@ndmspc/ndmvr-core 1.1.0-rc.9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/{RCanvasPainter-DQGWienR.js → RCanvasPainter-BN1wz_jA.js} +1 -1
- package/dist/assets/RNTuple-B19bW6t4.js +1 -0
- package/dist/assets/{RPavePainter-CQHUOnSn.js → RPavePainter-BOw0-OFU.js} +1 -1
- package/dist/assets/{RTreeMapPainter-B2r2zCJG.js → RTreeMapPainter-DNojexp9.js} +1 -1
- package/dist/assets/{TASImagePainter-DRdiRLt1.js → TASImagePainter-BNJ5OAGP.js} +1 -1
- package/dist/assets/{TAnnotation3DPainter-BCJen6cS.js → TAnnotation3DPainter-BCGBhq-q.js} +1 -1
- package/dist/assets/{TArrowPainter-Dspl2Ikh.js → TArrowPainter-C7a0r3SV.js} +1 -1
- package/dist/assets/{TBoxPainter-BQEN4gj8.js → TBoxPainter-Djh43LYY.js} +1 -1
- package/dist/assets/{TEfficiencyPainter-TxRejkVD.js → TEfficiencyPainter-dXd5DL3h.js} +1 -1
- package/dist/assets/{TF1Painter-BuwSTmhs.js → TF1Painter-DwE8KsBp.js} +1 -1
- package/dist/assets/{TF2Painter-BTh6LWBk.js → TF2Painter-SGNNKiK5.js} +1 -1
- package/dist/assets/{TF3Painter-R5EVXlD4.js → TF3Painter-yaRyTX9u.js} +1 -1
- package/dist/assets/{TGaxisPainter-BJuDLLel.js → TGaxisPainter-DSiIbikC.js} +1 -1
- package/dist/assets/{TGraph2DPainter-aeM0xqgu.js → TGraph2DPainter-COqZBIPT.js} +1 -1
- package/dist/assets/{TGraphPainter-DLkx_1ES.js → TGraphPainter-Bp7xEbQz.js} +1 -1
- package/dist/assets/{TGraphPainter-CtqNpDiH.js → TGraphPainter-CurXuifu.js} +1 -1
- package/dist/assets/{TGraphPolarPainter-bMuBuvEZ.js → TGraphPolarPainter-u-FCb_Gb.js} +1 -1
- package/dist/assets/{TGraphTimePainter-D_1RHDMz.js → TGraphTimePainter-DDPwiVGX.js} +1 -1
- package/dist/assets/{TH1Painter-CMr7gXzd.js → TH1Painter-BXzutgI3.js} +1 -1
- package/dist/assets/{TH1Painter--tuoUZTH.js → TH1Painter-DyN-WKyv.js} +1 -1
- package/dist/assets/{TH2Painter-DHaL_lR_.js → TH2Painter-BpixRP4j.js} +1 -1
- package/dist/assets/{TH2Painter-BLfyBVB5.js → TH2Painter-DceuYQAL.js} +1 -1
- package/dist/assets/{TH3Painter-DLCndhZ0.js → TH3Painter-BA_W8tmJ.js} +1 -1
- package/dist/assets/{THStackPainter-B3TUpsVt.js → THStackPainter-BWLN_w9A.js} +1 -1
- package/dist/assets/{THistPainter-Df-RmCQH.js → THistPainter-B2S5BnuY.js} +1 -1
- package/dist/assets/{TLinePainter-RinEQkrM.js → TLinePainter-D8inyuoX.js} +1 -1
- package/dist/assets/{TMultiGraphPainter-BQyL8zWX.js → TMultiGraphPainter-DcwdyhOr.js} +1 -1
- package/dist/assets/{TPavePainter-Dx40jhkF.js → TPavePainter-1yngbgp8.js} +1 -1
- package/dist/assets/{TPiePainter-BaTIH6-e.js → TPiePainter-BgDv4srX.js} +1 -1
- package/dist/assets/{TPolyLinePainter-7_jf8MLI.js → TPolyLinePainter-BYlrAjCB.js} +1 -1
- package/dist/assets/{TPolyMarker3D-DYlLB9Ww.js → TPolyMarker3D-BaWOSDy6.js} +1 -1
- package/dist/assets/{TRatioPlotPainter-BvUop_Na.js → TRatioPlotPainter-CJgkL58z.js} +1 -1
- package/dist/assets/{TScatterPainter-CvLCMGW2.js → TScatterPainter-Bt11j8z8.js} +1 -1
- package/dist/assets/{TSplinePainter-DJPtQW6I.js → TSplinePainter-p6k_OB02.js} +1 -1
- package/dist/assets/{TTextPainter-BwCh-g5B.js → TTextPainter-B26aOYGd.js} +1 -1
- package/dist/assets/{TTree-CE4EQRMu.js → TTree-BtFtnLeD.js} +1 -1
- package/dist/assets/{TWebPaintingPainter-CexNsDDp.js → TWebPaintingPainter-CZ6lo-7N.js} +1 -1
- package/dist/assets/{draw3d-BPJMZpwL.js → draw3d-ejHvJRmG.js} +1 -1
- package/dist/assets/{func-C1jNXIub.js → func-C6FX2eN2.js} +1 -1
- package/dist/assets/{hist3d-DCmav5Ga.js → hist3d-D9VevdP6.js} +1 -1
- package/dist/assets/{latex3d-ITrfFgp8.js → latex3d-8Hbnfz6c.js} +1 -1
- package/dist/assets/{main-CvPDcTGr.js → main-DwRPe_ox.js} +191 -191
- package/dist/assets/{more-CGvLPt4r.js → more-64laEJ4X.js} +1 -1
- package/dist/assets/{ndmvr-aframe-core-Cw91_9_Y.js → ndmvr-aframe-core-DEHQ38JB.js} +4 -4
- package/dist/assets/{rntuple-BCwqxNeP.js → rntuple-i8TaG-6V.js} +1 -1
- package/dist/assets/{stress-Ihg3ljmc.js → stress-KrXoDujC.js} +1 -1
- package/dist/assets/{v7more-H3D-KQGQ.js → v7more-C-UZAxz1.js} +1 -1
- package/dist/docs/components/configuration/configuration/index.html +243 -238
- package/dist/docs/components/tutorial/canvas/canvas/index.html +1 -1
- package/dist/docs/components/tutorial/configurationChapter/configuration-chapter/index.html +1 -1
- package/dist/docs/components/tutorial/firstVisualization/first-visualization/index.html +1 -1
- package/dist/docs/components/tutorial/interactions/interactions/index.html +1 -1
- package/dist/docs/downloads/canvas.zip +0 -0
- package/dist/docs/downloads/configuration.zip +0 -0
- package/dist/docs/downloads/first-visualization.zip +0 -0
- package/dist/docs/downloads/interactions.zip +0 -0
- package/dist/docs/index.html +1 -1
- package/dist/docs/search/search_index.json +1 -1
- package/dist/docs/sitemap.xml.gz +0 -0
- package/dist/index.es.js +962 -953
- package/dist/index.html +2 -2
- package/dist/index.umd.js +10 -10
- package/dist/stress.html +2 -2
- package/package.json +1 -1
- package/dist/assets/RNTuple-L4uyxl3s.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Addons-BBF-eVWZ.js","assets/three.module-C23jL5A5.js","assets/TTree-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Addons-BBF-eVWZ.js","assets/three.module-C23jL5A5.js","assets/TTree-BtFtnLeD.js","assets/TH1Painter-BXzutgI3.js","assets/hist3d-D9VevdP6.js","assets/latex3d-8Hbnfz6c.js","assets/THistPainter-B2S5BnuY.js","assets/TPavePainter-1yngbgp8.js","assets/TH2Painter-BpixRP4j.js","assets/TH1Painter-DyN-WKyv.js","assets/func-C6FX2eN2.js","assets/TH2Painter-DceuYQAL.js","assets/TH3Painter-BA_W8tmJ.js","assets/TGraphPainter-CurXuifu.js","assets/TGraphPainter-Bp7xEbQz.js","assets/TPolyMarker3D-BaWOSDy6.js","assets/TAnnotation3DPainter-BCGBhq-q.js","assets/TTextPainter-B26aOYGd.js","assets/THStackPainter-BWLN_w9A.js","assets/draw3d-ejHvJRmG.js","assets/TGraphTimePainter-DDPwiVGX.js","assets/TGraph2DPainter-COqZBIPT.js","assets/TGraphPolarPainter-u-FCb_Gb.js","assets/TEfficiencyPainter-dXd5DL3h.js","assets/TF1Painter-DwE8KsBp.js","assets/TScatterPainter-Bt11j8z8.js","assets/TRatioPlotPainter-CJgkL58z.js","assets/TLinePainter-D8inyuoX.js","assets/TMultiGraphPainter-DcwdyhOr.js","assets/TF2Painter-SGNNKiK5.js","assets/TF3Painter-yaRyTX9u.js","assets/TSplinePainter-p6k_OB02.js","assets/TPiePainter-BgDv4srX.js","assets/TArrowPainter-C7a0r3SV.js","assets/TGaxisPainter-DSiIbikC.js","assets/TASImagePainter-BNJ5OAGP.js","assets/RNTuple-B19bW6t4.js","assets/rntuple-i8TaG-6V.js","assets/v7more-C-UZAxz1.js","assets/RCanvasPainter-BN1wz_jA.js","assets/RPavePainter-BOw0-OFU.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function e(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=e(r);fetch(r.href,s)}})();const Q7="modulepreload",K7=function(n){return"/ndmvr-core/"+n},c3={},Qt=function(t,e,i){let r=Promise.resolve();if(e&&e.length>0){let h=function(l){return Promise.all(l.map(c=>Promise.resolve(c).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=a?.nonce||a?.getAttribute("nonce");r=h(e.map(l=>{if(l=K7(l),l in c3)return;c3[l]=!0;const c=l.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${f}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":Q7,c||(d.as="script"),d.crossOrigin="",d.href=l,o&&d.setAttribute("nonce",o),document.head.appendChild(d),c)return new Promise((u,p)=>{d.addEventListener("load",u),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return r.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return t().catch(s)})},O4="dev",B4="25/11/2025",lf=O4+" "+B4,ki=!!(typeof process=="object"&&process.versions?.node&&process.versions.v8),Kt={id_counter:1},Nh=import.meta?.url,f3="$jsrootsys";function se(n){return n&&typeof n=="object"}function lt(n){return typeof n=="function"}function Pt(n){return typeof n=="string"}function id(n){return se(n)&<(n.then)}function hf(n,t){return new Promise(e=>{setTimeout(()=>{const i=lt(n)?n():n;e(i)},t)})}function Go(n){return id(n)?n:Promise.resolve(n)}let li="";if(f3[0]!=="$")li=f3;else if(Nh&&Pt(Nh)){let n=Nh.indexOf("modules/core.mjs");n<0&&(n=Nh.indexOf("build/jsroot.js")),n<0&&(n=Nh.indexOf("build/jsroot.min.js")),n>=0?li=Nh.slice(0,n):Kt.ignore_v6=!0}ki||console.log(li?`Set jsroot source_dir to ${li}, ${lf}`:`jsroot bundle, ${lf}`);let z4=ki;function Ci(){return z4}function tP(n){z4=!!n}function Se(){return ki}const Vd=Se()?n=>Buffer.from(n,"base64").toString("latin1"):globalThis?.atob,Gd=Se()?n=>Buffer.from(n,"latin1").toString("base64"):globalThis?.btoa,ue={isFirefox:!0,isSafari:!1,isChrome:!1,isWin:!1,touches:!1,screenWidth:1200};typeof document<"u"&&typeof window<"u"&&typeof navigator<"u"&&(navigator.userAgentData?.brands?.forEach(n=>{n.brand==="HeadlessChrome"?(ue.isChromeHeadless=!0,ue.chromeVersion=parseInt(n.version)):n.brand==="Chromium"&&(ue.isChrome=!0,ue.chromeVersion=parseInt(n.version))}),ue.chromeVersion?(ue.isFirefox=!1,ue.isWin=navigator.userAgentData.platform==="Windows"):(ue.isFirefox=navigator.userAgent.indexOf("Firefox")>=0,ue.isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,ue.isChrome=!!window.chrome,ue.isChromeHeadless=navigator.userAgent.indexOf("HeadlessChrome")>=0,ue.chromeVersion=ue.isChrome||ue.isChromeHeadless?navigator.userAgent.indexOf("Chrom")>0?parseInt(navigator.userAgent.match(/Chrom(?:e|ium)\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/)[1]):134:0,ue.isWin=navigator.userAgent.indexOf("Windows")>=0),ue.android=/android/i.test(navigator.userAgent),ue.touches="ontouchend"in document,ue.screenWidth=window.screen?.width??1200);function Kl(n){if(n.length<14||n.indexOf("[object "))return 0;const t=n.indexOf("Array]");return t<0||t!==n.length-6?0:n.length===14?1:2}const Be={Render3D:{Default:0,WebGL:1,WebGLImage:2,SVG:3,None:4,fromString(n){return n==="webgl"||n==="gl"?this.WebGL:n==="img"?this.WebGLImage:n==="svg"?this.SVG:n==="none"?this.None:this.Default}},Embed3D:{NoEmbed:-1,Default:0,Overlay:1,Embed:2,EmbedSVG:3,fromString(n){return n==="embed"?this.Embed:n==="overlay"?this.Overlay:this.Default}},Latex:{Off:0,Symbols:1,Normal:2,MathJax:3,AlwaysMathJax:4,fromString(n){if(!n||!Pt(n))return this.Normal;switch(n){case"off":return this.Off;case"symbols":return this.Symbols;case"normal":case"latex":case"exp":case"experimental":return this.Normal;case"MathJax":case"mathjax":case"math":return this.MathJax;case"AlwaysMathJax":case"alwaysmath":case"alwaysmathjax":return this.AlwaysMathJax}const t=parseInt(n);return Number.isInteger(t)&&t>=this.Off&&t<=this.AlwaysMathJax?t:this.Normal}}},tt={Render3D:Be.Render3D.Default,Render3DBatch:Be.Render3D.Default,Embed3D:Be.Embed3D.Default,CanvasWidth:1200,CanvasHeight:800,CanvasScale:1,Tooltip:!ki,TooltipAnimation:500,ContextMenu:!ki,Zooming:!ki,ZoomMouse:!ki,ZoomWheel:!ki,ZoomTouch:!ki,MoveResize:!ue.touches&&!ki,HandleKeys:!ki,DragAndDrop:!ki,DragGraphs:!0,UserSelect:"none",ProgressBox:!ki,ToolBar:ki?!1:"popup",ToolBarSide:"left",ToolBarVert:!1,CanEnlarge:!0,CanAdjustFrame:!1,ApproxTextSize:!1,LoadSymbolTtf:!1,OptimizeDraw:1,AutoStat:!0,FrameNDC:{},SmallPad:{width:150,height:100},Palette:57,Latex:Be.Latex.Normal,GeoGradPerSegm:6,GeoCompressComp:!0,IgnoreUrlOptions:!1,HierarchyLimit:250,DislpayKind:"simple",BrowserWidth:250,XValuesFormat:void 0,YValuesFormat:void 0,ZValuesFormat:void 0,HandleWrongHttpResponse:!1,UseStamp:!ki,MaxRanges:200,TreeReadBunchSize:1e6,FilesTimeout:0,FilesRemap:{"https://root.cern/":"https://root-eos.web.cern.ch/"},WithCredentials:!1,SkipStreamerInfos:!1,OnlyLastCycle:!1,DarkMode:!1,PreferSavedPoints:!1,AxisTiltAngle:25,StripAxisLabels:!0,CutAxisLabels:!1,FuncAsCurve:!1,TimeZone:"",NewTabUrl:"",NewTabUrlPars:"",NewTabUrlExportSettings:!1,Debug:!1},K={fName:"Modern",fOptLogx:0,fOptLogy:0,fOptLogz:0,fOptDate:0,fOptFile:0,fDateX:.01,fDateY:.01,fOptTitle:1,fCanvasColor:0,fPadColor:0,fPadBottomMargin:.1,fPadTopMargin:.1,fPadLeftMargin:.1,fPadRightMargin:.1,fPadGridX:!1,fPadGridY:!1,fPadTickX:0,fPadTickY:0,fPadBorderSize:2,fPadBorderMode:0,fCanvasBorderSize:2,fCanvasBorderMode:0,fStatColor:0,fStatStyle:1e3,fStatTextColor:1,fStatFontSize:0,fStatFont:42,fStatBorderSize:1,fStatFormat:"6.4g",fStatX:.98,fStatY:.935,fStatW:.2,fStatH:.16,fTitleAlign:23,fTitleColor:0,fTitleTextColor:1,fTitleBorderSize:0,fTitleFont:42,fTitleFontSize:.05,fTitleStyle:0,fTitleX:.5,fTitleY:.995,fTitleW:0,fTitleH:0,fFitFormat:"5.4g",fOptStat:1111,fOptFit:0,fNumberContours:20,fGridColor:0,fGridStyle:3,fGridWidth:1,fFrameFillColor:0,fFrameFillStyle:1001,fFrameLineColor:1,fFrameLineWidth:1,fFrameLineStyle:1,fFrameBorderSize:1,fFrameBorderMode:0,fEndErrorSize:2,fErrorX:.5,fHistMinimumZero:!1,fHistTopMargin:.05,fHistFillColor:0,fHistFillStyle:1001,fHistLineColor:602,fHistLineStyle:1,fHistLineWidth:1,fPaintTextFormat:"g",fTimeOffset:788918400,fLegendBorderSize:1,fLegendFont:42,fLegendTextSize:0,fLegendFillColor:0,fLegendFillStyle:1001,fHatchesLineWidth:1,fHatchesSpacing:1,fCandleWhiskerRange:1,fCandleBoxRange:.5,fCandleScaled:!1,fViolinScaled:!0,fCandleCircleLineWidth:1,fCandleCrossLineWidth:1,fOrthoCamera:!1,fXAxisExpXOffset:0,fXAxisExpYOffset:0,fYAxisExpXOffset:0,fYAxisExpYOffset:0,fAxisMaxDigits:5,fStripDecimals:!0,fBarWidth:1,fBarOffset:0};function Zi(){if(ki)return Kt.nodejs_document;if(typeof document<"u")return document;if(typeof window=="object")return window.document}let cf=null;function Ne(n){return 1<<n}function Rm(n,t,e){if(!n)return null;if(!t)t={obj:[],clones:[],nofunc:e};else{const s=t.obj.indexOf(n);if(s>=0)return t.clones[s]}const i=Kl(Object.prototype.toString.apply(n));if(i===1){const s=[];t.obj.push(n),t.clones.push(s);for(let a=0;a<n.length;++a)s.push(se(n[a])?Rm(n[a],t):n[a]);return s}if(i===2){const s=[];t.obj.push(n),t.clones.push(s);for(let a=0;a<n.length;++a)s.push(n[a]);return s}const r={};t.obj.push(n),t.clones.push(r);for(const s in n)se(n[s])?r[s]=Rm(n[s],t):(!t.nofunc||!lt(n[s]))&&(r[s]=n[s]);return r}const Ae=Object.assign;let $d=null;function Tr(n){if(!n)return null;const t=Pt(n)?JSON.parse(n):n,e=[];let i;const r=s=>{if(s==null)return;if(Pt(s)){if(i||s.length<6||s.indexOf("$ref:"))return;const l=parseInt(s.slice(5));return!Number.isInteger(l)||l<0||l>=e.length?void 0:(i=!1,e[l])}if(typeof s!="object")return;const a=Object.prototype.toString.apply(s);if(Kl(a)>0){for(let l=0;l<s.length;++l){const c=r(s[l]);c!==void 0&&(s[l]=c)}return}const o=Object.keys(s),h=o.length;if(i!==!1&&h===1&&o[0]==="$ref"){const l=parseInt(s.$ref);return!Number.isInteger(l)||l<0||l>=e.length?void 0:(i=!0,e[l])}if(i!==!1&&h>1&&o[0]==="$arr"&&o[1]==="len"){let l;switch(s.$arr){case"Int8":l=new Int8Array(s.len);break;case"Uint8":l=new Uint8Array(s.len);break;case"Int16":l=new Int16Array(s.len);break;case"Uint16":l=new Uint16Array(s.len);break;case"Int32":l=new Int32Array(s.len);break;case"Uint32":l=new Uint32Array(s.len);break;case"Float32":l=new Float32Array(s.len);break;case"Int64":case"Uint64":case"Float64":l=new Float64Array(s.len);break;default:l=new Array(s.len)}if(l.fill(s.$arr==="Bool"?!1:0),s.b!==void 0){const c=Vd(s.b);if(l.buffer){const f=new DataView(l.buffer,s.o||0),d=Math.min(c.length,f.byteLength);for(let u=0;u<d;++u)f.setUint8(u,c.charCodeAt(u))}else throw new Error("base64 coding supported only for native arrays with binary data")}else{let c=2,f=0;for(;c<h;){if(o[c][0]==="p"&&(f=s[o[c++]]),o[c][0]!=="v")throw new Error(`Unexpected member ${o[c]} in array decoding`);const d=s[o[c++]];if(typeof d=="object")for(let u=0;u<d.length;++u)l[f++]=d[u];else if(l[f++]=d,c<h&&o[c][0]==="n"){let u=s[o[c++]];for(;--u;)l[f++]=d}}}return l}if(i!==!1&&h===3&&o[0]==="$pair"&&o[1]==="first"&&o[2]==="second"){i=!0;const l=r(s.first),c=r(s.second);l!==void 0&&(s.first=l),c!==void 0&&(s.second=c),s._typename=s.$pair,delete s.$pair;return}if(!(e.indexOf(s)>=0)){e.push(s),s._typename&&$d(s);for(let l=0;l<h;++l){const c=o[l],f=r(s[c]);f!==void 0&&(s[c]=f)}}};return r(t),t}function U4(n){if(!n)return null;const t=JSON.parse(n);if(t?.length)for(let e=0;e<t.length;++e)t[e]=Tr(t[e]);return t}function ba(n,t){if(!se(n))return"";const e=[],i=s=>{if(lt(s))return;if(s==null||!se(s))return s;if(Kl(Object.prototype.toString.apply(s))>0){const c=new Array(s.length);for(let f=0;f<s.length;++f)c[f]=i(s[f]);return c}const a=e.indexOf(s);if(a>=0)return{$ref:a};const o=Object.keys(s),h=o.length,l={};if(h===3&&o[0]==="$pair"&&o[1]==="first"&&o[2]==="second")return l.$pair=s.$pair,l.first=i(s.first),l.second=i(s.second),l;e.push(s);for(let c=0;c<h;++c){const f=o[c];f&&f[0]!=="$"&&(l[f]=i(s[f]))}return l},r=i(n);return JSON.stringify(r,null,t)}function Lu(n){const t={opts:{},has(i){return this.opts[i]!==void 0},get(i,r){return this.opts[i]??r}};if(!n||!Pt(n)){if(tt.IgnoreUrlOptions||typeof document>"u")return t;n=document.URL}t.url=n;const e=n.indexOf("?");if(e<0)return t;for(n=decodeURI(n.slice(e+1));n;){let i=0,r=0,s=-1,a=-1;for(;i<n.length&&(r||n[i]!=="&"&&n[i]!=="#");){switch(n[i]){case"'":r>=0&&(r=(r+1)%2),a<0&&(a=i);break;case'"':r<=0&&(r=(r-1)%2),a<0&&(a=i);break;case"=":a<0&&s<0&&(s=i);break}i++}if(s<0&&a<0)t.opts[n.slice(0,i)]="";else if(s>0){let o=n.slice(s+1,i);(o[0]==="'"||o[0]==='"')&&o.at(0)===o.at(-1)&&(o=o.slice(1,o.length-1)),t.opts[n.slice(0,s)]=o}if(i>=n.length||n[i]==="#")break;n=n.slice(i+1)}return t}function ts(n){if(lt(n))return n;if(!Pt(n))return null;const t=n.split(".");let e=globalThis;for(let i=0;e&&i<t.length;++i)e=e[t[i]];return lt(e)?e:null}function z1(n,t,e,i,r){function s(o){o.http_callback=lt(e)?e.bind(o):()=>{},o.error_callback=lt(i)?i.bind(o):(function(f){console.warn(f.message),this.http_callback(null)}).bind(o),t||(t="buf");let h="GET",l=!0;const c=t.indexOf(";sync");switch(c>0&&(t=t.slice(0,c),l=!1),t){case"head":h="HEAD";break;case"posttext":h="POST",t="text";break;case"postbuf":h="POST",t="buf";break;case"post":case"multi":h="POST";break}return o.kind=t,tt.WithCredentials&&(o.withCredentials=!0),tt.HandleWrongHttpResponse&&h==="GET"&<(o.addEventListener)&&o.addEventListener("progress",(function(f){f.lengthComputable&&this.expected_size&&f.loaded>this.expected_size&&(this.did_abort=!0,this.abort(),this.error_callback(Error(`Server sends more bytes ${f.loaded} than expected ${this.expected_size}. Abort I/O operation`),598))}).bind(o)),o.onreadystatechange=function(){if(!this.did_abort){if(this.readyState===2&&this.expected_size){const f=parseInt(this.getResponseHeader("Content-Length"));if(Number.isInteger(f)&&f>this.expected_size&&!tt.HandleWrongHttpResponse)return this.did_abort="large",this.abort(),this.error_callback(Error(`Server response size ${f} larger than expected ${this.expected_size}. Abort I/O operation`),599)}if(this.readyState===4){if(this.status!==200&&this.status!==206&&!ue.qt6&&!(this.status===0&&(n.indexOf("file://")===0||n.indexOf("blob:")===0)))return this.error_callback(Error(`Fail to load url ${n}`),this.status);if(this.nodejs_checkzip&&this.getResponseHeader("content-encoding")==="gzip")return Qt(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).then(f=>{const d=f.unzipSync(Buffer.from(this.response)),u=JSON.parse(d);return this.http_callback(Tr(u))});switch(this.kind){case"xml":return this.http_callback(this.responseXML);case"text":return this.http_callback(this.responseText);case"object":return this.http_callback(Tr(this.responseText));case"multi":return this.http_callback(U4(this.responseText));case"head":return this.http_callback(this)}if(this.responseType===void 0)return this.http_callback(this.responseText);if(this.kind==="bin"&&"byteLength"in this.response){const f=new Uint8Array(this.response);let d="";for(let u=0;u<f.length;++u)d+=String.fromCharCode(f[u]);return this.http_callback(d)}this.http_callback(this.response)}}},o.open(h,n,l),(t==="bin"||t==="buf")&&(o.responseType="arraybuffer"),ki&&h==="GET"&&t==="object"&&n.indexOf(".json.gz")>0&&(o.nodejs_checkzip=!0,o.responseType="arraybuffer"),o}if(Se()){if(!r)throw Error("Not allowed to create http requests in node.js without promise");return Qt(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).then(o=>s(new o.default))}const a=s(new XMLHttpRequest);return r?Promise.resolve(a):a}async function br(n,t,e){return new Promise((i,r)=>{z1(n,t,i,r,!0).then(s=>s.send(e||null))})}async function Dm(n){if(ki){let t,e;return Qt(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).then(i=>(t=i.tmpNameSync()+".js",Qt(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]))).then(i=>(e=i,e.writeFileSync(t,n),Qt(()=>import("file://"+t),[]))).finally(()=>e.unlinkSync(t))}if(typeof document<"u"){const t=document.getElementsByTagName("script");for(let a=0;a<t.length;++a)if(t[a].innerText===n)return!0;const e=n.indexOf("JSROOT.require")>=0,i=!e&&n.indexOf("import {")>0&&n.indexOf("} from '")>0,r=!e&&!i&&n.indexOf("JSROOT.ObjectPainter")>=0,s=e?cf():Promise.resolve(!0);return r&&!globalThis.JSROOT&&(globalThis.JSROOT=Kt.jsroot),s.then(()=>{const a=document.createElement("script");return a.setAttribute("type",i?"module":"text/javascript"),a.innerText=n,document.head.appendChild(a),Ci()?!0:hf(!0,10)})}return!1}async function Hd(n){return Pt(n)&&(n=n.split(";")),n.length?import(n.shift()).then(()=>Hd(n)):!0}async function Cr(n){if(!n)return!0;if(Pt(n)&&n.indexOf(";")>=0&&(n=n.split(";")),!Pt(n)){const r=n,s=()=>r.length?Cr(r.shift()).then(s,s):!0;return s()}n.indexOf("$$$")===0&&(n=n.slice(3),n.indexOf("style/")===0&&n.indexOf(".css")<0&&(n+=".css"),n=li+n);const t=n.indexOf(".css")>0;if(ki)return t?null:n.indexOf("http:")===0||n.indexOf("https:")===0?br(n,"text").then(r=>Dm(r)):n.indexOf("./")===0?Qt(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).then(r=>Dm(r.readFileSync(n))):import(n);const e=r=>{if(r===n)return!0;const s=r.indexOf(n);return s>0&&s+n.length===r.length&&r[s-1]==="/"};if(t){const r=document.getElementsByTagName("link");for(let s=0;s<r.length;++s)if(!(!r[s].href||r[s].type!=="text/css"||r[s].rel!=="stylesheet")&&e(r[s].href))return!0}else{const r=document.getElementsByTagName("script");for(let s=0;s<r.length;++s)if(e(r[s].src))return!0}let i;return t?(i=document.createElement("link"),i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href",n)):(i=document.createElement("script"),i.setAttribute("type","text/javascript"),i.setAttribute("src",n)),new Promise((r,s)=>{i.onload=()=>r(!0),i.onerror=()=>{i.remove(),s(Error(`Fail to load ${n}`))},document.head.appendChild(i)})}cf=async function(){return(globalThis.JSROOT?Promise.resolve(!0):Cr(li+"scripts/JSRoot.core.js")).then(()=>{if(globalThis.JSROOT?._complete_loading)return globalThis.JSROOT._complete_loading()}).then(()=>globalThis.JSROOT)};const Fm="ROOT.",Pe="TObject",ri="TNamed",nd="TString",ps="TObjString",U1="TKey",q1="TFile",zc="TTree",Re="TList",th="THashList",Wd="TMap",sr="TObjArray",rd="TClonesArray",fn="TAttLine",wr="TAttFill",ws="TAttMarker",ya="TAttText",jd="THStack",Ma="TGraph",Xd="TMultiGraph",I2="TCutG",q4="TGraph2DErrors",V4="TGraph2DAsymmErrors",G4="TGraphPolar",V1="TGraphPolargram",O2="TGraphTime",un="TPave",sd="TPaveText",G1="TPaveStats",$4="TPavesText",H4="TPaveLabel",W4="TPaveClass",j4="TDiamond",Rl="TLegend",B2="TLegendEntry",z2="TPaletteAxis",Cx="TImagePalette",Ta="TText",X4="TLink",Ff="TLatex",Y4="TMathText",Z4="TAnnotation",ph="TColor",Im="TLine",U2="TMarker",Uc="TBox",qc="TPolyLine",$1="TPolyLine3D",$o="TPolyMarker3D",u3="TAttPad",Pr="TPad",Dr="TCanvas",H1="TFrame",Om="TAttCanvas",ff="TGaxis",ad="TAttAxis",kr="TAxis",uf="TStyle",Co="TH1",J4="TH1I",eP="TH1F",Q4="TH1D",eh="TH2",K4="TH2I",tT="TH2F",iP="TH2D",ih="TH3",od="TF1",W1="TF12",j1="TF2",X1="TF3",q2="TProfile",V2="TProfile2D",G2="TProfile3D",Vi="TGeoVolume",Ra="TGeoNode",df="TGeoNodeMatrix",pf="ROOT::",Ti=pf+"Experimental::",lr="http://www.w3.org/2000/svg",ir=-1111,eT=Ne(9),Li="inspect",iT="title",ld="https://root.cern/doc/master/class";function Nt(n,t){const e=t||{};switch(n){case Pe:Ae(e,{fUniqueID:0,fBits:0});break;case ri:Ae(e,{fUniqueID:0,fBits:0,fName:"",fTitle:""});break;case Re:case th:Ae(e,{name:n,arr:[],opt:[]});break;case sr:Ae(e,{name:n,arr:[]});break;case ad:Ae(e,{fNdivisions:510,fAxisColor:1,fLabelColor:1,fLabelFont:42,fLabelOffset:.005,fLabelSize:.035,fTickLength:.03,fTitleOffset:1,fTitleSize:.035,fTitleColor:1,fTitleFont:42});break;case kr:Nt(ri,e),Nt(ad,e),Ae(e,{fNbins:1,fXmin:0,fXmax:1,fXbins:[],fFirst:0,fLast:0,fBits2:0,fTimeDisplay:!1,fTimeFormat:"",fLabels:null,fModLabs:null});break;case fn:Ae(e,{fLineColor:1,fLineStyle:1,fLineWidth:1});break;case wr:Ae(e,{fFillColor:0,fFillStyle:0});break;case ws:Ae(e,{fMarkerColor:1,fMarkerStyle:1,fMarkerSize:1});break;case Im:Nt(Pe,e),Nt(fn,e),Ae(e,{fX1:0,fX2:1,fY1:0,fY2:1});break;case U2:Nt(Pe,e),Nt(ws,e),Ae(e,{fX:0,fY:0});break;case Uc:Nt(Pe,e),Nt(fn,e),Nt(wr,e),Ae(e,{fX1:0,fX2:1,fY1:0,fY2:1});break;case un:Nt(Uc,e),Ae(e,{fX1NDC:0,fY1NDC:0,fX2NDC:0,fY2NDC:0,fBorderSize:0,fInit:1,fShadowColor:1,fCornerRadius:0,fOption:"brNDC",fName:""});break;case ya:Ae(e,{fTextAngle:0,fTextSize:0,fTextAlign:22,fTextColor:1,fTextFont:42});break;case sd:Nt(un,e),Nt(ya,e),Ae(e,{fLabel:"",fLongest:27,fMargin:.05,fLines:Nt(Re)});break;case G1:Nt(sd,e),Ae(e,{fFillColor:K.fStatColor,fFillStyle:K.fStatStyle,fTextFont:K.fStatFont,fTextSize:K.fStatFontSize,fTextColor:K.fStatTextColor,fBorderSize:K.fStatBorderSize,fOptFit:K.fOptFit,fOptStat:K.fOptStat,fFitFormat:K.fFitFormat,fStatFormat:K.fStatFormat,fParent:null});break;case Rl:Nt(un,e),Nt(ya,e),Ae(e,{fColumnSeparation:0,fEntrySeparation:.1,fMargin:.25,fNColumns:1,fPrimitives:Nt(Re),fName:un,fBorderSize:K.fLegendBorderSize,fTextFont:K.fLegendFont,fTextSize:K.fLegendTextSize,fFillColor:K.fLegendFillColor,fFillStyle:K.fLegendFillStyle});break;case z2:Nt(un,e),Ae(e,{fAxis:Nt(ff),fH:null,fName:un});break;case B2:Nt(Pe,e),Nt(ya,e),Nt(fn,e),Nt(wr,e),Nt(ws,e),Ae(e,{fLabel:"",fObject:null,fOption:"",fTextAlign:0,fTextColor:0,fTextFont:0});break;case Ta:Nt(ri,e),Nt(ya,e),Ae(e,{fX:0,fY:0});break;case Ff:Nt(Ta,e),Nt(fn,e),Ae(e,{fLimitFactorSize:3,fOriginSize:.04});break;case ps:Nt(Pe,e),Ae(e,{fString:""});break;case Co:Nt(ri,e),Nt(fn,e),Nt(wr,e),Nt(ws,e),Ae(e,{fBits:8,fNcells:0,fXaxis:Nt(kr),fYaxis:Nt(kr),fZaxis:Nt(kr),fFillColor:K.fHistFillColor,fFillStyle:K.fHistFillStyle,fLineColor:K.fHistLineColor,fLineStyle:K.fHistLineStyle,fLineWidth:K.fHistLineWidth,fBarOffset:0,fBarWidth:1e3,fEntries:0,fTsumw:0,fTsumw2:0,fTsumwx:0,fTsumwx2:0,fMaximum:ir,fMinimum:ir,fNormFactor:0,fContour:[],fSumw2:[],fOption:"",fFunctions:Nt(Re),fBufferSize:0,fBuffer:[],fBinStatErrOpt:0,fStatOverflows:2});break;case J4:case Q4:case"TH1L64":case"TH1F":case"TH1S":case"TH1C":Nt(Co,e),e.fArray=[];break;case eh:Nt(Co,e),Ae(e,{fScalefactor:1,fTsumwy:0,fTsumwy2:0,fTsumwxy:0});break;case K4:case"TH2L64":case tT:case"TH2D":case"TH2S":case"TH2C":Nt(eh,e),e.fArray=[];break;case ih:Nt(Co,e),Ae(e,{fTsumwy:0,fTsumwy2:0,fTsumwz:0,fTsumwz2:0,fTsumwxy:0,fTsumwxz:0,fTsumwyz:0});break;case"TH3I":case"TH3L64":case"TH3F":case"TH3D":case"TH3S":case"TH3C":Nt(ih,e),e.fArray=[];break;case jd:Nt(ri,e),Ae(e,{fHists:Nt(Re),fHistogram:null,fMaximum:ir,fMinimum:ir});break;case Ma:Nt(ri,e),Nt(fn,e),Nt(wr,e),Nt(ws,e),Ae(e,{fFunctions:Nt(Re),fHistogram:null,fMaxSize:0,fMaximum:ir,fMinimum:ir,fNpoints:0,fX:[],fY:[]});break;case"TGraphAsymmErrors":Nt(Ma,e),Ae(e,{fEXlow:[],fEXhigh:[],fEYlow:[],fEYhigh:[]});break;case Xd:Nt(ri,e),Ae(e,{fFunctions:Nt(Re),fGraphs:Nt(Re),fHistogram:null,fMaximum:ir,fMinimum:ir});break;case V1:Nt(ri,e),Nt(ya,e),Nt(fn,e),Ae(e,{fRadian:!1,fDegree:!1,fGrad:!1,fPolarLabelColor:1,fRadialLabelColor:1,fAxisAngle:0,fPolarOffset:.04,fPolarTextSize:.04,fRadialOffset:.025,fRadialTextSize:.035,fRwrmin:0,fRwrmax:1,fRwtmin:0,fRwtmax:2*Math.PI,fTickpolarSize:.02,fPolarLabelFont:62,fRadialLabelFont:62,fCutRadial:0,fNdivRad:508,fNdivPol:508});break;case qc:Nt(Pe,e),Nt(fn,e),Nt(wr,e),Ae(e,{fLastPoint:-1,fN:0,fOption:"",fX:null,fY:null});break;case ff:Nt(Im,e),Nt(ya,e),Ae(e,{fChopt:"",fFunctionName:"",fGridLength:0,fLabelColor:1,fLabelFont:42,fLabelOffset:.005,fLabelSize:.035,fName:"",fNdiv:12,fTickSize:.02,fTimeFormat:"",fTitle:"",fTitleOffset:1,fTitleSize:.035,fWmax:100,fWmin:0});break;case u3:Ae(e,{fLeftMargin:K.fPadLeftMargin,fRightMargin:K.fPadRightMargin,fBottomMargin:K.fPadBottomMargin,fTopMargin:K.fPadTopMargin,fXfile:2,fYfile:2,fAfile:1,fXstat:.99,fYstat:.99,fAstat:2,fFrameFillColor:K.fFrameFillColor,fFrameFillStyle:K.fFrameFillStyle,fFrameLineColor:K.fFrameLineColor,fFrameLineWidth:K.fFrameLineWidth,fFrameLineStyle:K.fFrameLineStyle,fFrameBorderSize:K.fFrameBorderSize,fFrameBorderMode:K.fFrameBorderMode});break;case Pr:Nt(Pe,e),Nt(fn,e),Nt(wr,e),Nt(u3,e),Ae(e,{fFillColor:K.fPadColor,fFillStyle:1001,fX1:0,fY1:0,fX2:1,fY2:1,fXtoAbsPixelk:1,fXtoPixelk:1,fXtoPixel:1,fYtoAbsPixelk:1,fYtoPixelk:1,fYtoPixel:1,fUtoAbsPixelk:1,fUtoPixelk:1,fUtoPixel:1,fVtoAbsPixelk:1,fVtoPixelk:1,fVtoPixel:1,fAbsPixeltoXk:1,fPixeltoXk:1,fPixeltoX:1,fAbsPixeltoYk:1,fPixeltoYk:1,fPixeltoY:1,fXlowNDC:0,fYlowNDC:0,fXUpNDC:0,fYUpNDC:0,fWNDC:1,fHNDC:1,fAbsXlowNDC:0,fAbsYlowNDC:0,fAbsWNDC:1,fAbsHNDC:1,fUxmin:0,fUymin:0,fUxmax:0,fUymax:0,fTheta:30,fPhi:30,fAspectRatio:0,fNumber:0,fLogx:K.fOptLogx,fLogy:K.fOptLogy,fLogz:K.fOptLogz,fTickx:K.fPadTickX,fTicky:K.fPadTickY,fPadPaint:0,fCrosshair:0,fCrosshairPos:0,fBorderSize:K.fPadBorderSize,fBorderMode:K.fPadBorderMode,fModified:!1,fGridx:K.fPadGridX,fGridy:K.fPadGridY,fAbsCoord:!1,fEditable:!0,fFixedAspectRatio:!1,fPrimitives:Nt(Re),fExecs:null,fName:"pad",fTitle:"canvas"});break;case Om:Ae(e,{fXBetween:2,fYBetween:2,fTitleFromTop:1.2,fXdate:.2,fYdate:.3,fAdate:1});break;case Dr:Nt(Pr,e),Ae(e,{fFillColor:K.fCanvasColor,fFillStyle:1001,fNumPaletteColor:0,fNextPaletteColor:0,fDISPLAY:"$DISPLAY",fDoubleBuffer:0,fRetained:!0,fXsizeUser:0,fYsizeUser:0,fXsizeReal:20,fYsizeReal:10,fWindowTopX:0,fWindowTopY:0,fWindowWidth:0,fWindowHeight:0,fBorderSize:K.fCanvasBorderSize,fBorderMode:K.fCanvasBorderMode,fCw:tt.CanvasWidth,fCh:tt.CanvasHeight,fCatt:Nt(Om),kMoveOpaque:!0,kResizeOpaque:!0,fHighLightColor:5,fBatch:!0,kShowEventStatus:!1,kAutoExec:!0,kMenuBar:!0});break;case Vi:Nt(ri,e),Nt(fn,e),Nt(wr,e),Ae(e,{fGeoAtt:0,fFinder:null,fMedium:null,fNodes:null,fNtotal:0,fNumber:0,fRefCount:0,fShape:null,fVoxels:null});break;case Ra:Nt(ri,e),Ae(e,{fGeoAtt:0,fMother:null,fNovlp:0,fNumber:0,fOverlaps:null,fVolume:null});break;case df:Nt(Ra,e),Ae(e,{fMatrix:null});break;case"TGeoTrack":Nt(Pe,e),Nt(fn,e),Nt(ws,e),Ae(e,{fGeoAtt:0,fNpoints:0,fPoints:[]});break;case $1:Nt(Pe,e),Nt(fn,e),Ae(e,{fLastPoint:-1,fN:0,fOption:"",fP:[]});break;case $o:Nt(Pe,e),Nt(ws,e),Ae(e,{fLastPoint:-1,fN:0,fName:"",fOption:"",fP:[]});break}return e._typename=n,$d(e,n),e}function om(n,t,e,i){const r=Nt(n);if(!r.fXaxis||!r.fYaxis||!r.fZaxis)return null;switch(r.fName="hist",r.fTitle="title",t&&Ae(r.fXaxis,{fNbins:t,fXmin:0,fXmax:t}),e&&Ae(r.fYaxis,{fNbins:e,fXmin:0,fXmax:e}),i&&Ae(r.fZaxis,{fNbins:i,fXmin:0,fXmax:i}),parseInt(n[2])){case 1:t&&(r.fNcells=t+2);break;case 2:t&&e&&(r.fNcells=(t+2)*(e+2));break;case 3:t&&e&&i&&(r.fNcells=(t+2)*(e+2)*(i+2));break}if(r.fNcells>0){switch(n[3]){case"C":r.fArray=new Int8Array(r.fNcells);break;case"S":r.fArray=new Int16Array(r.fNcells);break;case"I":r.fArray=new Int32Array(r.fNcells);break;case"F":r.fArray=new Float32Array(r.fNcells);break;case"L":case"D":r.fArray=new Float64Array(r.fNcells);break;default:r.fArray=new Array(r.fNcells)}r.fArray.fill(0)}return r}function nP(n,t){if(!(!n||!Pt(t)))if(t.indexOf(";")<0)n.fTitle=t;else{const e=t.split(";");n.fTitle=e[0],e.length>1&&(n.fXaxis.fTitle=e[1]),e.length>2&&(n.fYaxis.fTitle=e[2]),e.length>3&&(n.fZaxis.fTitle=e[3])}}function rP(n,t){const e=Nt(qc);return n&&(e.fN=n,t?(e.fX=new Int32Array(n),e.fY=new Int32Array(n)):(e.fX=new Float32Array(n),e.fY=new Float32Array(n))),e}function Px(n,t,e){const i=Ae(Nt(Ma),{fBits:1032,fName:"graph",fTitle:"title"});if(n>0){i.fMaxSize=i.fNpoints=n;const r=se(t)&&t.length===n,s=se(e)&&e.length===n;for(let a=0;a<n;++a)i.fX.push(r?t[a]:a/n),i.fY.push(s?e[a]:a/n)}return i}function sP(...n){const t=Nt(jd);for(let e=0;e<n.length;++e)t.fHists.Add(n[e],"");return t}function aP(...n){const t=Nt(Xd);for(let e=0;e<n.length;++e)t.fGraphs.Add(n[e],"");return t}const kx={};function Yd(n,t){let e=kx[n];const i=e!==void 0;return i||(e={}),(n===Pe||n===ri||t?.fBits!==void 0)&&typeof e.TestBit>"u"&&(e.TestBit=function(r){return!!(this.fBits&r)},e.InvertBit=function(r){this.fBits^=r&16777215},e.SetBit=function(r,s=!0){this.fBits=s?this.fBits|r:this.fBits&~r}),i||((n===Re||n===th)&&(e.Clear=function(){this.arr=[],this.opt=[]},e.Add=function(r,s){this.arr.push(r),this.opt.push(Pt(s)?s:"")},e.AddFirst=function(r,s){this.arr.unshift(r),this.opt.unshift(Pt(s)?s:"")},e.RemoveAt=function(r){this.arr.splice(r,1),this.opt.splice(r,1)}),(n===sd||n===G1)&&(e.AddText=function(r){const s=Nt(Ff);s.fTitle=r,s.fTextAlign=0,s.fTextColor=0,s.fTextFont=0,s.fTextSize=0,this.fLines.Add(s)},e.Clear=function(){this.fLines.Clear()}),(n.indexOf(od)===0||n===W1||n===j1||n===X1)&&(e.addFormula=function(r){r&&(this.formulas===void 0&&(this.formulas=[]),this.formulas.push(r))},e.GetParName=function(r){if(this.fParams?.fParNames)return this.fParams.fParNames[r];if(this.fFormula?.fParams){for(let s=0,a=this.fFormula.fParams;s<a.length;++s)if(a[s].second===r)return a[s].first}return this.fNames&&this.fNames[r]?this.fNames[r]:`p${r}`},e.GetParValue=function(r){return this.fParams?.fParameters?this.fParams.fParameters[r]:this.fFormula?.fClingParameters?this.fFormula.fClingParameters[r]:this.fParams?this.fParams[r]:void 0},e.GetParError=function(r){return this.fParErrors?this.fParErrors[r]:void 0},e.GetNumPars=function(){return this.fNpar}),(n.indexOf(Ma)===0||n===I2)&&n!==V1&&n!==O2&&(e.IsInside=function(r,s){const a=this.fX,o=this.fY;let h=0,l=this.fNpoints-1,c=!1;for(;h<this.fNpoints;++h)(o[h]<s&&o[l]>=s||o[l]<s&&o[h]>=s)&&a[h]+(s-o[h])/(o[l]-o[h])*(a[l]-a[h])<r&&(c=!c),l=h;return c}),(n.indexOf(Co)===0||n.indexOf(eh)===0||n.indexOf(ih)===0)&&(e.getBinError=function(r){return r>=this.fNcells&&(r=this.fNcells-1),r<0&&(r=0),r<this.fSumw2.length?Math.sqrt(this.fSumw2[r]):Math.sqrt(Math.abs(this.fArray[r]))},e.setBinContent=function(r,s){this.fEntries++,this.fTsumw=0,r>=0&&r<this.fArray.length&&(this.fArray[r]=s)}),n.indexOf(Co)===0&&(e.getBin=function(r){return r},e.getBinContent=function(r){return this.fArray[r]},e.Fill=function(r,s){const a=this.fXaxis,o=Math.max(0,1+Math.min(a.fNbins,Math.floor((r-a.fXmin)/(a.fXmax-a.fXmin)*a.fNbins)));this.fArray[o]+=s??1,this.fEntries++}),n.indexOf(eh)===0&&(e.getBin=function(r,s){return r+(this.fXaxis.fNbins+2)*s},e.getBinContent=function(r,s){return this.fArray[this.getBin(r,s)]},e.Fill=function(r,s,a){const o=this.fXaxis,h=this.fYaxis,l=Math.max(0,1+Math.min(o.fNbins,Math.floor((r-o.fXmin)/(o.fXmax-o.fXmin)*o.fNbins))),c=Math.max(0,1+Math.min(h.fNbins,Math.floor((s-h.fXmin)/(h.fXmax-h.fXmin)*h.fNbins)));this.fArray[l+(o.fNbins+2)*c]+=a??1,this.fEntries++}),n.indexOf(ih)===0&&(e.getBin=function(r,s,a){return r+(this.fXaxis.fNbins+2)*(s+(this.fYaxis.fNbins+2)*a)},e.getBinContent=function(r,s,a){return this.fArray[this.getBin(r,s,a)]},e.Fill=function(r,s,a,o){const h=this.fXaxis,l=this.fYaxis,c=this.fZaxis,f=Math.max(0,1+Math.min(h.fNbins,Math.floor((r-h.fXmin)/(h.fXmax-h.fXmin)*h.fNbins))),d=Math.max(0,1+Math.min(l.fNbins,Math.floor((s-l.fXmin)/(l.fXmax-l.fXmin)*l.fNbins))),u=Math.max(0,1+Math.min(c.fNbins,Math.floor((a-c.fXmin)/(c.fXmax-c.fXmin)*c.fNbins)));this.fArray[f+(h.fNbins+2)*(d+(l.fNbins+2)*u)]+=o??1,this.fEntries++}),(n===Pr||n===Dr)&&(e.Divide=function(r,s,a=.01,o=.01,h=0){if(!s){const d=r;if(d<2)return this;r=s=Math.round(Math.sqrt(d)),r*s<d&&(r+=1)}if(r*s<2)return 0;this.fPrimitives.Clear();const l=1/s,c=1/r;let f=0;for(let d=0;d<s;d++){const u=1-d*l-o,p=Math.max(0,u-l+2*o);if(!(p>u))for(let m=0;m<r;m++){const g=m*c+a,y=g+c-2*a;if(g>y)continue;f++;const A=Nt(Pr);A.fName=A.fTitle=`${this.fName}_${f}`,A.fNumber=f,this._typename!==Dr?(A.fAbsWNDC=(y-g)*this.fAbsWNDC,A.fAbsHNDC=(u-p)*this.fAbsHNDC,A.fAbsXlowNDC=this.fAbsXlowNDC+g*this.fAbsWNDC,A.fAbsYlowNDC=this.fAbsYlowNDC+p*this.fAbsHNDC):(A.fAbsWNDC=y-g,A.fAbsHNDC=u-p,A.fAbsXlowNDC=g,A.fAbsYlowNDC=p),A.fFillColor=h||this.fFillColor,this.fPrimitives.Add(A)}}return r*s},e.GetPad=function(r){return this.fPrimitives.arr.find(s=>s._typename===Pr&&s.fNumber===r)}),n.indexOf(q2)===0&&(n===G2?(e.getBin=function(r,s,a){return r+(this.fXaxis.fNbins+2)*(s+(this.fYaxis.fNbins+2)*a)},e.getBinContent=function(r,s,a){const o=this.getBin(r,s,a);return o<0||o>=this.fNcells||this.fBinEntries[o]<1e-300?0:this.fArray?this.fArray[o]/this.fBinEntries[o]:0},e.getBinEntries=function(r,s,a){const o=this.getBin(r,s,a);return o<0||o>=this.fNcells?0:this.fBinEntries[o]}):n===V2?(e.getBin=function(r,s){return r+(this.fXaxis.fNbins+2)*s},e.getBinContent=function(r,s){const a=this.getBin(r,s);return a<0||a>=this.fNcells||this.fBinEntries[a]<1e-300?0:this.fArray?this.fArray[a]/this.fBinEntries[a]:0},e.getBinEntries=function(r,s){const a=this.getBin(r,s);return a<0||a>=this.fNcells?0:this.fBinEntries[a]}):(e.getBin=function(r){return r},e.getBinContent=function(r){return r<0||r>=this.fNcells||this.fBinEntries[r]<1e-300?0:this.fArray?this.fArray[r]/this.fBinEntries[r]:0},e.getBinEntries=function(r){return r<0||r>=this.fNcells?0:this.fBinEntries[r]}),e.getBinEffectiveEntries=function(r){if(r<0||r>=this.fNcells)return 0;const s=this.fBinEntries[r];if(!this.fBinSumw2||this.fBinSumw2.length!==this.fNcells)return s;const a=this.fBinSumw2[r];return a>0?s*s/a:0},e.getBinError=function(r){if(r<0||r>=this.fNcells)return 0;const s=this.fArray[r],a=this.fBinEntries[r],o=this.fSumw2[r],h=this.getBinEffectiveEntries(r);if(a<1e-300)return 0;const l={kERRORSPREAD:1,kERRORSPREADI:2,kERRORSPREADG:3};if(this.fErrorMode===l.kERRORSPREADG)return 1/Math.sqrt(a);const c=s/a,f=Math.sqrt(Math.abs(o/a-c**2));return this.fErrorMode===l.kERRORSPREADI?f?f/Math.sqrt(h):1/Math.sqrt(12*h):this.fErrorMode===l.kERRORSPREAD?f:f/Math.sqrt(h)}),n===kr&&(e.GetBinLowEdge=function(r){return this.fNbins<=0?0:this.fXbins.length?r>0&&r<=this.fNbins+1?this.fXbins[r-1]:r===0?2*this.fXbins[0]-this.fXbins[1]:r===this.fNbins+2?2*this.fXbins[r-2]-this.fXbins[r-3]:0:this.fXmin+(r-1)*(this.fXmax-this.fXmin)/this.fNbins},e.GetBinCenter=function(r){return this.fNbins<=0?0:this.fXbins.length?r>0&&r<=this.fNbins?(this.fXbins[r-1]+this.fXbins[r])/2:r===0?1.5*this.fXbins[0]-.5*this.fXbins[1]:r===this.fNbins+1?1.5*this.fXbins[r-1]-.5*this.fXbins[r-2]:0:this.fXmin+(r-.5)*(this.fXmax-this.fXmin)/this.fNbins}),n.indexOf(pf+"Math::LorentzVector")===0&&(e.Px=e.X=function(){return this.fCoordinates.Px()},e.Py=e.Y=function(){return this.fCoordinates.Py()},e.Pz=e.Z=function(){return this.fCoordinates.Pz()},e.E=e.T=function(){return this.fCoordinates.E()},e.M2=function(){return this.fCoordinates.M2()},e.M=function(){return this.fCoordinates.M()},e.R=e.P=function(){return this.fCoordinates.R()},e.P2=function(){return this.P()*this.P()},e.Pt=e.pt=function(){return Math.sqrt(this.P2())},e.Phi=e.phi=function(){return Math.atan2(this.fCoordinates.Py(),this.fCoordinates.Px())},e.Eta=e.eta=function(){return Math.atanh(this.Pz()/this.P())}),n.indexOf(pf+"Math::PxPyPzE4D")===0&&(e.Px=e.X=function(){return this.fX},e.Py=e.Y=function(){return this.fY},e.Pz=e.Z=function(){return this.fZ},e.E=e.T=function(){return this.fT},e.P2=function(){return this.fX**2+this.fY**2+this.fZ**2},e.R=e.P=function(){return Math.sqrt(this.P2())},e.Mag2=e.M2=function(){return this.fT**2-this.fX**2-this.fY**2-this.fZ**2},e.Mag=e.M=function(){return this.M2()>=0?Math.sqrt(this.M2()):-Math.sqrt(-this.M2())},e.Perp2=e.Pt2=function(){return this.fX**2+this.fY**2},e.Pt=e.pt=function(){return Math.sqrt(this.P2())},e.Phi=e.phi=function(){return Math.atan2(this.fY,this.fX)},e.Eta=e.eta=function(){return Math.atanh(this.Pz/this.P())}),kx[n]=e),e}$d=function(n,t){Ae(n,Yd(t||n._typename,n))};K.fXaxis=Nt(ad);K.fYaxis=Nt(ad);K.fZaxis=Nt(ad);function oP(n,t){kx[n]=t}function mh(n,t){if(se(n)){if(n.$kind===Re||n.$kind===sr)return!0;t||(t=n._typename)}return t===Re||t===th||t===Wd||t===sr||t===rd}function Ee(n){return!Pt(n)||n.indexOf(pf)!==0?Fm+n:n}function Aa(n){return Pt(n)?n.indexOf(Fm)===0?n.slice(Fm.length):n.indexOf(pf)===0?n:null:null}Kt.jsroot={version:lf,source_dir:li,settings:tt,gStyle:K,parse:Tr,isBatchMode:Ci};const lP=Object.freeze(Object.defineProperty({__proto__:null,BIT:Ne,get _ensureJSROOT(){return cf},get addMethods(){return $d},atob_func:Vd,browser:ue,btoa_func:Gd,clTAnnotation:Z4,clTAttCanvas:Om,clTAttFill:wr,clTAttLine:fn,clTAttMarker:ws,clTAttText:ya,clTAxis:kr,clTBox:Uc,clTCanvas:Dr,clTClonesArray:rd,clTColor:ph,clTCutG:I2,clTDiamond:j4,clTF1:od,clTF12:W1,clTF2:j1,clTF3:X1,clTFile:q1,clTFrame:H1,clTGaxis:ff,clTGeoNode:Ra,clTGeoNodeMatrix:df,clTGeoVolume:Vi,clTGraph:Ma,clTGraph2DAsymmErrors:V4,clTGraph2DErrors:q4,clTGraphPolar:G4,clTGraphPolargram:V1,clTGraphTime:O2,clTH1:Co,clTH1D:Q4,clTH1F:eP,clTH1I:J4,clTH2:eh,clTH2D:iP,clTH2F:tT,clTH2I:K4,clTH3:ih,clTHStack:jd,clTHashList:th,clTImagePalette:Cx,clTKey:U1,clTLatex:Ff,clTLegend:Rl,clTLegendEntry:B2,clTLine:Im,clTLink:X4,clTList:Re,clTMap:Wd,clTMarker:U2,clTMathText:Y4,clTMultiGraph:Xd,clTNamed:ri,clTObjArray:sr,clTObjString:ps,clTObject:Pe,clTPad:Pr,clTPaletteAxis:z2,clTPave:un,clTPaveClass:W4,clTPaveLabel:H4,clTPaveStats:G1,clTPaveText:sd,clTPavesText:$4,clTPolyLine:qc,clTPolyLine3D:$1,clTPolyMarker3D:$o,clTProfile:q2,clTProfile2D:V2,clTProfile3D:G2,clTString:nd,clTStyle:uf,clTText:Ta,clTTree:zc,clone:Rm,constants:Be,create:Nt,createHistogram:om,createHttpRequest:z1,createTGraph:Px,createTHStack:sP,createTMultiGraph:aP,createTPolyLine:rP,decodeUrl:Lu,findFunction:ts,gStyle:K,getDocument:Zi,getKindForType:Ee,getMethods:Yd,getPromise:Go,getTypeForKind:Aa,httpRequest:br,injectCode:Dm,internals:Kt,isArrayProto:Kl,isBatchMode:Ci,isFunc:lt,isNodeJs:Se,isObject:se,isPromise:id,isRootCollection:mh,isStr:Pt,kInspect:Li,kNoStats:eT,kNoZoom:ir,kTitle:iT,loadModules:Hd,loadScript:Cr,nsREX:Ti,nsROOT:pf,nsSVG:lr,parse:Tr,parseMulti:U4,postponePromise:hf,prROOT:Fm,registerMethods:oP,setBatchMode:tP,setHistogramTitle:nP,settings:tt,get source_dir(){return li},toJSON:ba,urlClassPrefix:ld,version:lf,version_date:B4,version_id:O4},Symbol.toStringTag,{value:"Module"}));function If(n,t,e){n.prototype=t.prototype=e,e.constructor=n}function Zd(n,t){var e=Object.create(n.prototype);for(var i in t)e[i]=t[i];return e}function Zo(){}var nh=.7,mf=1/nh,Vc="\\s*([+-]?\\d+)\\s*",hd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hP=/^#([0-9a-f]{3,8})$/,cP=new RegExp(`^rgb\\(${Vc},${Vc},${Vc}\\)$`),fP=new RegExp(`^rgb\\(${Rs},${Rs},${Rs}\\)$`),uP=new RegExp(`^rgba\\(${Vc},${Vc},${Vc},${hd}\\)$`),dP=new RegExp(`^rgba\\(${Rs},${Rs},${Rs},${hd}\\)$`),pP=new RegExp(`^hsl\\(${hd},${Rs},${Rs}\\)$`),mP=new RegExp(`^hsla\\(${hd},${Rs},${Rs},${hd}\\)$`),d3={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};If(Zo,Pn,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:p3,formatHex:p3,formatHex8:gP,formatHsl:yP,formatRgb:m3,toString:m3});function p3(){return this.rgb().formatHex()}function gP(){return this.rgb().formatHex8()}function yP(){return nT(this).formatHsl()}function m3(){return this.rgb().formatRgb()}function Pn(n){var t,e;return n=(n+"").trim().toLowerCase(),(t=hP.exec(n))?(e=t[1].length,t=parseInt(t[1],16),e===6?g3(t):e===3?new Gi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?k0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?k0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=cP.exec(n))?new Gi(t[1],t[2],t[3],1):(t=fP.exec(n))?new Gi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=uP.exec(n))?k0(t[1],t[2],t[3],t[4]):(t=dP.exec(n))?k0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pP.exec(n))?x3(t[1],t[2]/100,t[3]/100,1):(t=mP.exec(n))?x3(t[1],t[2]/100,t[3]/100,t[4]):d3.hasOwnProperty(n)?g3(d3[n]):n==="transparent"?new Gi(NaN,NaN,NaN,0):null}function g3(n){return new Gi(n>>16&255,n>>8&255,n&255,1)}function k0(n,t,e,i){return i<=0&&(n=t=e=NaN),new Gi(n,t,e,i)}function $2(n){return n instanceof Zo||(n=Pn(n)),n?(n=n.rgb(),new Gi(n.r,n.g,n.b,n.opacity)):new Gi}function zs(n,t,e,i){return arguments.length===1?$2(n):new Gi(n,t,e,i??1)}function Gi(n,t,e,i){this.r=+n,this.g=+t,this.b=+e,this.opacity=+i}If(Gi,zs,Zd(Zo,{brighter(n){return n=n==null?mf:Math.pow(mf,n),new Gi(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?nh:Math.pow(nh,n),new Gi(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Gi(Vl(this.r),Vl(this.g),Vl(this.b),Bm(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:y3,formatHex:y3,formatHex8:AP,formatRgb:A3,toString:A3}));function y3(){return`#${Dl(this.r)}${Dl(this.g)}${Dl(this.b)}`}function AP(){return`#${Dl(this.r)}${Dl(this.g)}${Dl(this.b)}${Dl((isNaN(this.opacity)?1:this.opacity)*255)}`}function A3(){const n=Bm(this.opacity);return`${n===1?"rgb(":"rgba("}${Vl(this.r)}, ${Vl(this.g)}, ${Vl(this.b)}${n===1?")":`, ${n})`}`}function Bm(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Vl(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Dl(n){return n=Vl(n),(n<16?"0":"")+n.toString(16)}function x3(n,t,e,i){return i<=0?n=t=e=NaN:e<=0||e>=1?n=t=NaN:t<=0&&(n=NaN),new rs(n,t,e,i)}function nT(n){if(n instanceof rs)return new rs(n.h,n.s,n.l,n.opacity);if(n instanceof Zo||(n=Pn(n)),!n)return new rs;if(n instanceof rs)return n;n=n.rgb();var t=n.r/255,e=n.g/255,i=n.b/255,r=Math.min(t,e,i),s=Math.max(t,e,i),a=NaN,o=s-r,h=(s+r)/2;return o?(t===s?a=(e-i)/o+(e<i)*6:e===s?a=(i-t)/o+2:a=(t-e)/o+4,o/=h<.5?s+r:2-s-r,a*=60):o=h>0&&h<1?0:a,new rs(a,o,h,n.opacity)}function xP(n,t,e,i){return arguments.length===1?nT(n):new rs(n,t,e,i??1)}function rs(n,t,e,i){this.h=+n,this.s=+t,this.l=+e,this.opacity=+i}If(rs,xP,Zd(Zo,{brighter(n){return n=n==null?mf:Math.pow(mf,n),new rs(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?nh:Math.pow(nh,n),new rs(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,t=isNaN(n)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*t,r=2*e-i;return new Gi(Kg(n>=240?n-240:n+120,r,i),Kg(n,r,i),Kg(n<120?n+240:n-120,r,i),this.opacity)},clamp(){return new rs(_3(this.h),L0(this.s),L0(this.l),Bm(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=Bm(this.opacity);return`${n===1?"hsl(":"hsla("}${_3(this.h)}, ${L0(this.s)*100}%, ${L0(this.l)*100}%${n===1?")":`, ${n})`}`}}));function _3(n){return n=(n||0)%360,n<0?n+360:n}function L0(n){return Math.max(0,Math.min(1,n||0))}function Kg(n,t,e){return(n<60?t+(e-t)*n/60:n<180?e:n<240?t+(e-t)*(240-n)/60:t)*255}const rT=Math.PI/180,sT=180/Math.PI,zm=18,aT=.96422,oT=1,lT=.82521,hT=4/29,Gc=6/29,cT=3*Gc*Gc,_P=Gc*Gc*Gc;function fT(n){if(n instanceof Ds)return new Ds(n.l,n.a,n.b,n.opacity);if(n instanceof Ea)return uT(n);n instanceof Gi||(n=$2(n));var t=ny(n.r),e=ny(n.g),i=ny(n.b),r=ty((.2225045*t+.7168786*e+.0606169*i)/oT),s,a;return t===e&&e===i?s=a=r:(s=ty((.4360747*t+.3850649*e+.1430804*i)/aT),a=ty((.0139322*t+.0971045*e+.7141733*i)/lT)),new Ds(116*r-16,500*(s-r),200*(r-a),n.opacity)}function vP(n,t,e,i){return arguments.length===1?fT(n):new Ds(n,t,e,i??1)}function Ds(n,t,e,i){this.l=+n,this.a=+t,this.b=+e,this.opacity=+i}If(Ds,vP,Zd(Zo,{brighter(n){return new Ds(this.l+zm*(n??1),this.a,this.b,this.opacity)},darker(n){return new Ds(this.l-zm*(n??1),this.a,this.b,this.opacity)},rgb(){var n=(this.l+16)/116,t=isNaN(this.a)?n:n+this.a/500,e=isNaN(this.b)?n:n-this.b/200;return t=aT*ey(t),n=oT*ey(n),e=lT*ey(e),new Gi(iy(3.1338561*t-1.6168667*n-.4906146*e),iy(-.9787684*t+1.9161415*n+.033454*e),iy(.0719453*t-.2289914*n+1.4052427*e),this.opacity)}}));function ty(n){return n>_P?Math.pow(n,1/3):n/cT+hT}function ey(n){return n>Gc?n*n*n:cT*(n-hT)}function iy(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function ny(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function bP(n){if(n instanceof Ea)return new Ea(n.h,n.c,n.l,n.opacity);if(n instanceof Ds||(n=fT(n)),n.a===0&&n.b===0)return new Ea(NaN,0<n.l&&n.l<100?0:NaN,n.l,n.opacity);var t=Math.atan2(n.b,n.a)*sT;return new Ea(t<0?t+360:t,Math.sqrt(n.a*n.a+n.b*n.b),n.l,n.opacity)}function wP(n,t,e,i){return arguments.length===1?bP(n):new Ea(n,t,e,i??1)}function Ea(n,t,e,i){this.h=+n,this.c=+t,this.l=+e,this.opacity=+i}function uT(n){if(isNaN(n.h))return new Ds(n.l,0,0,n.opacity);var t=n.h*rT;return new Ds(n.l,Math.cos(t)*n.c,Math.sin(t)*n.c,n.opacity)}If(Ea,wP,Zd(Zo,{brighter(n){return new Ea(this.h,this.c,this.l+zm*(n??1),this.opacity)},darker(n){return new Ea(this.h,this.c,this.l-zm*(n??1),this.opacity)},rgb(){return uT(this).rgb()}}));var dT=-.14861,H2=1.78277,W2=-.29227,Y1=-.90649,cd=1.97294,v3=cd*Y1,b3=cd*H2,w3=H2*W2-Y1*dT;function SP(n){if(n instanceof Gl)return new Gl(n.h,n.s,n.l,n.opacity);n instanceof Gi||(n=$2(n));var t=n.r/255,e=n.g/255,i=n.b/255,r=(w3*i+v3*t-b3*e)/(w3+v3-b3),s=i-r,a=(cd*(e-r)-W2*s)/Y1,o=Math.sqrt(a*a+s*s)/(cd*r*(1-r)),h=o?Math.atan2(a,s)*sT-120:NaN;return new Gl(h<0?h+360:h,o,r,n.opacity)}function MP(n,t,e,i){return arguments.length===1?SP(n):new Gl(n,t,e,i??1)}function Gl(n,t,e,i){this.h=+n,this.s=+t,this.l=+e,this.opacity=+i}If(Gl,MP,Zd(Zo,{brighter(n){return n=n==null?mf:Math.pow(mf,n),new Gl(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?nh:Math.pow(nh,n),new Gl(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=isNaN(this.h)?0:(this.h+120)*rT,t=+this.l,e=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(n),r=Math.sin(n);return new Gi(255*(t+e*(dT*i+H2*r)),255*(t+e*(W2*i+Y1*r)),255*(t+e*(cd*i)),this.opacity)}}));var S3=Math.abs,ry=Math.cos,sy=Math.sin,pT=Math.PI,N0=pT/2,M3=pT*2,T3=Math.max,ay=1e-12;function E3(n,t){return Array.from({length:t-n},(e,i)=>n+i)}function TP(n){return function(t,e){return n(t.source.value+t.target.value,e.source.value+e.target.value)}}function DJ(){return EP(!1)}function EP(n,t){var e=0,i=null,r=null,s=null;function a(o){var h=o.length,l=new Array(h),c=E3(0,h),f=new Array(h*h),d=new Array(h),u=0,p;o=Float64Array.from({length:h*h},(m,g)=>o[g/h|0][g%h]);for(let m=0;m<h;++m){let g=0;for(let y=0;y<h;++y)g+=o[m*h+y]+n*o[y*h+m];u+=l[m]=g}u=T3(0,M3-e*h)/u,p=u?e:M3/h;{let m=0;i&&c.sort((g,y)=>i(l[g],l[y]));for(const g of c){const y=m;{const A=E3(0,h).filter(_=>o[g*h+_]||o[_*h+g]);r&&A.sort((_,x)=>r(o[g*h+_],o[g*h+x]));for(const _ of A){let x;if(g<_?(x=f[g*h+_]||(f[g*h+_]={source:null,target:null}),x.source={index:g,startAngle:m,endAngle:m+=o[g*h+_]*u,value:o[g*h+_]}):(x=f[_*h+g]||(f[_*h+g]={source:null,target:null}),x.target={index:g,startAngle:m,endAngle:m+=o[g*h+_]*u,value:o[g*h+_]},g===_&&(x.source=x.target)),x.source&&x.target&&x.source.value<x.target.value){const v=x.source;x.source=x.target,x.target=v}}d[g]={index:g,startAngle:y,endAngle:m,value:l[g]}}m+=p}}return f=Object.values(f),f.groups=d,s?f.sort(s):f}return a.padAngle=function(o){return arguments.length?(e=T3(0,o),a):e},a.sortGroups=function(o){return arguments.length?(i=o,a):i},a.sortSubgroups=function(o){return arguments.length?(r=o,a):r},a.sortChords=function(o){return arguments.length?(o==null?s=null:(s=TP(o))._=o,a):s&&s._},a}const Lx=Math.PI,Nx=2*Lx,yl=1e-6,CP=Nx-yl;function mT(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}function PP(n){let t=Math.floor(n);if(!(t>=0))throw new Error(`invalid digits: ${n}`);if(t>15)return mT;const e=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;r<s;++r)this._+=Math.round(arguments[r]*e)/e+i[r]}}let j2=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?mT:PP(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,i,r){this._append`Q${+t},${+e},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(t,e,i,r,s,a){this._append`C${+t},${+e},${+i},${+r},${this._x1=+s},${this._y1=+a}`}arcTo(t,e,i,r,s){if(t=+t,e=+e,i=+i,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,h=i-t,l=r-e,c=a-t,f=o-e,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=e}`;else if(d>yl)if(!(Math.abs(f*h-l*c)>yl)||!s)this._append`L${this._x1=t},${this._y1=e}`;else{let u=i-a,p=r-o,m=h*h+l*l,g=u*u+p*p,y=Math.sqrt(m),A=Math.sqrt(d),_=s*Math.tan((Lx-Math.acos((m+d-g)/(2*y*A)))/2),x=_/A,v=_/y;Math.abs(x-1)>yl&&this._append`L${t+x*c},${e+x*f}`,this._append`A${s},${s},0,0,${+(f*u>c*p)},${this._x1=t+v*h},${this._y1=e+v*l}`}}arc(t,e,i,r,s,a){if(t=+t,e=+e,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(r),h=i*Math.sin(r),l=t+o,c=e+h,f=1^a,d=a?r-s:s-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>yl||Math.abs(this._y1-c)>yl)&&this._append`L${l},${c}`,i&&(d<0&&(d=d%Nx+Nx),d>CP?this._append`A${i},${i},0,1,${f},${t-o},${e-h}A${i},${i},0,1,${f},${this._x1=l},${this._y1=c}`:d>yl&&this._append`A${i},${i},0,${+(d>=Lx)},${f},${this._x1=t+i*Math.cos(s)},${this._y1=e+i*Math.sin(s)}`)}rect(t,e,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function gT(){return new j2}gT.prototype=j2.prototype;var kP=Array.prototype.slice;function Rh(n){return function(){return n}}function LP(n){return n.source}function NP(n){return n.target}function C3(n){return n.radius}function RP(n){return n.startAngle}function DP(n){return n.endAngle}function FP(){return 0}function IP(n){var t=LP,e=NP,i=C3,r=C3,s=RP,a=DP,o=FP,h=null;function l(){var c,f=t.apply(this,arguments),d=e.apply(this,arguments),u=o.apply(this,arguments)/2,p=kP.call(arguments),m=+i.apply(this,(p[0]=f,p)),g=s.apply(this,p)-N0,y=a.apply(this,p)-N0,A=+r.apply(this,(p[0]=d,p)),_=s.apply(this,p)-N0,x=a.apply(this,p)-N0;if(h||(h=c=gT()),u>ay&&(S3(y-g)>u*2+ay?y>g?(g+=u,y-=u):(g-=u,y+=u):g=y=(g+y)/2,S3(x-_)>u*2+ay?x>_?(_+=u,x-=u):(_-=u,x+=u):_=x=(_+x)/2),h.moveTo(m*ry(g),m*sy(g)),h.arc(0,0,m,g,y),(g!==_||y!==x)&&(h.quadraticCurveTo(0,0,A*ry(_),A*sy(_)),h.arc(0,0,A,_,x)),h.quadraticCurveTo(0,0,m*ry(g),m*sy(g)),h.closePath(),c)return h=null,c+""||null}return l.radius=function(c){return arguments.length?(i=r=typeof c=="function"?c:Rh(+c),l):i},l.sourceRadius=function(c){return arguments.length?(i=typeof c=="function"?c:Rh(+c),l):i},l.targetRadius=function(c){return arguments.length?(r=typeof c=="function"?c:Rh(+c),l):r},l.startAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Rh(+c),l):s},l.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:Rh(+c),l):a},l.padAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Rh(+c),l):o},l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(e=c,l):e},l.context=function(c){return arguments.length?(h=c??null,l):h},l}function IJ(){return IP()}var OP={value:()=>{}};function X2(){for(var n=0,t=arguments.length,e={},i;n<t;++n){if(!(i=arguments[n]+"")||i in e||/[\s.]/.test(i))throw new Error("illegal type: "+i);e[i]=[]}return new lm(e)}function lm(n){this._=n}function BP(n,t){return n.trim().split(/^|\s+/).map(function(e){var i="",r=e.indexOf(".");if(r>=0&&(i=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:i}})}lm.prototype=X2.prototype={constructor:lm,on:function(n,t){var e=this._,i=BP(n+"",e),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(n=i[s]).type)&&(r=zP(e[r],n.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(n=i[s]).type)e[r]=P3(e[r],n.name,t);else if(t==null)for(r in e)e[r]=P3(e[r],n.name,null);return this},copy:function(){var n={},t=this._;for(var e in t)n[e]=t[e].slice();return new lm(n)},call:function(n,t){if((r=arguments.length-2)>0)for(var e=new Array(r),i=0,r,s;i<r;++i)e[i]=arguments[i+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(s=this._[n],i=0,r=s.length;i<r;++i)s[i].value.apply(t,e)},apply:function(n,t,e){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var i=this._[n],r=0,s=i.length;r<s;++r)i[r].value.apply(t,e)}};function zP(n,t){for(var e=0,i=n.length,r;e<i;++e)if((r=n[e]).name===t)return r.value}function P3(n,t,e){for(var i=0,r=n.length;i<r;++i)if(n[i].name===t){n[i]=OP,n=n.slice(0,i).concat(n.slice(i+1));break}return e!=null&&n.push({name:t,value:e}),n}var Rx="http://www.w3.org/1999/xhtml",k3={svg:"http://www.w3.org/2000/svg",xhtml:Rx,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Z1(n){var t=n+="",e=t.indexOf(":");return e>=0&&(t=n.slice(0,e))!=="xmlns"&&(n=n.slice(e+1)),k3.hasOwnProperty(t)?{space:k3[t],local:n}:n}function UP(n){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===Rx&&t.documentElement.namespaceURI===Rx?t.createElement(n):t.createElementNS(e,n)}}function qP(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function yT(n){var t=Z1(n);return(t.local?qP:UP)(t)}function VP(){}function Y2(n){return n==null?VP:function(){return this.querySelector(n)}}function GP(n){typeof n!="function"&&(n=Y2(n));for(var t=this._groups,e=t.length,i=new Array(e),r=0;r<e;++r)for(var s=t[r],a=s.length,o=i[r]=new Array(a),h,l,c=0;c<a;++c)(h=s[c])&&(l=n.call(h,h.__data__,c,s))&&("__data__"in h&&(l.__data__=h.__data__),o[c]=l);return new dr(i,this._parents)}function $P(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function HP(){return[]}function AT(n){return n==null?HP:function(){return this.querySelectorAll(n)}}function WP(n){return function(){return $P(n.apply(this,arguments))}}function jP(n){typeof n=="function"?n=WP(n):n=AT(n);for(var t=this._groups,e=t.length,i=[],r=[],s=0;s<e;++s)for(var a=t[s],o=a.length,h,l=0;l<o;++l)(h=a[l])&&(i.push(n.call(h,h.__data__,l,a)),r.push(h));return new dr(i,r)}function xT(n){return function(){return this.matches(n)}}function _T(n){return function(t){return t.matches(n)}}var XP=Array.prototype.find;function YP(n){return function(){return XP.call(this.children,n)}}function ZP(){return this.firstElementChild}function JP(n){return this.select(n==null?ZP:YP(typeof n=="function"?n:_T(n)))}var QP=Array.prototype.filter;function KP(){return Array.from(this.children)}function t9(n){return function(){return QP.call(this.children,n)}}function e9(n){return this.selectAll(n==null?KP:t9(typeof n=="function"?n:_T(n)))}function i9(n){typeof n!="function"&&(n=xT(n));for(var t=this._groups,e=t.length,i=new Array(e),r=0;r<e;++r)for(var s=t[r],a=s.length,o=i[r]=[],h,l=0;l<a;++l)(h=s[l])&&n.call(h,h.__data__,l,s)&&o.push(h);return new dr(i,this._parents)}function vT(n){return new Array(n.length)}function n9(){return new dr(this._enter||this._groups.map(vT),this._parents)}function Um(n,t){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=t}Um.prototype={constructor:Um,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,t){return this._parent.insertBefore(n,t)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function r9(n){return function(){return n}}function s9(n,t,e,i,r,s){for(var a=0,o,h=t.length,l=s.length;a<l;++a)(o=t[a])?(o.__data__=s[a],i[a]=o):e[a]=new Um(n,s[a]);for(;a<h;++a)(o=t[a])&&(r[a]=o)}function a9(n,t,e,i,r,s,a){var o,h,l=new Map,c=t.length,f=s.length,d=new Array(c),u;for(o=0;o<c;++o)(h=t[o])&&(d[o]=u=a.call(h,h.__data__,o,t)+"",l.has(u)?r[o]=h:l.set(u,h));for(o=0;o<f;++o)u=a.call(n,s[o],o,s)+"",(h=l.get(u))?(i[o]=h,h.__data__=s[o],l.delete(u)):e[o]=new Um(n,s[o]);for(o=0;o<c;++o)(h=t[o])&&l.get(d[o])===h&&(r[o]=h)}function o9(n){return n.__data__}function l9(n,t){if(!arguments.length)return Array.from(this,o9);var e=t?a9:s9,i=this._parents,r=this._groups;typeof n!="function"&&(n=r9(n));for(var s=r.length,a=new Array(s),o=new Array(s),h=new Array(s),l=0;l<s;++l){var c=i[l],f=r[l],d=f.length,u=h9(n.call(c,c&&c.__data__,l,i)),p=u.length,m=o[l]=new Array(p),g=a[l]=new Array(p),y=h[l]=new Array(d);e(c,f,m,g,y,u,t);for(var A=0,_=0,x,v;A<p;++A)if(x=m[A]){for(A>=_&&(_=A+1);!(v=g[_])&&++_<p;);x._next=v||null}}return a=new dr(a,i),a._enter=o,a._exit=h,a}function h9(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function c9(){return new dr(this._exit||this._groups.map(vT),this._parents)}function f9(n,t,e){var i=this.enter(),r=this,s=this.exit();return typeof n=="function"?(i=n(i),i&&(i=i.selection())):i=i.append(n+""),t!=null&&(r=t(r),r&&(r=r.selection())),e==null?s.remove():e(s),i&&r?i.merge(r).order():r}function u9(n){for(var t=n.selection?n.selection():n,e=this._groups,i=t._groups,r=e.length,s=i.length,a=Math.min(r,s),o=new Array(r),h=0;h<a;++h)for(var l=e[h],c=i[h],f=l.length,d=o[h]=new Array(f),u,p=0;p<f;++p)(u=l[p]||c[p])&&(d[p]=u);for(;h<r;++h)o[h]=e[h];return new dr(o,this._parents)}function d9(){for(var n=this._groups,t=-1,e=n.length;++t<e;)for(var i=n[t],r=i.length-1,s=i[r],a;--r>=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function p9(n){n||(n=m9);function t(f,d){return f&&d?n(f.__data__,d.__data__):!f-!d}for(var e=this._groups,i=e.length,r=new Array(i),s=0;s<i;++s){for(var a=e[s],o=a.length,h=r[s]=new Array(o),l,c=0;c<o;++c)(l=a[c])&&(h[c]=l);h.sort(t)}return new dr(r,this._parents).order()}function m9(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function g9(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function y9(){return Array.from(this)}function A9(){for(var n=this._groups,t=0,e=n.length;t<e;++t)for(var i=n[t],r=0,s=i.length;r<s;++r){var a=i[r];if(a)return a}return null}function x9(){let n=0;for(const t of this)++n;return n}function _9(){return!this.node()}function v9(n){for(var t=this._groups,e=0,i=t.length;e<i;++e)for(var r=t[e],s=0,a=r.length,o;s<a;++s)(o=r[s])&&n.call(o,o.__data__,s,r);return this}function b9(n){return function(){this.removeAttribute(n)}}function w9(n){return function(){this.removeAttributeNS(n.space,n.local)}}function S9(n,t){return function(){this.setAttribute(n,t)}}function M9(n,t){return function(){this.setAttributeNS(n.space,n.local,t)}}function T9(n,t){return function(){var e=t.apply(this,arguments);e==null?this.removeAttribute(n):this.setAttribute(n,e)}}function E9(n,t){return function(){var e=t.apply(this,arguments);e==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}}function C9(n,t){var e=Z1(n);if(arguments.length<2){var i=this.node();return e.local?i.getAttributeNS(e.space,e.local):i.getAttribute(e)}return this.each((t==null?e.local?w9:b9:typeof t=="function"?e.local?E9:T9:e.local?M9:S9)(e,t))}function bT(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function P9(n){return function(){this.style.removeProperty(n)}}function k9(n,t,e){return function(){this.style.setProperty(n,t,e)}}function L9(n,t,e){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(n):this.style.setProperty(n,i,e)}}function N9(n,t,e){return arguments.length>1?this.each((t==null?P9:typeof t=="function"?L9:k9)(n,t,e??"")):gf(this.node(),n)}function gf(n,t){return n.style.getPropertyValue(t)||bT(n).getComputedStyle(n,null).getPropertyValue(t)}function R9(n){return function(){delete this[n]}}function D9(n,t){return function(){this[n]=t}}function F9(n,t){return function(){var e=t.apply(this,arguments);e==null?delete this[n]:this[n]=e}}function I9(n,t){return arguments.length>1?this.each((t==null?R9:typeof t=="function"?F9:D9)(n,t)):this.node()[n]}function wT(n){return n.trim().split(/^|\s+/)}function Z2(n){return n.classList||new ST(n)}function ST(n){this._node=n,this._names=wT(n.getAttribute("class")||"")}ST.prototype={add:function(n){var t=this._names.indexOf(n);t<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var t=this._names.indexOf(n);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function MT(n,t){for(var e=Z2(n),i=-1,r=t.length;++i<r;)e.add(t[i])}function TT(n,t){for(var e=Z2(n),i=-1,r=t.length;++i<r;)e.remove(t[i])}function O9(n){return function(){MT(this,n)}}function B9(n){return function(){TT(this,n)}}function z9(n,t){return function(){(t.apply(this,arguments)?MT:TT)(this,n)}}function U9(n,t){var e=wT(n+"");if(arguments.length<2){for(var i=Z2(this.node()),r=-1,s=e.length;++r<s;)if(!i.contains(e[r]))return!1;return!0}return this.each((typeof t=="function"?z9:t?O9:B9)(e,t))}function q9(){this.textContent=""}function V9(n){return function(){this.textContent=n}}function G9(n){return function(){var t=n.apply(this,arguments);this.textContent=t??""}}function $9(n){return arguments.length?this.each(n==null?q9:(typeof n=="function"?G9:V9)(n)):this.node().textContent}function H9(){this.innerHTML=""}function W9(n){return function(){this.innerHTML=n}}function j9(n){return function(){var t=n.apply(this,arguments);this.innerHTML=t??""}}function X9(n){return arguments.length?this.each(n==null?H9:(typeof n=="function"?j9:W9)(n)):this.node().innerHTML}function Y9(){this.nextSibling&&this.parentNode.appendChild(this)}function Z9(){return this.each(Y9)}function J9(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Q9(){return this.each(J9)}function K9(n){var t=typeof n=="function"?n:yT(n);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function tk(){return null}function ek(n,t){var e=typeof n=="function"?n:yT(n),i=t==null?tk:typeof t=="function"?t:Y2(t);return this.select(function(){return this.insertBefore(e.apply(this,arguments),i.apply(this,arguments)||null)})}function ik(){var n=this.parentNode;n&&n.removeChild(this)}function nk(){return this.each(ik)}function rk(){var n=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(n,this.nextSibling):n}function sk(){var n=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(n,this.nextSibling):n}function ak(n){return this.select(n?sk:rk)}function ok(n){return arguments.length?this.property("__data__",n):this.node().__data__}function lk(n){return function(t){n.call(this,t,this.__data__)}}function hk(n){return n.trim().split(/^|\s+/).map(function(t){var e="",i=t.indexOf(".");return i>=0&&(e=t.slice(i+1),t=t.slice(0,i)),{type:t,name:e}})}function ck(n){return function(){var t=this.__on;if(t){for(var e=0,i=-1,r=t.length,s;e<r;++e)s=t[e],(!n.type||s.type===n.type)&&s.name===n.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function fk(n,t,e){return function(){var i=this.__on,r,s=lk(t);if(i){for(var a=0,o=i.length;a<o;++a)if((r=i[a]).type===n.type&&r.name===n.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=e),r.value=t;return}}this.addEventListener(n.type,s,e),r={type:n.type,name:n.name,value:t,listener:s,options:e},i?i.push(r):this.__on=[r]}}function uk(n,t,e){var i=hk(n+""),r,s=i.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var h=0,l=o.length,c;h<l;++h)for(r=0,c=o[h];r<s;++r)if((a=i[r]).type===c.type&&a.name===c.name)return c.value}return}for(o=t?fk:ck,r=0;r<s;++r)this.each(o(i[r],t,e));return this}function ET(n,t,e){var i=bT(n),r=i.CustomEvent;typeof r=="function"?r=new r(t,e):(r=i.document.createEvent("Event"),e?(r.initEvent(t,e.bubbles,e.cancelable),r.detail=e.detail):r.initEvent(t,!1,!1)),n.dispatchEvent(r)}function dk(n,t){return function(){return ET(this,n,t)}}function pk(n,t){return function(){return ET(this,n,t.apply(this,arguments))}}function mk(n,t){return this.each((typeof t=="function"?pk:dk)(n,t))}function*gk(){for(var n=this._groups,t=0,e=n.length;t<e;++t)for(var i=n[t],r=0,s=i.length,a;r<s;++r)(a=i[r])&&(yield a)}var CT=[null];function dr(n,t){this._groups=n,this._parents=t}function Jd(){return new dr([[document.documentElement]],CT)}function yk(){return this}dr.prototype=Jd.prototype={constructor:dr,select:GP,selectAll:jP,selectChild:JP,selectChildren:e9,filter:i9,data:l9,enter:n9,exit:c9,join:f9,merge:u9,selection:yk,order:d9,sort:p9,call:g9,nodes:y9,node:A9,size:x9,empty:_9,each:v9,attr:C9,style:N9,property:I9,classed:U9,text:$9,html:X9,raise:Z9,lower:Q9,append:K9,insert:ek,remove:nk,clone:ak,datum:ok,on:uk,dispatch:mk,[Symbol.iterator]:gk};function Ct(n){return typeof n=="string"?new dr([[document.querySelector(n)]],[document.documentElement]):new dr([[n]],CT)}var Ak=0;function L3(){this._="@"+(++Ak).toString(36)}L3.prototype={constructor:L3,get:function(n){for(var t=this._;!(t in n);)if(!(n=n.parentNode))return;return n[t]},set:function(n,t){return n[this._]=t},remove:function(n){return this._ in n&&delete n[this._]},toString:function(){return this._}};function PT(n){let t;for(;t=n.sourceEvent;)n=t;return n}function ji(n,t){if(n=PT(n),t===void 0&&(t=n.currentTarget),t){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var i=e.createSVGPoint();return i.x=n.clientX,i.y=n.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[n.clientX-r.left-t.clientLeft,n.clientY-r.top-t.clientTop]}}return[n.pageX,n.pageY]}function xk(n,t){return n.target&&(n=PT(n),t===void 0&&(t=n.currentTarget),n=n.touches||[n]),Array.from(n,e=>ji(e,t))}const _k={passive:!1},fd={capture:!0,passive:!1};function oy(n){n.stopImmediatePropagation()}function $c(n){n.preventDefault(),n.stopImmediatePropagation()}function vk(n){var t=n.document.documentElement,e=Ct(n).on("dragstart.drag",$c,fd);"onselectstart"in t?e.on("selectstart.drag",$c,fd):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function bk(n,t){var e=n.document.documentElement,i=Ct(n).on("dragstart.drag",null);t&&(i.on("click.drag",$c,fd),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in e?i.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}var R0=n=>()=>n;function Dx(n,{sourceEvent:t,subject:e,target:i,identifier:r,active:s,x:a,y:o,dx:h,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}Dx.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function wk(n){return!n.ctrlKey&&!n.button}function Sk(){return this.parentNode}function Mk(n,t){return t??{x:n.x,y:n.y}}function Tk(){return navigator.maxTouchPoints||"ontouchstart"in this}function hr(){var n=wk,t=Sk,e=Mk,i=Tk,r={},s=X2("start","drag","end"),a=0,o,h,l,c,f=0;function d(x){x.on("mousedown.drag",u).filter(i).on("touchstart.drag",g).on("touchmove.drag",y,_k).on("touchend.drag touchcancel.drag",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function u(x,v){if(!(c||!n.call(this,x,v))){var b=_(this,t.call(this,x,v),x,v,"mouse");b&&(Ct(x.view).on("mousemove.drag",p,fd).on("mouseup.drag",m,fd),vk(x.view),oy(x),l=!1,o=x.clientX,h=x.clientY,b("start",x))}}function p(x){if($c(x),!l){var v=x.clientX-o,b=x.clientY-h;l=v*v+b*b>f}r.mouse("drag",x)}function m(x){Ct(x.view).on("mousemove.drag mouseup.drag",null),bk(x.view,l),$c(x),r.mouse("end",x)}function g(x,v){if(n.call(this,x,v)){var b=x.changedTouches,M=t.call(this,x,v),T=b.length,w,E;for(w=0;w<T;++w)(E=_(this,M,x,v,b[w].identifier,b[w]))&&(oy(x),E("start",x,b[w]))}}function y(x){var v=x.changedTouches,b=v.length,M,T;for(M=0;M<b;++M)(T=r[v[M].identifier])&&($c(x),T("drag",x,v[M]))}function A(x){var v=x.changedTouches,b=v.length,M,T;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),M=0;M<b;++M)(T=r[v[M].identifier])&&(oy(x),T("end",x,v[M]))}function _(x,v,b,M,T,w){var E=s.copy(),k=ji(w||b,v),C,R,F;if((F=e.call(x,new Dx("beforestart",{sourceEvent:b,target:d,identifier:T,active:a,x:k[0],y:k[1],dx:0,dy:0,dispatch:E}),M))!=null)return C=F.x-k[0]||0,R=F.y-k[1]||0,function P(I,U,N){var q=k,G;switch(I){case"start":r[T]=P,G=a++;break;case"end":delete r[T],--a;case"drag":k=ji(N||U,v),G=a;break}E.call(I,x,new Dx(I,{sourceEvent:U,subject:F,target:d,identifier:T,active:G,x:k[0]+C,y:k[1]+R,dx:k[0]-q[0],dy:k[1]-q[1],dispatch:E}),M)}}return d.filter=function(x){return arguments.length?(n=typeof x=="function"?x:R0(!!x),d):n},d.container=function(x){return arguments.length?(t=typeof x=="function"?x:R0(x),d):t},d.subject=function(x){return arguments.length?(e=typeof x=="function"?x:R0(x),d):e},d.touchable=function(x){return arguments.length?(i=typeof x=="function"?x:R0(!!x),d):i},d.on=function(){var x=s.on.apply(s,arguments);return x===s?d:x},d.clickDistance=function(x){return arguments.length?(f=(x=+x)*x,d):Math.sqrt(f)},d}function hm(n,t){return n==null||t==null?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function Ek(n,t){return n==null||t==null?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function J2(n){let t,e,i;n.length!==2?(t=hm,e=(o,h)=>hm(n(o),h),i=(o,h)=>n(o)-h):(t=n===hm||n===Ek?n:Ck,e=n,i=n);function r(o,h,l=0,c=o.length){if(l<c){if(t(h,h)!==0)return c;do{const f=l+c>>>1;e(o[f],h)<0?l=f+1:c=f}while(l<c)}return l}function s(o,h,l=0,c=o.length){if(l<c){if(t(h,h)!==0)return c;do{const f=l+c>>>1;e(o[f],h)<=0?l=f+1:c=f}while(l<c)}return l}function a(o,h,l=0,c=o.length){const f=r(o,h,l,c-1);return f>l&&i(o[f-1],h)>-i(o[f],h)?f-1:f}return{left:r,center:a,right:s}}function Ck(){return 0}function Pk(n){return n===null?NaN:+n}const kk=J2(hm),Lk=kk.right;J2(Pk).center;const Nk=Math.sqrt(50),Rk=Math.sqrt(10),Dk=Math.sqrt(2);function qm(n,t,e){const i=(t-n)/Math.max(0,e),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),a=s>=Nk?10:s>=Rk?5:s>=Dk?2:1;let o,h,l;return r<0?(l=Math.pow(10,-r)/a,o=Math.round(n*l),h=Math.round(t*l),o/l<n&&++o,h/l>t&&--h,l=-l):(l=Math.pow(10,r)*a,o=Math.round(n/l),h=Math.round(t/l),o*l<n&&++o,h*l>t&&--h),h<o&&.5<=e&&e<2?qm(n,t,e*2):[o,h,l]}function Fx(n,t,e){if(t=+t,n=+n,e=+e,!(e>0))return[];if(n===t)return[n];const i=t<n,[r,s,a]=i?qm(t,n,e):qm(n,t,e);if(!(s>=r))return[];const o=s-r+1,h=new Array(o);if(i)if(a<0)for(let l=0;l<o;++l)h[l]=(s-l)/-a;else for(let l=0;l<o;++l)h[l]=(s-l)*a;else if(a<0)for(let l=0;l<o;++l)h[l]=(r+l)/-a;else for(let l=0;l<o;++l)h[l]=(r+l)*a;return h}function Ix(n,t,e){return t=+t,n=+n,e=+e,qm(n,t,e)[2]}function Ox(n,t,e){t=+t,n=+n,e=+e;const i=t<n,r=i?Ix(t,n,e):Ix(n,t,e);return(i?-1:1)*(r<0?1/-r:r)}function J1(n,t){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(t).domain(n);break}return this}var Q2=n=>()=>n;function Fk(n,t){return function(e){return n+e*t}}function Ik(n,t,e){return n=Math.pow(n,e),t=Math.pow(t,e)-n,e=1/e,function(i){return Math.pow(n+i*t,e)}}function Ok(n){return(n=+n)==1?kT:function(t,e){return e-t?Ik(t,e,n):Q2(isNaN(t)?e:t)}}function kT(n,t){var e=t-n;return e?Fk(n,e):Q2(isNaN(n)?t:n)}var Vm=(function n(t){var e=Ok(t);function i(r,s){var a=e((r=zs(r)).r,(s=zs(s)).r),o=e(r.g,s.g),h=e(r.b,s.b),l=kT(r.opacity,s.opacity);return function(c){return r.r=a(c),r.g=o(c),r.b=h(c),r.opacity=l(c),r+""}}return i.gamma=n,i})(1);function Bk(n,t){t||(t=[]);var e=n?Math.min(t.length,n.length):0,i=t.slice(),r;return function(s){for(r=0;r<e;++r)i[r]=n[r]*(1-s)+t[r]*s;return i}}function zk(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Uk(n,t){var e=t?t.length:0,i=n?Math.min(e,n.length):0,r=new Array(i),s=new Array(e),a;for(a=0;a<i;++a)r[a]=K2(n[a],t[a]);for(;a<e;++a)s[a]=t[a];return function(o){for(a=0;a<i;++a)s[a]=r[a](o);return s}}function qk(n,t){var e=new Date;return n=+n,t=+t,function(i){return e.setTime(n*(1-i)+t*i),e}}function is(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function Vk(n,t){var e={},i={},r;(n===null||typeof n!="object")&&(n={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in n?e[r]=K2(n[r],t[r]):i[r]=t[r];return function(s){for(r in e)i[r]=e[r](s);return i}}var Bx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ly=new RegExp(Bx.source,"g");function Gk(n){return function(){return n}}function $k(n){return function(t){return n(t)+""}}function LT(n,t){var e=Bx.lastIndex=ly.lastIndex=0,i,r,s,a=-1,o=[],h=[];for(n=n+"",t=t+"";(i=Bx.exec(n))&&(r=ly.exec(t));)(s=r.index)>e&&(s=t.slice(e,s),o[a]?o[a]+=s:o[++a]=s),(i=i[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,h.push({i:a,x:is(i,r)})),e=ly.lastIndex;return e<t.length&&(s=t.slice(e),o[a]?o[a]+=s:o[++a]=s),o.length<2?h[0]?$k(h[0].x):Gk(t):(t=h.length,function(l){for(var c=0,f;c<t;++c)o[(f=h[c]).i]=f.x(l);return o.join("")})}function K2(n,t){var e=typeof t,i;return t==null||e==="boolean"?Q2(t):(e==="number"?is:e==="string"?(i=Pn(t))?(t=i,Vm):LT:t instanceof Pn?Vm:t instanceof Date?qk:zk(t)?Bk:Array.isArray(t)?Uk:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Vk:is)(n,t)}function Hk(n,t){return n=+n,t=+t,function(e){return Math.round(n*(1-e)+t*e)}}var N3=180/Math.PI,zx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function NT(n,t,e,i,r,s){var a,o,h;return(a=Math.sqrt(n*n+t*t))&&(n/=a,t/=a),(h=n*e+t*i)&&(e-=n*h,i-=t*h),(o=Math.sqrt(e*e+i*i))&&(e/=o,i/=o,h/=o),n*i<t*e&&(n=-n,t=-t,h=-h,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(t,n)*N3,skewX:Math.atan(h)*N3,scaleX:a,scaleY:o}}var D0;function Wk(n){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return t.isIdentity?zx:NT(t.a,t.b,t.c,t.d,t.e,t.f)}function jk(n){return n==null||(D0||(D0=document.createElementNS("http://www.w3.org/2000/svg","g")),D0.setAttribute("transform",n),!(n=D0.transform.baseVal.consolidate()))?zx:(n=n.matrix,NT(n.a,n.b,n.c,n.d,n.e,n.f))}function RT(n,t,e,i){function r(l){return l.length?l.pop()+" ":""}function s(l,c,f,d,u,p){if(l!==f||c!==d){var m=u.push("translate(",null,t,null,e);p.push({i:m-4,x:is(l,f)},{i:m-2,x:is(c,d)})}else(f||d)&&u.push("translate("+f+t+d+e)}function a(l,c,f,d){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),d.push({i:f.push(r(f)+"rotate(",null,i)-2,x:is(l,c)})):c&&f.push(r(f)+"rotate("+c+i)}function o(l,c,f,d){l!==c?d.push({i:f.push(r(f)+"skewX(",null,i)-2,x:is(l,c)}):c&&f.push(r(f)+"skewX("+c+i)}function h(l,c,f,d,u,p){if(l!==f||c!==d){var m=u.push(r(u)+"scale(",null,",",null,")");p.push({i:m-4,x:is(l,f)},{i:m-2,x:is(c,d)})}else(f!==1||d!==1)&&u.push(r(u)+"scale("+f+","+d+")")}return function(l,c){var f=[],d=[];return l=n(l),c=n(c),s(l.translateX,l.translateY,c.translateX,c.translateY,f,d),a(l.rotate,c.rotate,f,d),o(l.skewX,c.skewX,f,d),h(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,d),l=c=null,function(u){for(var p=-1,m=d.length,g;++p<m;)f[(g=d[p]).i]=g.x(u);return f.join("")}}}var Xk=RT(Wk,"px, ","px)","deg)"),Yk=RT(jk,", ",")",")");function Zk(n){return function(){return n}}function Jk(n){return+n}var R3=[0,1];function Pc(n){return n}function Ux(n,t){return(t-=n=+n)?function(e){return(e-n)/t}:Zk(isNaN(t)?NaN:.5)}function Qk(n,t){var e;return n>t&&(e=n,n=t,t=e),function(i){return Math.max(n,Math.min(t,i))}}function Kk(n,t,e){var i=n[0],r=n[1],s=t[0],a=t[1];return r<i?(i=Ux(r,i),s=e(a,s)):(i=Ux(i,r),s=e(s,a)),function(o){return s(i(o))}}function tL(n,t,e){var i=Math.min(n.length,t.length)-1,r=new Array(i),s=new Array(i),a=-1;for(n[i]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++a<i;)r[a]=Ux(n[a],n[a+1]),s[a]=e(t[a],t[a+1]);return function(o){var h=Lk(n,o,1,i)-1;return s[h](r[h](o))}}function Q1(n,t){return t.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tv(){var n=R3,t=R3,e=K2,i,r,s,a=Pc,o,h,l;function c(){var d=Math.min(n.length,t.length);return a!==Pc&&(a=Qk(n[0],n[d-1])),o=d>2?tL:Kk,h=l=null,f}function f(d){return d==null||isNaN(d=+d)?s:(h||(h=o(n.map(i),t,e)))(i(a(d)))}return f.invert=function(d){return a(r((l||(l=o(t,n.map(i),is)))(d)))},f.domain=function(d){return arguments.length?(n=Array.from(d,Jk),c()):n.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),e=Hk,c()},f.clamp=function(d){return arguments.length?(a=d?!0:Pc,c()):a!==Pc},f.interpolate=function(d){return arguments.length?(e=d,c()):e},f.unknown=function(d){return arguments.length?(s=d,f):s},function(d,u){return i=d,r=u,c()}}function DT(){return tv()(Pc,Pc)}function eL(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function Gm(n,t){if((e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"))<0)return null;var e,i=n.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+n.slice(e+1)]}function yf(n){return n=Gm(Math.abs(n)),n?n[1]:NaN}function iL(n,t){return function(e,i){for(var r=e.length,s=[],a=0,o=n[0],h=0;r>0&&o>0&&(h+o+1>i&&(o=Math.max(1,i-h)),s.push(e.substring(r-=o,r+o)),!((h+=o+1)>i));)o=n[a=(a+1)%n.length];return s.reverse().join(t)}}function nL(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var rL=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ud(n){if(!(t=rL.exec(n)))throw new Error("invalid format: "+n);var t;return new ev({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ud.prototype=ev.prototype;function ev(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}ev.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function sL(n){t:for(var t=n.length,e=1,i=-1,r;e<t;++e)switch(n[e]){case".":i=r=e;break;case"0":i===0&&(i=e),r=e;break;default:if(!+n[e])break t;i>0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(r+1):n}var FT;function aL(n,t){var e=Gm(n,t);if(!e)return n+"";var i=e[0],r=e[1],s=r-(FT=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=i.length;return s===a?i:s>a?i+new Array(s-a+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Gm(n,Math.max(0,t+s-1))[0]}function D3(n,t){var e=Gm(n,t);if(!e)return n+"";var i=e[0],r=e[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}var F3={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2),c:n=>n+"",d:eL,e:(n,t)=>n.toExponential(t),f:(n,t)=>n.toFixed(t),g:(n,t)=>n.toPrecision(t),o:n=>Math.round(n).toString(8),p:(n,t)=>D3(n*100,t),r:D3,s:aL,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function I3(n){return n}var O3=Array.prototype.map,B3=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function oL(n){var t=n.grouping===void 0||n.thousands===void 0?I3:iL(O3.call(n.grouping,Number),n.thousands+""),e=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",r=n.decimal===void 0?".":n.decimal+"",s=n.numerals===void 0?I3:nL(O3.call(n.numerals,String)),a=n.percent===void 0?"%":n.percent+"",o=n.minus===void 0?"−":n.minus+"",h=n.nan===void 0?"NaN":n.nan+"";function l(f){f=ud(f);var d=f.fill,u=f.align,p=f.sign,m=f.symbol,g=f.zero,y=f.width,A=f.comma,_=f.precision,x=f.trim,v=f.type;v==="n"?(A=!0,v="g"):F3[v]||(_===void 0&&(_=12),x=!0,v="g"),(g||d==="0"&&u==="=")&&(g=!0,d="0",u="=");var b=m==="$"?e:m==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",M=m==="$"?i:/[%p]/.test(v)?a:"",T=F3[v],w=/[defgprs%]/.test(v);_=_===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function E(k){var C=b,R=M,F,P,I;if(v==="c")R=T(k)+R,k="";else{k=+k;var U=k<0||1/k<0;if(k=isNaN(k)?h:T(Math.abs(k),_),x&&(k=sL(k)),U&&+k==0&&p!=="+"&&(U=!1),C=(U?p==="("?p:o:p==="-"||p==="("?"":p)+C,R=(v==="s"?B3[8+FT/3]:"")+R+(U&&p==="("?")":""),w){for(F=-1,P=k.length;++F<P;)if(I=k.charCodeAt(F),48>I||I>57){R=(I===46?r+k.slice(F+1):k.slice(F))+R,k=k.slice(0,F);break}}}A&&!g&&(k=t(k,1/0));var N=C.length+k.length+R.length,q=N<y?new Array(y-N+1).join(d):"";switch(A&&g&&(k=t(q+k,q.length?y-R.length:1/0),q=""),u){case"<":k=C+k+R+q;break;case"=":k=C+q+k+R;break;case"^":k=q.slice(0,N=q.length>>1)+C+k+R+q.slice(N);break;default:k=q+C+k+R;break}return s(k)}return E.toString=function(){return f+""},E}function c(f,d){var u=l((f=ud(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(yf(d)/3)))*3,m=Math.pow(10,-p),g=B3[8+p/3];return function(y){return u(m*y)+g}}return{format:l,formatPrefix:c}}var F0,iv,IT;lL({thousands:",",grouping:[3],currency:["$",""]});function lL(n){return F0=oL(n),iv=F0.format,IT=F0.formatPrefix,F0}function hL(n){return Math.max(0,-yf(Math.abs(n)))}function cL(n,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(yf(t)/3)))*3-yf(Math.abs(n)))}function fL(n,t){return n=Math.abs(n),t=Math.abs(t)-n,Math.max(0,yf(t)-yf(n))+1}function uL(n,t,e,i){var r=Ox(n,t,e),s;switch(i=ud(i??",f"),i.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(t));return i.precision==null&&!isNaN(s=cL(r,a))&&(i.precision=s),IT(i,a)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=fL(r,Math.max(Math.abs(n),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=hL(r))&&(i.precision=s-(i.type==="%")*2);break}}return iv(i)}function OT(n){var t=n.domain;return n.ticks=function(e){var i=t();return Fx(i[0],i[i.length-1],e??10)},n.tickFormat=function(e,i){var r=t();return uL(r[0],r[r.length-1],e??10,i)},n.nice=function(e){e==null&&(e=10);var i=t(),r=0,s=i.length-1,a=i[r],o=i[s],h,l,c=10;for(o<a&&(l=a,a=o,o=l,l=r,r=s,s=l);c-- >0;){if(l=Ix(a,o,e),l===h)return i[r]=a,i[s]=o,t(i);if(l>0)a=Math.floor(a/l)*l,o=Math.ceil(o/l)*l;else if(l<0)a=Math.ceil(a*l)/l,o=Math.floor(o*l)/l;else break;h=l}return n},n}function BT(){var n=DT();return n.copy=function(){return Q1(n,BT())},J1.apply(n,arguments),OT(n)}function zT(n,t){n=n.slice();var e=0,i=n.length-1,r=n[e],s=n[i],a;return s<r&&(a=e,e=i,i=a,a=r,r=s,s=a),n[e]=t.floor(r),n[i]=t.ceil(s),n}function z3(n){return Math.log(n)}function U3(n){return Math.exp(n)}function dL(n){return-Math.log(-n)}function pL(n){return-Math.exp(-n)}function mL(n){return isFinite(n)?+("1e"+n):n<0?0:n}function gL(n){return n===10?mL:n===Math.E?Math.exp:t=>Math.pow(n,t)}function yL(n){return n===Math.E?Math.log:n===10&&Math.log10||n===2&&Math.log2||(n=Math.log(n),t=>Math.log(t)/n)}function q3(n){return(t,e)=>-n(-t,e)}function AL(n){const t=n(z3,U3),e=t.domain;let i=10,r,s;function a(){return r=yL(i),s=gL(i),e()[0]<0?(r=q3(r),s=q3(s),n(dL,pL)):n(z3,U3),t}return t.base=function(o){return arguments.length?(i=+o,a()):i},t.domain=function(o){return arguments.length?(e(o),a()):e()},t.ticks=o=>{const h=e();let l=h[0],c=h[h.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=r(l),u=r(c),p,m;const g=o==null?10:+o;let y=[];if(!(i%1)&&u-d<g){if(d=Math.floor(d),u=Math.ceil(u),l>0){for(;d<=u;++d)for(p=1;p<i;++p)if(m=d<0?p/s(-d):p*s(d),!(m<l)){if(m>c)break;y.push(m)}}else for(;d<=u;++d)for(p=i-1;p>=1;--p)if(m=d>0?p/s(-d):p*s(d),!(m<l)){if(m>c)break;y.push(m)}y.length*2<g&&(y=Fx(l,c,g))}else y=Fx(d,u,Math.min(u-d,g)).map(s);return f?y.reverse():y},t.tickFormat=(o,h)=>{if(o==null&&(o=10),h==null&&(h=i===10?"s":","),typeof h!="function"&&(!(i%1)&&(h=ud(h)).precision==null&&(h.trim=!0),h=iv(h)),o===1/0)return h;const l=Math.max(1,i*o/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*i<i-.5&&(f*=i),f<=l?h(c):""}},t.nice=()=>e(zT(e(),{floor:o=>s(Math.floor(r(o))),ceil:o=>s(Math.ceil(r(o)))})),t}function UT(){const n=AL(tv()).domain([1,10]);return n.copy=()=>Q1(n,UT()).base(n.base()),J1.apply(n,arguments),n}function V3(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function G3(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function xL(n){var t=1,e=n(V3(t),G3(t));return e.constant=function(i){return arguments.length?n(V3(t=+i),G3(t)):t},OT(e)}function qT(){var n=xL(tv());return n.copy=function(){return Q1(n,qT()).constant(n.constant())},J1.apply(n,arguments)}const hy=new Date,cy=new Date;function Di(n,t,e,i){function r(s){return n(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(n(s=new Date(+s)),s),r.ceil=s=>(n(s=new Date(s-1)),t(s,1),n(s),s),r.round=s=>{const a=r(s),o=r.ceil(s);return s-a<o-s?a:o},r.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),r.range=(s,a,o)=>{const h=[];if(s=r.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return h;let l;do h.push(l=new Date(+s)),t(s,o),n(s);while(l<s&&s<a);return h},r.filter=s=>Di(a=>{if(a>=a)for(;n(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),e&&(r.count=(s,a)=>(hy.setTime(+s),cy.setTime(+a),n(hy),n(cy),Math.floor(e(hy,cy))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?a=>i(a)%s===0:a=>r.count(0,a)%s===0):r)),r}const $m=Di(()=>{},(n,t)=>{n.setTime(+n+t)},(n,t)=>t-n);$m.every=n=>(n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?Di(t=>{t.setTime(Math.floor(t/n)*n)},(t,e)=>{t.setTime(+t+e*n)},(t,e)=>(e-t)/n):$m);$m.range;const Ca=1e3,Lr=Ca*60,Pa=Lr*60,qa=Pa*24,nv=qa*7,$3=qa*30,fy=qa*365,kc=Di(n=>{n.setTime(n-n.getMilliseconds())},(n,t)=>{n.setTime(+n+t*Ca)},(n,t)=>(t-n)/Ca,n=>n.getUTCSeconds());kc.range;const rv=Di(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*Ca)},(n,t)=>{n.setTime(+n+t*Lr)},(n,t)=>(t-n)/Lr,n=>n.getMinutes());rv.range;const _L=Di(n=>{n.setUTCSeconds(0,0)},(n,t)=>{n.setTime(+n+t*Lr)},(n,t)=>(t-n)/Lr,n=>n.getUTCMinutes());_L.range;const sv=Di(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*Ca-n.getMinutes()*Lr)},(n,t)=>{n.setTime(+n+t*Pa)},(n,t)=>(t-n)/Pa,n=>n.getHours());sv.range;const vL=Di(n=>{n.setUTCMinutes(0,0,0)},(n,t)=>{n.setTime(+n+t*Pa)},(n,t)=>(t-n)/Pa,n=>n.getUTCHours());vL.range;const Qd=Di(n=>n.setHours(0,0,0,0),(n,t)=>n.setDate(n.getDate()+t),(n,t)=>(t-n-(t.getTimezoneOffset()-n.getTimezoneOffset())*Lr)/qa,n=>n.getDate()-1);Qd.range;const av=Di(n=>{n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCDate(n.getUTCDate()+t)},(n,t)=>(t-n)/qa,n=>n.getUTCDate()-1);av.range;const bL=Di(n=>{n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCDate(n.getUTCDate()+t)},(n,t)=>(t-n)/qa,n=>Math.floor(n/qa));bL.range;function gh(n){return Di(t=>{t.setDate(t.getDate()-(t.getDay()+7-n)%7),t.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+e*7)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Lr)/nv)}const K1=gh(0),Hm=gh(1),wL=gh(2),SL=gh(3),Af=gh(4),ML=gh(5),TL=gh(6);K1.range;Hm.range;wL.range;SL.range;Af.range;ML.range;TL.range;function yh(n){return Di(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-n)%7),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e*7)},(t,e)=>(e-t)/nv)}const VT=yh(0),Wm=yh(1),EL=yh(2),CL=yh(3),xf=yh(4),PL=yh(5),kL=yh(6);VT.range;Wm.range;EL.range;CL.range;xf.range;PL.range;kL.range;const ov=Di(n=>{n.setDate(1),n.setHours(0,0,0,0)},(n,t)=>{n.setMonth(n.getMonth()+t)},(n,t)=>t.getMonth()-n.getMonth()+(t.getFullYear()-n.getFullYear())*12,n=>n.getMonth());ov.range;const LL=Di(n=>{n.setUTCDate(1),n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCMonth(n.getUTCMonth()+t)},(n,t)=>t.getUTCMonth()-n.getUTCMonth()+(t.getUTCFullYear()-n.getUTCFullYear())*12,n=>n.getUTCMonth());LL.range;const Va=Di(n=>{n.setMonth(0,1),n.setHours(0,0,0,0)},(n,t)=>{n.setFullYear(n.getFullYear()+t)},(n,t)=>t.getFullYear()-n.getFullYear(),n=>n.getFullYear());Va.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:Di(t=>{t.setFullYear(Math.floor(t.getFullYear()/n)*n),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e*n)});Va.range;const rh=Di(n=>{n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCFullYear(n.getUTCFullYear()+t)},(n,t)=>t.getUTCFullYear()-n.getUTCFullYear(),n=>n.getUTCFullYear());rh.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:Di(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/n)*n),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e*n)});rh.range;function NL(n,t,e,i,r,s){const a=[[kc,1,Ca],[kc,5,5*Ca],[kc,15,15*Ca],[kc,30,30*Ca],[s,1,Lr],[s,5,5*Lr],[s,15,15*Lr],[s,30,30*Lr],[r,1,Pa],[r,3,3*Pa],[r,6,6*Pa],[r,12,12*Pa],[i,1,qa],[i,2,2*qa],[e,1,nv],[t,1,$3],[t,3,3*$3],[n,1,fy]];function o(l,c,f){const d=c<l;d&&([l,c]=[c,l]);const u=f&&typeof f.range=="function"?f:h(l,c,f),p=u?u.range(l,+c+1):[];return d?p.reverse():p}function h(l,c,f){const d=Math.abs(c-l)/f,u=J2(([,,g])=>g).right(a,d);if(u===a.length)return n.every(Ox(l/fy,c/fy,f));if(u===0)return $m.every(Math.max(Ox(l,c,f),1));const[p,m]=a[d/a[u-1][2]<a[u][2]/d?u-1:u];return p.every(m)}return[o,h]}const[RL,DL]=NL(Va,ov,K1,Qd,sv,rv);function uy(n){if(0<=n.y&&n.y<100){var t=new Date(-1,n.m,n.d,n.H,n.M,n.S,n.L);return t.setFullYear(n.y),t}return new Date(n.y,n.m,n.d,n.H,n.M,n.S,n.L)}function dy(n){if(0<=n.y&&n.y<100){var t=new Date(Date.UTC(-1,n.m,n.d,n.H,n.M,n.S,n.L));return t.setUTCFullYear(n.y),t}return new Date(Date.UTC(n.y,n.m,n.d,n.H,n.M,n.S,n.L))}function ru(n,t,e){return{y:n,m:t,d:e,H:0,M:0,S:0,L:0}}function FL(n){var t=n.dateTime,e=n.date,i=n.time,r=n.periods,s=n.days,a=n.shortDays,o=n.months,h=n.shortMonths,l=su(r),c=au(r),f=su(s),d=au(s),u=su(a),p=au(a),m=su(o),g=au(o),y=su(h),A=au(h),_={a:U,A:N,b:q,B:G,c:null,d:Z3,e:Z3,f:rN,g:pN,G:gN,H:eN,I:iN,j:nN,L:GT,m:sN,M:aN,p:nt,q:gt,Q:K3,s:tw,S:oN,u:lN,U:hN,V:cN,w:fN,W:uN,x:null,X:null,y:dN,Y:mN,Z:yN,"%":Q3},x={a:O,A:Y,b:X,B:j,c:null,d:J3,e:J3,f:vN,g:LN,G:RN,H:AN,I:xN,j:_N,L:HT,m:bN,M:wN,p:J,q:$,Q:K3,s:tw,S:SN,u:MN,U:TN,V:EN,w:CN,W:PN,x:null,X:null,y:kN,Y:NN,Z:DN,"%":Q3},v={a:E,A:k,b:C,B:R,c:F,d:X3,e:X3,f:JL,g:j3,G:W3,H:Y3,I:Y3,j:jL,L:ZL,m:WL,M:XL,p:w,q:HL,Q:KL,s:tN,S:YL,u:UL,U:qL,V:VL,w:zL,W:GL,x:P,X:I,y:j3,Y:W3,Z:$L,"%":QL};_.x=b(e,_),_.X=b(i,_),_.c=b(t,_),x.x=b(e,x),x.X=b(i,x),x.c=b(t,x);function b(H,Z){return function(st){var ot=[],V=-1,rt=0,at=H.length,B,et,pt;for(st instanceof Date||(st=new Date(+st));++V<at;)H.charCodeAt(V)===37&&(ot.push(H.slice(rt,V)),(et=H3[B=H.charAt(++V)])!=null?B=H.charAt(++V):et=B==="e"?" ":"0",(pt=Z[B])&&(B=pt(st,et)),ot.push(B),rt=V+1);return ot.push(H.slice(rt,V)),ot.join("")}}function M(H,Z){return function(st){var ot=ru(1900,void 0,1),V=T(ot,H,st+="",0),rt,at;if(V!=st.length)return null;if("Q"in ot)return new Date(ot.Q);if("s"in ot)return new Date(ot.s*1e3+("L"in ot?ot.L:0));if(Z&&!("Z"in ot)&&(ot.Z=0),"p"in ot&&(ot.H=ot.H%12+ot.p*12),ot.m===void 0&&(ot.m="q"in ot?ot.q:0),"V"in ot){if(ot.V<1||ot.V>53)return null;"w"in ot||(ot.w=1),"Z"in ot?(rt=dy(ru(ot.y,0,1)),at=rt.getUTCDay(),rt=at>4||at===0?Wm.ceil(rt):Wm(rt),rt=av.offset(rt,(ot.V-1)*7),ot.y=rt.getUTCFullYear(),ot.m=rt.getUTCMonth(),ot.d=rt.getUTCDate()+(ot.w+6)%7):(rt=uy(ru(ot.y,0,1)),at=rt.getDay(),rt=at>4||at===0?Hm.ceil(rt):Hm(rt),rt=Qd.offset(rt,(ot.V-1)*7),ot.y=rt.getFullYear(),ot.m=rt.getMonth(),ot.d=rt.getDate()+(ot.w+6)%7)}else("W"in ot||"U"in ot)&&("w"in ot||(ot.w="u"in ot?ot.u%7:"W"in ot?1:0),at="Z"in ot?dy(ru(ot.y,0,1)).getUTCDay():uy(ru(ot.y,0,1)).getDay(),ot.m=0,ot.d="W"in ot?(ot.w+6)%7+ot.W*7-(at+5)%7:ot.w+ot.U*7-(at+6)%7);return"Z"in ot?(ot.H+=ot.Z/100|0,ot.M+=ot.Z%100,dy(ot)):uy(ot)}}function T(H,Z,st,ot){for(var V=0,rt=Z.length,at=st.length,B,et;V<rt;){if(ot>=at)return-1;if(B=Z.charCodeAt(V++),B===37){if(B=Z.charAt(V++),et=v[B in H3?Z.charAt(V++):B],!et||(ot=et(H,st,ot))<0)return-1}else if(B!=st.charCodeAt(ot++))return-1}return ot}function w(H,Z,st){var ot=l.exec(Z.slice(st));return ot?(H.p=c.get(ot[0].toLowerCase()),st+ot[0].length):-1}function E(H,Z,st){var ot=u.exec(Z.slice(st));return ot?(H.w=p.get(ot[0].toLowerCase()),st+ot[0].length):-1}function k(H,Z,st){var ot=f.exec(Z.slice(st));return ot?(H.w=d.get(ot[0].toLowerCase()),st+ot[0].length):-1}function C(H,Z,st){var ot=y.exec(Z.slice(st));return ot?(H.m=A.get(ot[0].toLowerCase()),st+ot[0].length):-1}function R(H,Z,st){var ot=m.exec(Z.slice(st));return ot?(H.m=g.get(ot[0].toLowerCase()),st+ot[0].length):-1}function F(H,Z,st){return T(H,t,Z,st)}function P(H,Z,st){return T(H,e,Z,st)}function I(H,Z,st){return T(H,i,Z,st)}function U(H){return a[H.getDay()]}function N(H){return s[H.getDay()]}function q(H){return h[H.getMonth()]}function G(H){return o[H.getMonth()]}function nt(H){return r[+(H.getHours()>=12)]}function gt(H){return 1+~~(H.getMonth()/3)}function O(H){return a[H.getUTCDay()]}function Y(H){return s[H.getUTCDay()]}function X(H){return h[H.getUTCMonth()]}function j(H){return o[H.getUTCMonth()]}function J(H){return r[+(H.getUTCHours()>=12)]}function $(H){return 1+~~(H.getUTCMonth()/3)}return{format:function(H){var Z=b(H+="",_);return Z.toString=function(){return H},Z},parse:function(H){var Z=M(H+="",!1);return Z.toString=function(){return H},Z},utcFormat:function(H){var Z=b(H+="",x);return Z.toString=function(){return H},Z},utcParse:function(H){var Z=M(H+="",!0);return Z.toString=function(){return H},Z}}}var H3={"-":"",_:" ",0:"0"},$i=/^\s*\d+/,IL=/^%/,OL=/[\\^$*+?|[\]().{}]/g;function Oe(n,t,e){var i=n<0?"-":"",r=(i?-n:n)+"",s=r.length;return i+(s<e?new Array(e-s+1).join(t)+r:r)}function BL(n){return n.replace(OL,"\\$&")}function su(n){return new RegExp("^(?:"+n.map(BL).join("|")+")","i")}function au(n){return new Map(n.map((t,e)=>[t.toLowerCase(),e]))}function zL(n,t,e){var i=$i.exec(t.slice(e,e+1));return i?(n.w=+i[0],e+i[0].length):-1}function UL(n,t,e){var i=$i.exec(t.slice(e,e+1));return i?(n.u=+i[0],e+i[0].length):-1}function qL(n,t,e){var i=$i.exec(t.slice(e,e+2));return i?(n.U=+i[0],e+i[0].length):-1}function VL(n,t,e){var i=$i.exec(t.slice(e,e+2));return i?(n.V=+i[0],e+i[0].length):-1}function GL(n,t,e){var i=$i.exec(t.slice(e,e+2));return i?(n.W=+i[0],e+i[0].length):-1}function W3(n,t,e){var i=$i.exec(t.slice(e,e+4));return i?(n.y=+i[0],e+i[0].length):-1}function j3(n,t,e){var i=$i.exec(t.slice(e,e+2));return i?(n.y=+i[0]+(+i[0]>68?1900:2e3),e+i[0].length):-1}function $L(n,t,e){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(e,e+6));return i?(n.Z=i[1]?0:-(i[2]+(i[3]||"00")),e+i[0].length):-1}function HL(n,t,e){var i=$i.exec(t.slice(e,e+1));return i?(n.q=i[0]*3-3,e+i[0].length):-1}function WL(n,t,e){var i=$i.exec(t.slice(e,e+2));return i?(n.m=i[0]-1,e+i[0].length):-1}function X3(n,t,e){var i=$i.exec(t.slice(e,e+2));return i?(n.d=+i[0],e+i[0].length):-1}function jL(n,t,e){var i=$i.exec(t.slice(e,e+3));return i?(n.m=0,n.d=+i[0],e+i[0].length):-1}function Y3(n,t,e){var i=$i.exec(t.slice(e,e+2));return i?(n.H=+i[0],e+i[0].length):-1}function XL(n,t,e){var i=$i.exec(t.slice(e,e+2));return i?(n.M=+i[0],e+i[0].length):-1}function YL(n,t,e){var i=$i.exec(t.slice(e,e+2));return i?(n.S=+i[0],e+i[0].length):-1}function ZL(n,t,e){var i=$i.exec(t.slice(e,e+3));return i?(n.L=+i[0],e+i[0].length):-1}function JL(n,t,e){var i=$i.exec(t.slice(e,e+6));return i?(n.L=Math.floor(i[0]/1e3),e+i[0].length):-1}function QL(n,t,e){var i=IL.exec(t.slice(e,e+1));return i?e+i[0].length:-1}function KL(n,t,e){var i=$i.exec(t.slice(e));return i?(n.Q=+i[0],e+i[0].length):-1}function tN(n,t,e){var i=$i.exec(t.slice(e));return i?(n.s=+i[0],e+i[0].length):-1}function Z3(n,t){return Oe(n.getDate(),t,2)}function eN(n,t){return Oe(n.getHours(),t,2)}function iN(n,t){return Oe(n.getHours()%12||12,t,2)}function nN(n,t){return Oe(1+Qd.count(Va(n),n),t,3)}function GT(n,t){return Oe(n.getMilliseconds(),t,3)}function rN(n,t){return GT(n,t)+"000"}function sN(n,t){return Oe(n.getMonth()+1,t,2)}function aN(n,t){return Oe(n.getMinutes(),t,2)}function oN(n,t){return Oe(n.getSeconds(),t,2)}function lN(n){var t=n.getDay();return t===0?7:t}function hN(n,t){return Oe(K1.count(Va(n)-1,n),t,2)}function $T(n){var t=n.getDay();return t>=4||t===0?Af(n):Af.ceil(n)}function cN(n,t){return n=$T(n),Oe(Af.count(Va(n),n)+(Va(n).getDay()===4),t,2)}function fN(n){return n.getDay()}function uN(n,t){return Oe(Hm.count(Va(n)-1,n),t,2)}function dN(n,t){return Oe(n.getFullYear()%100,t,2)}function pN(n,t){return n=$T(n),Oe(n.getFullYear()%100,t,2)}function mN(n,t){return Oe(n.getFullYear()%1e4,t,4)}function gN(n,t){var e=n.getDay();return n=e>=4||e===0?Af(n):Af.ceil(n),Oe(n.getFullYear()%1e4,t,4)}function yN(n){var t=n.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Oe(t/60|0,"0",2)+Oe(t%60,"0",2)}function J3(n,t){return Oe(n.getUTCDate(),t,2)}function AN(n,t){return Oe(n.getUTCHours(),t,2)}function xN(n,t){return Oe(n.getUTCHours()%12||12,t,2)}function _N(n,t){return Oe(1+av.count(rh(n),n),t,3)}function HT(n,t){return Oe(n.getUTCMilliseconds(),t,3)}function vN(n,t){return HT(n,t)+"000"}function bN(n,t){return Oe(n.getUTCMonth()+1,t,2)}function wN(n,t){return Oe(n.getUTCMinutes(),t,2)}function SN(n,t){return Oe(n.getUTCSeconds(),t,2)}function MN(n){var t=n.getUTCDay();return t===0?7:t}function TN(n,t){return Oe(VT.count(rh(n)-1,n),t,2)}function WT(n){var t=n.getUTCDay();return t>=4||t===0?xf(n):xf.ceil(n)}function EN(n,t){return n=WT(n),Oe(xf.count(rh(n),n)+(rh(n).getUTCDay()===4),t,2)}function CN(n){return n.getUTCDay()}function PN(n,t){return Oe(Wm.count(rh(n)-1,n),t,2)}function kN(n,t){return Oe(n.getUTCFullYear()%100,t,2)}function LN(n,t){return n=WT(n),Oe(n.getUTCFullYear()%100,t,2)}function NN(n,t){return Oe(n.getUTCFullYear()%1e4,t,4)}function RN(n,t){var e=n.getUTCDay();return n=e>=4||e===0?xf(n):xf.ceil(n),Oe(n.getUTCFullYear()%1e4,t,4)}function DN(){return"+0000"}function Q3(){return"%"}function K3(n){return+n}function tw(n){return Math.floor(+n/1e3)}var Dh,jm,Xm,jT;FN({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function FN(n){return Dh=FL(n),jm=Dh.format,Dh.parse,Xm=Dh.utcFormat,jT=Dh.utcParse,Dh}var XT="%Y-%m-%dT%H:%M:%S.%LZ";function IN(n){return n.toISOString()}Date.prototype.toISOString||Xm(XT);function ON(n){var t=new Date(n);return isNaN(t)?null:t}+new Date("2000-01-01T00:00:00.000Z")||jT(XT);function BN(n){return new Date(n)}function zN(n){return n instanceof Date?+n:+new Date(+n)}function YT(n,t,e,i,r,s,a,o,h,l){var c=DT(),f=c.invert,d=c.domain,u=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),y=l("%a %d"),A=l("%b %d"),_=l("%B"),x=l("%Y");function v(b){return(h(b)<b?u:o(b)<b?p:a(b)<b?m:s(b)<b?g:i(b)<b?r(b)<b?y:A:e(b)<b?_:x)(b)}return c.invert=function(b){return new Date(f(b))},c.domain=function(b){return arguments.length?d(Array.from(b,zN)):d().map(BN)},c.ticks=function(b){var M=d();return n(M[0],M[M.length-1],b??10)},c.tickFormat=function(b,M){return M==null?v:l(M)},c.nice=function(b){var M=d();return(!b||typeof b.range!="function")&&(b=t(M[0],M[M.length-1],b??10)),b?d(zT(M,b)):c},c.copy=function(){return Q1(c,YT(n,t,e,i,r,s,a,o,h,l))},c}function UN(){return J1.apply(YT(RL,DL,Va,ov,K1,Qd,sv,rv,kc,jm).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function no(n){return function(){return n}}const ew=Math.abs,Ki=Math.atan2,sl=Math.cos,qN=Math.max,py=Math.min,xs=Math.sin,Lc=Math.sqrt,Fn=1e-12,dd=Math.PI,Ym=dd/2,VN=2*dd;function GN(n){return n>1?0:n<-1?dd:Math.acos(n)}function iw(n){return n>=1?Ym:n<=-1?-Ym:Math.asin(n)}function $N(n){let t=3;return n.digits=function(e){if(!arguments.length)return t;if(e==null)t=null;else{const i=Math.floor(e);if(!(i>=0))throw new RangeError(`invalid digits: ${e}`);t=i}return n},()=>new j2(t)}function HN(n){return n.innerRadius}function WN(n){return n.outerRadius}function jN(n){return n.startAngle}function XN(n){return n.endAngle}function YN(n){return n&&n.padAngle}function ZN(n,t,e,i,r,s,a,o){var h=e-n,l=i-t,c=a-r,f=o-s,d=f*h-c*l;if(!(d*d<Fn))return d=(c*(t-s)-f*(n-r))/d,[n+d*h,t+d*l]}function I0(n,t,e,i,r,s,a){var o=n-e,h=t-i,l=(a?s:-s)/Lc(o*o+h*h),c=l*h,f=-l*o,d=n+c,u=t+f,p=e+c,m=i+f,g=(d+p)/2,y=(u+m)/2,A=p-d,_=m-u,x=A*A+_*_,v=r-s,b=d*m-p*u,M=(_<0?-1:1)*Lc(qN(0,v*v*x-b*b)),T=(b*_-A*M)/x,w=(-b*A-_*M)/x,E=(b*_+A*M)/x,k=(-b*A+_*M)/x,C=T-g,R=w-y,F=E-g,P=k-y;return C*C+R*R>F*F+P*P&&(T=E,w=k),{cx:T,cy:w,x01:-c,y01:-f,x11:T*(r/v-1),y11:w*(r/v-1)}}function OJ(){var n=HN,t=WN,e=no(0),i=null,r=jN,s=XN,a=YN,o=null,h=$N(l);function l(){var c,f,d=+n.apply(this,arguments),u=+t.apply(this,arguments),p=r.apply(this,arguments)-Ym,m=s.apply(this,arguments)-Ym,g=ew(m-p),y=m>p;if(o||(o=c=h()),u<d&&(f=u,u=d,d=f),!(u>Fn))o.moveTo(0,0);else if(g>VN-Fn)o.moveTo(u*sl(p),u*xs(p)),o.arc(0,0,u,p,m,!y),d>Fn&&(o.moveTo(d*sl(m),d*xs(m)),o.arc(0,0,d,m,p,y));else{var A=p,_=m,x=p,v=m,b=g,M=g,T=a.apply(this,arguments)/2,w=T>Fn&&(i?+i.apply(this,arguments):Lc(d*d+u*u)),E=py(ew(u-d)/2,+e.apply(this,arguments)),k=E,C=E,R,F;if(w>Fn){var P=iw(w/d*xs(T)),I=iw(w/u*xs(T));(b-=P*2)>Fn?(P*=y?1:-1,x+=P,v-=P):(b=0,x=v=(p+m)/2),(M-=I*2)>Fn?(I*=y?1:-1,A+=I,_-=I):(M=0,A=_=(p+m)/2)}var U=u*sl(A),N=u*xs(A),q=d*sl(v),G=d*xs(v);if(E>Fn){var nt=u*sl(_),gt=u*xs(_),O=d*sl(x),Y=d*xs(x),X;if(g<dd)if(X=ZN(U,N,O,Y,nt,gt,q,G)){var j=U-X[0],J=N-X[1],$=nt-X[0],H=gt-X[1],Z=1/xs(GN((j*$+J*H)/(Lc(j*j+J*J)*Lc($*$+H*H)))/2),st=Lc(X[0]*X[0]+X[1]*X[1]);k=py(E,(d-st)/(Z-1)),C=py(E,(u-st)/(Z+1))}else k=C=0}M>Fn?C>Fn?(R=I0(O,Y,U,N,u,C,y),F=I0(nt,gt,q,G,u,C,y),o.moveTo(R.cx+R.x01,R.cy+R.y01),C<E?o.arc(R.cx,R.cy,C,Ki(R.y01,R.x01),Ki(F.y01,F.x01),!y):(o.arc(R.cx,R.cy,C,Ki(R.y01,R.x01),Ki(R.y11,R.x11),!y),o.arc(0,0,u,Ki(R.cy+R.y11,R.cx+R.x11),Ki(F.cy+F.y11,F.cx+F.x11),!y),o.arc(F.cx,F.cy,C,Ki(F.y11,F.x11),Ki(F.y01,F.x01),!y))):(o.moveTo(U,N),o.arc(0,0,u,A,_,!y)):o.moveTo(U,N),!(d>Fn)||!(b>Fn)?o.lineTo(q,G):k>Fn?(R=I0(q,G,nt,gt,d,-k,y),F=I0(U,N,O,Y,d,-k,y),o.lineTo(R.cx+R.x01,R.cy+R.y01),k<E?o.arc(R.cx,R.cy,k,Ki(R.y01,R.x01),Ki(F.y01,F.x01),!y):(o.arc(R.cx,R.cy,k,Ki(R.y01,R.x01),Ki(R.y11,R.x11),!y),o.arc(0,0,d,Ki(R.cy+R.y11,R.cx+R.x11),Ki(F.cy+F.y11,F.cx+F.x11),y),o.arc(F.cx,F.cy,k,Ki(F.y11,F.x11),Ki(F.y01,F.x01),!y))):o.arc(0,0,d,v,x,y)}if(o.closePath(),c)return o=null,c+""||null}return l.centroid=function(){var c=(+n.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-dd/2;return[sl(f)*c,xs(f)*c]},l.innerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:no(+c),l):n},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:no(+c),l):t},l.cornerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:no(+c),l):e},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:no(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:no(+c),l):r},l.endAngle=function(c){return arguments.length?(s=typeof c=="function"?c:no(+c),l):s},l.padAngle=function(c){return arguments.length?(a=typeof c=="function"?c:no(+c),l):a},l.context=function(c){return arguments.length?(o=c??null,l):o},l}var _f=0,Nu=0,ou=0,ZT=1e3,Zm,Ru,Jm=0,sh=0,tg=0,pd=typeof performance=="object"&&performance.now?performance:Date,JT=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function lv(){return sh||(JT(JN),sh=pd.now()+tg)}function JN(){sh=0}function Qm(){this._call=this._time=this._next=null}Qm.prototype=QT.prototype={constructor:Qm,restart:function(n,t,e){if(typeof n!="function")throw new TypeError("callback is not a function");e=(e==null?lv():+e)+(t==null?0:+t),!this._next&&Ru!==this&&(Ru?Ru._next=this:Zm=this,Ru=this),this._call=n,this._time=e,qx()},stop:function(){this._call&&(this._call=null,this._time=1/0,qx())}};function QT(n,t,e){var i=new Qm;return i.restart(n,t,e),i}function QN(){lv(),++_f;for(var n=Zm,t;n;)(t=sh-n._time)>=0&&n._call.call(void 0,t),n=n._next;--_f}function nw(){sh=(Jm=pd.now())+tg,_f=Nu=0;try{QN()}finally{_f=0,tR(),sh=0}}function KN(){var n=pd.now(),t=n-Jm;t>ZT&&(tg-=t,Jm=n)}function tR(){for(var n,t=Zm,e,i=1/0;t;)t._call?(i>t._time&&(i=t._time),n=t,t=t._next):(e=t._next,t._next=null,t=n?n._next=e:Zm=e);Ru=n,qx(i)}function qx(n){if(!_f){Nu&&(Nu=clearTimeout(Nu));var t=n-sh;t>24?(n<1/0&&(Nu=setTimeout(nw,n-pd.now()-tg)),ou&&(ou=clearInterval(ou))):(ou||(Jm=pd.now(),ou=setInterval(KN,ZT)),_f=1,JT(nw))}}function rw(n,t,e){var i=new Qm;return t=t==null?0:+t,i.restart(r=>{i.stop(),n(r+t)},t,e),i}var eR=X2("start","end","cancel","interrupt"),iR=[],KT=0,sw=1,Vx=2,cm=3,aw=4,Gx=5,fm=6;function eg(n,t,e,i,r,s){var a=n.__transition;if(!a)n.__transition={};else if(e in a)return;nR(n,e,{name:t,index:i,group:r,on:eR,tween:iR,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:KT})}function hv(n,t){var e=ys(n,t);if(e.state>KT)throw new Error("too late; already scheduled");return e}function $s(n,t){var e=ys(n,t);if(e.state>cm)throw new Error("too late; already running");return e}function ys(n,t){var e=n.__transition;if(!e||!(e=e[t]))throw new Error("transition not found");return e}function nR(n,t,e){var i=n.__transition,r;i[t]=e,e.timer=QT(s,0,e.time);function s(l){e.state=sw,e.timer.restart(a,e.delay,e.time),e.delay<=l&&a(l-e.delay)}function a(l){var c,f,d,u;if(e.state!==sw)return h();for(c in i)if(u=i[c],u.name===e.name){if(u.state===cm)return rw(a);u.state===aw?(u.state=fm,u.timer.stop(),u.on.call("interrupt",n,n.__data__,u.index,u.group),delete i[c]):+c<t&&(u.state=fm,u.timer.stop(),u.on.call("cancel",n,n.__data__,u.index,u.group),delete i[c])}if(rw(function(){e.state===cm&&(e.state=aw,e.timer.restart(o,e.delay,e.time),o(l))}),e.state=Vx,e.on.call("start",n,n.__data__,e.index,e.group),e.state===Vx){for(e.state=cm,r=new Array(d=e.tween.length),c=0,f=-1;c<d;++c)(u=e.tween[c].value.call(n,n.__data__,e.index,e.group))&&(r[++f]=u);r.length=f+1}}function o(l){for(var c=l<e.duration?e.ease.call(null,l/e.duration):(e.timer.restart(h),e.state=Gx,1),f=-1,d=r.length;++f<d;)r[f].call(n,c);e.state===Gx&&(e.on.call("end",n,n.__data__,e.index,e.group),h())}function h(){e.state=fm,e.timer.stop(),delete i[t];for(var l in i)return;delete n.__transition}}function rR(n,t){var e=n.__transition,i,r,s=!0,a;if(e){t=t==null?null:t+"";for(a in e){if((i=e[a]).name!==t){s=!1;continue}r=i.state>Vx&&i.state<Gx,i.state=fm,i.timer.stop(),i.on.call(r?"interrupt":"cancel",n,n.__data__,i.index,i.group),delete e[a]}s&&delete n.__transition}}function sR(n){return this.each(function(){rR(this,n)})}function aR(n,t){var e,i;return function(){var r=$s(this,n),s=r.tween;if(s!==e){i=e=s;for(var a=0,o=i.length;a<o;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}r.tween=i}}function oR(n,t,e){var i,r;if(typeof e!="function")throw new Error;return function(){var s=$s(this,n),a=s.tween;if(a!==i){r=(i=a).slice();for(var o={name:t,value:e},h=0,l=r.length;h<l;++h)if(r[h].name===t){r[h]=o;break}h===l&&r.push(o)}s.tween=r}}function lR(n,t){var e=this._id;if(n+="",arguments.length<2){for(var i=ys(this.node(),e).tween,r=0,s=i.length,a;r<s;++r)if((a=i[r]).name===n)return a.value;return null}return this.each((t==null?aR:oR)(e,n,t))}function cv(n,t,e){var i=n._id;return n.each(function(){var r=$s(this,i);(r.value||(r.value={}))[t]=e.apply(this,arguments)}),function(r){return ys(r,i).value[t]}}function t6(n,t){var e;return(typeof t=="number"?is:t instanceof Pn?Vm:(e=Pn(t))?(t=e,Vm):LT)(n,t)}function hR(n){return function(){this.removeAttribute(n)}}function cR(n){return function(){this.removeAttributeNS(n.space,n.local)}}function fR(n,t,e){var i,r=e+"",s;return function(){var a=this.getAttribute(n);return a===r?null:a===i?s:s=t(i=a,e)}}function uR(n,t,e){var i,r=e+"",s;return function(){var a=this.getAttributeNS(n.space,n.local);return a===r?null:a===i?s:s=t(i=a,e)}}function dR(n,t,e){var i,r,s;return function(){var a,o=e(this),h;return o==null?void this.removeAttribute(n):(a=this.getAttribute(n),h=o+"",a===h?null:a===i&&h===r?s:(r=h,s=t(i=a,o)))}}function pR(n,t,e){var i,r,s;return function(){var a,o=e(this),h;return o==null?void this.removeAttributeNS(n.space,n.local):(a=this.getAttributeNS(n.space,n.local),h=o+"",a===h?null:a===i&&h===r?s:(r=h,s=t(i=a,o)))}}function mR(n,t){var e=Z1(n),i=e==="transform"?Yk:t6;return this.attrTween(n,typeof t=="function"?(e.local?pR:dR)(e,i,cv(this,"attr."+n,t)):t==null?(e.local?cR:hR)(e):(e.local?uR:fR)(e,i,t))}function gR(n,t){return function(e){this.setAttribute(n,t.call(this,e))}}function yR(n,t){return function(e){this.setAttributeNS(n.space,n.local,t.call(this,e))}}function AR(n,t){var e,i;function r(){var s=t.apply(this,arguments);return s!==i&&(e=(i=s)&&yR(n,s)),e}return r._value=t,r}function xR(n,t){var e,i;function r(){var s=t.apply(this,arguments);return s!==i&&(e=(i=s)&&gR(n,s)),e}return r._value=t,r}function _R(n,t){var e="attr."+n;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;var i=Z1(n);return this.tween(e,(i.local?AR:xR)(i,t))}function vR(n,t){return function(){hv(this,n).delay=+t.apply(this,arguments)}}function bR(n,t){return t=+t,function(){hv(this,n).delay=t}}function wR(n){var t=this._id;return arguments.length?this.each((typeof n=="function"?vR:bR)(t,n)):ys(this.node(),t).delay}function SR(n,t){return function(){$s(this,n).duration=+t.apply(this,arguments)}}function MR(n,t){return t=+t,function(){$s(this,n).duration=t}}function TR(n){var t=this._id;return arguments.length?this.each((typeof n=="function"?SR:MR)(t,n)):ys(this.node(),t).duration}function ER(n,t){if(typeof t!="function")throw new Error;return function(){$s(this,n).ease=t}}function CR(n){var t=this._id;return arguments.length?this.each(ER(t,n)):ys(this.node(),t).ease}function PR(n,t){return function(){var e=t.apply(this,arguments);if(typeof e!="function")throw new Error;$s(this,n).ease=e}}function kR(n){if(typeof n!="function")throw new Error;return this.each(PR(this._id,n))}function LR(n){typeof n!="function"&&(n=xT(n));for(var t=this._groups,e=t.length,i=new Array(e),r=0;r<e;++r)for(var s=t[r],a=s.length,o=i[r]=[],h,l=0;l<a;++l)(h=s[l])&&n.call(h,h.__data__,l,s)&&o.push(h);return new Ga(i,this._parents,this._name,this._id)}function NR(n){if(n._id!==this._id)throw new Error;for(var t=this._groups,e=n._groups,i=t.length,r=e.length,s=Math.min(i,r),a=new Array(i),o=0;o<s;++o)for(var h=t[o],l=e[o],c=h.length,f=a[o]=new Array(c),d,u=0;u<c;++u)(d=h[u]||l[u])&&(f[u]=d);for(;o<i;++o)a[o]=t[o];return new Ga(a,this._parents,this._name,this._id)}function RR(n){return(n+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||t==="start"})}function DR(n,t,e){var i,r,s=RR(t)?hv:$s;return function(){var a=s(this,n),o=a.on;o!==i&&(r=(i=o).copy()).on(t,e),a.on=r}}function FR(n,t){var e=this._id;return arguments.length<2?ys(this.node(),e).on.on(n):this.each(DR(e,n,t))}function IR(n){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==n)return;t&&t.removeChild(this)}}function OR(){return this.on("end.remove",IR(this._id))}function BR(n){var t=this._name,e=this._id;typeof n!="function"&&(n=Y2(n));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a<r;++a)for(var o=i[a],h=o.length,l=s[a]=new Array(h),c,f,d=0;d<h;++d)(c=o[d])&&(f=n.call(c,c.__data__,d,o))&&("__data__"in c&&(f.__data__=c.__data__),l[d]=f,eg(l[d],t,e,d,l,ys(c,e)));return new Ga(s,this._parents,t,e)}function zR(n){var t=this._name,e=this._id;typeof n!="function"&&(n=AT(n));for(var i=this._groups,r=i.length,s=[],a=[],o=0;o<r;++o)for(var h=i[o],l=h.length,c,f=0;f<l;++f)if(c=h[f]){for(var d=n.call(c,c.__data__,f,h),u,p=ys(c,e),m=0,g=d.length;m<g;++m)(u=d[m])&&eg(u,t,e,m,d,p);s.push(d),a.push(c)}return new Ga(s,a,t,e)}var UR=Jd.prototype.constructor;function qR(){return new UR(this._groups,this._parents)}function VR(n,t){var e,i,r;return function(){var s=gf(this,n),a=(this.style.removeProperty(n),gf(this,n));return s===a?null:s===e&&a===i?r:r=t(e=s,i=a)}}function e6(n){return function(){this.style.removeProperty(n)}}function GR(n,t,e){var i,r=e+"",s;return function(){var a=gf(this,n);return a===r?null:a===i?s:s=t(i=a,e)}}function $R(n,t,e){var i,r,s;return function(){var a=gf(this,n),o=e(this),h=o+"";return o==null&&(h=o=(this.style.removeProperty(n),gf(this,n))),a===h?null:a===i&&h===r?s:(r=h,s=t(i=a,o))}}function HR(n,t){var e,i,r,s="style."+t,a="end."+s,o;return function(){var h=$s(this,n),l=h.on,c=h.value[s]==null?o||(o=e6(t)):void 0;(l!==e||r!==c)&&(i=(e=l).copy()).on(a,r=c),h.on=i}}function WR(n,t,e){var i=(n+="")=="transform"?Xk:t6;return t==null?this.styleTween(n,VR(n,i)).on("end.style."+n,e6(n)):typeof t=="function"?this.styleTween(n,$R(n,i,cv(this,"style."+n,t))).each(HR(this._id,n)):this.styleTween(n,GR(n,i,t),e).on("end.style."+n,null)}function jR(n,t,e){return function(i){this.style.setProperty(n,t.call(this,i),e)}}function XR(n,t,e){var i,r;function s(){var a=t.apply(this,arguments);return a!==r&&(i=(r=a)&&jR(n,a,e)),i}return s._value=t,s}function YR(n,t,e){var i="style."+(n+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,XR(n,t,e??""))}function ZR(n){return function(){this.textContent=n}}function JR(n){return function(){var t=n(this);this.textContent=t??""}}function QR(n){return this.tween("text",typeof n=="function"?JR(cv(this,"text",n)):ZR(n==null?"":n+""))}function KR(n){return function(t){this.textContent=n.call(this,t)}}function tD(n){var t,e;function i(){var r=n.apply(this,arguments);return r!==e&&(t=(e=r)&&KR(r)),t}return i._value=n,i}function eD(n){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(n==null)return this.tween(t,null);if(typeof n!="function")throw new Error;return this.tween(t,tD(n))}function iD(){for(var n=this._name,t=this._id,e=i6(),i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,h,l=0;l<o;++l)if(h=a[l]){var c=ys(h,t);eg(h,n,e,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ga(i,this._parents,n,e)}function nD(){var n,t,e=this,i=e._id,r=e.size();return new Promise(function(s,a){var o={value:a},h={value:function(){--r===0&&s()}};e.each(function(){var l=$s(this,i),c=l.on;c!==n&&(t=(n=c).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(h)),l.on=t}),r===0&&s()})}var rD=0;function Ga(n,t,e,i){this._groups=n,this._parents=t,this._name=e,this._id=i}function i6(){return++rD}var Ks=Jd.prototype;Ga.prototype={constructor:Ga,select:BR,selectAll:zR,selectChild:Ks.selectChild,selectChildren:Ks.selectChildren,filter:LR,merge:NR,selection:qR,transition:iD,call:Ks.call,nodes:Ks.nodes,node:Ks.node,size:Ks.size,empty:Ks.empty,each:Ks.each,on:FR,attr:mR,attrTween:_R,style:WR,styleTween:YR,text:QR,textTween:eD,remove:OR,tween:lR,delay:wR,duration:TR,ease:CR,easeVarying:kR,end:nD,[Symbol.iterator]:Ks[Symbol.iterator]};function sD(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var aD={time:null,delay:0,duration:250,ease:sD};function oD(n,t){for(var e;!(e=n.__transition)||!(e=e[t]);)if(!(n=n.parentNode))throw new Error(`transition ${t} not found`);return e}function lD(n){var t,e;n instanceof Ga?(t=n._id,n=n._name):(t=i6(),(e=aD).time=lv(),n=n==null?null:n+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,h,l=0;l<o;++l)(h=a[l])&&eg(h,n,t,l,a,e||oD(h,t));return new Ga(i,this._parents,n,t)}Jd.prototype.interrupt=sR;Jd.prototype.transition=lD;const Km="TLinearGradient",t1="TRadialGradient",BJ=0,zJ=1;function Ss(n,t=255){return Math.round(n*t).toString(10)}function hD(n){const t=n.toFixed(2);return t.length===4&&t[3]==="0"?t.slice(0,3):t}function fv(n,t,e,i=1){return i!==void 0&&i!==1?`rgba(${Ss(n)}, ${Ss(t)}, ${Ss(e)}, ${hD(i)})`:`rgb(${Ss(n)}, ${Ss(t)}, ${Ss(e)})`}function UJ(n){return(Se()||Ci()&&tt.ApproxTextSize)&&(n[0]==="#"||n[0]==="r")?Pn(n).formatRgb():n}let $a=[];function cD(){function n(i){const r=Number.parseInt(i.slice(0,2),16),s=Number.parseInt(i.slice(2,4),16),a=Number.parseInt(i.slice(4,6),16);return`rgb(${r}, ${s}, ${a})`}const t=["white","black","red","green","blue","yellow","magenta","cyan",n("59d454"),n("5954d9"),"white"];t[110]="white",[{n:11,s:"c1b7ad4d4d4d6666668080809a9a9ab3b3b3cdcdcde6e6e6f3f3f3cdc8accdc8acc3c0a9bbb6a4b3a697b8a49cae9a8d9c8f83886657b1cfc885c3a48aa9a1839f8daebdc87b8f9a768a926983976e7b857d9ad280809caca6c0d4cf88dfbb88bd9f83c89a7dc08378cf5f61ac8f94a6787b946971d45a549300ff7b00ff6300ff4b00ff3300ff1b00ff0300ff0014ff002cff0044ff005cff0074ff008cff00a4ff00bcff00d4ff00ecff00fffd00ffe500ffcd00ffb500ff9d00ff8500ff6d00ff5500ff3d00ff2600ff0e0aff0022ff003aff0052ff006aff0082ff009aff00b1ff00c9ff00e1ff00f9ff00ffef00ffd700ffbf00ffa700ff8f00ff7700ff6000ff4800ff3000ff18006f2da8a52a2ab2beb55790fcf89c20e42536964a8b9c9ca17a21dd1845fbff5e02c91f16c849a9adad7d86c8dd578dff6563643f90daffa90ebd1f0194a4a2832db6a96b59e76300b9ac7071758192daddb2b2b2"},{n:201,s:"5c5c5c7b7b7bb8b8b8d7d7d78a0f0fb81414ec4848f176760f8a0f14b81448ec4876f1760f0f8a1414b84848ec7676f18a8a0fb8b814ecec48f1f1768a0f8ab814b8ec48ecf176f10f8a8a14b8b848ecec76f1f1"},{n:390,s:"ffffcdffff9acdcd9affff66cdcd669a9a66ffff33cdcd339a9a33666633ffff00cdcd009a9a00666600333300"},{n:406,s:"cdffcd9aff9a9acd9a66ff6666cd66669a6633ff3333cd33339a3333663300ff0000cd00009a00006600003300"},{n:422,s:"cdffff9affff9acdcd66ffff66cdcd669a9a33ffff33cdcd339a9a33666600ffff00cdcd009a9a006666003333"},{n:590,s:"cdcdff9a9aff9a9acd6666ff6666cd66669a3333ff3333cd33339a3333660000ff0000cd00009a000066000033"},{n:606,s:"ffcdffff9affcd9acdff66ffcd66cd9a669aff33ffcd33cd9a339a663366ff00ffcd00cd9a009a660066330033"},{n:622,s:"ffcdcdff9a9acd9a9aff6666cd66669a6666ff3333cd33339a3333663333ff0000cd00009a0000660000330000"},{n:791,s:"ffcd9acd9a669a66339a6600cd9a33ffcd66ff9a00ffcd33cd9a00ffcd00ff9a33cd66006633009a3300cd6633ff9a66ff6600ff6633cd3300ff33009aff3366cd00336600339a0066cd339aff6666ff0066ff3333cd0033ff00cdff9a9acd66669a33669a009acd33cdff669aff00cdff339acd00cdff009affcd66cd9a339a66009a6633cd9a66ffcd00ff6633ffcd00cd9a00ffcd33ff9a00cd66006633009a3333cd6666ff9a00ff9a33ff6600cd3300ff339acdff669acd33669a00339a3366cd669aff0066ff3366ff0033cd0033ff339aff0066cd00336600669a339acd66cdff009aff33cdff009acd00cdffcd9aff9a66cd66339a66009a9a33cdcd66ff9a00ffcd33ff9a00cdcd00ff9a33ff6600cd33006633009a6633cd9a66ff6600ff6633ff3300cd3300ffff339acd00666600339a0033cd3366ff669aff0066ff3366cd0033ff0033ff9acdcd669a9a33669a0066cd339aff66cdff009acd009aff33cdff009a"},{n:920,s:"cdcdcd9a9a9a666666333333"}].forEach(i=>{const r=i.s;for(let s=0;s<r.length;s+=6){const a=i.n+s/6;t[a]=n(r.slice(s,s+6))}}),$a=t}function $l(){return $a}function md(n){if(n?._typename!==ph)return null;const t=fv(n.fRed,n.fGreen,n.fBlue,n.fAlpha);switch(t){case"rgb(255, 255, 255)":return"white";case"rgb(0, 0, 0)":return"black";case"rgb(255, 0, 0)":return"red";case"rgb(0, 255, 0)":return"green";case"rgb(0, 0, 255)":return"blue";case"rgb(255, 255, 0)":return"yellow";case"rgb(255, 0, 255)":return"magenta";case"rgb(0, 255, 255)":return"cyan"}return t}function uv(n){const t=[];n||(n=$l());for(let e=0;e<n.length;++e){if(!n[e])continue;const i=Pn(n[e]),r=.299*i.r+.587*i.g+.114*i.b;i.r=i.g=i.b=r,t[e]=i.formatRgb()}return t}function $x(n,t,e){if(!n){n=[];for(let r=0;r<$a.length;++r)n[r]=$a[r]}if(!t)return n;let i=t;if(t._typename&&t.arr){i=[];for(let r=0;r<t.arr.length;++r){const s=t.arr[r];if(s?._typename===Km||s?._typename===t1){i[s.fNumber]=s,s.toString=()=>"white";continue}s?._typename===ph&&s.fNumber>=0&&s.fNumber<=1e4&&(i[s.fNumber]=md(s))}}for(let r=0;r<i.length;++r)i[r]&&n[r]!==i[r]&&(n[r]=i[r]);return e?uv(n):n}function ow(n){$x($a,n)}function Xi(n){return $a[n]}function n6(n){if(!n)return-1;for(let t=0;t<$a.length;++t)if($a[t]===n)return t;return-1}function fD(n,t,e){return t||(t=$a),n[0]==="#"&&(Se()||Ci()&&tt.ApproxTextSize)&&(n=Pn(n).formatRgb()),e!==void 0?(Number.isInteger(e)&&e>0&&(t[e]=n),e):(e=t.indexOf(n),e>=0?e:(t.push(n),t.length-1))}class Hc{constructor(t,e){this.palette=e?uv(t):t}calcColorIndex(t,e){const i=this.palette.length,r=Math.floor((t+.99)*i/(e-1));return r>i-1?i-1:r}getColor(t){return this.palette[t]}getLength(){return this.palette.length}calcColor(t,e){return this.getColor(this.calcColorIndex(t,e))}}function lw(n){const t=(o,h,l)=>(l<0&&(l+=1),l>1&&(l-=1),l<.16666666666666666?o+(h-o)*6*l:l<.5?h:l<.6666666666666666?o+(h-o)*(.6666666666666666-l)*6:o),e=(o,h,l)=>{const c=h+l-h*l,f=2*h-c,d=t(f,c,o+1/3),u=t(f,c,o),p=t(f,c,o-1/3);return fv(d,u,p)},a=[];for(let o=0;o<50;++o){const h=(280-(o+1)*5.6)/360;a.push(e(h,.5,1))}return new Hc(a,n)}function uD(){const n=[];for(let t=0;t<50;++t){const e=Ss((t+2)/60);n.push(`rgb(${e}, ${e}, ${e})`)}return new Hc(n)}function dD(n,t){if(n=n||tt.Palette,n>0&&n<10)return uD();if(n<51)return lw(t);n>113&&(n=57);const e=[0,.125,.25,.375,.5,.625,.75,.875,1];let i;switch(n){case 51:i=[[0,9,13,17,24,32,27,25,29],[0,0,0,2,37,74,113,160,221],[28,42,59,78,98,129,154,184,221]];break;case 52:i=[[0,32,64,96,128,160,192,224,255],[0,32,64,96,128,160,192,224,255],[0,32,64,96,128,160,192,224,255]];break;case 53:i=[[0,45,99,156,212,230,237,234,242],[0,0,0,45,101,168,238,238,243],[0,1,1,3,9,8,11,95,230]];break;case 54:i=[[0,22,44,68,93,124,160,192,237],[0,16,41,67,93,125,162,194,241],[97,100,99,99,93,68,44,26,74]];break;case 55:i=[[0,5,15,35,102,196,208,199,110],[0,48,124,192,206,226,97,16,0],[99,142,198,201,90,22,13,8,2]];break;case 56:i=[[242,234,237,230,212,156,99,45,0],[243,238,238,168,101,45,0,0,0],[230,95,11,8,9,3,1,1,0]];break;case 57:i=[[53.091,15.096,19.89,5.916,45.951,135.1755,208.743,253.878,248.982],[42.432,91.7745,128.5455,163.6845,183.039,191.046,186.864,200.481,250.716],[134.9715,221.442,213.8175,201.807,163.8375,118.881,89.2245,50.184,13.7445]];break;case 58:i=[[0,24,2,54,176,236,202,194,255],[0,29,92,129,117,120,176,236,255],[0,68,80,34,57,172,252,245,255]];break;case 59:i=[[13,23,25,63,76,104,137,161,206],[95,67,37,21,0,12,35,52,79],[4,3,2,6,11,22,49,98,208]];break;case 60:i=[[0,61,89,122,143,160,185,204,231],[0,0,0,0,14,37,72,132,235],[0,140,224,144,4,5,6,9,13]];break;case 61:i=[[14,7,2,0,5,11,55,131,229],[105,56,26,1,42,74,131,171,229],[2,21,35,60,92,113,160,185,229]];break;case 62:i=[[0,0,0,70,148,231,235,237,244],[0,0,0,0,0,69,67,216,244],[0,102,228,231,177,124,137,20,244]];break;case 63:i=[[50,56,63,68,93,121,165,192,241],[66,81,91,96,111,128,155,189,241],[97,91,75,65,77,103,143,167,217]];break;case 64:i=[[145,166,167,156,131,114,101,112,132],[158,178,179,181,163,154,144,152,159],[190,199,201,192,176,169,160,166,190]];break;case 65:i=[[93,91,99,108,130,125,132,155,174],[126,124,128,129,131,121,119,153,173],[103,94,87,85,80,85,107,120,146]];break;case 66:i=[[24,40,69,90,104,114,120,132,103],[29,52,94,127,150,162,159,151,101],[29,52,96,132,162,181,184,186,131]];break;case 67:i=[[46,38,61,92,113,121,132,150,191],[46,36,40,69,110,135,131,92,34],[46,80,74,70,81,105,165,211,225]];break;case 68:i=[[0,4,12,30,52,101,142,190,237],[0,40,86,121,140,172,187,213,240],[0,9,14,18,21,23,27,35,101]];break;case 69:i=[[198,206,206,211,198,181,161,171,244],[103,133,150,172,178,174,163,175,244],[49,54,55,66,91,130,184,224,244]];break;case 70:i=[[243,243,240,240,241,239,186,151,129],[0,46,99,149,194,220,183,166,147],[6,8,36,91,169,235,246,240,233]];break;case 71:i=[[22,19,19,25,35,53,88,139,210],[0,32,69,108,135,159,183,198,215],[77,96,110,116,110,100,90,78,70]];break;case 72:i=[[68,116,165,182,189,180,145,111,71],[37,82,135,178,204,225,221,202,147],[16,55,105,147,196,226,232,224,178]];break;case 73:i=[[61,99,136,181,213,225,198,136,24],[149,140,96,83,132,178,190,135,22],[214,203,168,135,110,100,111,113,22]];break;case 74:i=[[76,120,156,183,197,180,162,154,140],[34,35,42,69,102,137,164,188,197],[64,69,78,105,142,177,205,217,198]];break;case 75:i=[[37,102,157,188,196,214,223,235,251],[37,29,25,37,67,91,132,185,251],[37,32,33,45,66,98,137,187,251]];break;case 76:i=[[79,100,119,137,153,172,192,205,250],[63,79,93,103,115,135,167,196,250],[51,59,66,61,62,70,110,160,250]];break;case 77:i=[[43,44,50,66,125,172,178,155,157],[63,63,85,101,138,163,122,51,39],[121,101,58,44,47,55,57,44,43]];break;case 78:i=[[0,41,62,79,90,87,99,140,228],[0,57,81,93,85,70,71,125,228],[95,91,91,82,60,43,44,112,228]];break;case 79:i=[[49,59,72,88,114,141,176,205,222],[78,72,66,57,59,75,106,142,173],[78,55,46,40,39,39,40,41,47]];break;case 80:i=[[243,222,201,185,165,158,166,187,219],[94,108,132,135,125,96,68,51,61],[7,9,12,19,45,89,118,146,118]];break;case 81:i=[[19,44,74,105,137,166,194,206,220],[19,28,40,55,82,110,159,181,220],[19,42,68,96,129,157,188,203,220]];break;case 82:i=[[33,44,70,99,140,165,199,211,216],[38,50,76,105,140,165,191,189,167],[55,67,97,124,140,166,163,129,52]];break;case 83:i=[[0,33,73,124,136,152,159,171,223],[0,43,92,124,134,126,121,144,223],[0,43,68,76,73,64,72,114,223]];break;case 84:i=[[5,18,45,124,193,223,205,128,49],[48,134,207,230,193,113,28,0,7],[6,15,41,121,193,226,208,130,49]];break;case 85:i=[[180,106,104,135,164,188,189,165,144],[72,126,154,184,198,207,205,190,179],[41,120,158,188,194,181,145,100,62]];break;case 86:i=[[57,72,94,117,136,154,174,192,215],[0,33,68,109,140,171,192,196,209],[116,137,173,201,200,201,203,190,187]];break;case 87:i=[[31,71,123,160,210,222,214,199,183],[40,117,171,211,231,220,190,132,65],[234,214,228,222,210,160,105,60,34]];break;case 88:i=[[123,108,109,126,154,172,188,196,218],[184,138,130,133,154,175,188,196,218],[208,130,109,99,110,122,150,171,218]];break;case 89:i=[[105,106,122,143,159,172,176,181,207],[252,197,194,187,174,162,153,136,125],[146,133,144,155,163,167,166,162,174]];break;case 90:i=[[171,141,145,152,154,159,163,158,177],[236,143,100,63,53,55,44,31,6],[59,48,46,44,42,54,82,112,179]];break;case 91:i=[[180,190,209,223,204,228,205,152,91],[93,125,147,172,181,224,233,198,158],[236,218,160,133,114,132,162,220,218]];break;case 92:i=[[225,183,162,135,115,111,119,145,211],[205,177,166,135,124,117,117,132,172],[186,165,155,135,126,130,150,178,226]];break;case 93:i=[[39,43,59,63,80,116,153,177,223],[39,43,59,74,91,114,139,165,223],[39,50,59,70,85,115,151,176,223]];break;case 94:i=[[0,38,60,76,84,89,101,128,204],[0,10,15,23,35,57,83,123,199],[0,11,22,40,63,86,97,94,85]];break;case 95:i=[[94,112,141,165,167,140,91,49,27],[27,46,88,135,166,161,135,97,58],[42,52,81,106,139,158,155,137,116]];break;case 96:i=[[30,49,79,117,135,151,146,138,147],[63,60,72,90,94,94,68,46,16],[18,28,41,56,62,63,50,36,21]];break;case 97:i=[[0,30,63,101,143,152,169,187,230],[0,14,28,42,58,61,67,74,91],[39,26,21,18,15,14,14,13,13]];break;case 98:i=[[149,140,164,179,182,181,131,87,61],[62,70,107,136,144,138,117,87,74],[40,38,45,49,49,49,38,32,34]];break;case 99:i=[[99,112,148,165,179,182,183,183,208],[39,40,57,79,104,127,148,161,198],[15,16,18,33,51,79,103,129,177]];break;case 100:i=[[99,116,154,174,200,196,201,201,230],[0,0,8,32,58,83,119,136,173],[5,6,7,9,9,14,17,19,24]];break;case 101:i=[[82,106,126,141,155,163,142,107,66],[62,44,69,107,135,152,149,132,119],[39,25,31,60,73,68,49,72,188]];break;case 102:i=[[18,29,44,72,116,158,184,208,221],[27,46,71,105,146,177,189,190,183],[39,55,80,108,130,133,124,100,76]];break;case 103:i=[[0,48,119,173,212,224,228,228,245],[0,13,30,47,79,127,167,205,245],[0,68,75,43,16,22,55,128,245]];break;case 104:i=[[34,70,129,187,225,226,216,193,179],[48,91,147,194,226,229,196,110,12],[234,212,216,224,206,110,53,40,29]];break;case 105:i=[[30,55,103,147,174,203,188,151,105],[0,65,138,182,187,175,121,53,9],[191,202,212,208,171,140,97,57,30]];break;case 106:i=[[112,97,113,125,138,159,178,188,225],[16,17,24,37,56,81,110,136,189],[38,35,46,59,78,103,130,152,201]];break;case 107:i=[[18,72,5,23,29,201,200,98,29],[0,0,43,167,211,117,0,0,0],[51,203,177,26,10,9,8,3,0]];break;case 108:i=[[19,42,64,88,118,147,175,187,205],[19,55,89,125,154,169,161,129,70],[19,32,47,70,100,128,145,130,75]];break;case 109:i=[[33,31,42,68,86,111,141,172,227],[255,175,145,106,88,55,15,0,0],[255,205,202,203,208,205,203,206,231]];break;case 110:i=[[0,25,50,79,110,145,181,201,254],[0,16,30,46,63,82,101,124,179],[0,12,21,29,39,49,61,74,103]];break;case 111:i=[[0,13,30,44,72,120,156,200,247],[0,36,84,117,141,153,151,158,247],[0,94,100,82,56,66,76,131,247]];break;case 112:i=[[26,51,43,33,28,35,74,144,246],[9,24,55,87,118,150,180,200,222],[30,96,112,114,112,101,72,35,0]];break;case 113:i=[[0,5,65,97,124,156,189,224,255],[32,54,77,100,123,148,175,203,234],[77,110,107,111,120,119,111,94,70]];break;default:return lw()}const r=255,s=i[0],a=i[1],o=i[2],h=[];for(let l=1;l<e.length;l++){const c=Math.round(Math.floor(r*e[l])-Math.floor(r*e[l-1]));for(let f=0;f<c;f++){const d="rgb("+Ss(s[l-1]+f*(s[l]-s[l-1])/c,1)+", "+Ss(a[l-1]+f*(a[l]-a[l-1])/c,1)+", "+Ss(o[l-1]+f*(o[l]-o[l-1])/c,1)+")";h.push(d)}}return new Hc(h,t)}function pD(n){const t=[],e=n.split(";"),i=Se()||Ci()&&tt.ApproxTextSize;for(let r=0;r<e.length;++r){const s=e[r];let a=s.indexOf(":");if(a>0){const d=`rgb(${s.slice(a+1)})`;t[parseInt(s.slice(0,a))]=i?Pn(d).formatRgb():d;continue}if(a=s.indexOf("="),a>0){let d=`rgba(${s.slice(a+1)})`;i&&(d=Pn(d),d.opacity=(Math.round(d.opacity*255)/255).toFixed(2),d=d.formatRgb()),t[parseInt(s.slice(0,a))]=d;continue}if(a=s.indexOf("#"),a<0)continue;const o=parseInt(s.slice(0,a)),h=JSON.parse(s.slice(a+1)),l={_typename:h[0]===10?Km:t1,fNumber:o,fType:h[0]};let c=1;l.fCoordinateMode=Math.round(h[c++]);const f=Math.round(h[c++]);l.fColorPositions=h.slice(c,c+f),c+=f,l.fColors=h.slice(c,c+4*f),c+=4*f,l.fStart={fX:h[c++],fY:h[c++]},l.fEnd={fX:h[c++],fY:h[c++]},l._typename===t1&&c<h.length&&(l.fR1=h[c++],l.fR2=h[c]),t[o]=l}return t}cD();const e1="data:image/svg+xml;charset=utf-8,",i1="data:application/json;charset=utf-8,";function cr(n,t){if(!n||n.empty())return{x:0,y:0,width:0,height:0};if(Se()&&t!=="bbox"||n.property("_batch_mode"))return{x:0,y:0,width:parseInt(n.attr("width")),height:parseInt(n.attr("height"))};const e=s=>{let a=n.style(s);return!a||!Pt(a)?0:(a=parseFloat(a.replace("px","")),Number.isFinite(a)?Math.round(a):0)};let i=n.node().getBoundingClientRect();t==="bbox"&&parseFloat(i.width)>0&&(i=n.node().getBBox());const r={x:0,y:0,width:parseInt(i.width),height:parseInt(i.height)};return i.left!==void 0?(r.x=parseInt(i.left),r.y=parseInt(i.top)):i.x!==void 0&&(r.x=parseInt(i.x),r.y=parseInt(i.y)),(t===void 0||t==="nopadding")&&(r.width-=e("padding-left")+e("padding-right"),r.height-=e("padding-top")+e("padding-bottom")),r}function dv(n,t){if(!t)return t;for(;!n.empty()&&!n.classed("root_canvas");){const e=n.attr("class");e&&(e.indexOf("root_frame")>=0||e.indexOf("__root_pad_")>=0)&&(t.x+=n.property("draw_x")||0,t.y+=n.property("draw_y")||0),n=Ct(n.node().parentNode)}return t}function Gu(n,t,e){t?t==="g"&&(t="7.5g"):t="6.4g",t=t.trim();const i=t.length;if(i<2)return e?[n.toFixed(4),"6.4f"]:n.toFixed(4);const r=t[i-1].toLowerCase(),s=i>1&&t[i-2]==="c"?"c":"";if(t=t.slice(0,i-(s?2:1)),r==="g"){const l=Gu(n,t+"ce",!0),c=Gu(n,t+"cf",!0),f=l[0].length<c[0].length||c[0]==="0"&&n?l:c;return e?f:f[0]}let a,o=t.indexOf(".");switch(o=o<0?4:parseInt(t.slice(o+1)),(!Number.isInteger(o)||o<=0)&&(o=4),r){case"e":a=!0;break;case"f":a=!1;break;default:a=!1,o=4}if(a){let l=n.toExponential(o);if(s){const c=l.indexOf("."),f=l.toLowerCase().indexOf("e");if(c>0&&f>c){let d=f;for(;d>c&&l[d-1]==="0";)d--;d===c+1&&d--,d!==f&&(l=l.slice(0,d)+l.slice(f))}}return e?[l,`${o+2}.${o}${s}e`]:l}let h=n.toFixed(o);if(s){let l=0;for(;l<h.length&&(h[l]==="0"||h[l]==="-"||h[l]===".");)l++;let c=h.length-l-o;h.indexOf(".")>l&&c--,c&&(o-=c,o<0?o=0:o>20&&(o=20),h=n.toFixed(o));const f=h.indexOf(".");if(f>0){let d=h.length;for(;d>f&&h[d-1]==="0";)d--;d===f+1&&d--,h=h.slice(0,d)}h==="-0"&&(h="0")}return e?[h,`${o+2}.${o}${s}f`]:h}class r6{constructor(t){Pt(t)?(this.origin=t.trim(),this.opt=this.origin.toUpperCase()):this.opt=this.origin="",this.part=this.partO=""}empty(){return this.opt?!this.opt.replace(/[ ;_,]/g,""):!0}remain(){return this.opt}#i(t,e){this.opt=this.opt.slice(0,t)+this.opt.slice(e),this.origin=this.origin.slice(0,t)+this.origin.slice(e)}check(t,e){const i=this.opt.indexOf(t);if(i<0)return!1;if(this.#i(i,i+t.length),this.part="",!e)return!0;let r=i;const s=e==="array";if(s){if(this.opt[r]!=="[")return!1;for(;r<this.opt.length&&this.opt[r]!=="]";)r++;if(++r>this.opt.length)return!1}else for(;r<this.opt.length&&this.opt[r]!==" "&&this.opt[r]!==","&&this.opt[r]!==";";)r++;if(r>i&&(this.part=this.opt.slice(i,r),this.partO=this.origin.slice(i,r),this.#i(i,r)),s){try{this.array=JSON.parse(this.part)}catch{this.array=void 0}return this.array?.length!==void 0}if(e!=="color")return!0;if((this.part.length===6||this.part.length===8)&&this.part.match(/^[a-fA-F0-9]+/))return this.color=fD("#"+this.part),!0;if(this.color=this.partAsInt(1)-1,this.color>=0)return!0;for(let a=0;a<8;++a)if(Xi(a).toUpperCase()===this.part)return this.color=a,!0;return!1}getPart(t){return t?this.partO:this.part}partAsInt(t,e){let i=1;const r=this.part?this.part.at(-1):"";r==="K"?i=1e3:r==="M"?i=1e6:r==="G"&&(i=1e9);let s=this.part.replace(/^\D+/g,"");return s=s?parseInt(s,10):Number.NaN,Number.isInteger(s)?i*s+(t||0):e||0}partAsFloat(t,e){let i=this.part.replace(/^\D+/g,"");return i=i?parseFloat(i):Number.NaN,Number.isFinite(i)?i+(t||0):e||0}}class qJ{constructor(t){t!==void 0&&this.seed(t)}seed(t){t=Math.abs(t),t>1e8?t=Math.abs(1e8*Math.sin(t)):t<1&&(t*=1e8),this.m_w=Math.round(t),this.m_z=987654321}random(){if(this.m_z===void 0)return Math.random();this.m_z=36969*(this.m_z&65535)+(this.m_z>>16)&4294967295,this.m_w=18e3*(this.m_w&65535)+(this.m_w>>16)&4294967295;let t=(this.m_z<<16)+this.m_w&4294967295;return t/=4294967296,t+.5}}function VJ(n,t){t||(t={}),t.line?t.ndig===void 0&&(t.ndig=0):t.calc=!0;let e=n.length;if(e<3&&(t.line=!0),t.t=t.t??.2,t.ndig===void 0||t.height){t.maxy=n[0].gry,t.mindiff=100;for(let a=1;a<e;a++)t.maxy=Math.max(t.maxy,n[a].gry),t.mindiff=Math.min(t.mindiff,Math.abs(n[a].grx-n[a-1].grx),Math.abs(n[a].gry-n[a-1].gry));t.ndig===void 0&&(t.ndig=t.mindiff>20?0:t.mindiff>5?1:2)}const i=(a,o,h)=>{const l=Math.sqrt((o.gry-a.gry)**2+(o.grx-a.grx)**2)*t.t,c=Math.atan2(o.dgry,o.dgrx),f=Math.atan2(h*(o.gry-a.gry),h*(o.grx-a.grx));a.dgrx=l*Math.cos(2*f-c),a.dgry=l*Math.sin(2*f-c)},r=a=>{if(!t.ndig||Math.round(a)===a)return a.toFixed(0);let o=a.toFixed(t.ndig),h=o.length-1;for(;o[h]==="0";)h--;return o[h]==="."&&h--,o=o.slice(0,h+1),o==="-0"?"0":o};if(t.calc){for(let a=1;a<e-1;a++)n[a].dgrx=(n[a+1].grx-n[a-1].grx)*t.t,n[a].dgry=(n[a+1].gry-n[a-1].gry)*t.t;e>2?(i(n[0],n[1],1),i(n[e-1],n[e-2],-1)):n.length===2&&(n[0].dgrx=(n[1].grx-n[0].grx)*t.t,n[0].dgry=(n[1].gry-n[0].gry)*t.t,n[1].dgrx=-n[0].dgrx,n[1].dgry=-n[0].dgry)}let s=`${t.cmd??"M"}${r(n[0].grx)},${r(n[0].gry)}`;if(t.line)if(e<1e4){let a=0,o=0,h=Math.round(n[0].grx),l=Math.round(n[0].gry);const c=()=>{a&&(s+="h"+a,a=0),o&&(s+="v"+o,o=0)};for(let f=1;f<e;++f){const d=n[f],u=Math.round(d.grx)-h,p=Math.round(d.gry)-l;u&&p?(c(),s+=`l${u},${p}`):!u&&p?((o===0||p<0!=o<0)&&c(),o+=p):u&&!p&&((a===0||u<0!=a<0)&&c(),a+=u),h+=u,l+=p}c()}else{let a=Math.round(n[0].grx),o=Math.round(n[0].gry),h=o,l=o,c=o;for(let f=1;f<e;++f){const d=n[f],u=Math.round(d.grx),p=Math.round(d.gry),m=u-a;if(m===0){h=Math.min(h,p),l=Math.max(l,p),c=p;continue}h!==l&&(h!==o&&(s+=`v${h-o}`),s+=`v${l-h}`,l!==c&&(s+=`v${c-l}`),o=c);const g=p-o;g?s+=`l${m},${g}`:s+=`h${m}`,a=u,o=p,c=h=l=p}h!==l&&(h!==o&&(s+=`v${h-o}`),s+=`v${l-h}`,l!==c&&(s+=`v${c-l}`))}else{let a=1;t.qubic&&(e--,a++,s+=`Q${r(n[1].grx-n[1].dgrx)},${r(n[1].gry-n[1].dgry)},${r(n[1].grx)},${r(n[1].gry)}`),s+=`C${r(n[a-1].grx+n[a-1].dgrx)},${r(n[a-1].gry+n[a-1].dgry)},${r(n[a].grx-n[a].dgrx)},${r(n[a].gry-n[a].dgry)},${r(n[a].grx)},${r(n[a].gry)}`;for(let o=a+1;o<e;o++)s+=`S${r(n[o].grx-n[o].dgrx)},${r(n[o].gry-n[o].dgry)},${r(n[o].grx)},${r(n[o].gry)}`;t.qubic&&(s+=`Q${r(n[e].grx-n[e].dgrx)},${r(n[e].gry-n[e].dgry)},${r(n[e].grx)},${r(n[e].gry)}`)}return t.height&&(t.close=`L${r(n.at(-1).grx)},${r(Math.max(t.maxy,t.height))}H${r(n[0].grx)}Z`),s}function n1(n){return n=n.replace(/url\("#(\w+)"\)/g,"url(#$1)").replace(/ class="\w*"/g,"").replace(/ pad="\w*"/g,"").replace(/ title=""/g,"").replace(/ style=""/g,"").replace(/<g objname="\w*" objtype="\w*"/g,"<g").replace(/<g transform="translate\([0-9,]+\)"><\/g>/g,"").replace(/<g transform="translate\([0-9,]+\)" style="display: none;"><\/g>/g,"").replace(/<g><\/g>/g,""),n=n.replace(/<svg x="0" y="0" overflow="hidden" width="\d+" height="\d+" viewBox="0 0 \d+ \d+"><\/svg>/g,""),n}class Of{#i;#r;#e;#s;#h;constructor(t){this.#i=null,t&&this.setDom(t)}setDom(t){t!==void 0&&(this.#i=t,this.#r=null)}getDom(){return this.#i}getDrawDom(){return this.#i}selectDom(t){if(!this.#i)return Ct(null);let e=this.#r;if(!e){if(Pt(this.#i)){let a=this.#i;a[0]!=="#"&&(a="#"+a),e=Ct(a),e.empty()||(this.#i=e.node())}else e=Ct(this.#i);this.#r=e}if(!e||e.empty()||t==="origin")return e;const i=e.property("use_enlarge"),r=e.property("layout")||"simple",s=r==="simple"?"":e.property("layout_selector");return s&&(e=e.select(s)),!t&&!e.empty()&&i&&(e=Ct(Zi().getElementById("jsroot_enlarge_div"))),e}#a(t){const e=this.selectDom().node()?.firstChild;return e?(t===!0?e.painter=this:t===!1&&e.painter===this&&delete e.painter,e.painter):null}setTopPainter(){this.#a(!0)}getTopPainter(){return this.#a()}clearTopPainter(){this.#a(!1)}cleanup(t){this.clearTopPainter();const e=this.selectDom("origin");!e.empty()&&!t&&e.html(""),this.#i=null,this.#r=void 0,lt(this.#h?.removePainter)&&this.#h.removePainter(this),this.#e=void 0,this.#s=void 0,this.#h=void 0}checkResize(){}testMainResize(t,e,i){const r=this.enlargeMain("state"),s=this.selectDom("origin"),a=this.selectDom(),o=5;r!=="on"&&e?.width&&e?.height&&s.style("width",e.width+"px").style("height",e.height+"px");const h=cr(s,!0),l=s.attr("can_resize");let c=!1;l==="height"&&i&&Math.abs(h.width*i-h.height)>.1*h.width&&(c=!0),(h.height<=o||h.width<=o)&&l&&l!=="false"&&(c=!0),c&&r!=="on"&&(h.width>o?(i=i||.66,s.style("height",Math.round(h.width*i)+"px")):l!=="height"&&s.style("width","200px").style("height","100px"));const f=cr(a),d=a.property("_jsroot_height"),u=a.property("_jsroot_width");if(f.changed=!1,!f.width&&!f.height&&!a.empty()&&a.attr("style")){const p=a.style("width"),m=a.style("height");Pt(p)&&Pt(m)&&p.match(/^\d+px$/)&&m.match(/^\d+px$/)&&(f.width=parseInt(p.slice(0,p.length-2)),f.height=parseInt(m.slice(0,m.length-2)))}return d&&u&&d>0&&u>0?(d!==f.height||u!==f.width)&&(f.changed=t>1||f.width/u<.99||f.width/u>1.01||f.height/d<.99||f.height/d>1.01):f.changed=!0,f.changed&&a.property("_jsroot_height",f.height).property("_jsroot_width",f.width),s.property("did_enlarge")&&(f.changed=!0,s.property("did_enlarge",!1)),f}enlargeMain(t,e){const i=this.selectDom(!0),r=this.selectDom("origin"),s=Zi();if(i.empty()||!tt.CanEnlarge||r.property("can_enlarge")===!1)return!1;if(t===void 0||t==="verify")return!0;const a=r.property("use_enlarge")?"on":"off";if(t==="state")return a;t==="toggle"&&(t=a==="off");let o=Ct(s.getElementById("jsroot_enlarge_div"));if(t===!0&&a!=="on"){if(!o.empty())return!1;o=Ct(s.body).append("div").attr("id","jsroot_enlarge_div").attr("style","position: fixed; margin: 0px; border: 0px; padding: 0px; left: 1px; top: 1px; bottom: 1px; right: 1px; background: white; opacity: 0.95; z-index: 100; overflow: hidden;");const h=cr(i),l=cr(o);if((l.width<=h.width||l.height<=h.height)&&l.width*l.height<h.width*h.height)return e||console.log(`Enlarged area ${l.width} x ${l.height} smaller then original drawing ${h.width} x ${h.height}`),o.remove(),!1;for(;i.node().childNodes.length;)o.node().appendChild(i.node().firstChild);return r.property("use_enlarge",!0),r.property("did_enlarge",!0),!0}if(t===!1&&a!=="off"){for(;o.node()?.childNodes.length;)i.node().appendChild(o.node().firstChild);return o.remove(),r.property("use_enlarge",!1),r.property("did_enlarge",!0),!0}return!1}setItemName(t,e,i){this.#e=Pt(t)?t:void 0,Pt(e)&&(this.#s=e),this.#h=i}getHPainter(){return this.#h}getItemName(){return this.#e??null}getItemDrawOpt(){return this.#s??""}}async function pv(){return Qt(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).then(n=>(Kt.nodejs_window||(Kt.nodejs_window=new n.JSDOM("<!DOCTYPE html>hello").window,Kt.nodejs_document=Kt.nodejs_window.document,Kt.nodejs_body=Ct(Kt.nodejs_document).select("body")),{JSDOM:n.JSDOM,doc:Kt.nodejs_document,body:Kt.nodejs_body}))}function Bn(n,t,e,i=1){se(n)||(i=e,e=t,t=n,n=null);let r=e?`translate(${t},${e})`:t?`translate(${t})`:null;return i&&i!==1&&(r?r+=" ":r="",r+=`scale(${i.toFixed(3)})`),n?n.attr("transform",r):r}function gd(n,t){t?n.style("stroke","steelblue").style("fill-opacity","0.1"):n.style("stroke","#4572A7").style("fill","#4572A7").style("opacity","0")}async function mv(n,t,e){if((e===!0||e===!1)&&(e={as_buffer:e}),t==="svg")return n;if(t==="pdf")return Kt.makePDF?Kt.makePDF(n,e):null;const i='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';if(Se()){n=encodeURIComponent(i+n),n=n.replace(/%([0-9A-F]{2})/g,(a,o)=>{const h=String.fromCharCode("0x"+o);return h==="%"?"%25":h});const s="data:image/svg+xml;base64,"+Gd(decodeURIComponent(n));return Qt(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).then(async a=>a.default.loadImage(s).then(o=>{const h=a.default.createCanvas(o.width,o.height);return h.getContext("2d").drawImage(o,0,0,o.width,o.height),e?.as_buffer?h.toBuffer("image/"+t):t?h.toDataURL("image/"+t):h}))}const r=URL.createObjectURL(new Blob([i+n],{type:"image/svg+xml;charset=utf-8"}));return new Promise(s=>{const a=document.createElement("img");a.onload=function(){URL.revokeObjectURL(r);const o=document.createElement("canvas");o.width=a.width,o.height=a.height,o.getContext("2d").drawImage(a,0,0),e?.as_buffer&&t?o.toBlob(h=>h.arrayBuffer().then(s),"image/"+t):s(t?o.toDataURL("image/"+t):o)},a.onerror=function(o){URL.revokeObjectURL(r),console.log(`IMAGE ERROR ${o}`),s(null)},a.setAttribute("src",r)})}function s6(n){const t=(n.fDatime>>>26)+1995,e=(n.fDatime<<6>>>28)-1,i=n.fDatime<<10>>>27,r=n.fDatime<<15>>>27,s=n.fDatime<<20>>>26,a=n.fDatime<<26>>>26;return new Date(Date.UTC(t,e,i,r,s,a))}function Hx(n){let t="";if(tt.TimeZone&&Pt(tt.TimeZone))try{t=n.toLocaleString("en-GB",{timeZone:tt.TimeZone})}catch{t=""}return t||n.toLocaleString("en-GB")}function a6(n,t,e,i,r,s,a){const o=`M${n},${t}h${e}l${-s},${a}h${2*s-e}v${i-2*a}l${-s},${a}z`,h=`M${n+e},${t+i}v${-i}l${-s},${a}v${i-2*a}h${2*s-e}l${-s},${a}z`;return r>0?[o,h]:[h,o]}const Po="Arial",Fl="Times New Roman",ko="Courier New",Du="Verdana",Mn="RootSymbol",Hl="Wingdings",r1=[null,{n:Fl,s:"italic",aw:.5314},{n:Fl,w:"bold",aw:.5809},{n:Fl,s:"italic",w:"bold",aw:.554},{n:Po,aw:.5778},{n:Po,s:"oblique",aw:.5783},{n:Po,w:"bold",aw:.6034},{n:Po,s:"oblique",w:"bold",aw:.603},{n:ko,aw:.6003},{n:ko,s:"oblique",aw:.6004},{n:ko,w:"bold",aw:.6003},{n:ko,s:"oblique",w:"bold",aw:.6005},{n:Mn,aw:.5521,file:"symbol.ttf"},{n:Fl,aw:.5521},{n:Hl,aw:.5664,file:"wingding.ttf"},{n:Mn,s:"oblique",aw:.5314,file:"symbol.ttf"},{n:Du,aw:.5664},{n:Du,s:"italic",aw:.5495},{n:Du,w:"bold",aw:.5748},{n:Du,s:"italic",w:"bold",aw:.5578}],hw={};async function mD(n){let t=hw[n];if(t?.base64)return t?.base64;if(t?.promises!==void 0)return new Promise(s=>{t.promises.push(s)});t=hw[n]={promises:[]};const e=[];n.indexOf("/")>=0?e.push(""):(e.push(li+"fonts/"),Se()?e.push("../../fonts/"):li.indexOf("jsrootsys/")>=0&&(e.unshift(li.replace(/jsrootsys/g,"rootsys_fonts")),e.unshift(li.replace(/jsrootsys/g,"rootsys/fonts"))));function i(s){t.base64=s;const a=t.promises;return delete t.promises,a.forEach(o=>o(s)),s}async function r(){if(!e.length)throw i(null),new Error(`Fail to load ${n} font`);let s=e.shift()+n;return console.log("loading font",s),(Se()?Qt(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).then(o=>{const h="file://"+(process?.platform==="win32"?"/":"");return s.indexOf(h)===0&&(s=s.slice(h.length)),o.readFileSync(s).toString("base64")}):br(s,"bin").then(o=>Gd(o))).then(o=>o?i(o):r()).catch(()=>r())}return r()}class Ha{constructor(t,e,i){i&&e<1&&(e*=i,this.scaled=!0),this.size=Math.round(e),this.scale=i,this.index=0,this.func=this.setFont.bind(this);let r;t&&se(t)?r=t:(t&&Number.isInteger(t)&&(this.index=Math.floor(t/10)),r=r1[this.index]),r?(this.cfg=r,this.setNameStyleWeight(r.n,r.s,r.w,r.aw,r.format,r.base64)):this.setNameStyleWeight(Po)}needLoad(){return this.cfg?.file&&!this.isSymbol&&!this.base64}async load(){return this.needLoad()?mD(this.cfg.file).then(t=>(this.cfg.base64=this.base64=t,this.format="ttf",!!t)):!0}setNameStyleWeight(t,e,i,r,s,a){this.name=t,this.style=e||null,this.weight=i||null,this.aver_width=r||(i?.58:.55),this.format=s,this.base64=a,!tt.LoadSymbolTtf&&(this.name===Mn||this.name===Hl)?(this.isSymbol=this.name,this.name=Fl):this.isSymbol=""}setPainter(t){this.painter=t}setUseFullStyle(t){this.full_style=t}addCustomFontToSvg(t){if(!this.base64||!this.name)return;const e="custom_font_"+this.name,i="ttf";let r=t.selectChild(".canvas_defs");r.empty()&&(r=t.insert("svg:defs",":first-child").attr("class","canvas_defs")),r.selectChild("."+e).empty()&&r.append("style").attr("class",e).property("$fontcfg",this.cfg||null).text(`@font-face { font-family: "${this.name}"; font-weight: normal; font-style: normal; src: url(data:application/font-${i};charset=utf-8;base64,${this.base64}); }`)}setFont(t){this.base64&&this.painter&&this.addCustomFontToSvg(this.painter.getCanvSvg()),t.attr("font-family",this.name).attr("font-size",this.size).attr(":xml:space","preserve"),this.setFontStyle(t)}setFontStyle(t){t.attr("font-weight",this.weight||(this.full_style?"normal":null)).attr("font-style",this.style||(this.full_style?"normal":null))}setSize(t){this.size=Math.round(t)}setColor(t){this.color=t}setAlign(t){this.align=t}setAngle(t){this.angle=t}roundAngle(t,e){this.angle=parseInt(this.angle||0),Number.isInteger(this.angle)||(this.angle=0),this.angle=Math.round(this.angle/t)*t+(e||0),this.angle<0?this.angle+=360:this.angle>=360&&(this.angle-=360)}clearFont(t){t.attr("font-family",null).attr("font-size",null).attr(":xml:space",null).attr("font-weight",null).attr("font-style",null)}isMonospace(){const t=this.name.toLowerCase();return t.indexOf("courier")===0||t==="monospace"||t==="monaco"}getFontHtml(){let t=Math.round(this.size)+"pt "+this.name;return this.weight&&(t+=" "+this.weight),this.style&&(t+=" "+this.style),t}getFontName(){return this.isSymbol||this.name||"none"}}function gD(n,t,e,i){Number.isInteger(n)?r1[n]={n:t,format:e,base64:i}:console.error(`Wrong index ${n} for custom font`)}function yD(n){const t=n.getAttribute("font-size"),e=t.indexOf("px"),i=e>0?Number.parseInt(t.slice(0,e)):12;let r=n.getAttribute("font-family"),s=n.getAttribute("font-style"),a=n.getAttribute("font-weight");r==="times"?r=Fl:r==="symbol"?r=Mn:r==="arial"?r=Po:r==="verdana"&&(r=Du),a==="normal"&&(a=""),s==="normal"&&(s="");const o=r1.find(h=>h?.n===r&&(!a&&!h.w||h.w===a)&&(!s&&!h.s||h.s===s));return new Ha(o||r1[13],i)}const yd={"#alpha":"α","#beta":"β","#chi":"χ","#delta":"δ","#varepsilon":"ε","#phi":"φ","#gamma":"γ","#eta":"η","#iota":"ι","#varphi":"φ","#kappa":"κ","#lambda":"λ","#mu":"μ","#nu":"ν","#omicron":"ο","#pi":"π","#theta":"θ","#rho":"ρ","#sigma":"σ","#tau":"τ","#upsilon":"υ","#varomega":"ϖ","#omega":"ω","#xi":"ξ","#psi":"ψ","#zeta":"ζ","#Alpha":"Α","#Beta":"Β","#Chi":"Χ","#Delta":"Δ","#Epsilon":"Ε","#Phi":"Φ","#Gamma":"Γ","#Eta":"Η","#Iota":"Ι","#vartheta":"ϑ","#Kappa":"Κ","#Lambda":"Λ","#Mu":"Μ","#Nu":"Ν","#Omicron":"Ο","#Pi":"Π","#Theta":"Θ","#Rho":"Ρ","#Sigma":"Σ","#Tau":"Τ","#Upsilon":"Υ","#varsigma":"ς","#Omega":"Ω","#Xi":"Ξ","#Psi":"Ψ","#Zeta":"Ζ","#varUpsilon":"ϒ","#epsilon":"ε","#leq":"≤","#/":"⁄","#infty":"∞","#voidb":"ƒ","#club":"♣","#diamond":"♦","#heart":"♥","#spade":"♠","#leftrightarrow":"↔","#leftarrow":"←","#uparrow":"↑","#rightarrow":"→","#downarrow":"↓","#circ":"⸰","#pm":"±","#doublequote":"″","#geq":"≥","#times":"×","#propto":"∝","#partial":"∂","#bullet":"•","#divide":"÷","#neq":"≠","#equiv":"≡","#approx":"≈","#3dots":"…","#cbar":"|","#topbar":"¯","#downleftarrow":"↵","#aleph":"ℵ","#Jgothic":"ℑ","#Rgothic":"ℜ","#voidn":"℘","#otimes":"⊗","#oplus":"⊕","#oslash":"∅","#cap":"∩","#cup":"∪","#supset":"⊃","#supseteq":"⊇","#notsubset":"⊄","#subset":"⊂","#subseteq":"⊆","#in":"∈","#notin":"∉","#angle":"∠","#nabla":"∇","#oright":"®","#ocopyright":"©","#trademark":"™","#prod":"∏","#surd":"√","#upoint":"‧","#corner":"¬","#wedge":"∧","#vee":"∨","#Leftrightarrow":"⇔","#Leftarrow":"⇐","#Uparrow":"⇑","#Rightarrow":"⇒","#Downarrow":"⇓","#void2":"","#LT":"<","#void1":"®","#copyright":"©","#void3":"™","#sum":"∑","#arctop":"⎛","#lbar":"⎢","#arcbottom":"⎝","#void4":"","#void8":"⎢","#bottombar":"⌊","#arcbar":"⎧","#ltbar":"⎨","#AA":"Å","#aa":"å","#void06":"","#GT":">","#int":"∫","#forall":"∀","#exists":"∃","#koppa":"ϟ","#sampi":"ϡ","#stigma":"ϛ","#san":"ϻ","#sho":"ϸ","#varcoppa":"ϙ","#digamma":"ϝ","#Digamma":"Ϝ","#Koppa":"Ϟ","#varKoppa":"Ϙ","#Sampi":"Ϡ","#Stigma":"Ϛ","#San":"Ϻ","#Sho":"Ϸ","#vec":"","#dot":"⋅","#hat":"·","#ddot":"","#acute":"","#grave":"","#check":"✓","#tilde":"˜","#slash":"⁄","#hbar":"ħ","#box":"◽","#Box":"☐","#parallel":"∥","#perp":"⊥","#odot":"⊙","#left":"","#right":"","{}":"","#mp":"∓","#P":"¶","#sqrt":"√","#bar":"","#overline":"","#underline":"","#strike":""},AD=new RegExp(Object.keys(yd).sort((n,t)=>n.length<t.length?1:n.length>t.length?-1:0).join("|"),"g");function o6(n){for(;n.length>2&&n.at(0)==="{"&&n.at(-1)==="}";)n=n.slice(1,n.length-1);return n.replace(AD,t=>yd[t]).replace(/\{\}/g,"")}const xD=[453,535,661,973,955,1448,1242,324,593,596,778,1011,200,570,200,492,947,885,947,947,947,947,947,947,947,947,511,495,980,1010,987,893,1624,1185,1147,1193,1216,1080,1028,1270,1274,531,910,1177,1004,1521,1252,1276,1111,1276,1164,1056,1073,1215,1159,1596,1150,1124,1065,540,591,540,837,874,572,929,972,879,973,901,569,967,973,453,458,903,453,1477,973,970,972,976,638,846,548,973,870,1285,884,864,835,656,430,656,1069],_D={945:1002,946:996,967:917,948:953,949:834,966:1149,947:847,951:989,953:516,954:951,955:913,956:1003,957:862,959:967,960:1070,952:954,961:973,963:1017,964:797,965:944,982:1354,969:1359,958:803,968:1232,950:825,913:1194,914:1153,935:1162,916:1178,917:1086,934:1358,915:1016,919:1275,921:539,977:995,922:1189,923:1170,924:1523,925:1253,927:1281,928:1281,920:1285,929:1102,931:1041,932:1069,933:1135,962:848,937:1279,926:1092,936:1334,918:1067,978:1154,8730:986,8804:940,8260:476,8734:1453,402:811,9827:1170,9830:931,9829:1067,9824:965,8596:1768,8592:1761,8593:895,8594:1761,8595:895,710:695,177:955,8243:680,8805:947,215:995,8733:1124,8706:916,8226:626,247:977,8800:969,8801:1031,8776:976,8230:1552,175:883,8629:1454,8501:1095,8465:1002,8476:1490,8472:1493,8855:1417,8853:1417,8709:1205,8745:1276,8746:1404,8839:1426,8835:1426,8836:1426,8838:1426,8834:1426,8747:480,8712:1426,8713:1426,8736:1608,8711:1551,174:1339,169:1339,8482:1469,8719:1364,729:522,172:1033,8743:1383,8744:1383,8660:1768,8656:1496,8657:1447,8658:1496,8659:1447,8721:1182,9115:882,9144:1e3,9117:882,8970:749,9127:1322,9128:1322,8491:1150,229:929,8704:1397,8707:1170,8901:524,183:519,10003:1477,732:692,295:984,9725:1780,9744:1581,8741:737,8869:1390,8857:1421};function gv(n,t,e){Number.isInteger(t)&&(t=new Ha(t,e));const i=n.length,r=(e||t.size)*t.aver_width;if(t.isMonospace())return i*r;let s=0;for(let a=0;a<i;++a){const o=n.charCodeAt(a);o>=32&&o<127?s+=xD[o-32]:s+=_D[o]||1e3}return s/1e3*r}const my=[{name:"#it{",bi:"italic"},{name:"#bf{",bi:"bold"},{name:"#underline{",deco:"underline"},{name:"#overline{",deco:"overline"},{name:"#strike{",deco:"line-through"},{name:"#kern[",arg:"float",shift:"x"},{name:"#lower[",arg:"float",shift:"y"},{name:"#scale[",arg:"float"},{name:"#color[",arg:"int"},{name:"#font[",arg:"int"},{name:"#url[",arg:"string"},{name:"_{",low_up:"low"},{name:"^{",low_up:"up"},{name:"#bar{",deco:"overline"},{name:"#hat{",accent:"ˆ",hasw:!0},{name:"#check{",accent:"ˇ",hasw:!0},{name:"#acute{",accent:"ˊ"},{name:"#grave{",accent:"ˋ"},{name:"#dot{",accent:"˙"},{name:"#ddot{",accent:"ʺ",hasw:!0},{name:"#tilde{",accent:"˜",hasw:!0},{name:"#slash{",accent:"∕"},{name:"#vec{",accent:"˭",hasw:!0},{name:"#frac{",twolines:"line",middle:!0},{name:"#splitmline{",twolines:!0,middle:!0},{name:"#splitline{",twolines:!0},{name:"#sqrt[",arg:"int",sqrt:!0},{name:"#sqrt{",sqrt:!0},{name:"#sum",special:"∑",w:.8,h:.9},{name:"#int",special:"∫",w:.3,h:1},{name:"#left[",right:"#right]",braces:"[]"},{name:"#left(",right:"#right)",braces:"()"},{name:"#left{",right:"#right}",braces:"{}"},{name:"#left|",right:"#right|",braces:"||"},{name:"#[]{",braces:"[]"},{name:"#(){",braces:"()"},{name:"#{}{",braces:"{}"},{name:"#||{",braces:"||"}],Wx=[0,8704,0,8707,0,0,8717,0,0,8727,0,0,8722,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8773,913,914,935,916,917,934,915,919,921,977,922,923,924,925,927,928,920,929,931,932,933,962,937,926,936,918,0,8756,0,8869,0,0,945,946,967,948,949,966,947,951,953,981,954,955,956,957,959,960,952,961,963,964,965,982,969,958,968,950,0,402,0,8764,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,978,8242,8804,8260,8734,0,9827,9830,9829,9824,8596,8592,8593,8594,8595,0,0,8243,8805,0,8733,8706,8729,0,8800,8801,8776,8230,0,0,8629,8501,8465,8476,8472,8855,8853,8709,8745,8746,8835,8839,8836,8834,8838,8712,8713,8736,8711,0,0,8482,8719,8730,8901,0,8743,8744,8660,8656,8657,8658,8659,9674,9001,0,0,8482,8721,0,0,0,0,0,0,0,0,0,0,8364,9002,8747,8992,0,8993],vD=[128393,9986,9985,128083,128365,128366,128367,128383,9990,128386,128387,128234,128235,128236,128237,128193,128194,128196,128463,128464,128452,8987,128430,128432,128434,128435,128436,128427,128428,9991,9997,128398,9996,128076,128077,128078,9756,9758,9757,9759,128400,9786,128528,9785,128163,9760,127987,127985,9992,9788,128167,10052,128326,10014,128328,10016,10017,9770,9775,2384,9784,9800,9801,9802,9803,9804,9805,9806,9807,9808,9809,9810,9811,128624,128629,9679,128318,9632,9633,128912,10065,10066,11047,10731,9670,10070,11045,8999,11193,8984,127989,127990,128630,128631,0,9450,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9471,10102,10103,10104,10105,10106,10107,10108,10109,10110,10111,128610,128608,128609,128611,128606,128604,128605,128607,183,8226,9642,9898,128902,128904,9673,9678,128319,9642,9723,128962,10022,9733,10038,10036,10041,10037,11216,8982,10209,8977,11217,10026,10032,128336,128337,128338,128339,128340,128341,128342,128343,128344,128345,128346,128347,11184,11185,11186,11187,11188,11189,11190,11191,128618,128619,128597,128596,128599,128598,128592,128593,128594,128595,9003,8998,11160,11162,11161,11163,11144,11146,11145,11147,129128,129130,129129,129131,129132,129133,129135,129134,129144,129146,129145,129147,129148,129149,129151,129150,8678,8680,8679,8681,11012,8691,11008,11009,11011,11010,129196,129197,128502,10004,128503,128505],O0={};function bD(n){if(!O0[945]){let t=0;for(const e in yd){const i=yd[e];if(i.length===1){let r;if(t<54){const a=t;r=97+a,a>25&&(r-=58),a===52&&(r=161),a===53&&(r=206)}else{const a=t-54;switch(r=163+a,a){case 75:r=197;break;case 76:r=229;break;case 80:r=34;break;case 81:r=36;break}}const s=i.charCodeAt(0);s>128&&(O0[s]=r)}if(++t>136)break}for(let e=0;e<Wx.length;++e){const i=Wx[e];i&&(O0[i]=e+33)}}return O0[n]??n}function wD(n){if(n.$text&&n.$font)return n.$originalHTML=n.innerHTML,n.$originalFont=n.getAttribute("font-family"),n.innerHTML=n.$text,tt.LoadSymbolTtf?n.setAttribute("font-family",n.$font.isSymbol):n.setAttribute("font-family",n.$font.isSymbol===Hl?"zapfdingbats":"symbol"),n.$font.isSymbol;if(n.childNodes.length!==1)return!1;const t=n.textContent;if(!t)return!1;let e="",i=-1;for(let r=0;r<t.length;r++){const s=t.charCodeAt(r),a=bD(s);s!==a&&(e+=t.slice(i+1,r)+`<tspan font-family="${tt.LoadSymbolTtf?Mn:"symbol"}" font-style="normal" font-weight="normal">${String.fromCharCode(a)} </tspan>`,i=r)}return i<0?!1:(i<t.length-1&&(e+=t.slice(i+1,t.length)),n.$originalHTML=n.innerHTML,n.$originalFont=n.getAttribute("font-family"),n.innerHTML=e,Mn)}function l6(n,t){const e=t===Hl?vD:Wx;let i="";for(let r=0;r<n.length;++r){const s=n.charCodeAt(r),a=s>32?e[s-33]:0;i+=String.fromCodePoint(a||s)}return i}function SD(n,t,e){e.plain=!0,e.simple_latex&&(e.text=o6(e.text)),e.font?.isSymbol?(t.text(l6(e.text,e.font.isSymbol)),t.property("$text",e.text),t.property("$font",e.font)):t.text(e.text)}function MD(n){return!n||n.indexOf("#")<0&&n.indexOf("{")<0}function hn(n,t,e,i){let r=0;const s=()=>(i.g||(i.g=n.append("svg:g")),i.g),a=p=>{i.x+=Math.round(p)},o=(p,m,g,y)=>{i.rect?(i.rect.x1=Math.min(i.rect.x1,p),i.rect.y1=Math.min(i.rect.y1,m),i.rect.x2=Math.max(i.rect.x2,g),i.rect.y2=Math.max(i.rect.y2,y)):i.rect={x1:p,y1:m,x2:g,y2:y},i.rect.last_y1=m,i.rect.width=i.rect.x2-i.rect.x1,i.rect.height=i.rect.y2-i.rect.y1,i.parent||(t.text_rect=i.rect)},h=p=>{o(i.x,i.y,i.x+p*i.fsize*.4,i.y),a(p*i.fsize*.4)},l=(p,m,g,y)=>{m=Math.round(m),g=Math.round(g),Bn(p.g,m,g),p.rect.x1+=m,p.rect.x2+=m,p.rect.y1+=g,p.rect.y2+=g,y?o(i.x+p.rect.x1,i.y+p.rect.y1,i.x+p.rect.x2,i.y+p.rect.y2):o(p.rect.x1,p.rect.y1,p.rect.x2,p.rect.y2)},c=p=>{const m=s();return r===1&&!e&&!i.x&&!i.y&&!p?m:Bn(m.append(p?"svg:a":"svg:g"),i.x,i.y)},f=(p,m,g)=>{let y=0,A=1,_=!1;m||(m="{"),g||(g="}");const x=b=>y+b.length<=e.length&&e.slice(y,y+b.length)===b;if(p){if(!x(m))return console.log(`not starting with ${m} in ${e}`),-1;e=e.slice(m.length)}for(;A&&y<e.length;)x(m)?(A++,y+=m.length):x(g)?(A--,y+=g.length,A===0&&typeof p=="string"&&x(p+m)&&(A++,y+=m.length+p.length,p=!0,_=!0)):y++;if(A)return console.log(`mismatch with open ${m} and closing ${g} in ${e}`),-1;let v=e.slice(0,y-g.length);return _&&(v=m+v+g),e=e.slice(y),v},d=(p,m,g)=>p.append("svg:path").attr("d",m||"M0,0").style("stroke",g?"none":i.color||t.color).style("stroke-width",g?null:Math.max(1,Math.round(i.fsize*(i.font.weight?.1:.07)))).style("fill",g?i.color||t.color:"none"),u=p=>({lvl:i.lvl+1,x:0,y:0,fsize:i.fsize*(p||1),color:i.color,font:i.font,parent:i,painter:i.painter,italic:i.italic,bold:i.bold});for(;e;){let p=e.length,m=null;for(let A=0;A<my.length;++A){const _=e.indexOf(my[A].name);_>=0&&_<p&&(p=_,m=my[A])}if(p>0){const A=p===e.length&&r===0&&!m;r++;let _=o6(e.slice(0,p)),x=0,v=0;for(;x<_.length&&_[x]===" ";)x++;for(x>0&&(h(x),_=_.slice(x));v<_.length&&_[_.length-1-v]===" ";)v++;if(v>0&&(_=_.slice(0,_.length-v)),_||A){const b=i.g||(A?n:s()),M=b.append("svg:text");A&&!i.g&&(i.g=M),i.ufont&&(i.font.setPainter(t.painter),i.font.setFont(i.g)),i.bold!==void 0&&i.g.attr("font-weight",i.bold?"bold":"normal"),i.italic!==void 0&&i.g.attr("font-style",i.italic?"italic":"normal"),M.attr("fill",i.color||t.color||null),M.attr("font-size",Math.max(1,Math.round(i.fsize))),i.font?.isSymbol?(M.text(l6(_,i.font.isSymbol)),M.property("$text",_),M.property("$font",i.font)):M.text(_);const T=!Se()&&!tt.ApproxTextSize&&!t.fast?cr(M,"nopadding"):{height:i.fsize*1.2,width:gv(_,i.font,i.fsize)};i.x&&M.attr("x",i.x),i.y&&M.attr("y",i.y);const w=_.length===1&&!i.font.isMonospace()&&"lfij".indexOf(_)>=0?.1*i.fsize:0;o(i.x,i.y-T.height*.8,i.x+T.width,i.y+T.height*.2),A?i.deco?(M.attr("text-decoration",i.deco),i.deco=""):i.xgap=w:(a(T.width+w),h(v),i.xgap=0)}else h(v)}if(!m)return!0;if(e=e.slice(p+m.name.length),r++,m.accent){const A=f();if(A===-1)return!1;const _=c(),x=u(),v=A.length!==1?1:A>="a"&&A<="z"&&"tdbfhkli".indexOf(A)<0?.75:.9;hn(_,t,A,x);const b=i.fsize*.6,M=Math.round(x.rect.y1*v),T=Math.round(i.fsize*.1),w=T*2,E=`a${T},${T},0,0,1,${w},0a${T},${T},0,0,1,${-w},0z`;let k=0,C=x.rect.width;m.hasw&&C<b&&(C=b,k=(b-x.rect.width)/2);const R=Math.round(C*.5),F=Math.round(C*.3),P=R-F,I=R+F;switch(C=R*2,l(x,k,0,!0),m.name){case"#check{":d(_,`M${P},${M-w}L${R},${M}L${I},${M-w}`);break;case"#acute{":d(_,`M${R},${M}l${w},${-w}`);break;case"#grave{":d(_,`M${R},${M}l${-w},${-w}`);break;case"#dot{":d(_,`M${R-T},${M}${E}`,!0);break;case"#ddot{":d(_,`M${R-3*T},${M}${E} M${R+T},${M}${E}`,!0);break;case"#tilde{":d(_,`M${P},${M} a${F},${w},0,0,1,${F},0 a${F},${w},0,0,0,${F},0`);break;case"#slash{":d(_,`M${C},${M}L0,${Math.round(x.rect.y2)}`);break;case"#vec{":d(_,`M${P},${M}H${I}M${I-w},${M-w}l${w},${w}l${-w},${w}`);break;default:d(_,`M${P},${M}L${R},${M-w}L${I},${M}`)}a(x.rect.width+(x.xgap??0));continue}if(m.twolines){i.twolines=!0;const A=f(),_=f(!0);if(A===-1||_===-1)return!1;const x=c(),v=i.parent?.twolines?.7:1,b=u(v);hn(x,t,A,b);const M=m.twolines==="line"?d(x):null,T=u(v);hn(x,t,_,T);const w=Math.max(b.rect.width,T.rect.width),E=b.rect.width-T.rect.width,k=-i.fsize*.35;l(b,m.middle&&E<0?-E/2:0,k-b.rect.y2,!0),l(T,m.middle&&E>0?E/2:0,k-T.rect.y1,!0),M?.attr("d",`M0,${Math.round(k)}h${Math.round(w-i.fsize*.1)}`),a(w),delete i.twolines;continue}const g=A=>{const _={};if(A&&(e="{"+e,_[A]=f(A==="low"?"_":"^"),_[A]===-1))return!1;for(;e;)if(e[0]==="_"&&!_.low){if(e=e.slice(1),_.low=f("_"),_.low===-1)return console.log(`error with ${m.name} low limit ${e}`),!1}else if(e[0]==="^"&&!_.up){if(e=e.slice(1),_.up=f("^"),_.up===-1)return console.log(`error with ${m.name} upper limit ${e}`),!1}else break;return _};if(m.low_up){const A=g(m.low_up);if(!A)return!1;const _=i.x,x=.03*i.fsize,v=.25*i.fsize;let b,M,T=0,w=0,E=-i.fsize;A.up&&(b=u(.6),hn(s(),t,A.up,b)),A.low&&(M=u(.6),hn(s(),t,A.low,M)),b&&(!M&&i.rect&&(E=Math.min(E,i.rect.last_y1)),l(b,_+x,E-b.rect.y1-i.fsize*.1),T=b.rect.width),M&&(l(M,_+x,v-M.rect.y2+i.fsize*.1),w=M.rect.width),a(x+Math.max(T,w));continue}if(m.special){const A=g()||{},_=c(),x=d(_),v=Math.round(i.fsize*1.7),b=Math.round(i.fsize),M=Math.round(v*.1);let T,w;if(m.name==="#sum"?(T=w=b/2,x.attr("d",`M${b},${Math.round(-.75*v)}h${-b}l${Math.round(.4*b)},${Math.round(.3*v)}l${Math.round(-.4*b)},${Math.round(.7*v)}h${b}`)):(T=3*M,w=M,x.attr("d",`M0,${Math.round(.25*v-M)}a${M},${M},0,0,0,${2*M},0v${2*M-v}a${M},${M},0,1,1,${2*M},0`)),o(i.x,i.y-.6*v,i.x+b,i.y+.4*v),A.low){const E=u(.6);hn(_,t,A.low,E),l(E,w-E.rect.width/2,.25*v-E.rect.y1,!0)}if(A.up){const E=u(.6);hn(_,t,A.up,E),l(E,T-E.rect.width/2,-.75*v-E.rect.y2,!0)}a(b);continue}if(m.braces){const A=m.right,_=A?m.name:"{",x=f(!1,_,A),v=c(),b=u(),M=d(v);hn(v,t,x,b);const T=d(v),w=Math.max(2,Math.round(i.fsize*.2)),E=b.rect,k=Math.round(E.y2-E.y1),C=Math.round(E.y1),R=Math.round(E.width);switch(m.braces){case"||":M.attr("d",`M${w},${C}v${k}`),T.attr("d",`M${3*w+R},${C}v${k}`);break;case"[]":M.attr("d",`M${2*w},${C}h${-w}v${k}h${w}`),T.attr("d",`M${2*w+R},${C}h${w}v${k}h${-w}`);break;case"{}":M.attr("d",`M${2*w},${C}a${w},${w},0,0,0,${-w},${w}v${k/2-2*w}a${w},${w},0,0,1,${-w},${w}a${w},${w},0,0,1,${w},${w}v${k/2-2*w}a${w},${w},0,0,0,${w},${w}`),T.attr("d",`M${2*w+R},${C}a${w},${w},0,0,1,${w},${w}v${k/2-2*w}a${w},${w},0,0,0,${w},${w}a${w},${w},0,0,0,${-w},${w}v${k/2-2*w}a${w},${w},0,0,1,${-w},${w}`);break;default:M.attr("d",`M${w},${C}a${4*k},${4*k},0,0,0,0,${k}`),T.attr("d",`M${3*w+R},${C}a${4*k},${4*k},0,0,1,0,${k}`)}l(b,2*w,0,!0),o(i.x,i.y+E.y1,i.x+4*w+E.width,i.y+E.y2),a(4*w+E.width);continue}if(m.deco){const A=f(),_=c(),x=u();x.deco=m.deco,hn(_,t,A,x);const v=x.rect;switch(x.deco){case"underline":d(_,`M0,${Math.round(v.y2)}h${Math.round(v.width)}`);break;case"overline":d(_,`M0,${Math.round(v.y1)}h${Math.round(v.width)}`);break;case"line-through":d(_,`M0,${Math.round(.45*v.y1+.55*v.y2)}h${Math.round(v.width)}`);break}l(x,0,0,!0),a(v.width);continue}if(m.bi){const A=f();if(A===-1)return!1;const _=u();_[m.bi]=!_[m.bi],hn(s(),t,A,_),l(_,i.x,i.y),a(_.rect.width);continue}let y=0;if(m.arg){const A=e.indexOf("]{");if(A<0)return console.log("missing argument for ",m.name),!1;if(y=e.slice(0,A),m.arg==="int"){if(y=parseInt(y),!Number.isInteger(y))return console.log("wrong int argument",e.slice(0,A)),!1}else if(m.arg==="float"&&(y=parseFloat(y),!Number.isFinite(y)))return console.log("wrong float argument",e.slice(0,A)),!1;e=e.slice(A+2)}if(m.shift){const A=f();if(A===-1)return!1;const _=u();hn(s(),t,A,_);let x=0,v=0;m.shift==="x"?x=y*_.rect.width:v=y*_.rect.height,l(_,i.x+x,i.y+v),a(_.rect.width*(x>0?1+y:1));continue}if(m.name==="#url["){const A=f();if(A===-1)return!1;const _=c(!0),x=u();_.attr("href",y),!Ci()&&!i.painter?.isBatchMode()&&_.on("mouseenter",()=>_.style("text-decoration","underline")).on("mouseleave",()=>_.style("text-decoration",null)).append("svg:title").text(`link on ${y}`),hn(_,t,A,x),l(x,0,0,!0),a(x.rect.width);continue}if(m.name==="#color["||m.name==="#scale["||m.name==="#font["){const A=f();if(A===-1)return!1;const _=u();m.name==="#color["?_.color=i.painter.getColor(y):m.name==="#font["?(_.font=new Ha(y,_.fsize),_.font.name===Mn&&!_.font.isSymbol&&(_.font.isSymbol=Mn,_.font.name=Fl),_.font.setUseFullStyle(!0),_.ufont=!0):_.fsize*=y,hn(s(),t,A,_),l(_,i.x,i.y),a(_.rect.width);continue}if(m.sqrt){const A=f();if(A===-1)return!1;const _=c(),x=u();let v;m.arg&&(v=u(.7),hn(_,t,y.toString(),v));const b=d(_);hn(_,t,A,x);const M=x.rect,T=Math.round(M.height),w=Math.round(M.height*.1),E=Math.round(M.width),k=Math.round((M.y1+M.y2)/2),C=Math.round(i.fsize*.2),R=Math.round(M.y2);v&&l(v,0,k-v.fsize*.3,!0),b.attr("d",`M0,${k}h${w}l${w},${R-k-C}l${w},${C-T}h${Math.round(T*.2+E)}v${w}`),l(x,T*.4,0,!0),o(i.x,i.y+M.y1-i.fsize*.1,i.x+E+T*.6,i.y+M.y2),a(E+T*.6);continue}}return!0}function TD(n,t,e){const i={lvl:0,g:t,x:0,y:0,dx:0,dy:-.1,fsize:e.font_size,font:e.font,parent:null,painter:n};return hn(t,e,e.text,i)}let ro;async function h6(){const n=ro!==void 0;if(!n&&typeof globalThis.MathJax<"u")return globalThis.MathJax;n||(ro=[]);const t=new Promise(r=>{ro?ro.push(r):r(globalThis.MathJax)});if(n)return t;const e={scale:1,minScale:.5,mtextInheritFont:!1,merrorInheritFont:!0,mathmlSpacing:!1,skipAttributes:{},exFactor:.5,displayAlign:"center",displayIndent:"0",fontCache:"local",localID:null,internalSpeechTitles:!0,titleID:0};if(!Se()){window.MathJax={options:{enableMenu:!1},loader:{load:["[tex]/color","[tex]/upgreek","[tex]/mathtools","[tex]/physics"]},tex:{packages:{"[+]":["color","upgreek","mathtools","physics"]}},svg:e,startup:{ready(){MathJax.startup.defaultReady();const s=ro;ro=void 0,s.forEach(a=>a(globalThis.MathJax))}}};let r="../mathjax/3.2.0";return ue.webwindow&&li.indexOf("https://root.cern/js")<0&&li.indexOf("https://jsroot.gsi.de")<0&&(r="mathjax"),Cr(li+r+"/es5/tex-svg.js").catch(()=>Cr("https://cdn.jsdelivr.net/npm/mathjax@3.2.0/es5/tex-svg.js")).then(()=>t)}let i;return pv().then(r=>(i=r.JSDOM,Qt(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]))).then(r=>(r.init({loader:{load:["input/tex","output/svg","[tex]/color","[tex]/upgreek","[tex]/mathtools","[tex]/physics"]},tex:{packages:{"[+]":["color","upgreek","mathtools","physics"]}},svg:e,config:{JSDOM:i},startup:{typeset:!1,ready(){const s=MathJax;s.startup.registerConstructor("jsdomAdaptor",()=>new s._.adaptors.HTMLAdaptor.HTMLAdaptor(new s.config.config.JSDOM().window)),s.startup.useAdaptor("jsdomAdaptor",!0),s.startup.defaultReady();const a=ro;ro=void 0,a.forEach(o=>o(s))}}}),t))}const cw={"#LT":"\\langle","#GT":"\\rangle","#club":"\\clubsuit","#spade":"\\spadesuit","#heart":"\\heartsuit","#diamond":"\\diamondsuit","#voidn":"\\wp","#voidb":"f","#copyright":"(c)","#ocopyright":"(c)","#trademark":"TM","#void3":"TM","#oright":"R","#void1":"R","#3dots":"\\ldots","#lbar":"\\mid","#void8":"\\mid","#divide":"\\div","#Jgothic":"\\Im","#Rgothic":"\\Re","#doublequote":'"',"#plus":"+","#minus":"-","#/":"/","#upoint":".","#aa":"\\mathring{a}","#AA":"\\mathring{A}","#omicron":"o","#Alpha":"A","#Beta":"B","#Epsilon":"E","#Zeta":"Z","#Eta":"H","#Iota":"I","#Kappa":"K","#Mu":"M","#Nu":"N","#Omicron":"O","#Rho":"P","#Tau":"T","#Chi":"X","#varomega":"\\varpi","#corner":"?","#ltbar":"?","#bottombar":"?","#notsubset":"?","#arcbottom":"?","#cbar":"?","#arctop":"?","#topbar":"?","#arcbar":"?","#downleftarrow":"?","#splitline":"\\genfrac{}{}{0pt}{}","#it":"\\textit","#bf":"\\textbf","#frac":"\\frac","#left{":"\\lbrace","#right}":"\\rbrace","#left\\[":"\\lbrack","#right\\]":"\\rbrack","#\\[\\]{":"\\lbrack"," } ":"\\rbrack","#\\[":"\\lbrack","#\\]":"\\rbrack","#{":"\\lbrace","#}":"\\rbrace"," ":"\\;"},fw={upDelta:"Updelta",upGamma:"Upgamma",upLambda:"Uplambda",upOmega:"Upomega",upPhi:"Upphi",upPi:"Uppi",upPsi:"Uppsi",upSigma:"Upsigma",upTheta:"Uptheta",upUpsilon:"Upupsilon",upXi:"Upxi",notcong:"ncong",notgeq:"ngeq",notgr:"ngtr",notless:"nless",notleq:"nleq",notsucc:"nsucc",notprec:"nprec",notsubseteq:"nsubseteq",notsupseteq:"nsupseteq",openclubsuit:"clubsuit",openspadesuit:"spadesuit",dasharrow:"dashrightarrow",comp:"circ",iiintop:"iiint",iintop:"iint",ointop:"oint"},uw={Digamma:988,upDigamma:988,digamma:989,updigamma:989,Koppa:990,koppa:991,upkoppa:991,upKoppa:990,VarKoppa:984,upVarKoppa:984,varkoppa:985,upvarkoppa:985,varkappa:954,upvarkappa:954,varbeta:976,upvarbeta:976,Sampi:992,upSampi:992,sampi:993,upsampi:993,Stigma:986,upStigma:986,stigma:987,upstigma:987,San:1018,upSan:1018,san:1019,upsan:1019,Sho:1015,upSho:1015,sho:1016,upsho:1016,P:182,aa:176,bulletdashcirc:8887,circdashbullet:8886,downuparrows:8693,updownarrows:8645,dashdownarrow:8675,dashuparrow:8673,complement:8705,dbar:396,ddddot:8943,dddot:8943,ddots:8945,defineequal:8797,defineeq:8797,downdownharpoons:10597,downupharpoons:10607,updownharpoons:10606,upupharpoons:10595,hateq:8793,ldbrack:10214,rdbrack:10215,leadsfrom:8604,leftsquigarrow:8668,lightning:9735,napprox:8777,nasymp:8813,nequiv:8802,nsimeq:8772,nsubseteq:8840,nsubset:8836,notapprox:8777,notasymp:8813,notequiv:8802,notni:8716,notsimeq:8772,notsubseteq:8840,notsubset:8836,notsupseteq:8841,notsupset:8837,nsupset:8837,setdif:8726,simarrow:10610,t:8256,u:711,v:711,undercurvearrowright:10555,updbar:396,wwbar:8213,awointop:8754,awoint:8755,barintop:10780,barint:10779,cwintop:8753,cwint:8753,cwointop:8755,cwoint:8754,oiiintop:8752,oiiint:8752,oiintop:8751,oiint:8751,slashintop:10767,slashint:10767},ED=['"',"'","`","=","~"];function CD(n,t,e,i){if(t!==2){for(const a in cw)n=n.replace(new RegExp(a,"g"),cw[a]);for(const a in yd)a.length>2&&(n=n.replace(new RegExp(a,"g"),"\\"+a.slice(1)));let r="",s=!0;for(;n;){let a=n.indexOf("#color[");if(a<0&&s){r=n;break}if(s=!1,a){const f=a<0?n:n.slice(0,a);if(r+=f,a<0)break}if(n=n.slice(a+7),a=n.indexOf("]{"),a<=0)break;const o=parseInt(n.slice(0,a));if(!Number.isInteger(o))break;const h=i.getColor(o);let l=1;for(n=n.slice(a+2),a=-1;l&&++a<n.length;)n[a]==="{"?l++:n[a]==="}"&&l--;if(l)break;const c=n.slice(0,a);n=n.slice(a+1),c&&(r+=`\\color{${h}}{${c}}`)}n=r}else{n==="\\^"&&(n="\\unicode{0x5E}"),n==="\\vec"&&(n="\\unicode{0x2192}"),n=n.replace(/\\\./g,"\\unicode{0x2E}").replace(/\\\^/g,"\\hat");for(const r in uw)n=n.replace(new RegExp(`\\\\\\b${r}\\b`,"g"),`\\unicode{0x${uw[r].toString(16)}}`);ED.forEach(r=>{n=n.replace(new RegExp(`(\\\\${r})`,"g"),`\\unicode{0x${r.charCodeAt(0).toString(16)}}`)});for(const r in fw)n=n.replace(new RegExp(`\\\\\\b${r}\\b`,"g"),`\\${fw[r]}`)}return Pt(e)?`\\color{${e}}{${n}}`:n}function PD(n,t,e,i){const r=h=>{if(!h||!Pt(h)||h.length<3)return null;const l=h.indexOf("ex");return l<0||l!==h.length-2?null:(h=parseFloat(h.slice(0,l)),Number.isFinite(h)?h*i.font.size*.5:null)};let s=r(e.getAttribute("width")),a=r(e.getAttribute("height")),o=e.getAttribute("style");if(o&&o.length>18&&o.indexOf("vertical-align:")===0){const h=o.indexOf("ex;");o=h>0&&h===o.length-3?r(o.slice(16,o.length-1)):null}else o=null;if(s=!s||s<=.5?1:Math.round(s),a=!a||a<=.5?1:Math.round(a),e.setAttribute("width",s),e.setAttribute("height",a),e.removeAttribute("style"),!Se()){const h=cr(t,"bbox");s=1.05*h.width,a=1.05*h.height}i.valign=o,i.scale&&n.scaleTextDrawing(Math.max(s/i.width,a/i.height),i.draw_g)}function kD(n,t,e,i,r,s){let a=parseInt(e.attr("width")),o=parseInt(e.attr("height"));if(Se()){const d=e.attr("viewBox");Pt(d)&&d.indexOf("NaN")>0&&e.attr("viewBox",d.replaceAll("NaN","600"))}if(Number.isInteger(o)&&Number.isInteger(a))s>0&&(a/=s,o/=s,e.attr("width",Math.round(a)).attr("height",Math.round(o)));else{const d=cr(t,"bbox");a=d.width||a||100,o=d.height||o||10}s>0&&i.valign&&(i.valign/=s),i.valign===null&&(i.valign=(r-o)/2);const h={x:1,y:1};let l="x",c="y";i.rotate===180?h.x=h.y=-1:(i.rotate===270||i.rotate===90)&&(h.x=i.rotate===270?-1:1,h.y=-h.x,l="y",c="x"),i.align[0]==="middle"?i[l]+=h.x*(i.width-a)/2:i.align[0]==="end"&&(i[l]+=h.x*(i.width-a)),i.align[1]==="middle"?i[c]+=h.y*(i.height-o)/2:i.align[1]==="bottom"?i[c]+=h.y*(i.height-o):i.align[1]==="bottom-base"&&(i[c]+=h.y*(i.height-o-i.valign));let f=Bn(i.x,i.y)||"";i.rotate&&(f+=`${f?" ":""}rotate(${i.rotate})`),t.attr("transform",f||null).attr("visibility",null)}async function LD(n,t,e){const i=CD(e.text,e.latex,e.color,n),r={em:e.font.size,ex:e.font.size/2,family:e.font.name,scale:1,containerWidth:-1,lineWidth:1e5};return h6().then(s=>s.tex2svgPromise(i,r)).then(s=>{const a=s.querySelector("svg");return t.append(()=>a),PD(n,t,a,e),e.mj_func=kD,!0})}async function ND(n){return h6().then(t=>t.typesetPromise(n?[n]:void 0))}const gy=[2,3,5,4,25,26,27,28,30,32,35,36,37,38,40,42,44,46],RD=[0,1,2,3,4,5,106,107,104,1,1,1,1,1,1,1,1,1,1,1,104,125,126,132,4,25,26,27,28,130,30,3,32,127,128,35,36,37,38,137,40,140,42,142,44,144,46,146,148,149];class yv{constructor(t){this.x0=this.y0=0,this.color="black",this.style=1,this.size=8,this.scale=1,this.stroke=!0,this.fill=!0,this.marker="",this.ndig=0,this.used=!0,this.changed=!1,this.func=this.apply.bind(this),this.setArgs(t),this.changed=!1}setArgs(t){se(t)&&typeof t.fMarkerStyle=="number"&&(t={attr:t}),t.attr&&(t.color??=t.painter?t.painter.getColor(t.attr.fMarkerColor):Xi(t.attr.fMarkerColor),(!t.style||t.style<0)&&(t.style=t.attr.fMarkerStyle),t.size??=t.attr.fMarkerSize),this.color=t.color,this.style=t.style,this.size=t.size,this.refsize=t.refsize,this.#i()}setUsed(t){this.used=t}resetPos(){this.lastx=this.lasty=null}create(t,e){if(!this.optimized)return`M${(t+this.x0).toFixed(this.ndig)},${(e+this.y0).toFixed(this.ndig)}${this.marker}`;const i=Math.round(t),r=Math.round(e);let s=`M${i},${r}`;if(this.lastx!==null)if(i===this.lastx&&r===this.lasty)s="";else{const a=`m${i-this.lastx},${r-this.lasty}`;a.length<s.length&&(s=a)}return this.lastx=i+1,this.lasty=r,s+"h1"}getFullSize(){return this.scale*this.size}getMarkerLength(){return this.marker?this.marker.length:10}change(t,e,i){this.changed=!0,t!==void 0&&(this.color=t),e!==void 0&&e>=0&&(this.style=e),i!==void 0&&(this.size=i),this.#i()}#i(){if(this.x0=this.y0=0,this.style===1||this.style===777)return this.fill=!1,this.marker="h1",this.size=1,this.optimized=!0,this.resetPos(),!0;this.optimized=!1,this.lwidth=1;let t=this.style;t>=50&&(this.lwidth=2+Math.floor((t-50)/gy.length),t=gy[(t-50)%gy.length]);const e=RD[t]??104,i=e%100;this.fill=e>=100,this.scale=this.refsize||8;const r=this.getFullSize();this.ndig=r>7?0:r>2?1:2,i===30&&this.ndig++;let s=r.toFixed(this.ndig);const a=(r/2).toFixed(this.ndig),o=(r/3).toFixed(this.ndig),h=(r/4).toFixed(this.ndig),l=(r/8).toFixed(this.ndig),c=(r*3/8).toFixed(this.ndig),f=(r*3/4).toFixed(this.ndig);switch(i){case 1:this.marker="h1";break;case 2:this.y0=-r/2,this.marker=`v${s}m-${a},-${a}h${s}`;break;case 3:this.y0=-r/2,this.marker=`v${s}m-${a},-${a}h${s}m-${l},-${c}l-${f},${f}m${f},0l-${f},-${f}`;break;case 4:this.x0=-parseFloat(a),s=(parseFloat(a)*2).toFixed(this.ndig),this.marker=`a${a},${a},0,1,0,${s},0a${a},${a},0,1,0,-${s},0z`;break;case 5:this.x0=this.y0=-3/8*r,this.marker=`l${f},${f}m0,-${f}l-${f},${f}`;break;case 6:this.x0=-1,this.marker="a1,1,0,1,0,2,0a1,1,0,1,0,-2,0z";break;case 7:this.x0=-1.5,this.marker="a1.5,1.5,0,1,0,3,0a1.5,1.5,0,1,0,-3,0z";break;case 25:this.x0=this.y0=-r/2,this.marker=`v${s}h${s}v-${s}z`;break;case 26:this.y0=-r/2,this.marker=`l-${a},${s}h${s}z`;break;case 27:this.y0=-r/2,this.marker=`l${o},${a}l-${o},${a}l-${o},-${a}z`;break;case 28:this.x0=this.y0=r/6,this.marker=`h${o}v-${o}h-${o}v-${o}h-${o}v${o}h-${o}v${o}h${o}v${o}h${o}z`;break;case 30:{this.y0=-r/2;const d=(r*5/6).toFixed(this.ndig),u=(r*5/8).toFixed(this.ndig);this.marker=`l${o},${s}l-${d},-${u}h${s}l-${d},${u}z`;break}case 32:this.y0=r/2,this.marker=`l-${a},-${s}h${s}z`;break;case 35:this.x0=-r/2,this.marker=`l${a},${a}l${a},-${a}l-${a},-${a}zh${s}m-${a},-${a}v${s}`;break;case 36:this.x0=this.y0=-r/2,this.marker=`h${s}v${s}h-${s}zl${s},${s}m0,-${s}l-${s},${s}`;break;case 37:this.x0=-r/2,this.marker=`h${s}l-${h},-${a}l-${a},${s}h${a}l-${a},-${s}z`;break;case 38:this.x0=-r/4,this.y0=-r/2,this.marker=`h${a}l${h},${h}v${a}l-${h},${h}h-${a}l-${h},-${h}v-${a}zm${h},0v${s}m-${a},-${a}h${s}`;break;case 40:this.x0=-r/4,this.y0=-r/2,this.marker=`l${a},${s}l${h},-${h}l-${s},-${a}zm${a},0l-${a},${s}l-${h},-${h}l${s},-${a}z`;break;case 42:this.y0=-r/2,this.marker=`l${l},${c}l${c},${l}l-${c},${l}l-${l},${c}l-${l},-${c}l-${c},-${l}l${c},-${l}z`;break;case 44:this.x0=-r/4,this.y0=-r/2,this.marker=`h${a}l-${l},${c}l${c},-${l}v${a}l-${c},-${l}l${l},${c}h-${a}l${l},-${c}l-${c},${l}v-${a}l${c},${l}z`;break;case 46:this.x0=-r/4,this.y0=-r/2,this.marker=`l${h},${h}l${h},-${h}l${h},${h}l-${h},${h}l${h},${h}l-${h},${h}l-${h},-${h}l-${h},${h}l-${h},-${h}l${h},-${h}l-${h},-${h}z`;break;case 48:this.x0=-r/4,this.y0=-r/2,this.marker=`l${h},${h}l-${h},${h}l-${h},-${h}zm${a},0l${h},${h}l-${h},${h}l-${h},-${h}zm0,${a}l${h},${h}l-${h},${h}l-${h},-${h}zm-${a},0l${h},${h}l-${h},${h}l-${h},-${h}z`;break;case 49:this.x0=-r/6,this.y0=-r/2,this.marker=`h${o}v${o}h-${o}zm${o},${o}h${o}v${o}h-${o}zm-${o},${o}h${o}v${o}h-${o}zm-${o},-${o}h${o}v${o}h-${o}z`;break;default:this.y0=-r/2,this.marker=`l${o},${a}l-${o},${a}l-${o},-${a}z`;break}return!0}getStrokeColor(){return this.stroke?this.color:"none"}getFillColor(){return this.fill?this.color:"none"}empty(){return this.color==="none"||!this.fill&&!this.stroke}apply(t){this.used=!0,t.style("stroke",this.stroke?this.color:"none").style("stroke-width",this.stroke&&this.lwidth>1?this.lwidth:null).style("fill",this.fill?this.color:"none")}verifyDirectChange(){this.change(this.color,parseInt(this.style),parseFloat(this.size))}createSample(t,e,i,r){r&&(t=Ct(t)),this.resetPos(),t.append("path").attr("d",this.create(e/2,i/2)).call(this.func)}}class ig{#i;constructor(t){this.color="none",this.colorindx=0,this.pattern=0,this.used=!0,this.kind=t.kind||2,this.changed=!1,this.func=this.apply.bind(this),this.setArgs(t),this.changed=!1}setArgs(t){se(t.attr)&&(t.pattern??=t.attr.fFillStyle,t.color??=t.attr.fFillColor),t.enable!==void 0&&this.enable(t.enable);const e=this.changed;this.change(t.color,t.pattern,t.svg,t.color_as_svg,t.painter),this.changed=e}apply(t){if(this.#i){t.style("fill","none");return}this.used=!0,t.style("fill",this.getFillColor()),"opacity"in this&&t.style("opacity",this.opacity),"antialias"in this&&t.style("antialias",this.antialias)}getFillColor(){return this.pattern_url||this.color}getFillColorAlt(t){return this.color&&this.color!=="none"?this.color:t}empty(){const t=this.getFillColor();return!t||t==="none"}enable(t){this.#i=t===void 0||t?void 0:!0}setUsed(t){this.used=t}hasColor(){return this.color&&this.color!=="none"}setSolidColor(t){delete this.pattern_url,this.color=t,this.pattern=1001}setOpacity(t){this.opacity=t}isSolid(t){return this.pattern!==1001||this.gradient?!1:!t||t===this.color}verifyDirectChange(t){Pt(this.pattern)&&(this.pattern=parseInt(this.pattern)),Number.isInteger(this.pattern)||(this.pattern=0),this.change(this.color,this.pattern,t?.getCanvSvg(),!0,t)}change(t,e,i,r,s){if(delete this.pattern_url,delete this.gradient,this.changed=!0,t!==void 0&&Number.isInteger(parseInt(t))&&!r&&(this.colorindx=parseInt(t)),e!==void 0&&Number.isInteger(parseInt(e))&&(this.pattern=parseInt(e),delete this.opacity,delete this.antialias),this.pattern===1e3&&this.colorindx===0)return this.pattern_url="white",!0;if(this.pattern===1e3&&(this.pattern=1001),this.pattern<1001)return this.pattern_url="none",!0;if(this.isSolid()&&this.colorindx===0&&this.kind===1&&!r)return this.pattern_url="none",!0;let a=this.colorindx;if(r?(this.color=t,t!=="none"&&(a=Pn(t).hex().slice(1))):this.color=s?s.getColor(a):Xi(a),Pt(this.color)||(se(this.color)&&(this.color?._typename===Km||this.color?._typename===t1)&&(this.gradient=this.color),this.color="none"),this.isSolid())return!0;if(!this.gradient){if(this.pattern>=4e3&&this.pattern<=4100)return this.opacity=(this.pattern-4e3)/100,!0;if(this.pattern<3e3||this.color==="none")return!1}if(!i||i.empty())return!1;let o,h="",l=null,c="",f="",d=2,u=2;if(this.gradient)o=`grad_${this.gradient.fNumber}`;else{switch(o=`pat_${this.pattern}_${a}`,this.pattern){case 3001:d=u=2,c="M0,0h1v1h-1zM1,1h1v1h-1z";break;case 3002:d=4,u=2,c="M1,0h1v1h-1zM3,1h1v1h-1z";break;case 3003:d=u=4,c="M2,1h1v1h-1zM0,3h1v1h-1z";break;case 3004:d=u=8,h="M8,0L0,8";break;case 3005:d=u=8,h="M0,0L8,8";break;case 3006:d=u=4,h="M1,0v4";break;case 3007:d=u=4,h="M0,1h4";break;case 3008:d=u=10,c="M0,3v-3h3ZM7,0h3v3ZM0,7v3h3ZM7,10h3v-3ZM5,2l3,3l-3,3l-3,-3Z",h="M0,3l5,5M3,10l5,-5M10,7l-5,-5M7,0l-5,5";break;case 3009:d=u=12,h="M0,0A6,6,0,0,0,12,0M6,6A6,6,0,0,0,12,12M6,6A6,6,0,0,1,0,12",l="none";break;case 3010:d=u=10,h="M0,2h10M0,7h10M2,0v2M7,2v5M2,7v3";break;case 3011:d=9,u=18,h="M5,0v8M2,1l6,6M8,1l-6,6M9,9v8M6,10l3,3l-3,3M0,9v8M3,10l-3,3l3,3",l="none";break;case 3012:d=10,u=20,h="M5,1A4,4,0,0,0,5,9A4,4,0,0,0,5,1M0,11A4,4,0,0,1,0,19M10,11A4,4,0,0,0,10,19",l="none";break;case 3013:d=u=7,h="M0,0L7,7M7,0L0,7",l="none";break;case 3014:d=u=16,h="M0,0h16v16h-16v-16M0,12h16M12,0v16M4,0v8M4,4h8M0,8h8M8,4v8",l="none";break;case 3015:d=6,u=12,h="M2,1A2,2,0,0,0,2,5A2,2,0,0,0,2,1M0,7A2,2,0,0,1,0,11M6,7A2,2,0,0,0,6,11",l="none";break;case 3016:d=12,u=7,h="M0,1A3,2,0,0,1,3,3A3,2,0,0,0,9,3A3,2,0,0,1,12,1",l="none";break;case 3017:d=u=4,h="M3,1l-2,2";break;case 3018:d=u=4,h="M1,1l2,2";break;case 3019:d=u=12,h="M1,6A5,5,0,0,0,11,6A5,5,0,0,0,1,6h-1h1A5,5,0,0,1,6,11v1v-1A5,5,0,0,1,11,6h1h-1A5,5,0,0,1,6,1v-1v1A5,5,0,0,1,1,6",l="none";break;case 3020:d=7,u=12,h="M1,0A2,3,0,0,0,3,3A2,3,0,0,1,3,9A2,3,0,0,0,1,12",l="none";break;case 3021:d=u=8,h="M8,2h-2v4h-4v2M2,0v2h-2",l="none";break;case 3022:d=u=8,h="M0,2h2v4h4v2M6,0v2h2",l="none";break;case 3023:d=u=8,c="M4,0h4v4zM8,4v4h-4z",f="M4,0L0,4L4,8L8,4Z";break;case 3024:d=u=16,c="M0,8v8h2v-8zM8,0v8h2v-8M4,14v2h12v-2z",f="M0,2h8v6h4v-6h4v12h-12v-6h-4z";break;case 3025:d=u=18,c="M5,13v-8h8ZM18,0v18h-18l5,-5h8v-8Z";break;default:{if(this.pattern>3025&&this.pattern<3100){d=4,u=2,c="M1,0h1v1h-1zM3,1h1v1h-1z";break}const m=this.pattern%1e3,g=m%10,y=(m-g)%100/10,A=(m-y*10-g)/100;if(!A)break;const _=y===g||y===0||y===5||y===9||g===0||g===5||g===9,x=s?.getPadPainter(),v=x?Math.max(x.getPadWidth(),x.getPadHeight()):600,b=Math.max(.1,K.fHatchesSpacing*v*.001),M=Math.max(1,Math.round(b))*6,T=A*M;o+=_?`_hn${Math.round(b*100)}`:`_ho${M}`,d=u=6*T;const k=_?(F,P,I,U)=>{if(I===0||I===90){const X=A*b*3,j=Math.round(u/X),J=u/j;let $=J/2;for(;$<u;)I===0?h+=`M0,${Math.round($)}h${d}`:h+=`M${Math.round($)},0v${u}`,$+=J;return}const N=I/180*Math.PI,q=A*b*3/Math.cos(N),G=Math.tan(N)*d,nt=Math.round(G/q),gt=G/nt,O=Math.floor(u/gt);u=Math.round(O*gt);let Y=O*gt;for(;Math.abs(Y-u)<.1;)Y-=gt;for(;Y+G>0;){let X=0,j=Y,J=d,$=Y+G;j<-1e-5?(X=-j/G*d,j=0):$>u&&(J=(u-j)/G*d,$=u),U&&(X=d-X,J=d-J),h+=`M${Math.round(X)},${Math.round(j)}L${Math.round(J)},${Math.round($)}`,Y-=gt}}:(F,P)=>{const I=[];let U=T,N=0,q=u,G,nt,gt;for(Math.abs(F)<3&&(U=Math.round(T/12*9)),F===0?(U=Math.round(T/12*8),N=U/2):F>0?q-=U:N=U;N<=q;)G=N+F*U,G<0?(gt=Math.round(N/(N-G)*d),I.push(0,N,gt,0),I.push(d,u-N,d-gt,u)):G>u?(gt=Math.round((u-N)/(G-N)*d),I.push(0,N,gt,u),I.push(d,u-N,d-gt,0)):I.push(0,N,d,G),N+=U;for(let O=0;O<I.length;O+=4)P?(nt=I[O+1],N=I[O],gt=I[O+3],G=I[O+2]):(nt=I[O],N=I[O+1],gt=I[O+2],G=I[O+3]),h+=`M${nt},${N}`,G===N?h+=`h${gt-nt}`:gt===nt?h+=`v${G-N}`:h+=`L${gt},${G}`};let C=!1,R=!1;switch(y){case 0:C=!0;break;case 1:k(1,!1,10);break;case 2:k(2,!1,20);break;case 3:k(3,!1,30);break;case 4:k(6,!1,45);break;case 6:k(3,!0,60);break;case 7:k(2,!0,70);break;case 8:k(1,!0,80);break;case 9:R=!0;break}switch(g){case 0:C=!0;break;case 1:k(-1,!1,10,!0);break;case 2:k(-2,!1,20,!0);break;case 3:k(-3,!1,30,!0);break;case 4:k(-6,!1,45,!0);break;case 6:k(-3,!0,60,!0);break;case 7:k(-2,!0,70,!0);break;case 8:k(-1,!0,80,!0);break;case 9:R=!0;break}C&&k(0,!1,0),R&&k(0,!0,90);break}}if(!c&&!h)return!1}this.pattern_url=`url(#${o})`,this.antialias=!1;let p=i.selectChild(".canvas_defs");if(p.empty()&&(p=i.insert("svg:defs",":first-child").attr("class","canvas_defs")),p.selectChild("."+o).empty())if(this.gradient){const m=this.gradient._typename===Km,g=p.append(m?"svg:linearGradient":"svg:radialGradient").attr("id",o).attr("class",o),y=A=>A===Math.round(A)?A.toFixed(0):A.toFixed(2);m?g.attr("x1",y(this.gradient.fStart.fX)).attr("y1",y(1-this.gradient.fStart.fY)).attr("x2",y(this.gradient.fEnd.fX)).attr("y2",y(1-this.gradient.fEnd.fY)):g.attr("cx",y(this.gradient.fStart.fX)).attr("cy",y(1-this.gradient.fStart.fY)).attr("cr",y(this.gradient.fR1));for(let A=0;A<this.gradient.fColorPositions.length;++A){const _=this.gradient.fColorPositions[A],x=fv(this.gradient.fColors[A*4],this.gradient.fColors[A*4+1],this.gradient.fColors[A*4+2]);g.append("svg:stop").attr("offset",`${Math.round(_*100)}%`).attr("stop-color",x).attr("stop-opacity",`${Math.round(this.gradient.fColors[A*4+3]*100)}%`)}}else{const m=p.append("svg:pattern").attr("id",o).attr("class",o).attr("patternUnits","userSpaceOnUse").attr("width",d).attr("height",u);if(f){const g=zs(this.color);g.r=Math.round((g.r+255)/2),g.g=Math.round((g.g+255)/2),g.b=Math.round((g.b+255)/2),m.append("svg:path").attr("d",f).style("fill",g)}c&&m.append("svg:path").attr("d",c).style("fill",this.color),h&&m.append("svg:path").attr("d",h).style("stroke",this.color).style("stroke-width",K.fHatchesLineWidth||1).style("fill",l)}return!0}createSample(t,e,i,r){r&&(t=Ct(t));const s=new ig({svg:t,pattern:this.pattern,color:this.color,color_as_svg:!0});t.append("path").attr("d",`M0,0h${e}v${i}h${-e}z`).call(s.func)}saveToStyle(t,e){if(t){const i=this.colorindx??n6(this.color);i>=0&&(K[t]=i)}e&&(K[e]=this.pattern)}}const s1=["","","3, 3","1, 2","3, 4, 1, 4","5, 3, 1, 3","5, 3, 1, 3, 1, 3, 1, 3","5, 5","5, 3, 1, 3, 1, 3","20, 5","20, 10, 1, 10","1, 3"];class jx{constructor(t){this.func=this.apply.bind(this),this.used=!0,t._typename&&t.fLineStyle!==void 0&&(t={attr:t}),this.setArgs(t)}setArgs(t){t.attr?(this.color_index=t.attr.fLineColor,t.color=t.color0||(t.painter?.getColor(this.color_index)??Xi(this.color_index)),t.width??=t.attr.fLineWidth,t.style??=t.attr.fLineStyle):Pt(t.color)?t.color!=="none"&&!t.width&&(t.width=1):typeof t.color=="number"&&(this.color_index=t.color,t.color=t.painter?.getColor(t.color)??Xi(t.color)),t.width===void 0&&(t.width=t.color&&t.color!=="none"?1:0),this.nocolor=t.nocolor,this.color=t.width===0||this.nocolor?"none":t.color,this.width=t.width,this.style=t.style,this.pattern=t.pattern||s1[this.style]||null,t.can_excl&&(this.excl_side=this.excl_width=0,Math.abs(this.width)>99&&(this.excl_side=this.width<0?-1:1,this.excl_width=Math.floor(this.width/100)*5,this.width=Math.abs(this.width%100))),!this.color&&this.width>0&&(this.color="lightgrey")}changeExcl(t,e){e!==void 0&&(this.excl_width=e),t!==void 0&&(this.excl_side=t,this.excl_width===0&&this.excl_side&&(this.excl_width=20)),this.changed=!0}empty(){return this.color==="none"}setUsed(t){this.used=t}setBorder(t,e){this.rx=t,this.ry=e,this.func=this.applyBorder.bind(this)}apply(t){this.used=!0,this.empty()?t.style("stroke",null).style("stroke-width",null).style("stroke-dasharray",null):t.style("stroke",this.color).style("stroke-width",this.width).style("stroke-dasharray",this.pattern)}applyBorder(t){this.used=!0,this.empty()?t.attr("rx",null).attr("ry",null).style("stroke",null).style("stroke-width",null).style("stroke-dasharray",null):t.attr("rx",this.rx||null).attr("ry",this.ry||null).style("stroke",this.color).style("stroke-width",this.width).style("stroke-dasharray",this.pattern)}change(t,e,i){t!==void 0&&(this.color!==t&&delete this.color_index,this.color=t),e!==void 0&&(this.width=e),i!==void 0&&(this.style=i,this.pattern=s1[this.style]||null),this.changed=!0}verifyDirectChange(){this.change(this.color,parseInt(this.width),parseInt(this.style))}createSample(t,e,i,r){r&&(t=Ct(t)),t.append("path").attr("d",`M0,${i/2}h${e}`).call(this.func)}saveToStyle(t,e,i){if(t){const r=this.color_index!==void 0?this.color_index:n6(this.color);r>=0&&(K[t]=r)}e&&(K[e]=this.width),i&&(K[i]=this.style)}}function Ad(n){return(n<0||n>=s1.length)&&(n=11),s1[n]}function dw(n,t,e,i){return n||(n=t||0),n>=1?Math.round(n*(i?.getPadScale()||1)):Math.round(n*Math.min(i?.getPadWidth()??1e3,i?.getPadHeight()??1e3)*(e||1))}class DD{constructor(t){this.used=!0,t._typename&&t.fTextFont!==void 0&&(t={attr:t}),this.setArgs(t)}setArgs(t){t.attr?(t.font=t.attr.fTextFont||t.attr_alt?.fTextFont||0,t.size=t.attr.fTextSize||t.attr_alt?.fTextSize||0,this.color_index=t.attr.fTextColor||t.attr_alt?.fTextColor||0,t.color=t.painter?.getColor(this.color_index)??Xi(this.color_index),t.align=t.attr.fTextAlign||t.attr_alt?.fTextAlign||0,t.angle=t.attr.fTextAngle||t.attr_alt?.fTextAngle||0):typeof t.color=="number"&&(this.color_index=t.color,t.color=t.painter?.getColor(t.color)??Xi(t.color)),this.font=t.font,this.size=t.size,this.color=t.color,this.align=t.align,this.angle=t.angle,this.can_rotate=t.can_rotate??!0,this.angle_used=!1,this.align_used=!1}empty(){return this.color==="none"}change(t,e,i,r,s){t!==void 0&&(this.font=t),e!==void 0&&(this.size=e),i!==void 0&&(this.color!==i&&delete this.color_index,this.color=i),r!==void 0&&(this.align=r),s!==void 0&&(this.angle=s),this.changed=!0}verifyDirectChange(){this.change(parseInt(this.font),parseFloat(this.size),this.color,parseInt(this.align),parseInt(this.angle))}createArg(t){return t||(t={}),this.align_used=!t.noalign&&!t.align,this.align_used&&(t.align=this.align),this.angle_used=!t.norotate&&this.can_rotate,this.angle_used&&this.angle&&(t.rotate=-this.angle),t.color=this.color||"black",t}getSize(t,e,i){return dw(this.size,i,e,t)}getAltSize(t,e){return dw(t,this.size,1,e)}getGedFont(){return Math.floor(this.font/10)}setGedFont(t){const e=parseInt(t);return e>0&&e<17&&this.change(e*10+this.font%10),this.font}}function Io(n){return lt(n?.getRootPad)&<(n?.forEachPainterInPad)}function Av(n){const t=n?.select(".root_canvas");return!t||t.empty()?null:t.property("pad_painter")}class Vn extends Of{#i;#r;#e;#s;#h;#a;#d;#u;#o;#n;#p;#c;#g;#A;#x;#v;#w;#_;#b;#M;constructor(t,e,i){const r=Io(t)?t:null;super(r?.getDom()??t),this.setPadPainter(r),this.#r=void 0,this.assignObject(e),Pt(i)&&(this.#o={original:i})}assignObject(t){this.#i=se(t)?t:null}getObject(){return this.#i}setPadPainter(t){this.#e=t?new WeakRef(t):void 0}getPadPainter(){return this.#e?.deref()}getCanvPainter(){let t=this.getPadPainter();for(;t&&!t.isCanvas();)t=t.getPadPainter();return t}isBatchMode(){return Ci()?!0:this.getCanvPainter()?.isBatchMode()??!1}assignSnapId(t){this.#a=t}getSnapId(t){return this.#a?this.#a+(t?"#"+t:""):""}hasSnapId(){return this.#a!==void 0}cleanup(){this.removeG();let t=!0;if(this.isMainPainter()){const e=this.getPadPainter();(!e||e.isCanvas("auto"))&&(t=!1)}this.#e=void 0,this.#s=null,this.#i=null,this.#a=void 0,this.#d=void 0,this.#h=void 0,this.#u=void 0,this.deleteAttr(),this.#v=void 0,this.#o=void 0,this.#n=void 0,delete this.rstyle,delete this.csstype,super.cleanup(t)}getObjectName(){return this.getObject()?.fName??""}getClassName(){return this.getObject()?._typename??""}matchObjectType(t){const e=this.getClassName();return!t||!e?!1:Pt(t)?t===e:Pt(t._typename)?t._typename===e:!!e.match(t)}setItemName(t,e,i){if(super.setItemName(t,e,i),this._no_default_title||!t)return;const r=this.getCanvSvg();r.empty()?this.selectDom().attr("title",t):r.select("title").text(t);const s=this.getCanvPainter();s&&(s===this||this.isMainPainter()&&s===this.getPadPainter())&&s.drawItemNameOnCanvas(t)}setOptions(t,e){return e?this.#o=t:(this.#o||(this.#o={}),Object.assign(this.#o,t)),this.#o}getOptions(t){return!t&&!this.#o&&(this.#o={}),this.#o}get options(){return this.getOptions()}storeDrawOpt(t){if(!this.#o)return;t||(t="");const e=t.indexOf(";;");e>=0&&(t=t.slice(0,e)),this.#o.original=t,this.#n=Object.assign({},this.#o)}getDrawDom(){return this.getPadPainter()||this.getDom()}getDrawOpt(t){if(!this.#o)return"";if(lt(this.#o.asString)){let e=!1;const i=this.getPadPainter();if(!this.#n||i?.options._interactively_changed)e=!0;else for(const r in this.#n)this.#o[r]!==this.#n[r]&&r[0]!=="_"&&r[0]!=="$"&&r[0].toLowerCase()!==r[0]&&(e=!0);if(e&<(this.#o.asString))return this.#o.asString(this.isMainPainter(),t?null:i?.getRootPad())}return this.#o.original||""}getSupportedDrawOptions(){const t=this.getPadPainter(),e=this.getClassName();return!e||!lt(t?.getObjectDrawSettings)?[]:t.getObjectDrawSettings(Ee(e),"nosame")?.opts}redrawObject(t,e){if(!this.updateObject(t,e))return!1;const i=this.isBatchMode()?null:Zi(),r=i?.body.style.cursor;return i&&(i.body.style.cursor="wait"),this.redrawPad().then(s=>(i&&(i.body.style.cursor=r),s))}updateObject(t){return this.matchObjectType(t)?(Object.assign(this.getObject(),t),!0):!1}getObjectHint(){const t=this.getItemName();return t?t.length>20?"..."+t.slice(t.length-17):t:this.getObjectName()||this.getClassName()||""}setColors(t){this.#v=t}getColors(t){return!this.#v&&t&&this.setColors(this.getCanvPainter()?.getColors()||$l()),this.#v}getColor(t){return this.getColors(!0)[t]}addColor(t){const e=this.getColors(!0),i=e.indexOf(t);return i>=0?i:(e.push(t),e.length-1)}isTooltipAllowed(){return(this.getCanvPainter()||this).tooltip_allowed}setTooltipAllowed(t=!0){const e=this.getCanvPainter()||this;e.tooltip_allowed=t==="toggle"?!e.tooltip_allowed:t}checkResize(t){return this.getCanvPainter()?.checkCanvasResize(t)}removeG(){this.#r?.remove(),this.#r=void 0}getG(){return this.#r}get draw_g(){return this.#r}setG(t){return this.#r=t,t}appendPath(t){return this.#r.append("svg:path").attr("d",t)}createG(t,e=!1){let i;const r=this.getPadPainter();if(t==="frame2d"){const o=this.getFramePainter();t=o&&!o.mode3d}if(t){const o=r.getFrameSvg();if(o.empty())return console.error("Not found frame to create g element inside"),o;Pt(t)||(t="main_layer"),i=o.selectChild("."+t)}else i=r.getLayerSvg("primitives_layer");this.#r&&this.#r.node().parentNode!==i.node()&&(console.log("g element changes its layer!"),this.removeG()),this.#r?this.#r.selectAll("*").remove():(this.#r=i.append(e?"svg:a":"svg:g"),t||i.selectChildren(".most_upper_primitives").raise());const s=this.getClassName(),a=this.getObjectName();return(a||s)&&this.#r.attr("objname",(a||"name").replace(/[^\w]/g,"_")).attr("objtype",(s||"type").replace(/[^\w]/g,"_")),this.#r.property("in_frame",!!t),this.#r}bringToFront(t){if(!this.#r)return;if(this.#r.node().parentNode?.appendChild(this.#r.node()),t&&this.getSnapId()){const i=this.getPadPainter();i?.getSnapId()&&this.getCanvPainter()?.sendWebsocket("POPOBJ:"+JSON.stringify([i.getSnapId(),this.getSnapId()]))}}setPrimary(t=!0){this.#d=t}isPrimary(){return this.#d}setSecondaryId(t,e){t.setPrimary(!0),this.#h=new WeakRef(t),this.#u=e}getSecondaryId(){return this.#u}isSecondary(t){return this.#h?se(t)?this.#h.deref()===t:!0:!1}getPrimary(){return this.#h?.deref()}getCanvSvg(){return this.selectDom().select(".root_canvas")}selectCurrentPad(){return console.warn("selectCurrentPad is deprecated, will be removed in v8"),""}getAxisToSvgFunc(t,e,i){const r={isndc:t,nornd:e},s=this.getG()?.property("in_frame");if((s||i&&!t)&&(r.fp=this.getFramePainter()),r.fp?.grx&&r.fp?.gry)r.x0=i&&!t?r.fp.getFrameX():0,r.y0=i&&!t?r.fp.getFrameY():0,e?(r.x=function(a){return this.x0+this.fp.grx(a)},r.y=function(a){return this.y0+this.fp.gry(a)}):(r.x=function(a){return this.x0+Math.round(this.fp.grx(a))},r.y=function(a){return this.y0+Math.round(this.fp.gry(a))});else if(s)console.error(`Problem to create functor for ${this.getClassName()}`),r.x=()=>0,r.y=()=>0;else{const a=this.getPadPainter();r.pad=t?null:a?.getRootPad(!0),r.padw=a?.getPadWidth()??10,r.x=function(o){return this.pad&&(this.pad.fLogx&&(o=o>0?Math.log10(o):this.pad.fUxmin),o=(o-this.pad.fX1)/(this.pad.fX2-this.pad.fX1)),o*=this.padw,this.nornd?o:Math.round(o)},r.padh=a?.getPadHeight()??10,r.y=function(o){return this.pad&&(this.pad.fLogy&&(o=o>0?Math.log10(o):this.pad.fUymin),o=(o-this.pad.fY1)/(this.pad.fY2-this.pad.fY1)),o=(1-o)*this.padh,this.nornd?o:Math.round(o)}}return r}axisToSvg(t,e,i,r){return this.getAxisToSvgFunc(i,r)[t](e)}svgToAxis(t,e,i){if(this.getG()?.property("in_frame"))return this.getFramePainter()?.revertAxis(t,e)??0;const s=this.getPadPainter(),a=i||!s?null:s.getRootPad(!0);let o=s?t==="y"?1-e/s.getPadHeight():e/s.getPadWidth():0;return a&&(t==="y"?(o=a.fY1+o*(a.fY2-a.fY1),a.fLogy&&(o=Math.pow(10,o))):(o=a.fX1+o*(a.fX2-a.fX1),a.fLogx&&(o=Math.pow(10,o)))),o}getFramePainter(){return this.getPadPainter()?.getFramePainter()}getMainPainter(t){let e=this.#s?.deref();if(!e){const i=this.getPadPainter();e=i?i.getMainPainter():this.getTopPainter(),this.#s=t||!e?null:new WeakRef(e)}return e||null}isMainPainter(){return this===this.getMainPainter()}setAsMainPainter(t){const e=this.getPadPainter();e?e.setMainPainter(this,t):this.setTopPainter()}addToPadPrimitives(t){return this.#e?t=this.#e.deref():(t||(t=Av(this.selectDom())),t&&(this.#e=new WeakRef(t))),!t||t===this?null:t.addToPrimitives(this)}removeFromPadPrimitives(){this.getPadPainter()?.removePrimitive(this)}createAttMarker(t){t===void 0?t={attr:this.getObject()}:se(t)?t.fMarkerColor!==void 0&&t.fMarkerStyle!==void 0&&t.fMarkerSize!==void 0&&(t={attr:t,std:!1}):t={std:!0},t.std===void 0&&(t.std=!0),t.painter===void 0&&(t.painter=this);let e=t.std?this.#b:null;return e?(!e.changed||t.force)&&e.setArgs(t):e=new yv(t),t.std&&(this.#b=e),e}createAttLine(t){t===void 0?t={attr:this.getObject()}:se(t)?t.fLineColor!==void 0&&t.fLineStyle!==void 0&&t.fLineWidth!==void 0&&(t={attr:t,std:!1}):t={std:!0},t.std===void 0&&(t.std=!0),t.painter===void 0&&(t.painter=this);let e=t.std?this.#_:null;return e?(!e.changed||t.force)&&e.setArgs(t):e=new jx(t),t.std&&(this.#_=e),e}createAttText(t){t===void 0?t={attr:this.getObject()}:se(t)?t.fTextFont!==void 0&&t.fTextSize!==void 0&&t.fTextColor!==void 0&&(t={attr:t,std:!1}):t={std:!0},t.std===void 0&&(t.std=!0),t.painter===void 0&&(t.painter=this);let e=t.std?this.#M:null;return e?(!e.changed||t.force)&&e.setArgs(t):e=new DD(t),t.std&&(this.#M=e),e}createAttFill(t){t===void 0?t={attr:this.getObject()}:se(t)?t._typename&&t.fFillColor!==void 0&&t.fFillStyle!==void 0&&(t={attr:t,std:!1}):t={std:!0},t.std===void 0&&(t.std=!0),t.painter===void 0&&(t.painter=this);let e=t.std?this.#w:null;return t.svg||(t.svg=this.getCanvSvg()),e?(!e.changed||t.force)&&e.setArgs(t):e=new ig(t),t.std&&(this.#w=e),e}get fillatt(){return this.#w}get lineatt(){return this.#_}get markeratt(){return this.#b}get textatt(){return this.#M}forEachPainter(t,e){let i=this.getPadPainter(),r=null;i||(r=this.getTopPainter(),Io(r)&&(i=r)),i?i.forEachPainterInPad(t,e):r&&e!=="pads"&&t(r)}async interactiveRedraw(t,e,i){let r,s;return Pt(e)&&e.indexOf("exec:")&&(r=e),t==="pad"?s=this.redrawPad(r):t!==!1&&(s=this.redraw(r)),Go(s).then(()=>{if(t==="attribute")return this.getPadPainter()?.redrawLegend()}).then(()=>{const a=this.getCanvPainter();return lt(a?.producePadEvent)&&a.producePadEvent("redraw",this.getPadPainter(),this,null,i),lt(a?.processChanges)&&a.processChanges(e,this,i),this})}async redrawPad(t){return this.getPadPainter()?.redrawPad(t)??!1}executeMenuCommand(t){return t.fName==="Inspect"?this.showInspector():!1}submitCanvExec(t,e){if(!t||!Pt(t))return;const i=this.getCanvPainter();lt(i?.submitExec)&&i.submitExec(this,t,e)}deleteAttr(t){(!t||t==="line")&&(this.#_=void 0),(!t||t==="fill")&&(this.#w=void 0),(!t||t==="marker")&&(this.#b=void 0),(!t||t==="text")&&(this.#M=void 0)}showInspector(){return!1}fillContextMenu(t){const e=this.getClassName(),i=this.getObjectName(),r=e.lastIndexOf("::"),s=r>0?e.slice(r+2):e,a=s&&i?`${s}:${i}`:s||i||"object",o=e?`${ld}${e.replaceAll("::","_1_1")}.html`:"";t.header(a,o);const h=t.size();return lt(this.fillContextMenuItems)&&this.fillContextMenuItems(t),t.size()>h&&this.showInspector("check")&&t.add("Inspect",this.showInspector),t.addAttributesMenu(this),t.size()>h}showObjectStatus(t,e,i,r){let s=this.getCanvPainter();if(lt(s?.showCanvasStatus)||(s=null),!s&&!lt(Kt.showStatus)||this.enlargeMain("state")==="on")return!1;if(t===void 0&&e===void 0){const a=this.getObject();if(!a)return;t=this.getItemName()||a.fName,e=a.fTitle||a._typename,i=a._typename}s?s.showCanvasStatus(t,e,i,r):Kt.showStatus(t,e,i,r)}redraw(){}startTextDrawing(t,e,i,r,s){if(i||(i=this.getG()),!i||i.empty())return!1;const a=e==="font"?t:new Ha(t,e);return s&&a.needLoad()?a:(a.setPainter(this),i.call(a.func),i.property("draw_text_completed",!1).property("all_args",[]).property("text_font",a).property("text_factor",0).property("max_text_width",0).property("max_font_size",r).property("_fast_drawing",this.getPadPainter()?.isFastDrawing()??!1),i.property("_fast_drawing")&&i.property("_font_too_small",r&&r<5||a.size<4),!0)}async startTextDrawingAsync(t,e,i,r){const s=this.startTextDrawing(t,e,i,r,!0);return s===!0||s===!1?s:s.load().then(a=>a?this.startTextDrawing(s,"font",i,r):!1)}scaleTextDrawing(t,e){e||(e=this.getG()),!(!e||e.empty())&&t&&t>e.property("text_factor")&&e.property("text_factor",t)}#k(t,e,i){const r=t.property("all_args")||[];let s=0;if(r.forEach(u=>{u.ready||s++}),s>0){lt(e)&&(t.node().textResolveFunc=e,t.node().try_optimize=i);return}t.property("all_args",null);const a=t.property("text_factor"),o=t.property("text_font"),h=t.property("max_font_size");let l=o.size,c=!1,f=!0;a>0&&(a<.95||a>1.05)&&(o.size=Math.max(1,Math.floor(o.size/a))),h&&o.size>h&&(o.size=h),o.size!==l&&(t.call(o.func),l=o.size),r.forEach(u=>{if(u.mj_node&&u.mj_func){const p=u.mj_node.select("svg");u.mj_func(this,u.mj_node,p,u,l,a),delete u.mj_node,f=!1}else u.txt_g&&(f=!1)}),e||(e=t.node().textResolveFunc,i=t.node().try_optimize,delete t.node().textResolveFunc,delete t.node().try_optimize);const d=i&&f?[]:null;r.forEach(u=>{let p,m,g=1;if(u.txt_node)p=u.txt_node,delete u.txt_node,m=!0,d!==null&&d.push(p);else if(u.txt_g)p=u.txt_g,delete u.txt_g,m=!1;else return;p.attr("visibility",null),c=!0,u.width&&(u.align[0]==="middle"?u.x+=u.width/2:u.align[0]==="end"&&(u.x+=u.width)),u.height&&(u.align[1].indexOf("bottom")===0?u.y+=u.height:u.align[1]==="middle"&&(u.y+=u.height/2));let y=0,A=0;if(m)Se()?u.scale&&a>0&&(u.box.width*=1/a,u.box.height*=1/a):!u.plain&&!u.fast&&(u.box=cr(p,"bbox")),u.plain?(p.attr("text-anchor",u.align[0]),u.align[1]==="top"?p.attr("dy",".8em"):u.align[1]==="middle"&&p.attr("dominant-baseline","middle")):(p.attr("text-anchor","start"),y=(u.align[0]==="middle"?-.5:u.align[0]==="end"?-1:0)*u.box.width,A=(u.align[1]==="top"?u.top_shift||1:u.align[1]==="middle"?u.mid_shift||.5:0)*u.box.height);else if(u.text_rect){const b=u.text_rect;g=a>0&&Math.abs(1-a)>.01?1/a:1,y=(u.align[0]==="middle"?-.5:u.align[0]==="end"?-1:0)*b.width*g,u.align[1]==="top"?A=-b.y1*g:u.align[1]==="bottom"?A=-b.y2*g:u.align[1]==="middle"&&(A=-.5*(b.y1+b.y2)*g)}else console.error("text rect not calcualted - please check code");u.rotate||(u.x+=y,u.y+=A,y=A=0);let _=Bn(Math.round(u.x),Math.round(u.y))||"";const x=Bn(Math.round(y),Math.round(A)),v=b=>{_&&(_+=" "),_+=b};u.rotate&&v(`rotate(${Math.round(u.rotate)})`),g!==1&&v(`scale(${g.toFixed(3)})`),x&&v(x),_&&p.attr("transform",_)}),c||o.clearFont(t),d!==null&&d.length>1&&["fill","text-anchor"].forEach(u=>{let p=d[0].attr(u);d.forEach(m=>{const g=m.attr(u);(!g||g!==p)&&(p=void 0)}),p&&(t.attr(u,p),d.forEach(m=>{m.attr(u,null)}))}),e&&e(this)}#L(t,e){return t.box=!Se()&&!tt.ApproxTextSize&&!t.fast?cr(e,"bbox"):t.text_rect||{height:Math.round(1.15*t.font_size),width:gv(t.text,t.font,t.font_size)},e.attr("visibility","hidden"),t.box.width>t.draw_g.property("max_text_width")&&t.draw_g.property("max_text_width",t.box.width),t.scale&&this.scaleTextDrawing(Math.max(1.05*t.box.width/t.width,t.box.height/t.height),t.draw_g),t.result_width=t.box.width,t.result_height=t.box.height,lt(t.post_process)&&t.post_process(this),t.box.width}drawText(t){if(t.text||(t.text=""),t.draw_g=t.draw_g||this.getG(),!t.draw_g||t.draw_g.empty())return;const e=t.draw_g.property("text_font");t.font=e,e&&(t.color=t.color||e.color,t.align=t.align||e.align,t.rotate=t.rotate||e.angle);let i=["start","middle"];if(Pt(t.align)?(i=t.align.split(";"),i.length===1&&i.push("middle")):typeof t.align=="number"?(t.align/10>=3?i[0]="end":t.align/10>=2&&(i[0]="middle"),t.align%10===0?i[1]="bottom":t.align%10===1?i[1]="bottom-base":t.align%10===3&&(i[1]="top")):se(t.align)&&t.align.length===2&&(i=t.align),t.latex===void 0&&(t.latex=1),t.align=i,t.x=t.x||0,t.y=t.y||0,t.scale!==!1&&(t.scale=t.width&&t.height&&!t.font_size),t.width=t.width||0,t.height=t.height||0,t.draw_g.property("_fast_drawing")){if(t.scale){if(t.height<4)return 0}else if(t.font_size){if(t.font_size<4)return 0}else if(t.draw_g.property("_font_too_small"))return 0}t.draw_g.property("all_args").push(t),t.ready=!1;let r=t.latex===2;const s=Be.Latex;return t.latex===1&&(r=tt.Latex===s.AlwaysMathJax||tt.Latex===s.MathJax&&t.text.match(/[#{\\]/g)||t.text.match(/[\\]/g)),!r||t.nomathjax?(t.txt_node=t.draw_g.append("svg:text"),t.color&&t.txt_node.attr("fill",t.color),t.font_size?t.txt_node.attr("font-size",t.font_size):t.font_size=e.size,t.plain=!t.latex||tt.Latex===s.Off||tt.Latex===s.Symbols,t.simple_latex=t.latex&&tt.Latex===s.Symbols,!t.plain||t.simple_latex||t.font?.isSymbol?(t.simple_latex||MD(t.text)||t.plain?(t.simple_latex=!0,SD(this,t.txt_node,t)):(t.txt_node.remove(),delete t.txt_node,t.txt_g=t.draw_g.append("svg:g"),TD(this,t.txt_g,t)),t.ready=!0,this.#L(t,t.txt_g||t.txt_node),t.draw_g.property("draw_text_completed")&&this.#k(t.draw_g),0):(t.plain=!0,t.txt_node.text(t.text),t.ready=!0,this.#L(t,t.txt_node))):(t.mj_node=t.draw_g.append("svg:g").attr("visibility","hidden"),LD(this,t.mj_node,t).then(()=>{t.ready=!0,t.draw_g.property("draw_text_completed")&&this.#k(t.draw_g)}),0)}async finishTextDrawing(t,e){return t||(t=this.getG()),!t||t.empty()?!1:(t.property("draw_text_completed",!0),new Promise(i=>{this.#k(t,i,e)}))}configureUserContextMenu(t){this.#A=lt(t)?t:void 0}async fillObjectExecMenu(t,e){if(lt(this.#A))return this.#A(t,e);const i=this.getCanvPainter();if(!this.getSnapId()||!i||i?.isReadonly()||!i?.getWebsocket())return t;function r(o){const h=t.exec_painter||this,l=h.getCanvPainter(),c=t.exec_items[parseInt(o)];if(c?.fName){if(c.fExec==="Show:Editor"){lt(l?.activateGed)&&l.activateGed(h);return}if(!(lt(l?.executeObjectMethod)&&l.executeObjectMethod(h,c,c.$execid))&&(c.fClassName=h.getClassName(),(c.$execid.indexOf("#x")>0||c.$execid.indexOf("#y")>0||c.$execid.indexOf("#z")>0)&&(c.fClassName=kr),!h.executeMenuCommand(c)&&c.$execid)){if(!c.fArgs)return l?.v7canvas?l.submitExec(h,c.fExec,e):h.submitCanvExec(c.fExec,c.$execid);t.showMethodArgsDialog(c).then(f=>{if(!f||h.executeMenuCommand(c,f))return;const d=c.fExec.slice(0,c.fExec.length-1)+f+")";l?.v7canvas?l.submitExec(h,d,e):l?.sendWebsocket(`OBJEXEC:${c.$execid}:${d}`)})}}}const s=(o,h,l,c)=>{if(!t._got_menu){if(t._got_menu=!0,c&&h!==c.fId&&console.error(`missmatch between request ${h} and reply ${c.fId} identifiers`),t.exec_items=c?.fItems,t.exec_items?.length){o.size()>0&&o.separator();let f;for(let d=0;d<t.exec_items.length;++d){const u=t.exec_items[d];if(u.$execid=c.fId,u.$menu=t,u.fClassName&&f&&f!==u.fClassName&&(o.endsub(),f=""),f!==u.fClassName){f=u.fClassName;const p=f.lastIndexOf("::"),m=p>0?f.slice(p+2):f;o.sub(m.replace(/[<>]/g,"_"))}u.fChecked===void 0||u.fChecked<0?o.add(u.fName,d,r):o.addchk(u.fChecked,u.fName,d,r)}f&&o.endsub()}l(o)}},a=this.getSnapId(e);return t._got_menu=!1,t.painter&&(t.exec_painter=t.painter!==this?this:void 0),new Promise(o=>{let h=!1;function l(c){h||(h=!0,o(c))}setTimeout(()=>s(t,a,l),2e3),i.submitMenuRequest(this,e,a).then(c=>s(t,a,l,c))})}configureUserTooltipHandler(t,e=100){!t||!lt(t)?(this.#p=void 0,this.#c=void 0):(this.#p=t,this.#c=e)}configureUserClickHandler(t){const e=this.getFramePainter();lt(e?.configureUserClickHandler)&&e.configureUserClickHandler(t)}configureUserDblclickHandler(t){const e=this.getFramePainter();lt(e?.configureUserDblclickHandler)&&e.configureUserDblclickHandler(t)}hasUserTooltip(){return lt(this.#p)}provideUserTooltip(t){if(this.hasUserTooltip()){if(this.#c<=0)return this.#p(t);if(this.#g&&(clearTimeout(this.#g),this.#g=void 0),!t)return this.#p(t);this.#g=setTimeout(()=>{this.#g=void 0,this.#p&&this.#p(t)},this.#c)}}async provideSpecialDrawArea(t){return t===this.#x?!0:this.getCanvPainter().toggleProjection(t).then(()=>(this.#x=t,!0))}async drawInSpecialArea(t,e,i){const r=this.getCanvPainter();return this.#x&<(r?.drawProjection)?r.drawProjection(i||this.#x,t,e):!1}getToolTip(t){if(t?.clientX===void 0||t?.clientY===void 0)return null;const e=this.getPadPainter()?.getFrameSvg();if(!e||e.empty())return null;const i=e.selectChild(".main_layer");if(i.empty())return null;const r=ji(t,i.node()),s={touch:!1,x:r[0],y:r[1]};if(lt(this.extractToolTip))return this.extractToolTip(s);s.disabled=!0;const a=lt(this.processTooltipEvent)?this.processTooltipEvent(s):null;return a?.user_info||a}}function pw(n,t){const e=new Of(n);return e.txt=t,e.redrawObject=async function(i){return this.txt=i,this.drawText()},e.drawText=async function(){let i=this.txt._typename===ps?this.txt.fString:this.txt.value;Pt(i)||(i="<undefined>");const r=this.txt.mathjax||tt.Latex===Be.Latex.AlwaysMathJax,s=this.selectDom();let a=s.select("div");if(a.empty()?a=s.append("div").attr("style","max-width:100%;max-height:100%;overflow:auto"):a.html(""),this.setTopPainter(),!r&&!("as_is"in this.txt)){const o=i.split(`
|
|
3
3
|
`);for(let h=0;h<o.length;++h)a.append("pre").style("margin","0").text(o[h])}else a.text(i);return r&&ND(s.node()),this},e.drawText()}function bl(n){return Io(n)?n.getCanvPainter():Av(new Vn(n).selectDom())}function GJ(n){return Io(n)?n:new Vn(n).getPadPainter()}function um(n){return Io(n)?n.getMainPainter():new Vn(n).getMainPainter(!0)}let _c=null;function wl(n){n.active?(_c?.getFramePainter()?.setFrameActive(!1),_c=n.pp,_c?.getFramePainter()?.setFrameActive(!0)):_c===n.pp&&(_c=null)}function Xx(){return _c}function Lo(n,t){t===!0?t={force:!0}:se(t)||(t=null);let e=!1;return new Vn(n).forEachPainter(i=>{!e&<(i.checkResize)&&(e=i.checkResize(t))}),e}function pr(n){const t=new Vn(n),e=[];return t.forEachPainter(i=>{e.indexOf(i)<0&&e.push(i)}),e.forEach(i=>i.cleanup()),t.selectDom().html(""),e}const Je={kDecimals:Ne(7),kTickPlus:Ne(9),kTickMinus:Ne(10),kAxisRange:Ne(11),kCenterTitle:Ne(12),kCenterLabels:Ne(14),kRotateTitle:Ne(15),kPalette:Ne(16),kNoExponent:Ne(17),kLabelsHori:Ne(18),kLabelsVert:Ne(19),kLabelsDown:Ne(20),kLabelsUp:Ne(21),kIsInteger:Ne(22),kMoreLogLabels:Ne(23),kOppositeTitle:Ne(32)},Sl="labels",Fu="normal",B0="func",Nc="time";Object.assign(Kt.jsroot,{ObjectPainter:Vn,cleanup:pr,resize:Lo});const ng="180",Wc={ROTATE:0,DOLLY:1,PAN:2},Rc={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},FD=0,mw=1,ID=2,c6=1,OD=2,ma=3,Wa=0,zn=1,ss=2,Da=0,jc=1,Yx=2,gw=3,yw=4,BD=5,Ml=100,zD=101,UD=102,qD=103,VD=104,GD=200,$D=201,HD=202,WD=203,Zx=204,Jx=205,jD=206,XD=207,YD=208,ZD=209,JD=210,QD=211,KD=212,tF=213,eF=214,Qx=0,Kx=1,t_=2,vf=3,e_=4,i_=5,n_=6,r_=7,rg=0,iF=1,nF=2,Oo=0,rF=1,sF=2,aF=3,oF=4,lF=5,hF=6,cF=7,f6=300,bf=301,wf=302,s_=303,a_=304,sg=306,o_=1e3,Il=1001,l_=1002,ur=1003,fF=1004,z0=1005,Cs=1006,yy=1007,Ol=1008,Us=1009,u6=1010,d6=1011,xd=1012,xv=1013,ah=1014,Ps=1015,Fa=1016,_v=1017,vv=1018,_d=1020,p6=35902,m6=35899,g6=1021,y6=1022,cs=1023,vd=1026,bd=1027,bv=1028,wv=1029,A6=1030,Sv=1031,Mv=1033,dm=33776,pm=33777,mm=33778,gm=33779,h_=35840,c_=35841,f_=35842,u_=35843,d_=36196,p_=37492,m_=37496,g_=37808,y_=37809,A_=37810,x_=37811,__=37812,v_=37813,b_=37814,w_=37815,S_=37816,M_=37817,T_=37818,E_=37819,C_=37820,P_=37821,k_=36492,L_=36494,N_=36495,R_=36283,D_=36284,F_=36285,I_=36286,uF=3200,dF=3201,Ah=0,pF=1,wo="",rr="srgb",Sf="srgb-linear",a1="linear",je="srgb",Fh=7680,Aw=519,mF=512,gF=513,yF=514,x6=515,AF=516,xF=517,_F=518,vF=519,xw=35044,_w="300 es",ks=2e3,o1=2001;let xh=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)}hasEventListener(t,e){const i=this._listeners;return i===void 0?!1:i[t]!==void 0&&i[t].indexOf(e)!==-1}removeEventListener(t,e){const i=this._listeners;if(i===void 0)return;const r=i[t];if(r!==void 0){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}dispatchEvent(t){const e=this._listeners;if(e===void 0)return;const i=e[t.type];if(i!==void 0){t.target=this;const r=i.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,t);t.target=null}}};const tn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let vw=1234567;const Xc=Math.PI/180,Mf=180/Math.PI;function Jo(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(tn[n&255]+tn[n>>8&255]+tn[n>>16&255]+tn[n>>24&255]+"-"+tn[t&255]+tn[t>>8&255]+"-"+tn[t>>16&15|64]+tn[t>>24&255]+"-"+tn[e&63|128]+tn[e>>8&255]+"-"+tn[e>>16&255]+tn[e>>24&255]+tn[i&255]+tn[i>>8&255]+tn[i>>16&255]+tn[i>>24&255]).toLowerCase()}function ye(n,t,e){return Math.max(t,Math.min(e,n))}function ag(n,t){return(n%t+t)%t}function _6(n,t,e,i,r){return i+(n-t)*(r-i)/(e-t)}function v6(n,t,e){return n!==t?(e-n)/(t-n):0}function Yc(n,t,e){return(1-e)*n+e*t}function b6(n,t,e,i){return Yc(n,t,1-Math.exp(-e*i))}function w6(n,t=1){return t-Math.abs(ag(n,t*2)-t)}function S6(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function M6(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function T6(n,t){return n+Math.floor(Math.random()*(t-n+1))}function E6(n,t){return n+Math.random()*(t-n)}function C6(n){return n*(.5-Math.random())}function P6(n){n!==void 0&&(vw=n);let t=vw+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function k6(n){return n*Xc}function L6(n){return n*Mf}function N6(n){return(n&n-1)===0&&n!==0}function R6(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function D6(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function F6(n,t,e,i,r){const s=Math.cos,a=Math.sin,o=s(e/2),h=a(e/2),l=s((t+i)/2),c=a((t+i)/2),f=s((t-i)/2),d=a((t-i)/2),u=s((i-t)/2),p=a((i-t)/2);switch(r){case"XYX":n.set(o*c,h*f,h*d,o*l);break;case"YZY":n.set(h*d,o*c,h*f,o*l);break;case"ZXZ":n.set(h*f,h*d,o*c,o*l);break;case"XZX":n.set(o*c,h*p,h*u,o*l);break;case"YXY":n.set(h*u,o*c,h*p,o*l);break;case"ZYZ":n.set(h*p,h*u,o*c,o*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Tl(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function cn(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const bF={DEG2RAD:Xc,RAD2DEG:Mf,generateUUID:Jo,clamp:ye,euclideanModulo:ag,mapLinear:_6,inverseLerp:v6,lerp:Yc,damp:b6,pingpong:w6,smoothstep:S6,smootherstep:M6,randInt:T6,randFloat:E6,randFloatSpread:C6,seededRandom:P6,degToRad:k6,radToDeg:L6,isPowerOfTwo:N6,ceilPowerOfTwo:R6,floorPowerOfTwo:D6,setQuaternionFromProperEuler:F6,normalize:cn,denormalize:Tl};var wF=Object.freeze({__proto__:null,DEG2RAD:Xc,MathUtils:bF,RAD2DEG:Mf,ceilPowerOfTwo:R6,clamp:ye,damp:b6,degToRad:k6,denormalize:Tl,euclideanModulo:ag,floorPowerOfTwo:D6,generateUUID:Jo,inverseLerp:v6,isPowerOfTwo:N6,lerp:Yc,mapLinear:_6,normalize:cn,pingpong:w6,radToDeg:L6,randFloat:E6,randFloatSpread:C6,randInt:T6,seededRandom:P6,setQuaternionFromProperEuler:F6,smootherstep:M6,smoothstep:S6});let Bt=class I6{constructor(t=0,e=0){I6.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=ye(this.x,t.x,e.x),this.y=ye(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=ye(this.x,t,e),this.y=ye(this.y,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ye(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(ye(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),r=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*i-a*r+t.x,this.y=s*r+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Ho=class{constructor(t=0,e=0,i=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=r}static slerpFlat(t,e,i,r,s,a,o){let h=i[r+0],l=i[r+1],c=i[r+2],f=i[r+3];const d=s[a+0],u=s[a+1],p=s[a+2],m=s[a+3];if(o===0){t[e+0]=h,t[e+1]=l,t[e+2]=c,t[e+3]=f;return}if(o===1){t[e+0]=d,t[e+1]=u,t[e+2]=p,t[e+3]=m;return}if(f!==m||h!==d||l!==u||c!==p){let g=1-o;const y=h*d+l*u+c*p+f*m,A=y>=0?1:-1,_=1-y*y;if(_>Number.EPSILON){const v=Math.sqrt(_),b=Math.atan2(v,y*A);g=Math.sin(g*b)/v,o=Math.sin(o*b)/v}const x=o*A;if(h=h*g+d*x,l=l*g+u*x,c=c*g+p*x,f=f*g+m*x,g===1-o){const v=1/Math.sqrt(h*h+l*l+c*c+f*f);h*=v,l*=v,c*=v,f*=v}}t[e]=h,t[e+1]=l,t[e+2]=c,t[e+3]=f}static multiplyQuaternionsFlat(t,e,i,r,s,a){const o=i[r],h=i[r+1],l=i[r+2],c=i[r+3],f=s[a],d=s[a+1],u=s[a+2],p=s[a+3];return t[e]=o*p+c*f+h*u-l*d,t[e+1]=h*p+c*d+l*f-o*u,t[e+2]=l*p+c*u+o*d-h*f,t[e+3]=c*p-o*f-h*d-l*u,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,r){return this._x=t,this._y=e,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,r=t._y,s=t._z,a=t._order,o=Math.cos,h=Math.sin,l=o(i/2),c=o(r/2),f=o(s/2),d=h(i/2),u=h(r/2),p=h(s/2);switch(a){case"XYZ":this._x=d*c*f+l*u*p,this._y=l*u*f-d*c*p,this._z=l*c*p+d*u*f,this._w=l*c*f-d*u*p;break;case"YXZ":this._x=d*c*f+l*u*p,this._y=l*u*f-d*c*p,this._z=l*c*p-d*u*f,this._w=l*c*f+d*u*p;break;case"ZXY":this._x=d*c*f-l*u*p,this._y=l*u*f+d*c*p,this._z=l*c*p+d*u*f,this._w=l*c*f-d*u*p;break;case"ZYX":this._x=d*c*f-l*u*p,this._y=l*u*f+d*c*p,this._z=l*c*p-d*u*f,this._w=l*c*f+d*u*p;break;case"YZX":this._x=d*c*f+l*u*p,this._y=l*u*f+d*c*p,this._z=l*c*p-d*u*f,this._w=l*c*f-d*u*p;break;case"XZY":this._x=d*c*f-l*u*p,this._y=l*u*f-d*c*p,this._z=l*c*p+d*u*f,this._w=l*c*f+d*u*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],r=e[4],s=e[8],a=e[1],o=e[5],h=e[9],l=e[2],c=e[6],f=e[10],d=i+o+f;if(d>0){const u=.5/Math.sqrt(d+1);this._w=.25/u,this._x=(c-h)*u,this._y=(s-l)*u,this._z=(a-r)*u}else if(i>o&&i>f){const u=2*Math.sqrt(1+i-o-f);this._w=(c-h)/u,this._x=.25*u,this._y=(r+a)/u,this._z=(s+l)/u}else if(o>f){const u=2*Math.sqrt(1+o-i-f);this._w=(s-l)/u,this._x=(r+a)/u,this._y=.25*u,this._z=(h+c)/u}else{const u=2*Math.sqrt(1+f-i-o);this._w=(a-r)/u,this._x=(s+l)/u,this._y=(h+c)/u,this._z=.25*u}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<1e-8?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ye(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const r=Math.min(1,e/i);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,r=t._y,s=t._z,a=t._w,o=e._x,h=e._y,l=e._z,c=e._w;return this._x=i*c+a*o+r*l-s*h,this._y=r*c+a*h+s*o-i*l,this._z=s*c+a*l+i*h-r*o,this._w=a*c-i*o-r*h-s*l,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,r=this._y,s=this._z,a=this._w;let o=a*t._w+i*t._x+r*t._y+s*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=i,this._y=r,this._z=s,this;const h=1-o*o;if(h<=Number.EPSILON){const u=1-e;return this._w=u*a+e*this._w,this._x=u*i+e*this._x,this._y=u*r+e*this._y,this._z=u*s+e*this._z,this.normalize(),this}const l=Math.sqrt(h),c=Math.atan2(l,o),f=Math.sin((1-e)*c)/l,d=Math.sin(e*c)/l;return this._w=a*f+this._w*d,this._x=i*f+this._x*d,this._y=r*f+this._y*d,this._z=s*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(t),r*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},dt=class O6{constructor(t=0,e=0,i=0){O6.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(bw.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(bw.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=t.elements,a=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,r=this.z,s=t.x,a=t.y,o=t.z,h=t.w,l=2*(a*r-o*i),c=2*(o*e-s*r),f=2*(s*i-a*e);return this.x=e+h*l+a*f-o*c,this.y=i+h*c+o*l-s*f,this.z=r+h*f+s*c-a*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r,this.y=s[1]*e+s[5]*i+s[9]*r,this.z=s[2]*e+s[6]*i+s[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=ye(this.x,t.x,e.x),this.y=ye(this.y,t.y,e.y),this.z=ye(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=ye(this.x,t,e),this.y=ye(this.y,t,e),this.z=ye(this.z,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ye(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,r=t.y,s=t.z,a=e.x,o=e.y,h=e.z;return this.x=r*h-s*o,this.y=s*a-i*h,this.z=i*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Ay.copy(this).projectOnVector(t),this.sub(Ay)}reflect(t){return this.sub(Ay.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(ye(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};const Ay=new dt,bw=new Ho;let ve=class B6{constructor(t,e,i,r,s,a,o,h,l){B6.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,h,l)}set(t,e,i,r,s,a,o,h,l){const c=this.elements;return c[0]=t,c[1]=r,c[2]=o,c[3]=e,c[4]=s,c[5]=h,c[6]=i,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[3],h=i[6],l=i[1],c=i[4],f=i[7],d=i[2],u=i[5],p=i[8],m=r[0],g=r[3],y=r[6],A=r[1],_=r[4],x=r[7],v=r[2],b=r[5],M=r[8];return s[0]=a*m+o*A+h*v,s[3]=a*g+o*_+h*b,s[6]=a*y+o*x+h*M,s[1]=l*m+c*A+f*v,s[4]=l*g+c*_+f*b,s[7]=l*y+c*x+f*M,s[2]=d*m+u*A+p*v,s[5]=d*g+u*_+p*b,s[8]=d*y+u*x+p*M,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],l=t[7],c=t[8];return e*a*c-e*o*l-i*s*c+i*o*h+r*s*l-r*a*h}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],l=t[7],c=t[8],f=c*a-o*l,d=o*h-c*s,u=l*s-a*h,p=e*f+i*d+r*u;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return t[0]=f*m,t[1]=(r*l-c*i)*m,t[2]=(o*i-r*a)*m,t[3]=d*m,t[4]=(c*e-r*h)*m,t[5]=(r*s-o*e)*m,t[6]=u*m,t[7]=(i*h-l*e)*m,t[8]=(a*e-i*s)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,r,s,a,o){const h=Math.cos(s),l=Math.sin(s);return this.set(i*h,i*l,-i*(h*a+l*o)+a+t,-r*l,r*h,-r*(-l*a+h*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(xy.makeScale(t,e)),this}rotate(t){return this.premultiply(xy.makeRotation(-t)),this}translate(t,e){return this.premultiply(xy.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<9;r++)if(e[r]!==i[r])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}};const xy=new ve;function z6(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function wd(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function SF(){const n=wd("canvas");return n.style.display="block",n}const ww={};function Sd(n){n in ww||(ww[n]=!0,console.warn(n))}function MF(n,t,e){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(t,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,e);break;default:i()}}setTimeout(s,e)})}const Sw=new ve().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Mw=new ve().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function TF(){const n={enabled:!0,workingColorSpace:Sf,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===je&&(r.r=Ia(r.r),r.g=Ia(r.g),r.b=Ia(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===je&&(r.r=Zc(r.r),r.g=Zc(r.g),r.b=Zc(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===wo?a1:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return Sd("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return Sd("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,s)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[Sf]:{primaries:t,whitePoint:i,transfer:a1,toXYZ:Sw,fromXYZ:Mw,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:rr},outputColorSpaceConfig:{drawingBufferColorSpace:rr}},[rr]:{primaries:t,whitePoint:i,transfer:je,toXYZ:Sw,fromXYZ:Mw,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:rr}}}),n}const Ie=TF();function Ia(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Zc(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ih,EF=class{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let i;if(t instanceof HTMLCanvasElement)i=t;else{Ih===void 0&&(Ih=wd("canvas")),Ih.width=t.width,Ih.height=t.height;const r=Ih.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),i=Ih}return i.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=wd("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=Ia(s[a]/255)*255;return i.putImageData(r,0,0),e}else if(t.data){const e=t.data.slice(0);for(let i=0;i<e.length;i++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[i]=Math.floor(Ia(e[i]/255)*255):e[i]=Ia(e[i]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},CF=0,Tv=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:CF++}),this.uuid=Jo(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const e=this.data;return typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):e instanceof VideoFrame?t.set(e.displayHeight,e.displayWidth,0):e!==null?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(_y(r[a].image)):s.push(_y(r[a]))}else s=_y(r);i.url=s}return e||(t.images[this.uuid]=i),i}};function _y(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?EF.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let PF=0;const vy=new dt;let mr=class ym extends xh{constructor(t=ym.DEFAULT_IMAGE,e=ym.DEFAULT_MAPPING,i=Il,r=Il,s=Cs,a=Ol,o=cs,h=Us,l=ym.DEFAULT_ANISOTROPY,c=wo){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:PF++}),this.uuid=Jo(),this.name="",this.source=new Tv(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=h,this.offset=new Bt(0,0),this.repeat=new Bt(1,1),this.center=new Bt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ve,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(vy).x}get height(){return this.source.getSize(vy).y}get depth(){return this.source.getSize(vy).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const e in t){const i=t[e];if(i===void 0){console.warn(`THREE.Texture.setValues(): parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Texture.setValues(): property '${e}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==f6)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case o_:t.x=t.x-Math.floor(t.x);break;case Il:t.x=t.x<0?0:1;break;case l_:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case o_:t.y=t.y-Math.floor(t.y);break;case Il:t.y=t.y<0?0:1;break;case l_:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};mr.DEFAULT_IMAGE=null;mr.DEFAULT_MAPPING=f6;mr.DEFAULT_ANISOTROPY=1;let di=class U6{constructor(t=0,e=0,i=0,r=1){U6.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*e+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*e+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*e+a[7]*i+a[11]*r+a[15]*s,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,r,s;const h=t.elements,l=h[0],c=h[4],f=h[8],d=h[1],u=h[5],p=h[9],m=h[2],g=h[6],y=h[10];if(Math.abs(c-d)<.01&&Math.abs(f-m)<.01&&Math.abs(p-g)<.01){if(Math.abs(c+d)<.1&&Math.abs(f+m)<.1&&Math.abs(p+g)<.1&&Math.abs(l+u+y-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const _=(l+1)/2,x=(u+1)/2,v=(y+1)/2,b=(c+d)/4,M=(f+m)/4,T=(p+g)/4;return _>x&&_>v?_<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(_),r=b/i,s=M/i):x>v?x<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(x),i=b/r,s=T/r):v<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(v),i=M/s,r=T/s),this.set(i,r,s,e),this}let A=Math.sqrt((g-p)*(g-p)+(f-m)*(f-m)+(d-c)*(d-c));return Math.abs(A)<.001&&(A=1),this.x=(g-p)/A,this.y=(f-m)/A,this.z=(d-c)/A,this.w=Math.acos((l+u+y-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=ye(this.x,t.x,e.x),this.y=ye(this.y,t.y,e.y),this.z=ye(this.z,t.z,e.z),this.w=ye(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=ye(this.x,t,e),this.y=ye(this.y,t,e),this.z=ye(this.z,t,e),this.w=ye(this.w,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ye(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};class kF extends xh{constructor(t=1,e=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Cs,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=i.depth,this.scissor=new di(0,0,t,e),this.scissorTest=!1,this.viewport=new di(0,0,t,e);const r={width:t,height:e,depth:i.depth},s=new mr(r);this.textures=[];const a=i.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(t={}){const e={minFilter:Cs,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(e.mapping=t.mapping),t.wrapS!==void 0&&(e.wrapS=t.wrapS),t.wrapT!==void 0&&(e.wrapT=t.wrapT),t.wrapR!==void 0&&(e.wrapR=t.wrapR),t.magFilter!==void 0&&(e.magFilter=t.magFilter),t.minFilter!==void 0&&(e.minFilter=t.minFilter),t.format!==void 0&&(e.format=t.format),t.type!==void 0&&(e.type=t.type),t.anisotropy!==void 0&&(e.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(e.colorSpace=t.colorSpace),t.flipY!==void 0&&(e.flipY=t.flipY),t.generateMipmaps!==void 0&&(e.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(e.internalFormat=t.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,i=1){if(this.width!==t||this.height!==e||this.depth!==i){this.width=t,this.height=e,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=i,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,i=t.textures.length;e<i;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;const r=Object.assign({},t.textures[e].image);this.textures[e].source=new Tv(r)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Fr extends kF{constructor(t=1,e=1,i={}){super(t,e,i),this.isWebGLRenderTarget=!0}}const q6={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},so={h:0,s:0,l:0},U0={h:0,s:0,l:0};function by(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}let ae=class{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){if(e===void 0&&i===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=rr){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Ie.colorSpaceToWorking(this,e),this}setRGB(t,e,i,r=Ie.workingColorSpace){return this.r=t,this.g=e,this.b=i,Ie.colorSpaceToWorking(this,r),this}setHSL(t,e,i,r=Ie.workingColorSpace){if(t=ag(t,1),e=ye(e,0,1),i=ye(i,0,1),e===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+e):i+e-i*e,a=2*i-s;this.r=by(a,s,t+1/3),this.g=by(a,s,t),this.b=by(a,s,t-1/3)}return Ie.colorSpaceToWorking(this,r),this}setStyle(t,e=rr){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=rr){const i=q6[t.toLowerCase()];return i!==void 0?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Ia(t.r),this.g=Ia(t.g),this.b=Ia(t.b),this}copyLinearToSRGB(t){return this.r=Zc(t.r),this.g=Zc(t.g),this.b=Zc(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=rr){return Ie.workingToColorSpace(en.copy(this),t),Math.round(ye(en.r*255,0,255))*65536+Math.round(ye(en.g*255,0,255))*256+Math.round(ye(en.b*255,0,255))}getHexString(t=rr){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Ie.workingColorSpace){Ie.workingToColorSpace(en.copy(this),e);const i=en.r,r=en.g,s=en.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let h,l;const c=(o+a)/2;if(o===a)h=0,l=0;else{const f=a-o;switch(l=c<=.5?f/(a+o):f/(2-a-o),a){case i:h=(r-s)/f+(r<s?6:0);break;case r:h=(s-i)/f+2;break;case s:h=(i-r)/f+4;break}h/=6}return t.h=h,t.s=l,t.l=c,t}getRGB(t,e=Ie.workingColorSpace){return Ie.workingToColorSpace(en.copy(this),e),t.r=en.r,t.g=en.g,t.b=en.b,t}getStyle(t=rr){Ie.workingToColorSpace(en.copy(this),t);const e=en.r,i=en.g,r=en.b;return t!==rr?`color(${t} ${e.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(t,e,i){return this.getHSL(so),this.setHSL(so.h+t,so.s+e,so.l+i)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(so),t.getHSL(U0);const i=Yc(so.h,U0.h,e),r=Yc(so.s,U0.s,e),s=Yc(so.l,U0.l,e);return this.setHSL(i,r,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,i=this.g,r=this.b,s=t.elements;return this.r=s[0]*e+s[3]*i+s[6]*r,this.g=s[1]*e+s[4]*i+s[7]*r,this.b=s[2]*e+s[5]*i+s[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const en=new ae;ae.NAMES=q6;let qs=class{constructor(t=new dt(1/0,1/0,1/0),e=new dt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(jr.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(jr.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=jr.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const i=t.geometry;if(i!==void 0){const s=i.getAttribute("position");if(e===!0&&s!==void 0&&t.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)t.isMesh===!0?t.getVertexPosition(a,jr):jr.fromBufferAttribute(s,a),jr.applyMatrix4(t.matrixWorld),this.expandByPoint(jr);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),q0.copy(t.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),q0.copy(i.boundingBox)),q0.applyMatrix4(t.matrixWorld),this.union(q0)}const r=t.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,jr),jr.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(lu),V0.subVectors(this.max,lu),Oh.subVectors(t.a,lu),Bh.subVectors(t.b,lu),zh.subVectors(t.c,lu),ao.subVectors(Bh,Oh),oo.subVectors(zh,Bh),al.subVectors(Oh,zh);let e=[0,-ao.z,ao.y,0,-oo.z,oo.y,0,-al.z,al.y,ao.z,0,-ao.x,oo.z,0,-oo.x,al.z,0,-al.x,-ao.y,ao.x,0,-oo.y,oo.x,0,-al.y,al.x,0];return!wy(e,Oh,Bh,zh,V0)||(e=[1,0,0,0,1,0,0,0,1],!wy(e,Oh,Bh,zh,V0))?!1:(G0.crossVectors(ao,oo),e=[G0.x,G0.y,G0.z],wy(e,Oh,Bh,zh,V0))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,jr).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(jr).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(ta[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ta[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ta[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ta[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ta[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ta[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ta[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ta[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ta),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}};const ta=[new dt,new dt,new dt,new dt,new dt,new dt,new dt,new dt],jr=new dt,q0=new qs,Oh=new dt,Bh=new dt,zh=new dt,ao=new dt,oo=new dt,al=new dt,lu=new dt,V0=new dt,G0=new dt,ol=new dt;function wy(n,t,e,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){ol.fromArray(n,s);const o=r.x*Math.abs(ol.x)+r.y*Math.abs(ol.y)+r.z*Math.abs(ol.z),h=t.dot(ol),l=e.dot(ol),c=i.dot(ol);if(Math.max(-Math.max(h,l,c),Math.min(h,l,c))>o)return!1}return!0}const LF=new qs,hu=new dt,Sy=new dt;let _h=class{constructor(t=new dt,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;e!==void 0?i.copy(e):LF.setFromPoints(t).getCenter(i);let r=0;for(let s=0,a=t.length;s<a;s++)r=Math.max(r,i.distanceToSquared(t[s]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;hu.subVectors(t,this.center);const e=hu.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),r=(i-this.radius)*.5;this.center.addScaledVector(hu,r/i),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(Sy.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(hu.copy(t.center).add(Sy)),this.expandByPoint(hu.copy(t.center).sub(Sy))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}};const My=new dt,NF=new dt,RF=new ve;class xa{constructor(t=new dt(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,r){return this.normal.set(t,e,i),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const r=My.subVectors(i,e).cross(NF.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const i=t.delta(My),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;const s=-(t.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:e.copy(t.start).addScaledVector(i,s)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||RF.getNormalMatrix(t),r=this.coplanarPoint(My).applyMatrix4(t),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ll=new _h,DF=new Bt(.5,.5),$0=new dt;class og{constructor(t=new xa,e=new xa,i=new xa,r=new xa,s=new xa,a=new xa){this.planes=[t,e,i,r,s,a]}set(t,e,i,r,s,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=ks,i=!1){const r=this.planes,s=t.elements,a=s[0],o=s[1],h=s[2],l=s[3],c=s[4],f=s[5],d=s[6],u=s[7],p=s[8],m=s[9],g=s[10],y=s[11],A=s[12],_=s[13],x=s[14],v=s[15];if(r[0].setComponents(l-a,u-c,y-p,v-A).normalize(),r[1].setComponents(l+a,u+c,y+p,v+A).normalize(),r[2].setComponents(l+o,u+f,y+m,v+_).normalize(),r[3].setComponents(l-o,u-f,y-m,v-_).normalize(),i)r[4].setComponents(h,d,g,x).normalize(),r[5].setComponents(l-h,u-d,y-g,v-x).normalize();else if(r[4].setComponents(l-h,u-d,y-g,v-x).normalize(),e===ks)r[5].setComponents(l+h,u+d,y+g,v+x).normalize();else if(e===o1)r[5].setComponents(h,d,g,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),ll.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),ll.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(ll)}intersectsSprite(t){ll.center.set(0,0,0);const e=DF.distanceTo(t.center);return ll.radius=.7071067811865476+e,ll.applyMatrix4(t.matrixWorld),this.intersectsSphere(ll)}intersectsSphere(t){const e=this.planes,i=t.center,r=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(t){const e=this.planes;for(let i=0;i<6;i++){const r=e[i];if($0.x=r.normal.x>0?t.max.x:t.min.x,$0.y=r.normal.y>0?t.max.y:t.min.y,$0.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint($0)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}let Ue=class O_{constructor(t,e,i,r,s,a,o,h,l,c,f,d,u,p,m,g){O_.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,h,l,c,f,d,u,p,m,g)}set(t,e,i,r,s,a,o,h,l,c,f,d,u,p,m,g){const y=this.elements;return y[0]=t,y[4]=e,y[8]=i,y[12]=r,y[1]=s,y[5]=a,y[9]=o,y[13]=h,y[2]=l,y[6]=c,y[10]=f,y[14]=d,y[3]=u,y[7]=p,y[11]=m,y[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new O_().fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,r=1/Uh.setFromMatrixColumn(t,0).length(),s=1/Uh.setFromMatrixColumn(t,1).length(),a=1/Uh.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*s,e[5]=i[5]*s,e[6]=i[6]*s,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,r=t.y,s=t.z,a=Math.cos(i),o=Math.sin(i),h=Math.cos(r),l=Math.sin(r),c=Math.cos(s),f=Math.sin(s);if(t.order==="XYZ"){const d=a*c,u=a*f,p=o*c,m=o*f;e[0]=h*c,e[4]=-h*f,e[8]=l,e[1]=u+p*l,e[5]=d-m*l,e[9]=-o*h,e[2]=m-d*l,e[6]=p+u*l,e[10]=a*h}else if(t.order==="YXZ"){const d=h*c,u=h*f,p=l*c,m=l*f;e[0]=d+m*o,e[4]=p*o-u,e[8]=a*l,e[1]=a*f,e[5]=a*c,e[9]=-o,e[2]=u*o-p,e[6]=m+d*o,e[10]=a*h}else if(t.order==="ZXY"){const d=h*c,u=h*f,p=l*c,m=l*f;e[0]=d-m*o,e[4]=-a*f,e[8]=p+u*o,e[1]=u+p*o,e[5]=a*c,e[9]=m-d*o,e[2]=-a*l,e[6]=o,e[10]=a*h}else if(t.order==="ZYX"){const d=a*c,u=a*f,p=o*c,m=o*f;e[0]=h*c,e[4]=p*l-u,e[8]=d*l+m,e[1]=h*f,e[5]=m*l+d,e[9]=u*l-p,e[2]=-l,e[6]=o*h,e[10]=a*h}else if(t.order==="YZX"){const d=a*h,u=a*l,p=o*h,m=o*l;e[0]=h*c,e[4]=m-d*f,e[8]=p*f+u,e[1]=f,e[5]=a*c,e[9]=-o*c,e[2]=-l*c,e[6]=u*f+p,e[10]=d-m*f}else if(t.order==="XZY"){const d=a*h,u=a*l,p=o*h,m=o*l;e[0]=h*c,e[4]=-f,e[8]=l*c,e[1]=d*f+m,e[5]=a*c,e[9]=u*f-p,e[2]=p*f-u,e[6]=o*c,e[10]=m*f+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(FF,t,IF)}lookAt(t,e,i){const r=this.elements;return Zn.subVectors(t,e),Zn.lengthSq()===0&&(Zn.z=1),Zn.normalize(),lo.crossVectors(i,Zn),lo.lengthSq()===0&&(Math.abs(i.z)===1?Zn.x+=1e-4:Zn.z+=1e-4,Zn.normalize(),lo.crossVectors(i,Zn)),lo.normalize(),H0.crossVectors(Zn,lo),r[0]=lo.x,r[4]=H0.x,r[8]=Zn.x,r[1]=lo.y,r[5]=H0.y,r[9]=Zn.y,r[2]=lo.z,r[6]=H0.z,r[10]=Zn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[4],h=i[8],l=i[12],c=i[1],f=i[5],d=i[9],u=i[13],p=i[2],m=i[6],g=i[10],y=i[14],A=i[3],_=i[7],x=i[11],v=i[15],b=r[0],M=r[4],T=r[8],w=r[12],E=r[1],k=r[5],C=r[9],R=r[13],F=r[2],P=r[6],I=r[10],U=r[14],N=r[3],q=r[7],G=r[11],nt=r[15];return s[0]=a*b+o*E+h*F+l*N,s[4]=a*M+o*k+h*P+l*q,s[8]=a*T+o*C+h*I+l*G,s[12]=a*w+o*R+h*U+l*nt,s[1]=c*b+f*E+d*F+u*N,s[5]=c*M+f*k+d*P+u*q,s[9]=c*T+f*C+d*I+u*G,s[13]=c*w+f*R+d*U+u*nt,s[2]=p*b+m*E+g*F+y*N,s[6]=p*M+m*k+g*P+y*q,s[10]=p*T+m*C+g*I+y*G,s[14]=p*w+m*R+g*U+y*nt,s[3]=A*b+_*E+x*F+v*N,s[7]=A*M+_*k+x*P+v*q,s[11]=A*T+_*C+x*I+v*G,s[15]=A*w+_*R+x*U+v*nt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],r=t[8],s=t[12],a=t[1],o=t[5],h=t[9],l=t[13],c=t[2],f=t[6],d=t[10],u=t[14],p=t[3],m=t[7],g=t[11],y=t[15];return p*(+s*h*f-r*l*f-s*o*d+i*l*d+r*o*u-i*h*u)+m*(+e*h*u-e*l*d+s*a*d-r*a*u+r*l*c-s*h*c)+g*(+e*l*f-e*o*u-s*a*f+i*a*u+s*o*c-i*l*c)+y*(-r*o*c-e*h*f+e*o*d+r*a*f-i*a*d+i*h*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],l=t[7],c=t[8],f=t[9],d=t[10],u=t[11],p=t[12],m=t[13],g=t[14],y=t[15],A=f*g*l-m*d*l+m*h*u-o*g*u-f*h*y+o*d*y,_=p*d*l-c*g*l-p*h*u+a*g*u+c*h*y-a*d*y,x=c*m*l-p*f*l+p*o*u-a*m*u-c*o*y+a*f*y,v=p*f*h-c*m*h-p*o*d+a*m*d+c*o*g-a*f*g,b=e*A+i*_+r*x+s*v;if(b===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/b;return t[0]=A*M,t[1]=(m*d*s-f*g*s-m*r*u+i*g*u+f*r*y-i*d*y)*M,t[2]=(o*g*s-m*h*s+m*r*l-i*g*l-o*r*y+i*h*y)*M,t[3]=(f*h*s-o*d*s-f*r*l+i*d*l+o*r*u-i*h*u)*M,t[4]=_*M,t[5]=(c*g*s-p*d*s+p*r*u-e*g*u-c*r*y+e*d*y)*M,t[6]=(p*h*s-a*g*s-p*r*l+e*g*l+a*r*y-e*h*y)*M,t[7]=(a*d*s-c*h*s+c*r*l-e*d*l-a*r*u+e*h*u)*M,t[8]=x*M,t[9]=(p*f*s-c*m*s-p*i*u+e*m*u+c*i*y-e*f*y)*M,t[10]=(a*m*s-p*o*s+p*i*l-e*m*l-a*i*y+e*o*y)*M,t[11]=(c*o*s-a*f*s-c*i*l+e*f*l+a*i*u-e*o*u)*M,t[12]=v*M,t[13]=(c*m*r-p*f*r+p*i*d-e*m*d-c*i*g+e*f*g)*M,t[14]=(p*o*r-a*m*r-p*i*h+e*m*h+a*i*g-e*o*g)*M,t[15]=(a*f*r-c*o*r+c*i*h-e*f*h-a*i*d+e*o*d)*M,this}scale(t){const e=this.elements,i=t.x,r=t.y,s=t.z;return e[0]*=i,e[4]*=r,e[8]*=s,e[1]*=i,e[5]*=r,e[9]*=s,e[2]*=i,e[6]*=r,e[10]*=s,e[3]*=i,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),r=Math.sin(e),s=1-i,a=t.x,o=t.y,h=t.z,l=s*a,c=s*o;return this.set(l*a+i,l*o-r*h,l*h+r*o,0,l*o+r*h,c*o+i,c*h-r*a,0,l*h-r*o,c*h+r*a,s*h*h+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,r,s,a){return this.set(1,i,s,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){const r=this.elements,s=e._x,a=e._y,o=e._z,h=e._w,l=s+s,c=a+a,f=o+o,d=s*l,u=s*c,p=s*f,m=a*c,g=a*f,y=o*f,A=h*l,_=h*c,x=h*f,v=i.x,b=i.y,M=i.z;return r[0]=(1-(m+y))*v,r[1]=(u+x)*v,r[2]=(p-_)*v,r[3]=0,r[4]=(u-x)*b,r[5]=(1-(d+y))*b,r[6]=(g+A)*b,r[7]=0,r[8]=(p+_)*M,r[9]=(g-A)*M,r[10]=(1-(d+m))*M,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){const r=this.elements;let s=Uh.set(r[0],r[1],r[2]).length();const a=Uh.set(r[4],r[5],r[6]).length(),o=Uh.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],Xr.copy(this);const l=1/s,c=1/a,f=1/o;return Xr.elements[0]*=l,Xr.elements[1]*=l,Xr.elements[2]*=l,Xr.elements[4]*=c,Xr.elements[5]*=c,Xr.elements[6]*=c,Xr.elements[8]*=f,Xr.elements[9]*=f,Xr.elements[10]*=f,e.setFromRotationMatrix(Xr),i.x=s,i.y=a,i.z=o,this}makePerspective(t,e,i,r,s,a,o=ks,h=!1){const l=this.elements,c=2*s/(e-t),f=2*s/(i-r),d=(e+t)/(e-t),u=(i+r)/(i-r);let p,m;if(h)p=s/(a-s),m=a*s/(a-s);else if(o===ks)p=-(a+s)/(a-s),m=-2*a*s/(a-s);else if(o===o1)p=-a/(a-s),m=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=f,l[9]=u,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,r,s,a,o=ks,h=!1){const l=this.elements,c=2/(e-t),f=2/(i-r),d=-(e+t)/(e-t),u=-(i+r)/(i-r);let p,m;if(h)p=1/(a-s),m=a/(a-s);else if(o===ks)p=-2/(a-s),m=-(a+s)/(a-s);else if(o===o1)p=-1/(a-s),m=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=0,l[12]=d,l[1]=0,l[5]=f,l[9]=0,l[13]=u,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<16;r++)if(e[r]!==i[r])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}};const Uh=new dt,Xr=new Ue,FF=new dt(0,0,0),IF=new dt(1,1,1),lo=new dt,H0=new dt,Zn=new dt;function V6(){let n=null,t=!1,e=null,i=null;function r(s,a){e(s,a),i=n.requestAnimationFrame(r)}return{start:function(){t!==!0&&e!==null&&(i=n.requestAnimationFrame(r),t=!0)},stop:function(){n.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){n=s}}}function OF(n){const t=new WeakMap;function e(o,h){const l=o.array,c=o.usage,f=l.byteLength,d=n.createBuffer();n.bindBuffer(h,d),n.bufferData(h,l,c),o.onUploadCallback();let u;if(l instanceof Float32Array)u=n.FLOAT;else if(typeof Float16Array<"u"&&l instanceof Float16Array)u=n.HALF_FLOAT;else if(l instanceof Uint16Array)o.isFloat16BufferAttribute?u=n.HALF_FLOAT:u=n.UNSIGNED_SHORT;else if(l instanceof Int16Array)u=n.SHORT;else if(l instanceof Uint32Array)u=n.UNSIGNED_INT;else if(l instanceof Int32Array)u=n.INT;else if(l instanceof Int8Array)u=n.BYTE;else if(l instanceof Uint8Array)u=n.UNSIGNED_BYTE;else if(l instanceof Uint8ClampedArray)u=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+l);return{buffer:d,type:u,bytesPerElement:l.BYTES_PER_ELEMENT,version:o.version,size:f}}function i(o,h,l){const c=h.array,f=h.updateRanges;if(n.bindBuffer(l,o),f.length===0)n.bufferSubData(l,0,c);else{f.sort((u,p)=>u.start-p.start);let d=0;for(let u=1;u<f.length;u++){const p=f[d],m=f[u];m.start<=p.start+p.count+1?p.count=Math.max(p.count,m.start+m.count-p.start):(++d,f[d]=m)}f.length=d+1;for(let u=0,p=f.length;u<p;u++){const m=f[u];n.bufferSubData(l,m.start*c.BYTES_PER_ELEMENT,c,m.start,m.count)}h.clearUpdateRanges()}h.onUploadCallback()}function r(o){return o.isInterleavedBufferAttribute&&(o=o.data),t.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);const h=t.get(o);h&&(n.deleteBuffer(h.buffer),t.delete(o))}function a(o,h){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const c=t.get(o);(!c||c.version<o.version)&&t.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const l=t.get(o);if(l===void 0)t.set(o,e(o,h));else if(l.version<o.version){if(l.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");i(l.buffer,o,h),l.version=o.version}}return{get:r,remove:s,update:a}}const Si=new dt,W0=new Bt;let BF=0,Ir=class{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:BF++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=i,this.usage=xw,this.updateRanges=[],this.gpuType=Ps,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[t+r]=e.array[i+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,i=this.count;e<i;e++)W0.fromBufferAttribute(this,e),W0.applyMatrix3(t),this.setXY(e,W0.x,W0.y);else if(this.itemSize===3)for(let e=0,i=this.count;e<i;e++)Si.fromBufferAttribute(this,e),Si.applyMatrix3(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)Si.fromBufferAttribute(this,e),Si.applyMatrix4(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)Si.fromBufferAttribute(this,e),Si.applyNormalMatrix(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)Si.fromBufferAttribute(this,e),Si.transformDirection(t),this.setXYZ(e,Si.x,Si.y,Si.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let i=this.array[t*this.itemSize+e];return this.normalized&&(i=Tl(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=cn(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Tl(e,this.array)),e}setX(t,e){return this.normalized&&(e=cn(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Tl(e,this.array)),e}setY(t,e){return this.normalized&&(e=cn(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Tl(e,this.array)),e}setZ(t,e){return this.normalized&&(e=cn(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Tl(e,this.array)),e}setW(t,e){return this.normalized&&(e=cn(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=cn(e,this.array),i=cn(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,r){return t*=this.itemSize,this.normalized&&(e=cn(e,this.array),i=cn(i,this.array),r=cn(r,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this}setXYZW(t,e,i,r,s){return t*=this.itemSize,this.normalized&&(e=cn(e,this.array),i=cn(i,this.array),r=cn(r,this.array),s=cn(s,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==xw&&(t.usage=this.usage),t}},G6=class extends Ir{constructor(t,e,i){super(new Uint16Array(t),e,i)}},$6=class extends Ir{constructor(t,e,i){super(new Uint32Array(t),e,i)}},pi=class extends Ir{constructor(t,e,i){super(new Float32Array(t),e,i)}};const Tw=new Ue,Ew=new Ho;let ms=class H6{constructor(t=0,e=0,i=0,r=H6.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,r=this._order){return this._x=t,this._y=e,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const r=t.elements,s=r[0],a=r[4],o=r[8],h=r[1],l=r[5],c=r[9],f=r[2],d=r[6],u=r[10];switch(e){case"XYZ":this._y=Math.asin(ye(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,u),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-ye(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,u),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(ye(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,u),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(h,s));break;case"ZYX":this._y=Math.asin(-ye(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,u),this._z=Math.atan2(h,s)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(ye(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(o,u));break;case"XZY":this._z=Math.asin(-ye(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-c,u),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return Tw.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Tw,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Ew.setFromEuler(this),this.setFromQuaternion(Ew,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};ms.DEFAULT_ORDER="XYZ";let Ev=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},zF=0;const Cw=new dt,qh=new Ho,ea=new Ue,j0=new dt,cu=new dt,UF=new dt,qF=new Ho,Pw=new dt(1,0,0),kw=new dt(0,1,0),Lw=new dt(0,0,1),Nw={type:"added"},VF={type:"removed"},Vh={type:"childadded",child:null},Ty={type:"childremoved",child:null};let gn=class Am extends xh{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:zF++}),this.uuid=Jo(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Am.DEFAULT_UP.clone();const t=new dt,e=new ms,i=new Ho,r=new dt(1,1,1);function s(){i.setFromEuler(e,!1)}function a(){e.setFromQuaternion(i,void 0,!1)}e._onChange(s),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Ue},normalMatrix:{value:new ve}}),this.matrix=new Ue,this.matrixWorld=new Ue,this.matrixAutoUpdate=Am.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Am.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Ev,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return qh.setFromAxisAngle(t,e),this.quaternion.multiply(qh),this}rotateOnWorldAxis(t,e){return qh.setFromAxisAngle(t,e),this.quaternion.premultiply(qh),this}rotateX(t){return this.rotateOnAxis(Pw,t)}rotateY(t){return this.rotateOnAxis(kw,t)}rotateZ(t){return this.rotateOnAxis(Lw,t)}translateOnAxis(t,e){return Cw.copy(t).applyQuaternion(this.quaternion),this.position.add(Cw.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Pw,t)}translateY(t){return this.translateOnAxis(kw,t)}translateZ(t){return this.translateOnAxis(Lw,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(ea.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?j0.copy(t):j0.set(t,e,i);const r=this.parent;this.updateWorldMatrix(!0,!1),cu.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ea.lookAt(cu,j0,this.up):ea.lookAt(j0,cu,this.up),this.quaternion.setFromRotationMatrix(ea),r&&(ea.extractRotation(r.matrixWorld),qh.setFromRotationMatrix(ea),this.quaternion.premultiply(qh.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(Nw),Vh.child=t,this.dispatchEvent(Vh),Vh.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(VF),Ty.child=t,this.dispatchEvent(Ty),Ty.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),ea.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),ea.multiply(t.parent.matrixWorld)),t.applyMatrix4(ea),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Nw),Vh.child=t,this.dispatchEvent(Vh),Vh.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,r=this.children.length;i<r;i++){const a=this.children[i].getObjectByProperty(t,e);if(a!==void 0)return a}}getObjectsByProperty(t,e,i=[]){this[t]===e&&i.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(t,e,i);return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cu,t,UF),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(cu,qF,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e){const i=this.parent;if(t===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),e===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(t),r.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(o,h){return o[h.uuid]===void 0&&(o[h.uuid]=h.toJSON(t)),h.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const h=o.shapes;if(Array.isArray(h))for(let l=0,c=h.length;l<c;l++){const f=h[l];s(t.shapes,f)}else s(t.shapes,h)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let h=0,l=this.material.length;h<l;h++)o.push(s(t.materials,this.material[h]));r.material=o}else r.material=s(t.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const h=this.animations[o];r.animations.push(s(t.animations,h))}}if(e){const o=a(t.geometries),h=a(t.materials),l=a(t.textures),c=a(t.images),f=a(t.shapes),d=a(t.skeletons),u=a(t.animations),p=a(t.nodes);o.length>0&&(i.geometries=o),h.length>0&&(i.materials=h),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),f.length>0&&(i.shapes=f),d.length>0&&(i.skeletons=d),u.length>0&&(i.animations=u),p.length>0&&(i.nodes=p)}return i.object=r,i;function a(o){const h=[];for(const l in o){const c=o[l];delete c.metadata,h.push(c)}return h}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let i=0;i<t.children.length;i++){const r=t.children[i];this.add(r.clone())}return this}};gn.DEFAULT_UP=new dt(0,1,0);gn.DEFAULT_MATRIX_AUTO_UPDATE=!0;gn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let GF=0;const Ar=new Ue,Ey=new gn,Gh=new dt,Jn=new qs,fu=new qs,Bi=new dt;let Un=class W6 extends xh{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:GF++}),this.uuid=Jo(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(z6(t)?$6:G6)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new ve().getNormalMatrix(t);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ar.makeRotationFromQuaternion(t),this.applyMatrix4(Ar),this}rotateX(t){return Ar.makeRotationX(t),this.applyMatrix4(Ar),this}rotateY(t){return Ar.makeRotationY(t),this.applyMatrix4(Ar),this}rotateZ(t){return Ar.makeRotationZ(t),this.applyMatrix4(Ar),this}translate(t,e,i){return Ar.makeTranslation(t,e,i),this.applyMatrix4(Ar),this}scale(t,e,i){return Ar.makeScale(t,e,i),this.applyMatrix4(Ar),this}lookAt(t){return Ey.lookAt(t),Ey.updateMatrix(),this.applyMatrix4(Ey.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Gh).negate(),this.translate(Gh.x,Gh.y,Gh.z),this}setFromPoints(t){const e=this.getAttribute("position");if(e===void 0){const i=[];for(let r=0,s=t.length;r<s;r++){const a=t[r];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new pi(i,3))}else{const i=Math.min(t.length,e.count);for(let r=0;r<i;r++){const s=t[r];e.setXYZ(r,s.x,s.y,s.z||0)}t.length>e.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new qs);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new dt(-1/0,-1/0,-1/0),new dt(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let i=0,r=e.length;i<r;i++){const s=e[i];Jn.setFromBufferAttribute(s),this.morphTargetsRelative?(Bi.addVectors(this.boundingBox.min,Jn.min),this.boundingBox.expandByPoint(Bi),Bi.addVectors(this.boundingBox.max,Jn.max),this.boundingBox.expandByPoint(Bi)):(this.boundingBox.expandByPoint(Jn.min),this.boundingBox.expandByPoint(Jn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new _h);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new dt,1/0);return}if(t){const i=this.boundingSphere.center;if(Jn.setFromBufferAttribute(t),e)for(let s=0,a=e.length;s<a;s++){const o=e[s];fu.setFromBufferAttribute(o),this.morphTargetsRelative?(Bi.addVectors(Jn.min,fu.min),Jn.expandByPoint(Bi),Bi.addVectors(Jn.max,fu.max),Jn.expandByPoint(Bi)):(Jn.expandByPoint(fu.min),Jn.expandByPoint(fu.max))}Jn.getCenter(i);let r=0;for(let s=0,a=t.count;s<a;s++)Bi.fromBufferAttribute(t,s),r=Math.max(r,i.distanceToSquared(Bi));if(e)for(let s=0,a=e.length;s<a;s++){const o=e[s],h=this.morphTargetsRelative;for(let l=0,c=o.count;l<c;l++)Bi.fromBufferAttribute(o,l),h&&(Gh.fromBufferAttribute(t,l),Bi.add(Gh)),r=Math.max(r,i.distanceToSquared(Bi))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=e.position,r=e.normal,s=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Ir(new Float32Array(4*i.count),4));const a=this.getAttribute("tangent"),o=[],h=[];for(let T=0;T<i.count;T++)o[T]=new dt,h[T]=new dt;const l=new dt,c=new dt,f=new dt,d=new Bt,u=new Bt,p=new Bt,m=new dt,g=new dt;function y(T,w,E){l.fromBufferAttribute(i,T),c.fromBufferAttribute(i,w),f.fromBufferAttribute(i,E),d.fromBufferAttribute(s,T),u.fromBufferAttribute(s,w),p.fromBufferAttribute(s,E),c.sub(l),f.sub(l),u.sub(d),p.sub(d);const k=1/(u.x*p.y-p.x*u.y);isFinite(k)&&(m.copy(c).multiplyScalar(p.y).addScaledVector(f,-u.y).multiplyScalar(k),g.copy(f).multiplyScalar(u.x).addScaledVector(c,-p.x).multiplyScalar(k),o[T].add(m),o[w].add(m),o[E].add(m),h[T].add(g),h[w].add(g),h[E].add(g))}let A=this.groups;A.length===0&&(A=[{start:0,count:t.count}]);for(let T=0,w=A.length;T<w;++T){const E=A[T],k=E.start,C=E.count;for(let R=k,F=k+C;R<F;R+=3)y(t.getX(R+0),t.getX(R+1),t.getX(R+2))}const _=new dt,x=new dt,v=new dt,b=new dt;function M(T){v.fromBufferAttribute(r,T),b.copy(v);const w=o[T];_.copy(w),_.sub(v.multiplyScalar(v.dot(w))).normalize(),x.crossVectors(b,w);const k=x.dot(h[T])<0?-1:1;a.setXYZW(T,_.x,_.y,_.z,k)}for(let T=0,w=A.length;T<w;++T){const E=A[T],k=E.start,C=E.count;for(let R=k,F=k+C;R<F;R+=3)M(t.getX(R+0)),M(t.getX(R+1)),M(t.getX(R+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Ir(new Float32Array(e.count*3),3),this.setAttribute("normal",i);else for(let d=0,u=i.count;d<u;d++)i.setXYZ(d,0,0,0);const r=new dt,s=new dt,a=new dt,o=new dt,h=new dt,l=new dt,c=new dt,f=new dt;if(t)for(let d=0,u=t.count;d<u;d+=3){const p=t.getX(d+0),m=t.getX(d+1),g=t.getX(d+2);r.fromBufferAttribute(e,p),s.fromBufferAttribute(e,m),a.fromBufferAttribute(e,g),c.subVectors(a,s),f.subVectors(r,s),c.cross(f),o.fromBufferAttribute(i,p),h.fromBufferAttribute(i,m),l.fromBufferAttribute(i,g),o.add(c),h.add(c),l.add(c),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(m,h.x,h.y,h.z),i.setXYZ(g,l.x,l.y,l.z)}else for(let d=0,u=e.count;d<u;d+=3)r.fromBufferAttribute(e,d+0),s.fromBufferAttribute(e,d+1),a.fromBufferAttribute(e,d+2),c.subVectors(a,s),f.subVectors(r,s),c.cross(f),i.setXYZ(d+0,c.x,c.y,c.z),i.setXYZ(d+1,c.x,c.y,c.z),i.setXYZ(d+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)Bi.fromBufferAttribute(t,e),Bi.normalize(),t.setXYZ(e,Bi.x,Bi.y,Bi.z)}toNonIndexed(){function t(o,h){const l=o.array,c=o.itemSize,f=o.normalized,d=new l.constructor(h.length*c);let u=0,p=0;for(let m=0,g=h.length;m<g;m++){o.isInterleavedBufferAttribute?u=h[m]*o.data.stride+o.offset:u=h[m]*c;for(let y=0;y<c;y++)d[p++]=l[u++]}return new Ir(d,c,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new W6,i=this.index.array,r=this.attributes;for(const o in r){const h=r[o],l=t(h,i);e.setAttribute(o,l)}const s=this.morphAttributes;for(const o in s){const h=[],l=s[o];for(let c=0,f=l.length;c<f;c++){const d=l[c],u=t(d,i);h.push(u)}e.morphAttributes[o]=h}e.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,h=a.length;o<h;o++){const l=a[o];e.addGroup(l.start,l.count,l.materialIndex)}return e}toJSON(){const t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const h=this.parameters;for(const l in h)h[l]!==void 0&&(t[l]=h[l]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const h in i){const l=i[h];t.data.attributes[h]=l.toJSON(t.data)}const r={};let s=!1;for(const h in this.morphAttributes){const l=this.morphAttributes[h],c=[];for(let f=0,d=l.length;f<d;f++){const u=l[f];c.push(u.toJSON(t.data))}c.length>0&&(r[h]=c,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere=o.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone());const r=t.attributes;for(const l in r){const c=r[l];this.setAttribute(l,c.clone(e))}const s=t.morphAttributes;for(const l in s){const c=[],f=s[l];for(let d=0,u=f.length;d<u;d++)c.push(f[d].clone(e));this.morphAttributes[l]=c}this.morphTargetsRelative=t.morphTargetsRelative;const a=t.groups;for(let l=0,c=a.length;l<c;l++){const f=a[l];this.addGroup(f.start,f.count,f.materialIndex)}const o=t.boundingBox;o!==null&&(this.boundingBox=o.clone());const h=t.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},lg=class j6 extends Un{constructor(t=1,e=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const h=[],l=[],c=[],f=[];let d=0,u=0;p("z","y","x",-1,-1,i,e,t,a,s,0),p("z","y","x",1,-1,i,e,-t,a,s,1),p("x","z","y",1,1,t,i,e,r,a,2),p("x","z","y",1,-1,t,i,-e,r,a,3),p("x","y","z",1,-1,t,e,i,r,s,4),p("x","y","z",-1,-1,t,e,-i,r,s,5),this.setIndex(h),this.setAttribute("position",new pi(l,3)),this.setAttribute("normal",new pi(c,3)),this.setAttribute("uv",new pi(f,2));function p(m,g,y,A,_,x,v,b,M,T,w){const E=x/M,k=v/T,C=x/2,R=v/2,F=b/2,P=M+1,I=T+1;let U=0,N=0;const q=new dt;for(let G=0;G<I;G++){const nt=G*k-R;for(let gt=0;gt<P;gt++){const O=gt*E-C;q[m]=O*A,q[g]=nt*_,q[y]=F,l.push(q.x,q.y,q.z),q[m]=0,q[g]=0,q[y]=b>0?1:-1,c.push(q.x,q.y,q.z),f.push(gt/M),f.push(1-G/T),U+=1}}for(let G=0;G<T;G++)for(let nt=0;nt<M;nt++){const gt=d+nt+P*G,O=d+nt+P*(G+1),Y=d+(nt+1)+P*(G+1),X=d+(nt+1)+P*G;h.push(gt,O,X),h.push(O,Y,X),N+=6}o.addGroup(u,N,w),u+=N,d+=U}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new j6(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}},X6=class Y6 extends Un{constructor(t=1,e=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:r};const s=t/2,a=e/2,o=Math.floor(i),h=Math.floor(r),l=o+1,c=h+1,f=t/o,d=e/h,u=[],p=[],m=[],g=[];for(let y=0;y<c;y++){const A=y*d-a;for(let _=0;_<l;_++){const x=_*f-s;p.push(x,-A,0),m.push(0,0,1),g.push(_/o),g.push(1-y/h)}}for(let y=0;y<h;y++)for(let A=0;A<o;A++){const _=A+l*y,x=A+l*(y+1),v=A+1+l*(y+1),b=A+1+l*y;u.push(_,x,b),u.push(x,v,b)}this.setIndex(u),this.setAttribute("position",new pi(p,3)),this.setAttribute("normal",new pi(m,3)),this.setAttribute("uv",new pi(g,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Y6(t.width,t.height,t.widthSegments,t.heightSegments)}},$F=0,Ur=class extends xh{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:$F++}),this.uuid=Jo(),this.name="",this.type="Material",this.blending=jc,this.side=Wa,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Zx,this.blendDst=Jx,this.blendEquation=Ml,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ae(0,0,0),this.blendAlpha=0,this.depthFunc=vf,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Aw,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Fh,this.stencilZFail=Fh,this.stencilZPass=Fh,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const i=t[e];if(i===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==jc&&(i.blending=this.blending),this.side!==Wa&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Zx&&(i.blendSrc=this.blendSrc),this.blendDst!==Jx&&(i.blendDst=this.blendDst),this.blendEquation!==Ml&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==vf&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Aw&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Fh&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Fh&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Fh&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const h=s[o];delete h.metadata,a.push(h)}return a}if(e){const s=r(t.textures),a=r(t.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(e!==null){const r=e.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=e[s].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}};function Tf(n){const t={};for(const e in n){t[e]={};for(const i in n[e]){const r=n[e][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][i]=null):t[e][i]=r.clone():Array.isArray(r)?t[e][i]=r.slice():t[e][i]=r}}return t}function wn(n){const t={};for(let e=0;e<n.length;e++){const i=Tf(n[e]);for(const r in i)t[r]=i[r]}return t}function HF(n){const t=[];for(let e=0;e<n.length;e++)t.push(n[e].clone());return t}function Z6(n){const t=n.getRenderTarget();return t===null?n.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Ie.workingColorSpace}const l1={clone:Tf,merge:wn};var WF=`void main() {
|
|
4
4
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
@@ -4490,7 +4490,7 @@ CMapName currentdict /CMap defineresource pop
|
|
|
4490
4490
|
end
|
|
4491
4491
|
end`,u},r=function(h){var l=h.font,c=h.out,f=h.newObject,d=h.putStream;if(l.metadata instanceof n.API.TTFFont&&l.encoding==="Identity-H"){for(var u=l.metadata.Unicode.widths,p=l.metadata.subset.encode(l.metadata.glyIdsUsed,1),m=p,g="",y=0;y<m.length;y++)g+=String.fromCharCode(m[y]);var A=f();d({data:g,addLength1:!0,objectId:A}),c("endobj");var _=f(),x=i(l.metadata.toUnicode);d({data:x,addLength1:!0,objectId:_}),c("endobj");var v=f();c("<<"),c("/Type /FontDescriptor"),c("/FontName /"+Tc(l.fontName)),c("/FontFile2 "+A+" 0 R"),c("/FontBBox "+n.API.PDFObject.convert(l.metadata.bbox)),c("/Flags "+l.metadata.flags),c("/StemV "+l.metadata.stemV),c("/ItalicAngle "+l.metadata.italicAngle),c("/Ascent "+l.metadata.ascender),c("/Descent "+l.metadata.decender),c("/CapHeight "+l.metadata.capHeight),c(">>"),c("endobj");var b=f();c("<<"),c("/Type /Font"),c("/BaseFont /"+Tc(l.fontName)),c("/FontDescriptor "+v+" 0 R"),c("/W "+n.API.PDFObject.convert(u)),c("/CIDToGIDMap /Identity"),c("/DW 1000"),c("/Subtype /CIDFontType2"),c("/CIDSystemInfo"),c("<<"),c("/Supplement 0"),c("/Registry (Adobe)"),c("/Ordering ("+l.encoding+")"),c(">>"),c(">>"),c("endobj"),l.objectNumber=f(),c("<<"),c("/Type /Font"),c("/Subtype /Type0"),c("/ToUnicode "+_+" 0 R"),c("/BaseFont /"+Tc(l.fontName)),c("/Encoding /"+l.encoding),c("/DescendantFonts ["+b+" 0 R]"),c(">>"),c("endobj"),l.isAlreadyPutted=!0}};t.events.push(["putFont",function(h){r(h)}]);var s=function(h){var l=h.font,c=h.out,f=h.newObject,d=h.putStream;if(l.metadata instanceof n.API.TTFFont&&l.encoding==="WinAnsiEncoding"){for(var u=l.metadata.rawData,p=u,m="",g=0;g<p.length;g++)m+=String.fromCharCode(p[g]);var y=f();d({data:m,addLength1:!0,objectId:y}),c("endobj");var A=f(),_=i(l.metadata.toUnicode);d({data:_,addLength1:!0,objectId:A}),c("endobj");var x=f();c("<<"),c("/Descent "+l.metadata.decender),c("/CapHeight "+l.metadata.capHeight),c("/StemV "+l.metadata.stemV),c("/Type /FontDescriptor"),c("/FontFile2 "+y+" 0 R"),c("/Flags 96"),c("/FontBBox "+n.API.PDFObject.convert(l.metadata.bbox)),c("/FontName /"+Tc(l.fontName)),c("/ItalicAngle "+l.metadata.italicAngle),c("/Ascent "+l.metadata.ascender),c(">>"),c("endobj"),l.objectNumber=f();for(var v=0;v<l.metadata.hmtx.widths.length;v++)l.metadata.hmtx.widths[v]=parseInt(l.metadata.hmtx.widths[v]*(1e3/l.metadata.head.unitsPerEm));c("<</Subtype/TrueType/Type/Font/ToUnicode "+A+" 0 R/BaseFont/"+Tc(l.fontName)+"/FontDescriptor "+x+" 0 R/Encoding/"+l.encoding+" /FirstChar 29 /LastChar 255 /Widths "+n.API.PDFObject.convert(l.metadata.hmtx.widths)+">>"),c("endobj"),l.isAlreadyPutted=!0}};t.events.push(["putFont",function(h){s(h)}]);var a=function(h){var l=h.text||"",c=h.x,f=h.y,d=h.options||{},u=h.mutex||{},p=u.pdfEscape,m=u.activeFontKey,g=u.fonts,y=m,A="",_=0,x,v="",b=g[y].encoding;if(g[y].encoding!=="Identity-H")return{text:l,x:c,y:f,options:d,mutex:u};for(v=l,y=m,Array.isArray(l)&&(v=l[0]),_=0;_<v.length;_+=1)g[y].metadata.hasOwnProperty("cmap")&&(x=g[y].metadata.cmap.unicode.codeMap[v[_].charCodeAt(0)]),x||v[_].charCodeAt(0)<256&&g[y].metadata.hasOwnProperty("Unicode")?A+=v[_]:A+="";var M="";return parseInt(y.slice(1))<14||b==="WinAnsiEncoding"?M=p(A,y).split("").map(function(T){return T.charCodeAt(0).toString(16)}).join(""):b==="Identity-H"&&(M=e(A,g[y])),u.isHex=!0,{text:M,x:c,y:f,options:d,mutex:u}},o=function(h){var l=h.text||"",c=h.x,f=h.y,d=h.options,u=h.mutex,p=[],m={text:l,x:c,y:f,options:d,mutex:u};if(Array.isArray(l)){var g=0;for(g=0;g<l.length;g+=1)Array.isArray(l[g])?l[g].length===3?p.push([a(Object.assign({},m,{text:l[g][0]})).text,l[g][1],l[g][2]]):p.push(a(Object.assign({},m,{text:l[g]})).text):p.push(a(Object.assign({},m,{text:l[g]})).text);h.text=p}else h.text=a(Object.assign({},m,{text:l})).text};t.events.push(["postProcessText",o])})(de);(function(n){var t=function(){return typeof this.internal.vFS>"u"&&(this.internal.vFS={}),!0};n.existsFileInVFS=function(e){return t.call(this),typeof this.internal.vFS[e]<"u"},n.addFileToVFS=function(e,i){return t.call(this),this.internal.vFS[e]=i,this},n.getFileFromVFS=function(e){return t.call(this),typeof this.internal.vFS[e]<"u"?this.internal.vFS[e]:null}})(de.API);(function(n){var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"];n.__bidiEngine__=n.prototype.__bidiEngine__=function(s){var a=e,o=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],h=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],l={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},c={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},f=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],d=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),u=!1,p,m,g=0,y=1,A,_,x,v,b,M=g;this.__bidiEngine__={};var T=function(N,q){if(q)for(var G=0;G<N.length;G++)q[G]=G;_===void 0&&(_=E(N)),v===void 0&&(v=E(N))},w=function(N){var q=N.charCodeAt(),G=q>>8,nt=c[G];return nt!==void 0?a[nt*256+(q&255)]:G===252||G===253?"AL":d.test(G)?"L":G===8?"R":"N"},E=function(N){for(var q=0,G;q<N.length;q++){if(G=w(N.charAt(q)),G==="L")return!1;if(G==="R")return!0}return!1},k=function(N,q,G,nt){var gt=q[nt],O,Y,X,j;switch(gt){case"L":case"R":u=!1;break;case"N":case"AN":break;case"EN":u&&(gt="AN");break;case"AL":u=!0,gt="R";break;case"WS":gt="N";break;case"CS":nt<1||nt+1>=q.length||(O=G[nt-1])!=="EN"&&O!=="AN"||(Y=q[nt+1])!=="EN"&&Y!=="AN"?gt="N":u&&(Y="AN"),gt=Y===O?Y:"N";break;case"ES":O=nt>0?G[nt-1]:"B",gt=O==="EN"&&nt+1<q.length&&q[nt+1]==="EN"?"EN":"N";break;case"ET":if(nt>0&&G[nt-1]==="EN"){gt="EN";break}else if(u){gt="N";break}for(X=nt+1,j=q.length;X<j&&q[X]==="ET";)X++;X<j&&q[X]==="EN"?gt="EN":gt="N";break;case"NSM":if(A&&!_){for(j=q.length,X=nt+1;X<j&&q[X]==="NSM";)X++;if(X<j){var J=N[nt],$=J>=1425&&J<=2303||J===64286;if(O=q[X],$&&(O==="R"||O==="AL")){gt="R";break}}}nt<1||(O=q[nt-1])==="B"?gt="N":gt=G[nt-1];break;case"B":u=!1,p=!0,gt=M;break;case"S":m=!0,gt="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":u=!1;break;case"BN":gt="N";break}return gt},C=function(N,q,G){for(var nt=0;nt<G;nt++)if(N[nt]==="S"){q[nt]=M;for(var gt=nt-1;gt>=0&&N[gt]==="WS";gt--)q[gt]=M}},R=function(N,q,G){var nt=N.split("");return G&&F(nt,G,{hiLevel:M}),nt.reverse(),q&&q.reverse(),nt.join("")},F=function(N,q,G){var nt,gt,O,Y,X,j,J=-1,$=N.length,H=0,Z=[],st=M?h:o,ot=[];for(u=!1,p=!1,m=!1,O=0;O<$;O++)ot[O]=w(N[O]);for(Y=0;Y<$;Y++){if(j=H,Z[Y]=k(N,ot,Z,Y),H=st[j][l[Z[Y]]],nt=H&240,H&=15,q[Y]=X=st[H][5],nt>0)if(nt===16){for(O=J;O<Y;O++)q[O]=1;J=-1}else J=-1;if(gt=st[H][6],gt)J===-1&&(J=Y);else if(J>-1){for(O=J;O<Y;O++)q[O]=X;J=-1}ot[Y]==="B"&&(q[Y]=0),G.hiLevel|=X}m&&C(ot,q,$)},P=function(N,q,G,nt,gt){if(!(gt.hiLevel<N)){if(N===1&&M===y&&!p){q.reverse(),G&&G.reverse();return}for(var O,Y,X,j,J=q.length,$=0;$<J;){if(nt[$]>=N){for(X=$+1;X<J&&nt[X]>=N;)X++;for(j=$,Y=X-1;j<Y;j++,Y--)O=q[j],q[j]=q[Y],q[Y]=O,G&&(O=G[j],G[j]=G[Y],G[Y]=O);$=X}$++}}},I=function(N,q,G){if(G.hiLevel!==0&&b)for(var nt=0,gt;nt<N.length;nt++)q[nt]===1&&(gt=f.indexOf(N[nt]),gt>=0&&(N[nt]=f[gt+1]))},U=function(N,q,G){var nt=N.split(""),gt={hiLevel:M};return G||(G=[]),F(nt,G,gt),I(nt,G,gt),P(y+1,nt,q,G,gt),P(y,nt,q,G,gt),nt.join("")};return this.__bidiEngine__.doBidiReorder=function(N,q,G){if(T(N,q),!A&&x&&!v)M=_?y:g,N=U(N,q,G);else if(A&&x&&_^v)M=_?y:g,N=R(N,q,G);else if(!A&&x&&v)M=_?y:g,N=U(N,q,G),N=R(N,q);else if(A&&!_&&!x&&!v)M=g,N=U(N,q,G);else if(A&&!x&&_^v)N=R(N,q),_?(M=g,N=U(N,q,G)):(M=y,N=U(N,q,G),N=R(N,q));else if(A&&_&&!x&&v)M=y,N=U(N,q,G),N=R(N,q);else if(!A&&!x&&_^v){var nt=b;_?(M=y,N=U(N,q,G),M=g,b=!1,N=U(N,q,G),b=nt):(M=g,N=U(N,q,G),N=R(N,q),M=y,b=!1,N=U(N,q,G),b=nt,N=R(N,q))}return N},this.__bidiEngine__.setOptions=function(N){N&&(A=N.isInputVisual,x=N.isOutputVisual,_=N.isInputRtl,v=N.isOutputRtl,b=N.isSymmetricSwapping)},this.__bidiEngine__.setOptions(s),this.__bidiEngine__};var e=t,i=new n.__bidiEngine__({isInputVisual:!0}),r=function(s){var a=s.text;s.x,s.y;var o=s.options||{};s.mutex,o.lang;var h=[];if(o.isInputVisual=typeof o.isInputVisual=="boolean"?o.isInputVisual:!0,i.setOptions(o),Object.prototype.toString.call(a)==="[object Array]"){var l=0;for(h=[],l=0;l<a.length;l+=1)Object.prototype.toString.call(a[l])==="[object Array]"?h.push([i.doBidiReorder(a[l][0]),a[l][1],a[l][2]]):h.push([i.doBidiReorder(a[l])]);s.text=h}else s.text=i.doBidiReorder(a);i.setOptions({isInputVisual:!0})};n.API.events.push(["postProcessText",r])})(de);de.API.TTFFont=(function(){n.open=function(t){return new n(t)};function n(t){var e;if(this.rawData=t,e=this.contents=new Xo(t),this.contents.pos=4,e.readString(4)==="ttcf")throw new Error("TTCF not supported.");e.pos=0,this.parse(),this.subset=new $X(this),this.registerTTF()}return n.prototype.parse=function(){return this.directory=new PX(this.contents),this.head=new LX(this),this.name=new IX(this),this.cmap=new w8(this),this.toUnicode={},this.hhea=new NX(this),this.maxp=new OX(this),this.hmtx=new BX(this),this.post=new DX(this),this.os2=new RX(this),this.loca=new VX(this),this.glyf=new zX(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},n.prototype.registerTTF=function(){var t,e,i,r,s;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var a,o,h,l;for(h=this.bbox,l=[],a=0,o=h.length;a<o;a++)t=h[a],l.push(Math.round(t*this.scaleFactor));return l}).call(this),this.stemV=0,this.post.exists?(r=this.post.italic_angle,e=r>>16,i=r&255,(e&32768)!==0&&(e=-((e^65535)+1)),this.italicAngle=+(""+e+"."+i)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(s=this.familyClass)===1||s===2||s===3||s===4||s===5||s===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},n.prototype.characterToGlyph=function(t){var e;return((e=this.cmap.unicode)!=null?e.codeMap[t]:void 0)||0},n.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*e},n.prototype.widthOfString=function(t,e,i){var r,s,a,o,h;for(t=""+t,o=0,s=0,h=t.length;0<=h?s<h:s>h;s=0<=h?++s:--s)r=t.charCodeAt(s),o+=this.widthOfGlyph(this.characterToGlyph(r))+i*(1e3/e)||0;return a=e/1e3,o*a},n.prototype.lineHeight=function(t,e){var i;return e==null&&(e=!1),i=e?this.lineGap:0,(this.ascender+i-this.decender)/1e3*t},n})();var Xo=(function(){function n(t){this.data=t??[],this.pos=0,this.length=this.data.length}return n.prototype.readByte=function(){return this.data[this.pos++]},n.prototype.writeByte=function(t){return this.data[this.pos++]=t},n.prototype.readUInt32=function(){var t,e,i,r;return t=this.readByte()*16777216,e=this.readByte()<<16,i=this.readByte()<<8,r=this.readByte(),t+e+i+r},n.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(t&255)},n.prototype.readInt32=function(){var t;return t=this.readUInt32(),t>=2147483648?t-4294967296:t},n.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},n.prototype.readUInt16=function(){var t,e;return t=this.readByte()<<8,e=this.readByte(),t|e},n.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(t&255)},n.prototype.readInt16=function(){var t;return t=this.readUInt16(),t>=32768?t-65536:t},n.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},n.prototype.readString=function(t){var e,i;for(i=[],e=0;0<=t?e<t:e>t;e=0<=t?++e:--e)i[e]=String.fromCharCode(this.readByte());return i.join("")},n.prototype.writeString=function(t){var e,i,r;for(r=[],e=0,i=t.length;0<=i?e<i:e>i;e=0<=i?++e:--e)r.push(this.writeByte(t.charCodeAt(e)));return r},n.prototype.readShort=function(){return this.readInt16()},n.prototype.writeShort=function(t){return this.writeInt16(t)},n.prototype.readLongLong=function(){var t,e,i,r,s,a,o,h;return t=this.readByte(),e=this.readByte(),i=this.readByte(),r=this.readByte(),s=this.readByte(),a=this.readByte(),o=this.readByte(),h=this.readByte(),t&128?((t^255)*72057594037927940+(e^255)*281474976710656+(i^255)*1099511627776+(r^255)*4294967296+(s^255)*16777216+(a^255)*65536+(o^255)*256+(h^255)+1)*-1:t*72057594037927940+e*281474976710656+i*1099511627776+r*4294967296+s*16777216+a*65536+o*256+h},n.prototype.writeLongLong=function(t){var e,i;return e=Math.floor(t/4294967296),i=t&4294967295,this.writeByte(e>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(e&255),this.writeByte(i>>24&255),this.writeByte(i>>16&255),this.writeByte(i>>8&255),this.writeByte(i&255)},n.prototype.readInt=function(){return this.readInt32()},n.prototype.writeInt=function(t){return this.writeInt32(t)},n.prototype.read=function(t){var e,i;for(e=[],i=0;0<=t?i<t:i>t;i=0<=t?++i:--i)e.push(this.readByte());return e},n.prototype.write=function(t){var e,i,r,s;for(s=[],i=0,r=t.length;i<r;i++)e=t[i],s.push(this.writeByte(e));return s},n})(),PX=(function(){var n;function t(e){var i,r,s;for(this.scalarType=e.readInt(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),this.tables={},r=0,s=this.tableCount;0<=s?r<s:r>s;r=0<=s?++r:--r)i={tag:e.readString(4),checksum:e.readInt(),offset:e.readInt(),length:e.readInt()},this.tables[i.tag]=i}return t.prototype.encode=function(e){var i,r,s,a,o,h,l,c,f,d,u,p,m,g;p=Object.keys(e).length,h=Math.log(2),f=Math.floor(Math.log(p)/h)*16,a=Math.floor(f/h),c=p*16-f,r=new Xo,r.writeInt(this.scalarType),r.writeShort(p),r.writeShort(f),r.writeShort(a),r.writeShort(c),s=p*16,l=r.pos+s,o=null,m=[];for(g in e)for(u=e[g],r.writeString(g),r.writeInt(n(u)),r.writeInt(l),r.writeInt(u.length),m=m.concat(u),g==="head"&&(o=l),l+=u.length;l%4;)m.push(0),l++;return r.write(m),d=n(r.data),i=2981146554-d,r.pos=o+8,r.writeUInt32(i),r.data},n=function(e){var i,r,s,a;for(e=S8.call(e);e.length%4;)e.push(0);for(s=new Xo(e),r=0,i=0,a=e.length;i<a;i=i+=4)r+=s.readUInt32();return r&4294967295},t})(),As,kX={}.hasOwnProperty,js=function(n,t){for(var e in t)kX.call(t,e)&&(n[e]=t[e]);function i(){this.constructor=n}return i.prototype=t.prototype,n.prototype=new i,n.__super__=t.prototype,n};As=(function(){function n(t){var e;this.file=t,e=this.file.directory.tables[this.tag],this.exists=!!e,e&&(this.offset=e.offset,this.length=e.length,this.parse(this.file.contents))}return n.prototype.parse=function(){},n.prototype.encode=function(){},n.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},n})();var LX=(function(n){js(t,n);function t(){return t.__super__.constructor.apply(this,arguments)}return t.prototype.tag="head",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},t.prototype.encode=function(e){var i;return i=new Xo,i.writeInt(this.version),i.writeInt(this.revision),i.writeInt(this.checkSumAdjustment),i.writeInt(this.magicNumber),i.writeShort(this.flags),i.writeShort(this.unitsPerEm),i.writeLongLong(this.created),i.writeLongLong(this.modified),i.writeShort(this.xMin),i.writeShort(this.yMin),i.writeShort(this.xMax),i.writeShort(this.yMax),i.writeShort(this.macStyle),i.writeShort(this.lowestRecPPEM),i.writeShort(this.fontDirectionHint),i.writeShort(e),i.writeShort(this.glyphDataFormat),i.data},t})(As),T5=(function(){function n(t,e){var i,r,s,a,o,h,l,c,f,d,u,p,m,g,y,A,_,x;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=e+t.readInt(),d=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4||this.platformID===1&&this.encodingID===0&&this.format===0,this.codeMap={},this.format){case 0:for(h=0;h<256;++h)this.codeMap[h]=t.readByte();break;case 4:for(p=t.readUInt16(),u=p/2,t.pos+=6,s=(function(){var v,b;for(b=[],h=v=0;0<=u?v<u:v>u;h=0<=u?++v:--v)b.push(t.readUInt16());return b})(),t.pos+=2,g=(function(){var v,b;for(b=[],h=v=0;0<=u?v<u:v>u;h=0<=u?++v:--v)b.push(t.readUInt16());return b})(),l=(function(){var v,b;for(b=[],h=v=0;0<=u?v<u:v>u;h=0<=u?++v:--v)b.push(t.readUInt16());return b})(),c=(function(){var v,b;for(b=[],h=v=0;0<=u?v<u:v>u;h=0<=u?++v:--v)b.push(t.readUInt16());return b})(),r=(this.length-t.pos+this.offset)/2,o=(function(){var v,b;for(b=[],h=v=0;0<=r?v<r:v>r;h=0<=r?++v:--v)b.push(t.readUInt16());return b})(),h=A=0,x=s.length;A<x;h=++A)for(y=s[h],m=g[h],i=_=m;m<=y?_<=y:_>=y;i=m<=y?++_:--_)c[h]===0?a=i+l[h]:(f=c[h]/2+(i-m)-(u-h),a=o[f]||0,a!==0&&(a+=l[h])),this.codeMap[i]=a&65535}t.pos=d}return n.encode=function(t,e){var i,r,s,a,o,h,l,c,f,d,u,p,m,g,y,A,_,x,v,b,M,T,w,E,k,C,R,F,P,I,U,N,q,G,nt,gt,O,Y,X,j,J,$,H,Z,st,ot;switch(F=new Xo,a=Object.keys(t).sort(function(V,rt){return V-rt}),e){case"macroman":for(m=0,g=(function(){var V=[];for(p=0;p<256;++p)V.push(0);return V})(),A={0:0},s={},P=0,q=a.length;P<q;P++)r=a[P],A[H=t[r]]==null&&(A[H]=++m),s[r]={old:t[r],new:A[t[r]]},g[r]=A[t[r]];return F.writeUInt16(1),F.writeUInt16(0),F.writeUInt32(12),F.writeUInt16(0),F.writeUInt16(262),F.writeUInt16(0),F.write(g),{charMap:s,subtable:F.data,maxGlyphID:m+1};case"unicode":for(C=[],f=[],_=0,A={},i={},y=l=null,I=0,G=a.length;I<G;I++)r=a[I],v=t[r],A[v]==null&&(A[v]=++_),i[r]={old:v,new:A[v]},o=A[v]-r,(y==null||o!==l)&&(y&&f.push(y),C.push(r),l=o),y=r;for(y&&f.push(y),f.push(65535),C.push(65535),w=C.length,E=w*2,T=2*Math.pow(Math.log(w)/Math.LN2,2),d=Math.log(T/2)/Math.LN2,M=2*w-T,h=[],b=[],u=[],p=U=0,nt=C.length;U<nt;p=++U){if(k=C[p],c=f[p],k===65535){h.push(0),b.push(0);break}if(R=i[k].new,k-R>=32768)for(h.push(0),b.push(2*(u.length+w-p)),r=N=k;k<=c?N<=c:N>=c;r=k<=c?++N:--N)u.push(i[r].new);else h.push(R-k),b.push(0)}for(F.writeUInt16(3),F.writeUInt16(1),F.writeUInt32(12),F.writeUInt16(4),F.writeUInt16(16+w*8+u.length*2),F.writeUInt16(0),F.writeUInt16(E),F.writeUInt16(T),F.writeUInt16(d),F.writeUInt16(M),J=0,gt=f.length;J<gt;J++)r=f[J],F.writeUInt16(r);for(F.writeUInt16(0),$=0,O=C.length;$<O;$++)r=C[$],F.writeUInt16(r);for(Z=0,Y=h.length;Z<Y;Z++)o=h[Z],F.writeUInt16(o);for(st=0,X=b.length;st<X;st++)x=b[st],F.writeUInt16(x);for(ot=0,j=u.length;ot<j;ot++)m=u[ot],F.writeUInt16(m);return{charMap:i,subtable:F.data,maxGlyphID:_+1}}},n})(),w8=(function(n){js(t,n);function t(){return t.__super__.constructor.apply(this,arguments)}return t.prototype.tag="cmap",t.prototype.parse=function(e){var i,r,s;for(e.pos=this.offset,this.version=e.readUInt16(),s=e.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=s?r<s:r>s;r=0<=s?++r:--r)i=new T5(e,this.offset),this.tables.push(i),i.isUnicode&&this.unicode==null&&(this.unicode=i);return!0},t.encode=function(e,i){var r,s;return i==null&&(i="macroman"),r=T5.encode(e,i),s=new Xo,s.writeUInt16(0),s.writeUInt16(1),r.table=s.data.concat(r.subtable),r},t})(As),NX=(function(n){js(t,n);function t(){return t.__super__.constructor.apply(this,arguments)}return t.prototype.tag="hhea",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},t})(As),RX=(function(n){js(t,n);function t(){return t.__super__.constructor.apply(this,arguments)}return t.prototype.tag="OS/2",t.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=(function(){var i,r;for(r=[],i=0;i<10;++i)r.push(e.readByte());return r})(),this.charRange=(function(){var i,r;for(r=[],i=0;i<4;++i)r.push(e.readInt());return r})(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=(function(){var i,r;for(r=[],i=0;i<2;i=++i)r.push(e.readInt());return r})(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},t})(As),DX=(function(n){js(t,n);function t(){return t.__super__.constructor.apply(this,arguments)}return t.prototype.tag="post",t.prototype.parse=function(e){var i,r,s;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:break;case 131072:r=e.readUInt16(),this.glyphNameIndex=[];var a;for(a=0;0<=r?a<r:a>r;a=0<=r?++a:--a)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],s=[];e.pos<this.offset+this.length;)i=e.readByte(),s.push(this.names.push(e.readString(i)));return s;case 151552:return r=e.readUInt16(),this.offsets=e.read(r);case 196608:break;case 262144:return this.map=(function(){var o,h,l;for(l=[],a=o=0,h=this.file.maxp.numGlyphs;0<=h?o<h:o>h;a=0<=h?++o:--o)l.push(e.readUInt32());return l}).call(this)}},t})(As),FX=(function(){function n(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID}return n})(),IX=(function(n){js(t,n);function t(){return t.__super__.constructor.apply(this,arguments)}return t.prototype.tag="name",t.prototype.parse=function(e){var i,r,s,a,o,h,l,c,f,d,u;for(e.pos=this.offset,e.readShort(),i=e.readShort(),h=e.readShort(),r=[],a=0;0<=i?a<i:a>i;a=0<=i?++a:--a)r.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+h+e.readShort()});for(l={},a=f=0,d=r.length;f<d;a=++f)s=r[a],e.pos=s.offset,c=e.readString(s.length),o=new FX(c,s),l[u=s.nameID]==null&&(l[u]=[]),l[s.nameID].push(o);this.strings=l,this.copyright=l[0],this.fontFamily=l[1],this.fontSubfamily=l[2],this.uniqueSubfamily=l[3],this.fontName=l[4],this.version=l[5];try{this.postscriptName=l[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=l[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=l[7],this.manufacturer=l[8],this.designer=l[9],this.description=l[10],this.vendorUrl=l[11],this.designerUrl=l[12],this.license=l[13],this.licenseUrl=l[14],this.preferredFamily=l[15],this.preferredSubfamily=l[17],this.compatibleFull=l[18],this.sampleText=l[19]},t})(As),OX=(function(n){js(t,n);function t(){return t.__super__.constructor.apply(this,arguments)}return t.prototype.tag="maxp",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},t})(As),BX=(function(n){js(t,n);function t(){return t.__super__.constructor.apply(this,arguments)}return t.prototype.tag="hmtx",t.prototype.parse=function(e){var i,r,s,a,o,h,l;for(e.pos=this.offset,this.metrics=[],i=0,h=this.file.hhea.numberOfMetrics;0<=h?i<h:i>h;i=0<=h?++i:--i)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(s=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=(function(){var c,f;for(f=[],i=c=0;0<=s?c<s:c>s;i=0<=s?++c:--c)f.push(e.readInt16());return f})(),this.widths=(function(){var c,f,d,u;for(d=this.metrics,u=[],c=0,f=d.length;c<f;c++)a=d[c],u.push(a.advance);return u}).call(this),r=this.widths[this.widths.length-1],l=[],i=o=0;0<=s?o<s:o>s;i=0<=s?++o:--o)l.push(this.widths.push(r));return l},t.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},t})(As),S8=[].slice,zX=(function(n){js(t,n);function t(){return t.__super__.constructor.apply(this,arguments)}return t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(e){var i,r,s,a,o,h,l,c,f,d;return e in this.cache?this.cache[e]:(a=this.file.loca,i=this.file.contents,r=a.indexOf(e),s=a.lengthOf(e),s===0?this.cache[e]=null:(i.pos=this.offset+r,h=new Xo(i.read(s)),o=h.readShort(),c=h.readShort(),d=h.readShort(),l=h.readShort(),f=h.readShort(),o===-1?this.cache[e]=new qX(h,c,d,l,f):this.cache[e]=new UX(h,o,c,d,l,f),this.cache[e]))},t.prototype.encode=function(e,i,r){var s,a,o,h,l,c;for(h=[],o=[],l=0,c=i.length;l<c;l++)a=i[l],s=e[a],o.push(h.length),s&&(h=h.concat(s.encode(r)));return o.push(h.length),{table:h,offsets:o}},t})(As),UX=(function(){function n(t,e,i,r,s,a){this.raw=t,this.numberOfContours=e,this.xMin=i,this.yMin=r,this.xMax=s,this.yMax=a,this.compound=!1}return n.prototype.encode=function(){return this.raw.data},n})(),qX=(function(){var n,t,e,i,r;n=1,i=8,t=32,e=64,r=128;function s(a,o,h,l,c){var f,d;for(this.raw=a,this.xMin=o,this.yMin=h,this.xMax=l,this.yMax=c,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],f=this.raw;d=f.readShort(),this.glyphOffsets.push(f.pos),this.glyphIDs.push(f.readUInt16()),!!(d&t);)d&n?f.pos+=4:f.pos+=2,d&r?f.pos+=8:d&e?f.pos+=4:d&i&&(f.pos+=2)}return s.prototype.encode=function(){var a,o,h,l;for(o=new Xo(S8.call(this.raw.data)),l=this.glyphIDs,a=0,h=l.length;a<h;++a)o.pos=this.glyphOffsets[a];return o.data},s})(),VX=(function(n){js(t,n);function t(){return t.__super__.constructor.apply(this,arguments)}return t.prototype.tag="loca",t.prototype.parse=function(e){var i,r;return e.pos=this.offset,i=this.file.head.indexToLocFormat,i===0?this.offsets=(function(){var s,a;for(a=[],r=0,s=this.length;r<s;r+=2)a.push(e.readUInt16()*2);return a}).call(this):this.offsets=(function(){var s,a;for(a=[],r=0,s=this.length;r<s;r+=4)a.push(e.readUInt32());return a}).call(this)},t.prototype.indexOf=function(e){return this.offsets[e]},t.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},t.prototype.encode=function(e,i){for(var r=new Uint32Array(this.offsets.length),s=0,a=0,o=0;o<r.length;++o)if(r[o]=s,a<i.length&&i[a]==o){++a,r[o]=s;var h=this.offsets[o],l=this.offsets[o+1]-h;l>0&&(s+=l)}for(var c=new Array(r.length*4),f=0;f<r.length;++f)c[4*f+3]=r[f]&255,c[4*f+2]=(r[f]&65280)>>8,c[4*f+1]=(r[f]&16711680)>>16,c[4*f]=(r[f]&4278190080)>>24;return c},t})(As),GX=function(n){var t,e,i;e={};for(t in n)i=n[t],e[i]=t;return e},$X=(function(){function n(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return n.prototype.generateCmap=function(){var t,e,i,r,s;r=this.font.cmap.tables[0].codeMap,t={},s=this.subset;for(e in s)i=s[e],t[e]=r[i];return t},n.prototype.glyphsFor=function(t){var e,i,r,s,a,o,h;for(r={},a=0,o=t.length;a<o;a++)s=t[a],r[s]=this.font.glyf.glyphFor(s);e=[];for(s in r)i=r[s],i?.compound&&e.push.apply(e,i.glyphIDs);if(e.length>0){h=this.glyphsFor(e);for(s in h)i=h[s],r[s]=i}return r},n.prototype.encode=function(t,e){var i,r,s,a,o,h,l,c,f,d,u,p,m,g,y;i=w8.encode(this.generateCmap(),"unicode"),a=this.glyphsFor(t),u={0:0},y=i.charMap;for(r in y)h=y[r],u[h.old]=h.new;d=i.maxGlyphID;for(p in a)p in u||(u[p]=d++);return c=GX(u),f=Object.keys(c).sort(function(A,_){return A-_}),m=(function(){var A,_,x;for(x=[],A=0,_=f.length;A<_;A++)o=f[A],x.push(c[o]);return x})(),s=this.font.glyf.encode(a,m,u),l=this.font.loca.encode(s.offsets,m),g={cmap:this.font.cmap.raw(),glyf:s.table,loca:l,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(e)},this.font.os2.exists&&(g["OS/2"]=this.font.os2.raw()),this.font.directory.encode(g)},n})();de.API.PDFObject=(function(){var n;function t(){}return n=function(e,i){return(Array(i+1).join("0")+e).slice(-i)},t.convert=function(e){var i,r,s,a,o;if(Array.isArray(e))return r=(function(){var h,l,c;for(c=[],h=0,l=e.length;h<l;h++)i=e[h],c.push(t.convert(i));return c})().join(" "),"["+r+"]";if(typeof e=="string")return"/"+e;if(e?.isString)return"("+e+")";if(e instanceof Date)return"(D:"+n(e.getUTCFullYear(),4)+n(e.getUTCMonth(),2)+n(e.getUTCDate(),2)+n(e.getUTCHours(),2)+n(e.getUTCMinutes(),2)+n(e.getUTCSeconds(),2)+"Z)";if({}.toString.call(e)==="[object Object]"){a=["<<"];for(s in e)o=e[s],a.push("/"+s+" "+t.convert(o));return a.push(">>"),a.join(`
|
|
4492
4492
|
`)}else return""+e},t})();var x2=function(n,t){return x2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},x2(n,t)};function Ze(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");x2(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var D1=function(){return D1=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},D1.apply(this,arguments)};function Qe(n,t,e,i){function r(s){return s instanceof e?s:new e(function(a){a(s)})}return new(e||(e=Promise))(function(s,a){function o(c){try{l(i.next(c))}catch(f){a(f)}}function h(c){try{l(i.throw(c))}catch(f){a(f)}}function l(c){c.done?s(c.value):r(c.value).then(o,h)}l((i=i.apply(n,t||[])).next())})}function Ke(n,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(l){return function(c){return h([l,c])}}function h(l){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,r&&(s=l[0]&2?r.return:l[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;switch(r=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,r=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){e.label=l[1];break}if(l[0]===6&&e.label<s[1]){e.label=s[1],s=l;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(l);break}s[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(n,e)}catch(c){l=[6,c],r=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var ns=(function(){function n(t){if(this.a=void 0,this.r=0,this.g=0,this.b=0,this.simpleColors={},this.colorDefs=[],this.ok=!1,!!t){t.charAt(0)=="#"&&(t=t.substr(1,6)),t=t.replace(/ /g,""),t=t.toLowerCase(),this.simpleColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var e in this.simpleColors)t==e&&(t=this.simpleColors[e]);this.colorDefs=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(h){return[parseInt(h[1]),parseInt(h[2]),parseInt(h[3])]}},{re:/^rgb\(([0-9.]+)%,\s*([0-9.]+)%,\s*([0-9.]+)%\)$/,example:["rgb(50.5%, 25.75%, 75.5%)","rgb(100%,0%,0%)"],process:function(h){return[Math.round(parseFloat(h[1])*2.55),Math.round(parseFloat(h[2])*2.55),Math.round(parseFloat(h[3])*2.55)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(h){return[parseInt(h[1],16),parseInt(h[2],16),parseInt(h[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(h){return[parseInt(h[1]+h[1],16),parseInt(h[2]+h[2],16),parseInt(h[3]+h[3],16)]}}];for(var i=0;i<this.colorDefs.length;i++){var r=this.colorDefs[i].re,s=this.colorDefs[i].process,a=r.exec(t);if(a){var o=s(a);this.r=o[0],this.g=o[1],this.b=o[2],this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b}}return n.prototype.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},n.prototype.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+(this.a||"1")+")"},n.prototype.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),i=this.b.toString(16);return t.length==1&&(t="0"+t),e.length==1&&(e="0"+e),i.length==1&&(i="0"+i),"#"+t+e+i},n.prototype.getHelpXML=function(){for(var t=[],e=0;e<this.colorDefs.length;e++)for(var i=this.colorDefs[e].example,r=0;r<i.length;r++)t[t.length]=i[r];for(var s in this.simpleColors)t[t.length]=s;var a=document.createElement("ul");a.setAttribute("id","rgbcolor-examples");for(var e=0;e<t.length;e++)try{var o=document.createElement("li"),h=new n(t[e]),l=document.createElement("div");l.style.cssText="margin: 3px; border: 1px solid black; background:"+h.toHex()+"; color:"+h.toHex(),l.appendChild(document.createTextNode("test"));var c=document.createTextNode(" "+t[e]+" -> "+h.toRGB()+" -> "+h.toHex());o.appendChild(l),o.appendChild(c),a.appendChild(o)}catch{}return a},n})(),Yi=(function(){function n(t){this.color=t}return n.prototype.getFillData=function(t,e){return Qe(this,void 0,void 0,function(){return Ke(this,function(i){return[2,void 0]})})},n})(),Lf=(function(){function n(){this.xmlSpace="",this.whiteSpace="",this.fill=null,this.fillOpacity=1,this.fontFamily="",this.fontSize=16,this.fontStyle="",this.fontWeight="",this.opacity=1,this.stroke=null,this.strokeDasharray=null,this.strokeDashoffset=0,this.strokeLinecap="",this.strokeLinejoin="",this.strokeMiterlimit=4,this.strokeOpacity=1,this.strokeWidth=1,this.alignmentBaseline="",this.textAnchor="",this.visibility="",this.color=null,this.contextFill=null,this.contextStroke=null,this.fillRule=null}return n.prototype.clone=function(){var t=new n;return t.xmlSpace=this.xmlSpace,t.whiteSpace=this.whiteSpace,t.fill=this.fill,t.fillOpacity=this.fillOpacity,t.fontFamily=this.fontFamily,t.fontSize=this.fontSize,t.fontStyle=this.fontStyle,t.fontWeight=this.fontWeight,t.opacity=this.opacity,t.stroke=this.stroke,t.strokeDasharray=this.strokeDasharray,t.strokeDashoffset=this.strokeDashoffset,t.strokeLinecap=this.strokeLinecap,t.strokeLinejoin=this.strokeLinejoin,t.strokeMiterlimit=this.strokeMiterlimit,t.strokeOpacity=this.strokeOpacity,t.strokeWidth=this.strokeWidth,t.textAnchor=this.textAnchor,t.alignmentBaseline=this.alignmentBaseline,t.visibility=this.visibility,t.color=this.color,t.fillRule=this.fillRule,t.contextFill=this.contextFill,t.contextStroke=this.contextStroke,t},n.default=function(){var t=new n;return t.xmlSpace="default",t.whiteSpace="normal",t.fill=new Yi(new ns("rgb(0, 0, 0)")),t.fillOpacity=1,t.fontFamily="times",t.fontSize=16,t.fontStyle="normal",t.fontWeight="normal",t.opacity=1,t.stroke=null,t.strokeDasharray=null,t.strokeDashoffset=0,t.strokeLinecap="butt",t.strokeLinejoin="miter",t.strokeMiterlimit=4,t.strokeOpacity=1,t.strokeWidth=1,t.alignmentBaseline="baseline",t.textAnchor="start",t.visibility="visible",t.color=new ns("rgb(0, 0, 0)"),t.fillRule="nonzero",t.contextFill=null,t.contextStroke=null,t},n.getContextColors=function(t,e){e===void 0&&(e=!1);var i={};return t.attributeState.contextFill&&(i.contextFill=t.attributeState.contextFill),t.attributeState.contextStroke&&(i.contextStroke=t.attributeState.contextStroke),e&&t.attributeState.color&&(i.color=t.attributeState.color),i},n})(),Qo=(function(){function n(t,e){var i,r,s;this.pdf=t,this.svg2pdfParameters=e.svg2pdfParameters,this.attributeState=e.attributeState?e.attributeState.clone():Lf.default(),this.viewport=e.viewport,this.refsHandler=e.refsHandler,this.styleSheets=e.styleSheets,this.textMeasure=e.textMeasure,this.transform=(i=e.transform)!==null&&i!==void 0?i:this.pdf.unitMatrix,this.withinClipPath=(r=e.withinClipPath)!==null&&r!==void 0?r:!1,this.withinUse=(s=e.withinUse)!==null&&s!==void 0?s:!1}return n.prototype.clone=function(t){var e,i,r,s;return t===void 0&&(t={}),new n(this.pdf,{svg2pdfParameters:this.svg2pdfParameters,attributeState:t.attributeState?t.attributeState.clone():this.attributeState.clone(),viewport:(e=t.viewport)!==null&&e!==void 0?e:this.viewport,refsHandler:this.refsHandler,styleSheets:this.styleSheets,textMeasure:this.textMeasure,transform:(i=t.transform)!==null&&i!==void 0?i:this.transform,withinClipPath:(r=t.withinClipPath)!==null&&r!==void 0?r:this.withinClipPath,withinUse:(s=t.withinUse)!==null&&s!==void 0?s:this.withinUse})},n})(),M8=(function(){function n(t){this.renderedElements={},this.idMap=t,this.idPrefix=String(n.instanceCounter++)}return n.prototype.getRendered=function(t,e,i){return Qe(this,void 0,void 0,function(){var r,s;return Ke(this,function(a){switch(a.label){case 0:return r=this.generateKey(t,e),this.renderedElements.hasOwnProperty(r)?[2,this.renderedElements[t]]:(s=this.get(t),this.renderedElements[r]=s,[4,i(s)]);case 1:return a.sent(),[2,s]}})})},n.prototype.get=function(t){return this.idMap[t]},n.prototype.generateKey=function(t,e){var i="",r=["color","contextFill","contextStroke"];return e&&(i=r.map(function(s){var a,o;return(o=(a=e[s])===null||a===void 0?void 0:a.toRGBA())!==null&&o!==void 0?o:""}).join("|")),this.idPrefix+"|"+t+"|"+i},n.instanceCounter=0,n})();function E5(n,t){return Math.atan2(t[1]-n[1],t[0]-n[0])}var C5=2/3;function P5(n,t){return[C5*(t[0]-n[0])+n[0],C5*(t[1]-n[1])+n[1]]}function qu(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]);return[n[0]/t,n[1]/t]}function ic(n,t){var e=[t[0]-n[0],t[1]-n[1]];return qu(e)}function Tp(n,t){return[n[0]+t[0],n[1]+t[1]]}function RA(n,t){var e=n[0],i=n[1];return[t.a*e+t.c*i+t.e,t.b*e+t.d*i+t.f]}var Nf=(function(){function n(){this.segments=[]}return n.prototype.moveTo=function(t,e){return this.segments.push(new Ui(t,e)),this},n.prototype.lineTo=function(t,e){return this.segments.push(new Eo(t,e)),this},n.prototype.curveTo=function(t,e,i,r,s,a){return this.segments.push(new Ts(t,e,i,r,s,a)),this},n.prototype.close=function(){return this.segments.push(new _2),this},n.prototype.transform=function(t){this.segments.forEach(function(e){if(e instanceof Ui||e instanceof Eo||e instanceof Ts){var i=RA([e.x,e.y],t);e.x=i[0],e.y=i[1]}if(e instanceof Ts){var r=RA([e.x1,e.y1],t),s=RA([e.x2,e.y2],t);e.x1=r[0],e.y1=r[1],e.x2=s[0],e.y2=s[1]}})},n.prototype.draw=function(t){var e=t.pdf;this.segments.forEach(function(i){i instanceof Ui?e.moveTo(i.x,i.y):i instanceof Eo?e.lineTo(i.x,i.y):i instanceof Ts?e.curveTo(i.x1,i.y1,i.x2,i.y2,i.x,i.y):e.close()})},n})(),Ui=(function(){function n(t,e){this.x=t,this.y=e}return n})(),Eo=(function(){function n(t,e){this.x=t,this.y=e}return n})(),Ts=(function(){function n(t,e,i,r,s,a){this.x1=t,this.y1=e,this.x2=i,this.y2=r,this.x=s,this.y=a}return n})(),_2=(function(){function n(){}return n})();function Yo(n,t){return t.split(",").indexOf((n.nodeName||n.tagName).toLowerCase())>=0}function HX(n,t){for(var e=[],i=0;i<n.childNodes.length;i++){var r=n.childNodes[i];r.nodeName.charAt(0)!=="#"&&e.push(r)}for(var i=0;i<e.length;i++)t(i,e[i])}function Vt(n,t,e,i){var r;i===void 0&&(i=e);var s=(r=n.style)===null||r===void 0?void 0:r.getPropertyValue(i);if(s)return s;var a=t.getPropertyValue(n,i);return a||n.hasAttribute(e)&&n.getAttribute(e)||void 0}function Za(n,t,e){if(Vt(n.element,e.styleSheets,"display")==="none")return!1;var i=t,r=Vt(n.element,e.styleSheets,"visibility");return r&&(i=r!=="hidden"),i}function Ko(n,t,e){var i=Za(n,t,e);return n.element.childNodes.length===0?!1:(n.children.forEach(function(r){r.isVisible(i,e)&&(i=!0)}),i)}var WX=(function(){function n(){this.markers=[]}return n.prototype.addMarker=function(t){this.markers.push(t)},n.prototype.draw=function(t){return Qe(this,void 0,void 0,function(){var e,i,r,s,a,o,h,l;return Ke(this,function(c){switch(c.label){case 0:e=0,c.label=1;case 1:return e<this.markers.length?(i=this.markers[e],r=void 0,s=i.angle,a=i.anchor,o=Math.cos(s),h=Math.sin(s),r=t.pdf.Matrix(o,h,-h,o,a[0],a[1]),r=t.pdf.matrixMult(t.pdf.Matrix(t.attributeState.strokeWidth,0,0,t.attributeState.strokeWidth,0,0),r),r=t.pdf.matrixMult(r,t.transform),t.pdf.saveGraphicsState(),l=Lf.getContextColors(t),[4,t.refsHandler.getRendered(i.id,l,function(f){return f.apply(t)})]):[3,4];case 2:c.sent(),t.pdf.doFormObject(t.refsHandler.generateKey(i.id,l),r),t.pdf.restoreGraphicsState(),c.label=3;case 3:return e++,[3,1];case 4:return[2]}})})},n})(),mo=(function(){function n(t,e,i,r){r===void 0&&(r=!1),this.id=t,this.anchor=e,this.angle=i,this.isStartMarker=r}return n})(),Sb=/url\(["']?#([^"']+)["']?\)/,jX={bottom:"bottom","text-bottom":"bottom",top:"top","text-top":"top",hanging:"hanging",middle:"middle",central:"middle",center:"middle",mathematical:"middle",ideographic:"ideographic",alphabetic:"alphabetic",baseline:"alphabetic"},k5="http://www.w3.org/2000/svg";function va(n,t){var e;return e=n&&n.toString().match(/^([\-0-9.]+)em$/),e?parseFloat(e[1])*t:(e=n&&n.toString().match(/^([\-0-9.]+)(px|)$/),e?parseFloat(e[1]):0)}function T8(n){return jX[n]||"alphabetic"}function Rr(n){for(var t=[],e=/[+-]?(?:(?:\d+\.?\d*)|(?:\d*\.?\d+))(?:[eE][+-]?\d+)?/g,i;i=e.exec(n);)t.push(parseFloat(i[0]));return t}function sf(n,t){if(n==="transparent"){var e=new ns("rgb(0,0,0)");return e.a=0,e}if(t&&n.toLowerCase()==="currentcolor")return t.color||new ns("rgb(0,0,0)");if(t&&n.toLowerCase()==="context-stroke")return t.contextStroke||new ns("rgb(0,0,0)");if(t&&n.toLowerCase()==="context-fill")return t.contextFill||new ns("rgb(0,0,0)");var i=/\s*rgba\(((?:[^,\)]*,){3}[^,\)]*)\)\s*/.exec(n);if(i){var r=Rr(i[1]),s=new ns("rgb("+r.slice(0,3).join(",")+")");return s.a=r[3],s}else return new ns(n)}function E8(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var DA,L5;function XX(){if(L5)return DA;L5=1;var n=0,t=1,e=2,i=3,r=4,s=5,a=/[a-z0-9_-]/i,o=/[\s\t]/,h=function(f){for(var d=!0,u=n,p="",m=0,g,y,A=[];;){if(y=f[m],u===n){if(!y&&d)break;if(!y&&!d)throw new Error("Parse error");if(y==='"'||y==="'")g=y,u=t,d=!1;else if(!o.test(y))if(a.test(y))u=i,d=!1,m--;else throw new Error("Parse error")}else if(u===t)if(y)y==="\\"?u=e:y===g?(A.push(p),p="",u=r):p+=y;else throw new Error("Parse Error");else if(u===e)if(y===g||y==="\\")p+=y,u=t;else throw new Error("Parse error");else if(u===i)if(y)if(a.test(y))p+=y;else if(y===",")A.push(p),p="",u=n;else if(o.test(y))u=s;else throw new Error("Parse error");else{A.push(p);break}else if(u===s)if(y){if(a.test(y))p+=" "+y,u=i;else if(y===",")A.push(p),p="",u=n;else if(!o.test(y))throw new Error("Parse error")}else{A.push(p);break}else if(u===r)if(y){if(y===",")u=n;else if(!o.test(y))throw new Error("Parse error")}else break;m++}return A},l=/[^a-z0-9_-]/i,c=function(f,d){var u=d&&d.quote||'"';if(u!=='"'&&u!=="'")throw new Error("Quote must be `'` or `\"`");for(var p=new RegExp(u,"g"),m=[],g=0;g<f.length;++g){var y=f[g];l.test(y)&&(y=y.replace(/\\/g,"\\\\").replace(p,"\\"+u),y=u+y+u),m.push(y)}return m.join(", ")};return DA={parse:h,stringify:c},DA}var YX=XX(),ZX=E8(YX),Na={"sans-serif":"helvetica",verdana:"helvetica",arial:"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",serif:"times",cursive:"times",fantasy:"times"};function JX(n,t,e){var i=C8(n.fontStyle,n.fontWeight),r=e.pdf.getFontList(),s="",a=t.some(function(o){var h=r[o];return h&&h.indexOf(i)>=0||(o=o.toLowerCase(),Na.hasOwnProperty(o))?(s=o,!0):!1});return a||(s="times"),s}var QX=(function(){var n=de.version.split(".");return parseFloat(n[0])===2&&parseFloat(n[1])===3})();function C8(n,t){return QX?t==400?n=="italic"?"italic":"normal":t==700&&n!=="italic"?"bold":n+""+t:t==400||t==="normal"?n==="italic"?"italic":"normal":(t==700||t==="bold")&&n==="normal"?"bold":(t==700?"bold":t)+""+n}function Mb(n,t){if(Vt(t.element,n.styleSheets,"display")==="none")return[0,0,0,0];var e=[];return t.children.forEach(function(i){var r=i.getBoundingBox(n);if(!(r[0]===0&&r[1]===0&&r[2]===0&&r[3]===0)){var s=i.computeNodeTransform(n);r[0]=r[0]*s.sx+s.tx,r[1]=r[1]*s.sy+s.ty,r[2]=r[2]*s.sx,r[3]=r[3]*s.sy,e.length===0?e=r:e=[Math.min(e[0],r[0]),Math.min(e[1],r[1]),Math.max(e[0]+e[2],r[0]+r[2])-Math.min(e[0],r[0]),Math.max(e[1]+e[3],r[1]+r[3])-Math.min(e[1],r[1])]}}),e.length===0?[0,0,0,0]:e}function s0(n,t){var e=parseFloat,i=e(n.getAttribute("x1"))||e(Vt(n,t.styleSheets,"x"))||e(Vt(n,t.styleSheets,"cx"))-e(Vt(n,t.styleSheets,"r"))||0,r=e(n.getAttribute("x2"))||i+e(Vt(n,t.styleSheets,"width"))||e(Vt(n,t.styleSheets,"cx"))+e(Vt(n,t.styleSheets,"r"))||0,s=e(n.getAttribute("y1"))||e(Vt(n,t.styleSheets,"y"))||e(Vt(n,t.styleSheets,"cy"))-e(Vt(n,t.styleSheets,"r"))||0,a=e(n.getAttribute("y2"))||s+e(Vt(n,t.styleSheets,"height"))||e(Vt(n,t.styleSheets,"cy"))+e(Vt(n,t.styleSheets,"r"))||0;return[Math.min(i,r),Math.min(s,a),Math.max(i,r)-Math.min(i,r),Math.max(s,a)-Math.min(s,a)]}function a0(n,t,e,i,r,s,a,o){o===void 0&&(o=!1);var h=t[0],l=t[1],c=t[2],f=t[3],d=r/c,u=s/f,p,m,g=n.getAttribute("preserveAspectRatio");if(g){var y=g.split(" ");y[0]==="defer"&&(y=y.slice(1)),p=y[0],m=y[1]||"meet"}else p="xMidYMid",m="meet";if(p!=="none"&&(m==="meet"?d=u=Math.min(d,u):m==="slice"&&(d=u=Math.max(d,u))),o)return a.pdf.Matrix(d,0,0,u,0,0);var A=e-h*d,_=i-l*u;p.indexOf("xMid")>=0?A+=(r-c*d)/2:p.indexOf("xMax")>=0&&(A+=r-c*d),p.indexOf("YMid")>=0?_+=(s-f*u)/2:p.indexOf("YMax")>=0&&(_+=s-f*u);var x=a.pdf.Matrix(1,0,0,1,A,_),v=a.pdf.Matrix(d,0,0,u,0,0);return a.pdf.matrixMult(v,x)}function kg(n,t){if(!n||n==="none")return t.pdf.unitMatrix;for(var e=/^[\s,]*matrix\(([^)]+)\)\s*/,i=/^[\s,]*translate\(([^)]+)\)\s*/,r=/^[\s,]*rotate\(([^)]+)\)\s*/,s=/^[\s,]*scale\(([^)]+)\)\s*/,a=/^[\s,]*skewX\(([^)]+)\)\s*/,o=/^[\s,]*skewY\(([^)]+)\)\s*/,h=t.pdf.unitMatrix,l,c;n.length>0&&n.length!==c;){c=n.length;var f=e.exec(n);if(f&&(l=Rr(f[1]),h=t.pdf.matrixMult(t.pdf.Matrix(l[0],l[1],l[2],l[3],l[4],l[5]),h),n=n.substr(f[0].length)),f=r.exec(n),f){l=Rr(f[1]);var d=Math.PI*l[0]/180;if(h=t.pdf.matrixMult(t.pdf.Matrix(Math.cos(d),Math.sin(d),-Math.sin(d),Math.cos(d),0,0),h),l[1]||l[2]){var u=t.pdf.Matrix(1,0,0,1,l[1],l[2]),p=t.pdf.Matrix(1,0,0,1,-l[1],-l[2]);h=t.pdf.matrixMult(p,t.pdf.matrixMult(h,u))}n=n.substr(f[0].length)}f=i.exec(n),f&&(l=Rr(f[1]),h=t.pdf.matrixMult(t.pdf.Matrix(1,0,0,1,l[0],l[1]||0),h),n=n.substr(f[0].length)),f=s.exec(n),f&&(l=Rr(f[1]),l[1]||(l[1]=l[0]),h=t.pdf.matrixMult(t.pdf.Matrix(l[0],0,0,l[1],0,0),h),n=n.substr(f[0].length)),f=a.exec(n),f&&(l=parseFloat(f[1]),l*=Math.PI/180,h=t.pdf.matrixMult(t.pdf.Matrix(1,0,Math.tan(l),1,0,0),h),n=n.substr(f[0].length)),f=o.exec(n),f&&(l=parseFloat(f[1]),l*=Math.PI/180,h=t.pdf.matrixMult(t.pdf.Matrix(1,Math.tan(l),0,1,0,0),h),n=n.substr(f[0].length))}return h}var Tb=(function(){function n(t,e){this.element=t,this.children=e,this.parent=null}return n.prototype.setParent=function(t){this.parent=t},n.prototype.getParent=function(){return this.parent},n.prototype.getBoundingBox=function(t){return Vt(this.element,t.styleSheets,"display")==="none"?[0,0,0,0]:this.getBoundingBoxCore(t)},n.prototype.computeNodeTransform=function(t){var e=this.computeNodeTransformCore(t),i=Vt(this.element,t.styleSheets,"transform");return i?t.pdf.matrixMult(e,kg(i,t)):e},n})(),o0=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.render=function(e){return Promise.resolve()},t.prototype.getBoundingBoxCore=function(e){return[]},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t})(Tb),P8=(function(n){Ze(t,n);function t(e,i,r){var s=n.call(this,i,r)||this;return s.pdfGradientType=e,s.contextColor=void 0,s}return t.prototype.apply=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o,h;return Ke(this,function(l){return i=this.element.getAttribute("id"),i?(r=this.getStops(e.styleSheets),s=0,a=!1,r.forEach(function(c){var f=c.opacity;f&&f!==1&&(s+=f,a=!0)}),a&&(o=new ch({opacity:s/r.length})),h=new To(this.pdfGradientType,this.getCoordinates(),r,o),e.pdf.addShadingPattern(i,h),[2]):[2]})})},t.prototype.getStops=function(e){var i=this;if(this.stops)return this.stops;if(this.contextColor===void 0){this.contextColor=null;for(var r=this;r;){var s=Vt(r.element,e,"color");if(s){this.contextColor=sf(s,null);break}r=r.getParent()}}var a=[];return this.children.forEach(function(o){if(o.element.tagName.toLowerCase()==="stop"){var h=Vt(o.element,e,"color"),l=sf(Vt(o.element,e,"stop-color")||"",h?{color:sf(h,null)}:{color:i.contextColor}),c=parseFloat(Vt(o.element,e,"stop-opacity")||"1");a.push({offset:t.parseGradientOffset(o.element.getAttribute("offset")||"0"),color:[l.r,l.g,l.b],opacity:c})}}),this.stops=a},t.prototype.getBoundingBoxCore=function(e){return s0(this.element,e)},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t.parseGradientOffset=function(e){var i=parseFloat(e);return!isNaN(i)&&e.indexOf("%")>=0?i/100:i},t})(o0),k8=(function(n){Ze(t,n);function t(e,i){return n.call(this,"axial",e,i)||this}return t.prototype.getCoordinates=function(){return[parseFloat(this.element.getAttribute("x1")||"0"),parseFloat(this.element.getAttribute("y1")||"0"),parseFloat(this.element.getAttribute("x2")||"1"),parseFloat(this.element.getAttribute("y2")||"0")]},t})(P8),L8=(function(n){Ze(t,n);function t(e,i){return n.call(this,"radial",e,i)||this}return t.prototype.getCoordinates=function(){var e=this.element.getAttribute("cx"),i=this.element.getAttribute("cy"),r=this.element.getAttribute("fx"),s=this.element.getAttribute("fy");return[parseFloat(r||e||"0.5"),parseFloat(s||i||"0.5"),0,parseFloat(e||"0.5"),parseFloat(i||"0.5"),parseFloat(this.element.getAttribute("r")||"0.5")]},t})(P8),KX=(function(){function n(t,e){this.key=t,this.gradient=e}return n.prototype.getFillData=function(t,e){return Qe(this,void 0,void 0,function(){var i,r,s;return Ke(this,function(a){switch(a.label){case 0:return[4,e.refsHandler.getRendered(this.key,null,function(o){return o.apply(new Qo(e.pdf,{refsHandler:e.refsHandler,textMeasure:e.textMeasure,styleSheets:e.styleSheets,viewport:e.viewport,svg2pdfParameters:e.svg2pdfParameters}))})];case 1:return a.sent(),!this.gradient.element.hasAttribute("gradientUnits")||this.gradient.element.getAttribute("gradientUnits").toLowerCase()==="objectboundingbox"?(r=t.getBoundingBox(e),i=e.pdf.Matrix(r[2],0,0,r[3],r[0],r[1])):i=e.pdf.unitMatrix,s=kg(Vt(this.gradient.element,e.styleSheets,"gradientTransform","transform"),e),[2,{key:this.key,matrix:e.pdf.matrixMult(s,i)}]}})})},n})(),N8=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.apply=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o,h;return Ke(this,function(l){switch(l.label){case 0:if(i=this.element.getAttribute("id"),!i)return[2];r=this.getBoundingBox(e),s=new Ul([r[0],r[1],r[0]+r[2],r[1]+r[3]],r[2],r[3]),e.pdf.beginTilingPattern(s),a=0,o=this.children,l.label=1;case 1:return a<o.length?(h=o[a],[4,h.render(new Qo(e.pdf,{attributeState:e.attributeState,refsHandler:e.refsHandler,styleSheets:e.styleSheets,viewport:e.viewport,svg2pdfParameters:e.svg2pdfParameters,textMeasure:e.textMeasure}))]):[3,4];case 2:l.sent(),l.label=3;case 3:return a++,[3,1];case 4:return e.pdf.endTilingPattern(i,s),[2]}})})},t.prototype.getBoundingBoxCore=function(e){return s0(this.element,e)},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t})(o0),tY=(function(){function n(t,e){this.key=t,this.pattern=e}return n.prototype.getFillData=function(t,e){return Qe(this,void 0,void 0,function(){var i,r,s,o,h,l,c,f,a,o,h,l,c,f,d,u,p;return Ke(this,function(m){switch(m.label){case 0:return[4,e.refsHandler.getRendered(this.key,null,function(g){return g.apply(new Qo(e.pdf,{refsHandler:e.refsHandler,textMeasure:e.textMeasure,styleSheets:e.styleSheets,viewport:e.viewport,svg2pdfParameters:e.svg2pdfParameters}))})];case 1:return m.sent(),i={key:this.key,boundingBox:void 0,xStep:0,yStep:0,matrix:void 0},s=e.pdf.unitMatrix,(!this.pattern.element.hasAttribute("patternUnits")||this.pattern.element.getAttribute("patternUnits").toLowerCase()==="objectboundingbox")&&(r=t.getBoundingBox(e),s=e.pdf.Matrix(1,0,0,1,r[0],r[1]),o=this.pattern.getBoundingBox(e),h=o[0]*r[0]||0,l=o[1]*r[1]||0,c=o[2]*r[2]||0,f=o[3]*r[3]||0,i.boundingBox=[h,l,h+c,l+f],i.xStep=c,i.yStep=f),a=e.pdf.unitMatrix,this.pattern.element.hasAttribute("patternContentUnits")&&this.pattern.element.getAttribute("patternContentUnits").toLowerCase()==="objectboundingbox"&&(r||(r=t.getBoundingBox(e)),a=e.pdf.Matrix(r[2],0,0,r[3],0,0),o=i.boundingBox||this.pattern.getBoundingBox(e),h=o[0]/r[0]||0,l=o[1]/r[1]||0,c=o[2]/r[2]||0,f=o[3]/r[3]||0,i.boundingBox=[h,l,h+c,l+f],i.xStep=c,i.yStep=f),d=e.pdf.unitMatrix,u=Vt(this.pattern.element,e.styleSheets,"patternTransform","transform"),u&&(d=kg(u,e)),p=a,p=e.pdf.matrixMult(p,s),p=e.pdf.matrixMult(p,d),p=e.pdf.matrixMult(p,e.transform),i.matrix=p,[2,i]}})})},n})();function eY(n,t){var e=Sb.exec(n);if(e){var i=e[1],r=t.refsHandler.get(i);return r&&(r instanceof k8||r instanceof L8)?iY(i,r,t):r&&r instanceof N8?new tY(i,r):new Yi(new ns("rgb(0, 0, 0)"))}else{var s=sf(n,t.attributeState);return s.ok?new Yi(s):null}}function iY(n,t,e){var i=t.getStops(e.styleSheets);if(i.length===0)return null;if(i.length===1){var r=i[0].color,s=new ns;return s.ok=!0,s.r=r[0],s.g=r[1],s.b=r[2],s.a=i[0].opacity,new Yi(s)}return new KX(n,t)}function Eb(n,t,e){var i=e||t.element,r=Vt(i,n.styleSheets,"color");if(r){var s=sf(r,n.attributeState);s.ok?n.attributeState.color=s:n.attributeState.color=new ns("rgb(0,0,0)")}var a=Vt(i,n.styleSheets,"visibility");a&&(n.attributeState.visibility=a);var o=Vt(i,n.styleSheets,"fill");o&&(n.attributeState.fill=eY(o,n));var h=Vt(i,n.styleSheets,"fill-opacity");h&&(n.attributeState.fillOpacity=parseFloat(h));var l=Vt(i,n.styleSheets,"stroke-opacity");l&&(n.attributeState.strokeOpacity=parseFloat(l));var c=Vt(i,n.styleSheets,"opacity");c&&(n.attributeState.opacity=parseFloat(c));var f=Vt(i,n.styleSheets,"stroke-width");f!==void 0&&f!==""&&(n.attributeState.strokeWidth=Math.abs(parseFloat(f)));var d=Vt(i,n.styleSheets,"stroke");if(d)if(d==="none")n.attributeState.stroke=null;else{var u=sf(d,n.attributeState);u.ok&&(n.attributeState.stroke=new Yi(u))}d&&n.attributeState.stroke instanceof Yi&&(n.attributeState.contextStroke=n.attributeState.stroke.color),o&&n.attributeState.fill instanceof Yi&&(n.attributeState.contextFill=n.attributeState.fill.color);var p=Vt(i,n.styleSheets,"stroke-linecap");p&&(n.attributeState.strokeLinecap=p);var m=Vt(i,n.styleSheets,"stroke-linejoin");m&&(n.attributeState.strokeLinejoin=m);var g=Vt(i,n.styleSheets,"stroke-dasharray");if(g){var y=parseInt(Vt(i,n.styleSheets,"stroke-dashoffset")||"0");n.attributeState.strokeDasharray=Rr(g),n.attributeState.strokeDashoffset=y}var A=Vt(i,n.styleSheets,"stroke-miterlimit");A!==void 0&&A!==""&&(n.attributeState.strokeMiterlimit=parseFloat(A));var _=i.getAttribute("xml:space");_&&(n.attributeState.xmlSpace=_);var x=Vt(i,n.styleSheets,"white-space");x&&(n.attributeState.whiteSpace=x);var v=Vt(i,n.styleSheets,"font-weight");v&&(n.attributeState.fontWeight=v);var b=Vt(i,n.styleSheets,"font-style");b&&(n.attributeState.fontStyle=b);var M=Vt(i,n.styleSheets,"font-family");if(M){var T=ZX.parse(M);n.attributeState.fontFamily=JX(n.attributeState,T,n)}var w=Vt(i,n.styleSheets,"font-size");if(w){var E=n.pdf.getFontSize();n.attributeState.fontSize=va(w,E)}var k=Vt(i,n.styleSheets,"vertical-align")||Vt(i,n.styleSheets,"alignment-baseline");if(k){var C=k.match(/(baseline|text-bottom|alphabetic|ideographic|middle|central|mathematical|text-top|bottom|center|top|hanging)/);C&&(n.attributeState.alignmentBaseline=C[0])}var R=Vt(i,n.styleSheets,"text-anchor");R&&(n.attributeState.textAnchor=R);var F=Vt(i,n.styleSheets,"fill-rule");F&&(n.attributeState.fillRule=F)}function Cb(n,t,e){var i=1,r=1;i*=n.attributeState.fillOpacity,i*=n.attributeState.opacity,n.attributeState.fill instanceof Yi&&typeof n.attributeState.fill.color.a<"u"&&(i*=n.attributeState.fill.color.a),r*=n.attributeState.strokeOpacity,r*=n.attributeState.opacity,n.attributeState.stroke instanceof Yi&&typeof n.attributeState.stroke.color.a<"u"&&(r*=n.attributeState.stroke.color.a);var s=i<1,a=r<1;if(Yo(e,"use")?(s=!0,a=!0,i*=n.attributeState.fill?1:0,r*=n.attributeState.stroke?1:0):n.withinUse&&(n.attributeState.fill!==t.attributeState.fill?(s=!0,i*=n.attributeState.fill?1:0):s&&!n.attributeState.fill&&(i=0),n.attributeState.stroke!==t.attributeState.stroke?(a=!0,r*=n.attributeState.stroke?1:0):a&&!n.attributeState.stroke&&(r=0)),s||a){var o={};s&&(o.opacity=i),a&&(o["stroke-opacity"]=r),n.pdf.setGState(new ch(o))}n.attributeState.fill&&n.attributeState.fill!==t.attributeState.fill&&n.attributeState.fill instanceof Yi&&n.attributeState.fill.color.ok&&!Yo(e,"text")&&n.pdf.setFillColor(n.attributeState.fill.color.r,n.attributeState.fill.color.g,n.attributeState.fill.color.b),n.attributeState.strokeWidth!==t.attributeState.strokeWidth&&n.pdf.setLineWidth(n.attributeState.strokeWidth),n.attributeState.stroke!==t.attributeState.stroke&&n.attributeState.stroke instanceof Yi&&n.pdf.setDrawColor(n.attributeState.stroke.color.r,n.attributeState.stroke.color.g,n.attributeState.stroke.color.b),n.attributeState.strokeLinecap!==t.attributeState.strokeLinecap&&n.pdf.setLineCap(n.attributeState.strokeLinecap),n.attributeState.strokeLinejoin!==t.attributeState.strokeLinejoin&&n.pdf.setLineJoin(n.attributeState.strokeLinejoin),(n.attributeState.strokeDasharray!==t.attributeState.strokeDasharray||n.attributeState.strokeDashoffset!==t.attributeState.strokeDashoffset)&&n.attributeState.strokeDasharray&&n.pdf.setLineDashPattern(n.attributeState.strokeDasharray,n.attributeState.strokeDashoffset),n.attributeState.strokeMiterlimit!==t.attributeState.strokeMiterlimit&&n.pdf.setLineMiterLimit(n.attributeState.strokeMiterlimit);var h;if(n.attributeState.fontFamily!==t.attributeState.fontFamily&&(Na.hasOwnProperty(n.attributeState.fontFamily)?h=Na[n.attributeState.fontFamily]:h=n.attributeState.fontFamily),n.attributeState.fill&&n.attributeState.fill!==t.attributeState.fill&&n.attributeState.fill instanceof Yi&&n.attributeState.fill.color.ok){var l=n.attributeState.fill.color;n.pdf.setTextColor(l.r,l.g,l.b)}var c;(n.attributeState.fontWeight!==t.attributeState.fontWeight||n.attributeState.fontStyle!==t.attributeState.fontStyle)&&(c=C8(n.attributeState.fontStyle,n.attributeState.fontWeight)),(h!==void 0||c!==void 0)&&(h===void 0&&(Na.hasOwnProperty(n.attributeState.fontFamily)?h=Na[n.attributeState.fontFamily]:h=n.attributeState.fontFamily),n.pdf.setFont(h,c)),n.attributeState.fontSize!==t.attributeState.fontSize&&n.pdf.setFontSize(n.attributeState.fontSize*n.pdf.internal.scaleFactor)}function nY(n){var t=n.attributeState,e=n.pdf,i=1,r=1;i*=t.fillOpacity,i*=t.opacity,t.fill instanceof Yi&&typeof t.fill.color.a<"u"&&(i*=t.fill.color.a),r*=t.strokeOpacity,r*=t.opacity,t.stroke instanceof Yi&&typeof t.stroke.color.a<"u"&&(r*=t.stroke.color.a);var s={};s.opacity=i,s["stroke-opacity"]=r,e.setGState(new ch(s)),t.fill&&t.fill instanceof Yi&&t.fill.color.ok?e.setFillColor(t.fill.color.r,t.fill.color.g,t.fill.color.b):e.setFillColor(0,0,0),e.setLineWidth(t.strokeWidth),t.stroke instanceof Yi?e.setDrawColor(t.stroke.color.r,t.stroke.color.g,t.stroke.color.b):e.setDrawColor(0,0,0),e.setLineCap(t.strokeLinecap),e.setLineJoin(t.strokeLinejoin),t.strokeDasharray?e.setLineDashPattern(t.strokeDasharray,t.strokeDashoffset):e.setLineDashPattern([],0),e.setLineMiterLimit(t.strokeMiterlimit);var a;if(Na.hasOwnProperty(t.fontFamily)?a=Na[t.fontFamily]:a=t.fontFamily,t.fill&&t.fill instanceof Yi&&t.fill.color.ok){var o=t.fill.color;e.setTextColor(o.r,o.g,o.b)}else e.setTextColor(0,0,0);var h="";t.fontWeight==="bold"&&(h="bold"),t.fontStyle==="italic"&&(h+="italic"),h===""&&(h="normal"),a!==void 0||h!==void 0?(a===void 0&&(Na.hasOwnProperty(t.fontFamily)?a=Na[t.fontFamily]:a=t.fontFamily),e.setFont(a,h)):e.setFont("helvetica",h),e.setFontSize(t.fontSize*e.internal.scaleFactor)}function R8(n,t,e){var i=Sb.exec(n);if(i){var r=i[1],s=e.refsHandler.get(r);return s||void 0}}function D8(n,t,e){return Qe(this,void 0,void 0,function(){var i,r;return Ke(this,function(s){switch(s.label){case 0:return i=e.clone(),t.element.hasAttribute("clipPathUnits")&&t.element.getAttribute("clipPathUnits").toLowerCase()==="objectboundingbox"&&(r=n.getBoundingBox(e),i.transform=e.pdf.matrixMult(e.pdf.Matrix(r[2],0,0,r[3],r[0],r[1]),e.transform)),[4,t.apply(i)];case 1:return s.sent(),[2]}})})}var F8=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.render=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a;return Ke(this,function(o){switch(o.label){case 0:return this.isVisible(e.attributeState.visibility!=="hidden",e)?(i=e.clone(),i.transform=i.pdf.matrixMult(this.computeNodeTransform(i),e.transform),Eb(i,this),r=Vt(this.element,i.styleSheets,"clip-path"),s=r&&r!=="none",s?(a=R8(r,this,i),a?a.isVisible(!0,i)?(i.pdf.saveGraphicsState(),[4,D8(this,a,i)]):[3,2]:[3,4]):[3,5]):[2];case 1:return o.sent(),[3,3];case 2:return[2];case 3:return[3,5];case 4:s=!1,o.label=5;case 5:return i.withinClipPath||i.pdf.saveGraphicsState(),Cb(i,e,this.element),[4,this.renderCore(i)];case 6:return o.sent(),i.withinClipPath||i.pdf.restoreGraphicsState(),s&&i.pdf.restoreGraphicsState(),[2]}})})},t})(Tb),Lg=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t})(F8),l0=(function(n){Ze(t,n);function t(e,i,r){var s=n.call(this,i,r)||this;return s.cachedPath=null,s.hasMarkers=e,s}return t.prototype.renderCore=function(e){return Qe(this,void 0,void 0,function(){var i;return Ke(this,function(r){switch(r.label){case 0:return i=this.getCachedPath(e),i===null||i.segments.length===0?[2]:(e.withinClipPath?i.transform(e.transform):e.pdf.setCurrentTransformationMatrix(e.transform),i.draw(e),[4,this.fillOrStroke(e)]);case 1:return r.sent(),this.hasMarkers?[4,this.drawMarkers(e,i)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},t.prototype.getCachedPath=function(e){return this.cachedPath||(this.cachedPath=this.getPath(e))},t.prototype.drawMarkers=function(e,i){return Qe(this,void 0,void 0,function(){var r;return Ke(this,function(s){switch(s.label){case 0:return r=this.getMarkers(i,e),[4,r.draw(e.clone({transform:e.pdf.unitMatrix}))];case 1:return s.sent(),[2]}})})},t.prototype.fillOrStroke=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o;return Ke(this,function(h){switch(h.label){case 0:return e.withinClipPath?[2]:(i=e.attributeState.fill,r=e.attributeState.stroke&&e.attributeState.strokeWidth!==0,i?[4,i.getFillData(this,e)]:[3,2]);case 1:return a=h.sent(),[3,3];case 2:a=void 0,h.label=3;case 3:return s=a,o=e.attributeState.fillRule==="evenodd",i&&r||e.withinUse?o?e.pdf.fillStrokeEvenOdd(s):e.pdf.fillStroke(s):i?o?e.pdf.fillEvenOdd(s):e.pdf.fill(s):r?e.pdf.stroke():e.pdf.discardPath(),[2]}})})},t.prototype.getBoundingBoxCore=function(e){var i=this.getCachedPath(e);if(!i||!i.segments.length)return[0,0,0,0];for(var r=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=0,c=0;c<i.segments.length;c++){var f=i.segments[c];(f instanceof Ui||f instanceof Eo||f instanceof Ts)&&(h=f.x,l=f.y),f instanceof Ts?(r=Math.min(r,h,f.x1,f.x2,f.x),a=Math.max(a,h,f.x1,f.x2,f.x),s=Math.min(s,l,f.y1,f.y2,f.y),o=Math.max(o,l,f.y1,f.y2,f.y)):(r=Math.min(r,h),a=Math.max(a,h),s=Math.min(s,l),o=Math.max(o,l))}return[r,s,a-r,o-s]},t.prototype.getMarkers=function(e,i){var r=Vt(this.element,i.styleSheets,"marker-start"),s=Vt(this.element,i.styleSheets,"marker-mid"),a=Vt(this.element,i.styleSheets,"marker-end"),o=new WX;if(r||s||a){a&&(a=FA(a)),r&&(r=FA(r)),s&&(s=FA(s));for(var h=e.segments,l=[1,0],c=void 0,f=!1,d=[1,0],u=!1,p=function(g){var y=h[g],A=r&&(g===1||!(h[g]instanceof Ui)&&h[g-1]instanceof Ui);A&&h.forEach(function(T,w){if(!u&&T instanceof _2&&w>g){var E=h[w-1];u=(E instanceof Ui||E instanceof Eo||E instanceof Ts)&&E}});var _=a&&(g===h.length-1||!(h[g]instanceof Ui)&&h[g+1]instanceof Ui),x=s&&g>0&&!(g===1&&h[g-1]instanceof Ui),v=h[g-1]||null;if(v instanceof Ui||v instanceof Eo||v instanceof Ts){if(y instanceof Ts)A&&o.addMarker(new mo(r,[v.x,v.y],E5(u?[u.x,u.y]:[v.x,v.y],[y.x1,y.y1]),!0)),_&&o.addMarker(new mo(a,[y.x,y.y],E5([y.x2,y.y2],[y.x,y.y]))),x&&(c=ic([v.x,v.y],[y.x1,y.y1]),c=v instanceof Ui?c:qu(Tp(l,c)),o.addMarker(new mo(s,[v.x,v.y],Math.atan2(c[1],c[0])))),l=ic([y.x2,y.y2],[y.x,y.y]);else if(y instanceof Ui||y instanceof Eo){if(c=ic([v.x,v.y],[y.x,y.y]),A){var b=u?ic([u.x,u.y],[y.x,y.y]):c;o.addMarker(new mo(r,[v.x,v.y],Math.atan2(b[1],b[0]),!0))}if(_&&o.addMarker(new mo(a,[y.x,y.y],Math.atan2(c[1],c[0]))),x){var b=y instanceof Ui?l:v instanceof Ui?c:qu(Tp(l,c));o.addMarker(new mo(s,[v.x,v.y],Math.atan2(b[1],b[0])))}l=c}else if(y instanceof _2){if(c=ic([v.x,v.y],[f.x,f.y]),x){var b=v instanceof Ui?c:qu(Tp(l,c));o.addMarker(new mo(s,[v.x,v.y],Math.atan2(b[1],b[0])))}if(_){var b=qu(Tp(c,d));o.addMarker(new mo(a,[f.x,f.y],Math.atan2(b[1],b[0])))}l=c}}else{f=y instanceof Ui&&y;var M=h[g+1];(M instanceof Ui||M instanceof Eo||M instanceof Ts)&&(d=ic([f.x,f.y],[M.x,M.y]))}},m=0;m<h.length;m++)p(m)}return o.markers.forEach(function(g){var y=i.refsHandler.get(g.id);if(y){var A=Vt(y.element,i.styleSheets,"orient");A!=null&&(g.isStartMarker&&A==="auto-start-reverse"&&(g.angle+=Math.PI),isNaN(Number(A))||(g.angle=parseFloat(A)/180*Math.PI))}}),o},t})(Lg);function FA(n){var t=Sb.exec(n);return t&&t[1]||void 0}var rY=(function(n){Ze(t,n);function t(e,i){return n.call(this,!0,e,i)||this}return t.prototype.getPath=function(e){if(e.withinClipPath||e.attributeState.stroke===null)return null;var i=parseFloat(this.element.getAttribute("x1")||"0"),r=parseFloat(this.element.getAttribute("y1")||"0"),s=parseFloat(this.element.getAttribute("x2")||"0"),a=parseFloat(this.element.getAttribute("y2")||"0");return i||s||r||a?new Nf().moveTo(i,r).lineTo(s,a):null},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.prototype.isVisible=function(e,i){return Za(this,e,i)},t.prototype.fillOrStroke=function(e){return Qe(this,void 0,void 0,function(){return Ke(this,function(i){switch(i.label){case 0:return e.attributeState.fill=null,[4,n.prototype.fillOrStroke.call(this,e)];case 1:return i.sent(),[2]}})})},t})(l0),I8=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.apply=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o,h,l;return Ke(this,function(c){switch(c.label){case 0:return this.isVisible(e.attributeState.visibility!=="hidden",e)?(i=e.clone(),i.transform=i.pdf.unitMatrix,Eb(i,this),r=Vt(this.element,i.styleSheets,"clip-path"),s=r&&r!=="none",s?(a=R8(r,this,i),a?a.isVisible(!0,i)?[4,D8(this,a,i)]:[3,2]:[3,3]):[3,3]):[2];case 1:return c.sent(),[3,3];case 2:return[2];case 3:Cb(i,e,this.element),o=0,h=this.children,c.label=4;case 4:return o<h.length?(l=h[o],[4,l.render(i)]):[3,7];case 5:c.sent(),c.label=6;case 6:return o++,[3,4];case 7:return[2]}})})},t.prototype.getBoundingBoxCore=function(e){return Mb(e,this)},t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t.prototype.computeNodeTransformCore=function(e){var i=parseFloat(Vt(this.element,e.styleSheets,"x")||"0"),r=parseFloat(Vt(this.element,e.styleSheets,"y")||"0"),s=this.element.getAttribute("viewBox");if(s){var a=Rr(s),o=parseFloat(Vt(this.element,e.styleSheets,"width")||Vt(this.element.ownerSVGElement,e.styleSheets,"width")||s[2]),h=parseFloat(Vt(this.element,e.styleSheets,"height")||Vt(this.element.ownerSVGElement,e.styleSheets,"height")||s[3]);return a0(this.element,a,i,r,o,h,e)}else return e.pdf.Matrix(1,0,0,1,i,r)},t})(o0),Ng=(function(){function n(t,e){this.width=t,this.height=e}return n})(),sY=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.renderCore=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o,h,l,c,f,d,u,p,m;return Ke(this,function(g){switch(g.label){case 0:return i=parseFloat,r=this.element.getAttribute("href")||this.element.getAttribute("xlink:href"),r?(s=r.substring(1),a=e.refsHandler.get(s),o=Yo(a.element,"symbol,svg")&&a.element.hasAttribute("viewBox"),h=i(Vt(this.element,e.styleSheets,"x")||"0"),l=i(Vt(this.element,e.styleSheets,"y")||"0"),c=void 0,f=void 0,o?(c=i(Vt(this.element,e.styleSheets,"width")||Vt(a.element,e.styleSheets,"width")||"0"),f=i(Vt(this.element,e.styleSheets,"height")||Vt(a.element,e.styleSheets,"height")||"0"),h+=i(Vt(a.element,e.styleSheets,"x")||"0"),l+=i(Vt(a.element,e.styleSheets,"y")||"0"),u=Rr(a.element.getAttribute("viewBox")),d=a0(a.element,u,h,l,c,f,e)):d=e.pdf.Matrix(1,0,0,1,h,l),p=Lf.getContextColors(e,!0),m=new Qo(e.pdf,{refsHandler:e.refsHandler,styleSheets:e.styleSheets,withinUse:!0,viewport:o?new Ng(c,f):e.viewport,svg2pdfParameters:e.svg2pdfParameters,textMeasure:e.textMeasure,attributeState:Object.assign(Lf.default(),p)}),[4,e.refsHandler.getRendered(s,p,function(y){return t.renderReferencedNode(y,s,m)})]):[2];case 1:return g.sent(),e.pdf.saveGraphicsState(),e.pdf.setCurrentTransformationMatrix(e.transform),o&&Vt(a.element,e.styleSheets,"overflow")!=="visible"&&(e.pdf.rect(h,l,c,f),e.pdf.clip().discardPath()),e.pdf.doFormObject(e.refsHandler.generateKey(s,p),d),e.pdf.restoreGraphicsState(),[2]}})})},t.renderReferencedNode=function(e,i,r){return Qe(this,void 0,void 0,function(){var s;return Ke(this,function(a){switch(a.label){case 0:return s=e.getBoundingBox(r),s=[s[0]-.5*s[2],s[1]-.5*s[3],s[2]*2,s[3]*2],r.pdf.beginFormObject(s[0],s[1],s[2],s[3],r.pdf.unitMatrix),e instanceof I8?[4,e.apply(r)]:[3,2];case 1:return a.sent(),[3,4];case 2:return[4,e.render(r)];case 3:a.sent(),a.label=4;case 4:return r.pdf.endFormObject(r.refsHandler.generateKey(i,r.attributeState)),[2]}})})},t.prototype.getBoundingBoxCore=function(e){return s0(this.element,e)},t.prototype.isVisible=function(e,i){return Za(this,e,i)},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t})(Lg),aY=(function(n){Ze(t,n);function t(e,i){return n.call(this,!1,e,i)||this}return t.prototype.getPath=function(e){var i=parseFloat(Vt(this.element,e.styleSheets,"width")||"0"),r=parseFloat(Vt(this.element,e.styleSheets,"height")||"0");if(!isFinite(i)||i<=0||!isFinite(r)||r<=0)return null;var s=Vt(this.element,e.styleSheets,"rx"),a=Vt(this.element,e.styleSheets,"ry"),o=Math.min(parseFloat(s||a||"0"),i*.5),h=Math.min(parseFloat(a||s||"0"),r*.5),l=parseFloat(Vt(this.element,e.styleSheets,"x")||"0"),c=parseFloat(Vt(this.element,e.styleSheets,"y")||"0"),f=4/3*(Math.SQRT2-1);return o===0&&h===0?new Nf().moveTo(l,c).lineTo(l+i,c).lineTo(l+i,c+r).lineTo(l,c+r).close():new Nf().moveTo(l+=o,c).lineTo(l+=i-2*o,c).curveTo(l+o*f,c,l+o,c+(h-h*f),l+=o,c+=h).lineTo(l,c+=r-2*h).curveTo(l,c+h*f,l-o*f,c+h,l-=o,c+=h).lineTo(l+=-i+2*o,c).curveTo(l-o*f,c,l-o,c-h*f,l-=o,c-=h).lineTo(l,c+=-r+2*h).curveTo(l,c-h*f,l+o*f,c-h,l+=o,c-=h).close()},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.prototype.isVisible=function(e,i){return Za(this,e,i)},t})(l0),O8=(function(n){Ze(t,n);function t(e,i){return n.call(this,!1,e,i)||this}return t.prototype.getPath=function(e){var i=this.getRx(e),r=this.getRy(e);if(!isFinite(i)||r<=0||!isFinite(r)||r<=0)return null;var s=parseFloat(Vt(this.element,e.styleSheets,"cx")||"0"),a=parseFloat(Vt(this.element,e.styleSheets,"cy")||"0"),o=4/3*(Math.SQRT2-1)*i,h=4/3*(Math.SQRT2-1)*r;return new Nf().moveTo(s+i,a).curveTo(s+i,a-h,s+o,a-r,s,a-r).curveTo(s-o,a-r,s-i,a-h,s-i,a).curveTo(s-i,a+h,s-o,a+r,s,a+r).curveTo(s+o,a+r,s+i,a+h,s+i,a)},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.prototype.isVisible=function(e,i){return Za(this,e,i)},t})(l0),oY=(function(n){Ze(t,n);function t(e,i){return n.call(this,e,i)||this}return t.prototype.getRx=function(e){return parseFloat(Vt(this.element,e.styleSheets,"rx")||"0")},t.prototype.getRy=function(e){return parseFloat(Vt(this.element,e.styleSheets,"ry")||"0")},t})(O8);function B8(n){var t="invisible",e=n.stroke&&n.strokeWidth!==0,i=n.fill;return i&&e?t="fillThenStroke":i?t="fill":e&&(t="stroke"),t}function lY(n,t){n=z8(n),n=U8(n);var e=t.xmlSpace==="preserve"||t.whiteSpace==="pre";return e||(n=n.trim(),n=q8(n)),n}function z8(n){return n.replace(/[\n\r]/g,"")}function U8(n){return n.replace(/[\t]/g," ")}function q8(n){return n.replace(/ +/g," ")}function N5(n,t,e){var i=Vt(n,e.styleSheets,"text-transform");switch(i){case"uppercase":return t.toUpperCase();case"lowercase":return t.toLowerCase();default:return t}}function hY(n){return n.replace(/^\s+/,"")}function cY(n){return n.replace(/\s+$/,"")}var IA=(function(){function n(t,e,i,r){this.textNode=t,this.texts=[],this.textNodes=[],this.contexts=[],this.textAnchor=e,this.originX=i,this.originY=r,this.textMeasures=[]}return n.prototype.setX=function(t){this.originX=t},n.prototype.setY=function(t){this.originY=t},n.prototype.add=function(t,e,i){this.texts.push(e),this.textNodes.push(t),this.contexts.push(i)},n.prototype.rightTrimText=function(){for(var t=this.texts.length-1;t>=0;t--){var e=this.contexts[t].attributeState.xmlSpace==="preserve"||this.contexts[t].attributeState.whiteSpace==="pre";if(e||(this.texts[t]=cY(this.texts[t])),this.texts[t].match(/[^\s]/))return!1}return!0},n.prototype.measureText=function(t){for(var e=0;e<this.texts.length;e++)this.textMeasures.push({width:t.textMeasure.measureTextWidth(this.texts[e],this.contexts[e].attributeState),length:this.texts[e].length})},n.prototype.put=function(t,e){var i,r,s,a,o=[],h=[],l=[],c=this.originX,f=this.originY,d=c,u=c;for(i=0;i<this.textNodes.length;i++){r=this.textNodes[i],s=this.contexts[i],a=this.textMeasures[i]||{width:t.textMeasure.measureTextWidth(this.texts[i],this.contexts[i].attributeState),length:this.texts[i].length};var p=c,m=f;if(r.nodeName!=="#text"&&!o.includes(r)){o.push(r);var g=n.resolveRelativePositionAttribute(r,"dx");g!==null&&(p+=va(g,s.attributeState.fontSize));var y=n.resolveRelativePositionAttribute(r,"dy");y!==null&&(m+=va(y,s.attributeState.fontSize))}h[i]=p,l[i]=m,c=p+a.width+a.length*e,f=m,d=Math.min(d,p),u=Math.max(u,c)}var A=0;switch(this.textAnchor){case"start":A=0;break;case"middle":A=(u-d)/2;break;case"end":A=u-d;break}for(i=0;i<this.textNodes.length;i++)if(r=this.textNodes[i],s=this.contexts[i],!(r.nodeName!=="#text"&&s.attributeState.visibility==="hidden")){t.pdf.saveGraphicsState(),Cb(s,t,r);var _=s.attributeState.alignmentBaseline,x=B8(s.attributeState);t.pdf.text(this.texts[i],h[i]-A,l[i],{baseline:T8(_),angle:t.transform,renderingMode:x==="fill"?void 0:x,charSpace:e===0?void 0:e}),t.pdf.restoreGraphicsState()}return[c,f]},n.resolveRelativePositionAttribute=function(t,e){for(var i,r=t;r&&Yo(r,"tspan");){if(r.hasAttribute(e))return r.getAttribute(e);if(((i=t.parentElement)===null||i===void 0?void 0:i.firstChild)!==t)break;r=r.parentElement}return null},n})(),fY=(function(n){Ze(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.boundingBox=[],e}return t.prototype.processTSpans=function(e,i,r,s,a,o){for(var h=r.pdf.getFontSize(),l=r.attributeState.xmlSpace==="preserve"||r.attributeState.whiteSpace==="pre",c=!0,f=!1,d=0;d<i.childNodes.length;d++){var u=i.childNodes[d];if(u.textContent){var p=u.textContent;if(u.nodeName==="#text"){var m=z8(p);m=U8(m),l||(m=q8(m),c&&m.match(/^\s/)&&(f=!0),m.match(/[^\s]/)&&(c=!1),o.prevText.match(/\s$/)&&(m=hY(m)));var g=N5(i,m,r);a.add(i,g,r),o.prevText=p,o.prevContext=r}else if(!Yo(u,"title")){if(Yo(u,"tspan")){var y=u,A=y.getAttribute("x");if(A!==null){var _=va(A,h);a=new IA(this,Vt(y,r.styleSheets,"text-anchor")||r.attributeState.textAnchor,_,0),s.push({type:"y",chunk:a})}var x=y.getAttribute("y");if(x!==null){var v=va(x,h);a=new IA(this,Vt(y,r.styleSheets,"text-anchor")||r.attributeState.textAnchor,0,v),s.push({type:"x",chunk:a})}var b=r.clone();Eb(b,e,y),this.processTSpans(e,y,b,s,a,o)}}}}return f},t.prototype.renderCore=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o,h,l,c,f,d,u,p,m,g,y,A,_,x,v,b,M,T,w,E,k;return Ke(this,function(C){if(e.pdf.saveGraphicsState(),i=0,r=0,s=1,a=e.pdf.getFontSize(),o=va(this.element.getAttribute("x"),a),h=va(this.element.getAttribute("y"),a),l=va(this.element.getAttribute("dx"),a),c=va(this.element.getAttribute("dy"),a),f=parseFloat(this.element.getAttribute("textLength")||"0"),d=e.attributeState.visibility,u=this.element.childElementCount,u===0)p=this.element.textContent||"",m=lY(p,e.attributeState),g=N5(this.element,m,e),i=e.textMeasure.getTextOffset(g,e.attributeState),f>0&&(y=e.textMeasure.measureTextWidth(g,e.attributeState),A=e.attributeState.xmlSpace==="preserve"||e.attributeState.whiteSpace==="pre",!A&&p.match(/^\s/)&&(s=0),r=(f-y)/(g.length-s)||0),d==="visible"&&(_=e.attributeState.alignmentBaseline,x=B8(e.attributeState),e.pdf.text(g,o+l-i,h+c,{baseline:T8(_),angle:e.transform,renderingMode:x==="fill"?void 0:x,charSpace:r===0?void 0:r}),this.boundingBox=[o+l-i,h+c+.1*a,e.textMeasure.measureTextWidth(g,e.attributeState),a]);else{for(v=[],b=new IA(this,e.attributeState.textAnchor,o+l,h+c),v.push({type:"",chunk:b}),M=this.processTSpans(this,this.element,e,v,b,{prevText:" ",prevContext:e}),s=M?0:1,T=!0,w=v.length-1;w>=0;w--)T&&(T=v[w].chunk.rightTrimText());f>0&&(E=0,k=0,v.forEach(function(R){var F=R.chunk;F.measureText(e),F.textMeasures.forEach(function(P){var I=P.width,U=P.length;E+=I,k+=U})}),r=(f-E)/(k-s)),v.reduce(function(R,F){var P=F.type,I=F.chunk;return P==="x"?I.setX(R[0]):P==="y"&&I.setY(R[1]),I.put(e,r)},[0,0])}return e.pdf.restoreGraphicsState(),[2]})})},t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t.prototype.getBoundingBoxCore=function(e){return this.boundingBox.length>0?this.boundingBox:s0(this.element,e)},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t})(Lg),OA,R5;function uY(){if(R5)return OA;R5=1;var n={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},t=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function e(u){return u===10||u===13||u===8232||u===8233||u===32||u===9||u===11||u===12||u===160||u>=5760&&t.indexOf(u)>=0}function i(u){switch(u|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function r(u){return(u|32)===97}function s(u){return u>=48&&u<=57}function a(u){return u>=48&&u<=57||u===43||u===45||u===46}function o(u){this.index=0,this.path=u,this.max=u.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function h(u){for(;u.index<u.max&&e(u.path.charCodeAt(u.index));)u.index++}function l(u){var p=u.path.charCodeAt(u.index);if(p===48){u.param=0,u.index++;return}if(p===49){u.param=1,u.index++;return}u.err="SvgPath: arc flag can be 0 or 1 only (at pos "+u.index+")"}function c(u){var p=u.index,m=p,g=u.max,y=!1,A=!1,_=!1,x=!1,v;if(m>=g){u.err="SvgPath: missed param (at pos "+m+")";return}if(v=u.path.charCodeAt(m),(v===43||v===45)&&(m++,v=m<g?u.path.charCodeAt(m):0),!s(v)&&v!==46){u.err="SvgPath: param should start with 0..9 or `.` (at pos "+m+")";return}if(v!==46){if(y=v===48,m++,v=m<g?u.path.charCodeAt(m):0,y&&m<g&&v&&s(v)){u.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+p+")";return}for(;m<g&&s(u.path.charCodeAt(m));)m++,A=!0;v=m<g?u.path.charCodeAt(m):0}if(v===46){for(x=!0,m++;s(u.path.charCodeAt(m));)m++,_=!0;v=m<g?u.path.charCodeAt(m):0}if(v===101||v===69){if(x&&!A&&!_){u.err="SvgPath: invalid float exponent (at pos "+m+")";return}if(m++,v=m<g?u.path.charCodeAt(m):0,(v===43||v===45)&&m++,m<g&&s(u.path.charCodeAt(m)))for(;m<g&&s(u.path.charCodeAt(m));)m++;else{u.err="SvgPath: invalid float exponent (at pos "+m+")";return}}u.index=m,u.param=parseFloat(u.path.slice(p,m))+0}function f(u){var p,m;p=u.path[u.segmentStart],m=p.toLowerCase();var g=u.data;if(m==="m"&&g.length>2&&(u.result.push([p,g[0],g[1]]),g=g.slice(2),m="l",p=p==="m"?"l":"L"),m==="r")u.result.push([p].concat(g));else for(;g.length>=n[m]&&(u.result.push([p].concat(g.splice(0,n[m]))),!!n[m]););}function d(u){var p=u.max,m,g,y,A,_;if(u.segmentStart=u.index,m=u.path.charCodeAt(u.index),g=r(m),!i(m)){u.err="SvgPath: bad command "+u.path[u.index]+" (at pos "+u.index+")";return}if(A=n[u.path[u.index].toLowerCase()],u.index++,h(u),u.data=[],!A){f(u);return}for(y=!1;;){for(_=A;_>0;_--){if(g&&(_===3||_===4)?l(u):c(u),u.err.length)return;u.data.push(u.param),h(u),y=!1,u.index<p&&u.path.charCodeAt(u.index)===44&&(u.index++,h(u),y=!0)}if(!y&&(u.index>=u.max||!a(u.path.charCodeAt(u.index))))break}f(u)}return OA=function(p){var m=new o(p),g=m.max;for(h(m);m.index<g&&!m.err.length;)d(m);return m.err.length?m.result=[]:m.result.length&&("mM".indexOf(m.result[0][0])<0?(m.err="SvgPath: string should start with `M` or `m`",m.result=[]):m.result[0][0]="M"),{err:m.err,segments:m.result}},OA}var BA,D5;function V8(){if(D5)return BA;D5=1;function n(e,i){return[e[0]*i[0]+e[2]*i[1],e[1]*i[0]+e[3]*i[1],e[0]*i[2]+e[2]*i[3],e[1]*i[2]+e[3]*i[3],e[0]*i[4]+e[2]*i[5]+e[4],e[1]*i[4]+e[3]*i[5]+e[5]]}function t(){if(!(this instanceof t))return new t;this.queue=[],this.cache=null}return t.prototype.matrix=function(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[3]===1&&e[4]===0&&e[5]===0?this:(this.cache=null,this.queue.push(e),this)},t.prototype.translate=function(e,i){return(e!==0||i!==0)&&(this.cache=null,this.queue.push([1,0,0,1,e,i])),this},t.prototype.scale=function(e,i){return(e!==1||i!==1)&&(this.cache=null,this.queue.push([e,0,0,i,0,0])),this},t.prototype.rotate=function(e,i,r){var s,a,o;return e!==0&&(this.translate(i,r),s=e*Math.PI/180,a=Math.cos(s),o=Math.sin(s),this.queue.push([a,o,-o,a,0,0]),this.cache=null,this.translate(-i,-r)),this},t.prototype.skewX=function(e){return e!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(e*Math.PI/180),1,0,0])),this},t.prototype.skewY=function(e){return e!==0&&(this.cache=null,this.queue.push([1,Math.tan(e*Math.PI/180),0,1,0,0])),this},t.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var e=1;e<this.queue.length;e++)this.cache=n(this.cache,this.queue[e]);return this.cache},t.prototype.calc=function(e,i,r){var s;return this.queue.length?(this.cache||(this.cache=this.toArray()),s=this.cache,[e*s[0]+i*s[2]+(r?0:s[4]),e*s[1]+i*s[3]+(r?0:s[5])]):[e,i]},BA=t,BA}var zA,F5;function dY(){if(F5)return zA;F5=1;var n=V8(),t={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},e=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,i=/[\s,]+/;return zA=function(s){var a=new n,o,h;return s.split(e).forEach(function(l){if(l.length){if(typeof t[l]<"u"){o=l;return}switch(h=l.split(i).map(function(c){return+c||0}),o){case"matrix":h.length===6&&a.matrix(h);return;case"scale":h.length===1?a.scale(h[0],h[0]):h.length===2&&a.scale(h[0],h[1]);return;case"rotate":h.length===1?a.rotate(h[0],0,0):h.length===3&&a.rotate(h[0],h[1],h[2]);return;case"translate":h.length===1?a.translate(h[0],0):h.length===2&&a.translate(h[0],h[1]);return;case"skewX":h.length===1&&a.skewX(h[0]);return;case"skewY":h.length===1&&a.skewY(h[0]);return}}}),a},zA}var UA,I5;function pY(){if(I5)return UA;I5=1;var n=Math.PI*2;function t(r,s,a,o){var h=r*o-s*a<0?-1:1,l=r*a+s*o;return l>1&&(l=1),l<-1&&(l=-1),h*Math.acos(l)}function e(r,s,a,o,h,l,c,f,d,u){var p=u*(r-a)/2+d*(s-o)/2,m=-d*(r-a)/2+u*(s-o)/2,g=c*c,y=f*f,A=p*p,_=m*m,x=g*y-g*_-y*A;x<0&&(x=0),x/=g*_+y*A,x=Math.sqrt(x)*(h===l?-1:1);var v=x*c/f*m,b=x*-f/c*p,M=u*v-d*b+(r+a)/2,T=d*v+u*b+(s+o)/2,w=(p-v)/c,E=(m-b)/f,k=(-p-v)/c,C=(-m-b)/f,R=t(1,0,w,E),F=t(w,E,k,C);return l===0&&F>0&&(F-=n),l===1&&F<0&&(F+=n),[M,T,R,F]}function i(r,s){var a=1.3333333333333333*Math.tan(s/4),o=Math.cos(r),h=Math.sin(r),l=Math.cos(r+s),c=Math.sin(r+s);return[o,h,o-h*a,h+o*a,l+c*a,c-l*a,l,c]}return UA=function(s,a,o,h,l,c,f,d,u){var p=Math.sin(u*n/360),m=Math.cos(u*n/360),g=m*(s-o)/2+p*(a-h)/2,y=-p*(s-o)/2+m*(a-h)/2;if(g===0&&y===0)return[];if(f===0||d===0)return[];f=Math.abs(f),d=Math.abs(d);var A=g*g/(f*f)+y*y/(d*d);A>1&&(f*=Math.sqrt(A),d*=Math.sqrt(A));var _=e(s,a,o,h,l,c,f,d,p,m),x=[],v=_[2],b=_[3],M=Math.max(Math.ceil(Math.abs(b)/(n/4)),1);b/=M;for(var T=0;T<M;T++)x.push(i(v,b)),v+=b;return x.map(function(w){for(var E=0;E<w.length;E+=2){var k=w[E+0],C=w[E+1];k*=f,C*=d;var R=m*k-p*C,F=p*k+m*C;w[E+0]=R+_[0],w[E+1]=F+_[1]}return w})},UA}var qA,O5;function mY(){if(O5)return qA;O5=1;var n=1e-10,t=Math.PI/180;function e(i,r,s){if(!(this instanceof e))return new e(i,r,s);this.rx=i,this.ry=r,this.ax=s}return e.prototype.transform=function(i){var r=Math.cos(this.ax*t),s=Math.sin(this.ax*t),a=[this.rx*(i[0]*r+i[2]*s),this.rx*(i[1]*r+i[3]*s),this.ry*(-i[0]*s+i[2]*r),this.ry*(-i[1]*s+i[3]*r)],o=a[0]*a[0]+a[2]*a[2],h=a[1]*a[1]+a[3]*a[3],l=((a[0]-a[3])*(a[0]-a[3])+(a[2]+a[1])*(a[2]+a[1]))*((a[0]+a[3])*(a[0]+a[3])+(a[2]-a[1])*(a[2]-a[1])),c=(o+h)/2;if(l<n*c)return this.rx=this.ry=Math.sqrt(c),this.ax=0,this;var f=a[0]*a[1]+a[2]*a[3];l=Math.sqrt(l);var d=c+l/2,u=c-l/2;return this.ax=Math.abs(f)<n&&Math.abs(d-h)<n?90:Math.atan(Math.abs(f)>Math.abs(d-h)?(d-o)/f:f/(d-h))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(d),this.ry=Math.sqrt(u)):(this.ax+=90,this.rx=Math.sqrt(u),this.ry=Math.sqrt(d)),this},e.prototype.isDegenerate=function(){return this.rx<n*this.ry||this.ry<n*this.rx},qA=e,qA}var VA,B5;function gY(){if(B5)return VA;B5=1;var n=uY(),t=dY(),e=V8(),i=pY(),r=mY();function s(a){if(!(this instanceof s))return new s(a);var o=n(a);this.segments=o.segments,this.err=o.err,this.__stack=[]}return s.from=function(a){if(typeof a=="string")return new s(a);if(a instanceof s){var o=new s("");return o.err=a.err,o.segments=a.segments.map(function(h){return h.slice()}),o.__stack=a.__stack.map(function(h){return e().matrix(h.toArray())}),o}throw new Error("SvgPath.from: invalid param type "+a)},s.prototype.__matrix=function(a){var o=this,h;a.queue.length&&this.iterate(function(l,c,f,d){var u,p,m,g;switch(l[0]){case"v":u=a.calc(0,l[1],!0),p=u[0]===0?["v",u[1]]:["l",u[0],u[1]];break;case"V":u=a.calc(f,l[1],!1),p=u[0]===a.calc(f,d,!1)[0]?["V",u[1]]:["L",u[0],u[1]];break;case"h":u=a.calc(l[1],0,!0),p=u[1]===0?["h",u[0]]:["l",u[0],u[1]];break;case"H":u=a.calc(l[1],d,!1),p=u[1]===a.calc(f,d,!1)[1]?["H",u[0]]:["L",u[0],u[1]];break;case"a":case"A":var y=a.toArray(),A=r(l[1],l[2],l[3]).transform(y);if(y[0]*y[3]-y[1]*y[2]<0&&(l[5]=l[5]?"0":"1"),u=a.calc(l[6],l[7],l[0]==="a"),l[0]==="A"&&l[6]===f&&l[7]===d||l[0]==="a"&&l[6]===0&&l[7]===0){p=[l[0]==="a"?"l":"L",u[0],u[1]];break}A.isDegenerate()?p=[l[0]==="a"?"l":"L",u[0],u[1]]:p=[l[0],A.rx,A.ry,A.ax,l[4],l[5],u[0],u[1]];break;case"m":g=c>0,u=a.calc(l[1],l[2],g),p=["m",u[0],u[1]];break;default:for(m=l[0],p=[m],g=m.toLowerCase()===m,h=1;h<l.length;h+=2)u=a.calc(l[h],l[h+1],g),p.push(u[0],u[1])}o.segments[c]=p},!0)},s.prototype.__evaluateStack=function(){var a,o;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(a=e(),o=this.__stack.length;--o>=0;)a.matrix(this.__stack[o].toArray());this.__matrix(a),this.__stack=[]}},s.prototype.toString=function(){var a="",o="",h=!1;this.__evaluateStack();for(var l=0,c=this.segments.length;l<c;l++){var f=this.segments[l],d=f[0];d!==o||d==="m"||d==="M"?(d==="m"&&o==="z"&&(a+=" "),a+=d,h=!1):h=!0;for(var u=1;u<f.length;u++){var p=f[u];u===1?h&&p>=0&&(a+=" "):p>=0&&(a+=" "),a+=p}o=d}return a},s.prototype.translate=function(a,o){return this.__stack.push(e().translate(a,o||0)),this},s.prototype.scale=function(a,o){return this.__stack.push(e().scale(a,!o&&o!==0?a:o)),this},s.prototype.rotate=function(a,o,h){return this.__stack.push(e().rotate(a,o||0,h||0)),this},s.prototype.skewX=function(a){return this.__stack.push(e().skewX(a)),this},s.prototype.skewY=function(a){return this.__stack.push(e().skewY(a)),this},s.prototype.matrix=function(a){return this.__stack.push(e().matrix(a)),this},s.prototype.transform=function(a){return a.trim()?(this.__stack.push(t(a)),this):this},s.prototype.round=function(a){var o=0,h=0,l=0,c=0,f;return a=a||0,this.__evaluateStack(),this.segments.forEach(function(d){var u=d[0].toLowerCase()===d[0];switch(d[0]){case"H":case"h":u&&(d[1]+=l),l=d[1]-d[1].toFixed(a),d[1]=+d[1].toFixed(a);return;case"V":case"v":u&&(d[1]+=c),c=d[1]-d[1].toFixed(a),d[1]=+d[1].toFixed(a);return;case"Z":case"z":l=o,c=h;return;case"M":case"m":u&&(d[1]+=l,d[2]+=c),l=d[1]-d[1].toFixed(a),c=d[2]-d[2].toFixed(a),o=l,h=c,d[1]=+d[1].toFixed(a),d[2]=+d[2].toFixed(a);return;case"A":case"a":u&&(d[6]+=l,d[7]+=c),l=d[6]-d[6].toFixed(a),c=d[7]-d[7].toFixed(a),d[1]=+d[1].toFixed(a),d[2]=+d[2].toFixed(a),d[3]=+d[3].toFixed(a+2),d[6]=+d[6].toFixed(a),d[7]=+d[7].toFixed(a);return;default:f=d.length,u&&(d[f-2]+=l,d[f-1]+=c),l=d[f-2]-d[f-2].toFixed(a),c=d[f-1]-d[f-1].toFixed(a),d.forEach(function(p,m){m&&(d[m]=+d[m].toFixed(a))});return}}),this},s.prototype.iterate=function(a,o){var h=this.segments,l={},c=!1,f=0,d=0,u=0,p=0,m,g,y;if(o||this.__evaluateStack(),h.forEach(function(A,_){var x=a(A,_,f,d);Array.isArray(x)&&(l[_]=x,c=!0);var v=A[0]===A[0].toLowerCase();switch(A[0]){case"m":case"M":f=A[1]+(v?f:0),d=A[2]+(v?d:0),u=f,p=d;return;case"h":case"H":f=A[1]+(v?f:0);return;case"v":case"V":d=A[1]+(v?d:0);return;case"z":case"Z":f=u,d=p;return;default:f=A[A.length-2]+(v?f:0),d=A[A.length-1]+(v?d:0)}}),!c)return this;for(y=[],m=0;m<h.length;m++)if(typeof l[m]<"u")for(g=0;g<l[m].length;g++)y.push(l[m][g]);else y.push(h[m]);return this.segments=y,this},s.prototype.abs=function(){return this.iterate(function(a,o,h,l){var c=a[0],f=c.toUpperCase(),d;if(c!==f)switch(a[0]=f,c){case"v":a[1]+=l;return;case"a":a[6]+=h,a[7]+=l;return;default:for(d=1;d<a.length;d++)a[d]+=d%2?h:l}},!0),this},s.prototype.rel=function(){return this.iterate(function(a,o,h,l){var c=a[0],f=c.toLowerCase(),d;if(c!==f&&!(o===0&&c==="M"))switch(a[0]=f,c){case"V":a[1]-=l;return;case"A":a[6]-=h,a[7]-=l;return;default:for(d=1;d<a.length;d++)a[d]-=d%2?h:l}},!0),this},s.prototype.unarc=function(){return this.iterate(function(a,o,h,l){var c,f,d,u=[],p=a[0];return p!=="A"&&p!=="a"?null:(p==="a"?(f=h+a[6],d=l+a[7]):(f=a[6],d=a[7]),c=i(h,l,f,d,a[4],a[5],a[1],a[2],a[3]),c.length===0?[[a[0]==="a"?"l":"L",a[6],a[7]]]:(c.forEach(function(m){u.push(["C",m[2],m[3],m[4],m[5],m[6],m[7]])}),u))}),this},s.prototype.unshort=function(){var a=this.segments,o,h,l,c,f;return this.iterate(function(d,u,p,m){var g=d[0],y=g.toUpperCase(),A;u&&(y==="T"?(A=g==="t",l=a[u-1],l[0]==="Q"?(o=l[1]-p,h=l[2]-m):l[0]==="q"?(o=l[1]-l[3],h=l[2]-l[4]):(o=0,h=0),c=-o,f=-h,A||(c+=p,f+=m),a[u]=[A?"q":"Q",c,f,d[1],d[2]]):y==="S"&&(A=g==="s",l=a[u-1],l[0]==="C"?(o=l[3]-p,h=l[4]-m):l[0]==="c"?(o=l[3]-l[5],h=l[4]-l[6]):(o=0,h=0),c=-o,f=-h,A||(c+=p,f+=m),a[u]=[A?"c":"C",c,f,d[1],d[2],d[3],d[4]]))}),this},VA=s,VA}var GA,z5;function yY(){return z5||(z5=1,GA=gY()),GA}var AY=yY(),xY=E8(AY),_Y=(function(n){Ze(t,n);function t(e,i){return n.call(this,!0,e,i)||this}return t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.prototype.isVisible=function(e,i){return Za(this,e,i)},t.prototype.getPath=function(e){var i=new xY(Vt(this.element,e.styleSheets,"d")||"").unshort().unarc().abs(),r=new Nf,s,a;return i.iterate(function(o){switch(o[0]){case"M":r.moveTo(o[1],o[2]);break;case"L":r.lineTo(o[1],o[2]);break;case"H":r.lineTo(o[1],a);break;case"V":r.lineTo(s,o[1]);break;case"C":r.curveTo(o[1],o[2],o[3],o[4],o[5],o[6]);break;case"Q":var h=P5([s,a],[o[1],o[2]]),l=P5([o[3],o[4]],[o[1],o[2]]);r.curveTo(h[0],h[1],l[0],l[1],o[3],o[4]);break;case"Z":r.close();break}switch(o[0]){case"M":case"L":s=o[1],a=o[2];break;case"H":s=o[1];break;case"V":a=o[1];break;case"C":s=o[5],a=o[6];break;case"Q":s=o[3],a=o[4];break}}),r},t})(l0),vY=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,((?:.|\s)*)$/i,bY=(function(n){Ze(t,n);function t(e,i){var r=n.call(this,e,i)||this;return r.imageLoadingPromise=null,r.imageUrl=r.element.getAttribute("xlink:href")||r.element.getAttribute("href"),r.imageUrl&&(r.imageLoadingPromise=t.fetchImageData(r.imageUrl)),r}return t.prototype.renderCore=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o,h,l,c,f,d,u,p,m,g,y,A,_,x,v;return Ke(this,function(b){switch(b.label){case 0:return this.imageLoadingPromise?(e.pdf.setCurrentTransformationMatrix(e.transform),i=parseFloat(Vt(this.element,e.styleSheets,"width")||"0"),r=parseFloat(Vt(this.element,e.styleSheets,"height")||"0"),s=parseFloat(Vt(this.element,e.styleSheets,"x")||"0"),a=parseFloat(Vt(this.element,e.styleSheets,"y")||"0"),!isFinite(i)||i<=0||!isFinite(r)||r<=0?[2]:[4,this.imageLoadingPromise]):[2];case 1:return o=b.sent(),h=o.data,l=o.format,l.indexOf("svg")!==0?[3,3]:(c=new DOMParser,f=c.parseFromString(h,"image/svg+xml").firstElementChild,d=this.element.getAttribute("preserveAspectRatio"),(!d||d.indexOf("defer")<0||!f.getAttribute("preserveAspectRatio"))&&f.setAttribute("preserveAspectRatio",d||""),f.setAttribute("x",String(s)),f.setAttribute("y",String(a)),f.setAttribute("width",String(i)),f.setAttribute("height",String(r)),u={},p=Pb(f,u),[4,p.render(new Qo(e.pdf,{refsHandler:new M8(u),styleSheets:e.styleSheets,viewport:new Ng(i,r),svg2pdfParameters:e.svg2pdfParameters,textMeasure:e.textMeasure}))]);case 2:return b.sent(),[2];case 3:m="data:image/".concat(l,";base64,").concat(btoa(h)),b.label=4;case 4:return b.trys.push([4,6,,7]),[4,t.getImageDimensions(m)];case 5:return g=b.sent(),y=g[0],A=g[1],_=[0,0,y,A],x=a0(this.element,_,s,a,i,r,e),e.pdf.setCurrentTransformationMatrix(x),e.pdf.addImage(m,"",0,0,y,A),[3,7];case 6:return v=b.sent(),typeof console=="object"&&console.warn&&console.warn("Could not load image ".concat(this.imageUrl,`.
|
|
4493
|
-
`).concat(v)),[3,7];case 7:return[2]}})})},t.prototype.getBoundingBoxCore=function(e){return s0(this.element,e)},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.prototype.isVisible=function(e,i){return Za(this,e,i)},t.fetchImageData=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o;return Ke(this,function(h){switch(h.label){case 0:if(s=e.match(vY),!s)return[3,1];if(a=s[2],o=a.split("/"),o[0]!=="image")throw new Error("Unsupported image URL: ".concat(e));return r=o[1],i=s[5],s[4]==="base64"?(i=i.replace(/\s/g,""),i=atob(i)):i=decodeURIComponent(i),[3,3];case 1:return[4,t.fetchImage(e)];case 2:i=h.sent(),r=e.substring(e.lastIndexOf(".")+1),h.label=3;case 3:return[2,{data:i,format:r}]}})})},t.fetchImage=function(e){return new Promise(function(i,r){var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer",s.onload=function(){if(s.status!==200)throw new Error("Error ".concat(s.status,": Failed to load image '").concat(e,"'"));for(var a=new Uint8Array(s.response),o="",h=0;h<a.length;h++)o+=String.fromCharCode(a[h]);i(o)},s.onerror=r,s.onabort=r,s.send(null)})},t.getMimeType=function(e){switch(e=e.toLowerCase(),e){case"jpg":case"jpeg":return"image/jpeg";default:return"image/".concat(e)}},t.getImageDimensions=function(e){return new Promise(function(i,r){var s=new Image;s.onload=function(){i([s.width,s.height])},s.onerror=r,s.src=e})},t})(Lg),G8=(function(n){Ze(t,n);function t(e,i,r){var s=n.call(this,!0,i,r)||this;return s.closed=e,s}return t.prototype.getPath=function(e){if(!this.element.hasAttribute("points")||this.element.getAttribute("points")==="")return null;var i=t.parsePointsString(this.element.getAttribute("points")),r=new Nf;if(i.length<1)return r;r.moveTo(i[0][0],i[0][1]);for(var s=1;s<i.length;s++)r.lineTo(i[s][0],i[s][1]);return this.closed&&r.close(),r},t.prototype.isVisible=function(e,i){return Za(this,e,i)},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.parsePointsString=function(e){for(var i=Rr(e),r=[],s=0;s<i.length-1;s+=2){var a=i[s],o=i[s+1];r.push([a,o])}return r},t})(l0),wY=(function(n){Ze(t,n);function t(e,i){return n.call(this,!0,e,i)||this}return t})(G8),SY=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.render=function(e){return Promise.resolve()},t.prototype.getBoundingBoxCore=function(e){return[0,0,0,0]},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.prototype.isVisible=function(e,i){return Za(this,e,i)},t})(Tb),MY=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.apply=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o,h,l;return Ke(this,function(c){switch(c.label){case 0:i=this.computeNodeTransform(e),r=this.getBoundingBox(e),e.pdf.beginFormObject(r[0],r[1],r[2],r[3],i),s=Lf.getContextColors(e),a=new Qo(e.pdf,{refsHandler:e.refsHandler,styleSheets:e.styleSheets,viewport:e.viewport,svg2pdfParameters:e.svg2pdfParameters,textMeasure:e.textMeasure,attributeState:Object.assign(Lf.default(),s)}),nY(a),o=0,h=this.children,c.label=1;case 1:return o<h.length?(l=h[o],[4,l.render(a)]):[3,4];case 2:c.sent(),c.label=3;case 3:return o++,[3,1];case 4:return e.pdf.endFormObject(a.refsHandler.generateKey(this.element.getAttribute("id"),s)),[2]}})})},t.prototype.getBoundingBoxCore=function(e){var i=this.element.getAttribute("viewBox"),r;return i&&(r=Rr(i)),[r&&r[0]||0,r&&r[1]||0,r&&r[2]||parseFloat(this.element.getAttribute("markerWidth")||"3"),r&&r[3]||parseFloat(this.element.getAttribute("markerHeight")||"3")]},t.prototype.computeNodeTransformCore=function(e){var i=parseFloat(this.element.getAttribute("refX")||"0"),r=parseFloat(this.element.getAttribute("refY")||"0"),s=this.element.getAttribute("viewBox"),a;if(s){var o=Rr(s);a=a0(this.element,o,0,0,parseFloat(this.element.getAttribute("markerWidth")||"3"),parseFloat(this.element.getAttribute("markerHeight")||"3"),e,!0),a=e.pdf.matrixMult(e.pdf.Matrix(1,0,0,1,-i,-r),a)}else a=e.pdf.Matrix(1,0,0,1,-i,-r);return a},t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t})(o0),TY=(function(n){Ze(t,n);function t(e,i){return n.call(this,e,i)||this}return t.prototype.getR=function(e){var i;return(i=this.r)!==null&&i!==void 0?i:this.r=parseFloat(Vt(this.element,e.styleSheets,"r")||"0")},t.prototype.getRx=function(e){return this.getR(e)},t.prototype.getRy=function(e){return this.getR(e)},t})(O8),EY=(function(n){Ze(t,n);function t(e,i){return n.call(this,!1,e,i)||this}return t})(G8),$8=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.renderCore=function(e){return Qe(this,void 0,void 0,function(){var i,r,s;return Ke(this,function(a){switch(a.label){case 0:i=0,r=this.children,a.label=1;case 1:return i<r.length?(s=r[i],[4,s.render(e)]):[3,4];case 2:a.sent(),a.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},t.prototype.getBoundingBoxCore=function(e){return Mb(e,this)},t})(F8),CY=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t.prototype.render=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o;return Ke(this,function(h){switch(h.label){case 0:return this.isVisible(e.attributeState.visibility!=="hidden",e)?(i=this.getX(e),r=this.getY(e),s=this.getWidth(e),a=this.getHeight(e),e.pdf.saveGraphicsState(),o=e.transform,this.element.hasAttribute("transform")&&(o=e.pdf.matrixMult(kg(this.element.getAttribute("transform"),e),o)),e.pdf.setCurrentTransformationMatrix(o),!e.withinUse&&Vt(this.element,e.styleSheets,"overflow")!=="visible"&&e.pdf.rect(i,r,s,a).clip().discardPath(),[4,n.prototype.render.call(this,e.clone({transform:e.pdf.unitMatrix,viewport:e.withinUse?e.viewport:new Ng(s,a)}))]):[2];case 1:return h.sent(),e.pdf.restoreGraphicsState(),[2]}})})},t.prototype.computeNodeTransform=function(e){return this.computeNodeTransformCore(e)},t.prototype.computeNodeTransformCore=function(e){if(e.withinUse)return e.pdf.unitMatrix;var i=this.getX(e),r=this.getY(e),s=this.getViewBox(),a;if(s){var o=this.getWidth(e),h=this.getHeight(e);a=a0(this.element,s,i,r,o,h,e)}else a=e.pdf.Matrix(1,0,0,1,i,r);return a},t.prototype.getWidth=function(e){if(this.width!==void 0)return this.width;var i,r=e.svg2pdfParameters;if(this.isOutermostSvg(e))if(r.width!=null)i=r.width;else{var s=Vt(this.element,e.styleSheets,"width");if(s)i=parseFloat(s);else{var a=this.getViewBox();if(a&&(r.height!=null||Vt(this.element,e.styleSheets,"height"))){var o=a[2]/a[3];i=this.getHeight(e)*o}else i=Math.min(300,e.viewport.width,e.viewport.height*2)}}else{var s=Vt(this.element,e.styleSheets,"width");i=s?parseFloat(s):e.viewport.width}return this.width=i},t.prototype.getHeight=function(e){if(this.height!==void 0)return this.height;var i,r=e.svg2pdfParameters;if(this.isOutermostSvg(e))if(r.height!=null)i=r.height;else{var s=Vt(this.element,e.styleSheets,"height");if(s)i=parseFloat(s);else{var a=this.getViewBox();if(a){var o=a[2]/a[3];i=this.getWidth(e)/o}else i=Math.min(150,e.viewport.width/2,e.viewport.height)}}else{var s=Vt(this.element,e.styleSheets,"height");i=s?parseFloat(s):e.viewport.height}return this.height=i},t.prototype.getX=function(e){if(this.x!==void 0)return this.x;if(this.isOutermostSvg(e))return this.x=0;var i=Vt(this.element,e.styleSheets,"x");return this.x=i?parseFloat(i):0},t.prototype.getY=function(e){if(this.y!==void 0)return this.y;if(this.isOutermostSvg(e))return this.y=0;var i=Vt(this.element,e.styleSheets,"y");return this.y=i?parseFloat(i):0},t.prototype.getViewBox=function(){if(this.viewBox!==void 0)return this.viewBox;var e=this.element.getAttribute("viewBox");return this.viewBox=e?Rr(e):void 0},t.prototype.isOutermostSvg=function(e){return e.svg2pdfParameters.element===this.element},t})($8),H8=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t})($8),PY=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.renderCore=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a;return Ke(this,function(o){switch(o.label){case 0:return[4,n.prototype.renderCore.call(this,e)];case 1:return o.sent(),i=Vt(this.element,e.styleSheets,"href"),i&&(r=this.getBoundingBox(e),s=e.pdf.internal.scaleFactor,a=e.pdf.internal.pageSize.getHeight(),e.pdf.link(s*(r[0]*e.transform.sx+e.transform.tx),s*(a-r[1]*e.transform.sy-e.transform.ty),s*e.transform.sx*r[2],s*e.transform.sy*r[3],{url:i})),[2]}})})},t})(H8),kY=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.apply=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o,h;return Ke(this,function(l){switch(l.label){case 0:if(!this.isVisible(!0,e))return[2];i=e.pdf.matrixMult(this.computeNodeTransform(e),e.transform),e.pdf.setCurrentTransformationMatrix(i),r=0,s=this.children,l.label=1;case 1:return r<s.length?(a=s[r],[4,a.render(new Qo(e.pdf,{refsHandler:e.refsHandler,styleSheets:e.styleSheets,viewport:e.viewport,withinClipPath:!0,svg2pdfParameters:e.svg2pdfParameters,textMeasure:e.textMeasure}))]):[3,4];case 2:l.sent(),l.label=3;case 3:return r++,[3,1];case 4:return o=this.children.length>0&&!!Vt(this.children[0].element,e.styleSheets,"clip-rule"),h=o?this.getClipRuleAttr(this.children[0].element,e.styleSheets):this.getClipRuleAttr(this.element,e.styleSheets),e.pdf.clip(h).discardPath(),e.pdf.setCurrentTransformationMatrix(i.inversed()),[2]}})})},t.prototype.getBoundingBoxCore=function(e){return Mb(e,this)},t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t.prototype.getClipRuleAttr=function(e,i){return Vt(e,i,"clip-rule")==="evenodd"?"evenodd":void 0},t})(o0);function Pb(n,t){var e,i=[];switch(HX(n,function(s,a){return i.push(Pb(a,t))}),n.tagName.toLowerCase()){case"a":e=new PY(n,i);break;case"g":e=new H8(n,i);break;case"circle":e=new TY(n,i);break;case"clippath":e=new kY(n,i);break;case"ellipse":e=new oY(n,i);break;case"lineargradient":e=new k8(n,i);break;case"image":e=new bY(n,i);break;case"line":e=new rY(n,i);break;case"marker":e=new MY(n,i);break;case"path":e=new _Y(n,i);break;case"pattern":e=new N8(n,i);break;case"polygon":e=new wY(n,i);break;case"polyline":e=new EY(n,i);break;case"radialgradient":e=new L8(n,i);break;case"rect":e=new aY(n,i);break;case"svg":e=new CY(n,i);break;case"symbol":e=new I8(n,i);break;case"text":e=new fY(n,i);break;case"use":e=new sY(n,i);break;default:e=new SY(n,i);break}if(t!=null&&e.element.hasAttribute("id")){var r=e.element.id;t[r]=t[r]||e}return e.children.forEach(function(s){return s.setParent(e)}),e}var LY=(function(){function n(t,e){this.rootSvg=t,this.loadExternalSheets=e,this.styleSheets=[]}return n.prototype.load=function(){return Qe(this,void 0,void 0,function(){var t;return Ke(this,function(e){switch(e.label){case 0:return[4,this.collectStyleSheetTexts()];case 1:return t=e.sent(),this.parseCssSheets(t),[2]}})})},n.prototype.collectStyleSheetTexts=function(){return Qe(this,void 0,void 0,function(){var t,r,e,i,r,s;return Ke(this,function(a){switch(a.label){case 0:if(t=[],this.loadExternalSheets&&this.rootSvg.ownerDocument)for(r=0;r<this.rootSvg.ownerDocument.childNodes.length;r++)e=this.rootSvg.ownerDocument.childNodes[r],e.nodeName==="xml-stylesheet"&&typeof e.data=="string"&&t.push(n.loadSheet(e.data.match(/href=["'].*?["']/)[0].split("=")[1].slice(1,-1)));for(i=this.rootSvg.querySelectorAll("style,link"),r=0;r<i.length;r++)s=i[r],Yo(s,"style")?t.push(s.textContent):this.loadExternalSheets&&Yo(s,"link")&&s.getAttribute("rel")==="stylesheet"&&s.hasAttribute("href")&&t.push(n.loadSheet(s.getAttribute("href")));return[4,Promise.all(t)];case 1:return[2,a.sent().filter(function(o){return o!==null})]}})})},n.prototype.parseCssSheets=function(t){for(var e=document.implementation.createHTMLDocument(""),i=0,r=t;i<r.length;i++){var s=r[i],a=e.createElement("style");a.textContent=s,e.body.appendChild(a);var o=a.sheet;if(o instanceof CSSStyleSheet){for(var h=o.cssRules.length-1;h>=0;h--){var l=o.cssRules[h];if(!(l instanceof CSSStyleRule)){o.deleteRule(h);continue}var c=l;if(c.selectorText.indexOf(",")>=0){o.deleteRule(h);for(var f=c.cssText.substring(c.selectorText.length),d=n.splitSelectorAtCommas(c.selectorText),u=0;u<d.length;u++)o.insertRule(d[u]+f,h+u)}}this.styleSheets.push(o)}}},n.splitSelectorAtCommas=function(t){for(var e=/,|["']/g,i=/[^\\]["]/g,r=/[^\\][']/g,s=[],a="initial",o,h=-1,l=i,c=0;c<t.length;)switch(a){case"initial":e.lastIndex=c,o=e.exec(t),o?(o[0]===","?(s.push(t.substring(h+1,e.lastIndex-1).trim()),h=e.lastIndex-1):(a="withinQuotes",l=o[0]==='"'?i:r),c=e.lastIndex):(s.push(t.substring(h+1).trim()),c=t.length);break;case"withinQuotes":l.lastIndex=c,o=l.exec(t),o&&(c=l.lastIndex,a="initial");break}return s},n.loadSheet=function(t){return new Promise(function(e,i){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="text",r.onload=function(){r.status!==200&&i(new Error("Error ".concat(r.status,": Failed to load '").concat(t,"'"))),e(r.responseText)},r.onerror=i,r.onabort=i,r.send(null)}).catch(function(){return null})},n.prototype.getPropertyValue=function(t,e){for(var i=[],r=0,s=this.styleSheets;r<s.length;r++)for(var a=s[r],o=0;o<a.cssRules.length;o++){var h=a.cssRules[o];h.style.getPropertyValue(e)&&t.matches(h.selectorText)&&i.push(h)}if(i.length!==0){var l=function(f,d){var u=f.style.getPropertyPriority(e),p=d.style.getPropertyPriority(e);return u!==p?u==="important"?1:-1:0},c=i.reduce(function(f,d){return l(f,d)===1?f:d});return c.style.getPropertyValue(e)||void 0}},n})(),NY=(function(){function n(){this.measureMethods={}}return n.prototype.getTextOffset=function(t,e){var i=e.textAnchor;if(i==="start")return 0;var r=this.measureTextWidth(t,e),s=0;switch(i){case"end":s=r;break;case"middle":s=r/2;break}return s},n.prototype.measureTextWidth=function(t,e){if(t.length===0)return 0;var i=e.fontFamily,r=this.getMeasureFunction(i);return r.call(this,t,e.fontFamily,e.fontSize+"px",e.fontStyle,e.fontWeight)},n.prototype.getMeasurementTextNode=function(){if(!this.textMeasuringTextElement){this.textMeasuringTextElement=document.createElementNS(k5,"text");var t=document.createElementNS(k5,"svg");t.appendChild(this.textMeasuringTextElement),t.style.setProperty("position","absolute"),t.style.setProperty("visibility","hidden"),document.body.appendChild(t)}return this.textMeasuringTextElement},n.prototype.canvasTextMeasure=function(t,e,i,r,s){var a=document.createElement("canvas"),o=a.getContext("2d");return o!=null?(o.font=[r,s,i,e].join(" "),o.measureText(t).width):0},n.prototype.svgTextMeasure=function(t,e,i,r,s,a){a===void 0&&(a=this.getMeasurementTextNode());var o=a;return o.setAttribute("font-family",e),o.setAttribute("font-size",i),o.setAttribute("font-style",r),o.setAttribute("font-weight",s),o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.textContent=t,o.getBBox().width},n.prototype.getMeasureFunction=function(t){var e=this.measureMethods[t];if(!e){var i="16px",r="normal",s="normal",a=this.canvasTextMeasure(n.testString,t,i,r,s),o=this.svgTextMeasure(n.testString,t,i,r,s);e=Math.abs(a-o)<n.epsilon?this.canvasTextMeasure:this.svgTextMeasure,this.measureMethods[t]=e}return e},n.prototype.cleanupTextMeasuring=function(){if(this.textMeasuringTextElement){var t=this.textMeasuringTextElement.parentNode;t&&document.body.removeChild(t),this.textMeasuringTextElement=void 0}},n.testString=`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789!"$%&/()=?'\\+*-_.:,;^}][{#~|<>`,n.epsilon=.1,n})();function W8(n,t){return Qe(this,arguments,void 0,function(e,i,r){var s,a,o,h,l,c,f,d,u,p,m,g,y,A,_;return r===void 0&&(r={}),Ke(this,function(x){switch(x.label){case 0:return s=(y=r.x)!==null&&y!==void 0?y:0,a=(A=r.y)!==null&&A!==void 0?A:0,o=(_=r.loadExternalStyleSheets)!==null&&_!==void 0?_:!1,h={},l=new M8(h),c=new LY(e,o),[4,c.load()];case 1:return x.sent(),f=new Ng(i.internal.pageSize.getWidth(),i.internal.pageSize.getHeight()),d=D1(D1({},r),{element:e}),u=new NY,p=new Qo(i,{refsHandler:l,styleSheets:c,viewport:f,svg2pdfParameters:d,textMeasure:u}),i.advancedAPI(),i.saveGraphicsState(),i.setCurrentTransformationMatrix(i.Matrix(1,0,0,1,s,a)),i.setLineWidth(p.attributeState.strokeWidth),m=p.attributeState.fill.color,i.setFillColor(m.r,m.g,m.b),i.setFont(p.attributeState.fontFamily),i.setFontSize(p.attributeState.fontSize*i.internal.scaleFactor),g=Pb(e,h),[4,g.render(p)];case 2:return x.sent(),i.restoreGraphicsState(),i.compatAPI(),p.textMeasure.cleanupTextMeasuring(),[2,i]}})})}de.API.svg=function(n,t){return t===void 0&&(t={}),W8(n,this,t)};async function RY(n,t){const e=Se();let i=!1;const r=[],s=[],a=[],o=[],h=[],l=[],c=n.node.getAttribute("transform"),f={};n.reset_tranform&&n.node.removeAttribute("transform"),Ct(n.node).selectAll("g").each(function(){if(this.hasAttribute("font-family")){const m=this.getAttribute("font-family");m===ko&&(this.setAttribute("font-family","courier"),n.can_modify||r.push(this)),m===Mn&&(this.setAttribute("font-family","symbol"),n.can_modify||s.push(this)),m===Hl&&(this.setAttribute("font-family","zapfdingbats"),n.can_modify||a.push(this)),(m===Po||m===ko)&&this.getAttribute("font-weight")==="bold"&&this.getAttribute("font-style")==="oblique"?(this.setAttribute("font-style","italic"),n.can_modify||h.push(this)):m===ko&&this.getAttribute("font-style")==="oblique"&&(this.setAttribute("font-style","italic"),n.can_modify||h.push(this))}}),Ct(n.node).selectAll("text").each(function(){this.hasAttribute("dominant-baseline")?(this.setAttribute("dy",".2em"),this.removeAttribute("dominant-baseline"),n.can_modify||o.push(this)):n.can_modify&&e&&this.getAttribute("dy")===".4em"&&this.setAttribute("dy",".2em"),wD(this)&&(i=!0,n.can_modify||l.push(this))});let d=Promise.resolve();if(e){const m=Kt.nodejs_document;m.originalCreateElementNS=m.createElementNS,globalThis.document=m,globalThis.CSSStyleSheet=Kt.nodejs_window.CSSStyleSheet,globalThis.CSSStyleRule=Kt.nodejs_window.CSSStyleRule,m.createElementNS=function(g,y){const A=m.originalCreateElementNS(g,y);return A.getBBox=function(){let _=50,x=10;if(this.tagName==="text"){const v=yD(this);_=gv(this.textContent,v),x=v.size*1.2}return{x:0,y:0,width:_,height:x}},A},d=Qt(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).then(g=>{globalThis.Image=g.Image})}const u=n.width<n.height?"portrait":"landscape";let p=t?.as_doc?t.doc:null;if(p?p.addPage({orientation:u,unit:"px",format:[n.width+10,n.height+10]}):(p=new de({orientation:u,unit:"px",format:[n.width+10,n.height+10]}),t?.as_doc&&(t.doc=p)),Ct(n.node).selectAll("style").each(function(){const m=this.$fontcfg;if(!m?.n||!m?.base64)return;const g=m.n;if(g===Mn||g===Hl||f[g])return;f[g]=!0;const y=g.toLowerCase().replace(/\s/g,"")+".ttf";p.addFileToVFS(y,m.base64),p.addFont(y,m.n,m.s||"normal")}),i&&!f[Mn]&&tt.LoadSymbolTtf){const m=new Ha(122,10);d=d.then(()=>m.load()).then(()=>{m.addCustomFontToSvg(Ct(n.node)),p.addFileToVFS(Mn+".ttf",m.base64),p.addFont(Mn+".ttf",Mn,"normal")})}return d.then(()=>W8(n.node,p,{x:5,y:5,width:n.width,height:n.height})).then(()=>{n.reset_tranform&&!n.can_modify&&c&&n.node.setAttribute("transform",c),r.forEach(g=>g.setAttribute("font-family",ko)),s.forEach(g=>g.setAttribute("font-family",Mn)),a.forEach(g=>g.setAttribute("font-family",Hl)),h.forEach(g=>g.setAttribute("font-style","oblique")),o.forEach(g=>{g.setAttribute("dominant-baseline","middle"),g.removeAttribute("dy")}),l.forEach(g=>{g.innerHTML=g.$originalHTML,g.$originalFont?g.setAttribute("font-family",g.$originalFont):g.removeAttribute("font-family")});const m=t?.as_buffer?p.output("arraybuffer"):p.output("dataurlstring");return e&&(globalThis.document=void 0,globalThis.CSSStyleSheet=void 0,globalThis.CSSStyleRule=void 0,globalThis.Image=void 0,Kt.nodejs_document.createElementNS=Kt.nodejs_document.originalCreateElementNS,t?.as_buffer)?Buffer.from(m):m})}async function Ep(){return Qt(()=>import("./more-CGvLPt4r.js"),[])}async function km(){return Qt(()=>Promise.resolve().then(()=>c$),void 0)}async function Cp(){return Qt(()=>import("./TTree-CE4EQRMu.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,10,11,12,13,14,15]))}async function Ll(){return Qt(()=>Promise.resolve().then(()=>VY),void 0)}let bn=null,Ec=null;const $A="TGraph2D",U5="TH2Poly",HA="TEllipse",q5="TSpline3",V5="TCanvasWebSnapshot",Pp="fPrimitives",kp="fFunctions",_l={lst:[{name:Dr,icon:"img_canvas",class:()=>km().then(n=>n.TCanvasPainter),opt:";grid;gridx;gridy;tick;tickx;ticky;log;logx;logy;logz",expand_item:Pp,noappend:!0},{name:Pr,icon:"img_canvas",func:Fs.draw,opt:";grid;gridx;gridy;tick;tickx;ticky;log;logx;logy;logz",expand_item:Pp,noappend:!0},{name:"TSlider",icon:"img_canvas",func:Fs.draw},{name:g1,icon:"img_canvas",func:Fs.draw},{name:"TInspectCanvas",icon:"img_canvas",sameas:Dr},{name:H1,icon:"img_frame",draw:()=>km().then(n=>n.drawTFrame)},{name:un,icon:"img_pavetext",class:()=>Qt(()=>import("./TPavePainter-Dx40jhkF.js"),[]).then(n=>n.TPavePainter)},{name:sd,sameas:un},{name:$4,sameas:un},{name:G1,sameas:un},{name:H4,sameas:un},{name:W4,sameas:un},{name:j4,sameas:un},{name:Rl,icon:"img_pavelabel",sameas:un},{name:z2,icon:"img_colz",sameas:un},{name:Ta,icon:"img_text",class:()=>Qt(()=>import("./TTextPainter-BwCh-g5B.js"),[]).then(n=>n.TTextPainter),build3d:()=>Qt(()=>import("./latex3d-ITrfFgp8.js"),[]).then(n=>n.build3dlatex)},{name:Y4,sameas:Ta},{name:Ff,sameas:Ta},{name:X4,sameas:Ta},{name:Z4,icon:"img_text",class:()=>Qt(()=>import("./TAnnotation3DPainter-BCJen6cS.js"),__vite__mapDeps([16,17,5])).then(n=>n.TAnnotation3DPainter)},{name:/^TH1/,icon:"img_histo1d",class:()=>Qt(()=>import("./TH1Painter-CMr7gXzd.js"),__vite__mapDeps([3,4,5,6,7,8,9,10])).then(n=>n.TH1Painter),opt:";hist;P;P0;E;E1;E2;E3;E4;E1X0;L;LF2;C;B;B1;A;TEXT;LEGO;same",ctrl:"l",expand_item:kp,for_derived:!0},{name:q2,icon:"img_profile",class:()=>Qt(()=>import("./TH1Painter-CMr7gXzd.js"),__vite__mapDeps([3,4,5,6,7,8,9,10])).then(n=>n.TH1Painter),opt:";E0;E1;E2;p;AH;hist;projx;projxb;projxc=e;projxw",expand_item:kp},{name:U5,icon:"img_histo2d",class:()=>Qt(()=>import("./TH2Painter-BLfyBVB5.js"),__vite__mapDeps([11,4,5,6,7,8])).then(n=>n.TH2Painter),opt:";COL;COL0;COLZ;LCOL;LCOL0;LCOLZ;LEGO;TEXT;same",expand_item:"fBins",theonly:!0},{name:"TProfile2Poly",sameas:U5},{name:"TH2PolyBin",icon:"img_histo2d",draw_field:"fPoly",draw_field_opt:"L"},{name:/^TH2/,icon:"img_histo2d",class:()=>Qt(()=>import("./TH2Painter-BLfyBVB5.js"),__vite__mapDeps([11,4,5,6,7,8])).then(n=>n.TH2Painter),opt:";COL;COLZ;COL0;COL1;COL0Z;COL1Z;COLA;COL_POL;COL_ARR;BOX;BOX1;PROJ;PROJX1;PROJX2;PROJX3;PROJY1;PROJY2;PROJY3;PROJXY1;PROJXY2;PROJXY3;SCAT;TEXT;TEXTE;TEXTE0;CANDLE;CANDLE1;CANDLE2;CANDLE3;CANDLE4;CANDLE5;CANDLE6;CANDLEY1;CANDLEY2;CANDLEY3;CANDLEY4;CANDLEY5;CANDLEY6;VIOLIN;VIOLIN1;VIOLIN2;VIOLINY1;VIOLINY2;CONT;CONT1;CONT2;CONT3;CONT4;ARR;CHORD;SURF;SURF1;SURF2;SURF4;SURF6;E;A;LEGO;LEGO0;LEGO1;LEGO2;LEGO3;LEGO4;same",ctrl:"lego",expand_item:kp,for_derived:!0},{name:V2,sameas:eh,opt2:";projxyb;projxyc=e;projxyw"},{name:/^TH3/,icon:"img_histo3d",class:()=>Qt(()=>import("./TH3Painter-DLCndhZ0.js"),__vite__mapDeps([12,6,7,4,5,8,10])).then(n=>n.TH3Painter),opt:";SCAT;BOX;BOX2;BOX3;GLBOX1;GLBOX2;GLCOL",expand_item:kp,for_derived:!0},{name:G2,sameas:ih},{name:jd,icon:"img_histo1d",class:()=>Qt(()=>import("./THStackPainter-B3TUpsVt.js"),__vite__mapDeps([18,9,6,7,10,8,3,4,5,11])).then(n=>n.THStackPainter),expand_item:"fHists",opt:"NOSTACK;HIST;COL;LEGO;E;PFC;PLC;PADS"},{name:$o,icon:"img_histo3d",draw:()=>Qt(()=>import("./draw3d-BPJMZpwL.js"),__vite__mapDeps([19,15])).then(n=>n.drawPolyMarker3D),direct:!0,frame:"3d"},{name:$1,icon:"img_graph",draw:()=>Qt(()=>import("./draw3d-BPJMZpwL.js"),__vite__mapDeps([19,15])).then(n=>n.drawPolyLine3D),direct:!0,frame:"3d"},{name:"TGraphStruct"},{name:"TGraphNode"},{name:"TGraphEdge"},{name:O2,icon:"img_graph",class:()=>Qt(()=>import("./TGraphTimePainter-D_1RHDMz.js"),__vite__mapDeps([20,9,6,7,10])).then(n=>n.TGraphTimePainter),opt:"once;repeat;first",theonly:!0},{name:$A,icon:"img_graph",class:()=>Qt(()=>import("./TGraph2DPainter-aeM0xqgu.js"),__vite__mapDeps([21,11,4,5,6,7,8])).then(n=>n.TGraph2DPainter),opt:";P;PCOL",theonly:!0},{name:q4,sameas:$A,opt:";P;PCOL;ERR",theonly:!0},{name:V4,sameas:$A,opt:";P;PCOL;ERR",theonly:!0},{name:V1,icon:"img_graph",class:()=>Qt(()=>import("./TGraphPolarPainter-bMuBuvEZ.js"),__vite__mapDeps([22,7])).then(n=>n.TGraphPolargramPainter),theonly:!0},{name:G4,icon:"img_graph",class:()=>Qt(()=>import("./TGraphPolarPainter-bMuBuvEZ.js"),__vite__mapDeps([22,7])).then(n=>n.TGraphPolarPainter),opt:";F;L;P;PE",theonly:!0},{name:/^TGraph/,icon:"img_graph",class:()=>Qt(()=>import("./TGraphPainter-DLkx_1ES.js"),__vite__mapDeps([14,6,7,9,10])).then(n=>n.TGraphPainter),opt:";L;P"},{name:"TEfficiency",icon:"img_graph",class:()=>Qt(()=>import("./TEfficiencyPainter-TxRejkVD.js"),__vite__mapDeps([23,14,6,7,9,10,24,3,4,5,8,11])).then(n=>n.TEfficiencyPainter),opt:";AP;A4P;B"},{name:I2,sameas:Ma},{name:/^RooHist/,sameas:Ma},{name:/^RooCurve/,sameas:Ma},{name:/^RooEllipse/,sameas:Ma},{name:"TScatter",icon:"img_graph",class:()=>Qt(()=>import("./TScatterPainter-CvLCMGW2.js"),__vite__mapDeps([25,14,6,7,9,10,8])).then(n=>n.TScatterPainter),opt:";A"},{name:"RooPlot",icon:"img_canvas",draw:()=>Qt(()=>import("./TGraphTimePainter-D_1RHDMz.js"),__vite__mapDeps([20,9,6,7,10])).then(n=>n.drawRooPlot)},{name:"TRatioPlot",icon:"img_mgraph",class:()=>Qt(()=>import("./TRatioPlotPainter-BvUop_Na.js"),__vite__mapDeps([26,27])).then(n=>n.TRatioPlotPainter),opt:""},{name:Xd,icon:"img_mgraph",class:()=>Qt(()=>import("./TMultiGraphPainter-BQyL8zWX.js"),__vite__mapDeps([28,6,7,9,10,14,11,4,5,8,13,3])).then(n=>n.TMultiGraphPainter),opt:";ac;l;p;3d;pads",expand_item:"fGraphs"},{name:_g,icon:"img_question",draw:()=>Ll().then(n=>n.drawStreamerInfo)},{name:"TWebPainting",icon:"img_graph",class:()=>Qt(()=>import("./TWebPaintingPainter-CexNsDDp.js"),[]).then(n=>n.TWebPaintingPainter)},{name:V5,icon:"img_canvas",draw:()=>km().then(n=>n.drawTPadSnapshot)},{name:"TPadWebSnapshot",sameas:V5},{name:"kind:Text",icon:"img_text",func:pw},{name:ps,icon:"img_text",func:pw},{name:od,icon:"img_tf1",class:()=>Qt(()=>import("./TF1Painter-BuwSTmhs.js"),__vite__mapDeps([24,6,7,9,10])).then(n=>n.TF1Painter),opt:";L;C;FC;FL"},{name:W1,sameas:od},{name:j1,icon:"img_tf2",class:()=>Qt(()=>import("./TF2Painter-BTh6LWBk.js"),__vite__mapDeps([29,11,4,5,6,7,8,10,24,9])).then(n=>n.TF2Painter),opt:";BOX;ARR;SURF;SURF1;SURF2;SURF4;SURF6;LEGO;LEGO0;LEGO1;LEGO2;LEGO3;LEGO4;same"},{name:X1,icon:"img_histo3d",class:()=>Qt(()=>import("./TF3Painter-R5EVXlD4.js"),__vite__mapDeps([30,11,4,5,6,7,8,10,24,9])).then(n=>n.TF3Painter),opt:";SURF"},{name:q5,icon:"img_tf1",class:()=>Qt(()=>import("./TSplinePainter-DJPtQW6I.js"),__vite__mapDeps([31,3,4,5,6,7,8,9,10])).then(n=>n.TSplinePainter)},{name:"TSpline5",sameas:q5},{name:HA,icon:"img_graph",draw:()=>Ep().then(n=>n.drawEllipse),direct:!0},{name:"TArc",sameas:HA},{name:"TCrown",sameas:HA},{name:"TPie",icon:"img_graph",class:()=>Qt(()=>import("./TPiePainter-BaTIH6-e.js"),__vite__mapDeps([32,7])).then(n=>n.TPiePainter),opt:";3D"},{name:"TPieSlice",icon:"img_graph",dummy:!0},{name:"TExec",icon:"img_graph",dummy:!0},{name:Im,icon:"img_graph",class:()=>Qt(()=>import("./TLinePainter-RinEQkrM.js"),[]).then(n=>n.TLinePainter)},{name:"TArrow",icon:"img_graph",class:()=>Qt(()=>import("./TArrowPainter-Dspl2Ikh.js"),__vite__mapDeps([33,27])).then(n=>n.TArrowPainter)},{name:qc,icon:"img_graph",class:()=>Qt(()=>import("./TPolyLinePainter-7_jf8MLI.js"),[]).then(n=>n.TPolyLinePainter),opt:";F"},{name:"TCurlyLine",sameas:qc},{name:"TCurlyArc",sameas:qc},{name:"TParallelCoord",icon:"img_graph",dummy:!0},{name:ff,icon:"img_graph",class:()=>Qt(()=>import("./TGaxisPainter-BJuDLLel.js"),__vite__mapDeps([34,10])).then(n=>n.TGaxisPainter)},{name:Uc,icon:"img_graph",class:()=>Qt(()=>import("./TBoxPainter-BQEN4gj8.js"),[]).then(n=>n.TBoxPainter),opt:";L"},{name:"TWbox",sameas:Uc},{name:"TSliderBox",sameas:Uc},{name:U2,icon:"img_graph",draw:()=>Ep().then(n=>n.drawMarker),direct:!0},{name:"TPolyMarker",icon:"img_graph",draw:()=>Ep().then(n=>n.drawPolyMarker),direct:!0},{name:"TASImage",icon:"img_mgraph",class:()=>Qt(()=>import("./TASImagePainter-DRdiRLt1.js"),__vite__mapDeps([35,7])).then(n=>n.TASImagePainter),opt:";z"},{name:"TJSImage",icon:"img_mgraph",draw:()=>Ep().then(n=>n.drawJSImage),opt:";scale;center"},{name:Vi,icon:"img_histo3d",class:()=>Ec().then(n=>n.TGeoPainter),get_expand:()=>Ec().then(n=>n.expandGeoObject),opt:";more;all;count;projx;projz;wire;no_screen;dflt",ctrl:"dflt"},{name:"TEveGeoShapeExtract",sameas:Vi,opt:";more;all;count;projx;projz;wire;dflt"},{name:Ti+"REveGeoShapeExtract",sameas:Vi,opt:";more;all;count;projx;projz;wire;dflt"},{name:"TGeoOverlap",sameas:Vi,opt:";more;all;count;projx;projz;wire;dflt",dflt:"dflt",ctrl:"expand"},{name:"TGeoManager",sameas:Vi,opt:";more;all;count;projx;projz;wire;tracks;no_screen;dflt",dflt:"expand",pm:!0,ctrl:"dflt",noappend:!0,expand_after_draw:!0},{name:"TGeoVolumeAssembly",sameas:Vi,opt:";more;all;count"},{name:/^TGeo/,class:()=>Ec().then(n=>n.TGeoPainter),get_expand:()=>Ec().then(n=>n.expandGeoObject),opt:";more;all;axis;compa;count;projx;projz;wire;no_screen;dflt",dflt:"dflt",ctrl:"expand"},{name:"TAxis3D",icon:"img_graph",draw:()=>Ec().then(n=>n.drawAxis3D),direct:!0},{name:"kind:Command",icon:"img_execute",execute:!0},{name:"TFolder",icon:"img_folder",icon2:"img_folderopen",noinspect:!0,get_expand:()=>Ll().then(n=>n.folderHierarchy)},{name:"TTask",icon:"img_task",get_expand:()=>Ll().then(n=>n.taskHierarchy),for_derived:!0},{name:zc,icon:"img_tree",get_expand:()=>Qt(()=>Promise.resolve().then(()=>EH),void 0).then(n=>n.treeHierarchy),draw:()=>Cp().then(n=>n.drawTree),dflt:"expand",opt:"player;testio",shift:Li,pm:!0},{name:"TNtuple",sameas:zc},{name:"TNtupleD",sameas:zc},{name:C1,icon:"img_leaf_method",draw:()=>Cp().then(n=>n.drawTree),opt:";dump",noinspect:!0},{name:/^TBranch/,icon:"img_branch",draw:()=>Cp().then(n=>n.drawTree),dflt:"expand",opt:";dump",ctrl:"dump",shift:Li,ignore_online:!0,always_draw:!0},{name:/^TLeaf/,icon:"img_leaf",noexpand:!0,draw:()=>Cp().then(n=>n.drawTree),opt:";dump",ctrl:"dump",ignore_online:!0,always_draw:!0},{name:"ROOT::RNTuple",icon:"img_tree",get_expand:()=>Qt(()=>import("./rntuple-BCwqxNeP.js"),[]).then(n=>n.tupleHierarchy),draw:()=>Qt(()=>import("./RNTuple-L4uyxl3s.js"),__vite__mapDeps([36,2,3,4,5,6,7,8,9,10,11,12,13,14,15,37])).then(n=>n.drawRNTuple),dflt:"expand",pm:!0},{name:"ROOT::RNTupleField",icon:"img_leaf",draw:()=>Qt(()=>import("./RNTuple-L4uyxl3s.js"),__vite__mapDeps([36,2,3,4,5,6,7,8,9,10,11,12,13,14,15,37])).then(n=>n.drawRNTuple),opt:";dump",ctrl:"dump",shift:Li,ignore_online:!0,always_draw:!0},{name:Re,icon:"img_list",draw:()=>Ll().then(n=>n.drawList),get_expand:()=>Ll().then(n=>n.listHierarchy),dflt:"expand"},{name:th,sameas:Re},{name:sr,sameas:Re},{name:rd,sameas:Re},{name:Wd,sameas:Re},{name:ph,icon:"img_color"},{name:q1,icon:"img_file",noinspect:!0},{name:"TMemFile",icon:"img_file",noinspect:!0},{name:uf,icon:"img_question",noexpand:!0},{name:"Session",icon:"img_globe"},{name:"kind:TopFolder",icon:"img_base"},{name:"kind:Folder",icon:"img_folder",icon2:"img_folderopen",noinspect:!0},{name:Ti+"RCanvas",icon:"img_canvas",class:()=>bn().then(n=>n.RCanvasPainter),opt:"",expand_item:Pp},{name:Ti+"RCanvasDisplayItem",icon:"img_canvas",draw:()=>bn().then(n=>n.drawRPadSnapshot),opt:"",expand_item:Pp},{name:Ti+"RText",icon:"img_text",draw:()=>bn("more").then(n=>n.drawText),opt:"",direct:"v7",csstype:"text"},{name:Ti+"RFrameTitle",icon:"img_text",draw:()=>bn().then(n=>n.drawRFrameTitle),opt:"",direct:"v7",csstype:"title"},{name:Ti+"RPaletteDrawable",icon:"img_text",class:()=>bn("more").then(n=>n.RPalettePainter),opt:""},{name:Ti+"RLine",icon:"img_graph",draw:()=>bn("more").then(n=>n.drawLine),opt:"",direct:"v7",csstype:"line"},{name:Ti+"RBox",icon:"img_graph",draw:()=>bn("more").then(n=>n.drawBox),opt:"",direct:"v7",csstype:"box"},{name:Ti+"RMarker",icon:"img_graph",draw:()=>bn("more").then(n=>n.drawMarker),opt:"",direct:"v7",csstype:"marker"},{name:Ti+"RPave",icon:"img_pavetext",class:()=>bn("pave").then(n=>n.RPavePainter),opt:""},{name:Ti+"RLegend",icon:"img_graph",class:()=>bn("pave").then(n=>n.RLegendPainter),opt:""},{name:Ti+"RPaveText",icon:"img_pavetext",class:()=>bn("pave").then(n=>n.RPaveTextPainter),opt:""},{name:Ti+"RFrame",icon:"img_frame",draw:()=>bn().then(n=>n.drawRFrame),opt:""},{name:Ti+"RFont",icon:"img_text",draw:()=>bn().then(n=>n.drawRFont),opt:"",direct:"v7",csstype:"font"},{name:Ti+"RAxisDrawable",icon:"img_frame",draw:()=>bn().then(n=>n.drawRAxis),opt:""},{name:Ti+"RTreeMapPainter",class:()=>Qt(()=>import("./RTreeMapPainter-B2r2zCJG.js"),[]).then(n=>n.RTreeMapPainter),opt:""}],cache:{}};function Od(n){return _l.lst.push(n),n}function ui(n,t){if(!Pt(n))return null;t===""&&(t=null);let e=null;if(t===null&&n in _l.cache)return _l.cache[n];const i=Aa(n)||`kind:${n}`;let r=0;for(let s=0;s<_l.lst.length;++s){const a=_l.lst[s];if(Pt(a.name)){if(a.name!==i)continue}else if(!i.match(a.name))continue;if(a.sameas){const o=ui(Ee(a.sameas),t);if(o){for(const h in o)a[h]===void 0&&(a[h]=o[h]);delete a.sameas}return a}if(t==null)return n in _l.cache||(_l.cache[n]=a),a;if(Pt(t)){if(e||(e=a),t==="::expand"){if("expand"in a||"expand_item"in a)return a}else if("opt"in a){const o=a.opt.split(";");for(let h=0;h<o.length;++h)if(o[h].toLowerCase()===t.toLowerCase())return a}}else if(t===r)return a;++r}return e}function af(n){return Pt(n)&&(n=ui(n)),se(n)?n.func||n.class||n.draw||n.draw_field||n.opt==="inspect":!1}function Bc(n,t){const e={opts:null,inspect:!1,expand:!1,draw:!1,handle:null};if(!Pt(n))return e;let i=!1,r=!1,s=!1;Pt(t)||(t="");for(let a=0;a<1e3;++a){const o=ui(n,a);if(!o||(e.handle||(e.handle=o),o.noinspect&&(r=!0),o.noappend&&(e.noappend=!0),(o.expand||o.get_expand||o.expand_item||o.can_expand)&&(s=!0),!o.func&&!o.class&&!o.draw))break;if(i=!0,o.opt===void 0)continue;let h=o.opt;Pt(o.opt2)&&(h+=o.opt2);const l=h.split(";");for(let c=0;c<l.length;++c)l[c]=l[c].toLowerCase(),!(l[c].indexOf("same")===0&&(e.has_same=!0,t.indexOf("nosame")>=0))&&(e.opts===null&&(e.opts=[]),e.opts.indexOf(l[c])<0&&e.opts.push(l[c]));if(o.theonly)break}return t.indexOf("noinspect")>=0&&(r=!0),i&&e.opts===null&&(e.opts=[""]),!i&&Aa(n)&&!r&&(e.opts=[]),!r&&e.opts&&e.opts.push(Li),e.inspect=!r,e.expand=s,e.draw=!!e.opts,e}function j8(n,t){if(n)if(t===void 0&&Pt(n)&&n.indexOf(":")>0)t.split(";").forEach(e=>{const i=e.split(":");i.length>=1&&j8(i[0],i[1]||"")});else{const e=ui(Ee(n),0);e&&(e.dflt=t)}}async function Xa(n,t,e){if(!se(t))return Promise.reject(Error("not an object in draw call"));if(Pt(e)&&e.indexOf(Li)===0)return Ll().then(o=>o.drawInspector(n,t,e));let i,r;if("_typename"in t)r="type "+t._typename,i=ui(Ee(t._typename),e);else if("_kind"in t)r="kind "+t._kind,i=ui(t._kind,e);else return Ll().then(o=>o.drawInspector(n,t,e));if(!i)return Promise.reject(Error(`Object of ${r} cannot be shown with draw`));if(i.dummy)return null;if(i.draw_field&&t[i.draw_field])return Xa(n,t[i.draw_field],e||i.draw_field_opt);if(!af(i)){if(e&&e.indexOf("same")>=0){const o=um(n);if(lt(o?.performDrop))return o.performDrop(t,"",null,e)}return Promise.reject(Error(`Function not specified to draw object ${r}`))}function s(){let o,h;return i.direct==="v7"?o=Qt(()=>import("./RCanvasPainter-DQGWienR.js"),[]).then(l=>(h=new l.RObjectPainter(n,t,e,i.csstype),h.redraw=i.func,l.ensureRCanvas(h,i.frame||!1))).then(()=>h.redraw()):i.direct?(h=new Vn(n,t,e),h.redraw=i.func,o=km().then(l=>l.ensureTCanvas(h,i.frame||!1)).then(()=>h.redraw())):o=Go(i.func(n,t,e)),o.then(l=>{if(h||(h=l),h===!1)return null;if(!h)throw Error(`Fail to draw object ${r}`);return se(h)&&!h.options&&(h.options={original:e||""}),h})}if(lt(i.func))return s();let a;if(lt(i.class))a=i.class().then(o=>{i.func=o.draw});else if(lt(i.draw))a=i.draw().then(o=>{i.func=o});else{if(!i.func||!Pt(i.func))return Promise.reject(Error(`Draw function or class not specified to draw ${r}`));{let o=ts(i.func);if(lt(o))return i.func=o,s();let h=null;if(Pt(i.script)&&(i.script.indexOf("modules:")===0?h=i.script.slice(8):i.script.indexOf(".mjs")>0&&(h=i.script)),!h&&!i.prereq&&!i.script)return Promise.reject(Error(`Prerequicities to load ${i.func} are not specified`));let l=Promise.resolve(!0);h?l=Hd(h):Kt.ignore_v6||(l=cf().then(c=>(i.prereq?c.require(i.prereq):Promise.resolve(!0)).then(()=>{if(i.script)return Cr(i.script)}).then(()=>c._complete_loading()))),a=l.then(()=>{if(o=ts(i.func),!lt(o))return Promise.reject(Error(`Fail to find function ${i.func} after loading ${i.prereq||i.script}`));i.func=o})}}return a.then(()=>s())}async function v2(n,t,e){if(!se(t))return Promise.reject(Error("not an object in redraw"));const i=bl(n);let r,s=null,a;if(t._typename&&(r=ui(Ee(t._typename))),r?.draw_field&&t[r.draw_field]&&(t=t[r.draw_field]),i)i.matchObjectType(t._typename)?(a=i.redrawObject(t,e),a&&(s=i)):i.forEachPainterInPad(o=>{!s&&o.matchObjectType(t._typename)&&(a=o.redrawObject(t,e),a&&(s=o))},"objects");else{const o=new Of(n).getTopPainter();lt(o?.redrawObject)&&(a=o.redrawObject(t,e),a&&(s=o))}return s?Go(a).then(()=>s):(pr(n),Xa(n,t,e))}async function FQ(n,t){if(!se(n)||!n?._typename)return Promise.reject(Error("not an object in build3d"));const e=ui(Ee(n._typename));return!e?.class&&!e.build3d?Promise.reject(Error(`not able to create three.js for ${n._typename}`)):e.build3d?e.build3d().then(i=>i(n,t)):e.class().then(i=>lt(i?.build3d)?i.build3d(n,t):Promise.reject(Error(`painter class for ${n._typename} does not implement build3d method`)))}function DY(n){if(!n)return;const t=[Pe,ri,nd,"TCollection",fn,wr,ws,ya];function e(i,r){const s=i.fElements?.arr[0];if(s?.fTypeName!==jo||r>4||t.indexOf(s.fName)>=0)return null;let a=ui(Ee(s.fName));if(a&&!a.for_derived&&(a=null),a===null){for(let o=0;o<n.arr.length;++o)if(n.arr[o].fName===s.fName){a=e(n.arr[o],r+1);break}}return a?.for_derived?a:null}n.arr.forEach(i=>{if(ui(Ee(i.fName))!==null)return;const r=e(i,0);if(r){const s=Object.assign({},r);delete s.for_derived,s.name=i.fName,Od(s)}})}async function X8(n){if(n||(n={}),!se(n.object))return Promise.reject(Error("No object specified to generate SVG"));n.format||(n.format="svg"),n.width||(n.width=tt.CanvasWidth),n.height||(n.height=tt.CanvasHeight);async function t(e){e.attr("width",n.width).attr("height",n.height).style("width",n.width+"px").style("height",n.height+"px").property("_batch_use_canvsize",n.use_canvas_size??!1).property("_batch_mode",!0).property("_batch_format",n.format!=="svg"?n.format:null);function i(r){return pr(e.node()),e.remove(),r}return Xa(e.node(),n.object,n.option||"").then(()=>{if(n.format!=="svg"){const h=e.select("svg").selectChild("image");if(!h.empty()){const l=h.attr("href");if(n.as_buffer){const c=l.indexOf("base64,"),f=Vd(l.slice(c+7)),d=new ArrayBuffer(f.length),u=new Uint8Array(d);for(let p=0;p<f.length;p++)u[p]=f.charCodeAt(p);return Se()?Buffer.from(d):d}return l}}const r=e.select("svg"),s=r.style("filter");r.attr("xmlns",lr).attr("style",null).attr("class",null).attr("x",null).attr("y",null),!r.attr("width")&&!r.attr("height")&&r.attr("width",n.width).attr("height",n.height),s&&r.style("filter",s);function a(){const h=Ct(this);h.style("display")==="none"&&h.remove()}e.selectAll("g.root_frame").each(a),e.selectAll("svg").each(a);let o;if(n.format==="pdf")o={node:r.node(),width:n.width,height:n.height,can_modify:!0};else if(o=n1(e.html()),n.format==="svg")return i(o);return mv(o,n.format,n).then(i)})}return Se()?pv().then(e=>t(e.body.append("div"))):t(Ct("body").append("div").style("display","none"))}async function FY(n){return n||(n={}),n.format="svg",X8(n)}function Y8(n){n.prototype.drawObject=Xa,n.prototype.getObjectDrawSettings=Bc}Y8(Fs);Ec=async function(){return Qt(()=>Promise.resolve().then(()=>J$),void 0).then(n=>{const t=ui(Ee("TGeoVolumeAssembly"));return t&&(t.icon="img_geoassembly"),n})};bn=async function(n){return Qt(()=>import("./RCanvasPainter-DQGWienR.js"),[]).then(t=>{switch(Y8(t.RPadPainter),n){case"more":return Qt(()=>import("./v7more-H3D-KQGQ.js"),__vite__mapDeps([38,39]));case"pave":return Qt(()=>import("./RPavePainter-CQHUOnSn.js"),__vite__mapDeps([40,39]))}return t})};Object.assign(Kt,{addStreamerInfosForPainter:DY,addDrawFunc:Od,setDefaultDrawOpt:j8,makePDF:RY});Object.assign(Kt.jsroot,{draw:Xa,redraw:v2,makeSVG:FY,makeImage:X8,addDrawFunc:Od});const la="TopFolder",Nl="expand",bu="plusminus",WA="__default_draw_option__",vo="h_value_num",vl="h_button",F1="h_item",Cc="h_tree";function IY(n){function t(s,a,o,h){return`.jsroot .img_${s} { display: inline-block; height: ${a}px; width: ${a}px; background-image: url("data:image/${o};base64,${h}"); }`}const e=tt.DarkMode?"black":"#E6E6FA",i=tt.DarkMode?"green":"black",r=tt.DarkMode?"#555":"#aaa";$v(`
|
|
4493
|
+
`).concat(v)),[3,7];case 7:return[2]}})})},t.prototype.getBoundingBoxCore=function(e){return s0(this.element,e)},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.prototype.isVisible=function(e,i){return Za(this,e,i)},t.fetchImageData=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o;return Ke(this,function(h){switch(h.label){case 0:if(s=e.match(vY),!s)return[3,1];if(a=s[2],o=a.split("/"),o[0]!=="image")throw new Error("Unsupported image URL: ".concat(e));return r=o[1],i=s[5],s[4]==="base64"?(i=i.replace(/\s/g,""),i=atob(i)):i=decodeURIComponent(i),[3,3];case 1:return[4,t.fetchImage(e)];case 2:i=h.sent(),r=e.substring(e.lastIndexOf(".")+1),h.label=3;case 3:return[2,{data:i,format:r}]}})})},t.fetchImage=function(e){return new Promise(function(i,r){var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer",s.onload=function(){if(s.status!==200)throw new Error("Error ".concat(s.status,": Failed to load image '").concat(e,"'"));for(var a=new Uint8Array(s.response),o="",h=0;h<a.length;h++)o+=String.fromCharCode(a[h]);i(o)},s.onerror=r,s.onabort=r,s.send(null)})},t.getMimeType=function(e){switch(e=e.toLowerCase(),e){case"jpg":case"jpeg":return"image/jpeg";default:return"image/".concat(e)}},t.getImageDimensions=function(e){return new Promise(function(i,r){var s=new Image;s.onload=function(){i([s.width,s.height])},s.onerror=r,s.src=e})},t})(Lg),G8=(function(n){Ze(t,n);function t(e,i,r){var s=n.call(this,!0,i,r)||this;return s.closed=e,s}return t.prototype.getPath=function(e){if(!this.element.hasAttribute("points")||this.element.getAttribute("points")==="")return null;var i=t.parsePointsString(this.element.getAttribute("points")),r=new Nf;if(i.length<1)return r;r.moveTo(i[0][0],i[0][1]);for(var s=1;s<i.length;s++)r.lineTo(i[s][0],i[s][1]);return this.closed&&r.close(),r},t.prototype.isVisible=function(e,i){return Za(this,e,i)},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.parsePointsString=function(e){for(var i=Rr(e),r=[],s=0;s<i.length-1;s+=2){var a=i[s],o=i[s+1];r.push([a,o])}return r},t})(l0),wY=(function(n){Ze(t,n);function t(e,i){return n.call(this,!0,e,i)||this}return t})(G8),SY=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.render=function(e){return Promise.resolve()},t.prototype.getBoundingBoxCore=function(e){return[0,0,0,0]},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t.prototype.isVisible=function(e,i){return Za(this,e,i)},t})(Tb),MY=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.apply=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o,h,l;return Ke(this,function(c){switch(c.label){case 0:i=this.computeNodeTransform(e),r=this.getBoundingBox(e),e.pdf.beginFormObject(r[0],r[1],r[2],r[3],i),s=Lf.getContextColors(e),a=new Qo(e.pdf,{refsHandler:e.refsHandler,styleSheets:e.styleSheets,viewport:e.viewport,svg2pdfParameters:e.svg2pdfParameters,textMeasure:e.textMeasure,attributeState:Object.assign(Lf.default(),s)}),nY(a),o=0,h=this.children,c.label=1;case 1:return o<h.length?(l=h[o],[4,l.render(a)]):[3,4];case 2:c.sent(),c.label=3;case 3:return o++,[3,1];case 4:return e.pdf.endFormObject(a.refsHandler.generateKey(this.element.getAttribute("id"),s)),[2]}})})},t.prototype.getBoundingBoxCore=function(e){var i=this.element.getAttribute("viewBox"),r;return i&&(r=Rr(i)),[r&&r[0]||0,r&&r[1]||0,r&&r[2]||parseFloat(this.element.getAttribute("markerWidth")||"3"),r&&r[3]||parseFloat(this.element.getAttribute("markerHeight")||"3")]},t.prototype.computeNodeTransformCore=function(e){var i=parseFloat(this.element.getAttribute("refX")||"0"),r=parseFloat(this.element.getAttribute("refY")||"0"),s=this.element.getAttribute("viewBox"),a;if(s){var o=Rr(s);a=a0(this.element,o,0,0,parseFloat(this.element.getAttribute("markerWidth")||"3"),parseFloat(this.element.getAttribute("markerHeight")||"3"),e,!0),a=e.pdf.matrixMult(e.pdf.Matrix(1,0,0,1,-i,-r),a)}else a=e.pdf.Matrix(1,0,0,1,-i,-r);return a},t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t})(o0),TY=(function(n){Ze(t,n);function t(e,i){return n.call(this,e,i)||this}return t.prototype.getR=function(e){var i;return(i=this.r)!==null&&i!==void 0?i:this.r=parseFloat(Vt(this.element,e.styleSheets,"r")||"0")},t.prototype.getRx=function(e){return this.getR(e)},t.prototype.getRy=function(e){return this.getR(e)},t})(O8),EY=(function(n){Ze(t,n);function t(e,i){return n.call(this,!1,e,i)||this}return t})(G8),$8=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.renderCore=function(e){return Qe(this,void 0,void 0,function(){var i,r,s;return Ke(this,function(a){switch(a.label){case 0:i=0,r=this.children,a.label=1;case 1:return i<r.length?(s=r[i],[4,s.render(e)]):[3,4];case 2:a.sent(),a.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},t.prototype.getBoundingBoxCore=function(e){return Mb(e,this)},t})(F8),CY=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t.prototype.render=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o;return Ke(this,function(h){switch(h.label){case 0:return this.isVisible(e.attributeState.visibility!=="hidden",e)?(i=this.getX(e),r=this.getY(e),s=this.getWidth(e),a=this.getHeight(e),e.pdf.saveGraphicsState(),o=e.transform,this.element.hasAttribute("transform")&&(o=e.pdf.matrixMult(kg(this.element.getAttribute("transform"),e),o)),e.pdf.setCurrentTransformationMatrix(o),!e.withinUse&&Vt(this.element,e.styleSheets,"overflow")!=="visible"&&e.pdf.rect(i,r,s,a).clip().discardPath(),[4,n.prototype.render.call(this,e.clone({transform:e.pdf.unitMatrix,viewport:e.withinUse?e.viewport:new Ng(s,a)}))]):[2];case 1:return h.sent(),e.pdf.restoreGraphicsState(),[2]}})})},t.prototype.computeNodeTransform=function(e){return this.computeNodeTransformCore(e)},t.prototype.computeNodeTransformCore=function(e){if(e.withinUse)return e.pdf.unitMatrix;var i=this.getX(e),r=this.getY(e),s=this.getViewBox(),a;if(s){var o=this.getWidth(e),h=this.getHeight(e);a=a0(this.element,s,i,r,o,h,e)}else a=e.pdf.Matrix(1,0,0,1,i,r);return a},t.prototype.getWidth=function(e){if(this.width!==void 0)return this.width;var i,r=e.svg2pdfParameters;if(this.isOutermostSvg(e))if(r.width!=null)i=r.width;else{var s=Vt(this.element,e.styleSheets,"width");if(s)i=parseFloat(s);else{var a=this.getViewBox();if(a&&(r.height!=null||Vt(this.element,e.styleSheets,"height"))){var o=a[2]/a[3];i=this.getHeight(e)*o}else i=Math.min(300,e.viewport.width,e.viewport.height*2)}}else{var s=Vt(this.element,e.styleSheets,"width");i=s?parseFloat(s):e.viewport.width}return this.width=i},t.prototype.getHeight=function(e){if(this.height!==void 0)return this.height;var i,r=e.svg2pdfParameters;if(this.isOutermostSvg(e))if(r.height!=null)i=r.height;else{var s=Vt(this.element,e.styleSheets,"height");if(s)i=parseFloat(s);else{var a=this.getViewBox();if(a){var o=a[2]/a[3];i=this.getWidth(e)/o}else i=Math.min(150,e.viewport.width/2,e.viewport.height)}}else{var s=Vt(this.element,e.styleSheets,"height");i=s?parseFloat(s):e.viewport.height}return this.height=i},t.prototype.getX=function(e){if(this.x!==void 0)return this.x;if(this.isOutermostSvg(e))return this.x=0;var i=Vt(this.element,e.styleSheets,"x");return this.x=i?parseFloat(i):0},t.prototype.getY=function(e){if(this.y!==void 0)return this.y;if(this.isOutermostSvg(e))return this.y=0;var i=Vt(this.element,e.styleSheets,"y");return this.y=i?parseFloat(i):0},t.prototype.getViewBox=function(){if(this.viewBox!==void 0)return this.viewBox;var e=this.element.getAttribute("viewBox");return this.viewBox=e?Rr(e):void 0},t.prototype.isOutermostSvg=function(e){return e.svg2pdfParameters.element===this.element},t})($8),H8=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t.prototype.computeNodeTransformCore=function(e){return e.pdf.unitMatrix},t})($8),PY=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.renderCore=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a;return Ke(this,function(o){switch(o.label){case 0:return[4,n.prototype.renderCore.call(this,e)];case 1:return o.sent(),i=Vt(this.element,e.styleSheets,"href"),i&&(r=this.getBoundingBox(e),s=e.pdf.internal.scaleFactor,a=e.pdf.internal.pageSize.getHeight(),e.pdf.link(s*(r[0]*e.transform.sx+e.transform.tx),s*(a-r[1]*e.transform.sy-e.transform.ty),s*e.transform.sx*r[2],s*e.transform.sy*r[3],{url:i})),[2]}})})},t})(H8),kY=(function(n){Ze(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.apply=function(e){return Qe(this,void 0,void 0,function(){var i,r,s,a,o,h;return Ke(this,function(l){switch(l.label){case 0:if(!this.isVisible(!0,e))return[2];i=e.pdf.matrixMult(this.computeNodeTransform(e),e.transform),e.pdf.setCurrentTransformationMatrix(i),r=0,s=this.children,l.label=1;case 1:return r<s.length?(a=s[r],[4,a.render(new Qo(e.pdf,{refsHandler:e.refsHandler,styleSheets:e.styleSheets,viewport:e.viewport,withinClipPath:!0,svg2pdfParameters:e.svg2pdfParameters,textMeasure:e.textMeasure}))]):[3,4];case 2:l.sent(),l.label=3;case 3:return r++,[3,1];case 4:return o=this.children.length>0&&!!Vt(this.children[0].element,e.styleSheets,"clip-rule"),h=o?this.getClipRuleAttr(this.children[0].element,e.styleSheets):this.getClipRuleAttr(this.element,e.styleSheets),e.pdf.clip(h).discardPath(),e.pdf.setCurrentTransformationMatrix(i.inversed()),[2]}})})},t.prototype.getBoundingBoxCore=function(e){return Mb(e,this)},t.prototype.isVisible=function(e,i){return Ko(this,e,i)},t.prototype.getClipRuleAttr=function(e,i){return Vt(e,i,"clip-rule")==="evenodd"?"evenodd":void 0},t})(o0);function Pb(n,t){var e,i=[];switch(HX(n,function(s,a){return i.push(Pb(a,t))}),n.tagName.toLowerCase()){case"a":e=new PY(n,i);break;case"g":e=new H8(n,i);break;case"circle":e=new TY(n,i);break;case"clippath":e=new kY(n,i);break;case"ellipse":e=new oY(n,i);break;case"lineargradient":e=new k8(n,i);break;case"image":e=new bY(n,i);break;case"line":e=new rY(n,i);break;case"marker":e=new MY(n,i);break;case"path":e=new _Y(n,i);break;case"pattern":e=new N8(n,i);break;case"polygon":e=new wY(n,i);break;case"polyline":e=new EY(n,i);break;case"radialgradient":e=new L8(n,i);break;case"rect":e=new aY(n,i);break;case"svg":e=new CY(n,i);break;case"symbol":e=new I8(n,i);break;case"text":e=new fY(n,i);break;case"use":e=new sY(n,i);break;default:e=new SY(n,i);break}if(t!=null&&e.element.hasAttribute("id")){var r=e.element.id;t[r]=t[r]||e}return e.children.forEach(function(s){return s.setParent(e)}),e}var LY=(function(){function n(t,e){this.rootSvg=t,this.loadExternalSheets=e,this.styleSheets=[]}return n.prototype.load=function(){return Qe(this,void 0,void 0,function(){var t;return Ke(this,function(e){switch(e.label){case 0:return[4,this.collectStyleSheetTexts()];case 1:return t=e.sent(),this.parseCssSheets(t),[2]}})})},n.prototype.collectStyleSheetTexts=function(){return Qe(this,void 0,void 0,function(){var t,r,e,i,r,s;return Ke(this,function(a){switch(a.label){case 0:if(t=[],this.loadExternalSheets&&this.rootSvg.ownerDocument)for(r=0;r<this.rootSvg.ownerDocument.childNodes.length;r++)e=this.rootSvg.ownerDocument.childNodes[r],e.nodeName==="xml-stylesheet"&&typeof e.data=="string"&&t.push(n.loadSheet(e.data.match(/href=["'].*?["']/)[0].split("=")[1].slice(1,-1)));for(i=this.rootSvg.querySelectorAll("style,link"),r=0;r<i.length;r++)s=i[r],Yo(s,"style")?t.push(s.textContent):this.loadExternalSheets&&Yo(s,"link")&&s.getAttribute("rel")==="stylesheet"&&s.hasAttribute("href")&&t.push(n.loadSheet(s.getAttribute("href")));return[4,Promise.all(t)];case 1:return[2,a.sent().filter(function(o){return o!==null})]}})})},n.prototype.parseCssSheets=function(t){for(var e=document.implementation.createHTMLDocument(""),i=0,r=t;i<r.length;i++){var s=r[i],a=e.createElement("style");a.textContent=s,e.body.appendChild(a);var o=a.sheet;if(o instanceof CSSStyleSheet){for(var h=o.cssRules.length-1;h>=0;h--){var l=o.cssRules[h];if(!(l instanceof CSSStyleRule)){o.deleteRule(h);continue}var c=l;if(c.selectorText.indexOf(",")>=0){o.deleteRule(h);for(var f=c.cssText.substring(c.selectorText.length),d=n.splitSelectorAtCommas(c.selectorText),u=0;u<d.length;u++)o.insertRule(d[u]+f,h+u)}}this.styleSheets.push(o)}}},n.splitSelectorAtCommas=function(t){for(var e=/,|["']/g,i=/[^\\]["]/g,r=/[^\\][']/g,s=[],a="initial",o,h=-1,l=i,c=0;c<t.length;)switch(a){case"initial":e.lastIndex=c,o=e.exec(t),o?(o[0]===","?(s.push(t.substring(h+1,e.lastIndex-1).trim()),h=e.lastIndex-1):(a="withinQuotes",l=o[0]==='"'?i:r),c=e.lastIndex):(s.push(t.substring(h+1).trim()),c=t.length);break;case"withinQuotes":l.lastIndex=c,o=l.exec(t),o&&(c=l.lastIndex,a="initial");break}return s},n.loadSheet=function(t){return new Promise(function(e,i){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="text",r.onload=function(){r.status!==200&&i(new Error("Error ".concat(r.status,": Failed to load '").concat(t,"'"))),e(r.responseText)},r.onerror=i,r.onabort=i,r.send(null)}).catch(function(){return null})},n.prototype.getPropertyValue=function(t,e){for(var i=[],r=0,s=this.styleSheets;r<s.length;r++)for(var a=s[r],o=0;o<a.cssRules.length;o++){var h=a.cssRules[o];h.style.getPropertyValue(e)&&t.matches(h.selectorText)&&i.push(h)}if(i.length!==0){var l=function(f,d){var u=f.style.getPropertyPriority(e),p=d.style.getPropertyPriority(e);return u!==p?u==="important"?1:-1:0},c=i.reduce(function(f,d){return l(f,d)===1?f:d});return c.style.getPropertyValue(e)||void 0}},n})(),NY=(function(){function n(){this.measureMethods={}}return n.prototype.getTextOffset=function(t,e){var i=e.textAnchor;if(i==="start")return 0;var r=this.measureTextWidth(t,e),s=0;switch(i){case"end":s=r;break;case"middle":s=r/2;break}return s},n.prototype.measureTextWidth=function(t,e){if(t.length===0)return 0;var i=e.fontFamily,r=this.getMeasureFunction(i);return r.call(this,t,e.fontFamily,e.fontSize+"px",e.fontStyle,e.fontWeight)},n.prototype.getMeasurementTextNode=function(){if(!this.textMeasuringTextElement){this.textMeasuringTextElement=document.createElementNS(k5,"text");var t=document.createElementNS(k5,"svg");t.appendChild(this.textMeasuringTextElement),t.style.setProperty("position","absolute"),t.style.setProperty("visibility","hidden"),document.body.appendChild(t)}return this.textMeasuringTextElement},n.prototype.canvasTextMeasure=function(t,e,i,r,s){var a=document.createElement("canvas"),o=a.getContext("2d");return o!=null?(o.font=[r,s,i,e].join(" "),o.measureText(t).width):0},n.prototype.svgTextMeasure=function(t,e,i,r,s,a){a===void 0&&(a=this.getMeasurementTextNode());var o=a;return o.setAttribute("font-family",e),o.setAttribute("font-size",i),o.setAttribute("font-style",r),o.setAttribute("font-weight",s),o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.textContent=t,o.getBBox().width},n.prototype.getMeasureFunction=function(t){var e=this.measureMethods[t];if(!e){var i="16px",r="normal",s="normal",a=this.canvasTextMeasure(n.testString,t,i,r,s),o=this.svgTextMeasure(n.testString,t,i,r,s);e=Math.abs(a-o)<n.epsilon?this.canvasTextMeasure:this.svgTextMeasure,this.measureMethods[t]=e}return e},n.prototype.cleanupTextMeasuring=function(){if(this.textMeasuringTextElement){var t=this.textMeasuringTextElement.parentNode;t&&document.body.removeChild(t),this.textMeasuringTextElement=void 0}},n.testString=`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789!"$%&/()=?'\\+*-_.:,;^}][{#~|<>`,n.epsilon=.1,n})();function W8(n,t){return Qe(this,arguments,void 0,function(e,i,r){var s,a,o,h,l,c,f,d,u,p,m,g,y,A,_;return r===void 0&&(r={}),Ke(this,function(x){switch(x.label){case 0:return s=(y=r.x)!==null&&y!==void 0?y:0,a=(A=r.y)!==null&&A!==void 0?A:0,o=(_=r.loadExternalStyleSheets)!==null&&_!==void 0?_:!1,h={},l=new M8(h),c=new LY(e,o),[4,c.load()];case 1:return x.sent(),f=new Ng(i.internal.pageSize.getWidth(),i.internal.pageSize.getHeight()),d=D1(D1({},r),{element:e}),u=new NY,p=new Qo(i,{refsHandler:l,styleSheets:c,viewport:f,svg2pdfParameters:d,textMeasure:u}),i.advancedAPI(),i.saveGraphicsState(),i.setCurrentTransformationMatrix(i.Matrix(1,0,0,1,s,a)),i.setLineWidth(p.attributeState.strokeWidth),m=p.attributeState.fill.color,i.setFillColor(m.r,m.g,m.b),i.setFont(p.attributeState.fontFamily),i.setFontSize(p.attributeState.fontSize*i.internal.scaleFactor),g=Pb(e,h),[4,g.render(p)];case 2:return x.sent(),i.restoreGraphicsState(),i.compatAPI(),p.textMeasure.cleanupTextMeasuring(),[2,i]}})})}de.API.svg=function(n,t){return t===void 0&&(t={}),W8(n,this,t)};async function RY(n,t){const e=Se();let i=!1;const r=[],s=[],a=[],o=[],h=[],l=[],c=n.node.getAttribute("transform"),f={};n.reset_tranform&&n.node.removeAttribute("transform"),Ct(n.node).selectAll("g").each(function(){if(this.hasAttribute("font-family")){const m=this.getAttribute("font-family");m===ko&&(this.setAttribute("font-family","courier"),n.can_modify||r.push(this)),m===Mn&&(this.setAttribute("font-family","symbol"),n.can_modify||s.push(this)),m===Hl&&(this.setAttribute("font-family","zapfdingbats"),n.can_modify||a.push(this)),(m===Po||m===ko)&&this.getAttribute("font-weight")==="bold"&&this.getAttribute("font-style")==="oblique"?(this.setAttribute("font-style","italic"),n.can_modify||h.push(this)):m===ko&&this.getAttribute("font-style")==="oblique"&&(this.setAttribute("font-style","italic"),n.can_modify||h.push(this))}}),Ct(n.node).selectAll("text").each(function(){this.hasAttribute("dominant-baseline")?(this.setAttribute("dy",".2em"),this.removeAttribute("dominant-baseline"),n.can_modify||o.push(this)):n.can_modify&&e&&this.getAttribute("dy")===".4em"&&this.setAttribute("dy",".2em"),wD(this)&&(i=!0,n.can_modify||l.push(this))});let d=Promise.resolve();if(e){const m=Kt.nodejs_document;m.originalCreateElementNS=m.createElementNS,globalThis.document=m,globalThis.CSSStyleSheet=Kt.nodejs_window.CSSStyleSheet,globalThis.CSSStyleRule=Kt.nodejs_window.CSSStyleRule,m.createElementNS=function(g,y){const A=m.originalCreateElementNS(g,y);return A.getBBox=function(){let _=50,x=10;if(this.tagName==="text"){const v=yD(this);_=gv(this.textContent,v),x=v.size*1.2}return{x:0,y:0,width:_,height:x}},A},d=Qt(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]).then(g=>{globalThis.Image=g.Image})}const u=n.width<n.height?"portrait":"landscape";let p=t?.as_doc?t.doc:null;if(p?p.addPage({orientation:u,unit:"px",format:[n.width+10,n.height+10]}):(p=new de({orientation:u,unit:"px",format:[n.width+10,n.height+10]}),t?.as_doc&&(t.doc=p)),Ct(n.node).selectAll("style").each(function(){const m=this.$fontcfg;if(!m?.n||!m?.base64)return;const g=m.n;if(g===Mn||g===Hl||f[g])return;f[g]=!0;const y=g.toLowerCase().replace(/\s/g,"")+".ttf";p.addFileToVFS(y,m.base64),p.addFont(y,m.n,m.s||"normal")}),i&&!f[Mn]&&tt.LoadSymbolTtf){const m=new Ha(122,10);d=d.then(()=>m.load()).then(()=>{m.addCustomFontToSvg(Ct(n.node)),p.addFileToVFS(Mn+".ttf",m.base64),p.addFont(Mn+".ttf",Mn,"normal")})}return d.then(()=>W8(n.node,p,{x:5,y:5,width:n.width,height:n.height})).then(()=>{n.reset_tranform&&!n.can_modify&&c&&n.node.setAttribute("transform",c),r.forEach(g=>g.setAttribute("font-family",ko)),s.forEach(g=>g.setAttribute("font-family",Mn)),a.forEach(g=>g.setAttribute("font-family",Hl)),h.forEach(g=>g.setAttribute("font-style","oblique")),o.forEach(g=>{g.setAttribute("dominant-baseline","middle"),g.removeAttribute("dy")}),l.forEach(g=>{g.innerHTML=g.$originalHTML,g.$originalFont?g.setAttribute("font-family",g.$originalFont):g.removeAttribute("font-family")});const m=t?.as_buffer?p.output("arraybuffer"):p.output("dataurlstring");return e&&(globalThis.document=void 0,globalThis.CSSStyleSheet=void 0,globalThis.CSSStyleRule=void 0,globalThis.Image=void 0,Kt.nodejs_document.createElementNS=Kt.nodejs_document.originalCreateElementNS,t?.as_buffer)?Buffer.from(m):m})}async function Ep(){return Qt(()=>import("./more-64laEJ4X.js"),[])}async function km(){return Qt(()=>Promise.resolve().then(()=>c$),void 0)}async function Cp(){return Qt(()=>import("./TTree-BtFtnLeD.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,10,11,12,13,14,15]))}async function Ll(){return Qt(()=>Promise.resolve().then(()=>VY),void 0)}let bn=null,Ec=null;const $A="TGraph2D",U5="TH2Poly",HA="TEllipse",q5="TSpline3",V5="TCanvasWebSnapshot",Pp="fPrimitives",kp="fFunctions",_l={lst:[{name:Dr,icon:"img_canvas",class:()=>km().then(n=>n.TCanvasPainter),opt:";grid;gridx;gridy;tick;tickx;ticky;log;logx;logy;logz",expand_item:Pp,noappend:!0},{name:Pr,icon:"img_canvas",func:Fs.draw,opt:";grid;gridx;gridy;tick;tickx;ticky;log;logx;logy;logz",expand_item:Pp,noappend:!0},{name:"TSlider",icon:"img_canvas",func:Fs.draw},{name:g1,icon:"img_canvas",func:Fs.draw},{name:"TInspectCanvas",icon:"img_canvas",sameas:Dr},{name:H1,icon:"img_frame",draw:()=>km().then(n=>n.drawTFrame)},{name:un,icon:"img_pavetext",class:()=>Qt(()=>import("./TPavePainter-1yngbgp8.js"),[]).then(n=>n.TPavePainter)},{name:sd,sameas:un},{name:$4,sameas:un},{name:G1,sameas:un},{name:H4,sameas:un},{name:W4,sameas:un},{name:j4,sameas:un},{name:Rl,icon:"img_pavelabel",sameas:un},{name:z2,icon:"img_colz",sameas:un},{name:Ta,icon:"img_text",class:()=>Qt(()=>import("./TTextPainter-B26aOYGd.js"),[]).then(n=>n.TTextPainter),build3d:()=>Qt(()=>import("./latex3d-8Hbnfz6c.js"),[]).then(n=>n.build3dlatex)},{name:Y4,sameas:Ta},{name:Ff,sameas:Ta},{name:X4,sameas:Ta},{name:Z4,icon:"img_text",class:()=>Qt(()=>import("./TAnnotation3DPainter-BCGBhq-q.js"),__vite__mapDeps([16,17,5])).then(n=>n.TAnnotation3DPainter)},{name:/^TH1/,icon:"img_histo1d",class:()=>Qt(()=>import("./TH1Painter-BXzutgI3.js"),__vite__mapDeps([3,4,5,6,7,8,9,10])).then(n=>n.TH1Painter),opt:";hist;P;P0;E;E1;E2;E3;E4;E1X0;L;LF2;C;B;B1;A;TEXT;LEGO;same",ctrl:"l",expand_item:kp,for_derived:!0},{name:q2,icon:"img_profile",class:()=>Qt(()=>import("./TH1Painter-BXzutgI3.js"),__vite__mapDeps([3,4,5,6,7,8,9,10])).then(n=>n.TH1Painter),opt:";E0;E1;E2;p;AH;hist;projx;projxb;projxc=e;projxw",expand_item:kp},{name:U5,icon:"img_histo2d",class:()=>Qt(()=>import("./TH2Painter-DceuYQAL.js"),__vite__mapDeps([11,4,5,6,7,8])).then(n=>n.TH2Painter),opt:";COL;COL0;COLZ;LCOL;LCOL0;LCOLZ;LEGO;TEXT;same",expand_item:"fBins",theonly:!0},{name:"TProfile2Poly",sameas:U5},{name:"TH2PolyBin",icon:"img_histo2d",draw_field:"fPoly",draw_field_opt:"L"},{name:/^TH2/,icon:"img_histo2d",class:()=>Qt(()=>import("./TH2Painter-DceuYQAL.js"),__vite__mapDeps([11,4,5,6,7,8])).then(n=>n.TH2Painter),opt:";COL;COLZ;COL0;COL1;COL0Z;COL1Z;COLA;COL_POL;COL_ARR;BOX;BOX1;PROJ;PROJX1;PROJX2;PROJX3;PROJY1;PROJY2;PROJY3;PROJXY1;PROJXY2;PROJXY3;SCAT;TEXT;TEXTE;TEXTE0;CANDLE;CANDLE1;CANDLE2;CANDLE3;CANDLE4;CANDLE5;CANDLE6;CANDLEY1;CANDLEY2;CANDLEY3;CANDLEY4;CANDLEY5;CANDLEY6;VIOLIN;VIOLIN1;VIOLIN2;VIOLINY1;VIOLINY2;CONT;CONT1;CONT2;CONT3;CONT4;ARR;CHORD;SURF;SURF1;SURF2;SURF4;SURF6;E;A;LEGO;LEGO0;LEGO1;LEGO2;LEGO3;LEGO4;same",ctrl:"lego",expand_item:kp,for_derived:!0},{name:V2,sameas:eh,opt2:";projxyb;projxyc=e;projxyw"},{name:/^TH3/,icon:"img_histo3d",class:()=>Qt(()=>import("./TH3Painter-BA_W8tmJ.js"),__vite__mapDeps([12,6,7,4,5,8,10])).then(n=>n.TH3Painter),opt:";SCAT;BOX;BOX2;BOX3;GLBOX1;GLBOX2;GLCOL",expand_item:kp,for_derived:!0},{name:G2,sameas:ih},{name:jd,icon:"img_histo1d",class:()=>Qt(()=>import("./THStackPainter-BWLN_w9A.js"),__vite__mapDeps([18,9,6,7,10,8,3,4,5,11])).then(n=>n.THStackPainter),expand_item:"fHists",opt:"NOSTACK;HIST;COL;LEGO;E;PFC;PLC;PADS"},{name:$o,icon:"img_histo3d",draw:()=>Qt(()=>import("./draw3d-ejHvJRmG.js"),__vite__mapDeps([19,15])).then(n=>n.drawPolyMarker3D),direct:!0,frame:"3d"},{name:$1,icon:"img_graph",draw:()=>Qt(()=>import("./draw3d-ejHvJRmG.js"),__vite__mapDeps([19,15])).then(n=>n.drawPolyLine3D),direct:!0,frame:"3d"},{name:"TGraphStruct"},{name:"TGraphNode"},{name:"TGraphEdge"},{name:O2,icon:"img_graph",class:()=>Qt(()=>import("./TGraphTimePainter-DDPwiVGX.js"),__vite__mapDeps([20,9,6,7,10])).then(n=>n.TGraphTimePainter),opt:"once;repeat;first",theonly:!0},{name:$A,icon:"img_graph",class:()=>Qt(()=>import("./TGraph2DPainter-COqZBIPT.js"),__vite__mapDeps([21,11,4,5,6,7,8])).then(n=>n.TGraph2DPainter),opt:";P;PCOL",theonly:!0},{name:q4,sameas:$A,opt:";P;PCOL;ERR",theonly:!0},{name:V4,sameas:$A,opt:";P;PCOL;ERR",theonly:!0},{name:V1,icon:"img_graph",class:()=>Qt(()=>import("./TGraphPolarPainter-u-FCb_Gb.js"),__vite__mapDeps([22,7])).then(n=>n.TGraphPolargramPainter),theonly:!0},{name:G4,icon:"img_graph",class:()=>Qt(()=>import("./TGraphPolarPainter-u-FCb_Gb.js"),__vite__mapDeps([22,7])).then(n=>n.TGraphPolarPainter),opt:";F;L;P;PE",theonly:!0},{name:/^TGraph/,icon:"img_graph",class:()=>Qt(()=>import("./TGraphPainter-Bp7xEbQz.js"),__vite__mapDeps([14,6,7,9,10])).then(n=>n.TGraphPainter),opt:";L;P"},{name:"TEfficiency",icon:"img_graph",class:()=>Qt(()=>import("./TEfficiencyPainter-dXd5DL3h.js"),__vite__mapDeps([23,14,6,7,9,10,24,3,4,5,8,11])).then(n=>n.TEfficiencyPainter),opt:";AP;A4P;B"},{name:I2,sameas:Ma},{name:/^RooHist/,sameas:Ma},{name:/^RooCurve/,sameas:Ma},{name:/^RooEllipse/,sameas:Ma},{name:"TScatter",icon:"img_graph",class:()=>Qt(()=>import("./TScatterPainter-Bt11j8z8.js"),__vite__mapDeps([25,14,6,7,9,10,8])).then(n=>n.TScatterPainter),opt:";A"},{name:"RooPlot",icon:"img_canvas",draw:()=>Qt(()=>import("./TGraphTimePainter-DDPwiVGX.js"),__vite__mapDeps([20,9,6,7,10])).then(n=>n.drawRooPlot)},{name:"TRatioPlot",icon:"img_mgraph",class:()=>Qt(()=>import("./TRatioPlotPainter-CJgkL58z.js"),__vite__mapDeps([26,27])).then(n=>n.TRatioPlotPainter),opt:""},{name:Xd,icon:"img_mgraph",class:()=>Qt(()=>import("./TMultiGraphPainter-DcwdyhOr.js"),__vite__mapDeps([28,6,7,9,10,14,11,4,5,8,13,3])).then(n=>n.TMultiGraphPainter),opt:";ac;l;p;3d;pads",expand_item:"fGraphs"},{name:_g,icon:"img_question",draw:()=>Ll().then(n=>n.drawStreamerInfo)},{name:"TWebPainting",icon:"img_graph",class:()=>Qt(()=>import("./TWebPaintingPainter-CZ6lo-7N.js"),[]).then(n=>n.TWebPaintingPainter)},{name:V5,icon:"img_canvas",draw:()=>km().then(n=>n.drawTPadSnapshot)},{name:"TPadWebSnapshot",sameas:V5},{name:"kind:Text",icon:"img_text",func:pw},{name:ps,icon:"img_text",func:pw},{name:od,icon:"img_tf1",class:()=>Qt(()=>import("./TF1Painter-DwE8KsBp.js"),__vite__mapDeps([24,6,7,9,10])).then(n=>n.TF1Painter),opt:";L;C;FC;FL"},{name:W1,sameas:od},{name:j1,icon:"img_tf2",class:()=>Qt(()=>import("./TF2Painter-SGNNKiK5.js"),__vite__mapDeps([29,11,4,5,6,7,8,10,24,9])).then(n=>n.TF2Painter),opt:";BOX;ARR;SURF;SURF1;SURF2;SURF4;SURF6;LEGO;LEGO0;LEGO1;LEGO2;LEGO3;LEGO4;same"},{name:X1,icon:"img_histo3d",class:()=>Qt(()=>import("./TF3Painter-yaRyTX9u.js"),__vite__mapDeps([30,11,4,5,6,7,8,10,24,9])).then(n=>n.TF3Painter),opt:";SURF"},{name:q5,icon:"img_tf1",class:()=>Qt(()=>import("./TSplinePainter-p6k_OB02.js"),__vite__mapDeps([31,3,4,5,6,7,8,9,10])).then(n=>n.TSplinePainter)},{name:"TSpline5",sameas:q5},{name:HA,icon:"img_graph",draw:()=>Ep().then(n=>n.drawEllipse),direct:!0},{name:"TArc",sameas:HA},{name:"TCrown",sameas:HA},{name:"TPie",icon:"img_graph",class:()=>Qt(()=>import("./TPiePainter-BgDv4srX.js"),__vite__mapDeps([32,7])).then(n=>n.TPiePainter),opt:";3D"},{name:"TPieSlice",icon:"img_graph",dummy:!0},{name:"TExec",icon:"img_graph",dummy:!0},{name:Im,icon:"img_graph",class:()=>Qt(()=>import("./TLinePainter-D8inyuoX.js"),[]).then(n=>n.TLinePainter)},{name:"TArrow",icon:"img_graph",class:()=>Qt(()=>import("./TArrowPainter-C7a0r3SV.js"),__vite__mapDeps([33,27])).then(n=>n.TArrowPainter)},{name:qc,icon:"img_graph",class:()=>Qt(()=>import("./TPolyLinePainter-BYlrAjCB.js"),[]).then(n=>n.TPolyLinePainter),opt:";F"},{name:"TCurlyLine",sameas:qc},{name:"TCurlyArc",sameas:qc},{name:"TParallelCoord",icon:"img_graph",dummy:!0},{name:ff,icon:"img_graph",class:()=>Qt(()=>import("./TGaxisPainter-DSiIbikC.js"),__vite__mapDeps([34,10])).then(n=>n.TGaxisPainter)},{name:Uc,icon:"img_graph",class:()=>Qt(()=>import("./TBoxPainter-Djh43LYY.js"),[]).then(n=>n.TBoxPainter),opt:";L"},{name:"TWbox",sameas:Uc},{name:"TSliderBox",sameas:Uc},{name:U2,icon:"img_graph",draw:()=>Ep().then(n=>n.drawMarker),direct:!0},{name:"TPolyMarker",icon:"img_graph",draw:()=>Ep().then(n=>n.drawPolyMarker),direct:!0},{name:"TASImage",icon:"img_mgraph",class:()=>Qt(()=>import("./TASImagePainter-BNJ5OAGP.js"),__vite__mapDeps([35,7])).then(n=>n.TASImagePainter),opt:";z"},{name:"TJSImage",icon:"img_mgraph",draw:()=>Ep().then(n=>n.drawJSImage),opt:";scale;center"},{name:Vi,icon:"img_histo3d",class:()=>Ec().then(n=>n.TGeoPainter),get_expand:()=>Ec().then(n=>n.expandGeoObject),opt:";more;all;count;projx;projz;wire;no_screen;dflt",ctrl:"dflt"},{name:"TEveGeoShapeExtract",sameas:Vi,opt:";more;all;count;projx;projz;wire;dflt"},{name:Ti+"REveGeoShapeExtract",sameas:Vi,opt:";more;all;count;projx;projz;wire;dflt"},{name:"TGeoOverlap",sameas:Vi,opt:";more;all;count;projx;projz;wire;dflt",dflt:"dflt",ctrl:"expand"},{name:"TGeoManager",sameas:Vi,opt:";more;all;count;projx;projz;wire;tracks;no_screen;dflt",dflt:"expand",pm:!0,ctrl:"dflt",noappend:!0,expand_after_draw:!0},{name:"TGeoVolumeAssembly",sameas:Vi,opt:";more;all;count"},{name:/^TGeo/,class:()=>Ec().then(n=>n.TGeoPainter),get_expand:()=>Ec().then(n=>n.expandGeoObject),opt:";more;all;axis;compa;count;projx;projz;wire;no_screen;dflt",dflt:"dflt",ctrl:"expand"},{name:"TAxis3D",icon:"img_graph",draw:()=>Ec().then(n=>n.drawAxis3D),direct:!0},{name:"kind:Command",icon:"img_execute",execute:!0},{name:"TFolder",icon:"img_folder",icon2:"img_folderopen",noinspect:!0,get_expand:()=>Ll().then(n=>n.folderHierarchy)},{name:"TTask",icon:"img_task",get_expand:()=>Ll().then(n=>n.taskHierarchy),for_derived:!0},{name:zc,icon:"img_tree",get_expand:()=>Qt(()=>Promise.resolve().then(()=>EH),void 0).then(n=>n.treeHierarchy),draw:()=>Cp().then(n=>n.drawTree),dflt:"expand",opt:"player;testio",shift:Li,pm:!0},{name:"TNtuple",sameas:zc},{name:"TNtupleD",sameas:zc},{name:C1,icon:"img_leaf_method",draw:()=>Cp().then(n=>n.drawTree),opt:";dump",noinspect:!0},{name:/^TBranch/,icon:"img_branch",draw:()=>Cp().then(n=>n.drawTree),dflt:"expand",opt:";dump",ctrl:"dump",shift:Li,ignore_online:!0,always_draw:!0},{name:/^TLeaf/,icon:"img_leaf",noexpand:!0,draw:()=>Cp().then(n=>n.drawTree),opt:";dump",ctrl:"dump",ignore_online:!0,always_draw:!0},{name:"ROOT::RNTuple",icon:"img_tree",get_expand:()=>Qt(()=>import("./rntuple-i8TaG-6V.js"),[]).then(n=>n.tupleHierarchy),draw:()=>Qt(()=>import("./RNTuple-B19bW6t4.js"),__vite__mapDeps([36,2,3,4,5,6,7,8,9,10,11,12,13,14,15,37])).then(n=>n.drawRNTuple),dflt:"expand",pm:!0},{name:"ROOT::RNTupleField",icon:"img_leaf",draw:()=>Qt(()=>import("./RNTuple-B19bW6t4.js"),__vite__mapDeps([36,2,3,4,5,6,7,8,9,10,11,12,13,14,15,37])).then(n=>n.drawRNTuple),opt:";dump",ctrl:"dump",shift:Li,ignore_online:!0,always_draw:!0},{name:Re,icon:"img_list",draw:()=>Ll().then(n=>n.drawList),get_expand:()=>Ll().then(n=>n.listHierarchy),dflt:"expand"},{name:th,sameas:Re},{name:sr,sameas:Re},{name:rd,sameas:Re},{name:Wd,sameas:Re},{name:ph,icon:"img_color"},{name:q1,icon:"img_file",noinspect:!0},{name:"TMemFile",icon:"img_file",noinspect:!0},{name:uf,icon:"img_question",noexpand:!0},{name:"Session",icon:"img_globe"},{name:"kind:TopFolder",icon:"img_base"},{name:"kind:Folder",icon:"img_folder",icon2:"img_folderopen",noinspect:!0},{name:Ti+"RCanvas",icon:"img_canvas",class:()=>bn().then(n=>n.RCanvasPainter),opt:"",expand_item:Pp},{name:Ti+"RCanvasDisplayItem",icon:"img_canvas",draw:()=>bn().then(n=>n.drawRPadSnapshot),opt:"",expand_item:Pp},{name:Ti+"RText",icon:"img_text",draw:()=>bn("more").then(n=>n.drawText),opt:"",direct:"v7",csstype:"text"},{name:Ti+"RFrameTitle",icon:"img_text",draw:()=>bn().then(n=>n.drawRFrameTitle),opt:"",direct:"v7",csstype:"title"},{name:Ti+"RPaletteDrawable",icon:"img_text",class:()=>bn("more").then(n=>n.RPalettePainter),opt:""},{name:Ti+"RLine",icon:"img_graph",draw:()=>bn("more").then(n=>n.drawLine),opt:"",direct:"v7",csstype:"line"},{name:Ti+"RBox",icon:"img_graph",draw:()=>bn("more").then(n=>n.drawBox),opt:"",direct:"v7",csstype:"box"},{name:Ti+"RMarker",icon:"img_graph",draw:()=>bn("more").then(n=>n.drawMarker),opt:"",direct:"v7",csstype:"marker"},{name:Ti+"RPave",icon:"img_pavetext",class:()=>bn("pave").then(n=>n.RPavePainter),opt:""},{name:Ti+"RLegend",icon:"img_graph",class:()=>bn("pave").then(n=>n.RLegendPainter),opt:""},{name:Ti+"RPaveText",icon:"img_pavetext",class:()=>bn("pave").then(n=>n.RPaveTextPainter),opt:""},{name:Ti+"RFrame",icon:"img_frame",draw:()=>bn().then(n=>n.drawRFrame),opt:""},{name:Ti+"RFont",icon:"img_text",draw:()=>bn().then(n=>n.drawRFont),opt:"",direct:"v7",csstype:"font"},{name:Ti+"RAxisDrawable",icon:"img_frame",draw:()=>bn().then(n=>n.drawRAxis),opt:""},{name:Ti+"RTreeMapPainter",class:()=>Qt(()=>import("./RTreeMapPainter-DNojexp9.js"),[]).then(n=>n.RTreeMapPainter),opt:""}],cache:{}};function Od(n){return _l.lst.push(n),n}function ui(n,t){if(!Pt(n))return null;t===""&&(t=null);let e=null;if(t===null&&n in _l.cache)return _l.cache[n];const i=Aa(n)||`kind:${n}`;let r=0;for(let s=0;s<_l.lst.length;++s){const a=_l.lst[s];if(Pt(a.name)){if(a.name!==i)continue}else if(!i.match(a.name))continue;if(a.sameas){const o=ui(Ee(a.sameas),t);if(o){for(const h in o)a[h]===void 0&&(a[h]=o[h]);delete a.sameas}return a}if(t==null)return n in _l.cache||(_l.cache[n]=a),a;if(Pt(t)){if(e||(e=a),t==="::expand"){if("expand"in a||"expand_item"in a)return a}else if("opt"in a){const o=a.opt.split(";");for(let h=0;h<o.length;++h)if(o[h].toLowerCase()===t.toLowerCase())return a}}else if(t===r)return a;++r}return e}function af(n){return Pt(n)&&(n=ui(n)),se(n)?n.func||n.class||n.draw||n.draw_field||n.opt==="inspect":!1}function Bc(n,t){const e={opts:null,inspect:!1,expand:!1,draw:!1,handle:null};if(!Pt(n))return e;let i=!1,r=!1,s=!1;Pt(t)||(t="");for(let a=0;a<1e3;++a){const o=ui(n,a);if(!o||(e.handle||(e.handle=o),o.noinspect&&(r=!0),o.noappend&&(e.noappend=!0),(o.expand||o.get_expand||o.expand_item||o.can_expand)&&(s=!0),!o.func&&!o.class&&!o.draw))break;if(i=!0,o.opt===void 0)continue;let h=o.opt;Pt(o.opt2)&&(h+=o.opt2);const l=h.split(";");for(let c=0;c<l.length;++c)l[c]=l[c].toLowerCase(),!(l[c].indexOf("same")===0&&(e.has_same=!0,t.indexOf("nosame")>=0))&&(e.opts===null&&(e.opts=[]),e.opts.indexOf(l[c])<0&&e.opts.push(l[c]));if(o.theonly)break}return t.indexOf("noinspect")>=0&&(r=!0),i&&e.opts===null&&(e.opts=[""]),!i&&Aa(n)&&!r&&(e.opts=[]),!r&&e.opts&&e.opts.push(Li),e.inspect=!r,e.expand=s,e.draw=!!e.opts,e}function j8(n,t){if(n)if(t===void 0&&Pt(n)&&n.indexOf(":")>0)t.split(";").forEach(e=>{const i=e.split(":");i.length>=1&&j8(i[0],i[1]||"")});else{const e=ui(Ee(n),0);e&&(e.dflt=t)}}async function Xa(n,t,e){if(!se(t))return Promise.reject(Error("not an object in draw call"));if(Pt(e)&&e.indexOf(Li)===0)return Ll().then(o=>o.drawInspector(n,t,e));let i,r;if("_typename"in t)r="type "+t._typename,i=ui(Ee(t._typename),e);else if("_kind"in t)r="kind "+t._kind,i=ui(t._kind,e);else return Ll().then(o=>o.drawInspector(n,t,e));if(!i)return Promise.reject(Error(`Object of ${r} cannot be shown with draw`));if(i.dummy)return null;if(i.draw_field&&t[i.draw_field])return Xa(n,t[i.draw_field],e||i.draw_field_opt);if(!af(i)){if(e&&e.indexOf("same")>=0){const o=um(n);if(lt(o?.performDrop))return o.performDrop(t,"",null,e)}return Promise.reject(Error(`Function not specified to draw object ${r}`))}function s(){let o,h;return i.direct==="v7"?o=Qt(()=>import("./RCanvasPainter-BN1wz_jA.js"),[]).then(l=>(h=new l.RObjectPainter(n,t,e,i.csstype),h.redraw=i.func,l.ensureRCanvas(h,i.frame||!1))).then(()=>h.redraw()):i.direct?(h=new Vn(n,t,e),h.redraw=i.func,o=km().then(l=>l.ensureTCanvas(h,i.frame||!1)).then(()=>h.redraw())):o=Go(i.func(n,t,e)),o.then(l=>{if(h||(h=l),h===!1)return null;if(!h)throw Error(`Fail to draw object ${r}`);return se(h)&&!h.options&&(h.options={original:e||""}),h})}if(lt(i.func))return s();let a;if(lt(i.class))a=i.class().then(o=>{i.func=o.draw});else if(lt(i.draw))a=i.draw().then(o=>{i.func=o});else{if(!i.func||!Pt(i.func))return Promise.reject(Error(`Draw function or class not specified to draw ${r}`));{let o=ts(i.func);if(lt(o))return i.func=o,s();let h=null;if(Pt(i.script)&&(i.script.indexOf("modules:")===0?h=i.script.slice(8):i.script.indexOf(".mjs")>0&&(h=i.script)),!h&&!i.prereq&&!i.script)return Promise.reject(Error(`Prerequicities to load ${i.func} are not specified`));let l=Promise.resolve(!0);h?l=Hd(h):Kt.ignore_v6||(l=cf().then(c=>(i.prereq?c.require(i.prereq):Promise.resolve(!0)).then(()=>{if(i.script)return Cr(i.script)}).then(()=>c._complete_loading()))),a=l.then(()=>{if(o=ts(i.func),!lt(o))return Promise.reject(Error(`Fail to find function ${i.func} after loading ${i.prereq||i.script}`));i.func=o})}}return a.then(()=>s())}async function v2(n,t,e){if(!se(t))return Promise.reject(Error("not an object in redraw"));const i=bl(n);let r,s=null,a;if(t._typename&&(r=ui(Ee(t._typename))),r?.draw_field&&t[r.draw_field]&&(t=t[r.draw_field]),i)i.matchObjectType(t._typename)?(a=i.redrawObject(t,e),a&&(s=i)):i.forEachPainterInPad(o=>{!s&&o.matchObjectType(t._typename)&&(a=o.redrawObject(t,e),a&&(s=o))},"objects");else{const o=new Of(n).getTopPainter();lt(o?.redrawObject)&&(a=o.redrawObject(t,e),a&&(s=o))}return s?Go(a).then(()=>s):(pr(n),Xa(n,t,e))}async function FQ(n,t){if(!se(n)||!n?._typename)return Promise.reject(Error("not an object in build3d"));const e=ui(Ee(n._typename));return!e?.class&&!e.build3d?Promise.reject(Error(`not able to create three.js for ${n._typename}`)):e.build3d?e.build3d().then(i=>i(n,t)):e.class().then(i=>lt(i?.build3d)?i.build3d(n,t):Promise.reject(Error(`painter class for ${n._typename} does not implement build3d method`)))}function DY(n){if(!n)return;const t=[Pe,ri,nd,"TCollection",fn,wr,ws,ya];function e(i,r){const s=i.fElements?.arr[0];if(s?.fTypeName!==jo||r>4||t.indexOf(s.fName)>=0)return null;let a=ui(Ee(s.fName));if(a&&!a.for_derived&&(a=null),a===null){for(let o=0;o<n.arr.length;++o)if(n.arr[o].fName===s.fName){a=e(n.arr[o],r+1);break}}return a?.for_derived?a:null}n.arr.forEach(i=>{if(ui(Ee(i.fName))!==null)return;const r=e(i,0);if(r){const s=Object.assign({},r);delete s.for_derived,s.name=i.fName,Od(s)}})}async function X8(n){if(n||(n={}),!se(n.object))return Promise.reject(Error("No object specified to generate SVG"));n.format||(n.format="svg"),n.width||(n.width=tt.CanvasWidth),n.height||(n.height=tt.CanvasHeight);async function t(e){e.attr("width",n.width).attr("height",n.height).style("width",n.width+"px").style("height",n.height+"px").property("_batch_use_canvsize",n.use_canvas_size??!1).property("_batch_mode",!0).property("_batch_format",n.format!=="svg"?n.format:null);function i(r){return pr(e.node()),e.remove(),r}return Xa(e.node(),n.object,n.option||"").then(()=>{if(n.format!=="svg"){const h=e.select("svg").selectChild("image");if(!h.empty()){const l=h.attr("href");if(n.as_buffer){const c=l.indexOf("base64,"),f=Vd(l.slice(c+7)),d=new ArrayBuffer(f.length),u=new Uint8Array(d);for(let p=0;p<f.length;p++)u[p]=f.charCodeAt(p);return Se()?Buffer.from(d):d}return l}}const r=e.select("svg"),s=r.style("filter");r.attr("xmlns",lr).attr("style",null).attr("class",null).attr("x",null).attr("y",null),!r.attr("width")&&!r.attr("height")&&r.attr("width",n.width).attr("height",n.height),s&&r.style("filter",s);function a(){const h=Ct(this);h.style("display")==="none"&&h.remove()}e.selectAll("g.root_frame").each(a),e.selectAll("svg").each(a);let o;if(n.format==="pdf")o={node:r.node(),width:n.width,height:n.height,can_modify:!0};else if(o=n1(e.html()),n.format==="svg")return i(o);return mv(o,n.format,n).then(i)})}return Se()?pv().then(e=>t(e.body.append("div"))):t(Ct("body").append("div").style("display","none"))}async function FY(n){return n||(n={}),n.format="svg",X8(n)}function Y8(n){n.prototype.drawObject=Xa,n.prototype.getObjectDrawSettings=Bc}Y8(Fs);Ec=async function(){return Qt(()=>Promise.resolve().then(()=>J$),void 0).then(n=>{const t=ui(Ee("TGeoVolumeAssembly"));return t&&(t.icon="img_geoassembly"),n})};bn=async function(n){return Qt(()=>import("./RCanvasPainter-BN1wz_jA.js"),[]).then(t=>{switch(Y8(t.RPadPainter),n){case"more":return Qt(()=>import("./v7more-C-UZAxz1.js"),__vite__mapDeps([38,39]));case"pave":return Qt(()=>import("./RPavePainter-BOw0-OFU.js"),__vite__mapDeps([40,39]))}return t})};Object.assign(Kt,{addStreamerInfosForPainter:DY,addDrawFunc:Od,setDefaultDrawOpt:j8,makePDF:RY});Object.assign(Kt.jsroot,{draw:Xa,redraw:v2,makeSVG:FY,makeImage:X8,addDrawFunc:Od});const la="TopFolder",Nl="expand",bu="plusminus",WA="__default_draw_option__",vo="h_value_num",vl="h_button",F1="h_item",Cc="h_tree";function IY(n){function t(s,a,o,h){return`.jsroot .img_${s} { display: inline-block; height: ${a}px; width: ${a}px; background-image: url("data:image/${o};base64,${h}"); }`}const e=tt.DarkMode?"black":"#E6E6FA",i=tt.DarkMode?"green":"black",r=tt.DarkMode?"#555":"#aaa";$v(`
|
|
4494
4494
|
.jsroot .${Cc} { display: block; white-space: nowrap; }
|
|
4495
4495
|
.jsroot .${Cc} * { padding: 0; margin: 0; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; box-sizing: content-box; line-height: 14px }
|
|
4496
4496
|
.jsroot .${Cc} img { border: 0px; vertical-align: middle; }
|
|
@@ -4546,13 +4546,13 @@ ${t("class",16,"png","iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAvQ
|
|
|
4546
4546
|
${t("member",16,"png","iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAvQC9AL1pQtWoAAAAX0lEQVR42mNgAAIVBob/+DADPgBS8GCPBV6M1xCKDcDnBRcoZhgW4D8DBV75v2bLATAmxyC4ZmRMrCFYNfeU9BBvwJwpS8AYWTNZBoAwTDPFBpAciDCDyNFMtXSAFwAAUyq0GRPbbz4AAABMelRYdFNvZnR3YXJlAAB42nPQUNb0zE1MT/VNTM9MzlYw0TPSM1CwtNQ3MNY3MFRILsosLql0yK0sLslM1kst1kspLcjPK9FLzs8FAPO/Eny7iktKAAAAM3pUWHRTaWduYXR1cmUAAHjaS01JNrE0S00zSbU0NEsxMbMwM0xOSjYwNzY3NLRIMjUCAJcdCJ2BHe6SAAAAAElFTkSuQmCC")}
|
|
4547
4547
|
${t("tf1",16,"png","iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX/////AP8/SMz///+Cf5VqAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAHdElNRQfgCw4QHgSCla+2AAAAL0lEQVQI12MQYAACrAQXiFBoABINCgwMQgwcDAwSDEwMDKmhodMYJjAwaKDrAAEAoRAEjHDJ/uQAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMTEtMTRUMTc6Mjk6MjErMDE6MDDxcSccAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE2LTExLTE0VDE3OjI5OjA1KzAxOjAwNka8zgAAAABJRU5ErkJggg==")}
|
|
4548
4548
|
${t("tf2",16,"png","iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX/////AP8A/wD////pL6WoAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAHdElNRQfgCw4PNgzGaW1jAAAARUlEQVQI12NgEGDQZAASKkBigQKQ6GhgYBDiYgASIiAigIGBS8iBgUFhEpCnoAEkUkNDQxkagUIMrUDMMAVETAARQI0MAD5GCJ7tAr1aAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE2LTExLTE0VDE2OjUxOjUzKzAxOjAwi1Gz3gAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNi0xMS0xNFQxNjo1MTozNiswMTowMG5bLUIAAAAASUVORK5CYII=")}
|
|
4549
|
-
`,n,"jsroot_hstyle")}function Z8(n){return n<1e4?n.toFixed(0)+"B":n<1e6?(n/1e3).toFixed(2)+"KiB":n<1e9?(n/1e6).toFixed(2)+"MiB":(n/1e9).toFixed(2)+"GiB"}function OY(n){const t=Math.floor(n/1e4);let e=Math.floor((n-t*1e4)/100).toString(),i=(n%100).toString();return e.length<2&&(e="0"+e),i.length<2&&(i="0"+i),`${t}.${e}.${i}`}async function BY(n,t,e){return t?.arr?{dom:n,lst:t,opt:e,indx:-1,painter:null,draw_next(){for(;++this.indx<this.lst.arr.length;){const r=this.lst.arr[this.indx],s=this.lst.opt&&this.lst.opt[this.indx]?this.lst.opt[this.indx]:this.opt;if(r)return Xa(this.dom,r,s).then(a=>(a&&!this.painter&&(this.painter=a),this.draw_next()))}return this.painter}}.draw_next():null}function zY(n,t){if(!t?.fFolders)return!1;if(!t.fFolders.arr.length)return n._more=!1,!0;n._childs=[];for(let e=0;e<t.fFolders.arr.length;++e){const i=t.fFolders.arr[e];n._childs.push({_name:i.fName,_kind:Ee(i._typename),_obj:i})}return!0}function J8(n,t){if(!mh(t))return!1;if(!t.arr?.length)return n._more=!1,!0;let e=!1,i=n;for(;i;)i._do_context&&(e=!0),i=i._parent;const r=t._typename===Wd,s=[],a=[],o=[];for(let h=0;h<t.arr.length;++h){const l=r?t.arr[h].first:t.arr[h];if(!l)continue;const c=l.fName||l.name;if(!c)continue;const f=s.indexOf(c);f>=0?a[f]++:(a[s.length]=o[s.length]=1,s.push(c))}n._childs=[];for(let h=0;h<t.arr.length;++h){const l=r?t.arr[h].first:t.arr[h];let c;if(!l?._typename)c={_name:h.toString(),_kind:Ee("NULL"),_title:"NULL",_value:"null",_obj:null};else{switch(c={_name:l.fName||l.name,_kind:Ee(l._typename),_title:`${l.fTitle||""} type:${l._typename}`,_obj:l},l._typename){case ph:c._value=md(l);break;case Ta:case Ff:c._value=l.fTitle;break;case ps:c._value=l.fString;break;default:t.opt&&t.opt[h]&&t.opt[h].length&&(c._value=t.opt[h])}if(e&&af(l._typename)&&(c._direct_context=!0),!c._name||Number.isInteger(parseInt(c._name))&&parseInt(c._name)!==h||t.arr.indexOf(l)<h)c._name=h.toString();else{const f=s.indexOf(l.fName);f>=0&&a[f]>1&&(c._cycle=o[f]++,c._keyname=c._name,c._name=c._keyname+";"+c._cycle)}}n._childs.push(c)}return!0}function ql(n,t,e,i){if(t===void 0)return!1;n._childs=[];for(let r=0;r<t.length;++r){const s=t[r];if(tt.OnlyLastCycle&&r>0&&s.fName===t[r-1].fName&&s.fCycle<t[r-1].fCycle)continue;const a={_name:s.fName+";"+s.fCycle,_cycle:s.fCycle,_kind:Ee(s.fClassName),_title:s.fTitle+` (size: ${Z8(s.fObjlen)})`,_keyname:s.fName,_readobj:null,_parent:n};if(s.fRealName&&(a._realname=s.fRealName+";"+s.fCycle),s.fClassName===Wl||s.fClassName===gC){const o=i&&e?e.getDir(i+s.fName):null;o?(a._name=s.fName,ql(a,o.fKeys,e,i+s.fName+"/")):(a._more=!0,a._expand=function(h,l){return ql(h,l.fKeys)})}else if(s.fClassName===Re&&s.fName===v1){if(tt.SkipStreamerInfos)continue;a._name=v1,a._kind=Ee(_g),a._title="List of streamer infos for binary I/O",a._readobj=e.fStreamerInfos}n._childs.push(a)}return!0}function Rf(n,t,e=void 0){if(!n||t===null)return!1;n._childs=[];let i=Object.prototype.toString.apply(t);if(i==="[object DataView]"){let p={_parent:n,_name:"size",_value:t.byteLength.toString(),_vclass:vo};n._childs.push(p);const m=t.byteLength<10?1:Math.log10(t.byteLength);for(let g=0;g<t.byteLength;++g){if(g%16===0){for(p={_parent:n,_name:g.toString(),_value:"",_vclass:vo};p._name.length<m;)p._name="0"+p._name;n._childs.push(p)}let y=t.getUint8(g).toString(16);for(;y.length<2;)y="0"+y;p._value&&(p._value+=g%4===0?" | ":" "),p._value+=y}return!0}let r=!0,s=!1,a=n;for(;a;){if(a._do_context&&(s=!0),"_nosimple"in a){r=a._nosimple;break}a=a._parent}const o=Kl(i)>0&&t.length,h=o&&t.length>tt.HierarchyLimit;let l=!1;if(o&&n._name==="Object"&&!n._parent&&(n._name="Array"),h){l=!0;for(let p=0;p<t.length;++p){const m=typeof t[p];if(!(m==="number"||m==="boolean"||m==="string"&&t[p].length<16)){l=!1;break}}}if("_obj"in n?n._obj!==t&&alert("object missmatch"):n._obj=t,n._title||(t._typename?n._title=Ee(t._typename):o&&(n._title="Array len: "+t.length)),l){for(let p=0;p<t.length;){let m=Math.min(p+10,t.length),g=!0,y=p;for(;g;){g=!0;for(let _=y;_<m;++_)t[p]!==t[_]&&(g=!1);if(g){if(m===t.length)break;y=m,m=Math.min(m+10,t.length)}else if(y!==p){m=y,g=!0;break}}const A={_parent:n,_name:p+".."+(m-1),_vclass:vo};if(g)A._value=t[p].toString();else{A._value="";for(let _=p;_<m;++_)A._value+=(_===p?"[ ":", ")+t[_].toString();A._value+=" ]"}n._childs.push(A),p=m}return!0}let c,f,d,u;for(const p in t){if(p==="_typename"||p[0]==="$")continue;const m=t[p];if(lt(m)||e?.exclude&&e.exclude.indexOf(p)>=0)continue;if(h&&c){if(d===m){++u,f=p;continue}u>0&&(c._name+=".."+f)}const g={_parent:n,_name:p};if(h&&(c=g,f=p,d=m,u=0),m===null){g._value=g._title="null",r||n._childs.push(g);continue}let y=!1;if(se(m))if(i=Object.prototype.toString.apply(m),Kl(i)>0)g._title="array len="+m.length,y=i!=="[object Array]",m.length?(g._value="[...]",g._more=!0,g._expand=Rf,g._obj=m):(g._value="[ ]",g._more=!1);else if(i==="[object DataView]")g._title="DataView len="+m.byteLength,g._value="[...]",g._more=!0,g._expand=Rf,g._obj=m;else if(i==="[object Date]")g._more=!1,g._title="Date",g._value=m.toString(),g._vclass=vo;else{(m.$kind||m._typename)&&(g._kind=g._title=Ee(m.$kind||m._typename)),m._typename&&(g._title=m._typename,s&&af(m._typename)&&(g._direct_context=!0));let A=n,_=!1;for(;A&&!_;)_=A._obj===m,A=A._parent;if(_)g._value="{ prnt }",g._vclass=vo,g._more=!1,y=!0;else switch(g._obj=m,g._more=!1,m._typename){case ph:g._value=md(m);break;case Ta:case Ff:g._value=m.fTitle;break;case ps:g._value=m.fString;break;default:mh(m)&&se(m.arr)?(g._value=m.arr.length?"[...]":"[]",g._title+=", size:"+m.arr.length,m.arr.length&&(g._more=!0)):(g._more=!0,g._value="{ }")}}else typeof m=="number"||typeof m=="boolean"||typeof m=="bigint"?(y=!0,p==="fBits"?g._value="0x"+m.toString(16):g._value=m.toString(),g._vclass=vo):Pt(m)?(y=!0,g._value='"'+m+'"',g._vclass="h_value_str"):typeof m>"u"?(y=!0,g._value="undefined",g._vclass=vo):(y=!0,alert(`miss ${p} type ${typeof m}`));(!y||!r)&&n._childs.push(g)}return h&&c&&u>0&&(c._name+=".."+f),!0}function UY(n,t){if(!t?.fTasks)return!1;if(Rf(n,t,{exclude:["fTasks","fName"]}),!t.fTasks.arr.length&&!n._childs.length)return n._more=!1,!0;for(let e=0;e<t.fTasks.arr.length;++e){const i=t.fTasks.arr[e];n._childs.push({_name:i.fName,_kind:Ee(i._typename),_obj:i})}return!0}function Q8(n){const t={_name:v1,_childs:[]};for(let e=0;e<n.arr.length;++e){const i=n.arr[e];if(i._typename===Re)continue;if(typeof i.fName>"u"){console.warn(`strange element in StreamerInfo with type ${i._typename}`);continue}const r={_name:`${i.fName};${i.fClassVersion}`,_kind:`class ${i.fName}`,_title:`class:${i.fName} version:${i.fClassVersion} checksum:${i.fCheckSum}`,_icon:"img_class",_childs:[]};if(i.fTitle&&(r._title+=" "+i.fTitle),t._childs.push(r),!(typeof i.fElements>"u")){for(let s=0;s<i.fElements.arr.length;++s){const a=i.fElements.arr[s];if(!a?.fName)continue;let o=`${a.fTypeName} ${a.fName}`;const h=`${a.fTypeName} type:${a.fType}`;if(a.fArrayDim===1)o+=`[${a.fArrayLength}]`;else for(let l=0;l<a.fArrayDim;++l)o+=`[${a.fMaxIndex[l]}]`;a.fBaseVersion===4294967295?o+=":-1":a.fBaseVersion!==void 0&&(o+=`:${a.fBaseVersion}`),o+=";",a.fTitle&&(o+=` // ${a.fTitle}`),r._childs.push({_name:o,_title:h,_kind:a.fTypeName,_icon:a.fTypeName===jo?"img_class":"img_member"})}r._childs.length||delete r._childs}}return t}function K8(n,t,e){e?._typename===Re&&(e._typename=_g)}function t7(n){const t={_name:"Object",_title:"",_click_action:Nl,_nosimple:!1,_do_context:!0};return Pt(n.fName)&&n.fName&&(t._name=n.fName),Pt(n.fTitle)&&n.fTitle&&(t._title=n.fTitle),n._typename&&(t._title+=` type:${n._typename}`),mh(n)?(t._name=n.name||n._typename,J8(t,n)):Rf(t,n),t}function bo(n){const t=[];if(!Pt(n)||(n=n.trim(),!n))return t;if(n.length<2||n.at(0)!=="["||n.at(-1)!=="]")return t.push(n),t;let e=0,i=0,r=0,s=1;for(let a=1;a<n.length;++a){if(i>0){n[a]==="'"&&i--;continue}if(r>0){n[a]==='"'&&r--;continue}switch(n[a]){case"'":i++;break;case'"':r++;break;case"[":e++;break;case"]":if(a<n.length-1){e--;break}case",":if(e===0){let o=n.substring(s,a).trim();o.length>1&&o.at(0)===o.at(-1)&&(o[0]==='"'||o[0]==="'")&&(o=o.slice(1,o.length-1)),t.push(o),s=a+1}break}}return t.length||t.push(n.slice(1,n.length-1).trim()),t}function Lm(n,t){if(n&&t?._childs){for(let e=0;e<t._childs.length;++e)(t._childs[e]._more||t._childs[e]._childs)&&(t._childs[e]._expand=Lm);return n._childs=t._childs,t._childs=null,!0}return!1}function G5(n){return n?.expand||n?.get_expand||n?.expand_item}const nc=Ee(q1);class h0 extends Of{#i;#r;#e;#s;#h;#a;#d;#u;#o;constructor(t,e,i){super(e),this.name=t,this.h=null,this.with_icons=!0,i==="__as_dark_mode__"?this.setBasicColors():this.background=i,this.files_monitoring=!e,this.nobrowser=e===null,No()||WS(this)}setBasicColors(){this.background=tt.DarkMode?"black":"white",this.textcolor=tt.DarkMode?"#eee":"#111"}setDrawFunc(t,e){lt(t)&&(this.#u=t,this.#o=lt(e)?e:t)}async callDrawFunc(t,e,i,r){return(r?this.#o||v2:this.#u||Xa)(t,e,i)}cleanup(){this.clearHierarchy(!0),super.cleanup(),No()===this&&WS(null)}fileHierarchy(t,e){const i=this;return e||(e={}),e._name=t.fFileName,e._title=(t.fTitle?t.fTitle+", path: ":"")+t.fFullURL+`, size: ${Z8(t.fEND)}, version: ${OY(t.fVersion)}, modified: ${Hx(s6(t.fDatimeM))}`,e._kind=nc,e._file=t,e._fullurl=t.fFullURL,e._localfile=t.fLocalFile,e._had_direct_read=!1,e._get=function(r,s){if(r?._readobj)return Promise.resolve(r._readobj);r&&(s=i.itemFullName(r,this));const a=o=>(this._file||(this._file=o),o?o.readObject(s).then(h=>{if(!r&&h){const l=i.findItem({name:s,top:this,last_exists:!0,check_keys:!0});if(l?.last!==void 0&&l.last!==this){const c=o.getDir(i.itemFullName(l.last,this));if(c){l.last._name=l.last._keyname;const f=i.itemFullName(l.last,this);ql(l.last,c.fKeys,o,f+"/")}}else ql(this,o.fKeys,o,"");r=i.findItem({name:s,top:this})}return r&&(r._readobj=h,"_expand"in r&&(r._name=r._keyname)),h}):Promise.resolve(null));return this._file?a(this._file):this._localfile?Uu(this._localfile).then(o=>a(o)):this._fullurl?Uu(this._fullurl).then(o=>a(o)):Promise.resolve(null)},ql(e,t.fKeys,t,""),e}forEachItem(t,e){function i(r,s){if(!r)return;s&&(r._parent=s),t(r);const a=r._childs?.length??0;for(let o=0;o<a;++o)i(r._childs[o],r)}lt(t)&&i(e||this.h)}findItem(t){function e(s,a){if(!a||!s)return s;let o=a.length;if(!s._parent&&s._kind!==la&&a.indexOf(s._name)===0){if(a===s._name)return s;const l=s._name.length;a[l]==="/"&&(a=a.slice(l+1),o=a.length)}function h(l,c){return c||(l._parent=s),o>=a.length-1||o<0?l:e(l,a.slice(o+1))}for(;o>0;){let l=o>=a.length?a:a.slice(0,o);if(s._childs){for(let f=0;f<s._childs.length;++f)if(s._childs[f]._name===l)return h(s._childs[f]);if(s._kind===la&&s._childs[0]._online!==void 0){for(let f=0;f<s._childs[0]._childs.length;++f)if(s._childs[0]._childs[f]._name===l)return h(s._childs[0]._childs[f],!0)}if(t.check_keys){let f=null;for(let d=0;d<s._childs.length;++d)s._childs[d]._keyname===l&&(!f||f._cycle<s._childs[d]._cycle)&&(f=s._childs[d]);if(f)return h(f)}let c=t.allow_index;if(l.at(0)==="["&&l.at(-1)==="]"&&/^\d+$/.test(l.slice(1,l.length-1))&&(c=!0,l=l.slice(1,l.length-1)),c&&/^\d+$/.test(l)){const f=parseInt(l);if(Number.isInteger(f)&&f>=0&&f<s._childs.length)return h(s._childs[f])}}o=a.lastIndexOf("/",o-1)}if(t.force){s._childs===void 0&&(s._childs=[]),o=a.indexOf("/");const l={_name:o<0?a:a.slice(0,o)};return s._childs.push(l),h(l)}return t.last_exists?{last:s,rest:a}:null}let i=this.h,r;if(Pt(t))r=t,t={};else if(se(t))r=t.name,"top"in t&&(i=t.top);else return null;return r==="__top_folder__"?i:Pt(r)&&r.indexOf("img:")===0?null:e(i,r)}itemFullName(t,e,i){if(t?._kind===la)return"__top_folder__";let r="";for(;t;){if(t._online!==void 0&&!e)return r;if(t===e||t._kind===la||i&&!t._parent)break;r&&(r="/"+r),r=t._name+r,t=t._parent}return r}async executeCommand(t,e,...i){const r=this.findItem(t),s=this.getOnlineItemUrl(r)+"/cmd.json",a=Ct(e),o=[];for(let l=0;l<(r._numargs??0);++l)o.push(l<i.length?i[l]:"");return(!o.length||!e?Promise.resolve(o):fr().then(l=>l.showCommandArgsDialog(r._name,o))).then(l=>{if(l===null)return!1;let c="";for(let f=0;f<l.length;++f)c+=`${f>0?"&":"?"}arg${f+1}=${l[f]}`;return a.empty()||(a.style("background","yellow"),r._title&&a.attr("title","Executing "+r._title)),br(s+c,"text").then(f=>{if(a.empty())return f;const d=f&&f!=="false"?"green":"red";return a.style("background",d),r._title&&a.attr("title",r._title+" lastres="+f),setTimeout(()=>{a.style("background",null),r._icon&&a.classed("jsroot_fastcmd_btn")&&a.style("background-image",`url('${r._icon}')`)},2e3),d==="green"&&"_hreload"in r&&this.reload(),d==="green"&&"_update_item"in r&&this.updateItems(r._update_item.split(";")),f})})}async getObject(t,e){const i={item:null,obj:null};let r,s;if(t===null)return i;if(Pt(t)?r=t:se(t)&&(t._parent!==void 0&&t._name!==void 0&&t._kind!==void 0?s=t:t.name!==void 0?r=t.name:t.arg!==void 0?r=t.arg:t.item!==void 0&&(s=t.item)),Pt(r)&&r.indexOf("img:")===0)return i.obj={_typename:"TJSImage",fName:r.slice(4)},i;s?r=this.itemFullName(s):s=this.findItem({name:r,allow_index:!0,check_keys:!0});const a=s?null:this.findItem({name:r,last_exists:!0,check_keys:!0,allow_index:!0});if(a!==null&&"last"in a&&a.last!==null){const h=this.itemFullName(a.last);return se(t)&&"rest"in t&&(t.rest===a.rest||t.rest.length<=a.rest.length)?i:this.expandItem(h,void 0,e!=="hierarchy_expand_verbose").then(l=>{if(!l)return i;let c=this.itemFullName(a.last);return c&&(c+="/"),this.getObject({name:c+a.rest,rest:a.rest},e)})}if(i.item=s,s!==null&&se(s._obj))return i.obj=s._obj,i;let o=s;for(;o;){if(lt(o._get))return o._get(s,null,e).then(h=>(i.obj=h,i));o=o._parent}return i}isLastSibling(t){if(!t||!t._parent||!t._parent._childs)return!1;const e=t._parent._childs;let i=e.indexOf(t);if(i<0)return!1;for(;++i<e.length;)if(!("_hidden"in e[i]))return!1;return!0}addItemHtml(t,e,i){if(!t||"_hidden"in t)return!0;const r=t===this.h,s="_childs"in t,a=ui(t._kind),o=this.itemFullName(t);let h="",l="",c=!1,f=!1,d;a&&("icon"in a&&(h=a.icon),"icon2"in a&&(l=a.icon2),!h&<(a.icon_get)&&(h=a.icon_get(t,this)),(af(a)||"execute"in a||"aslink"in a||G5(a)&&t._more!==!1)&&(c=!0)),"_icon"in t&&(h=t._icon),"_icon2"in t&&(l=t._icon2),!h&&"_online"in t&&(t._icon=h="img_globe"),!h&&r&&(t._icon=h="img_base"),(t._more||t._expand||t._player||t._can_draw)&&(c=!0);let u=c;!u&&Aa(t._kind)&&(u=c=!0),l||(l=h),h||(h=s||t._more?"img_folder":"img_page"),l||(l=s||t._more?"img_folderopen":"img_page"),i==="update"?(e.selectAll("*").remove(),d=e):(d=e.append("div"),i&&i>=(t._parent._show_limit||tt.HierarchyLimit)&&(f=!0)),t._d3cont=d.node(),d.attr("item",o);const p=this,m=d.append("div").attr("class","h_line");let g=r?null:t._parent,y=1;for(;g&&g!==this.h;){const M=this.isLastSibling(g),T=m.insert("div",":first-child").attr("class",M?"img_empty":"img_line");M||T.style("cursor","pointer").property("upcnt",y).on("click",function(w){p.tree_click(w,this,"parentminus")}),g=g._parent,y++}let A="",_=!1;if(r||(s&&!f||a?.pm?(A=t._isopen?"img_minus":"img_plus",_=!0):A="img_join"),A){(f||this.isLastSibling(t))&&(A+="bottom");const M=m.append("div").attr("class",A);_&&M.style("cursor","pointer").on("click",function(T){p.tree_click(T,this,bu)})}if(this.with_icons&&!f){const M=t._isopen?l:h,T=M.indexOf("img_")===0?m.append("div").attr("class",M).attr("title",t._kind):m.append("img").attr("src",M).attr("alt","").attr("title",t._kind).style("vertical-align","top").style("width","18px").style("height","18px");(t._icon_click||a?.icon_click)&&T.on("click",function(w){p.tree_click(w,this,"icon")})}const x=m.append("a");if((c||s||f)&&x.attr("class",F1).on("click",function(M){p.tree_click(M,this)}),f)return t._break_point=!0,x.attr("title","there are "+(t._parent._childs.length-i)+" more items").text("...more..."),!1;"disp_kind"in p?(tt.DragAndDrop&&c&&this.enableDrag(x,o),tt.ContextMenu&&u&&x.on("contextmenu",function(M){p.tree_contextmenu(M,this)}),x.on("mouseover",function(){p.tree_mouseover(!0,this)}).on("mouseleave",function(){p.tree_mouseover(!1,this)})):t._direct_context&&tt.ContextMenu&&x.on("contextmenu",function(M){p.direct_contextmenu(M,this)});let v=t._name,b="";if("_realname"in t&&(v=t._realname),"_title"in t&&(b=t._title),"_fullname"in t&&(b+=" fullname: "+t._fullname),b||(b=v),x.attr("title",b).text(v+("_value"in t?":":"")).style("background",t._background?t._background:null),"_value"in t){const M=m.append("p");"_vclass"in t&&M.attr("class",t._vclass),t._isopen||M.text(t._value)}if(s&&(r||t._isopen)){const M=d.append("div").attr("class","h_childs");this.show_overflow&&M.style("overflow","initial");for(let T=0;T<t._childs.length;++T){const w=t._childs[T];if(w._parent=t,!this.addItemHtml(w,M,T))break}}return!0}toggleOpenState(t,e,i){const r=e||this.h;if(r._childs===void 0){if(!t||this.with_icons&&!r._more&&!r._expand&&!this.canExpandItem(r))return!1;const a=this.expandItem(this.itemFullName(r));return id(a)&&se(i)&&i.push(a),r._childs!==void 0&&(r._isopen=!0),r._isopen}if(r!==this.h&&t&&!r._isopen)return r._isopen=!0,!0;let s=!1;for(let a=0;a<r._childs.length;++a)this.toggleOpenState(t,r._childs[a],i)&&(s=!0);return r!==this.h&&!t&&r._isopen&&!s?(delete r._isopen,!0):(e||this.refreshHtml(),!1)}async expandToLevel(t){if(!t||!Number.isFinite(t)||t<0)return this;const e=[];return this.toggleOpenState(!0,this.h,e),Promise.all(e).then(()=>this.expandToLevel(t-1))}async exapndToLevel(t){return this.expandToLevel(t)}async refreshHtml(){const t=this.selectDom();if(t.empty())return this;t.html("").style("overflow",this.show_overflow?"auto":"hidden").style("display","flex").style("flex-direction","column"),IY(t.node());const e=this,i=[];let r=null;if(this.forEachItem(o=>{delete o._d3cont,"_fastcmd"in o&&o._kind==="Command"&&i.push(o),"_status"in o&&!r&&(r=o)}),!this.h||t.empty())return this;if(i.length){const o=t.append("div").attr("style","display: inline; vertical-align: middle; white-space: nowrap;");for(let h=0;h<i.length;++h){const l=o.append("button").text("").attr("class","jsroot_fastcmd_btn").attr("item",this.itemFullName(i[h])).attr("title",i[h]._title).on("click",function(){e.executeCommand(Ct(this).attr("item"),this)});i[h]._icon&&l.style("background-image",`url('${i[h]._icon}')`)}}const s=t.append("p").attr("class","jsroot").style("margin-bottom","3px").style("margin-top",0);s.append("a").attr("class",vl).text("expand all").attr("title","expand all items in the browser").on("click",()=>this.toggleOpenState(!0)),s.append("text").text(" | "),s.append("a").attr("class",vl).text("collapse all").attr("title","collapse all items in the browser").on("click",()=>this.toggleOpenState(!1)),lt(this.storeAsJson)&&(s.append("text").text(" | "),s.append("a").attr("class",vl).text("json").attr("title","dump to json file").on("click",()=>this.storeAsJson())),lt(this.removeInspector)&&(s.append("text").text(" | "),s.append("a").attr("class",vl).text("remove").attr("title","remove inspector").on("click",()=>this.removeInspector())),"_online"in this.h&&(s.append("text").text(" | "),s.append("a").attr("class",vl).text("reload").attr("title","reload object list from the server").on("click",()=>this.reload())),"disp_kind"in this&&(s.append("text").text(" | "),s.append("a").attr("class",vl).text("clear").attr("title","clear all drawn objects").on("click",()=>this.clearHierarchy(!1)));const a=t.append("div").attr("class","jsroot").style("font-size",this.with_icons?"12px":"15px").style("flex","1");if(this.show_overflow||a.style("overflow","auto"),this.background&&a.style("background-color",this.background).style("margin","2px").style("padding","2px"),this.textcolor&&a.style("color",this.textcolor),this.addItemHtml(this.h,a.append("div").attr("class",Cc)),this.setTopPainter(),r&&!this.status_disabled&&!Lu().has("nostatus")){const o=ts(r._status);if(lt(o))return this.createStatusLine().then(h=>{h&&o(h,this.itemFullName(r))})}return this}updateTreeNode(t,e){if(e===void 0||e.empty()){e=Ct(t._d3cont?t._d3cont:null);const i=this.itemFullName(t);if(e.empty()&&(e=this.selectDom().select(`[item='${i}']`)),e.empty()&&"_cycle"in t&&(e=this.selectDom().select(`[item='${i};${t._cycle}']`)),e.empty())return}this.addItemHtml(t,e,"update"),this.brlayout?.adjustBrowserSize(!0)}updateBackground(t,e){if(!t||!t._d3cont)return;const i=Ct(t._d3cont);if(i.empty())return;const r=i.select(`.${F1}`);r.style("background",t._background?t._background:null),e&&t._background&&r.node().scrollIntoView(!1)}async focusOnItem(t){Pt(t)&&(t=this.findItem(t));const e=t?this.itemFullName(t):"";if(!e)return!1;let i=t,r=!1;for(;i;)i._childs!==void 0&&!i._isopen&&(i._isopen=!0,r=!0),i=i._parent;return(r?this.refreshHtml():Promise.resolve(!0)).then(()=>{const a=this.selectDom().select(`[item='${e}']`);return a.empty()?!1:(a.node().scrollIntoView(),!0)})}tree_click(t,e,i){if(!e)return;let r=Ct(e.parentNode.parentNode),s=r.attr("item"),a=s?this.findItem(s):null;if(!a)return;if(i==="parentminus"){let d=Ct(e).property("upcnt")||1;for(;d-- >0;)a=a?._parent;if(!a)return;s=this.itemFullName(a),r=Ct(a?._d3cont||null),i=bu}if(a._break_point){delete a._break_point,this.addItemHtml(a,r,"update");const d=a._parent,u=d._childs.indexOf(a),p=Ct(r.node().parentNode);if(u<0)return console.error("internal error");d._show_limit=(d._show_limit||tt.HierarchyLimit)*2;for(let m=u+1;m<d._childs.length;++m){const g=d._childs[m];if(g._parent=d,!this.addItemHtml(g,p,m))break}return}let o=a,h;for(;o&&(h=o._click_action)===void 0;)o=o._parent;i||(i="item");const l=a._kind===Ee(U1)&&a._more?"noinspect":"",c=Bc(a._kind,l),f=c.handle;if(i==="icon"){let d=null;lt(a._icon_click)?d=a._icon_click:lt(f?.icon_click)&&(d=f.icon_click),d&&d(a,this)&&this.updateTreeNode(a,r);return}if(i==="item"&&"_expand"in a&&!a._expand_miss&&!t.ctrlKey&&!t.shiftKey&&(i=bu),i===bu&&!("_childs"in a)&&a._more||i===bu&&f?.pm||i==="item"&&h===Nl)return this.expandItem(s,r);if(i==="item"){if(a._player)return this.player(s);if(f?.aslink)return window.open(s+"/");if(f?.execute)return this.executeCommand(s,e.parentNode);if(f?.ignore_online&&this.isOnlineItem(a))return;const d=this.default_by_click===Nl;let u=a._can_draw,p=a._more,m="";if(t.shiftKey&&(m=f?.shift||Li,Pt(m)&&m.indexOf(Li)===0&&f?.noinspect&&(m="")),t.ctrlKey&&f?.ctrl&&(m=f.ctrl),!m&&!f?.always_draw){for(let g=a._parent;g;g=g._parent)if(g._painter){u=!1,p===void 0&&(p=!1);break}}if(a._childs&&(p=!1),u===void 0&&(u=c.draw),p===void 0&&(p=c.expand||c.get_expand),u&&p&&!m&&(d||f?.dflt===Nl||f?.expand_after_draw&&this.isItemDisplayed(s))&&(u=!1),u&&!m&&(m=WA),u)return this.display(s,m,null,!0);if(p||d)return this.expandItem(s,r);if(Aa(a._kind)&&c.inspect&&u!==!1)return this.display(s,Li,null,!0);if(!a._childs||a===this.h)return}a._isopen?delete a._isopen:a._isopen=!0,this.updateTreeNode(a,r)}tree_mouseover(t,e){const i=Ct(e.parentNode.parentNode).attr("item"),r=this.findItem(i);if(!r)return;let s,a=r;for(;a&&!s;)s=a._painter,a=a._parent;lt(s?.mouseOverHierarchy)&&s.mouseOverHierarchy(t,i,r)}direct_contextmenu(t,e){t.preventDefault();const i=Ct(e.parentNode.parentNode).attr("item"),r=this.findItem(i);r&<(this.fill_context)&&fr(t,this).then(s=>{this.fill_context(s,r),s.size()>0&&(s.tree_node=e.parentNode,s.show())})}fillSettingsMenu(t,e){t.addSettingsMenu(!0,e,i=>{i==="refresh"?(this.forEachRootFile(r=>ql(r,r._file.fKeys,r._file,"")),this.refreshHtml()):i==="dark"?this.changeDarkMode():i==="width"&&this.brlayout?.adjustSeparators(tt.BrowserWidth,null)})}changeDarkMode(){this.textcolor&&(this.setBasicColors(),this.refreshHtml()),this.brlayout?.createStyle(),this.createButtons(),lt(this.disp?.changeDarkMode)&&this.disp.changeDarkMode(),this.disp?.forEachFrame(t=>{const e=bl(t)||um(t);lt(e?.changeDarkMode)&&e!==this&&e.changeDarkMode()})}toggleDarkMode(){tt.DarkMode=!tt.DarkMode,this.changeDarkMode()}tree_contextmenu(t,e){t.preventDefault();const i=Ct(e.parentNode.parentNode).attr("item"),r=this.findItem(i);if(!r)return;const s=this.getOnlineProp(i),a=this.getFileProp(i);function o(h){const l=f=>f.split("&").join("&").split("<").join("<").split('"').join("""),c=document.createElement("div");return c.innerHTML=`<a href="${l(h)}">x</a>`,c.firstChild.href}return fr(t,this).then(h=>{if((!i||!r._parent)&&!("_jsonfile"in r)){let l="",c=0;const f=[],d=()=>c++>0?"&":"?";this.forEachRootFile(m=>f.push(m._file.fFullURL)),this.getTopOnlineItem()||(l=li+"index.htm"),this.isMonitoring()&&(l+=d()+"monitoring="+this.getMonitoringInterval()),f.length===1?l+=`${d()}file=${f[0]}`:f.length>1&&(l+=`${d()}files=${JSON.stringify(f)}`),this.disp_kind&&(l+=d()+"layout="+this.disp_kind.replace(/ /g,""));const u=[],p=[];this.disp?.forEachFrame(m=>{const g=new Vn(m);let y=g.getTopPainter(),A=y?y.getItemName():null,_;A?_=y.getDrawOpt()||y.getItemDrawOpt():(y=null,g.forEachPainter(x=>{const v=x.getItemName();if(!v)return;let b=x.getDrawOpt()||x.getItemDrawOpt()||"";y?y.getPadPainter()===x.getPadPainter()&&(b.indexOf("same ")===0&&(b=b.slice(5)),A+="+"+v,_+="+"+b):(y=x,A=v,_=b)})),A&&(u.push(A),p.push(_||""))}),u.length===1?l+=d()+"item="+u[0]+d()+"opt="+p[0]:u.length>1&&(l+=d()+"items="+JSON.stringify(u)+d()+"opts="+JSON.stringify(p)),h.add("Direct link",()=>window.open(l)),h.add("Only items",()=>window.open(l+"&nobrowser")),this.fillSettingsMenu(h)}else if(s)this.fillOnlineMenu(h,s,i);else{const l=Bc(r._kind,"nosame");if(r._can_draw&&(l.opts||(l.opts=[""]),l.opts.indexOf("")<0&&l.opts.unshift("")),l.opts){h.addDrawMenu("Draw",l.opts,f=>this.display(i,f),"Draw item in the new frame");const c=this.disp?.getActiveFrame();!l.noappend&&c&&(bl(c)||um(c))&&h.addDrawMenu("Superimpose",l.opts,f=>this.dropItem(i,c,f),"Superimpose item with drawing on active frame")}if(a&&l.opts&&!a.localfile){const c=tt.NewTabUrl||li;let f=o(a.fileurl);if(f.indexOf(c)===0&&(f=f.slice(c.length)),f=`${a.kind}=${f}`,a.itemname){let u=a.itemname;u.search(/\+| |,/)>=0&&(u=`'${u}'`),f+=`&item=${u}`}let d="nobrowser";tt.WithCredentials&&(d+="&with_credentials"),tt.NewTabUrlPars&&(d+="&"+tt.NewTabUrlPars),tt.NewTabUrlExportSettings&&(K.fOptStat!==1111&&(d+=`&optstat=${K.fOptStat}`),K.fOptFit&&(d+=`&optfit=${K.fOptFit}`),K.fOptDate&&(d+=`&optdate=${K.fOptDate}`),K.fOptFile&&(d+=`&optfile=${K.fOptFile}`),K.fOptTitle!==1&&(d+=`&opttitle=${K.fOptTitle}`),tt.TimeZone==="UTC"?d+="&utc":tt.TimeZone==="Europe/Berlin"?d+="&cet":tt.TimeZone&&(d+=`&timezone='${tt.TimeZone}'`),Math.abs(K.fDateX-.01)>.001&&(d+=`&datex=${K.fDateX.toFixed(3)}`),Math.abs(K.fDateY-.01)>.001&&(d+=`&datey=${K.fDateY.toFixed(3)}`),K.fHistMinimumZero&&(d+="&histzero"),tt.DarkMode&&(d+="&dark=on"),tt.UseStamp||(d+="&usestamp=off"),tt.OnlyLastCycle&&(d+="&lastcycle"),tt.OptimizeDraw!==1&&(d+=`&optimize=${tt.OptimizeDraw}`),tt.MaxRanges!==200&&(d+=`&maxranges=${tt.MaxRanges}`),tt.FuncAsCurve&&(d+="&tf1=curve"),!tt.ToolBar&&!tt.Tooltip&&!tt.ContextMenu&&!tt.Zooming&&!tt.MoveResize&&!tt.DragAndDrop?d+="&interactive=0":tt.ContextMenu||(d+="&nomenu")),h.addDrawMenu("Draw in new tab",l.opts,u=>window.open(`${c}?${d}&${f}&opt=${u}`),"Draw item in the new browser tab or window")}(l.expand||l.get_expand)&&(r._more||r._more===void 0)&&(r._childs===void 0?h.add("Expand",()=>this.expandItem(i),"Expand content of object"):h.add("Unexpand",()=>{r._more=!0,delete r._childs,delete r._isopen,r.expand_item&&delete r._expand,this.updateTreeNode(r)},"Remove all childs from hierarchy")),r._kind===Ee(uf)&&h.add("Apply",()=>this.applyStyle(i))}lt(r._menu)&&r._menu(h,r,this),h.size()>0&&(h.tree_node=e.parentNode,h.separ&&h.separator(),h.add("Close"),h.show())}),!1}async player(t,e){const i=this.findItem(t);if(!Pt(i?._player))return null;let r;if(i._module){const s=await this.importModule(i._module);r=s?s[i._player]:null}else(i._prereq||i._player.indexOf("JSROOT.")>=0)&&await this.loadScripts("",i._prereq),r=ts(i._player);return lt(r)?(await this.createDisplay(),r(this,t,e)):null}canDisplay(t,e){if(!t)return!1;if(t._player)return!0;if(t._can_draw!==void 0)return t._can_draw;if(Pt(e)&&e.indexOf(Li)===0)return!0;const i=ui(t._kind,e);return af(i)}isItemDisplayed(t){return this.getDisplay()?.findFrame(t)!==null}async display(t,e,i=null,r=!1){const s=t;let a=null,o=!1,h=null,l=t;(i===!0||i===!1)&&(r=i,i=null),Pt(i)&&i.indexOf("frame:")===0&&(l=i.slice(6),i=null);const c=(f,d)=>(d&&console.log("When display ",t,"got",d),o&&h&&delete h._doing_update,o||Sn(),lt(f?.setItemName)&&(f.setItemName(s,o?null:e,this),h&&!h._painter&&(h._painter=f)),f||a);return this.createDisplay().then(f=>{if(!f)return c();if(h=this.findItem(s),h?._player)return this.player(s,e).then(u=>c(u));if(o=Pt(e)&&e.indexOf("update:")===0,o){if(e=e.slice(7),!h||h._doing_update)return c();h._doing_update=!0}if(h&&!this.canDisplay(h,e))return c();const d=e===WA;return d&&(e=""),o||Sn(`Loading ${s} ...`),this.getObject(s,e).then(u=>{o||Sn(),h||(h=u.item);let p=u.obj;if(!p)return c();o||Sn(`Drawing ${s} ...`);let m=p._typename?ui(Ee(p._typename)):null;if(m?.draw_field&&p[m.draw_field]&&(p=p[m.draw_field],e||(e=m.draw_field_opt||""),m=p._typename?ui(Ee(p._typename)):null),d&&!e&&m?.dflt&&m.dflt!==Nl&&(e=m.dflt),i)return this.callDrawFunc(i,p,e,o).then(_=>c(_)).catch(_=>c(null,_));let g=!1;const y=[];if(f.forEachPainter((_,x)=>{if(_.getItemName()!==s)return;const v=_.getItemDrawOpt();if(d&&r&&(e=v),!(!o&&e&&v!==e)&&(r&&!g&&(g=!0,f.activateFrame(x)),lt(_.redrawObject))){const b=_.redrawObject(p,e);b&&(a=_,y.push(b))}}),a)return Promise.all(y).then(()=>c());if(o)return console.warn(`something went wrong - did not found painter when doing update of ${s}`),c();const A=f.findFrame(l,!0);return pr(A),f.activateFrame(A),this.callDrawFunc(A,p,e).then(_=>c(_)).catch(_=>c(null,_))})})}enableDrag(t){t.attr("draggable","true").on("dragstart",function(e){const i=this.parentNode.parentNode.getAttribute("item");e.dataTransfer.setData("item",i)})}enableDrop(t){const e=this;Ct(t).on("dragover",i=>{const r=i.dataTransfer.getData("item"),s=e.findItem(r);Aa(s?._kind)&&i.preventDefault()}).on("dragenter",function(){Ct(this).classed("jsroot_drag_area",!0)}).on("dragleave",function(){Ct(this).classed("jsroot_drag_area",!1)}).on("drop",function(i){Ct(this).classed("jsroot_drag_area",!1);const r=i.dataTransfer.getData("item");if(!r)return;const s=[],a=[];let o=bl(this),h=i.target;if(o?.forEachPainter(l=>{s.push(l),a.push(l.getPadSvg().node())},"pads"),s.length>1)for(;h&&h!==this;){const l=a.indexOf(h);if(l>0){o=s[l];break}h=h.parentNode}e.dropItem(r,o||this)})}clearDrop(t){Ct(t).on("dragover",null).on("dragenter",null).on("dragleave",null).on("drop",null)}async dropItem(t,e,i){(!i||!Pt(i))&&(i="");const r=(s,a)=>(!a&<(s?.setItemName)&&s.setItemName(t,null,this),s);if(t==="$legend"){const s=bl(e);return lt(s?.buildLegend)?s.buildLegend(0,0,0,0,"",i).then(a=>r(a)):(console.error("Not possible to build legend"),r(null))}return this.getObject(t).then(s=>{if(!s.obj)return null;const a=um(e);if(lt(a?.performDrop))return a.performDrop(s.obj,t,s.item,i).then(l=>r(l,a===l));const o=s.obj._typename?Bc(Ee(s.obj._typename)):null;return o?.draw?(bl(e)?o?.has_same&&a&&(i="same "+i):this.cleanupFrame(e),lt(e?.addPadButtons)&&e.addPadButtons(),this.callDrawFunc(e,s.obj,i).then(l=>r(l,a===l))):null})}async updateItems(t){if(!this.disp)return!1;const e=[],i=[];let r=!1,s=!1;return Pt(t)?t=[t]:se(t)||(t===void 0&&(t=!this.isMonitoring()),s=!0,r=!!t),this.disp.forEachPainter(a=>{const o=a.getItemName();if(!(!Pt(o)||e.indexOf(o)>=0)){if(s){const h=this.findItem(o);if(!h||h._not_monitor||h._player)return;if(!("_always_monitor"in h)){const l=ui(h._kind);let c=!1;if(l?.monitor!==void 0){if(l.monitor===!1||l.monitor==="never")return;l.monitor==="always"&&(c=!0)}if(!c&&r)return}}else if(t.indexOf(o)<0)return;e.push(o),i.push("update:"+a.getItemDrawOpt())}},!0),this.files_monitoring&&!r&&s&&this.forEachRootFile(a=>{this.forEachItem(o=>{delete o._readobj},a),delete a._file}),this.displayItems(e,i)}async displayItems(t,e){if(!t?.length)return!0;const i=this;for(e||(e=[]);e.length<t.length;)e.push(WA);if(e.length===1&&e[0]==="iotest"){this.clearHierarchy(),Ct("#"+this.disp_frameid).html("").append("h2").text("Start I/O test");const l=new Date;return this.getObject(t[0]).then(c=>{const f=new Date;return Ct("#"+this.disp_frameid).append("h2").text(`Item ${t[0]} reading `+(c?.obj?`type ${c?.obj._typename} time = ${f.getTime()-l.getTime()}ms`:"fail")),!0})}const r=new Array(t.length),s=new Array(t.length),a=new Array(t.length);for(let l=0;l<t.length;++l){r[l]=s[l]=null;const c=t[l];let f=!0;if(c?.indexOf("img:")===0){a[l]=!0;continue}c?.length>1&&c.at(0)==="'"&&c.at(-1)==="'"&&(t[l]=c.slice(1,c.length-1),f=!1);let d=i.findItem({name:t[l],check_keys:!0});if(d){t[l]=i.itemFullName(d);continue}if(f&&t[l].at(0)==="["&&t[l].at(-1)==="]"?(r[l]=bo(t[l]),t[l]=r[l].shift()):f&&t[l].indexOf("+")>0&&(r[l]=t[l].split("+"),t[l]=r[l].shift()),r[l]?.length){for(let p=0;p<r[l].length;++p){const m=r[l][p].indexOf("_same_");m>0&&i.findItem(r[l][p])===null&&(r[l][p]=r[l][p].slice(0,m)+t[l].slice(m)),d=i.findItem({name:r[l][p],check_keys:!0}),d&&(r[l][p]=i.itemFullName(d))}for(e[l].at(0)==="["&&e[l].at(-1)==="]"?(s[l]=bo(e[l]),e[l]=s[l].shift()):e[l].indexOf("+")>0?(s[l]=e[l].split("+"),e[l]=s[l].shift()):s[l]=[];s[l].length<r[l].length;)s[l].push("")}const u=t[l].indexOf("_same_");u>0&&!i.findItem(t[l])&&l>0&&(t[l]=t[l].slice(0,u)+t[0].slice(u)),d=i.findItem({name:t[l],check_keys:!0}),d&&(t[l]=i.itemFullName(d))}for(let l=t.length-1;l>=0;--l){if(a[l])continue;const c=i.findItem(t[l]);!c||i.canDisplay(c,e[l])||(i.expandItem(t[l],null,!0),t.splice(l,1),e.splice(l,1),r.splice(l,1))}if(!t.length)return!0;const o=new Array(t.length),h=new Array(t.length);for(let l=0;l<t.length;++l){h[l]=0;let c=t[l],f=0;t.indexOf(c)<l&&(h[l]=!0);const d=e[l].indexOf("frameid:");if(d>=0)c=e[l].slice(d+8),e[l]=e[l].slice(0,d);else for(;o.indexOf(c)>=0;)c=t[l]+"_"+f++;o[l]=c}for(let l=0;l<t.length;++l){if(h[l]!==0)continue;let c=l;for(let f=0;f<t.length;++f)t[l]===t[f]&&e[f].indexOf("main")>=0&&(c=f);for(let f=0;f<t.length;++f)t[l]===t[f]&&(h[f]=c!==f)}return this.createDisplay().then(l=>{if(!l)return!1;const c=new Array(t.length);for(let u=0;u<t.length;++u)e[u].indexOf("update:")&&(l.createFrame(o[u]),c[u]="frame:"+o[u]);function f(u,p){if(p&&r[u]?.length)return i.dropItem(r[u].shift(),p.getDrawDom(),s[u].shift()).then(()=>f(u,p));r[u]=null,t[u]=null;for(let m=0;m<t.length;++m)if(t[m]!==null&&h[m]&&t.indexOf(t[m])===m)return h[m]=!1,i.display(t[m],e[m],c[m]).then(g=>f(m,g))}const d=[];if(this.#h){let u=function(p){return p>=t.length?!0:h[p]?u(p+1):i.display(t[p],e[p],c[p]).then(m=>f(p,m)).then(()=>u(p+1))};d.push(u(0))}else for(let u=0;u<t.length;++u)h[u]||d.push(i.display(t[u],e[u],c[u]).then(p=>f(u,p)));return Promise.all(d).then(()=>{l?.createFinalBatchFrame&&Ci()&&!Se()&&l.createFinalBatchFrame()})})}async reload(){return"_online"in this.h?this.openOnline(this.h._online).then(()=>this.refreshHtml()):!1}activateItems(t,e){Pt(t)&&(t=[t]);const i=[],r=[];this.forEachItem(a=>{a._background&&(i.push(a),delete a._background)});const s=(a,o)=>{if(a===void 0){if(!t.length){r.reverse().forEach(l=>this.updateTreeNode(l)),i.forEach(l=>this.updateBackground(l,e));return}a=t.shift()}let h=this.findItem(a);if(!h){const l=this.findItem({name:a,last_exists:!0,check_keys:!0,allow_index:!0});if(!l||!l.last)return s();if(l.now_found=this.itemFullName(l.last),e)return o!==void 0&&l.now_found===o?s():this.expandItem(l.now_found).then(c=>{if(!c)return s();let f=this.itemFullName(l.last);f&&(f+="/"),s(f+l.rest,l.now_found)});h=l.last}if(h){let l=h._parent;for(;l;){if(!l._isopen)if(e)l._isopen=!0,r.indexOf(l)<0&&r.push(l);else{h=l;break}l=l._parent}h._background="LightSteelBlue",i.indexOf(h)<0&&i.push(h)}s()};if(e&&this.brlayout){if(!this.brlayout.browser_kind)return this.createBrowser("float",!0).then(()=>s());this.brlayout.browser_visible||this.brlayout.toggleBrowserVisisbility()}s()}canExpandItem(t){if(!t)return!1;if(t._expand)return!0;const e=ui(t._kind,"::expand");return e&&G5(e)}async expandItem(t,e,i){const r=this.findItem(t),s=this;if(!r&&e)return;function a(l){return l._childs===void 0?l._expand_miss=!0:(l._isopen=!0,l._parent&&!l._parent._isopen?(l._parent._isopen=!0,i||s.updateTreeNode(l._parent)):i||s.updateTreeNode(l,e)),l}async function o(l,c){if(delete l._expand_miss,Pt(l._expand)&&(l._expand=ts(l._expand)),!lt(l._expand)){let f=ui(l._kind,"::expand");if(f?.expand_item&&!s._inspector&&(c=c[f.expand_item],l.expand_item=f.expand_item,f=c?._typename?ui(Ee(c._typename),"::expand"):null),f?.expand||f?.get_expand)if(lt(f.expand))l._expand=f.expand;else if(Pt(f.expand)){if(!Kt.ignore_v6){const d=await cf();await d.require(f.prereq),await d._complete_loading()}l._expand=f.expand=ts(f.expand)}else lt(f.get_expand)&&(l._expand=f.expand=await f.get_expand())}if(c&<(l._expand)){const f=l._expand(l,c);if(f)return Go(f).then(()=>a(l))}return c&&Rf(l,c)?a(l):(l._expand_miss=!0,-1)}let h=Promise.resolve(-1);if(r){if(r._more===!1||!r._parent&&r._childs)return;if(r._childs&&r._isopen){r._isopen=!1,i||this.updateTreeNode(r,e);return}r._obj&&(h=o(r,r._obj))}return h.then(l=>l!==-1?l:(Sn("Loading "+t),this.getObject(t,i?"hierarchy_expand":"hierarchy_expand_verbose").then(c=>{if(Sn(),c.obj)return o(c.item,c.obj).then(f=>f!==-1?f:void 0)})))}getTopOnlineItem(t){if(t){for(;t&&!("_online"in t);)t=t._parent;return t}return this.h?this.h._online?this.h:this.h._childs&&this.h._childs[0]?._online?this.h._childs[0]:null:null}forEachJsonFile(t){if(this.h){if(this.h._jsonfile)return t(this.h);this.h._childs?.forEach(e=>{e._jsonfile&&t(e)})}}async openJsonFile(t){let e=!1;if(this.forEachJsonFile(i=>{i._jsonfile===t&&(e=!0)}),!e)return br(t,"object").then(i=>{if(!i)return;const r={_jsonfile:t,_kind:Ee(i._typename),_jsontmp:i,_name:t.split("/").pop()};if(i.fTitle&&(r._title=i.fTitle),r._get=function(s){return s._jsontmp?Promise.resolve(s._jsontmp):br(s._jsonfile,"object").then(a=>(s._jsontmp=a,a))},!this.h)this.h=r;else if(this.h._kind===la)this.h._childs.push(r);else{const s=this.h,a=s?._jsonfile?"Files":"Items";this.h={_name:a,_kind:la,_childs:[s,r]}}return this.refreshHtml()})}forEachRootFile(t){if(this.h){if(this.h._kind===nc&&this.h._file)return t(this.h);this.h._childs?.forEach(e=>{e._kind===nc&&e._fullurl&&t(e)})}}findRootFileForItem(t){let e=this.findItem(t);for(;e;){if(e._kind===nc&&e._fullurl&&e._file)return e;e=e?._parent}return null}async openRootFile(t){let e=!1;if(this.forEachRootFile(r=>{r._fullurl===t&&(e=!0)}),e)return;const i=Pt(t)?t:"file";return Sn(`Opening ${i} ...`),Uu(t).then(r=>{const s=this.fileHierarchy(r);if(s._isopen=!0,!this.h)this.h=s,this.#a&&(s._name=this.#a);else if(this.h._kind===la)this.h._childs.push(s);else{const a=this.h,o=a._kind===nc?"Files":"Items";this.h={_name:o,_kind:la,_childs:[a,s],_isopen:!0}}return this.refreshHtml()}).catch(()=>(Ci()?console.error(`Fail to open ${i} - check CORS headers`):Ct("#gui_fileCORS").style("background","red").empty()||setTimeout(()=>Ct("#gui_fileCORS").style("background",""),5e3),!1)).finally(()=>Sn())}async listServerDir(t){return br(t,"text").then(e=>{if(!e)return!1;const i={_name:"Files",_kind:la,_childs:[],_isopen:!0},r={};let s=0;for(;s<e.length&&(s=e.indexOf('a href="',s+1),!(s<0));){s+=8;const a=e.indexOf('"',s+1);if(a<0)break;const o=e.slice(s,a);s=a+1,!r[o]&&(r[o]=!0,o.lastIndexOf(".root")===o.length-5&&o.length>5?i._childs.push({_name:o,_title:t+o,_url:t+o,_kind:nc,_click_action:Nl,_more:!0,_obj:{},_expand:h=>Uu(h._url).then(l=>{if(!l)return!1;delete h._expand,delete h._more,delete h._click_action,delete h._obj,h._isopen=!0,this.fileHierarchy(l,h),this.updateTreeNode(h)})}):(o.lastIndexOf(".json.gz")===o.length-8&&o.length>8||o.lastIndexOf(".json")===o.length-5&&o.length>5)&&i._childs.push({_name:o,_title:t+o,_jsonfile:t+o,_can_draw:!0,_get:h=>br(h._jsonfile,"object").then(l=>(l&&(h._kind=Ee(l._typename),h._jsontmp=l,this.updateTreeNode(h)),l))}))}return i._childs.length&&(this.h=i),!0})}async applyStyle(t){if(!t)return!0;let e=Promise.resolve(t);if(Pt(t)){const i=this.findItem({name:t,allow_index:!0,check_keys:!0});i!==null?e=this.getObject(i).then(r=>r.obj):t.indexOf(".json")>0&&(e=br(t,"object"))}return e.then(i=>{i?._typename===uf&&Object.assign(K,i)})}getFileProp(t){let e=this.findItem(t);if(!e)return null;for(t=e._name;e._parent;){if(e=e._parent,e._file)return{kind:"file",fileurl:e._file.fURL,itemname:t,localfile:!!e._file.fLocalFile};if(e._jsonfile)return{kind:"json",fileurl:e._jsonfile,itemname:t};t=e._name+"/"+t}return null}getOnlineItemUrl(t){Pt(t)&&(t=this.findItem(t));let e=t;for(;e&&e._online===void 0;)e=e._parent;return e?e._online+this.itemFullName(t,e):null}isOnlineItem(t){return this.getOnlineItemUrl(t)!==null}async importModule(t){switch(t){case"core":return Qt(()=>Promise.resolve().then(()=>lP),void 0);case"draw_tree":return Qt(()=>import("./TTree-CE4EQRMu.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,10,11,12,13,14,15]));case"hierarchy":return{HierarchyPainter:h0,markAsStreamerInfo:K8}}return import(t)}setCachedObject(t){this.#d=t}async getOnlineItem(t,e,i){let r=e,s=!1,a="",o="object",h=null;if(Pt(i)&&i.indexOf("hierarchy_expand")===0&&(s=!0,i=void 0),t){r=this.getOnlineItemUrl(t);let l=null;if(t._kind&&(h=ui(t._kind)),s?(a="h.json?compact=3",t._expand=Lm):t._make_request?t._module?l=(await this.importModule(t._module))[t._make_request]:l=ts(t._make_request):h?.make_request&&(l=h.make_request),lt(l)){const c=l(this,t,r,i);c&&(Pt(c)?a=c:(c.req&&(a=c.req),c.kind&&(o=c.kind)))}!a&&!Aa(t._kind)&&(a="item.json.gz?compact=3")}if(!e&&t&&this.#d&&!a){const l=this.#d;return this.#d=void 0,l}return a||(a="root.json.gz?compact=23"),r&&(r+="/"),r+=a,new Promise(l=>{let c=null;z1(r,o,f=>{const d=u=>{if(lt(u)){const p=u(this,t,f,i,c);se(p)&&(f=p)}l(f)};!s&&t?._after_request?t._module?this.importModule(t._module).then(u=>d(u[t._after_request])):d(ts(t._after_request)):d(h?.after_request)},void 0,!0).then(f=>{c=f,f.send(null)})})}async openOnline(t){const e=async i=>{if(this.h=i,!i)return Promise.resolve(null);this.h?._title&&typeof document<"u"&&(document.title=this.h._title),i._isopen=!0,this.h._online=t,this.h._get=(h,l,c)=>this.getOnlineItem(h,l,c),this.h._expand=Lm;const r=[],s=[],a=[],o=[];return this.forEachItem(h=>{h._childs!==void 0&&(h._expand=Lm),h._autoload&&h._autoload.split(";").forEach(c=>{c.length>4&&c.lastIndexOf(".mjs")===c.length-4?o.push(this.importModule(c)):c.length>3&&c.lastIndexOf(".js")===c.length-3?s.find(f=>f===c)||s.push(c):c.length>4&&c.lastIndexOf(".css")===c.length-4?r.find(f=>f===c)||r.push(c):c&&!a.find(f=>f===c)&&a.push(c)})}),this.loadScripts(s,a).then(()=>Cr(r)).then(()=>Promise.all(o)).then(()=>(this.forEachItem(h=>{if(!("_drawfunc"in h)||!("_kind"in h))return;const l=Aa(h._kind)||`kind:${h._kind}`,c=h._drawopt;(!af(l)||c)&&Od({name:l,func:h._drawfunc,script:h._drawscript,opt:c})}),this))};if(t||(t=""),se(t)){const i=t;return t="",e(i)}return br(t+"h.json?compact=3","object").then(i=>e(i))}getOnlineProp(t){let e=this.findItem(t);if(!e)return null;for(t=e._name;e._parent;){if(e=e._parent,e._online)return{server:e._online,itemname:t};t=e._name+"/"+t}return null}fillOnlineMenu(t,e,i){const r=this.findItem(i),s=Bc(r._kind,"nosame;noinspect"),a=ui(r._kind),o=Aa(r._kind);s.opts&&r._can_draw!==!1&&(s.opts.push(Li),t.addDrawMenu("Draw",s.opts,h=>this.display(i,h))),!r._childs&&r._more!==!1&&(r._more||o||s.expand||s.get_expand)&&t.add("Expand",()=>this.expandItem(i)),a?.execute&&t.add("Execute",()=>this.executeCommand(i,t.tree_node)),s.opts&&r._can_draw!==!1&&t.addDrawMenu("Draw in new window",s.opts,h=>window.open(e.server+`?nobrowser&item=${e.itemname}`+(this.isMonitoring()?`&monitoring=${this.getMonitoringInterval()}`:"")+(h?`&opt=${h}`:""))),s.opts?.length&&o&&r._can_draw!==!1&&t.addDrawMenu("Draw as png",s.opts,h=>window.open(e.server+e.itemname+"/root.png?w=600&h=400"+(h?"&opt="+h:"")),"Request PNG image from the server"),r._player&&t.add("Player",()=>this.player(i))}setHierarchy(t){this.h=t,this.refreshHtml()}setMonitoring(t,e){this.#n("cleanup"),t&&(t=parseInt(t),Number.isInteger(t)&&t>0?(this.#i=Math.max(100,t),e=!0):this.#i=3e3),this.#r=e,this.isMonitoring()&&this.#n()}#n(t){if(t==="cleanup"||!this.isMonitoring()){this.#e&&(clearTimeout(this.#e),this.#e=void 0),this.#s&&(cancelAnimationFrame(this.#s),this.#s=void 0);return}if(t==="frame"){this.#e=void 0,this.#s=requestAnimationFrame(()=>this.#n("draw"));return}t==="draw"&&(this.#s=void 0,this.updateItems()),this.#e=setTimeout(()=>this.#n("frame"),this.getMonitoringInterval())}getMonitoringInterval(){return this.#i||3e3}isMonitoring(){return this.#r}setDisplay(t,e){!e&&se(t)?(this.disp=t,this.disp_kind="custom",this.disp_frameid=null):(this.disp_kind=t,this.disp_frameid=e),!this.register_resize&&this.disp_kind!=="batch"&&(this.register_resize=!0,Gv(this))}getLayout(){return this.disp_kind}removePainter(t){this.forEachItem(e=>{e._painter===t&&(delete e._painter,lt(e.clear)&&e.clear())})}clearHierarchy(t){this.disp&&(this.disp.cleanup(),delete this.disp);const e=[];this.forEachItem(i=>{delete i._painter,!t&<(i.clear)&&i.clear(),t&&e.push(i)}),t&&(this.enableMonitoring(!1),this.selectDom().html(""),e.forEach(i=>{delete i._parent,delete i._childs,delete i._obj,delete i._d3cont}),delete this.h)}getDisplay(){return this.disp}cleanupFrame(t){Ct(t).attr("frame_title",null),this.clearDrop(t);const e=pr(t);e.length&&this.forEachItem(i=>{i._painter&&e.indexOf(i._painter)>=0&&delete i._painter})}async createDisplay(){if(this.disp){if(this.disp.numDraw()>0||this.disp_kind==="custom")return this.disp;this.disp.cleanup(),delete this.disp}return this.disp_kind==="batch"?(Se()?pv():Promise.resolve(null)).then(e=>(this.disp=new jS(1200,800,e?.body),this.disp)):!this.disp_frameid||!document.getElementById(this.disp_frameid)?null:(Ci()?this.disp=new jS(tt.CanvasWidth,tt.CanvasHeight):this.disp_kind.indexOf("flex")===0||this.disp_kind.indexOf("coll")===0?this.disp=new s$(this.disp_frameid):this.disp_kind==="tabs"?this.disp=new r$(this.disp_frameid):this.disp=new jv(this.disp_frameid,this.disp_kind),this.disp.cleanupFrame=this.cleanupFrame.bind(this),tt.DragAndDrop&&this.disp.setInitFrame(this.enableDrop.bind(this)),this.disp)}async createCustomDisplay(t,e){if(this.disp_kind!=="simple")return this.createDisplay();if(this.disp_kind=e,this.disp){const i=this.disp.numDraw();if(i>1||i===1&&!this.disp.findFrame(t))return this.createDisplay();this.disp.cleanup(),delete this.disp}return this.createDisplay()}updateOnOtherFrames(t,e){const i=e._typename?ui(Ee(e._typename)):null;i?.draw_field&&e[i?.draw_field]&&(e=e[i?.draw_field]);let r=!1;return this.disp?.forEachPainter(s=>{s===t||s.getItemName()!==t.getItemName()||lt(s.redrawObject)&&s.redrawObject(e)&&(r=!0)}),r}checkResize(t){this.disp?.checkMDIResize(null,t)}async loadScripts(t,e,i){return!t?.length&&!e?.length?!0:i&&t.indexOf(".mjs")>0?Hd(t.split(";")):(i&&!globalThis.JSROOT&&(globalThis.JSROOT={version:lf,gStyle:K,create:Nt,httpRequest:br,loadScript:Cr,decodeUrl:Lu,source_dir:li,settings:tt,addUserStreamer:lH,addDrawFunc:Od,draw:Xa,redraw:v2}),Kt.ignore_v6||i?Cr(t):cf().then(r=>r.require(e).then(()=>Cr(t)).then(()=>r._complete_loading())))}async startGUI(t,e){const i=Lu(e),r=C=>{let R=i.get(C,null);return R===null&&t&&!t.empty()&&t.node().hasAttribute(C)&&(R=t.attr(C)),R},s=C=>{let R=[];for(;C;){const F=C.indexOf(";");let P=F>0?C.slice(0,F):C;C=F>0?C.slice(F+1):"";let I=!0;P[0]==="#"&&(P=P.slice(1),I=!1);const U=i.get(P,null);I?R=R.concat(bo(U)):U!==null&&R.push(U)}return R},a=C=>{let R=s(C);if(R.length||!t||t.empty())return R;for(;C;){const F=C.indexOf(";");let P=F>0?C.slice(0,F):C;C=F>0?C.slice(F+1):"";let I=!0;if(P[0]==="#"&&(P=P.slice(1),I=!1),P==="files"||!t.node().hasAttribute(P))continue;const U=t.attr(P);I?R=R.concat(bo(U)):U!==null&&R.push(U)}return R},o=i.get("path")||"",h=a("#json;jsons"),l=a("expand"),c=r("focus"),f=r("layout"),d=a("#style"),u=r("title");this.#h=tt.drop_items_one_by_one??r("one_by_one")!==null;let p=r("prereq")||"",m=r("load"),g=r("dir"),y=r("inject"),A=a("#file;files"),_=a("#item;items"),x=a("#opt;opts"),v=r("monitoring"),b=0,M=r("status"),T=r("browser"),w=!!T;if(v===null?v=0:v===""?v=3e3:v=parseInt(v),r("float")!==null?(T="float",w=!0):r("fix")!==null&&(T="fix",w=!0),!w&&ue.screenWidth<=640&&(T="float"),this.no_select=r("noselect"),this.top_info=r("info"),r("files_monitoring")!==null&&(this.files_monitoring=!0),u&&typeof document<"u"&&(document.title=u),!l.length&&r("expand")===""&&l.push(""),o){for(let C=0;C<A.length;++C)A[C]=o+A[C];for(let C=0;C<h.length;++C)h[C]=o+h[C]}if(!_.length&&(r("item")===""||h.length===1&&!l.length)&&_.push(""),!this.disp_kind)if(Pt(f)&&f)this.disp_kind=f;else if(tt.DislpayKind&&tt.DislpayKind!=="simple")this.disp_kind=tt.DislpayKind;else{const C=["simple","simple","vert2","vert21","vert22","vert32","vert222","vert322","vert332","vert333"];this.disp_kind=C[_.length]||"flex"}M==="no"?M=null:M==="off"?(this.status_disabled=!0,M=null):M==="on"?M=!0:M!==null&&(b=parseInt(M),(!Number.isInteger(b)||b<5)&&(b=0),M=!0),this.no_select===""&&(this.no_select=!0),T?T==="no"?T="":T==="off"&&(T="",M=null,this.exclude_browser=!0):T="fix",r("nofloat")!==null&&(this.float_browser_disabled=!0),this.start_without_browser&&(T=""),this.#a=r("topname");const E=()=>{let C;if(m||p)C=this.loadScripts(m,p),m=p="";else if(y)C=this.loadScripts(y,"",!0),y="";else if(T)C=this.createBrowser(T),T="";else if(M!==null)C=this.createStatusLine(b,M),M=null;else if(h.length)C=this.openJsonFile(h.shift());else if(A.length)C=this.openRootFile(A.shift());else if(g)C=this.listServerDir(g),g="";else if(l.length)C=this.expandItem(l.shift());else if(d.length)C=this.applyStyle(d.shift());else return this.refreshHtml().then(()=>this.displayItems(_,x)).then(()=>c?this.focusOnItem(c):this).then(()=>(this.setMonitoring(v),_?this.refreshHtml():this));return C.then(E)};let k=null;if(this.is_online){const C=Kt.getCachedHierarchy||ts("GetCachedHierarchy");lt(C)&&(k=C()),se(k)||(k=""),this.is_online==="draw"&&!_.length&&_.push("")}return k!==null?this.openOnline(k).then(()=>(!this.exclude_browser&&!w&&this.h._browser&&(T=this.h._browser,T==="no"?T="":T==="off"&&(T="",M=null,this.exclude_browser=!0)),"_monitoring"in this.h&&!v&&(v=this.h._monitoring),this.h._loadfile&&!A.length&&(A=bo(this.h._loadfile)),"_drawitem"in this.h&&!_.length&&(_=bo(this.h._drawitem),x=bo(this.h._drawopt)),this.h._layout&&!f&&(this.is_online!=="draw"||_.length>1)&&(this.disp_kind=this.h._layout),"_toptitle"in this.h&&this.exclude_browser&&typeof document<"u"&&(document.title=this.h._toptitle),t&&this.prepareGuiDiv(t.attr("id"),this.disp_kind),E())):(t&&this.prepareGuiDiv(t.attr("id"),this.disp_kind),E())}prepareGuiDiv(t,e){this.gui_div=Pt(t)?t:t.attr("id"),this.brlayout=new KE(this.gui_div,this),this.brlayout.create(!this.exclude_browser),this.createButtons(),this.setDisplay(e,this.brlayout.drawing_divid())}createButtons(){if(this.exclude_browser)return;const t=this.brlayout?.createBrowserBtns();t&&(Ai.createSVG(t,Ai.diamand,15,"toggle fix-pos browser","browser").style("margin","3px").on("click",()=>this.createBrowser("fix",!0)),this.float_browser_disabled||Ai.createSVG(t,Ai.circle,15,"toggle float browser","browser").style("margin","3px").on("click",()=>this.createBrowser("float",!0)),this.status_disabled||Ai.createSVG(t,Ai.three_circles,15,"toggle status line","browser").style("margin","3px").on("click",()=>this.createStatusLine(0,"toggle")))}hasStatusLine(){return this.status_disabled||!this.gui_div||!this.brlayout?!1:this.brlayout.hasStatus()}async createStatusLine(t,e){return this.status_disabled||!this.gui_div||!this.brlayout?"":this.brlayout.createStatusLine(t,e)}redrawObject(t){return!this._inspector&&!this._streamer_info?!1:(this._streamer_info?this.h=Q8(t):this.h=t7(t),this.refreshHtml().then(()=>this.setTopPainter()))}async createBrowser(t,e){if(!this.gui_div||this.exclude_browser||!this.brlayout)return!1;const i=Ct(`#${this.gui_div} .jsroot_browser`);if(i.empty())return!1;if(t==="float"&&this.float_browser_disabled&&(t="fix"),!i.select(".jsroot_browser_area").empty())return e&&this.brlayout.toggleKind(t),!0;let r=`<p class="jsroot_browser_version"><a href="https://root.cern/js/">JSROOT</a> version <span style="color:green"><b>${lf}</b></span></p>`;if(this.is_online)r+='<p> Hierarchy in <a href="h.json">json</a> and <a href="h.xml">xml</a> format</p><div style="display:inline; vertical-align:middle; white-space: nowrap;"><label style="margin-right:5px"><input type="checkbox" name="monitoring" class="gui_monitoring"/>Monitoring</label>';else if(this.no_select)this.no_select==="file"&&(r+='<div style="display:flex;flex-direction:row">');else{const o=Ct("#"+this.gui_div),h=o.attr("files")||"../files/hsimple.root",l=Lu().get("path")||o.attr("path")||"",c=h.split(";");r+='<input type="text" value="" style="width:95%; margin:5px;border:2px;" class="gui_urlToLoad" title="input file name"/><div style="display:flex;flex-direction:row;padding-top:5px"><select class="gui_selectFileName" style="flex:1;padding:2px;" title="select file name"<option value="" selected="selected"></option>',c.forEach(f=>{r+=`<option value="${l+f}">${f}</option>`}),r+='</select><input type="file" class="gui_localFile" accept=".root" style="display:none"/><output id="list" style="display:none"></output><input type="button" value="..." class="gui_fileBtn" style="min-width:3em;padding:3px;margin-left:5px;margin-right:5px;" title="select local file for reading"/><br/></div><p id="gui_fileCORS"><small><a href="https://github.com/root-project/jsroot/blob/master/docs/JSROOT.md#reading-root-files-from-other-servers">Read docu</a> how to open files from other servers.</small></p><div style="display:flex;flex-direction:row"><input style="padding:3px;margin-right:5px" class="gui_ReadFileBtn" type="button" title="Read the Selected File" value="Load"/><input style="padding:3px;margin-right:5px" class="gui_ResetUIBtn" type="button" title="Close all opened files and clear drawings" value="Reset"/>'}(this.is_online||!this.no_select||this.no_select==="file")&&(r+='<select style="padding:2px;margin-right:5px;" title="layout kind" class="gui_layout"></select></div>'),r+=`<div id="${this.gui_div}_browser_hierarchy" class="jsroot_browser_hierarchy"></div>`,this.brlayout.setBrowserContent(r),this.brlayout.setBrowserTitle(this.top_info||(this.is_online?"ROOT online server":"Read a ROOT file"))?.on("contextmenu",o=>{o.preventDefault(),fr(o).then(h=>{this.fillSettingsMenu(h,!0),h.show()})}).on("dblclick",()=>{this.createBrowser(this.brlayout?.browser_kind==="float"?"fix":"float",!0)}),!this.is_online&&!this.no_select&&(this.readSelectedFile=function(){const o=i.select(".gui_urlToLoad").property("value").trim();o&&(o.toLowerCase().lastIndexOf(".json")===o.length-5?this.openJsonFile(o):this.openRootFile(o))},i.select(".gui_selectFileName").property("value","").on("change",o=>i.select(".gui_urlToLoad").property("value",o.target.value)),i.select(".gui_fileBtn").on("click",()=>i.select(".gui_localFile").node().click()),i.select(".gui_ReadFileBtn").on("click",()=>this.readSelectedFile()),i.select(".gui_ResetUIBtn").on("click",()=>this.clearHierarchy(!0)),i.select(".gui_urlToLoad").on("keyup",o=>{o.code==="Enter"&&this.readSelectedFile()}),i.select(".gui_localFile").on("change",o=>{const h=o.target.files;for(let l=0;l<h.length;++l){const c=h[l];i.select(".gui_urlToLoad").property("value",c.name),this.openRootFile(c)}}));const a=i.select(".gui_layout");return a.empty()||(["simple","vert2","vert3","vert231","horiz2","horiz32","flex","tabs","grid 2x2","grid 1x3","grid 2x3","grid 3x3","grid 4x4"].forEach(o=>a.append("option").attr("value",o).text(o)),a.on("change",o=>{const h=o.target.value||"flex";this.setDisplay(h,this.gui_div+"_drawing"),tt.DislpayKind=h})),this.setDom(this.gui_div+"_browser_hierarchy"),e&&(this.refreshHtml(),this.initializeBrowser()),this.brlayout.toggleBrowserKind(t||"fix")}initializeBrowser(){const t=Ct(`#${this.gui_div} .jsroot_browser`);if(t.empty()||!this.brlayout)return;this.brlayout.adjustBrowserSize();const e=t.select(".gui_layout").node();if(e){let i=!1;for(const r in e.options){const s=e.options[r].text;if(Pt(s)&&(s===this.getLayout()||s.replace(/ /g,"")===this.getLayout())){e.selectedIndex=r,i=!0;break}}if(!i){const r=document.createElement("option");r.innerText=r.value=this.getLayout(),e.appendChild(r),e.selectedIndex=e.options.length-1}}if(this.is_online)this.h?._toptitle&&this.brlayout.setBrowserTitle(this.h._toptitle),t.select(".gui_monitoring").property("checked",this.isMonitoring()).on("click",i=>{this.enableMonitoring(i.target.checked),this.updateItems()});else if(!this.no_select){let i="";this.forEachRootFile(r=>{i||(i=r._fullurl)}),t.select(".gui_urlToLoad").property("value",i)}}enableMonitoring(t){this.setMonitoring(void 0,t);const e=Ct(`#${this.gui_div} .jsroot_browser .gui_monitoring`);!e.empty()&&e.property("checked")!==t&&e.property("checked",t)}}async function qY(n,t){const e=new h0("sinfo",n,"__as_dark_mode__");return Ci()?(e.selectDom().property("_json_object_",t),e):(e._streamer_info=!0,e.h=Q8(t),e.refreshHtml().then(()=>(e.setTopPainter(),e)))}async function kb(n,t,e){pr(n);const i=new h0("inspector",n,"__as_dark_mode__");if(Ci())return i.selectDom().property("_json_object_",t),i;i.default_by_click=Nl,i.with_icons=!1,i._inspector=!0;let r=0;return Pt(e)&&e.indexOf(Li)===0&&(e=e.slice(Li.length),e&&(r=Number.parseInt(e))),i.selectDom().classed("jsroot_inspector")&&(i.removeInspector=function(){this.selectDom().remove()},!ue.qt6&&!ue.cef3&&(i.storeAsJson=function(){const s=ba(t,2),a=t.fName||"file";UE(`${a}.json`,i1+encodeURIComponent(s))})),i.fill_context=function(s,a){const o=Bc(a._kind,"nosame");o.opts&&s.addDrawMenu("nosub:Draw",o.opts,h=>{if(!a?._obj)return;const l=a._obj;let c=this.selectDom().node();if(lt(this.removeInspector)&&(c=c.parentNode,this.removeInspector(),h.indexOf(Li)===0))return this.showInspector(h,l);pr(c),Xa(c,l,h)})},i.h=t7(t),i.refreshHtml().then(()=>(i.setTopPainter(),i.expandToLevel(r)))}Vn.prototype.showInspector=function(n,t){if(n==="check")return!0;const e=this.selectDom(),i=cr(e),r=Math.round(i.width*.05)+"px",s=Math.round(i.height*.05)+"px",a="root_inspector_"+Kt.id_counter++;return e.append("div").attr("id",a).attr("class","jsroot_inspector").style("position","absolute").style("top",s).style("bottom",s).style("left",r).style("right",r),t?._typename||(t=lt(this.getPrimaryObject)?this.getPrimaryObject():this.getObject()),kb(a,t,n)};Kt.drawInspector=kb;const VY=Object.freeze(Object.defineProperty({__proto__:null,HierarchyPainter:h0,drawInspector:kb,drawList:BY,drawStreamerInfo:qY,folderHierarchy:zY,keysHierarchy:ql,listHierarchy:J8,markAsStreamerInfo:K8,objectHierarchy:Rf,parseAsArray:bo,taskHierarchy:UY},Symbol.toStringTag,{value:"Module"}));var b2=function(n,t){return b2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},b2(n,t)};function Xf(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");b2(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function IQ(n,t,e,i){function r(s){return s instanceof e?s:new e(function(a){a(s)})}return new(e||(e=Promise))(function(s,a){function o(c){try{l(i.next(c))}catch(f){a(f)}}function h(c){try{l(i.throw(c))}catch(f){a(f)}}function l(c){c.done?s(c.value):r(c.value).then(o,h)}l((i=i.apply(n,t||[])).next())})}function OQ(n,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=o(0),a.throw=o(1),a.return=o(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(l){return function(c){return h([l,c])}}function h(l){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(e=0)),e;)try{if(i=1,r&&(s=l[0]&2?r.return:l[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;switch(r=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,r=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){e.label=l[1];break}if(l[0]===6&&e.label<s[1]){e.label=s[1],s=l;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(l);break}s[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(n,e)}catch(c){l=[6,c],r=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Bd(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],i=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w2(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var i=e.call(n),r,s=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(o){a={error:o}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(a)throw a.error}}return s}function S2(n,t,e){if(e||arguments.length===2)for(var i=0,r=t.length,s;i<r;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return n.concat(s||Array.prototype.slice.call(t))}function M2(n){return this instanceof M2?(this.v=n,this):new M2(n)}function BQ(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(n,t||[]),r,s=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),r[Symbol.asyncIterator]=function(){return this},r;function a(u){return function(p){return Promise.resolve(p).then(u,f)}}function o(u,p){i[u]&&(r[u]=function(m){return new Promise(function(g,y){s.push([u,m,g,y])>1||h(u,m)})},p&&(r[u]=p(r[u])))}function h(u,p){try{l(i[u](p))}catch(m){d(s[0][3],m)}}function l(u){u.value instanceof M2?Promise.resolve(u.value.v).then(c,f):d(s[0][2],u)}function c(u){h("next",u)}function f(u){h("throw",u)}function d(u,p){u(p),s.shift(),s.length&&h(s[0][0],s[0][1])}}function zQ(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof Bd=="function"?Bd(n):n[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=n[s]&&function(a){return new Promise(function(o,h){a=n[s](a),r(o,h,a.done,a.value)})}}function r(s,a,o,h){Promise.resolve(h).then(function(l){s({value:l,done:o})},a)}}function Ba(n){return typeof n=="function"}function e7(n){var t=function(i){Error.call(i),i.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var jA=e7(function(n){return function(e){n(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
4549
|
+
`,n,"jsroot_hstyle")}function Z8(n){return n<1e4?n.toFixed(0)+"B":n<1e6?(n/1e3).toFixed(2)+"KiB":n<1e9?(n/1e6).toFixed(2)+"MiB":(n/1e9).toFixed(2)+"GiB"}function OY(n){const t=Math.floor(n/1e4);let e=Math.floor((n-t*1e4)/100).toString(),i=(n%100).toString();return e.length<2&&(e="0"+e),i.length<2&&(i="0"+i),`${t}.${e}.${i}`}async function BY(n,t,e){return t?.arr?{dom:n,lst:t,opt:e,indx:-1,painter:null,draw_next(){for(;++this.indx<this.lst.arr.length;){const r=this.lst.arr[this.indx],s=this.lst.opt&&this.lst.opt[this.indx]?this.lst.opt[this.indx]:this.opt;if(r)return Xa(this.dom,r,s).then(a=>(a&&!this.painter&&(this.painter=a),this.draw_next()))}return this.painter}}.draw_next():null}function zY(n,t){if(!t?.fFolders)return!1;if(!t.fFolders.arr.length)return n._more=!1,!0;n._childs=[];for(let e=0;e<t.fFolders.arr.length;++e){const i=t.fFolders.arr[e];n._childs.push({_name:i.fName,_kind:Ee(i._typename),_obj:i})}return!0}function J8(n,t){if(!mh(t))return!1;if(!t.arr?.length)return n._more=!1,!0;let e=!1,i=n;for(;i;)i._do_context&&(e=!0),i=i._parent;const r=t._typename===Wd,s=[],a=[],o=[];for(let h=0;h<t.arr.length;++h){const l=r?t.arr[h].first:t.arr[h];if(!l)continue;const c=l.fName||l.name;if(!c)continue;const f=s.indexOf(c);f>=0?a[f]++:(a[s.length]=o[s.length]=1,s.push(c))}n._childs=[];for(let h=0;h<t.arr.length;++h){const l=r?t.arr[h].first:t.arr[h];let c;if(!l?._typename)c={_name:h.toString(),_kind:Ee("NULL"),_title:"NULL",_value:"null",_obj:null};else{switch(c={_name:l.fName||l.name,_kind:Ee(l._typename),_title:`${l.fTitle||""} type:${l._typename}`,_obj:l},l._typename){case ph:c._value=md(l);break;case Ta:case Ff:c._value=l.fTitle;break;case ps:c._value=l.fString;break;default:t.opt&&t.opt[h]&&t.opt[h].length&&(c._value=t.opt[h])}if(e&&af(l._typename)&&(c._direct_context=!0),!c._name||Number.isInteger(parseInt(c._name))&&parseInt(c._name)!==h||t.arr.indexOf(l)<h)c._name=h.toString();else{const f=s.indexOf(l.fName);f>=0&&a[f]>1&&(c._cycle=o[f]++,c._keyname=c._name,c._name=c._keyname+";"+c._cycle)}}n._childs.push(c)}return!0}function ql(n,t,e,i){if(t===void 0)return!1;n._childs=[];for(let r=0;r<t.length;++r){const s=t[r];if(tt.OnlyLastCycle&&r>0&&s.fName===t[r-1].fName&&s.fCycle<t[r-1].fCycle)continue;const a={_name:s.fName+";"+s.fCycle,_cycle:s.fCycle,_kind:Ee(s.fClassName),_title:s.fTitle+` (size: ${Z8(s.fObjlen)})`,_keyname:s.fName,_readobj:null,_parent:n};if(s.fRealName&&(a._realname=s.fRealName+";"+s.fCycle),s.fClassName===Wl||s.fClassName===gC){const o=i&&e?e.getDir(i+s.fName):null;o?(a._name=s.fName,ql(a,o.fKeys,e,i+s.fName+"/")):(a._more=!0,a._expand=function(h,l){return ql(h,l.fKeys)})}else if(s.fClassName===Re&&s.fName===v1){if(tt.SkipStreamerInfos)continue;a._name=v1,a._kind=Ee(_g),a._title="List of streamer infos for binary I/O",a._readobj=e.fStreamerInfos}n._childs.push(a)}return!0}function Rf(n,t,e=void 0){if(!n||t===null)return!1;n._childs=[];let i=Object.prototype.toString.apply(t);if(i==="[object DataView]"){let p={_parent:n,_name:"size",_value:t.byteLength.toString(),_vclass:vo};n._childs.push(p);const m=t.byteLength<10?1:Math.log10(t.byteLength);for(let g=0;g<t.byteLength;++g){if(g%16===0){for(p={_parent:n,_name:g.toString(),_value:"",_vclass:vo};p._name.length<m;)p._name="0"+p._name;n._childs.push(p)}let y=t.getUint8(g).toString(16);for(;y.length<2;)y="0"+y;p._value&&(p._value+=g%4===0?" | ":" "),p._value+=y}return!0}let r=!0,s=!1,a=n;for(;a;){if(a._do_context&&(s=!0),"_nosimple"in a){r=a._nosimple;break}a=a._parent}const o=Kl(i)>0&&t.length,h=o&&t.length>tt.HierarchyLimit;let l=!1;if(o&&n._name==="Object"&&!n._parent&&(n._name="Array"),h){l=!0;for(let p=0;p<t.length;++p){const m=typeof t[p];if(!(m==="number"||m==="boolean"||m==="string"&&t[p].length<16)){l=!1;break}}}if("_obj"in n?n._obj!==t&&alert("object missmatch"):n._obj=t,n._title||(t._typename?n._title=Ee(t._typename):o&&(n._title="Array len: "+t.length)),l){for(let p=0;p<t.length;){let m=Math.min(p+10,t.length),g=!0,y=p;for(;g;){g=!0;for(let _=y;_<m;++_)t[p]!==t[_]&&(g=!1);if(g){if(m===t.length)break;y=m,m=Math.min(m+10,t.length)}else if(y!==p){m=y,g=!0;break}}const A={_parent:n,_name:p+".."+(m-1),_vclass:vo};if(g)A._value=t[p].toString();else{A._value="";for(let _=p;_<m;++_)A._value+=(_===p?"[ ":", ")+t[_].toString();A._value+=" ]"}n._childs.push(A),p=m}return!0}let c,f,d,u;for(const p in t){if(p==="_typename"||p[0]==="$")continue;const m=t[p];if(lt(m)||e?.exclude&&e.exclude.indexOf(p)>=0)continue;if(h&&c){if(d===m){++u,f=p;continue}u>0&&(c._name+=".."+f)}const g={_parent:n,_name:p};if(h&&(c=g,f=p,d=m,u=0),m===null){g._value=g._title="null",r||n._childs.push(g);continue}let y=!1;if(se(m))if(i=Object.prototype.toString.apply(m),Kl(i)>0)g._title="array len="+m.length,y=i!=="[object Array]",m.length?(g._value="[...]",g._more=!0,g._expand=Rf,g._obj=m):(g._value="[ ]",g._more=!1);else if(i==="[object DataView]")g._title="DataView len="+m.byteLength,g._value="[...]",g._more=!0,g._expand=Rf,g._obj=m;else if(i==="[object Date]")g._more=!1,g._title="Date",g._value=m.toString(),g._vclass=vo;else{(m.$kind||m._typename)&&(g._kind=g._title=Ee(m.$kind||m._typename)),m._typename&&(g._title=m._typename,s&&af(m._typename)&&(g._direct_context=!0));let A=n,_=!1;for(;A&&!_;)_=A._obj===m,A=A._parent;if(_)g._value="{ prnt }",g._vclass=vo,g._more=!1,y=!0;else switch(g._obj=m,g._more=!1,m._typename){case ph:g._value=md(m);break;case Ta:case Ff:g._value=m.fTitle;break;case ps:g._value=m.fString;break;default:mh(m)&&se(m.arr)?(g._value=m.arr.length?"[...]":"[]",g._title+=", size:"+m.arr.length,m.arr.length&&(g._more=!0)):(g._more=!0,g._value="{ }")}}else typeof m=="number"||typeof m=="boolean"||typeof m=="bigint"?(y=!0,p==="fBits"?g._value="0x"+m.toString(16):g._value=m.toString(),g._vclass=vo):Pt(m)?(y=!0,g._value='"'+m+'"',g._vclass="h_value_str"):typeof m>"u"?(y=!0,g._value="undefined",g._vclass=vo):(y=!0,alert(`miss ${p} type ${typeof m}`));(!y||!r)&&n._childs.push(g)}return h&&c&&u>0&&(c._name+=".."+f),!0}function UY(n,t){if(!t?.fTasks)return!1;if(Rf(n,t,{exclude:["fTasks","fName"]}),!t.fTasks.arr.length&&!n._childs.length)return n._more=!1,!0;for(let e=0;e<t.fTasks.arr.length;++e){const i=t.fTasks.arr[e];n._childs.push({_name:i.fName,_kind:Ee(i._typename),_obj:i})}return!0}function Q8(n){const t={_name:v1,_childs:[]};for(let e=0;e<n.arr.length;++e){const i=n.arr[e];if(i._typename===Re)continue;if(typeof i.fName>"u"){console.warn(`strange element in StreamerInfo with type ${i._typename}`);continue}const r={_name:`${i.fName};${i.fClassVersion}`,_kind:`class ${i.fName}`,_title:`class:${i.fName} version:${i.fClassVersion} checksum:${i.fCheckSum}`,_icon:"img_class",_childs:[]};if(i.fTitle&&(r._title+=" "+i.fTitle),t._childs.push(r),!(typeof i.fElements>"u")){for(let s=0;s<i.fElements.arr.length;++s){const a=i.fElements.arr[s];if(!a?.fName)continue;let o=`${a.fTypeName} ${a.fName}`;const h=`${a.fTypeName} type:${a.fType}`;if(a.fArrayDim===1)o+=`[${a.fArrayLength}]`;else for(let l=0;l<a.fArrayDim;++l)o+=`[${a.fMaxIndex[l]}]`;a.fBaseVersion===4294967295?o+=":-1":a.fBaseVersion!==void 0&&(o+=`:${a.fBaseVersion}`),o+=";",a.fTitle&&(o+=` // ${a.fTitle}`),r._childs.push({_name:o,_title:h,_kind:a.fTypeName,_icon:a.fTypeName===jo?"img_class":"img_member"})}r._childs.length||delete r._childs}}return t}function K8(n,t,e){e?._typename===Re&&(e._typename=_g)}function t7(n){const t={_name:"Object",_title:"",_click_action:Nl,_nosimple:!1,_do_context:!0};return Pt(n.fName)&&n.fName&&(t._name=n.fName),Pt(n.fTitle)&&n.fTitle&&(t._title=n.fTitle),n._typename&&(t._title+=` type:${n._typename}`),mh(n)?(t._name=n.name||n._typename,J8(t,n)):Rf(t,n),t}function bo(n){const t=[];if(!Pt(n)||(n=n.trim(),!n))return t;if(n.length<2||n.at(0)!=="["||n.at(-1)!=="]")return t.push(n),t;let e=0,i=0,r=0,s=1;for(let a=1;a<n.length;++a){if(i>0){n[a]==="'"&&i--;continue}if(r>0){n[a]==='"'&&r--;continue}switch(n[a]){case"'":i++;break;case'"':r++;break;case"[":e++;break;case"]":if(a<n.length-1){e--;break}case",":if(e===0){let o=n.substring(s,a).trim();o.length>1&&o.at(0)===o.at(-1)&&(o[0]==='"'||o[0]==="'")&&(o=o.slice(1,o.length-1)),t.push(o),s=a+1}break}}return t.length||t.push(n.slice(1,n.length-1).trim()),t}function Lm(n,t){if(n&&t?._childs){for(let e=0;e<t._childs.length;++e)(t._childs[e]._more||t._childs[e]._childs)&&(t._childs[e]._expand=Lm);return n._childs=t._childs,t._childs=null,!0}return!1}function G5(n){return n?.expand||n?.get_expand||n?.expand_item}const nc=Ee(q1);class h0 extends Of{#i;#r;#e;#s;#h;#a;#d;#u;#o;constructor(t,e,i){super(e),this.name=t,this.h=null,this.with_icons=!0,i==="__as_dark_mode__"?this.setBasicColors():this.background=i,this.files_monitoring=!e,this.nobrowser=e===null,No()||WS(this)}setBasicColors(){this.background=tt.DarkMode?"black":"white",this.textcolor=tt.DarkMode?"#eee":"#111"}setDrawFunc(t,e){lt(t)&&(this.#u=t,this.#o=lt(e)?e:t)}async callDrawFunc(t,e,i,r){return(r?this.#o||v2:this.#u||Xa)(t,e,i)}cleanup(){this.clearHierarchy(!0),super.cleanup(),No()===this&&WS(null)}fileHierarchy(t,e){const i=this;return e||(e={}),e._name=t.fFileName,e._title=(t.fTitle?t.fTitle+", path: ":"")+t.fFullURL+`, size: ${Z8(t.fEND)}, version: ${OY(t.fVersion)}, modified: ${Hx(s6(t.fDatimeM))}`,e._kind=nc,e._file=t,e._fullurl=t.fFullURL,e._localfile=t.fLocalFile,e._had_direct_read=!1,e._get=function(r,s){if(r?._readobj)return Promise.resolve(r._readobj);r&&(s=i.itemFullName(r,this));const a=o=>(this._file||(this._file=o),o?o.readObject(s).then(h=>{if(!r&&h){const l=i.findItem({name:s,top:this,last_exists:!0,check_keys:!0});if(l?.last!==void 0&&l.last!==this){const c=o.getDir(i.itemFullName(l.last,this));if(c){l.last._name=l.last._keyname;const f=i.itemFullName(l.last,this);ql(l.last,c.fKeys,o,f+"/")}}else ql(this,o.fKeys,o,"");r=i.findItem({name:s,top:this})}return r&&(r._readobj=h,"_expand"in r&&(r._name=r._keyname)),h}):Promise.resolve(null));return this._file?a(this._file):this._localfile?Uu(this._localfile).then(o=>a(o)):this._fullurl?Uu(this._fullurl).then(o=>a(o)):Promise.resolve(null)},ql(e,t.fKeys,t,""),e}forEachItem(t,e){function i(r,s){if(!r)return;s&&(r._parent=s),t(r);const a=r._childs?.length??0;for(let o=0;o<a;++o)i(r._childs[o],r)}lt(t)&&i(e||this.h)}findItem(t){function e(s,a){if(!a||!s)return s;let o=a.length;if(!s._parent&&s._kind!==la&&a.indexOf(s._name)===0){if(a===s._name)return s;const l=s._name.length;a[l]==="/"&&(a=a.slice(l+1),o=a.length)}function h(l,c){return c||(l._parent=s),o>=a.length-1||o<0?l:e(l,a.slice(o+1))}for(;o>0;){let l=o>=a.length?a:a.slice(0,o);if(s._childs){for(let f=0;f<s._childs.length;++f)if(s._childs[f]._name===l)return h(s._childs[f]);if(s._kind===la&&s._childs[0]._online!==void 0){for(let f=0;f<s._childs[0]._childs.length;++f)if(s._childs[0]._childs[f]._name===l)return h(s._childs[0]._childs[f],!0)}if(t.check_keys){let f=null;for(let d=0;d<s._childs.length;++d)s._childs[d]._keyname===l&&(!f||f._cycle<s._childs[d]._cycle)&&(f=s._childs[d]);if(f)return h(f)}let c=t.allow_index;if(l.at(0)==="["&&l.at(-1)==="]"&&/^\d+$/.test(l.slice(1,l.length-1))&&(c=!0,l=l.slice(1,l.length-1)),c&&/^\d+$/.test(l)){const f=parseInt(l);if(Number.isInteger(f)&&f>=0&&f<s._childs.length)return h(s._childs[f])}}o=a.lastIndexOf("/",o-1)}if(t.force){s._childs===void 0&&(s._childs=[]),o=a.indexOf("/");const l={_name:o<0?a:a.slice(0,o)};return s._childs.push(l),h(l)}return t.last_exists?{last:s,rest:a}:null}let i=this.h,r;if(Pt(t))r=t,t={};else if(se(t))r=t.name,"top"in t&&(i=t.top);else return null;return r==="__top_folder__"?i:Pt(r)&&r.indexOf("img:")===0?null:e(i,r)}itemFullName(t,e,i){if(t?._kind===la)return"__top_folder__";let r="";for(;t;){if(t._online!==void 0&&!e)return r;if(t===e||t._kind===la||i&&!t._parent)break;r&&(r="/"+r),r=t._name+r,t=t._parent}return r}async executeCommand(t,e,...i){const r=this.findItem(t),s=this.getOnlineItemUrl(r)+"/cmd.json",a=Ct(e),o=[];for(let l=0;l<(r._numargs??0);++l)o.push(l<i.length?i[l]:"");return(!o.length||!e?Promise.resolve(o):fr().then(l=>l.showCommandArgsDialog(r._name,o))).then(l=>{if(l===null)return!1;let c="";for(let f=0;f<l.length;++f)c+=`${f>0?"&":"?"}arg${f+1}=${l[f]}`;return a.empty()||(a.style("background","yellow"),r._title&&a.attr("title","Executing "+r._title)),br(s+c,"text").then(f=>{if(a.empty())return f;const d=f&&f!=="false"?"green":"red";return a.style("background",d),r._title&&a.attr("title",r._title+" lastres="+f),setTimeout(()=>{a.style("background",null),r._icon&&a.classed("jsroot_fastcmd_btn")&&a.style("background-image",`url('${r._icon}')`)},2e3),d==="green"&&"_hreload"in r&&this.reload(),d==="green"&&"_update_item"in r&&this.updateItems(r._update_item.split(";")),f})})}async getObject(t,e){const i={item:null,obj:null};let r,s;if(t===null)return i;if(Pt(t)?r=t:se(t)&&(t._parent!==void 0&&t._name!==void 0&&t._kind!==void 0?s=t:t.name!==void 0?r=t.name:t.arg!==void 0?r=t.arg:t.item!==void 0&&(s=t.item)),Pt(r)&&r.indexOf("img:")===0)return i.obj={_typename:"TJSImage",fName:r.slice(4)},i;s?r=this.itemFullName(s):s=this.findItem({name:r,allow_index:!0,check_keys:!0});const a=s?null:this.findItem({name:r,last_exists:!0,check_keys:!0,allow_index:!0});if(a!==null&&"last"in a&&a.last!==null){const h=this.itemFullName(a.last);return se(t)&&"rest"in t&&(t.rest===a.rest||t.rest.length<=a.rest.length)?i:this.expandItem(h,void 0,e!=="hierarchy_expand_verbose").then(l=>{if(!l)return i;let c=this.itemFullName(a.last);return c&&(c+="/"),this.getObject({name:c+a.rest,rest:a.rest},e)})}if(i.item=s,s!==null&&se(s._obj))return i.obj=s._obj,i;let o=s;for(;o;){if(lt(o._get))return o._get(s,null,e).then(h=>(i.obj=h,i));o=o._parent}return i}isLastSibling(t){if(!t||!t._parent||!t._parent._childs)return!1;const e=t._parent._childs;let i=e.indexOf(t);if(i<0)return!1;for(;++i<e.length;)if(!("_hidden"in e[i]))return!1;return!0}addItemHtml(t,e,i){if(!t||"_hidden"in t)return!0;const r=t===this.h,s="_childs"in t,a=ui(t._kind),o=this.itemFullName(t);let h="",l="",c=!1,f=!1,d;a&&("icon"in a&&(h=a.icon),"icon2"in a&&(l=a.icon2),!h&<(a.icon_get)&&(h=a.icon_get(t,this)),(af(a)||"execute"in a||"aslink"in a||G5(a)&&t._more!==!1)&&(c=!0)),"_icon"in t&&(h=t._icon),"_icon2"in t&&(l=t._icon2),!h&&"_online"in t&&(t._icon=h="img_globe"),!h&&r&&(t._icon=h="img_base"),(t._more||t._expand||t._player||t._can_draw)&&(c=!0);let u=c;!u&&Aa(t._kind)&&(u=c=!0),l||(l=h),h||(h=s||t._more?"img_folder":"img_page"),l||(l=s||t._more?"img_folderopen":"img_page"),i==="update"?(e.selectAll("*").remove(),d=e):(d=e.append("div"),i&&i>=(t._parent._show_limit||tt.HierarchyLimit)&&(f=!0)),t._d3cont=d.node(),d.attr("item",o);const p=this,m=d.append("div").attr("class","h_line");let g=r?null:t._parent,y=1;for(;g&&g!==this.h;){const M=this.isLastSibling(g),T=m.insert("div",":first-child").attr("class",M?"img_empty":"img_line");M||T.style("cursor","pointer").property("upcnt",y).on("click",function(w){p.tree_click(w,this,"parentminus")}),g=g._parent,y++}let A="",_=!1;if(r||(s&&!f||a?.pm?(A=t._isopen?"img_minus":"img_plus",_=!0):A="img_join"),A){(f||this.isLastSibling(t))&&(A+="bottom");const M=m.append("div").attr("class",A);_&&M.style("cursor","pointer").on("click",function(T){p.tree_click(T,this,bu)})}if(this.with_icons&&!f){const M=t._isopen?l:h,T=M.indexOf("img_")===0?m.append("div").attr("class",M).attr("title",t._kind):m.append("img").attr("src",M).attr("alt","").attr("title",t._kind).style("vertical-align","top").style("width","18px").style("height","18px");(t._icon_click||a?.icon_click)&&T.on("click",function(w){p.tree_click(w,this,"icon")})}const x=m.append("a");if((c||s||f)&&x.attr("class",F1).on("click",function(M){p.tree_click(M,this)}),f)return t._break_point=!0,x.attr("title","there are "+(t._parent._childs.length-i)+" more items").text("...more..."),!1;"disp_kind"in p?(tt.DragAndDrop&&c&&this.enableDrag(x,o),tt.ContextMenu&&u&&x.on("contextmenu",function(M){p.tree_contextmenu(M,this)}),x.on("mouseover",function(){p.tree_mouseover(!0,this)}).on("mouseleave",function(){p.tree_mouseover(!1,this)})):t._direct_context&&tt.ContextMenu&&x.on("contextmenu",function(M){p.direct_contextmenu(M,this)});let v=t._name,b="";if("_realname"in t&&(v=t._realname),"_title"in t&&(b=t._title),"_fullname"in t&&(b+=" fullname: "+t._fullname),b||(b=v),x.attr("title",b).text(v+("_value"in t?":":"")).style("background",t._background?t._background:null),"_value"in t){const M=m.append("p");"_vclass"in t&&M.attr("class",t._vclass),t._isopen||M.text(t._value)}if(s&&(r||t._isopen)){const M=d.append("div").attr("class","h_childs");this.show_overflow&&M.style("overflow","initial");for(let T=0;T<t._childs.length;++T){const w=t._childs[T];if(w._parent=t,!this.addItemHtml(w,M,T))break}}return!0}toggleOpenState(t,e,i){const r=e||this.h;if(r._childs===void 0){if(!t||this.with_icons&&!r._more&&!r._expand&&!this.canExpandItem(r))return!1;const a=this.expandItem(this.itemFullName(r));return id(a)&&se(i)&&i.push(a),r._childs!==void 0&&(r._isopen=!0),r._isopen}if(r!==this.h&&t&&!r._isopen)return r._isopen=!0,!0;let s=!1;for(let a=0;a<r._childs.length;++a)this.toggleOpenState(t,r._childs[a],i)&&(s=!0);return r!==this.h&&!t&&r._isopen&&!s?(delete r._isopen,!0):(e||this.refreshHtml(),!1)}async expandToLevel(t){if(!t||!Number.isFinite(t)||t<0)return this;const e=[];return this.toggleOpenState(!0,this.h,e),Promise.all(e).then(()=>this.expandToLevel(t-1))}async exapndToLevel(t){return this.expandToLevel(t)}async refreshHtml(){const t=this.selectDom();if(t.empty())return this;t.html("").style("overflow",this.show_overflow?"auto":"hidden").style("display","flex").style("flex-direction","column"),IY(t.node());const e=this,i=[];let r=null;if(this.forEachItem(o=>{delete o._d3cont,"_fastcmd"in o&&o._kind==="Command"&&i.push(o),"_status"in o&&!r&&(r=o)}),!this.h||t.empty())return this;if(i.length){const o=t.append("div").attr("style","display: inline; vertical-align: middle; white-space: nowrap;");for(let h=0;h<i.length;++h){const l=o.append("button").text("").attr("class","jsroot_fastcmd_btn").attr("item",this.itemFullName(i[h])).attr("title",i[h]._title).on("click",function(){e.executeCommand(Ct(this).attr("item"),this)});i[h]._icon&&l.style("background-image",`url('${i[h]._icon}')`)}}const s=t.append("p").attr("class","jsroot").style("margin-bottom","3px").style("margin-top",0);s.append("a").attr("class",vl).text("expand all").attr("title","expand all items in the browser").on("click",()=>this.toggleOpenState(!0)),s.append("text").text(" | "),s.append("a").attr("class",vl).text("collapse all").attr("title","collapse all items in the browser").on("click",()=>this.toggleOpenState(!1)),lt(this.storeAsJson)&&(s.append("text").text(" | "),s.append("a").attr("class",vl).text("json").attr("title","dump to json file").on("click",()=>this.storeAsJson())),lt(this.removeInspector)&&(s.append("text").text(" | "),s.append("a").attr("class",vl).text("remove").attr("title","remove inspector").on("click",()=>this.removeInspector())),"_online"in this.h&&(s.append("text").text(" | "),s.append("a").attr("class",vl).text("reload").attr("title","reload object list from the server").on("click",()=>this.reload())),"disp_kind"in this&&(s.append("text").text(" | "),s.append("a").attr("class",vl).text("clear").attr("title","clear all drawn objects").on("click",()=>this.clearHierarchy(!1)));const a=t.append("div").attr("class","jsroot").style("font-size",this.with_icons?"12px":"15px").style("flex","1");if(this.show_overflow||a.style("overflow","auto"),this.background&&a.style("background-color",this.background).style("margin","2px").style("padding","2px"),this.textcolor&&a.style("color",this.textcolor),this.addItemHtml(this.h,a.append("div").attr("class",Cc)),this.setTopPainter(),r&&!this.status_disabled&&!Lu().has("nostatus")){const o=ts(r._status);if(lt(o))return this.createStatusLine().then(h=>{h&&o(h,this.itemFullName(r))})}return this}updateTreeNode(t,e){if(e===void 0||e.empty()){e=Ct(t._d3cont?t._d3cont:null);const i=this.itemFullName(t);if(e.empty()&&(e=this.selectDom().select(`[item='${i}']`)),e.empty()&&"_cycle"in t&&(e=this.selectDom().select(`[item='${i};${t._cycle}']`)),e.empty())return}this.addItemHtml(t,e,"update"),this.brlayout?.adjustBrowserSize(!0)}updateBackground(t,e){if(!t||!t._d3cont)return;const i=Ct(t._d3cont);if(i.empty())return;const r=i.select(`.${F1}`);r.style("background",t._background?t._background:null),e&&t._background&&r.node().scrollIntoView(!1)}async focusOnItem(t){Pt(t)&&(t=this.findItem(t));const e=t?this.itemFullName(t):"";if(!e)return!1;let i=t,r=!1;for(;i;)i._childs!==void 0&&!i._isopen&&(i._isopen=!0,r=!0),i=i._parent;return(r?this.refreshHtml():Promise.resolve(!0)).then(()=>{const a=this.selectDom().select(`[item='${e}']`);return a.empty()?!1:(a.node().scrollIntoView(),!0)})}tree_click(t,e,i){if(!e)return;let r=Ct(e.parentNode.parentNode),s=r.attr("item"),a=s?this.findItem(s):null;if(!a)return;if(i==="parentminus"){let d=Ct(e).property("upcnt")||1;for(;d-- >0;)a=a?._parent;if(!a)return;s=this.itemFullName(a),r=Ct(a?._d3cont||null),i=bu}if(a._break_point){delete a._break_point,this.addItemHtml(a,r,"update");const d=a._parent,u=d._childs.indexOf(a),p=Ct(r.node().parentNode);if(u<0)return console.error("internal error");d._show_limit=(d._show_limit||tt.HierarchyLimit)*2;for(let m=u+1;m<d._childs.length;++m){const g=d._childs[m];if(g._parent=d,!this.addItemHtml(g,p,m))break}return}let o=a,h;for(;o&&(h=o._click_action)===void 0;)o=o._parent;i||(i="item");const l=a._kind===Ee(U1)&&a._more?"noinspect":"",c=Bc(a._kind,l),f=c.handle;if(i==="icon"){let d=null;lt(a._icon_click)?d=a._icon_click:lt(f?.icon_click)&&(d=f.icon_click),d&&d(a,this)&&this.updateTreeNode(a,r);return}if(i==="item"&&"_expand"in a&&!a._expand_miss&&!t.ctrlKey&&!t.shiftKey&&(i=bu),i===bu&&!("_childs"in a)&&a._more||i===bu&&f?.pm||i==="item"&&h===Nl)return this.expandItem(s,r);if(i==="item"){if(a._player)return this.player(s);if(f?.aslink)return window.open(s+"/");if(f?.execute)return this.executeCommand(s,e.parentNode);if(f?.ignore_online&&this.isOnlineItem(a))return;const d=this.default_by_click===Nl;let u=a._can_draw,p=a._more,m="";if(t.shiftKey&&(m=f?.shift||Li,Pt(m)&&m.indexOf(Li)===0&&f?.noinspect&&(m="")),t.ctrlKey&&f?.ctrl&&(m=f.ctrl),!m&&!f?.always_draw){for(let g=a._parent;g;g=g._parent)if(g._painter){u=!1,p===void 0&&(p=!1);break}}if(a._childs&&(p=!1),u===void 0&&(u=c.draw),p===void 0&&(p=c.expand||c.get_expand),u&&p&&!m&&(d||f?.dflt===Nl||f?.expand_after_draw&&this.isItemDisplayed(s))&&(u=!1),u&&!m&&(m=WA),u)return this.display(s,m,null,!0);if(p||d)return this.expandItem(s,r);if(Aa(a._kind)&&c.inspect&&u!==!1)return this.display(s,Li,null,!0);if(!a._childs||a===this.h)return}a._isopen?delete a._isopen:a._isopen=!0,this.updateTreeNode(a,r)}tree_mouseover(t,e){const i=Ct(e.parentNode.parentNode).attr("item"),r=this.findItem(i);if(!r)return;let s,a=r;for(;a&&!s;)s=a._painter,a=a._parent;lt(s?.mouseOverHierarchy)&&s.mouseOverHierarchy(t,i,r)}direct_contextmenu(t,e){t.preventDefault();const i=Ct(e.parentNode.parentNode).attr("item"),r=this.findItem(i);r&<(this.fill_context)&&fr(t,this).then(s=>{this.fill_context(s,r),s.size()>0&&(s.tree_node=e.parentNode,s.show())})}fillSettingsMenu(t,e){t.addSettingsMenu(!0,e,i=>{i==="refresh"?(this.forEachRootFile(r=>ql(r,r._file.fKeys,r._file,"")),this.refreshHtml()):i==="dark"?this.changeDarkMode():i==="width"&&this.brlayout?.adjustSeparators(tt.BrowserWidth,null)})}changeDarkMode(){this.textcolor&&(this.setBasicColors(),this.refreshHtml()),this.brlayout?.createStyle(),this.createButtons(),lt(this.disp?.changeDarkMode)&&this.disp.changeDarkMode(),this.disp?.forEachFrame(t=>{const e=bl(t)||um(t);lt(e?.changeDarkMode)&&e!==this&&e.changeDarkMode()})}toggleDarkMode(){tt.DarkMode=!tt.DarkMode,this.changeDarkMode()}tree_contextmenu(t,e){t.preventDefault();const i=Ct(e.parentNode.parentNode).attr("item"),r=this.findItem(i);if(!r)return;const s=this.getOnlineProp(i),a=this.getFileProp(i);function o(h){const l=f=>f.split("&").join("&").split("<").join("<").split('"').join("""),c=document.createElement("div");return c.innerHTML=`<a href="${l(h)}">x</a>`,c.firstChild.href}return fr(t,this).then(h=>{if((!i||!r._parent)&&!("_jsonfile"in r)){let l="",c=0;const f=[],d=()=>c++>0?"&":"?";this.forEachRootFile(m=>f.push(m._file.fFullURL)),this.getTopOnlineItem()||(l=li+"index.htm"),this.isMonitoring()&&(l+=d()+"monitoring="+this.getMonitoringInterval()),f.length===1?l+=`${d()}file=${f[0]}`:f.length>1&&(l+=`${d()}files=${JSON.stringify(f)}`),this.disp_kind&&(l+=d()+"layout="+this.disp_kind.replace(/ /g,""));const u=[],p=[];this.disp?.forEachFrame(m=>{const g=new Vn(m);let y=g.getTopPainter(),A=y?y.getItemName():null,_;A?_=y.getDrawOpt()||y.getItemDrawOpt():(y=null,g.forEachPainter(x=>{const v=x.getItemName();if(!v)return;let b=x.getDrawOpt()||x.getItemDrawOpt()||"";y?y.getPadPainter()===x.getPadPainter()&&(b.indexOf("same ")===0&&(b=b.slice(5)),A+="+"+v,_+="+"+b):(y=x,A=v,_=b)})),A&&(u.push(A),p.push(_||""))}),u.length===1?l+=d()+"item="+u[0]+d()+"opt="+p[0]:u.length>1&&(l+=d()+"items="+JSON.stringify(u)+d()+"opts="+JSON.stringify(p)),h.add("Direct link",()=>window.open(l)),h.add("Only items",()=>window.open(l+"&nobrowser")),this.fillSettingsMenu(h)}else if(s)this.fillOnlineMenu(h,s,i);else{const l=Bc(r._kind,"nosame");if(r._can_draw&&(l.opts||(l.opts=[""]),l.opts.indexOf("")<0&&l.opts.unshift("")),l.opts){h.addDrawMenu("Draw",l.opts,f=>this.display(i,f),"Draw item in the new frame");const c=this.disp?.getActiveFrame();!l.noappend&&c&&(bl(c)||um(c))&&h.addDrawMenu("Superimpose",l.opts,f=>this.dropItem(i,c,f),"Superimpose item with drawing on active frame")}if(a&&l.opts&&!a.localfile){const c=tt.NewTabUrl||li;let f=o(a.fileurl);if(f.indexOf(c)===0&&(f=f.slice(c.length)),f=`${a.kind}=${f}`,a.itemname){let u=a.itemname;u.search(/\+| |,/)>=0&&(u=`'${u}'`),f+=`&item=${u}`}let d="nobrowser";tt.WithCredentials&&(d+="&with_credentials"),tt.NewTabUrlPars&&(d+="&"+tt.NewTabUrlPars),tt.NewTabUrlExportSettings&&(K.fOptStat!==1111&&(d+=`&optstat=${K.fOptStat}`),K.fOptFit&&(d+=`&optfit=${K.fOptFit}`),K.fOptDate&&(d+=`&optdate=${K.fOptDate}`),K.fOptFile&&(d+=`&optfile=${K.fOptFile}`),K.fOptTitle!==1&&(d+=`&opttitle=${K.fOptTitle}`),tt.TimeZone==="UTC"?d+="&utc":tt.TimeZone==="Europe/Berlin"?d+="&cet":tt.TimeZone&&(d+=`&timezone='${tt.TimeZone}'`),Math.abs(K.fDateX-.01)>.001&&(d+=`&datex=${K.fDateX.toFixed(3)}`),Math.abs(K.fDateY-.01)>.001&&(d+=`&datey=${K.fDateY.toFixed(3)}`),K.fHistMinimumZero&&(d+="&histzero"),tt.DarkMode&&(d+="&dark=on"),tt.UseStamp||(d+="&usestamp=off"),tt.OnlyLastCycle&&(d+="&lastcycle"),tt.OptimizeDraw!==1&&(d+=`&optimize=${tt.OptimizeDraw}`),tt.MaxRanges!==200&&(d+=`&maxranges=${tt.MaxRanges}`),tt.FuncAsCurve&&(d+="&tf1=curve"),!tt.ToolBar&&!tt.Tooltip&&!tt.ContextMenu&&!tt.Zooming&&!tt.MoveResize&&!tt.DragAndDrop?d+="&interactive=0":tt.ContextMenu||(d+="&nomenu")),h.addDrawMenu("Draw in new tab",l.opts,u=>window.open(`${c}?${d}&${f}&opt=${u}`),"Draw item in the new browser tab or window")}(l.expand||l.get_expand)&&(r._more||r._more===void 0)&&(r._childs===void 0?h.add("Expand",()=>this.expandItem(i),"Expand content of object"):h.add("Unexpand",()=>{r._more=!0,delete r._childs,delete r._isopen,r.expand_item&&delete r._expand,this.updateTreeNode(r)},"Remove all childs from hierarchy")),r._kind===Ee(uf)&&h.add("Apply",()=>this.applyStyle(i))}lt(r._menu)&&r._menu(h,r,this),h.size()>0&&(h.tree_node=e.parentNode,h.separ&&h.separator(),h.add("Close"),h.show())}),!1}async player(t,e){const i=this.findItem(t);if(!Pt(i?._player))return null;let r;if(i._module){const s=await this.importModule(i._module);r=s?s[i._player]:null}else(i._prereq||i._player.indexOf("JSROOT.")>=0)&&await this.loadScripts("",i._prereq),r=ts(i._player);return lt(r)?(await this.createDisplay(),r(this,t,e)):null}canDisplay(t,e){if(!t)return!1;if(t._player)return!0;if(t._can_draw!==void 0)return t._can_draw;if(Pt(e)&&e.indexOf(Li)===0)return!0;const i=ui(t._kind,e);return af(i)}isItemDisplayed(t){return this.getDisplay()?.findFrame(t)!==null}async display(t,e,i=null,r=!1){const s=t;let a=null,o=!1,h=null,l=t;(i===!0||i===!1)&&(r=i,i=null),Pt(i)&&i.indexOf("frame:")===0&&(l=i.slice(6),i=null);const c=(f,d)=>(d&&console.log("When display ",t,"got",d),o&&h&&delete h._doing_update,o||Sn(),lt(f?.setItemName)&&(f.setItemName(s,o?null:e,this),h&&!h._painter&&(h._painter=f)),f||a);return this.createDisplay().then(f=>{if(!f)return c();if(h=this.findItem(s),h?._player)return this.player(s,e).then(u=>c(u));if(o=Pt(e)&&e.indexOf("update:")===0,o){if(e=e.slice(7),!h||h._doing_update)return c();h._doing_update=!0}if(h&&!this.canDisplay(h,e))return c();const d=e===WA;return d&&(e=""),o||Sn(`Loading ${s} ...`),this.getObject(s,e).then(u=>{o||Sn(),h||(h=u.item);let p=u.obj;if(!p)return c();o||Sn(`Drawing ${s} ...`);let m=p._typename?ui(Ee(p._typename)):null;if(m?.draw_field&&p[m.draw_field]&&(p=p[m.draw_field],e||(e=m.draw_field_opt||""),m=p._typename?ui(Ee(p._typename)):null),d&&!e&&m?.dflt&&m.dflt!==Nl&&(e=m.dflt),i)return this.callDrawFunc(i,p,e,o).then(_=>c(_)).catch(_=>c(null,_));let g=!1;const y=[];if(f.forEachPainter((_,x)=>{if(_.getItemName()!==s)return;const v=_.getItemDrawOpt();if(d&&r&&(e=v),!(!o&&e&&v!==e)&&(r&&!g&&(g=!0,f.activateFrame(x)),lt(_.redrawObject))){const b=_.redrawObject(p,e);b&&(a=_,y.push(b))}}),a)return Promise.all(y).then(()=>c());if(o)return console.warn(`something went wrong - did not found painter when doing update of ${s}`),c();const A=f.findFrame(l,!0);return pr(A),f.activateFrame(A),this.callDrawFunc(A,p,e).then(_=>c(_)).catch(_=>c(null,_))})})}enableDrag(t){t.attr("draggable","true").on("dragstart",function(e){const i=this.parentNode.parentNode.getAttribute("item");e.dataTransfer.setData("item",i)})}enableDrop(t){const e=this;Ct(t).on("dragover",i=>{const r=i.dataTransfer.getData("item"),s=e.findItem(r);Aa(s?._kind)&&i.preventDefault()}).on("dragenter",function(){Ct(this).classed("jsroot_drag_area",!0)}).on("dragleave",function(){Ct(this).classed("jsroot_drag_area",!1)}).on("drop",function(i){Ct(this).classed("jsroot_drag_area",!1);const r=i.dataTransfer.getData("item");if(!r)return;const s=[],a=[];let o=bl(this),h=i.target;if(o?.forEachPainter(l=>{s.push(l),a.push(l.getPadSvg().node())},"pads"),s.length>1)for(;h&&h!==this;){const l=a.indexOf(h);if(l>0){o=s[l];break}h=h.parentNode}e.dropItem(r,o||this)})}clearDrop(t){Ct(t).on("dragover",null).on("dragenter",null).on("dragleave",null).on("drop",null)}async dropItem(t,e,i){(!i||!Pt(i))&&(i="");const r=(s,a)=>(!a&<(s?.setItemName)&&s.setItemName(t,null,this),s);if(t==="$legend"){const s=bl(e);return lt(s?.buildLegend)?s.buildLegend(0,0,0,0,"",i).then(a=>r(a)):(console.error("Not possible to build legend"),r(null))}return this.getObject(t).then(s=>{if(!s.obj)return null;const a=um(e);if(lt(a?.performDrop))return a.performDrop(s.obj,t,s.item,i).then(l=>r(l,a===l));const o=s.obj._typename?Bc(Ee(s.obj._typename)):null;return o?.draw?(bl(e)?o?.has_same&&a&&(i="same "+i):this.cleanupFrame(e),lt(e?.addPadButtons)&&e.addPadButtons(),this.callDrawFunc(e,s.obj,i).then(l=>r(l,a===l))):null})}async updateItems(t){if(!this.disp)return!1;const e=[],i=[];let r=!1,s=!1;return Pt(t)?t=[t]:se(t)||(t===void 0&&(t=!this.isMonitoring()),s=!0,r=!!t),this.disp.forEachPainter(a=>{const o=a.getItemName();if(!(!Pt(o)||e.indexOf(o)>=0)){if(s){const h=this.findItem(o);if(!h||h._not_monitor||h._player)return;if(!("_always_monitor"in h)){const l=ui(h._kind);let c=!1;if(l?.monitor!==void 0){if(l.monitor===!1||l.monitor==="never")return;l.monitor==="always"&&(c=!0)}if(!c&&r)return}}else if(t.indexOf(o)<0)return;e.push(o),i.push("update:"+a.getItemDrawOpt())}},!0),this.files_monitoring&&!r&&s&&this.forEachRootFile(a=>{this.forEachItem(o=>{delete o._readobj},a),delete a._file}),this.displayItems(e,i)}async displayItems(t,e){if(!t?.length)return!0;const i=this;for(e||(e=[]);e.length<t.length;)e.push(WA);if(e.length===1&&e[0]==="iotest"){this.clearHierarchy(),Ct("#"+this.disp_frameid).html("").append("h2").text("Start I/O test");const l=new Date;return this.getObject(t[0]).then(c=>{const f=new Date;return Ct("#"+this.disp_frameid).append("h2").text(`Item ${t[0]} reading `+(c?.obj?`type ${c?.obj._typename} time = ${f.getTime()-l.getTime()}ms`:"fail")),!0})}const r=new Array(t.length),s=new Array(t.length),a=new Array(t.length);for(let l=0;l<t.length;++l){r[l]=s[l]=null;const c=t[l];let f=!0;if(c?.indexOf("img:")===0){a[l]=!0;continue}c?.length>1&&c.at(0)==="'"&&c.at(-1)==="'"&&(t[l]=c.slice(1,c.length-1),f=!1);let d=i.findItem({name:t[l],check_keys:!0});if(d){t[l]=i.itemFullName(d);continue}if(f&&t[l].at(0)==="["&&t[l].at(-1)==="]"?(r[l]=bo(t[l]),t[l]=r[l].shift()):f&&t[l].indexOf("+")>0&&(r[l]=t[l].split("+"),t[l]=r[l].shift()),r[l]?.length){for(let p=0;p<r[l].length;++p){const m=r[l][p].indexOf("_same_");m>0&&i.findItem(r[l][p])===null&&(r[l][p]=r[l][p].slice(0,m)+t[l].slice(m)),d=i.findItem({name:r[l][p],check_keys:!0}),d&&(r[l][p]=i.itemFullName(d))}for(e[l].at(0)==="["&&e[l].at(-1)==="]"?(s[l]=bo(e[l]),e[l]=s[l].shift()):e[l].indexOf("+")>0?(s[l]=e[l].split("+"),e[l]=s[l].shift()):s[l]=[];s[l].length<r[l].length;)s[l].push("")}const u=t[l].indexOf("_same_");u>0&&!i.findItem(t[l])&&l>0&&(t[l]=t[l].slice(0,u)+t[0].slice(u)),d=i.findItem({name:t[l],check_keys:!0}),d&&(t[l]=i.itemFullName(d))}for(let l=t.length-1;l>=0;--l){if(a[l])continue;const c=i.findItem(t[l]);!c||i.canDisplay(c,e[l])||(i.expandItem(t[l],null,!0),t.splice(l,1),e.splice(l,1),r.splice(l,1))}if(!t.length)return!0;const o=new Array(t.length),h=new Array(t.length);for(let l=0;l<t.length;++l){h[l]=0;let c=t[l],f=0;t.indexOf(c)<l&&(h[l]=!0);const d=e[l].indexOf("frameid:");if(d>=0)c=e[l].slice(d+8),e[l]=e[l].slice(0,d);else for(;o.indexOf(c)>=0;)c=t[l]+"_"+f++;o[l]=c}for(let l=0;l<t.length;++l){if(h[l]!==0)continue;let c=l;for(let f=0;f<t.length;++f)t[l]===t[f]&&e[f].indexOf("main")>=0&&(c=f);for(let f=0;f<t.length;++f)t[l]===t[f]&&(h[f]=c!==f)}return this.createDisplay().then(l=>{if(!l)return!1;const c=new Array(t.length);for(let u=0;u<t.length;++u)e[u].indexOf("update:")&&(l.createFrame(o[u]),c[u]="frame:"+o[u]);function f(u,p){if(p&&r[u]?.length)return i.dropItem(r[u].shift(),p.getDrawDom(),s[u].shift()).then(()=>f(u,p));r[u]=null,t[u]=null;for(let m=0;m<t.length;++m)if(t[m]!==null&&h[m]&&t.indexOf(t[m])===m)return h[m]=!1,i.display(t[m],e[m],c[m]).then(g=>f(m,g))}const d=[];if(this.#h){let u=function(p){return p>=t.length?!0:h[p]?u(p+1):i.display(t[p],e[p],c[p]).then(m=>f(p,m)).then(()=>u(p+1))};d.push(u(0))}else for(let u=0;u<t.length;++u)h[u]||d.push(i.display(t[u],e[u],c[u]).then(p=>f(u,p)));return Promise.all(d).then(()=>{l?.createFinalBatchFrame&&Ci()&&!Se()&&l.createFinalBatchFrame()})})}async reload(){return"_online"in this.h?this.openOnline(this.h._online).then(()=>this.refreshHtml()):!1}activateItems(t,e){Pt(t)&&(t=[t]);const i=[],r=[];this.forEachItem(a=>{a._background&&(i.push(a),delete a._background)});const s=(a,o)=>{if(a===void 0){if(!t.length){r.reverse().forEach(l=>this.updateTreeNode(l)),i.forEach(l=>this.updateBackground(l,e));return}a=t.shift()}let h=this.findItem(a);if(!h){const l=this.findItem({name:a,last_exists:!0,check_keys:!0,allow_index:!0});if(!l||!l.last)return s();if(l.now_found=this.itemFullName(l.last),e)return o!==void 0&&l.now_found===o?s():this.expandItem(l.now_found).then(c=>{if(!c)return s();let f=this.itemFullName(l.last);f&&(f+="/"),s(f+l.rest,l.now_found)});h=l.last}if(h){let l=h._parent;for(;l;){if(!l._isopen)if(e)l._isopen=!0,r.indexOf(l)<0&&r.push(l);else{h=l;break}l=l._parent}h._background="LightSteelBlue",i.indexOf(h)<0&&i.push(h)}s()};if(e&&this.brlayout){if(!this.brlayout.browser_kind)return this.createBrowser("float",!0).then(()=>s());this.brlayout.browser_visible||this.brlayout.toggleBrowserVisisbility()}s()}canExpandItem(t){if(!t)return!1;if(t._expand)return!0;const e=ui(t._kind,"::expand");return e&&G5(e)}async expandItem(t,e,i){const r=this.findItem(t),s=this;if(!r&&e)return;function a(l){return l._childs===void 0?l._expand_miss=!0:(l._isopen=!0,l._parent&&!l._parent._isopen?(l._parent._isopen=!0,i||s.updateTreeNode(l._parent)):i||s.updateTreeNode(l,e)),l}async function o(l,c){if(delete l._expand_miss,Pt(l._expand)&&(l._expand=ts(l._expand)),!lt(l._expand)){let f=ui(l._kind,"::expand");if(f?.expand_item&&!s._inspector&&(c=c[f.expand_item],l.expand_item=f.expand_item,f=c?._typename?ui(Ee(c._typename),"::expand"):null),f?.expand||f?.get_expand)if(lt(f.expand))l._expand=f.expand;else if(Pt(f.expand)){if(!Kt.ignore_v6){const d=await cf();await d.require(f.prereq),await d._complete_loading()}l._expand=f.expand=ts(f.expand)}else lt(f.get_expand)&&(l._expand=f.expand=await f.get_expand())}if(c&<(l._expand)){const f=l._expand(l,c);if(f)return Go(f).then(()=>a(l))}return c&&Rf(l,c)?a(l):(l._expand_miss=!0,-1)}let h=Promise.resolve(-1);if(r){if(r._more===!1||!r._parent&&r._childs)return;if(r._childs&&r._isopen){r._isopen=!1,i||this.updateTreeNode(r,e);return}r._obj&&(h=o(r,r._obj))}return h.then(l=>l!==-1?l:(Sn("Loading "+t),this.getObject(t,i?"hierarchy_expand":"hierarchy_expand_verbose").then(c=>{if(Sn(),c.obj)return o(c.item,c.obj).then(f=>f!==-1?f:void 0)})))}getTopOnlineItem(t){if(t){for(;t&&!("_online"in t);)t=t._parent;return t}return this.h?this.h._online?this.h:this.h._childs&&this.h._childs[0]?._online?this.h._childs[0]:null:null}forEachJsonFile(t){if(this.h){if(this.h._jsonfile)return t(this.h);this.h._childs?.forEach(e=>{e._jsonfile&&t(e)})}}async openJsonFile(t){let e=!1;if(this.forEachJsonFile(i=>{i._jsonfile===t&&(e=!0)}),!e)return br(t,"object").then(i=>{if(!i)return;const r={_jsonfile:t,_kind:Ee(i._typename),_jsontmp:i,_name:t.split("/").pop()};if(i.fTitle&&(r._title=i.fTitle),r._get=function(s){return s._jsontmp?Promise.resolve(s._jsontmp):br(s._jsonfile,"object").then(a=>(s._jsontmp=a,a))},!this.h)this.h=r;else if(this.h._kind===la)this.h._childs.push(r);else{const s=this.h,a=s?._jsonfile?"Files":"Items";this.h={_name:a,_kind:la,_childs:[s,r]}}return this.refreshHtml()})}forEachRootFile(t){if(this.h){if(this.h._kind===nc&&this.h._file)return t(this.h);this.h._childs?.forEach(e=>{e._kind===nc&&e._fullurl&&t(e)})}}findRootFileForItem(t){let e=this.findItem(t);for(;e;){if(e._kind===nc&&e._fullurl&&e._file)return e;e=e?._parent}return null}async openRootFile(t){let e=!1;if(this.forEachRootFile(r=>{r._fullurl===t&&(e=!0)}),e)return;const i=Pt(t)?t:"file";return Sn(`Opening ${i} ...`),Uu(t).then(r=>{const s=this.fileHierarchy(r);if(s._isopen=!0,!this.h)this.h=s,this.#a&&(s._name=this.#a);else if(this.h._kind===la)this.h._childs.push(s);else{const a=this.h,o=a._kind===nc?"Files":"Items";this.h={_name:o,_kind:la,_childs:[a,s],_isopen:!0}}return this.refreshHtml()}).catch(()=>(Ci()?console.error(`Fail to open ${i} - check CORS headers`):Ct("#gui_fileCORS").style("background","red").empty()||setTimeout(()=>Ct("#gui_fileCORS").style("background",""),5e3),!1)).finally(()=>Sn())}async listServerDir(t){return br(t,"text").then(e=>{if(!e)return!1;const i={_name:"Files",_kind:la,_childs:[],_isopen:!0},r={};let s=0;for(;s<e.length&&(s=e.indexOf('a href="',s+1),!(s<0));){s+=8;const a=e.indexOf('"',s+1);if(a<0)break;const o=e.slice(s,a);s=a+1,!r[o]&&(r[o]=!0,o.lastIndexOf(".root")===o.length-5&&o.length>5?i._childs.push({_name:o,_title:t+o,_url:t+o,_kind:nc,_click_action:Nl,_more:!0,_obj:{},_expand:h=>Uu(h._url).then(l=>{if(!l)return!1;delete h._expand,delete h._more,delete h._click_action,delete h._obj,h._isopen=!0,this.fileHierarchy(l,h),this.updateTreeNode(h)})}):(o.lastIndexOf(".json.gz")===o.length-8&&o.length>8||o.lastIndexOf(".json")===o.length-5&&o.length>5)&&i._childs.push({_name:o,_title:t+o,_jsonfile:t+o,_can_draw:!0,_get:h=>br(h._jsonfile,"object").then(l=>(l&&(h._kind=Ee(l._typename),h._jsontmp=l,this.updateTreeNode(h)),l))}))}return i._childs.length&&(this.h=i),!0})}async applyStyle(t){if(!t)return!0;let e=Promise.resolve(t);if(Pt(t)){const i=this.findItem({name:t,allow_index:!0,check_keys:!0});i!==null?e=this.getObject(i).then(r=>r.obj):t.indexOf(".json")>0&&(e=br(t,"object"))}return e.then(i=>{i?._typename===uf&&Object.assign(K,i)})}getFileProp(t){let e=this.findItem(t);if(!e)return null;for(t=e._name;e._parent;){if(e=e._parent,e._file)return{kind:"file",fileurl:e._file.fURL,itemname:t,localfile:!!e._file.fLocalFile};if(e._jsonfile)return{kind:"json",fileurl:e._jsonfile,itemname:t};t=e._name+"/"+t}return null}getOnlineItemUrl(t){Pt(t)&&(t=this.findItem(t));let e=t;for(;e&&e._online===void 0;)e=e._parent;return e?e._online+this.itemFullName(t,e):null}isOnlineItem(t){return this.getOnlineItemUrl(t)!==null}async importModule(t){switch(t){case"core":return Qt(()=>Promise.resolve().then(()=>lP),void 0);case"draw_tree":return Qt(()=>import("./TTree-BtFtnLeD.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,10,11,12,13,14,15]));case"hierarchy":return{HierarchyPainter:h0,markAsStreamerInfo:K8}}return import(t)}setCachedObject(t){this.#d=t}async getOnlineItem(t,e,i){let r=e,s=!1,a="",o="object",h=null;if(Pt(i)&&i.indexOf("hierarchy_expand")===0&&(s=!0,i=void 0),t){r=this.getOnlineItemUrl(t);let l=null;if(t._kind&&(h=ui(t._kind)),s?(a="h.json?compact=3",t._expand=Lm):t._make_request?t._module?l=(await this.importModule(t._module))[t._make_request]:l=ts(t._make_request):h?.make_request&&(l=h.make_request),lt(l)){const c=l(this,t,r,i);c&&(Pt(c)?a=c:(c.req&&(a=c.req),c.kind&&(o=c.kind)))}!a&&!Aa(t._kind)&&(a="item.json.gz?compact=3")}if(!e&&t&&this.#d&&!a){const l=this.#d;return this.#d=void 0,l}return a||(a="root.json.gz?compact=23"),r&&(r+="/"),r+=a,new Promise(l=>{let c=null;z1(r,o,f=>{const d=u=>{if(lt(u)){const p=u(this,t,f,i,c);se(p)&&(f=p)}l(f)};!s&&t?._after_request?t._module?this.importModule(t._module).then(u=>d(u[t._after_request])):d(ts(t._after_request)):d(h?.after_request)},void 0,!0).then(f=>{c=f,f.send(null)})})}async openOnline(t){const e=async i=>{if(this.h=i,!i)return Promise.resolve(null);this.h?._title&&typeof document<"u"&&(document.title=this.h._title),i._isopen=!0,this.h._online=t,this.h._get=(h,l,c)=>this.getOnlineItem(h,l,c),this.h._expand=Lm;const r=[],s=[],a=[],o=[];return this.forEachItem(h=>{h._childs!==void 0&&(h._expand=Lm),h._autoload&&h._autoload.split(";").forEach(c=>{c.length>4&&c.lastIndexOf(".mjs")===c.length-4?o.push(this.importModule(c)):c.length>3&&c.lastIndexOf(".js")===c.length-3?s.find(f=>f===c)||s.push(c):c.length>4&&c.lastIndexOf(".css")===c.length-4?r.find(f=>f===c)||r.push(c):c&&!a.find(f=>f===c)&&a.push(c)})}),this.loadScripts(s,a).then(()=>Cr(r)).then(()=>Promise.all(o)).then(()=>(this.forEachItem(h=>{if(!("_drawfunc"in h)||!("_kind"in h))return;const l=Aa(h._kind)||`kind:${h._kind}`,c=h._drawopt;(!af(l)||c)&&Od({name:l,func:h._drawfunc,script:h._drawscript,opt:c})}),this))};if(t||(t=""),se(t)){const i=t;return t="",e(i)}return br(t+"h.json?compact=3","object").then(i=>e(i))}getOnlineProp(t){let e=this.findItem(t);if(!e)return null;for(t=e._name;e._parent;){if(e=e._parent,e._online)return{server:e._online,itemname:t};t=e._name+"/"+t}return null}fillOnlineMenu(t,e,i){const r=this.findItem(i),s=Bc(r._kind,"nosame;noinspect"),a=ui(r._kind),o=Aa(r._kind);s.opts&&r._can_draw!==!1&&(s.opts.push(Li),t.addDrawMenu("Draw",s.opts,h=>this.display(i,h))),!r._childs&&r._more!==!1&&(r._more||o||s.expand||s.get_expand)&&t.add("Expand",()=>this.expandItem(i)),a?.execute&&t.add("Execute",()=>this.executeCommand(i,t.tree_node)),s.opts&&r._can_draw!==!1&&t.addDrawMenu("Draw in new window",s.opts,h=>window.open(e.server+`?nobrowser&item=${e.itemname}`+(this.isMonitoring()?`&monitoring=${this.getMonitoringInterval()}`:"")+(h?`&opt=${h}`:""))),s.opts?.length&&o&&r._can_draw!==!1&&t.addDrawMenu("Draw as png",s.opts,h=>window.open(e.server+e.itemname+"/root.png?w=600&h=400"+(h?"&opt="+h:"")),"Request PNG image from the server"),r._player&&t.add("Player",()=>this.player(i))}setHierarchy(t){this.h=t,this.refreshHtml()}setMonitoring(t,e){this.#n("cleanup"),t&&(t=parseInt(t),Number.isInteger(t)&&t>0?(this.#i=Math.max(100,t),e=!0):this.#i=3e3),this.#r=e,this.isMonitoring()&&this.#n()}#n(t){if(t==="cleanup"||!this.isMonitoring()){this.#e&&(clearTimeout(this.#e),this.#e=void 0),this.#s&&(cancelAnimationFrame(this.#s),this.#s=void 0);return}if(t==="frame"){this.#e=void 0,this.#s=requestAnimationFrame(()=>this.#n("draw"));return}t==="draw"&&(this.#s=void 0,this.updateItems()),this.#e=setTimeout(()=>this.#n("frame"),this.getMonitoringInterval())}getMonitoringInterval(){return this.#i||3e3}isMonitoring(){return this.#r}setDisplay(t,e){!e&&se(t)?(this.disp=t,this.disp_kind="custom",this.disp_frameid=null):(this.disp_kind=t,this.disp_frameid=e),!this.register_resize&&this.disp_kind!=="batch"&&(this.register_resize=!0,Gv(this))}getLayout(){return this.disp_kind}removePainter(t){this.forEachItem(e=>{e._painter===t&&(delete e._painter,lt(e.clear)&&e.clear())})}clearHierarchy(t){this.disp&&(this.disp.cleanup(),delete this.disp);const e=[];this.forEachItem(i=>{delete i._painter,!t&<(i.clear)&&i.clear(),t&&e.push(i)}),t&&(this.enableMonitoring(!1),this.selectDom().html(""),e.forEach(i=>{delete i._parent,delete i._childs,delete i._obj,delete i._d3cont}),delete this.h)}getDisplay(){return this.disp}cleanupFrame(t){Ct(t).attr("frame_title",null),this.clearDrop(t);const e=pr(t);e.length&&this.forEachItem(i=>{i._painter&&e.indexOf(i._painter)>=0&&delete i._painter})}async createDisplay(){if(this.disp){if(this.disp.numDraw()>0||this.disp_kind==="custom")return this.disp;this.disp.cleanup(),delete this.disp}return this.disp_kind==="batch"?(Se()?pv():Promise.resolve(null)).then(e=>(this.disp=new jS(1200,800,e?.body),this.disp)):!this.disp_frameid||!document.getElementById(this.disp_frameid)?null:(Ci()?this.disp=new jS(tt.CanvasWidth,tt.CanvasHeight):this.disp_kind.indexOf("flex")===0||this.disp_kind.indexOf("coll")===0?this.disp=new s$(this.disp_frameid):this.disp_kind==="tabs"?this.disp=new r$(this.disp_frameid):this.disp=new jv(this.disp_frameid,this.disp_kind),this.disp.cleanupFrame=this.cleanupFrame.bind(this),tt.DragAndDrop&&this.disp.setInitFrame(this.enableDrop.bind(this)),this.disp)}async createCustomDisplay(t,e){if(this.disp_kind!=="simple")return this.createDisplay();if(this.disp_kind=e,this.disp){const i=this.disp.numDraw();if(i>1||i===1&&!this.disp.findFrame(t))return this.createDisplay();this.disp.cleanup(),delete this.disp}return this.createDisplay()}updateOnOtherFrames(t,e){const i=e._typename?ui(Ee(e._typename)):null;i?.draw_field&&e[i?.draw_field]&&(e=e[i?.draw_field]);let r=!1;return this.disp?.forEachPainter(s=>{s===t||s.getItemName()!==t.getItemName()||lt(s.redrawObject)&&s.redrawObject(e)&&(r=!0)}),r}checkResize(t){this.disp?.checkMDIResize(null,t)}async loadScripts(t,e,i){return!t?.length&&!e?.length?!0:i&&t.indexOf(".mjs")>0?Hd(t.split(";")):(i&&!globalThis.JSROOT&&(globalThis.JSROOT={version:lf,gStyle:K,create:Nt,httpRequest:br,loadScript:Cr,decodeUrl:Lu,source_dir:li,settings:tt,addUserStreamer:lH,addDrawFunc:Od,draw:Xa,redraw:v2}),Kt.ignore_v6||i?Cr(t):cf().then(r=>r.require(e).then(()=>Cr(t)).then(()=>r._complete_loading())))}async startGUI(t,e){const i=Lu(e),r=C=>{let R=i.get(C,null);return R===null&&t&&!t.empty()&&t.node().hasAttribute(C)&&(R=t.attr(C)),R},s=C=>{let R=[];for(;C;){const F=C.indexOf(";");let P=F>0?C.slice(0,F):C;C=F>0?C.slice(F+1):"";let I=!0;P[0]==="#"&&(P=P.slice(1),I=!1);const U=i.get(P,null);I?R=R.concat(bo(U)):U!==null&&R.push(U)}return R},a=C=>{let R=s(C);if(R.length||!t||t.empty())return R;for(;C;){const F=C.indexOf(";");let P=F>0?C.slice(0,F):C;C=F>0?C.slice(F+1):"";let I=!0;if(P[0]==="#"&&(P=P.slice(1),I=!1),P==="files"||!t.node().hasAttribute(P))continue;const U=t.attr(P);I?R=R.concat(bo(U)):U!==null&&R.push(U)}return R},o=i.get("path")||"",h=a("#json;jsons"),l=a("expand"),c=r("focus"),f=r("layout"),d=a("#style"),u=r("title");this.#h=tt.drop_items_one_by_one??r("one_by_one")!==null;let p=r("prereq")||"",m=r("load"),g=r("dir"),y=r("inject"),A=a("#file;files"),_=a("#item;items"),x=a("#opt;opts"),v=r("monitoring"),b=0,M=r("status"),T=r("browser"),w=!!T;if(v===null?v=0:v===""?v=3e3:v=parseInt(v),r("float")!==null?(T="float",w=!0):r("fix")!==null&&(T="fix",w=!0),!w&&ue.screenWidth<=640&&(T="float"),this.no_select=r("noselect"),this.top_info=r("info"),r("files_monitoring")!==null&&(this.files_monitoring=!0),u&&typeof document<"u"&&(document.title=u),!l.length&&r("expand")===""&&l.push(""),o){for(let C=0;C<A.length;++C)A[C]=o+A[C];for(let C=0;C<h.length;++C)h[C]=o+h[C]}if(!_.length&&(r("item")===""||h.length===1&&!l.length)&&_.push(""),!this.disp_kind)if(Pt(f)&&f)this.disp_kind=f;else if(tt.DislpayKind&&tt.DislpayKind!=="simple")this.disp_kind=tt.DislpayKind;else{const C=["simple","simple","vert2","vert21","vert22","vert32","vert222","vert322","vert332","vert333"];this.disp_kind=C[_.length]||"flex"}M==="no"?M=null:M==="off"?(this.status_disabled=!0,M=null):M==="on"?M=!0:M!==null&&(b=parseInt(M),(!Number.isInteger(b)||b<5)&&(b=0),M=!0),this.no_select===""&&(this.no_select=!0),T?T==="no"?T="":T==="off"&&(T="",M=null,this.exclude_browser=!0):T="fix",r("nofloat")!==null&&(this.float_browser_disabled=!0),this.start_without_browser&&(T=""),this.#a=r("topname");const E=()=>{let C;if(m||p)C=this.loadScripts(m,p),m=p="";else if(y)C=this.loadScripts(y,"",!0),y="";else if(T)C=this.createBrowser(T),T="";else if(M!==null)C=this.createStatusLine(b,M),M=null;else if(h.length)C=this.openJsonFile(h.shift());else if(A.length)C=this.openRootFile(A.shift());else if(g)C=this.listServerDir(g),g="";else if(l.length)C=this.expandItem(l.shift());else if(d.length)C=this.applyStyle(d.shift());else return this.refreshHtml().then(()=>this.displayItems(_,x)).then(()=>c?this.focusOnItem(c):this).then(()=>(this.setMonitoring(v),_?this.refreshHtml():this));return C.then(E)};let k=null;if(this.is_online){const C=Kt.getCachedHierarchy||ts("GetCachedHierarchy");lt(C)&&(k=C()),se(k)||(k=""),this.is_online==="draw"&&!_.length&&_.push("")}return k!==null?this.openOnline(k).then(()=>(!this.exclude_browser&&!w&&this.h._browser&&(T=this.h._browser,T==="no"?T="":T==="off"&&(T="",M=null,this.exclude_browser=!0)),"_monitoring"in this.h&&!v&&(v=this.h._monitoring),this.h._loadfile&&!A.length&&(A=bo(this.h._loadfile)),"_drawitem"in this.h&&!_.length&&(_=bo(this.h._drawitem),x=bo(this.h._drawopt)),this.h._layout&&!f&&(this.is_online!=="draw"||_.length>1)&&(this.disp_kind=this.h._layout),"_toptitle"in this.h&&this.exclude_browser&&typeof document<"u"&&(document.title=this.h._toptitle),t&&this.prepareGuiDiv(t.attr("id"),this.disp_kind),E())):(t&&this.prepareGuiDiv(t.attr("id"),this.disp_kind),E())}prepareGuiDiv(t,e){this.gui_div=Pt(t)?t:t.attr("id"),this.brlayout=new KE(this.gui_div,this),this.brlayout.create(!this.exclude_browser),this.createButtons(),this.setDisplay(e,this.brlayout.drawing_divid())}createButtons(){if(this.exclude_browser)return;const t=this.brlayout?.createBrowserBtns();t&&(Ai.createSVG(t,Ai.diamand,15,"toggle fix-pos browser","browser").style("margin","3px").on("click",()=>this.createBrowser("fix",!0)),this.float_browser_disabled||Ai.createSVG(t,Ai.circle,15,"toggle float browser","browser").style("margin","3px").on("click",()=>this.createBrowser("float",!0)),this.status_disabled||Ai.createSVG(t,Ai.three_circles,15,"toggle status line","browser").style("margin","3px").on("click",()=>this.createStatusLine(0,"toggle")))}hasStatusLine(){return this.status_disabled||!this.gui_div||!this.brlayout?!1:this.brlayout.hasStatus()}async createStatusLine(t,e){return this.status_disabled||!this.gui_div||!this.brlayout?"":this.brlayout.createStatusLine(t,e)}redrawObject(t){return!this._inspector&&!this._streamer_info?!1:(this._streamer_info?this.h=Q8(t):this.h=t7(t),this.refreshHtml().then(()=>this.setTopPainter()))}async createBrowser(t,e){if(!this.gui_div||this.exclude_browser||!this.brlayout)return!1;const i=Ct(`#${this.gui_div} .jsroot_browser`);if(i.empty())return!1;if(t==="float"&&this.float_browser_disabled&&(t="fix"),!i.select(".jsroot_browser_area").empty())return e&&this.brlayout.toggleKind(t),!0;let r=`<p class="jsroot_browser_version"><a href="https://root.cern/js/">JSROOT</a> version <span style="color:green"><b>${lf}</b></span></p>`;if(this.is_online)r+='<p> Hierarchy in <a href="h.json">json</a> and <a href="h.xml">xml</a> format</p><div style="display:inline; vertical-align:middle; white-space: nowrap;"><label style="margin-right:5px"><input type="checkbox" name="monitoring" class="gui_monitoring"/>Monitoring</label>';else if(this.no_select)this.no_select==="file"&&(r+='<div style="display:flex;flex-direction:row">');else{const o=Ct("#"+this.gui_div),h=o.attr("files")||"../files/hsimple.root",l=Lu().get("path")||o.attr("path")||"",c=h.split(";");r+='<input type="text" value="" style="width:95%; margin:5px;border:2px;" class="gui_urlToLoad" title="input file name"/><div style="display:flex;flex-direction:row;padding-top:5px"><select class="gui_selectFileName" style="flex:1;padding:2px;" title="select file name"<option value="" selected="selected"></option>',c.forEach(f=>{r+=`<option value="${l+f}">${f}</option>`}),r+='</select><input type="file" class="gui_localFile" accept=".root" style="display:none"/><output id="list" style="display:none"></output><input type="button" value="..." class="gui_fileBtn" style="min-width:3em;padding:3px;margin-left:5px;margin-right:5px;" title="select local file for reading"/><br/></div><p id="gui_fileCORS"><small><a href="https://github.com/root-project/jsroot/blob/master/docs/JSROOT.md#reading-root-files-from-other-servers">Read docu</a> how to open files from other servers.</small></p><div style="display:flex;flex-direction:row"><input style="padding:3px;margin-right:5px" class="gui_ReadFileBtn" type="button" title="Read the Selected File" value="Load"/><input style="padding:3px;margin-right:5px" class="gui_ResetUIBtn" type="button" title="Close all opened files and clear drawings" value="Reset"/>'}(this.is_online||!this.no_select||this.no_select==="file")&&(r+='<select style="padding:2px;margin-right:5px;" title="layout kind" class="gui_layout"></select></div>'),r+=`<div id="${this.gui_div}_browser_hierarchy" class="jsroot_browser_hierarchy"></div>`,this.brlayout.setBrowserContent(r),this.brlayout.setBrowserTitle(this.top_info||(this.is_online?"ROOT online server":"Read a ROOT file"))?.on("contextmenu",o=>{o.preventDefault(),fr(o).then(h=>{this.fillSettingsMenu(h,!0),h.show()})}).on("dblclick",()=>{this.createBrowser(this.brlayout?.browser_kind==="float"?"fix":"float",!0)}),!this.is_online&&!this.no_select&&(this.readSelectedFile=function(){const o=i.select(".gui_urlToLoad").property("value").trim();o&&(o.toLowerCase().lastIndexOf(".json")===o.length-5?this.openJsonFile(o):this.openRootFile(o))},i.select(".gui_selectFileName").property("value","").on("change",o=>i.select(".gui_urlToLoad").property("value",o.target.value)),i.select(".gui_fileBtn").on("click",()=>i.select(".gui_localFile").node().click()),i.select(".gui_ReadFileBtn").on("click",()=>this.readSelectedFile()),i.select(".gui_ResetUIBtn").on("click",()=>this.clearHierarchy(!0)),i.select(".gui_urlToLoad").on("keyup",o=>{o.code==="Enter"&&this.readSelectedFile()}),i.select(".gui_localFile").on("change",o=>{const h=o.target.files;for(let l=0;l<h.length;++l){const c=h[l];i.select(".gui_urlToLoad").property("value",c.name),this.openRootFile(c)}}));const a=i.select(".gui_layout");return a.empty()||(["simple","vert2","vert3","vert231","horiz2","horiz32","flex","tabs","grid 2x2","grid 1x3","grid 2x3","grid 3x3","grid 4x4"].forEach(o=>a.append("option").attr("value",o).text(o)),a.on("change",o=>{const h=o.target.value||"flex";this.setDisplay(h,this.gui_div+"_drawing"),tt.DislpayKind=h})),this.setDom(this.gui_div+"_browser_hierarchy"),e&&(this.refreshHtml(),this.initializeBrowser()),this.brlayout.toggleBrowserKind(t||"fix")}initializeBrowser(){const t=Ct(`#${this.gui_div} .jsroot_browser`);if(t.empty()||!this.brlayout)return;this.brlayout.adjustBrowserSize();const e=t.select(".gui_layout").node();if(e){let i=!1;for(const r in e.options){const s=e.options[r].text;if(Pt(s)&&(s===this.getLayout()||s.replace(/ /g,"")===this.getLayout())){e.selectedIndex=r,i=!0;break}}if(!i){const r=document.createElement("option");r.innerText=r.value=this.getLayout(),e.appendChild(r),e.selectedIndex=e.options.length-1}}if(this.is_online)this.h?._toptitle&&this.brlayout.setBrowserTitle(this.h._toptitle),t.select(".gui_monitoring").property("checked",this.isMonitoring()).on("click",i=>{this.enableMonitoring(i.target.checked),this.updateItems()});else if(!this.no_select){let i="";this.forEachRootFile(r=>{i||(i=r._fullurl)}),t.select(".gui_urlToLoad").property("value",i)}}enableMonitoring(t){this.setMonitoring(void 0,t);const e=Ct(`#${this.gui_div} .jsroot_browser .gui_monitoring`);!e.empty()&&e.property("checked")!==t&&e.property("checked",t)}}async function qY(n,t){const e=new h0("sinfo",n,"__as_dark_mode__");return Ci()?(e.selectDom().property("_json_object_",t),e):(e._streamer_info=!0,e.h=Q8(t),e.refreshHtml().then(()=>(e.setTopPainter(),e)))}async function kb(n,t,e){pr(n);const i=new h0("inspector",n,"__as_dark_mode__");if(Ci())return i.selectDom().property("_json_object_",t),i;i.default_by_click=Nl,i.with_icons=!1,i._inspector=!0;let r=0;return Pt(e)&&e.indexOf(Li)===0&&(e=e.slice(Li.length),e&&(r=Number.parseInt(e))),i.selectDom().classed("jsroot_inspector")&&(i.removeInspector=function(){this.selectDom().remove()},!ue.qt6&&!ue.cef3&&(i.storeAsJson=function(){const s=ba(t,2),a=t.fName||"file";UE(`${a}.json`,i1+encodeURIComponent(s))})),i.fill_context=function(s,a){const o=Bc(a._kind,"nosame");o.opts&&s.addDrawMenu("nosub:Draw",o.opts,h=>{if(!a?._obj)return;const l=a._obj;let c=this.selectDom().node();if(lt(this.removeInspector)&&(c=c.parentNode,this.removeInspector(),h.indexOf(Li)===0))return this.showInspector(h,l);pr(c),Xa(c,l,h)})},i.h=t7(t),i.refreshHtml().then(()=>(i.setTopPainter(),i.expandToLevel(r)))}Vn.prototype.showInspector=function(n,t){if(n==="check")return!0;const e=this.selectDom(),i=cr(e),r=Math.round(i.width*.05)+"px",s=Math.round(i.height*.05)+"px",a="root_inspector_"+Kt.id_counter++;return e.append("div").attr("id",a).attr("class","jsroot_inspector").style("position","absolute").style("top",s).style("bottom",s).style("left",r).style("right",r),t?._typename||(t=lt(this.getPrimaryObject)?this.getPrimaryObject():this.getObject()),kb(a,t,n)};Kt.drawInspector=kb;const VY=Object.freeze(Object.defineProperty({__proto__:null,HierarchyPainter:h0,drawInspector:kb,drawList:BY,drawStreamerInfo:qY,folderHierarchy:zY,keysHierarchy:ql,listHierarchy:J8,markAsStreamerInfo:K8,objectHierarchy:Rf,parseAsArray:bo,taskHierarchy:UY},Symbol.toStringTag,{value:"Module"}));var b2=function(n,t){return b2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},b2(n,t)};function Xf(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");b2(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function IQ(n,t,e,i){function r(s){return s instanceof e?s:new e(function(a){a(s)})}return new(e||(e=Promise))(function(s,a){function o(c){try{l(i.next(c))}catch(f){a(f)}}function h(c){try{l(i.throw(c))}catch(f){a(f)}}function l(c){c.done?s(c.value):r(c.value).then(o,h)}l((i=i.apply(n,t||[])).next())})}function OQ(n,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=o(0),a.throw=o(1),a.return=o(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(l){return function(c){return h([l,c])}}function h(l){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(e=0)),e;)try{if(i=1,r&&(s=l[0]&2?r.return:l[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;switch(r=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,r=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){e.label=l[1];break}if(l[0]===6&&e.label<s[1]){e.label=s[1],s=l;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(l);break}s[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(n,e)}catch(c){l=[6,c],r=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Bd(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],i=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w2(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var i=e.call(n),r,s=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(o){a={error:o}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(a)throw a.error}}return s}function S2(n,t,e){if(e||arguments.length===2)for(var i=0,r=t.length,s;i<r;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return n.concat(s||Array.prototype.slice.call(t))}function M2(n){return this instanceof M2?(this.v=n,this):new M2(n)}function BQ(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(n,t||[]),r,s=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),r[Symbol.asyncIterator]=function(){return this},r;function a(u){return function(p){return Promise.resolve(p).then(u,f)}}function o(u,p){i[u]&&(r[u]=function(m){return new Promise(function(g,y){s.push([u,m,g,y])>1||h(u,m)})},p&&(r[u]=p(r[u])))}function h(u,p){try{l(i[u](p))}catch(m){d(s[0][3],m)}}function l(u){u.value instanceof M2?Promise.resolve(u.value.v).then(c,f):d(s[0][2],u)}function c(u){h("next",u)}function f(u){h("throw",u)}function d(u,p){u(p),s.shift(),s.length&&h(s[0][0],s[0][1])}}function zQ(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof Bd=="function"?Bd(n):n[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=n[s]&&function(a){return new Promise(function(o,h){a=n[s](a),r(o,h,a.done,a.value)})}}function r(s,a,o,h){Promise.resolve(h).then(function(l){s({value:l,done:o})},a)}}function Ba(n){return typeof n=="function"}function e7(n){var t=function(i){Error.call(i),i.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var jA=e7(function(n){return function(e){n(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
4550
4550
|
`+e.map(function(i,r){return r+1+") "+i.toString()}).join(`
|
|
4551
4551
|
`):"",this.name="UnsubscriptionError",this.errors=e}});function T2(n,t){if(n){var e=n.indexOf(t);0<=e&&n.splice(e,1)}}var Rg=(function(){function n(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var t,e,i,r,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Bd(a),h=o.next();!h.done;h=o.next()){var l=h.value;l.remove(this)}}catch(m){t={error:m}}finally{try{h&&!h.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}else a.remove(this);var c=this.initialTeardown;if(Ba(c))try{c()}catch(m){s=m instanceof jA?m.errors:[m]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var d=Bd(f),u=d.next();!u.done;u=d.next()){var p=u.value;try{$5(p)}catch(m){s=s??[],m instanceof jA?s=S2(S2([],w2(s)),w2(m.errors)):s.push(m)}}}catch(m){i={error:m}}finally{try{u&&!u.done&&(r=d.return)&&r.call(d)}finally{if(i)throw i.error}}}if(s)throw new jA(s)}},n.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)$5(t);else{if(t instanceof n){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},n.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},n.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},n.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&T2(e,t)},n.prototype.remove=function(t){var e=this._finalizers;e&&T2(e,t),t instanceof n&&t._removeParent(this)},n.EMPTY=(function(){var t=new n;return t.closed=!0,t})(),n})(),i7=Rg.EMPTY;function n7(n){return n instanceof Rg||n&&"closed"in n&&Ba(n.remove)&&Ba(n.add)&&Ba(n.unsubscribe)}function $5(n){Ba(n)?n():n.unsubscribe()}var GY={Promise:void 0},$Y={setTimeout:function(n,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];return setTimeout.apply(void 0,S2([n,t],w2(e)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function HY(n){$Y.setTimeout(function(){throw n})}function H5(){}function Nm(n){n()}var r7=(function(n){Xf(t,n);function t(e){var i=n.call(this)||this;return i.isStopped=!1,e?(i.destination=e,n7(e)&&e.add(i)):i.destination=XY,i}return t.create=function(e,i,r){return new E2(e,i,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Rg),WY=(function(){function n(t){this.partialObserver=t}return n.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(i){Lp(i)}},n.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(i){Lp(i)}else Lp(t)},n.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Lp(e)}},n})(),E2=(function(n){Xf(t,n);function t(e,i,r){var s=n.call(this)||this,a;return Ba(e)||!e?a={next:e??void 0,error:i??void 0,complete:r??void 0}:a=e,s.destination=new WY(a),s}return t})(r7);function Lp(n){HY(n)}function jY(n){throw n}var XY={closed:!0,next:H5,error:jY,complete:H5},YY=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function ZY(n){return n}function JY(n){return n.length===0?ZY:n.length===1?n[0]:function(e){return n.reduce(function(i,r){return r(i)},e)}}var W5=(function(){function n(t){t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,i){var r=this,s=KY(t)?t:new E2(t,e,i);return Nm(function(){var a=r,o=a.operator,h=a.source;s.add(o?o.call(s,h):h?r._subscribe(s):r._trySubscribe(s))}),s},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},n.prototype.forEach=function(t,e){var i=this;return e=j5(e),new e(function(r,s){var a=new E2({next:function(o){try{t(o)}catch(h){s(h),a.unsubscribe()}},error:s,complete:r});i.subscribe(a)})},n.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},n.prototype[YY]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return JY(t)(this)},n.prototype.toPromise=function(t){var e=this;return t=j5(t),new t(function(i,r){var s;e.subscribe(function(a){return s=a},function(a){return r(a)},function(){return i(s)})})},n.create=function(t){return new n(t)},n})();function j5(n){var t;return(t=n??GY.Promise)!==null&&t!==void 0?t:Promise}function QY(n){return n&&Ba(n.next)&&Ba(n.error)&&Ba(n.complete)}function KY(n){return n&&n instanceof r7||QY(n)&&n7(n)}var tZ=e7(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Lb=(function(n){Xf(t,n);function t(){var e=n.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var i=new X5(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new tZ},t.prototype.next=function(e){var i=this;Nm(function(){var r,s;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var a=Bd(i.currentObservers),o=a.next();!o.done;o=a.next()){var h=o.value;h.next(e)}}catch(l){r={error:l}}finally{try{o&&!o.done&&(s=a.return)&&s.call(a)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var i=this;Nm(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var r=i.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;Nm(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var i=e.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var i=this,r=this,s=r.hasError,a=r.isStopped,o=r.observers;return s||a?i7:(this.currentObservers=null,o.push(e),new Rg(function(){i.currentObservers=null,T2(o,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,r=i.hasError,s=i.thrownError,a=i.isStopped;r?e.error(s):a&&e.complete()},t.prototype.asObservable=function(){var e=new W5;return e.source=this,e},t.create=function(e,i){return new X5(e,i)},t})(W5),X5=(function(n){Xf(t,n);function t(e,i){var r=n.call(this)||this;return r.destination=e,r.source=i,r}return t.prototype.next=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,e)},t.prototype.error=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,e)},t.prototype.complete=function(){var e,i;(i=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||i===void 0||i.call(e)},t.prototype._subscribe=function(e){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&r!==void 0?r:i7},t})(Lb),eZ=(function(n){Xf(t,n);function t(e){var i=n.call(this)||this;return i._value=e,i}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var i=n.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},t.prototype.getValue=function(){var e=this,i=e.hasError,r=e.thrownError,s=e._value;if(i)throw r;return this._throwIfClosed(),s},t.prototype.next=function(e){n.prototype.next.call(this,this._value=e)},t})(Lb),s7={now:function(){return(s7.delegate||Date).now()},delegate:void 0},C2=(function(n){Xf(t,n);function t(e,i,r){e===void 0&&(e=1/0),i===void 0&&(i=1/0),r===void 0&&(r=s7);var s=n.call(this)||this;return s._bufferSize=e,s._windowTime=i,s._timestampProvider=r,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=i===1/0,s._bufferSize=Math.max(1,e),s._windowTime=Math.max(1,i),s}return t.prototype.next=function(e){var i=this,r=i.isStopped,s=i._buffer,a=i._infiniteTimeWindow,o=i._timestampProvider,h=i._windowTime;r||(s.push(e),!a&&s.push(o.now()+h)),this._trimBuffer(),n.prototype.next.call(this,e)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var i=this._innerSubscribe(e),r=this,s=r._infiniteTimeWindow,a=r._buffer,o=a.slice(),h=0;h<o.length&&!e.closed;h+=s?1:2)e.next(o[h]);return this._checkFinalizedStatuses(e),i},t.prototype._trimBuffer=function(){var e=this,i=e._bufferSize,r=e._timestampProvider,s=e._buffer,a=e._infiniteTimeWindow,o=(a?1:2)*i;if(i<1/0&&o<s.length&&s.splice(0,s.length-o),!a){for(var h=r.now(),l=0,c=1;c<s.length&&s[c]<=h;c+=2)l=c;l&&s.splice(0,l+1)}},t})(Lb);class iZ{#i;#r;#e;#s;constructor(t){this.#i=t,this.#r=this.open(t)}static async open(t){return Uu(t)}async getHistogram(t,e,i){if(t===0)return this.#e.readObject("hMap");{let r=this.#s.reduce((s,a)=>s*a,1);for(let s=0;s<=t;s++)r/=this.#s[s]}}static async parseFile(t){const e=await this.open(t);await this.computeMaxInstancesPerLayer(e)}static async computeMaxInstancesPerLayer(t){if(!t)return;const e=await t.readObject("hMap");e.children={};const i=e.fXaxis.fNbins*e.fYaxis.fNbins*e.fZaxis.fNbins;let r=[];r.push(i);const s=async(h,l)=>{for(const f of Object.keys(e.children))for(let d=0;d<h.length;d+=100){const u=[],p=Math.min(d+100,h.length);for(let m=d;m<p;m++)u.push(l.readObject(`content/${h[m].fName}/${f}`));console.log(`Processing batch: ${d} to ${p-1} (${u.length} items)`),await Promise.all(u)}return console.log("done"),h.forEach(f=>{}),r},a=await t.readObject("content");return(await t.readObject(`content/${a.fKeys[0].fName}`)).fKeys.forEach(h=>{e.children[h.fName]=[]}),console.log(e),s(a.fKeys,t),r}}const a7="183",P2=0,nZ=1,UQ=2,Y5=1,Z5=100,J5=204,Q5=205,K5=3,rZ=0,o7=300,t4=1e3,Np=1001,e4=1002,sZ=1006,aZ=1008,oZ=1009,lZ=1015,hZ=1023,l7="",Sr="srgb",i4="srgb-linear",n4="linear",XA="srgb",rc=7680,r4=519,k2=35044,Rp=2e3,s4=2001;function cZ(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function L2(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}const a4={};function o4(...n){const t="THREE."+n.shift();console.log(t,...n)}function h7(n){const t=n[0];if(typeof t=="string"&&t.startsWith("TSL:")){const e=n[1];e&&e.isStackTrace?n[0]+=" "+e.getLocation():n[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return n}function bi(...n){n=h7(n);const t="THREE."+n.shift();{const e=n[0];e&&e.isStackTrace?console.warn(e.getError(t)):console.warn(t,...n)}}function Sa(...n){n=h7(n);const t="THREE."+n.shift();{const e=n[0];e&&e.isStackTrace?console.error(e.getError(t)):console.error(t,...n)}}function l4(...n){const t=n.join(" ");t in a4||(a4[t]=!0,bi(...n))}class Dg{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)}hasEventListener(t,e){const i=this._listeners;return i===void 0?!1:i[t]!==void 0&&i[t].indexOf(e)!==-1}removeEventListener(t,e){const i=this._listeners;if(i===void 0)return;const r=i[t];if(r!==void 0){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}dispatchEvent(t){const e=this._listeners;if(e===void 0)return;const i=e[t.type];if(i!==void 0){t.target=this;const r=i.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,t);t.target=null}}}const on=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],fZ=Math.PI/180;function za(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(on[n&255]+on[n>>8&255]+on[n>>16&255]+on[n>>24&255]+"-"+on[t&255]+on[t>>8&255]+"-"+on[t>>16&15|64]+on[t>>24&255]+"-"+on[e&63|128]+on[e>>8&255]+"-"+on[e>>16&255]+on[e>>24&255]+on[i&255]+on[i>>8&255]+on[i>>16&255]+on[i>>24&255]).toLowerCase()}function Ce(n,t,e){return Math.max(t,Math.min(e,n))}function uZ(n,t){return(n%t+t)%t}function YA(n,t,e){return(1-e)*n+e*t}function Es(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Xe(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}class _e{constructor(t=0,e=0){_e.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Ce(this.x,t.x,e.x),this.y=Ce(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=Ce(this.x,t,e),this.y=Ce(this.y,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ce(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Ce(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),r=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*i-a*r+t.x,this.y=s*r+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class c0{constructor(t=0,e=0,i=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=r}static slerpFlat(t,e,i,r,s,a,o){let h=i[r+0],l=i[r+1],c=i[r+2],f=i[r+3],d=s[a+0],u=s[a+1],p=s[a+2],m=s[a+3];if(f!==m||h!==d||l!==u||c!==p){let g=h*d+l*u+c*p+f*m;g<0&&(d=-d,u=-u,p=-p,m=-m,g=-g);let y=1-o;if(g<.9995){const A=Math.acos(g),_=Math.sin(A);y=Math.sin(y*A)/_,o=Math.sin(o*A)/_,h=h*y+d*o,l=l*y+u*o,c=c*y+p*o,f=f*y+m*o}else{h=h*y+d*o,l=l*y+u*o,c=c*y+p*o,f=f*y+m*o;const A=1/Math.sqrt(h*h+l*l+c*c+f*f);h*=A,l*=A,c*=A,f*=A}}t[e]=h,t[e+1]=l,t[e+2]=c,t[e+3]=f}static multiplyQuaternionsFlat(t,e,i,r,s,a){const o=i[r],h=i[r+1],l=i[r+2],c=i[r+3],f=s[a],d=s[a+1],u=s[a+2],p=s[a+3];return t[e]=o*p+c*f+h*u-l*d,t[e+1]=h*p+c*d+l*f-o*u,t[e+2]=l*p+c*u+o*d-h*f,t[e+3]=c*p-o*f-h*d-l*u,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,r){return this._x=t,this._y=e,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,r=t._y,s=t._z,a=t._order,o=Math.cos,h=Math.sin,l=o(i/2),c=o(r/2),f=o(s/2),d=h(i/2),u=h(r/2),p=h(s/2);switch(a){case"XYZ":this._x=d*c*f+l*u*p,this._y=l*u*f-d*c*p,this._z=l*c*p+d*u*f,this._w=l*c*f-d*u*p;break;case"YXZ":this._x=d*c*f+l*u*p,this._y=l*u*f-d*c*p,this._z=l*c*p-d*u*f,this._w=l*c*f+d*u*p;break;case"ZXY":this._x=d*c*f-l*u*p,this._y=l*u*f+d*c*p,this._z=l*c*p+d*u*f,this._w=l*c*f-d*u*p;break;case"ZYX":this._x=d*c*f-l*u*p,this._y=l*u*f+d*c*p,this._z=l*c*p-d*u*f,this._w=l*c*f+d*u*p;break;case"YZX":this._x=d*c*f+l*u*p,this._y=l*u*f+d*c*p,this._z=l*c*p-d*u*f,this._w=l*c*f-d*u*p;break;case"XZY":this._x=d*c*f-l*u*p,this._y=l*u*f-d*c*p,this._z=l*c*p+d*u*f,this._w=l*c*f+d*u*p;break;default:bi("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],r=e[4],s=e[8],a=e[1],o=e[5],h=e[9],l=e[2],c=e[6],f=e[10],d=i+o+f;if(d>0){const u=.5/Math.sqrt(d+1);this._w=.25/u,this._x=(c-h)*u,this._y=(s-l)*u,this._z=(a-r)*u}else if(i>o&&i>f){const u=2*Math.sqrt(1+i-o-f);this._w=(c-h)/u,this._x=.25*u,this._y=(r+a)/u,this._z=(s+l)/u}else if(o>f){const u=2*Math.sqrt(1+o-i-f);this._w=(s-l)/u,this._x=(r+a)/u,this._y=.25*u,this._z=(h+c)/u}else{const u=2*Math.sqrt(1+f-i-o);this._w=(a-r)/u,this._x=(s+l)/u,this._y=(h+c)/u,this._z=.25*u}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<1e-8?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Ce(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const r=Math.min(1,e/i);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,r=t._y,s=t._z,a=t._w,o=e._x,h=e._y,l=e._z,c=e._w;return this._x=i*c+a*o+r*l-s*h,this._y=r*c+a*h+s*o-i*l,this._z=s*c+a*l+i*h-r*o,this._w=a*c-i*o-r*h-s*l,this._onChangeCallback(),this}slerp(t,e){let i=t._x,r=t._y,s=t._z,a=t._w,o=this.dot(t);o<0&&(i=-i,r=-r,s=-s,a=-a,o=-o);let h=1-e;if(o<.9995){const l=Math.acos(o),c=Math.sin(l);h=Math.sin(h*l)/c,e=Math.sin(e*l)/c,this._x=this._x*h+i*e,this._y=this._y*h+r*e,this._z=this._z*h+s*e,this._w=this._w*h+a*e,this._onChangeCallback()}else this._x=this._x*h+i*e,this._y=this._y*h+r*e,this._z=this._z*h+s*e,this._w=this._w*h+a*e,this.normalize();return this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(t),r*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class St{constructor(t=0,e=0,i=0){St.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(h4.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(h4.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=t.elements,a=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,r=this.z,s=t.x,a=t.y,o=t.z,h=t.w,l=2*(a*r-o*i),c=2*(o*e-s*r),f=2*(s*i-a*e);return this.x=e+h*l+a*f-o*c,this.y=i+h*c+o*l-s*f,this.z=r+h*f+s*c-a*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r,this.y=s[1]*e+s[5]*i+s[9]*r,this.z=s[2]*e+s[6]*i+s[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Ce(this.x,t.x,e.x),this.y=Ce(this.y,t.y,e.y),this.z=Ce(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=Ce(this.x,t,e),this.y=Ce(this.y,t,e),this.z=Ce(this.z,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ce(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,r=t.y,s=t.z,a=e.x,o=e.y,h=e.z;return this.x=r*h-s*o,this.y=s*a-i*h,this.z=i*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return ZA.copy(this).projectOnVector(t),this.sub(ZA)}reflect(t){return this.sub(ZA.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Ce(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const ZA=new St,h4=new c0;class tl{constructor(t,e,i,r,s,a,o,h,l){tl.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,h,l)}set(t,e,i,r,s,a,o,h,l){const c=this.elements;return c[0]=t,c[1]=r,c[2]=o,c[3]=e,c[4]=s,c[5]=h,c[6]=i,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[3],h=i[6],l=i[1],c=i[4],f=i[7],d=i[2],u=i[5],p=i[8],m=r[0],g=r[3],y=r[6],A=r[1],_=r[4],x=r[7],v=r[2],b=r[5],M=r[8];return s[0]=a*m+o*A+h*v,s[3]=a*g+o*_+h*b,s[6]=a*y+o*x+h*M,s[1]=l*m+c*A+f*v,s[4]=l*g+c*_+f*b,s[7]=l*y+c*x+f*M,s[2]=d*m+u*A+p*v,s[5]=d*g+u*_+p*b,s[8]=d*y+u*x+p*M,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],l=t[7],c=t[8];return e*a*c-e*o*l-i*s*c+i*o*h+r*s*l-r*a*h}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],l=t[7],c=t[8],f=c*a-o*l,d=o*h-c*s,u=l*s-a*h,p=e*f+i*d+r*u;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return t[0]=f*m,t[1]=(r*l-c*i)*m,t[2]=(o*i-r*a)*m,t[3]=d*m,t[4]=(c*e-r*h)*m,t[5]=(r*s-o*e)*m,t[6]=u*m,t[7]=(i*h-l*e)*m,t[8]=(a*e-i*s)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,r,s,a,o){const h=Math.cos(s),l=Math.sin(s);return this.set(i*h,i*l,-i*(h*a+l*o)+a+t,-r*l,r*h,-r*(-l*a+h*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(JA.makeScale(t,e)),this}rotate(t){return this.premultiply(JA.makeRotation(-t)),this}translate(t,e){return this.premultiply(JA.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<9;r++)if(e[r]!==i[r])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const JA=new tl,c4=new tl().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),f4=new tl().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function dZ(){const n={enabled:!0,workingColorSpace:i4,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===XA&&(r.r=Ua(r.r),r.g=Ua(r.g),r.b=Ua(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===XA&&(r.r=of(r.r),r.g=of(r.g),r.b=of(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===l7?n4:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return l4("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return l4("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,s)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[i4]:{primaries:t,whitePoint:i,transfer:n4,toXYZ:c4,fromXYZ:f4,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Sr},outputColorSpaceConfig:{drawingBufferColorSpace:Sr}},[Sr]:{primaries:t,whitePoint:i,transfer:XA,toXYZ:c4,fromXYZ:f4,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Sr}}}),n}const Zr=dZ();function Ua(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function of(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let sc;class pZ{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let i;if(t instanceof HTMLCanvasElement)i=t;else{sc===void 0&&(sc=L2("canvas")),sc.width=t.width,sc.height=t.height;const r=sc.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),i=sc}return i.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=L2("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=Ua(s[a]/255)*255;return i.putImageData(r,0,0),e}else if(t.data){const e=t.data.slice(0);for(let i=0;i<e.length;i++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[i]=Math.floor(Ua(e[i]/255)*255):e[i]=Ua(e[i]);return{data:e,width:t.width,height:t.height}}else return bi("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let mZ=0;class gZ{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:mZ++}),this.uuid=za(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const e=this.data;return typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):typeof VideoFrame<"u"&&e instanceof VideoFrame?t.set(e.displayHeight,e.displayWidth,0):e!==null?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(QA(r[a].image)):s.push(QA(r[a]))}else s=QA(r);i.url=s}return e||(t.images[this.uuid]=i),i}}function QA(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?pZ.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(bi("Texture: Unable to serialize Texture."),{})}let yZ=0;const KA=new St;class qo extends Dg{constructor(t=qo.DEFAULT_IMAGE,e=qo.DEFAULT_MAPPING,i=Np,r=Np,s=sZ,a=aZ,o=hZ,h=oZ,l=qo.DEFAULT_ANISOTROPY,c=l7){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:yZ++}),this.uuid=za(),this.name="",this.source=new gZ(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=h,this.offset=new _e(0,0),this.repeat=new _e(1,1),this.center=new _e(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new tl,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(KA).x}get height(){return this.source.getSize(KA).y}get depth(){return this.source.getSize(KA).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const e in t){const i=t[e];if(i===void 0){bi(`Texture.setValues(): parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){bi(`Texture.setValues(): property '${e}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==o7)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case t4:t.x=t.x-Math.floor(t.x);break;case Np:t.x=t.x<0?0:1;break;case e4:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case t4:t.y=t.y-Math.floor(t.y);break;case Np:t.y=t.y<0?0:1;break;case e4:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}qo.DEFAULT_IMAGE=null;qo.DEFAULT_MAPPING=o7;qo.DEFAULT_ANISOTROPY=1;class f0{constructor(t=0,e=0,i=0,r=1){f0.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*e+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*e+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*e+a[7]*i+a[11]*r+a[15]*s,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,r,s;const h=t.elements,l=h[0],c=h[4],f=h[8],d=h[1],u=h[5],p=h[9],m=h[2],g=h[6],y=h[10];if(Math.abs(c-d)<.01&&Math.abs(f-m)<.01&&Math.abs(p-g)<.01){if(Math.abs(c+d)<.1&&Math.abs(f+m)<.1&&Math.abs(p+g)<.1&&Math.abs(l+u+y-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const _=(l+1)/2,x=(u+1)/2,v=(y+1)/2,b=(c+d)/4,M=(f+m)/4,T=(p+g)/4;return _>x&&_>v?_<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(_),r=b/i,s=M/i):x>v?x<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(x),i=b/r,s=T/r):v<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(v),i=M/s,r=T/s),this.set(i,r,s,e),this}let A=Math.sqrt((g-p)*(g-p)+(f-m)*(f-m)+(d-c)*(d-c));return Math.abs(A)<.001&&(A=1),this.x=(g-p)/A,this.y=(f-m)/A,this.z=(d-c)/A,this.w=Math.acos((l+u+y-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Ce(this.x,t.x,e.x),this.y=Ce(this.y,t.y,e.y),this.z=Ce(this.z,t.z,e.z),this.w=Ce(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=Ce(this.x,t,e),this.y=Ce(this.y,t,e),this.z=Ce(this.z,t,e),this.w=Ce(this.w,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ce(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Cn{constructor(t,e,i,r,s,a,o,h,l,c,f,d,u,p,m,g){Cn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,h,l,c,f,d,u,p,m,g)}set(t,e,i,r,s,a,o,h,l,c,f,d,u,p,m,g){const y=this.elements;return y[0]=t,y[4]=e,y[8]=i,y[12]=r,y[1]=s,y[5]=a,y[9]=o,y[13]=h,y[2]=l,y[6]=c,y[10]=f,y[14]=d,y[3]=u,y[7]=p,y[11]=m,y[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Cn().fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return this.determinant()===0?(t.set(1,0,0),e.set(0,1,0),i.set(0,0,1),this):(t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){if(t.determinant()===0)return this.identity();const e=this.elements,i=t.elements,r=1/ac.setFromMatrixColumn(t,0).length(),s=1/ac.setFromMatrixColumn(t,1).length(),a=1/ac.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*s,e[5]=i[5]*s,e[6]=i[6]*s,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,r=t.y,s=t.z,a=Math.cos(i),o=Math.sin(i),h=Math.cos(r),l=Math.sin(r),c=Math.cos(s),f=Math.sin(s);if(t.order==="XYZ"){const d=a*c,u=a*f,p=o*c,m=o*f;e[0]=h*c,e[4]=-h*f,e[8]=l,e[1]=u+p*l,e[5]=d-m*l,e[9]=-o*h,e[2]=m-d*l,e[6]=p+u*l,e[10]=a*h}else if(t.order==="YXZ"){const d=h*c,u=h*f,p=l*c,m=l*f;e[0]=d+m*o,e[4]=p*o-u,e[8]=a*l,e[1]=a*f,e[5]=a*c,e[9]=-o,e[2]=u*o-p,e[6]=m+d*o,e[10]=a*h}else if(t.order==="ZXY"){const d=h*c,u=h*f,p=l*c,m=l*f;e[0]=d-m*o,e[4]=-a*f,e[8]=p+u*o,e[1]=u+p*o,e[5]=a*c,e[9]=m-d*o,e[2]=-a*l,e[6]=o,e[10]=a*h}else if(t.order==="ZYX"){const d=a*c,u=a*f,p=o*c,m=o*f;e[0]=h*c,e[4]=p*l-u,e[8]=d*l+m,e[1]=h*f,e[5]=m*l+d,e[9]=u*l-p,e[2]=-l,e[6]=o*h,e[10]=a*h}else if(t.order==="YZX"){const d=a*h,u=a*l,p=o*h,m=o*l;e[0]=h*c,e[4]=m-d*f,e[8]=p*f+u,e[1]=f,e[5]=a*c,e[9]=-o*c,e[2]=-l*c,e[6]=u*f+p,e[10]=d-m*f}else if(t.order==="XZY"){const d=a*h,u=a*l,p=o*h,m=o*l;e[0]=h*c,e[4]=-f,e[8]=l*c,e[1]=d*f+m,e[5]=a*c,e[9]=u*f-p,e[2]=p*f-u,e[6]=o*c,e[10]=m*f+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(AZ,t,xZ)}lookAt(t,e,i){const r=this.elements;return Kn.subVectors(t,e),Kn.lengthSq()===0&&(Kn.z=1),Kn.normalize(),go.crossVectors(i,Kn),go.lengthSq()===0&&(Math.abs(i.z)===1?Kn.x+=1e-4:Kn.z+=1e-4,Kn.normalize(),go.crossVectors(i,Kn)),go.normalize(),Dp.crossVectors(Kn,go),r[0]=go.x,r[4]=Dp.x,r[8]=Kn.x,r[1]=go.y,r[5]=Dp.y,r[9]=Kn.y,r[2]=go.z,r[6]=Dp.z,r[10]=Kn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[4],h=i[8],l=i[12],c=i[1],f=i[5],d=i[9],u=i[13],p=i[2],m=i[6],g=i[10],y=i[14],A=i[3],_=i[7],x=i[11],v=i[15],b=r[0],M=r[4],T=r[8],w=r[12],E=r[1],k=r[5],C=r[9],R=r[13],F=r[2],P=r[6],I=r[10],U=r[14],N=r[3],q=r[7],G=r[11],nt=r[15];return s[0]=a*b+o*E+h*F+l*N,s[4]=a*M+o*k+h*P+l*q,s[8]=a*T+o*C+h*I+l*G,s[12]=a*w+o*R+h*U+l*nt,s[1]=c*b+f*E+d*F+u*N,s[5]=c*M+f*k+d*P+u*q,s[9]=c*T+f*C+d*I+u*G,s[13]=c*w+f*R+d*U+u*nt,s[2]=p*b+m*E+g*F+y*N,s[6]=p*M+m*k+g*P+y*q,s[10]=p*T+m*C+g*I+y*G,s[14]=p*w+m*R+g*U+y*nt,s[3]=A*b+_*E+x*F+v*N,s[7]=A*M+_*k+x*P+v*q,s[11]=A*T+_*C+x*I+v*G,s[15]=A*w+_*R+x*U+v*nt,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],r=t[8],s=t[12],a=t[1],o=t[5],h=t[9],l=t[13],c=t[2],f=t[6],d=t[10],u=t[14],p=t[3],m=t[7],g=t[11],y=t[15],A=h*u-l*d,_=o*u-l*f,x=o*d-h*f,v=a*u-l*c,b=a*d-h*c,M=a*f-o*c;return e*(m*A-g*_+y*x)-i*(p*A-g*v+y*b)+r*(p*_-m*v+y*M)-s*(p*x-m*b+g*M)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],l=t[7],c=t[8],f=t[9],d=t[10],u=t[11],p=t[12],m=t[13],g=t[14],y=t[15],A=e*o-i*a,_=e*h-r*a,x=e*l-s*a,v=i*h-r*o,b=i*l-s*o,M=r*l-s*h,T=c*m-f*p,w=c*g-d*p,E=c*y-u*p,k=f*g-d*m,C=f*y-u*m,R=d*y-u*g,F=A*R-_*C+x*k+v*E-b*w+M*T;if(F===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/F;return t[0]=(o*R-h*C+l*k)*P,t[1]=(r*C-i*R-s*k)*P,t[2]=(m*M-g*b+y*v)*P,t[3]=(d*b-f*M-u*v)*P,t[4]=(h*E-a*R-l*w)*P,t[5]=(e*R-r*E+s*w)*P,t[6]=(g*x-p*M-y*_)*P,t[7]=(c*M-d*x+u*_)*P,t[8]=(a*C-o*E+l*T)*P,t[9]=(i*E-e*C-s*T)*P,t[10]=(p*b-m*x+y*A)*P,t[11]=(f*x-c*b-u*A)*P,t[12]=(o*w-a*k-h*T)*P,t[13]=(e*k-i*w+r*T)*P,t[14]=(m*_-p*v-g*A)*P,t[15]=(c*v-f*_+d*A)*P,this}scale(t){const e=this.elements,i=t.x,r=t.y,s=t.z;return e[0]*=i,e[4]*=r,e[8]*=s,e[1]*=i,e[5]*=r,e[9]*=s,e[2]*=i,e[6]*=r,e[10]*=s,e[3]*=i,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),r=Math.sin(e),s=1-i,a=t.x,o=t.y,h=t.z,l=s*a,c=s*o;return this.set(l*a+i,l*o-r*h,l*h+r*o,0,l*o+r*h,c*o+i,c*h-r*a,0,l*h-r*o,c*h+r*a,s*h*h+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,r,s,a){return this.set(1,i,s,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){const r=this.elements,s=e._x,a=e._y,o=e._z,h=e._w,l=s+s,c=a+a,f=o+o,d=s*l,u=s*c,p=s*f,m=a*c,g=a*f,y=o*f,A=h*l,_=h*c,x=h*f,v=i.x,b=i.y,M=i.z;return r[0]=(1-(m+y))*v,r[1]=(u+x)*v,r[2]=(p-_)*v,r[3]=0,r[4]=(u-x)*b,r[5]=(1-(d+y))*b,r[6]=(g+A)*b,r[7]=0,r[8]=(p+_)*M,r[9]=(g-A)*M,r[10]=(1-(d+m))*M,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){const r=this.elements;t.x=r[12],t.y=r[13],t.z=r[14];const s=this.determinant();if(s===0)return i.set(1,1,1),e.identity(),this;let a=ac.set(r[0],r[1],r[2]).length();const o=ac.set(r[4],r[5],r[6]).length(),h=ac.set(r[8],r[9],r[10]).length();s<0&&(a=-a),Jr.copy(this);const l=1/a,c=1/o,f=1/h;return Jr.elements[0]*=l,Jr.elements[1]*=l,Jr.elements[2]*=l,Jr.elements[4]*=c,Jr.elements[5]*=c,Jr.elements[6]*=c,Jr.elements[8]*=f,Jr.elements[9]*=f,Jr.elements[10]*=f,e.setFromRotationMatrix(Jr),i.x=a,i.y=o,i.z=h,this}makePerspective(t,e,i,r,s,a,o=Rp,h=!1){const l=this.elements,c=2*s/(e-t),f=2*s/(i-r),d=(e+t)/(e-t),u=(i+r)/(i-r);let p,m;if(h)p=s/(a-s),m=a*s/(a-s);else if(o===Rp)p=-(a+s)/(a-s),m=-2*a*s/(a-s);else if(o===s4)p=-a/(a-s),m=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=f,l[9]=u,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,r,s,a,o=Rp,h=!1){const l=this.elements,c=2/(e-t),f=2/(i-r),d=-(e+t)/(e-t),u=-(i+r)/(i-r);let p,m;if(h)p=1/(a-s),m=a/(a-s);else if(o===Rp)p=-2/(a-s),m=-(a+s)/(a-s);else if(o===s4)p=-1/(a-s),m=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=0,l[12]=d,l[1]=0,l[5]=f,l[9]=0,l[13]=u,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<16;r++)if(e[r]!==i[r])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const ac=new St,Jr=new Cn,AZ=new St(0,0,0),xZ=new St(1,1,1),go=new St,Dp=new St,Kn=new St,u4=new Cn,d4=new c0;class u0{constructor(t=0,e=0,i=0,r=u0.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,r=this._order){return this._x=t,this._y=e,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const r=t.elements,s=r[0],a=r[4],o=r[8],h=r[1],l=r[5],c=r[9],f=r[2],d=r[6],u=r[10];switch(e){case"XYZ":this._y=Math.asin(Ce(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,u),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Ce(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,u),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ce(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,u),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(h,s));break;case"ZYX":this._y=Math.asin(-Ce(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,u),this._z=Math.atan2(h,s)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(Ce(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(o,u));break;case"XZY":this._z=Math.asin(-Ce(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-c,u),this._y=0);break;default:bi("Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return u4.makeRotationFromQuaternion(t),this.setFromRotationMatrix(u4,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return d4.setFromEuler(this),this.setFromQuaternion(d4,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}u0.DEFAULT_ORDER="XYZ";class c7{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}}let _Z=0;const p4=new St,oc=new c0,ha=new Cn,Fp=new St,wu=new St,vZ=new St,bZ=new c0,m4=new St(1,0,0),g4=new St(0,1,0),y4=new St(0,0,1),A4={type:"added"},wZ={type:"removed"},lc={type:"childadded",child:null},tx={type:"childremoved",child:null};class Br extends Dg{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:_Z++}),this.uuid=za(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Br.DEFAULT_UP.clone();const t=new St,e=new u0,i=new c0,r=new St(1,1,1);function s(){i.setFromEuler(e,!1)}function a(){e.setFromQuaternion(i,void 0,!1)}e._onChange(s),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Cn},normalMatrix:{value:new tl}}),this.matrix=new Cn,this.matrixWorld=new Cn,this.matrixAutoUpdate=Br.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Br.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new c7,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return oc.setFromAxisAngle(t,e),this.quaternion.multiply(oc),this}rotateOnWorldAxis(t,e){return oc.setFromAxisAngle(t,e),this.quaternion.premultiply(oc),this}rotateX(t){return this.rotateOnAxis(m4,t)}rotateY(t){return this.rotateOnAxis(g4,t)}rotateZ(t){return this.rotateOnAxis(y4,t)}translateOnAxis(t,e){return p4.copy(t).applyQuaternion(this.quaternion),this.position.add(p4.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(m4,t)}translateY(t){return this.translateOnAxis(g4,t)}translateZ(t){return this.translateOnAxis(y4,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(ha.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?Fp.copy(t):Fp.set(t,e,i);const r=this.parent;this.updateWorldMatrix(!0,!1),wu.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ha.lookAt(wu,Fp,this.up):ha.lookAt(Fp,wu,this.up),this.quaternion.setFromRotationMatrix(ha),r&&(ha.extractRotation(r.matrixWorld),oc.setFromRotationMatrix(ha),this.quaternion.premultiply(oc.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(Sa("Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(A4),lc.child=t,this.dispatchEvent(lc),lc.child=null):Sa("Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(wZ),tx.child=t,this.dispatchEvent(tx),tx.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),ha.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),ha.multiply(t.parent.matrixWorld)),t.applyMatrix4(ha),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(A4),lc.child=t,this.dispatchEvent(lc),lc.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,r=this.children.length;i<r;i++){const a=this.children[i].getObjectByProperty(t,e);if(a!==void 0)return a}}getObjectsByProperty(t,e,i=[]){this[t]===e&&i.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(t,e,i);return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(wu,t,vZ),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(wu,bZ,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const t=this.pivot;if(t!==null){const e=t.x,i=t.y,r=t.z,s=this.matrix.elements;s[12]+=e-s[0]*e-s[4]*i-s[8]*r,s[13]+=i-s[1]*e-s[5]*i-s[9]*r,s[14]+=r-s[2]*e-s[6]*i-s[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e){const i=this.parent;if(t===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),e===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(t),r.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(o,h){return o[h.uuid]===void 0&&(o[h.uuid]=h.toJSON(t)),h.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const h=o.shapes;if(Array.isArray(h))for(let l=0,c=h.length;l<c;l++){const f=h[l];s(t.shapes,f)}else s(t.shapes,h)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let h=0,l=this.material.length;h<l;h++)o.push(s(t.materials,this.material[h]));r.material=o}else r.material=s(t.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const h=this.animations[o];r.animations.push(s(t.animations,h))}}if(e){const o=a(t.geometries),h=a(t.materials),l=a(t.textures),c=a(t.images),f=a(t.shapes),d=a(t.skeletons),u=a(t.animations),p=a(t.nodes);o.length>0&&(i.geometries=o),h.length>0&&(i.materials=h),l.length>0&&(i.textures=l),c.length>0&&(i.images=c),f.length>0&&(i.shapes=f),d.length>0&&(i.skeletons=d),u.length>0&&(i.animations=u),p.length>0&&(i.nodes=p)}return i.object=r,i;function a(o){const h=[];for(const l in o){const c=o[l];delete c.metadata,h.push(c)}return h}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),t.pivot!==null&&(this.pivot=t.pivot.clone()),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.static=t.static,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let i=0;i<t.children.length;i++){const r=t.children[i];this.add(r.clone())}return this}}Br.DEFAULT_UP=new St(0,1,0);Br.DEFAULT_MATRIX_AUTO_UPDATE=!0;Br.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class qQ extends Br{constructor(){super(),this.isGroup=!0,this.type="Group"}}const f7={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},yo={h:0,s:0,l:0},Ip={h:0,s:0,l:0};function ex(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}class Er{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){if(e===void 0&&i===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Sr){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Zr.colorSpaceToWorking(this,e),this}setRGB(t,e,i,r=Zr.workingColorSpace){return this.r=t,this.g=e,this.b=i,Zr.colorSpaceToWorking(this,r),this}setHSL(t,e,i,r=Zr.workingColorSpace){if(t=uZ(t,1),e=Ce(e,0,1),i=Ce(i,0,1),e===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+e):i+e-i*e,a=2*i-s;this.r=ex(a,s,t+1/3),this.g=ex(a,s,t),this.b=ex(a,s,t-1/3)}return Zr.colorSpaceToWorking(this,r),this}setStyle(t,e=Sr){function i(s){s!==void 0&&parseFloat(s)<1&&bi("Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:bi("Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);bi("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Sr){const i=f7[t.toLowerCase()];return i!==void 0?this.setHex(i,e):bi("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Ua(t.r),this.g=Ua(t.g),this.b=Ua(t.b),this}copyLinearToSRGB(t){return this.r=of(t.r),this.g=of(t.g),this.b=of(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Sr){return Zr.workingToColorSpace(ln.copy(this),t),Math.round(Ce(ln.r*255,0,255))*65536+Math.round(Ce(ln.g*255,0,255))*256+Math.round(Ce(ln.b*255,0,255))}getHexString(t=Sr){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Zr.workingColorSpace){Zr.workingToColorSpace(ln.copy(this),e);const i=ln.r,r=ln.g,s=ln.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let h,l;const c=(o+a)/2;if(o===a)h=0,l=0;else{const f=a-o;switch(l=c<=.5?f/(a+o):f/(2-a-o),a){case i:h=(r-s)/f+(r<s?6:0);break;case r:h=(s-i)/f+2;break;case s:h=(i-r)/f+4;break}h/=6}return t.h=h,t.s=l,t.l=c,t}getRGB(t,e=Zr.workingColorSpace){return Zr.workingToColorSpace(ln.copy(this),e),t.r=ln.r,t.g=ln.g,t.b=ln.b,t}getStyle(t=Sr){Zr.workingToColorSpace(ln.copy(this),t);const e=ln.r,i=ln.g,r=ln.b;return t!==Sr?`color(${t} ${e.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(t,e,i){return this.getHSL(yo),this.setHSL(yo.h+t,yo.s+e,yo.l+i)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(yo),t.getHSL(Ip);const i=YA(yo.h,Ip.h,e),r=YA(yo.s,Ip.s,e),s=YA(yo.l,Ip.l,e);return this.setHSL(i,r,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,i=this.g,r=this.b,s=t.elements;return this.r=s[0]*e+s[3]*i+s[6]*r,this.g=s[1]*e+s[4]*i+s[7]*r,this.b=s[2]*e+s[5]*i+s[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const ln=new Er;Er.NAMES=f7;const Qr=new St,ca=new St,ix=new St,fa=new St,hc=new St,cc=new St,x4=new St,nx=new St,rx=new St,sx=new St,ax=new f0,ox=new f0,lx=new f0;class or{constructor(t=new St,e=new St,i=new St){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,r){r.subVectors(i,e),Qr.subVectors(t,e),r.cross(Qr);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,i,r,s){Qr.subVectors(r,e),ca.subVectors(i,e),ix.subVectors(t,e);const a=Qr.dot(Qr),o=Qr.dot(ca),h=Qr.dot(ix),l=ca.dot(ca),c=ca.dot(ix),f=a*l-o*o;if(f===0)return s.set(0,0,0),null;const d=1/f,u=(l*h-o*c)*d,p=(a*c-o*h)*d;return s.set(1-u-p,p,u)}static containsPoint(t,e,i,r){return this.getBarycoord(t,e,i,r,fa)===null?!1:fa.x>=0&&fa.y>=0&&fa.x+fa.y<=1}static getInterpolation(t,e,i,r,s,a,o,h){return this.getBarycoord(t,e,i,r,fa)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(s,fa.x),h.addScaledVector(a,fa.y),h.addScaledVector(o,fa.z),h)}static getInterpolatedAttribute(t,e,i,r,s,a){return ax.setScalar(0),ox.setScalar(0),lx.setScalar(0),ax.fromBufferAttribute(t,e),ox.fromBufferAttribute(t,i),lx.fromBufferAttribute(t,r),a.setScalar(0),a.addScaledVector(ax,s.x),a.addScaledVector(ox,s.y),a.addScaledVector(lx,s.z),a}static isFrontFacing(t,e,i,r){return Qr.subVectors(i,e),ca.subVectors(t,e),Qr.cross(ca).dot(r)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,i,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Qr.subVectors(this.c,this.b),ca.subVectors(this.a,this.b),Qr.cross(ca).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return or.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return or.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,r,s){return or.getInterpolation(t,this.a,this.b,this.c,e,i,r,s)}containsPoint(t){return or.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return or.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,r=this.b,s=this.c;let a,o;hc.subVectors(r,i),cc.subVectors(s,i),nx.subVectors(t,i);const h=hc.dot(nx),l=cc.dot(nx);if(h<=0&&l<=0)return e.copy(i);rx.subVectors(t,r);const c=hc.dot(rx),f=cc.dot(rx);if(c>=0&&f<=c)return e.copy(r);const d=h*f-c*l;if(d<=0&&h>=0&&c<=0)return a=h/(h-c),e.copy(i).addScaledVector(hc,a);sx.subVectors(t,s);const u=hc.dot(sx),p=cc.dot(sx);if(p>=0&&u<=p)return e.copy(s);const m=u*l-h*p;if(m<=0&&l>=0&&p<=0)return o=l/(l-p),e.copy(i).addScaledVector(cc,o);const g=c*p-u*f;if(g<=0&&f-c>=0&&u-p>=0)return x4.subVectors(s,r),o=(f-c)/(f-c+(u-p)),e.copy(r).addScaledVector(x4,o);const y=1/(g+m+d);return a=m*y,o=d*y,e.copy(i).addScaledVector(hc,a).addScaledVector(cc,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}class d0{constructor(t=new St(1/0,1/0,1/0),e=new St(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(Kr.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(Kr.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Kr.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const i=t.geometry;if(i!==void 0){const s=i.getAttribute("position");if(e===!0&&s!==void 0&&t.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)t.isMesh===!0?t.getVertexPosition(a,Kr):Kr.fromBufferAttribute(s,a),Kr.applyMatrix4(t.matrixWorld),this.expandByPoint(Kr);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Op.copy(t.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Op.copy(i.boundingBox)),Op.applyMatrix4(t.matrixWorld),this.union(Op)}const r=t.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Kr),Kr.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Su),Bp.subVectors(this.max,Su),fc.subVectors(t.a,Su),uc.subVectors(t.b,Su),dc.subVectors(t.c,Su),Ao.subVectors(uc,fc),xo.subVectors(dc,uc),pl.subVectors(fc,dc);let e=[0,-Ao.z,Ao.y,0,-xo.z,xo.y,0,-pl.z,pl.y,Ao.z,0,-Ao.x,xo.z,0,-xo.x,pl.z,0,-pl.x,-Ao.y,Ao.x,0,-xo.y,xo.x,0,-pl.y,pl.x,0];return!hx(e,fc,uc,dc,Bp)||(e=[1,0,0,0,1,0,0,0,1],!hx(e,fc,uc,dc,Bp))?!1:(zp.crossVectors(Ao,xo),e=[zp.x,zp.y,zp.z],hx(e,fc,uc,dc,Bp))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Kr).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Kr).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(ua[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ua[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ua[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ua[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ua[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ua[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ua[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ua[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ua),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const ua=[new St,new St,new St,new St,new St,new St,new St,new St],Kr=new St,Op=new d0,fc=new St,uc=new St,dc=new St,Ao=new St,xo=new St,pl=new St,Su=new St,Bp=new St,zp=new St,ml=new St;function hx(n,t,e,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){ml.fromArray(n,s);const o=r.x*Math.abs(ml.x)+r.y*Math.abs(ml.y)+r.z*Math.abs(ml.z),h=t.dot(ml),l=e.dot(ml),c=i.dot(ml);if(Math.max(-Math.max(h,l,c),Math.min(h,l,c))>o)return!1}return!0}const Mi=new St,Up=new _e;let SZ=0;class Vo{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:SZ++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=i,this.usage=k2,this.updateRanges=[],this.gpuType=lZ,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[t+r]=e.array[i+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,i=this.count;e<i;e++)Up.fromBufferAttribute(this,e),Up.applyMatrix3(t),this.setXY(e,Up.x,Up.y);else if(this.itemSize===3)for(let e=0,i=this.count;e<i;e++)Mi.fromBufferAttribute(this,e),Mi.applyMatrix3(t),this.setXYZ(e,Mi.x,Mi.y,Mi.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)Mi.fromBufferAttribute(this,e),Mi.applyMatrix4(t),this.setXYZ(e,Mi.x,Mi.y,Mi.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)Mi.fromBufferAttribute(this,e),Mi.applyNormalMatrix(t),this.setXYZ(e,Mi.x,Mi.y,Mi.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)Mi.fromBufferAttribute(this,e),Mi.transformDirection(t),this.setXYZ(e,Mi.x,Mi.y,Mi.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let i=this.array[t*this.itemSize+e];return this.normalized&&(i=Es(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=Xe(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Es(e,this.array)),e}setX(t,e){return this.normalized&&(e=Xe(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Es(e,this.array)),e}setY(t,e){return this.normalized&&(e=Xe(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Es(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Xe(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Es(e,this.array)),e}setW(t,e){return this.normalized&&(e=Xe(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=Xe(e,this.array),i=Xe(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,r){return t*=this.itemSize,this.normalized&&(e=Xe(e,this.array),i=Xe(i,this.array),r=Xe(r,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this}setXYZW(t,e,i,r,s){return t*=this.itemSize,this.normalized&&(e=Xe(e,this.array),i=Xe(i,this.array),r=Xe(r,this.array),s=Xe(s,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==k2&&(t.usage=this.usage),t}}class MZ extends Vo{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class TZ extends Vo{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class Bs extends Vo{constructor(t,e,i){super(new Float32Array(t),e,i)}}const EZ=new d0,Mu=new St,cx=new St;class Nb{constructor(t=new St,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;e!==void 0?i.copy(e):EZ.setFromPoints(t).getCenter(i);let r=0;for(let s=0,a=t.length;s<a;s++)r=Math.max(r,i.distanceToSquared(t[s]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Mu.subVectors(t,this.center);const e=Mu.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),r=(i-this.radius)*.5;this.center.addScaledVector(Mu,r/i),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(cx.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Mu.copy(t.center).add(cx)),this.expandByPoint(Mu.copy(t.center).sub(cx))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}let CZ=0;const _r=new Cn,fx=new Br,pc=new St,tr=new d0,Tu=new d0,zi=new St;class Ja extends Dg{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:CZ++}),this.uuid=za(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(cZ(t)?TZ:MZ)(t,1):this.index=t,this}setIndirect(t,e=0){return this.indirect=t,this.indirectOffset=e,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new tl().getNormalMatrix(t);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return _r.makeRotationFromQuaternion(t),this.applyMatrix4(_r),this}rotateX(t){return _r.makeRotationX(t),this.applyMatrix4(_r),this}rotateY(t){return _r.makeRotationY(t),this.applyMatrix4(_r),this}rotateZ(t){return _r.makeRotationZ(t),this.applyMatrix4(_r),this}translate(t,e,i){return _r.makeTranslation(t,e,i),this.applyMatrix4(_r),this}scale(t,e,i){return _r.makeScale(t,e,i),this.applyMatrix4(_r),this}lookAt(t){return fx.lookAt(t),fx.updateMatrix(),this.applyMatrix4(fx.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(pc).negate(),this.translate(pc.x,pc.y,pc.z),this}setFromPoints(t){const e=this.getAttribute("position");if(e===void 0){const i=[];for(let r=0,s=t.length;r<s;r++){const a=t[r];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Bs(i,3))}else{const i=Math.min(t.length,e.count);for(let r=0;r<i;r++){const s=t[r];e.setXYZ(r,s.x,s.y,s.z||0)}t.length>e.count&&bi("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new d0);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){Sa("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new St(-1/0,-1/0,-1/0),new St(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let i=0,r=e.length;i<r;i++){const s=e[i];tr.setFromBufferAttribute(s),this.morphTargetsRelative?(zi.addVectors(this.boundingBox.min,tr.min),this.boundingBox.expandByPoint(zi),zi.addVectors(this.boundingBox.max,tr.max),this.boundingBox.expandByPoint(zi)):(this.boundingBox.expandByPoint(tr.min),this.boundingBox.expandByPoint(tr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Sa('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Nb);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){Sa("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new St,1/0);return}if(t){const i=this.boundingSphere.center;if(tr.setFromBufferAttribute(t),e)for(let s=0,a=e.length;s<a;s++){const o=e[s];Tu.setFromBufferAttribute(o),this.morphTargetsRelative?(zi.addVectors(tr.min,Tu.min),tr.expandByPoint(zi),zi.addVectors(tr.max,Tu.max),tr.expandByPoint(zi)):(tr.expandByPoint(Tu.min),tr.expandByPoint(Tu.max))}tr.getCenter(i);let r=0;for(let s=0,a=t.count;s<a;s++)zi.fromBufferAttribute(t,s),r=Math.max(r,i.distanceToSquared(zi));if(e)for(let s=0,a=e.length;s<a;s++){const o=e[s],h=this.morphTargetsRelative;for(let l=0,c=o.count;l<c;l++)zi.fromBufferAttribute(o,l),h&&(pc.fromBufferAttribute(t,l),zi.add(pc)),r=Math.max(r,i.distanceToSquared(zi))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&Sa('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){Sa("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=e.position,r=e.normal,s=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Vo(new Float32Array(4*i.count),4));const a=this.getAttribute("tangent"),o=[],h=[];for(let T=0;T<i.count;T++)o[T]=new St,h[T]=new St;const l=new St,c=new St,f=new St,d=new _e,u=new _e,p=new _e,m=new St,g=new St;function y(T,w,E){l.fromBufferAttribute(i,T),c.fromBufferAttribute(i,w),f.fromBufferAttribute(i,E),d.fromBufferAttribute(s,T),u.fromBufferAttribute(s,w),p.fromBufferAttribute(s,E),c.sub(l),f.sub(l),u.sub(d),p.sub(d);const k=1/(u.x*p.y-p.x*u.y);isFinite(k)&&(m.copy(c).multiplyScalar(p.y).addScaledVector(f,-u.y).multiplyScalar(k),g.copy(f).multiplyScalar(u.x).addScaledVector(c,-p.x).multiplyScalar(k),o[T].add(m),o[w].add(m),o[E].add(m),h[T].add(g),h[w].add(g),h[E].add(g))}let A=this.groups;A.length===0&&(A=[{start:0,count:t.count}]);for(let T=0,w=A.length;T<w;++T){const E=A[T],k=E.start,C=E.count;for(let R=k,F=k+C;R<F;R+=3)y(t.getX(R+0),t.getX(R+1),t.getX(R+2))}const _=new St,x=new St,v=new St,b=new St;function M(T){v.fromBufferAttribute(r,T),b.copy(v);const w=o[T];_.copy(w),_.sub(v.multiplyScalar(v.dot(w))).normalize(),x.crossVectors(b,w);const k=x.dot(h[T])<0?-1:1;a.setXYZW(T,_.x,_.y,_.z,k)}for(let T=0,w=A.length;T<w;++T){const E=A[T],k=E.start,C=E.count;for(let R=k,F=k+C;R<F;R+=3)M(t.getX(R+0)),M(t.getX(R+1)),M(t.getX(R+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Vo(new Float32Array(e.count*3),3),this.setAttribute("normal",i);else for(let d=0,u=i.count;d<u;d++)i.setXYZ(d,0,0,0);const r=new St,s=new St,a=new St,o=new St,h=new St,l=new St,c=new St,f=new St;if(t)for(let d=0,u=t.count;d<u;d+=3){const p=t.getX(d+0),m=t.getX(d+1),g=t.getX(d+2);r.fromBufferAttribute(e,p),s.fromBufferAttribute(e,m),a.fromBufferAttribute(e,g),c.subVectors(a,s),f.subVectors(r,s),c.cross(f),o.fromBufferAttribute(i,p),h.fromBufferAttribute(i,m),l.fromBufferAttribute(i,g),o.add(c),h.add(c),l.add(c),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(m,h.x,h.y,h.z),i.setXYZ(g,l.x,l.y,l.z)}else for(let d=0,u=e.count;d<u;d+=3)r.fromBufferAttribute(e,d+0),s.fromBufferAttribute(e,d+1),a.fromBufferAttribute(e,d+2),c.subVectors(a,s),f.subVectors(r,s),c.cross(f),i.setXYZ(d+0,c.x,c.y,c.z),i.setXYZ(d+1,c.x,c.y,c.z),i.setXYZ(d+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)zi.fromBufferAttribute(t,e),zi.normalize(),t.setXYZ(e,zi.x,zi.y,zi.z)}toNonIndexed(){function t(o,h){const l=o.array,c=o.itemSize,f=o.normalized,d=new l.constructor(h.length*c);let u=0,p=0;for(let m=0,g=h.length;m<g;m++){o.isInterleavedBufferAttribute?u=h[m]*o.data.stride+o.offset:u=h[m]*c;for(let y=0;y<c;y++)d[p++]=l[u++]}return new Vo(d,c,f)}if(this.index===null)return bi("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Ja,i=this.index.array,r=this.attributes;for(const o in r){const h=r[o],l=t(h,i);e.setAttribute(o,l)}const s=this.morphAttributes;for(const o in s){const h=[],l=s[o];for(let c=0,f=l.length;c<f;c++){const d=l[c],u=t(d,i);h.push(u)}e.morphAttributes[o]=h}e.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,h=a.length;o<h;o++){const l=a[o];e.addGroup(l.start,l.count,l.materialIndex)}return e}toJSON(){const t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const h=this.parameters;for(const l in h)h[l]!==void 0&&(t[l]=h[l]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const h in i){const l=i[h];t.data.attributes[h]=l.toJSON(t.data)}const r={};let s=!1;for(const h in this.morphAttributes){const l=this.morphAttributes[h],c=[];for(let f=0,d=l.length;f<d;f++){const u=l[f];c.push(u.toJSON(t.data))}c.length>0&&(r[h]=c,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere=o.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone());const r=t.attributes;for(const l in r){const c=r[l];this.setAttribute(l,c.clone(e))}const s=t.morphAttributes;for(const l in s){const c=[],f=s[l];for(let d=0,u=f.length;d<u;d++)c.push(f[d].clone(e));this.morphAttributes[l]=c}this.morphTargetsRelative=t.morphTargetsRelative;const a=t.groups;for(let l=0,c=a.length;l<c;l++){const f=a[l];this.addGroup(f.start,f.count,f.materialIndex)}const o=t.boundingBox;o!==null&&(this.boundingBox=o.clone());const h=t.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class PZ{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=k2,this.updateRanges=[],this.version=0,this.uuid=za()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let r=0,s=this.stride;r<s;r++)this.array[t+r]=e.array[i+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=za()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=za()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const vn=new St;class I1{constructor(t,e,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)vn.fromBufferAttribute(this,e),vn.applyMatrix4(t),this.setXYZ(e,vn.x,vn.y,vn.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)vn.fromBufferAttribute(this,e),vn.applyNormalMatrix(t),this.setXYZ(e,vn.x,vn.y,vn.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)vn.fromBufferAttribute(this,e),vn.transformDirection(t),this.setXYZ(e,vn.x,vn.y,vn.z);return this}getComponent(t,e){let i=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(i=Es(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=Xe(i,this.array)),this.data.array[t*this.data.stride+this.offset+e]=i,this}setX(t,e){return this.normalized&&(e=Xe(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Xe(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Xe(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Xe(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Es(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Es(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Es(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Es(e,this.array)),e}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Xe(e,this.array),i=Xe(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Xe(e,this.array),i=Xe(i,this.array),r=Xe(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this}setXYZW(t,e,i,r,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=Xe(e,this.array),i=Xe(i,this.array),r=Xe(r,this.array),s=Xe(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this.data.array[t+3]=s,this}clone(t){if(t===void 0){o4("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)e.push(this.data.array[r+s])}return new Vo(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new I1(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){o4("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const e=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)e.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let kZ=0;class Fg extends Dg{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:kZ++}),this.uuid=za(),this.name="",this.type="Material",this.blending=Y5,this.side=P2,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=J5,this.blendDst=Q5,this.blendEquation=Z5,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Er(0,0,0),this.blendAlpha=0,this.depthFunc=K5,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=r4,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=rc,this.stencilZFail=rc,this.stencilZPass=rc,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const i=t[e];if(i===void 0){bi(`Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){bi(`Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Y5&&(i.blending=this.blending),this.side!==P2&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==J5&&(i.blendSrc=this.blendSrc),this.blendDst!==Q5&&(i.blendDst=this.blendDst),this.blendEquation!==Z5&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==K5&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==r4&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==rc&&(i.stencilFail=this.stencilFail),this.stencilZFail!==rc&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==rc&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const h=s[o];delete h.metadata,a.push(h)}return a}if(e){const s=r(t.textures),a=r(t.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(e!==null){const r=e.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=e[s].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class u7 extends Fg{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Er(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let mc;const Eu=new St,gc=new St,yc=new St,Ac=new _e,Cu=new _e,d7=new Cn,qp=new St,Pu=new St,Vp=new St,_4=new _e,ux=new _e,v4=new _e;class LZ extends Br{constructor(t=new u7){if(super(),this.isSprite=!0,this.type="Sprite",mc===void 0){mc=new Ja;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new PZ(e,5);mc.setIndex([0,1,2,0,2,3]),mc.setAttribute("position",new I1(i,3,0,!1)),mc.setAttribute("uv",new I1(i,2,3,!1))}this.geometry=mc,this.material=t,this.center=new _e(.5,.5),this.count=1}raycast(t,e){t.camera===null&&Sa('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),gc.setFromMatrixScale(this.matrixWorld),d7.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),yc.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&gc.multiplyScalar(-yc.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const a=this.center;Gp(qp.set(-.5,-.5,0),yc,a,gc,r,s),Gp(Pu.set(.5,-.5,0),yc,a,gc,r,s),Gp(Vp.set(.5,.5,0),yc,a,gc,r,s),_4.set(0,0),ux.set(1,0),v4.set(1,1);let o=t.ray.intersectTriangle(qp,Pu,Vp,!1,Eu);if(o===null&&(Gp(Pu.set(-.5,.5,0),yc,a,gc,r,s),ux.set(0,1),o=t.ray.intersectTriangle(qp,Vp,Pu,!1,Eu),o===null))return;const h=t.ray.origin.distanceTo(Eu);h<t.near||h>t.far||e.push({distance:h,point:Eu.clone(),uv:or.getInterpolation(Eu,qp,Pu,Vp,_4,ux,v4,new _e),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function Gp(n,t,e,i,r,s){Ac.subVectors(n,e).addScalar(.5).multiply(i),r!==void 0?(Cu.x=s*Ac.x-r*Ac.y,Cu.y=r*Ac.x+s*Ac.y):Cu.copy(Ac),n.copy(t),n.x+=Cu.x,n.y+=Cu.y,n.applyMatrix4(d7)}const da=new St,dx=new St,$p=new St,_o=new St,px=new St,Hp=new St,mx=new St;class Rb{constructor(t=new St,e=new St(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,da)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=da.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(da.copy(this.origin).addScaledVector(this.direction,e),da.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){dx.copy(t).add(e).multiplyScalar(.5),$p.copy(e).sub(t).normalize(),_o.copy(this.origin).sub(dx);const s=t.distanceTo(e)*.5,a=-this.direction.dot($p),o=_o.dot(this.direction),h=-_o.dot($p),l=_o.lengthSq(),c=Math.abs(1-a*a);let f,d,u,p;if(c>0)if(f=a*h-o,d=a*o-h,p=s*c,f>=0)if(d>=-p)if(d<=p){const m=1/c;f*=m,d*=m,u=f*(f+a*d+2*o)+d*(a*f+d+2*h)+l}else d=s,f=Math.max(0,-(a*d+o)),u=-f*f+d*(d+2*h)+l;else d=-s,f=Math.max(0,-(a*d+o)),u=-f*f+d*(d+2*h)+l;else d<=-p?(f=Math.max(0,-(-a*s+o)),d=f>0?-s:Math.min(Math.max(-s,-h),s),u=-f*f+d*(d+2*h)+l):d<=p?(f=0,d=Math.min(Math.max(-s,-h),s),u=d*(d+2*h)+l):(f=Math.max(0,-(a*s+o)),d=f>0?s:Math.min(Math.max(-s,-h),s),u=-f*f+d*(d+2*h)+l);else d=a>0?-s:s,f=Math.max(0,-(a*d+o)),u=-f*f+d*(d+2*h)+l;return i&&i.copy(this.origin).addScaledVector(this.direction,f),r&&r.copy(dx).addScaledVector($p,d),u}intersectSphere(t,e){da.subVectors(t.center,this.origin);const i=da.dot(this.direction),r=da.dot(da)-i*i,s=t.radius*t.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,h=i+a;return h<0?null:o<0?this.at(h,e):this.at(o,e)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,r,s,a,o,h;const l=1/this.direction.x,c=1/this.direction.y,f=1/this.direction.z,d=this.origin;return l>=0?(i=(t.min.x-d.x)*l,r=(t.max.x-d.x)*l):(i=(t.max.x-d.x)*l,r=(t.min.x-d.x)*l),c>=0?(s=(t.min.y-d.y)*c,a=(t.max.y-d.y)*c):(s=(t.max.y-d.y)*c,a=(t.min.y-d.y)*c),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a<r||isNaN(r))&&(r=a),f>=0?(o=(t.min.z-d.z)*f,h=(t.max.z-d.z)*f):(o=(t.max.z-d.z)*f,h=(t.min.z-d.z)*f),i>h||o>r)||((o>i||i!==i)&&(i=o),(h<r||r!==r)&&(r=h),r<0)?null:this.at(i>=0?i:r,e)}intersectsBox(t){return this.intersectBox(t,da)!==null}intersectTriangle(t,e,i,r,s){px.subVectors(e,t),Hp.subVectors(i,t),mx.crossVectors(px,Hp);let a=this.direction.dot(mx),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;_o.subVectors(this.origin,t);const h=o*this.direction.dot(Hp.crossVectors(_o,Hp));if(h<0)return null;const l=o*this.direction.dot(px.cross(_o));if(l<0||h+l>a)return null;const c=-o*_o.dot(mx);return c<0?null:this.at(c/a,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class NZ extends Fg{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Er(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new u0,this.combine=rZ,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const b4=new Cn,gl=new Rb,Wp=new Nb,w4=new St,jp=new St,Xp=new St,Yp=new St,gx=new St,Zp=new St,S4=new St,Jp=new St;class VQ extends Br{constructor(t=new Ja,e=new NZ){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,i=Object.keys(e);if(i.length>0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(t,e){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,a=i.morphTargetsRelative;e.fromBufferAttribute(r,t);const o=this.morphTargetInfluences;if(s&&o){Zp.set(0,0,0);for(let h=0,l=s.length;h<l;h++){const c=o[h],f=s[h];c!==0&&(gx.fromBufferAttribute(f,t),a?Zp.addScaledVector(gx,c):Zp.addScaledVector(gx.sub(e),c))}e.add(Zp)}return e}raycast(t,e){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Wp.copy(i.boundingSphere),Wp.applyMatrix4(s),gl.copy(t.ray).recast(t.near),!(Wp.containsPoint(gl.origin)===!1&&(gl.intersectSphere(Wp,w4)===null||gl.origin.distanceToSquared(w4)>(t.far-t.near)**2))&&(b4.copy(s).invert(),gl.copy(t.ray).applyMatrix4(b4),!(i.boundingBox!==null&&gl.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,gl)))}_computeIntersections(t,e,i){let r;const s=this.geometry,a=this.material,o=s.index,h=s.attributes.position,l=s.attributes.uv,c=s.attributes.uv1,f=s.attributes.normal,d=s.groups,u=s.drawRange;if(o!==null)if(Array.isArray(a))for(let p=0,m=d.length;p<m;p++){const g=d[p],y=a[g.materialIndex],A=Math.max(g.start,u.start),_=Math.min(o.count,Math.min(g.start+g.count,u.start+u.count));for(let x=A,v=_;x<v;x+=3){const b=o.getX(x),M=o.getX(x+1),T=o.getX(x+2);r=Qp(this,y,t,i,l,c,f,b,M,T),r&&(r.faceIndex=Math.floor(x/3),r.face.materialIndex=g.materialIndex,e.push(r))}}else{const p=Math.max(0,u.start),m=Math.min(o.count,u.start+u.count);for(let g=p,y=m;g<y;g+=3){const A=o.getX(g),_=o.getX(g+1),x=o.getX(g+2);r=Qp(this,a,t,i,l,c,f,A,_,x),r&&(r.faceIndex=Math.floor(g/3),e.push(r))}}else if(h!==void 0)if(Array.isArray(a))for(let p=0,m=d.length;p<m;p++){const g=d[p],y=a[g.materialIndex],A=Math.max(g.start,u.start),_=Math.min(h.count,Math.min(g.start+g.count,u.start+u.count));for(let x=A,v=_;x<v;x+=3){const b=x,M=x+1,T=x+2;r=Qp(this,y,t,i,l,c,f,b,M,T),r&&(r.faceIndex=Math.floor(x/3),r.face.materialIndex=g.materialIndex,e.push(r))}}else{const p=Math.max(0,u.start),m=Math.min(h.count,u.start+u.count);for(let g=p,y=m;g<y;g+=3){const A=g,_=g+1,x=g+2;r=Qp(this,a,t,i,l,c,f,A,_,x),r&&(r.faceIndex=Math.floor(g/3),e.push(r))}}}}function RZ(n,t,e,i,r,s,a,o){let h;if(t.side===nZ?h=i.intersectTriangle(a,s,r,!0,o):h=i.intersectTriangle(r,s,a,t.side===P2,o),h===null)return null;Jp.copy(o),Jp.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(Jp);return l<e.near||l>e.far?null:{distance:l,point:Jp.clone(),object:n}}function Qp(n,t,e,i,r,s,a,o,h,l){n.getVertexPosition(o,jp),n.getVertexPosition(h,Xp),n.getVertexPosition(l,Yp);const c=RZ(n,t,e,i,jp,Xp,Yp,S4);if(c){const f=new St;or.getBarycoord(S4,jp,Xp,Yp,f),r&&(c.uv=or.getInterpolatedAttribute(r,o,h,l,f,new _e)),s&&(c.uv1=or.getInterpolatedAttribute(s,o,h,l,f,new _e)),a&&(c.normal=or.getInterpolatedAttribute(a,o,h,l,f,new St),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));const d={a:o,b:h,c:l,normal:new St,materialIndex:0};or.getNormal(jp,Xp,Yp,d.normal),c.face=d,c.barycoord=f}return c}class GQ extends Vo{constructor(t,e,i,r=1){super(t,e,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}class DZ extends Fg{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Er(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const O1=new St,B1=new St,M4=new Cn,ku=new Rb,Kp=new Nb,yx=new St,T4=new St;class FZ extends Br{constructor(t=new Ja,e=new DZ){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,i=[0];for(let r=1,s=e.count;r<s;r++)O1.fromBufferAttribute(e,r-1),B1.fromBufferAttribute(e,r),i[r]=i[r-1],i[r]+=O1.distanceTo(B1);t.setAttribute("lineDistance",new Bs(i,1))}else bi("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const i=this.geometry,r=this.matrixWorld,s=t.params.Line.threshold,a=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Kp.copy(i.boundingSphere),Kp.applyMatrix4(r),Kp.radius+=s,t.ray.intersectsSphere(Kp)===!1)return;M4.copy(r).invert(),ku.copy(t.ray).applyMatrix4(M4);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=o*o,l=this.isLineSegments?2:1,c=i.index,d=i.attributes.position;if(c!==null){const u=Math.max(0,a.start),p=Math.min(c.count,a.start+a.count);for(let m=u,g=p-1;m<g;m+=l){const y=c.getX(m),A=c.getX(m+1),_=tm(this,t,ku,h,y,A,m);_&&e.push(_)}if(this.isLineLoop){const m=c.getX(p-1),g=c.getX(u),y=tm(this,t,ku,h,m,g,p-1);y&&e.push(y)}}else{const u=Math.max(0,a.start),p=Math.min(d.count,a.start+a.count);for(let m=u,g=p-1;m<g;m+=l){const y=tm(this,t,ku,h,m,m+1,m);y&&e.push(y)}if(this.isLineLoop){const m=tm(this,t,ku,h,p-1,u,p-1);m&&e.push(m)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,i=Object.keys(e);if(i.length>0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function tm(n,t,e,i,r,s,a){const o=n.geometry.attributes.position;if(O1.fromBufferAttribute(o,r),B1.fromBufferAttribute(o,s),e.distanceSqToSegment(O1,B1,yx,T4)>i)return;yx.applyMatrix4(n.matrixWorld);const l=t.ray.origin.distanceTo(yx);if(!(l<t.near||l>t.far))return{distance:l,point:T4.clone().applyMatrix4(n.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:n}}const E4=new St,C4=new St;class $Q extends FZ{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,i=[];for(let r=0,s=e.count;r<s;r+=2)E4.fromBufferAttribute(e,r),C4.fromBufferAttribute(e,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+E4.distanceTo(C4);t.setAttribute("lineDistance",new Bs(i,1))}else bi("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class p7 extends Ja{constructor(t=1,e=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const h=[],l=[],c=[],f=[];let d=0,u=0;p("z","y","x",-1,-1,i,e,t,a,s,0),p("z","y","x",1,-1,i,e,-t,a,s,1),p("x","z","y",1,1,t,i,e,r,a,2),p("x","z","y",1,-1,t,i,-e,r,a,3),p("x","y","z",1,-1,t,e,i,r,s,4),p("x","y","z",-1,-1,t,e,-i,r,s,5),this.setIndex(h),this.setAttribute("position",new Bs(l,3)),this.setAttribute("normal",new Bs(c,3)),this.setAttribute("uv",new Bs(f,2));function p(m,g,y,A,_,x,v,b,M,T,w){const E=x/M,k=v/T,C=x/2,R=v/2,F=b/2,P=M+1,I=T+1;let U=0,N=0;const q=new St;for(let G=0;G<I;G++){const nt=G*k-R;for(let gt=0;gt<P;gt++){const O=gt*E-C;q[m]=O*A,q[g]=nt*_,q[y]=F,l.push(q.x,q.y,q.z),q[m]=0,q[g]=0,q[y]=b>0?1:-1,c.push(q.x,q.y,q.z),f.push(gt/M),f.push(1-G/T),U+=1}}for(let G=0;G<T;G++)for(let nt=0;nt<M;nt++){const gt=d+nt+P*G,O=d+nt+P*(G+1),Y=d+(nt+1)+P*(G+1),X=d+(nt+1)+P*G;h.push(gt,O,X),h.push(O,Y,X),N+=6}o.addGroup(u,N,w),u+=N,d+=U}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new p7(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}const em=new St,im=new St,Ax=new St,nm=new or;class HQ extends Ja{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},t!==null){const r=Math.pow(10,4),s=Math.cos(fZ*e),a=t.getIndex(),o=t.getAttribute("position"),h=a?a.count:o.count,l=[0,0,0],c=["a","b","c"],f=new Array(3),d={},u=[];for(let p=0;p<h;p+=3){a?(l[0]=a.getX(p),l[1]=a.getX(p+1),l[2]=a.getX(p+2)):(l[0]=p,l[1]=p+1,l[2]=p+2);const{a:m,b:g,c:y}=nm;if(m.fromBufferAttribute(o,l[0]),g.fromBufferAttribute(o,l[1]),y.fromBufferAttribute(o,l[2]),nm.getNormal(Ax),f[0]=`${Math.round(m.x*r)},${Math.round(m.y*r)},${Math.round(m.z*r)}`,f[1]=`${Math.round(g.x*r)},${Math.round(g.y*r)},${Math.round(g.z*r)}`,f[2]=`${Math.round(y.x*r)},${Math.round(y.y*r)},${Math.round(y.z*r)}`,!(f[0]===f[1]||f[1]===f[2]||f[2]===f[0]))for(let A=0;A<3;A++){const _=(A+1)%3,x=f[A],v=f[_],b=nm[c[A]],M=nm[c[_]],T=`${x}_${v}`,w=`${v}_${x}`;w in d&&d[w]?(Ax.dot(d[w].normal)<=s&&(u.push(b.x,b.y,b.z),u.push(M.x,M.y,M.z)),d[w]=null):T in d||(d[T]={index0:l[A],index1:l[_],normal:Ax.clone()})}}for(const p in d)if(d[p]){const{index0:m,index1:g}=d[p];em.fromBufferAttribute(o,m),im.fromBufferAttribute(o,g),u.push(em.x,em.y,em.z),u.push(im.x,im.y,im.z)}this.setAttribute("position",new Bs(u,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}class Xs{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){bi("Curve: .getPoint() not implemented.")}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,r=this.getPoint(0),s=0;e.push(0);for(let a=1;a<=t;a++)i=this.getPoint(a/t),s+=i.distanceTo(r),e.push(s),r=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e=null){const i=this.getLengths();let r=0;const s=i.length;let a;e?a=e:a=t*i[s-1];let o=0,h=s-1,l;for(;o<=h;)if(r=Math.floor(o+(h-o)/2),l=i[r]-a,l<0)o=r+1;else if(l>0)h=r-1;else{h=r;break}if(r=h,i[r]===a)return r/(s-1);const c=i[r],d=i[r+1]-c,u=(a-c)/d;return(r+u)/(s-1)}getTangent(t,e){let r=t-1e-4,s=t+1e-4;r<0&&(r=0),s>1&&(s=1);const a=this.getPoint(r),o=this.getPoint(s),h=e||(a.isVector2?new _e:new St);return h.copy(o).sub(a).normalize(),h}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e=!1){const i=new St,r=[],s=[],a=[],o=new St,h=new Cn;for(let u=0;u<=t;u++){const p=u/t;r[u]=this.getTangentAt(p,new St)}s[0]=new St,a[0]=new St;let l=Number.MAX_VALUE;const c=Math.abs(r[0].x),f=Math.abs(r[0].y),d=Math.abs(r[0].z);c<=l&&(l=c,i.set(1,0,0)),f<=l&&(l=f,i.set(0,1,0)),d<=l&&i.set(0,0,1),o.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],o),a[0].crossVectors(r[0],s[0]);for(let u=1;u<=t;u++){if(s[u]=s[u-1].clone(),a[u]=a[u-1].clone(),o.crossVectors(r[u-1],r[u]),o.length()>Number.EPSILON){o.normalize();const p=Math.acos(Ce(r[u-1].dot(r[u]),-1,1));s[u].applyMatrix4(h.makeRotationAxis(o,p))}a[u].crossVectors(r[u],s[u])}if(e===!0){let u=Math.acos(Ce(s[0].dot(s[t]),-1,1));u/=t,r[0].dot(o.crossVectors(s[0],s[t]))>0&&(u=-u);for(let p=1;p<=t;p++)s[p].applyMatrix4(h.makeRotationAxis(r[p],u*p)),a[p].crossVectors(r[p],s[p])}return{tangents:r,normals:s,binormals:a}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Db extends Xs{constructor(t=0,e=0,i=1,r=1,s=0,a=Math.PI*2,o=!1,h=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=a,this.aClockwise=o,this.aRotation=h}getPoint(t,e=new _e){const i=e,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const a=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(a?s=0:s=r),this.aClockwise===!0&&!a&&(s===r?s=-r:s=s-r);const o=this.aStartAngle+t*s;let h=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const c=Math.cos(this.aRotation),f=Math.sin(this.aRotation),d=h-this.aX,u=l-this.aY;h=d*c-u*f+this.aX,l=d*f+u*c+this.aY}return i.set(h,l)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class IZ extends Db{constructor(t,e,i,r,s,a){super(t,e,i,i,r,s,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Fb(){let n=0,t=0,e=0,i=0;function r(s,a,o,h){n=s,t=o,e=-3*s+3*a-2*o-h,i=2*s-2*a+o+h}return{initCatmullRom:function(s,a,o,h,l){r(a,o,l*(o-s),l*(h-a))},initNonuniformCatmullRom:function(s,a,o,h,l,c,f){let d=(a-s)/l-(o-s)/(l+c)+(o-a)/c,u=(o-a)/c-(h-a)/(c+f)+(h-o)/f;d*=c,u*=c,r(a,o,d,u)},calc:function(s){const a=s*s,o=a*s;return n+t*s+e*a+i*o}}}const rm=new St,xx=new Fb,_x=new Fb,vx=new Fb;class OZ extends Xs{constructor(t=[],e=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=r}getPoint(t,e=new St){const i=e,r=this.points,s=r.length,a=(s-(this.closed?0:1))*t;let o=Math.floor(a),h=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/s)+1)*s:h===0&&o===s-1&&(o=s-2,h=1);let l,c;this.closed||o>0?l=r[(o-1)%s]:(rm.subVectors(r[0],r[1]).add(r[0]),l=rm);const f=r[o%s],d=r[(o+1)%s];if(this.closed||o+2<s?c=r[(o+2)%s]:(rm.subVectors(r[s-1],r[s-2]).add(r[s-1]),c=rm),this.curveType==="centripetal"||this.curveType==="chordal"){const u=this.curveType==="chordal"?.5:.25;let p=Math.pow(l.distanceToSquared(f),u),m=Math.pow(f.distanceToSquared(d),u),g=Math.pow(d.distanceToSquared(c),u);m<1e-4&&(m=1),p<1e-4&&(p=m),g<1e-4&&(g=m),xx.initNonuniformCatmullRom(l.x,f.x,d.x,c.x,p,m,g),_x.initNonuniformCatmullRom(l.y,f.y,d.y,c.y,p,m,g),vx.initNonuniformCatmullRom(l.z,f.z,d.z,c.z,p,m,g)}else this.curveType==="catmullrom"&&(xx.initCatmullRom(l.x,f.x,d.x,c.x,this.tension),_x.initCatmullRom(l.y,f.y,d.y,c.y,this.tension),vx.initCatmullRom(l.z,f.z,d.z,c.z,this.tension));return i.set(xx.calc(h),_x.calc(h),vx.calc(h)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const r=t.points[e];this.points.push(new St().fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function P4(n,t,e,i,r){const s=(i-t)*.5,a=(r-e)*.5,o=n*n,h=n*o;return(2*e-2*i+s+a)*h+(-3*e+3*i-2*s-a)*o+s*n+e}function BZ(n,t){const e=1-n;return e*e*t}function zZ(n,t){return 2*(1-n)*n*t}function UZ(n,t){return n*n*t}function Ku(n,t,e,i){return BZ(n,t)+zZ(n,e)+UZ(n,i)}function qZ(n,t){const e=1-n;return e*e*e*t}function VZ(n,t){const e=1-n;return 3*e*e*n*t}function GZ(n,t){return 3*(1-n)*n*n*t}function $Z(n,t){return n*n*n*t}function td(n,t,e,i,r){return qZ(n,t)+VZ(n,e)+GZ(n,i)+$Z(n,r)}class m7 extends Xs{constructor(t=new _e,e=new _e,i=new _e,r=new _e){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new _e){const i=e,r=this.v0,s=this.v1,a=this.v2,o=this.v3;return i.set(td(t,r.x,s.x,a.x,o.x),td(t,r.y,s.y,a.y,o.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class HZ extends Xs{constructor(t=new St,e=new St,i=new St,r=new St){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new St){const i=e,r=this.v0,s=this.v1,a=this.v2,o=this.v3;return i.set(td(t,r.x,s.x,a.x,o.x),td(t,r.y,s.y,a.y,o.y),td(t,r.z,s.z,a.z,o.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class g7 extends Xs{constructor(t=new _e,e=new _e){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new _e){const i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new _e){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class WZ extends Xs{constructor(t=new St,e=new St){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new St){const i=e;return t===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new St){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class y7 extends Xs{constructor(t=new _e,e=new _e,i=new _e){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new _e){const i=e,r=this.v0,s=this.v1,a=this.v2;return i.set(Ku(t,r.x,s.x,a.x),Ku(t,r.y,s.y,a.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class jZ extends Xs{constructor(t=new St,e=new St,i=new St){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new St){const i=e,r=this.v0,s=this.v1,a=this.v2;return i.set(Ku(t,r.x,s.x,a.x),Ku(t,r.y,s.y,a.y),Ku(t,r.z,s.z,a.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class A7 extends Xs{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new _e){const i=e,r=this.points,s=(r.length-1)*t,a=Math.floor(s),o=s-a,h=r[a===0?a:a-1],l=r[a],c=r[a>r.length-2?r.length-1:a+1],f=r[a>r.length-3?r.length-1:a+2];return i.set(P4(o,h.x,l.x,c.x,f.x),P4(o,h.y,l.y,c.y,f.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const r=t.points[e];this.points.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const r=this.points[e];t.points.push(r.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const r=t.points[e];this.points.push(new _e().fromArray(r))}return this}}var k4=Object.freeze({__proto__:null,ArcCurve:IZ,CatmullRomCurve3:OZ,CubicBezierCurve:m7,CubicBezierCurve3:HZ,EllipseCurve:Db,LineCurve:g7,LineCurve3:WZ,QuadraticBezierCurve:y7,QuadraticBezierCurve3:jZ,SplineCurve:A7});class XZ extends Xs{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){const i=t.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new k4[i](e,t))}return this}getPoint(t,e){const i=t*this.getLength(),r=this.getCurveLengths();let s=0;for(;s<r.length;){if(r[s]>=i){const a=r[s]-i,o=this.curves[s],h=o.getLength(),l=h===0?0:1-a/h;return o.getPointAt(l,e)}s++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let i=0,r=this.curves.length;i<r;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const a=s[r],o=a.isEllipseCurve?t*2:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?t*a.points.length:t,h=a.getPoints(o);for(let l=0;l<h.length;l++){const c=h[l];i&&i.equals(c)||(e.push(c),i=c)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){const r=this.curves[e];t.curves.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const r=t.curves[e];this.curves.push(new k4[r.type]().fromJSON(r))}return this}}class N2 extends XZ{constructor(t){super(),this.type="Path",this.currentPoint=new _e,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const i=new g7(this.currentPoint.clone(),new _e(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,r){const s=new y7(this.currentPoint.clone(),new _e(t,e),new _e(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(t,e,i,r,s,a){const o=new m7(this.currentPoint.clone(),new _e(t,e),new _e(i,r),new _e(s,a));return this.curves.push(o),this.currentPoint.set(s,a),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),i=new A7(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,r,s,a){const o=this.currentPoint.x,h=this.currentPoint.y;return this.absarc(t+o,e+h,i,r,s,a),this}absarc(t,e,i,r,s,a){return this.absellipse(t,e,i,i,r,s,a),this}ellipse(t,e,i,r,s,a,o,h){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,i,r,s,a,o,h),this}absellipse(t,e,i,r,s,a,o,h){const l=new Db(t,e,i,r,s,a,o,h);if(this.curves.length>0){const f=l.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class bx extends N2{constructor(t){super(t),this.uuid=za(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let i=0,r=this.holes.length;i<r;i++)e[i]=this.holes[i].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const r=t.holes[e];this.holes.push(r.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){const r=this.holes[e];t.holes.push(r.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const r=t.holes[e];this.holes.push(new N2().fromJSON(r))}return this}}function YZ(n,t,e=2){const i=t&&t.length,r=i?t[0]*e:n.length;let s=x7(n,0,r,e,!0);const a=[];if(!s||s.next===s.prev)return a;let o,h,l;if(i&&(s=tJ(n,t,s,e)),n.length>80*e){o=n[0],h=n[1];let c=o,f=h;for(let d=e;d<r;d+=e){const u=n[d],p=n[d+1];u<o&&(o=u),p<h&&(h=p),u>c&&(c=u),p>f&&(f=p)}l=Math.max(c-o,f-h),l=l!==0?32767/l:0}return zd(s,a,e,o,h,l,0),a}function x7(n,t,e,i,r){let s;if(r===fJ(n,t,e,i)>0)for(let a=t;a<e;a+=i)s=L4(a/i|0,n[a],n[a+1],s);else for(let a=e-i;a>=t;a-=i)s=L4(a/i|0,n[a],n[a+1],s);return s&&Df(s,s.next)&&(qd(s),s=s.next),s}function dh(n,t){if(!n)return n;t||(t=n);let e=n,i;do if(i=!1,!e.steiner&&(Df(e,e.next)||fi(e.prev,e,e.next)===0)){if(qd(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function zd(n,t,e,i,r,s,a){if(!n)return;!a&&s&&sJ(n,i,r,s);let o=n;for(;n.prev!==n.next;){const h=n.prev,l=n.next;if(s?JZ(n,i,r,s):ZZ(n)){t.push(h.i,n.i,l.i),qd(n),n=l.next,o=l.next;continue}if(n=l,n===o){a?a===1?(n=QZ(dh(n),t),zd(n,t,e,i,r,s,2)):a===2&&KZ(n,t,e,i,r,s):zd(dh(n),t,e,i,r,s,1);break}}}function ZZ(n){const t=n.prev,e=n,i=n.next;if(fi(t,e,i)>=0)return!1;const r=t.x,s=e.x,a=i.x,o=t.y,h=e.y,l=i.y,c=Math.min(r,s,a),f=Math.min(o,h,l),d=Math.max(r,s,a),u=Math.max(o,h,l);let p=i.next;for(;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=f&&p.y<=u&&Vu(r,o,s,h,a,l,p.x,p.y)&&fi(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function JZ(n,t,e,i){const r=n.prev,s=n,a=n.next;if(fi(r,s,a)>=0)return!1;const o=r.x,h=s.x,l=a.x,c=r.y,f=s.y,d=a.y,u=Math.min(o,h,l),p=Math.min(c,f,d),m=Math.max(o,h,l),g=Math.max(c,f,d),y=R2(u,p,t,e,i),A=R2(m,g,t,e,i);let _=n.prevZ,x=n.nextZ;for(;_&&_.z>=y&&x&&x.z<=A;){if(_.x>=u&&_.x<=m&&_.y>=p&&_.y<=g&&_!==r&&_!==a&&Vu(o,c,h,f,l,d,_.x,_.y)&&fi(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=u&&x.x<=m&&x.y>=p&&x.y<=g&&x!==r&&x!==a&&Vu(o,c,h,f,l,d,x.x,x.y)&&fi(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=y;){if(_.x>=u&&_.x<=m&&_.y>=p&&_.y<=g&&_!==r&&_!==a&&Vu(o,c,h,f,l,d,_.x,_.y)&&fi(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=A;){if(x.x>=u&&x.x<=m&&x.y>=p&&x.y<=g&&x!==r&&x!==a&&Vu(o,c,h,f,l,d,x.x,x.y)&&fi(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function QZ(n,t){let e=n;do{const i=e.prev,r=e.next.next;!Df(i,r)&&v7(i,e,e.next,r)&&Ud(i,r)&&Ud(r,i)&&(t.push(i.i,e.i,r.i),qd(e),qd(e.next),e=n=r),e=e.next}while(e!==n);return dh(e)}function KZ(n,t,e,i,r,s){let a=n;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&lJ(a,o)){let h=b7(a,o);a=dh(a,a.next),h=dh(h,h.next),zd(a,t,e,i,r,s,0),zd(h,t,e,i,r,s,0);return}o=o.next}a=a.next}while(a!==n)}function tJ(n,t,e,i){const r=[];for(let s=0,a=t.length;s<a;s++){const o=t[s]*i,h=s<a-1?t[s+1]*i:n.length,l=x7(n,o,h,i,!1);l===l.next&&(l.steiner=!0),r.push(oJ(l))}r.sort(eJ);for(let s=0;s<r.length;s++)e=iJ(r[s],e);return e}function eJ(n,t){let e=n.x-t.x;if(e===0&&(e=n.y-t.y,e===0)){const i=(n.next.y-n.y)/(n.next.x-n.x),r=(t.next.y-t.y)/(t.next.x-t.x);e=i-r}return e}function iJ(n,t){const e=nJ(n,t);if(!e)return t;const i=b7(e,n);return dh(i,i.next),dh(e,e.next)}function nJ(n,t){let e=t;const i=n.x,r=n.y;let s=-1/0,a;if(Df(n,e))return e;do{if(Df(n,e.next))return e.next;if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){const f=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=i&&f>s&&(s=f,a=e.x<e.next.x?e:e.next,f===i))return a}e=e.next}while(e!==t);if(!a)return null;const o=a,h=a.x,l=a.y;let c=1/0;e=a;do{if(i>=e.x&&e.x>=h&&i!==e.x&&_7(r<l?i:s,r,h,l,r<l?s:i,r,e.x,e.y)){const f=Math.abs(r-e.y)/(i-e.x);Ud(e,n)&&(f<c||f===c&&(e.x>a.x||e.x===a.x&&rJ(a,e)))&&(a=e,c=f)}e=e.next}while(e!==o);return a}function rJ(n,t){return fi(n.prev,n,t.prev)<0&&fi(t.next,n,n.next)<0}function sJ(n,t,e,i){let r=n;do r.z===0&&(r.z=R2(r.x,r.y,t,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,aJ(r)}function aJ(n){let t,e=1;do{let i=n,r;n=null;let s=null;for(t=0;i;){t++;let a=i,o=0;for(let l=0;l<e&&(o++,a=a.nextZ,!!a);l++);let h=e;for(;o>0||h>0&&a;)o!==0&&(h===0||!a||i.z<=a.z)?(r=i,i=i.nextZ,o--):(r=a,a=a.nextZ,h--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;i=a}s.nextZ=null,e*=2}while(t>1);return n}function R2(n,t,e,i,r){return n=(n-e)*r|0,t=(t-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function oJ(n){let t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function _7(n,t,e,i,r,s,a,o){return(r-a)*(t-o)>=(n-a)*(s-o)&&(n-a)*(i-o)>=(e-a)*(t-o)&&(e-a)*(s-o)>=(r-a)*(i-o)}function Vu(n,t,e,i,r,s,a,o){return!(n===a&&t===o)&&_7(n,t,e,i,r,s,a,o)}function lJ(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!hJ(n,t)&&(Ud(n,t)&&Ud(t,n)&&cJ(n,t)&&(fi(n.prev,n,t.prev)||fi(n,t.prev,t))||Df(n,t)&&fi(n.prev,n,n.next)>0&&fi(t.prev,t,t.next)>0)}function fi(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function Df(n,t){return n.x===t.x&&n.y===t.y}function v7(n,t,e,i){const r=am(fi(n,t,e)),s=am(fi(n,t,i)),a=am(fi(e,i,n)),o=am(fi(e,i,t));return!!(r!==s&&a!==o||r===0&&sm(n,e,t)||s===0&&sm(n,i,t)||a===0&&sm(e,n,i)||o===0&&sm(e,t,i))}function sm(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function am(n){return n>0?1:n<0?-1:0}function hJ(n,t){let e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&v7(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function Ud(n,t){return fi(n.prev,n,n.next)<0?fi(n,t,n.next)>=0&&fi(n,n.prev,t)>=0:fi(n,t,n.prev)<0||fi(n,n.next,t)<0}function cJ(n,t){let e=n,i=!1;const r=(n.x+t.x)/2,s=(n.y+t.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&r<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function b7(n,t){const e=D2(n.i,n.x,n.y),i=D2(t.i,t.x,t.y),r=n.next,s=t.prev;return n.next=t,t.prev=n,e.next=r,r.prev=e,i.next=e,e.prev=i,s.next=i,i.prev=s,i}function L4(n,t,e,i){const r=D2(n,t,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function qd(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function D2(n,t,e){return{i:n,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function fJ(n,t,e,i){let r=0;for(let s=t,a=e-i;s<e;s+=i)r+=(n[a]-n[s])*(n[s+1]+n[a+1]),a=s;return r}class uJ{static triangulate(t,e,i=2){return YZ(t,e,i)}}class Ib{static area(t){const e=t.length;let i=0;for(let r=e-1,s=0;s<e;r=s++)i+=t[r].x*t[s].y-t[s].x*t[r].y;return i*.5}static isClockWise(t){return Ib.area(t)<0}static triangulateShape(t,e){const i=[],r=[],s=[];N4(t),R4(i,t);let a=t.length;e.forEach(N4);for(let h=0;h<e.length;h++)r.push(a),a+=e[h].length,R4(i,e[h]);const o=uJ.triangulate(i,r);for(let h=0;h<o.length;h+=3)s.push(o.slice(h,h+3));return s}}function N4(n){const t=n.length;t>2&&n[t-1].equals(n[0])&&n.pop()}function R4(n,t){for(let e=0;e<t.length;e++)n.push(t[e].x),n.push(t[e].y)}class w7 extends Ja{constructor(t=1,e=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:r};const s=t/2,a=e/2,o=Math.floor(i),h=Math.floor(r),l=o+1,c=h+1,f=t/o,d=e/h,u=[],p=[],m=[],g=[];for(let y=0;y<c;y++){const A=y*d-a;for(let _=0;_<l;_++){const x=_*f-s;p.push(x,-A,0),m.push(0,0,1),g.push(_/o),g.push(1-y/h)}}for(let y=0;y<h;y++)for(let A=0;A<o;A++){const _=A+l*y,x=A+l*(y+1),v=A+1+l*(y+1),b=A+1+l*y;u.push(_,x,b),u.push(x,v,b)}this.setIndex(u),this.setAttribute("position",new Bs(p,3)),this.setAttribute("normal",new Bs(m,3)),this.setAttribute("uv",new Bs(g,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new w7(t.width,t.height,t.widthSegments,t.heightSegments)}}function dJ(n){const t={};for(const e in n){t[e]={};for(const i in n[e]){const r=n[e][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(bi("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][i]=null):t[e][i]=r.clone():Array.isArray(r)?t[e][i]=r.slice():t[e][i]=r}}return t}function pJ(n){const t=[];for(let e=0;e<n.length;e++)t.push(n[e].clone());return t}var mJ=`void main() {
|
|
4552
4552
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
4553
4553
|
}`,gJ=`void main() {
|
|
4554
4554
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
4555
|
-
}`;class WQ extends Fg{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=mJ,this.fragmentShader=gJ,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=dJ(t.uniforms),this.uniformsGroups=pJ(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const r in this.uniforms){const a=this.uniforms[r].value;a&&a.isTexture?e.uniforms[r]={type:"t",value:a.toJSON(t).uuid}:a&&a.isColor?e.uniforms[r]={type:"c",value:a.getHex()}:a&&a.isVector2?e.uniforms[r]={type:"v2",value:a.toArray()}:a&&a.isVector3?e.uniforms[r]={type:"v3",value:a.toArray()}:a&&a.isVector4?e.uniforms[r]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?e.uniforms[r]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?e.uniforms[r]={type:"m4",value:a.toArray()}:e.uniforms[r]={value:a}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}const ed={enabled:!1,files:{},add:function(n,t){this.enabled!==!1&&(D4(n)||(this.files[n]=t))},get:function(n){if(this.enabled!==!1&&!D4(n))return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};function D4(n){try{const t=n.slice(n.indexOf(":")+1);return new URL(t).protocol==="blob:"}catch{return!1}}class yJ{constructor(t,e,i){const r=this;let s=!1,a=0,o=0,h;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this._abortController=null,this.itemStart=function(c){o++,s===!1&&r.onStart!==void 0&&r.onStart(c,a,o),s=!0},this.itemEnd=function(c){a++,r.onProgress!==void 0&&r.onProgress(c,a,o),a===o&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(c){r.onError!==void 0&&r.onError(c)},this.resolveURL=function(c){return h?h(c):c},this.setURLModifier=function(c){return h=c,this},this.addHandler=function(c,f){return l.push(c,f),this},this.removeHandler=function(c){const f=l.indexOf(c);return f!==-1&&l.splice(f,2),this},this.getHandler=function(c){for(let f=0,d=l.length;f<d;f+=2){const u=l[f],p=l[f+1];if(u.global&&(u.lastIndex=0),u.test(c))return p}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const AJ=new yJ;class Ig{constructor(t){this.manager=t!==void 0?t:AJ,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(t,e){const i=this;return new Promise(function(r,s){i.load(t,r,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}abort(){return this}}Ig.DEFAULT_MATERIAL_NAME="__DEFAULT";const pa={};class xJ extends Error{constructor(t,e){super(t),this.response=e}}class jQ extends Ig{constructor(t){super(t),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(t,e,i,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ed.get(`file:${t}`);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e&&e(s),this.manager.itemEnd(t)},0),s;if(pa[t]!==void 0){pa[t].push({onLoad:e,onProgress:i,onError:r});return}pa[t]=[],pa[t].push({onLoad:e,onProgress:i,onError:r});const a=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,h=this.responseType;fetch(a).then(l=>{if(l.status===200||l.status===0){if(l.status===0&&bi("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||l.body===void 0||l.body.getReader===void 0)return l;const c=pa[t],f=l.body.getReader(),d=l.headers.get("X-File-Size")||l.headers.get("Content-Length"),u=d?parseInt(d):0,p=u!==0;let m=0;const g=new ReadableStream({start(y){A();function A(){f.read().then(({done:_,value:x})=>{if(_)y.close();else{m+=x.byteLength;const v=new ProgressEvent("progress",{lengthComputable:p,loaded:m,total:u});for(let b=0,M=c.length;b<M;b++){const T=c[b];T.onProgress&&T.onProgress(v)}y.enqueue(x),A()}},_=>{y.error(_)})}}});return new Response(g)}else throw new xJ(`fetch for "${l.url}" responded with ${l.status}: ${l.statusText}`,l)}).then(l=>{switch(h){case"arraybuffer":return l.arrayBuffer();case"blob":return l.blob();case"document":return l.text().then(c=>new DOMParser().parseFromString(c,o));case"json":return l.json();default:if(o==="")return l.text();{const f=/charset="?([^;"\s]*)"?/i.exec(o),d=f&&f[1]?f[1].toLowerCase():void 0,u=new TextDecoder(d);return l.arrayBuffer().then(p=>u.decode(p))}}}).then(l=>{ed.add(`file:${t}`,l);const c=pa[t];delete pa[t];for(let f=0,d=c.length;f<d;f++){const u=c[f];u.onLoad&&u.onLoad(l)}}).catch(l=>{const c=pa[t];if(c===void 0)throw this.manager.itemError(t),l;delete pa[t];for(let f=0,d=c.length;f<d;f++){const u=c[f];u.onError&&u.onError(l)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}const xc=new WeakMap;class _J extends Ig{constructor(t){super(t)}load(t,e,i,r){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=this,a=ed.get(`image:${t}`);if(a!==void 0){if(a.complete===!0)s.manager.itemStart(t),setTimeout(function(){e&&e(a),s.manager.itemEnd(t)},0);else{let f=xc.get(a);f===void 0&&(f=[],xc.set(a,f)),f.push({onLoad:e,onError:r})}return a}const o=L2("img");function h(){c(),e&&e(this);const f=xc.get(this)||[];for(let d=0;d<f.length;d++){const u=f[d];u.onLoad&&u.onLoad(this)}xc.delete(this),s.manager.itemEnd(t)}function l(f){c(),r&&r(f),ed.remove(`image:${t}`);const d=xc.get(this)||[];for(let u=0;u<d.length;u++){const p=d[u];p.onError&&p.onError(f)}xc.delete(this),s.manager.itemError(t),s.manager.itemEnd(t)}function c(){o.removeEventListener("load",h,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",h,!1),o.addEventListener("error",l,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),ed.add(`image:${t}`,o),s.manager.itemStart(t),o.src=t,o}}class vJ extends Ig{constructor(t){super(t)}load(t,e,i,r){const s=new qo,a=new _J(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(o){s.image=o,s.needsUpdate=!0,e!==void 0&&e(s)},i,r),s}}class XQ extends Ja{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}const F4=new Cn;class YQ{constructor(t,e,i=0,r=1/0){this.ray=new Rb(t,e),this.near=i,this.far=r,this.camera=null,this.layers=new c7,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):Sa("Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return F4.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(F4),this}intersectObject(t,e=!0,i=[]){return F2(t,this,i,e),i.sort(I4),i}intersectObjects(t,e=!0,i=[]){for(let r=0,s=t.length;r<s;r++)F2(t[r],this,i,e);return i.sort(I4),i}}function I4(n,t){return n.distance-t.distance}function F2(n,t,e,i){let r=!0;if(n.layers.test(t.layers)&&n.raycast(t,e)===!1&&(r=!1),r===!0&&i===!0){const s=n.children;for(let a=0,o=s.length;a<o;a++)F2(s[a],t,e,!0)}}class ZQ{constructor(){this.type="ShapePath",this.color=new Er,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new N2,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,r){return this.currentPath.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,s,a){return this.currentPath.bezierCurveTo(t,e,i,r,s,a),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(y){const A=[];for(let _=0,x=y.length;_<x;_++){const v=y[_],b=new bx;b.curves=v.curves,A.push(b)}return A}function i(y,A){const _=A.length;let x=!1;for(let v=_-1,b=0;b<_;v=b++){let M=A[v],T=A[b],w=T.x-M.x,E=T.y-M.y;if(Math.abs(E)>Number.EPSILON){if(E<0&&(M=A[b],w=-w,T=A[v],E=-E),y.y<M.y||y.y>T.y)continue;if(y.y===M.y){if(y.x===M.x)return!0}else{const k=E*(y.x-M.x)-w*(y.y-M.y);if(k===0)return!0;if(k<0)continue;x=!x}}else{if(y.y!==M.y)continue;if(T.x<=y.x&&y.x<=M.x||M.x<=y.x&&y.x<=T.x)return!0}}return x}const r=Ib.isClockWise,s=this.subPaths;if(s.length===0)return[];let a,o,h;const l=[];if(s.length===1)return o=s[0],h=new bx,h.curves=o.curves,l.push(h),l;let c=!r(s[0].getPoints());c=t?!c:c;const f=[],d=[];let u=[],p=0,m;d[p]=void 0,u[p]=[];for(let y=0,A=s.length;y<A;y++)o=s[y],m=o.getPoints(),a=r(m),a=t?!a:a,a?(!c&&d[p]&&p++,d[p]={s:new bx,p:m},d[p].s.curves=o.curves,c&&p++,u[p]=[]):u[p].push({h:o,p:m[0]});if(!d[0])return e(s);if(d.length>1){let y=!1,A=0;for(let _=0,x=d.length;_<x;_++)f[_]=[];for(let _=0,x=d.length;_<x;_++){const v=u[_];for(let b=0;b<v.length;b++){const M=v[b];let T=!0;for(let w=0;w<d.length;w++)i(M.p,d[w].p)&&(_!==w&&A++,T?(T=!1,f[w].push(M)):y=!0);T&&f[_].push(M)}}A>0&&y===!1&&(u=f)}let g;for(let y=0,A=d.length;y<A;y++){h=d[y].s,l.push(h),g=u[y];for(let _=0,x=g.length;_<x;_++)h.holes.push(g[_].h)}return l}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:a7}}));typeof window<"u"&&(window.__THREE__?bi("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=a7);const bJ="/ndmvr-core/assets/HnotFilled-BH6p7qTV.png";function JQ(n,t,e,{scale:i,padding:r,origin:s}){const a=n.config??{};a.environment||(a.environment={}),a.environment.histogramPads||(a.environment.histogramPads=[]);const o=a.environment.histogramPads;let h=1,l=t.length;if(typeof e=="string"){const u=e.match(/^grid(\d+)x(\d+)$/i);u?(h=parseInt(u[1],10),l=parseInt(u[2],10)):(e==="simple"||e==="flex")&&(h=1,l=t.length)}h*l<t.length&&(l=Math.ceil(Math.sqrt(t.length)),h=Math.ceil(t.length/l));let f=0,d=0;return t.forEach(u=>{const p=s.x+d*(i.x+r.x)+i.x/2,m=s.y+(h-1-f)*(i.y+r.y)+i.y/2,g=s.z-i.z/2;o.push({id:u,position:{x:p,y:m,z:g},scale:{...i},padding:{...r},origin:{...s},grid:{row:f,col:d,rows:h,cols:l,disp_kind:e}}),d++,d>=l&&(d=0,f++)}),n}function QQ(n){const t={resetHistogram:"r",goToPreviousLayer:"z",hideOutlines:"o"};n.bindings=n.bindings||{};for(const e in t)n.bindings.hasOwnProperty(e)||(n.bindings[e]=t[e]);return n}function wJ(n,t=null){const e=typeof n=="string"?JSON.parse(n):n;function i(h){if(Array.isArray(h))return h;if(h&&typeof h=="object"&&"type"in h){const l=h.prefix??"histogram",c=h.type.match(/grid(\d+)x(\d+)x(\d+)/);if(!c)return[h];const f=+c[1],d=+c[2],u=+c[3],p=h.scale||{x:1,y:1,z:1},m=h.padding||{x:0,y:0,z:0},g=h.origin||{x:0,y:0,z:0},y=new St((p.x-m.x*(f-1))/f,(p.y-m.y*(d-1))/d,(p.z-m.z*(u-1))/u),A=[];let _=1;for(let x=0;x<f;x++)for(let v=0;v<d;v++)for(let b=0;b<u;b++)A.push({id:`${l}${_++}`,position:new St(g.x+x*(y.x+m.x)+y.x/2,g.y+v*(y.y+m.y)+y.y/2,g.z-b*(y.z+m.z)-y.z/2),scale:y.clone()});return A}return[h]}function r(h){const l={};for(const c in h){const f=h[c];f&&typeof f=="object"&&"x"in f&&"y"in f&&"z"in f&&Object.keys(f).length===3?l[c]=new St(f.x,f.y,f.z):typeof f=="string"&&f.startsWith("0x")?l[c]=new Er(parseInt(f)):f&&typeof f=="object"&&!Array.isArray(f)?l[c]=r(f):l[c]=f}return l}function s(h,l=null,c=null,f=!1){if(Array.isArray(h))return f?h:h.map(d=>s(d,l,h,!1));if(h&&typeof h=="object"){if(l==="histogramPads")return i(h).map(p=>r(p));if("x"in h&&"y"in h&&"z"in h&&Object.keys(h).length===3)return new St(h.x,h.y,h.z);const d={};for(const u in h){const p=u==="histogramPads";d[u]=s(h[u],u,h,p)}return"target"in d||(d.target={entity:"*",id:"*"}),d}return typeof h=="string"&&h.startsWith("0x")?new Er(parseInt(h)):h}function a(h,l){if(!h||Array.isArray(l)||!l||typeof l!="object"||l instanceof St||l instanceof Er)return l;const c={...h};for(const f in l){const d=h[f],u=l[f];d&&typeof d=="object"&&!Array.isArray(d)&&!(d instanceof St)&&!(d instanceof Er)&&u&&typeof u=="object"&&!Array.isArray(u)&&!(u instanceof St)&&!(u instanceof Er)?c[f]=a(d,u):c[f]=u}return c}const o=s(e);return a(t,o)}function SJ(n){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))return!1;return!0}function KQ(n,t){return["scale","padding","position"].every(i=>n[i]?.x===t[i]?.x&&n[i]?.y===t[i]?.y&&n[i]?.z===t[i]?.z)}function tK(n,t){const e=new vJ().load(bJ);e.colorSpace=Sr;const i=new u7({map:e,transparent:!0}),r=new LZ(i);return r.scale.set(...n.scale),r.position.set(...n.position),r.raycast=s=>{s._triggerSource==="shiftmousedbclick"&&t()},r}class MJ{#i;constructor(t){this.#i=Tr(t)}static async parseJson(t){const e=Tr(t),i=r=>{r&&typeof r=="object"&&(r.children&&SJ(r.children)?delete r.children:r.children&&Object.values(r.children).forEach(s=>{Array.isArray(s)&&s.forEach(a=>i(a))}))};return i(e),e}computeMaxInstancesPerLayer(){if(!this.#i)return;const t=this.#i.fXaxis.fNbins*this.#i.fYaxis.fNbins*this.#i.fZaxis.fNbins;let e=[];e.push(t);const i=(r,s=1)=>{let a=0;return s>=e.length&&e.push(0),Object.entries(r).forEach((o,h)=>{o[1].forEach(l=>{l&&(a=l.fXaxis.fNbins*l.fYaxis.fNbins*l.fZaxis.fNbins,a>e[s]&&(e[s]=a),l.children&&i(l.children,s+1))})}),e};return i(this.#i.children),Promise.resolve(e)}}let wx;class TJ{#i=new Map;getStream(t){return this.#i.has(t)||this.#i.set(t,new C2(1)),this.#i.get(t).asObservable()}async next(t){if(!t.id)throw new Error("Missing id in event");if(typeof t.obj=="string")t.obj=await iZ.parseFile(t.obj);else if(typeof t.obj=="object")t.obj=await MJ.parseJson(t.obj),t.opts=t.opts||{},t.opts.config=wJ(t.opts.config);else throw new Error("Unsupported data type");this.#i.has(t.id)||this.#i.set(t.id,new C2(1)),this.#i.get(t.id).next(t)}}const eK=()=>(wx||(wx=new TJ),wx);let Sx;class EJ{#i;constructor(){this.#i=new eZ({inputDevice:"keyboard"})}getObservable(){return this.#i.asObservable()}next(t){let e=this.#i.getValue();t.inputDevice&&(e.inputDevice=t.inputDevice),this.#i.next(t)}}const CJ=()=>(Sx||(Sx=new EJ),Sx);let Mx;class PJ{#i;#r;constructor(){this.#i=document.createElement("a-entity"),this.#i.id="cameraRig",this.#i.setAttribute("position","0 1.6 0"),this.#i.innerHTML=`
|
|
4555
|
+
}`;class WQ extends Fg{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=mJ,this.fragmentShader=gJ,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=dJ(t.uniforms),this.uniformsGroups=pJ(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const r in this.uniforms){const a=this.uniforms[r].value;a&&a.isTexture?e.uniforms[r]={type:"t",value:a.toJSON(t).uuid}:a&&a.isColor?e.uniforms[r]={type:"c",value:a.getHex()}:a&&a.isVector2?e.uniforms[r]={type:"v2",value:a.toArray()}:a&&a.isVector3?e.uniforms[r]={type:"v3",value:a.toArray()}:a&&a.isVector4?e.uniforms[r]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?e.uniforms[r]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?e.uniforms[r]={type:"m4",value:a.toArray()}:e.uniforms[r]={value:a}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}const ed={enabled:!1,files:{},add:function(n,t){this.enabled!==!1&&(D4(n)||(this.files[n]=t))},get:function(n){if(this.enabled!==!1&&!D4(n))return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};function D4(n){try{const t=n.slice(n.indexOf(":")+1);return new URL(t).protocol==="blob:"}catch{return!1}}class yJ{constructor(t,e,i){const r=this;let s=!1,a=0,o=0,h;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this._abortController=null,this.itemStart=function(c){o++,s===!1&&r.onStart!==void 0&&r.onStart(c,a,o),s=!0},this.itemEnd=function(c){a++,r.onProgress!==void 0&&r.onProgress(c,a,o),a===o&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(c){r.onError!==void 0&&r.onError(c)},this.resolveURL=function(c){return h?h(c):c},this.setURLModifier=function(c){return h=c,this},this.addHandler=function(c,f){return l.push(c,f),this},this.removeHandler=function(c){const f=l.indexOf(c);return f!==-1&&l.splice(f,2),this},this.getHandler=function(c){for(let f=0,d=l.length;f<d;f+=2){const u=l[f],p=l[f+1];if(u.global&&(u.lastIndex=0),u.test(c))return p}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const AJ=new yJ;class Ig{constructor(t){this.manager=t!==void 0?t:AJ,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(t,e){const i=this;return new Promise(function(r,s){i.load(t,r,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}abort(){return this}}Ig.DEFAULT_MATERIAL_NAME="__DEFAULT";const pa={};class xJ extends Error{constructor(t,e){super(t),this.response=e}}class jQ extends Ig{constructor(t){super(t),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(t,e,i,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ed.get(`file:${t}`);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e&&e(s),this.manager.itemEnd(t)},0),s;if(pa[t]!==void 0){pa[t].push({onLoad:e,onProgress:i,onError:r});return}pa[t]=[],pa[t].push({onLoad:e,onProgress:i,onError:r});const a=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,h=this.responseType;fetch(a).then(l=>{if(l.status===200||l.status===0){if(l.status===0&&bi("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||l.body===void 0||l.body.getReader===void 0)return l;const c=pa[t],f=l.body.getReader(),d=l.headers.get("X-File-Size")||l.headers.get("Content-Length"),u=d?parseInt(d):0,p=u!==0;let m=0;const g=new ReadableStream({start(y){A();function A(){f.read().then(({done:_,value:x})=>{if(_)y.close();else{m+=x.byteLength;const v=new ProgressEvent("progress",{lengthComputable:p,loaded:m,total:u});for(let b=0,M=c.length;b<M;b++){const T=c[b];T.onProgress&&T.onProgress(v)}y.enqueue(x),A()}},_=>{y.error(_)})}}});return new Response(g)}else throw new xJ(`fetch for "${l.url}" responded with ${l.status}: ${l.statusText}`,l)}).then(l=>{switch(h){case"arraybuffer":return l.arrayBuffer();case"blob":return l.blob();case"document":return l.text().then(c=>new DOMParser().parseFromString(c,o));case"json":return l.json();default:if(o==="")return l.text();{const f=/charset="?([^;"\s]*)"?/i.exec(o),d=f&&f[1]?f[1].toLowerCase():void 0,u=new TextDecoder(d);return l.arrayBuffer().then(p=>u.decode(p))}}}).then(l=>{ed.add(`file:${t}`,l);const c=pa[t];delete pa[t];for(let f=0,d=c.length;f<d;f++){const u=c[f];u.onLoad&&u.onLoad(l)}}).catch(l=>{const c=pa[t];if(c===void 0)throw this.manager.itemError(t),l;delete pa[t];for(let f=0,d=c.length;f<d;f++){const u=c[f];u.onError&&u.onError(l)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}const xc=new WeakMap;class _J extends Ig{constructor(t){super(t)}load(t,e,i,r){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=this,a=ed.get(`image:${t}`);if(a!==void 0){if(a.complete===!0)s.manager.itemStart(t),setTimeout(function(){e&&e(a),s.manager.itemEnd(t)},0);else{let f=xc.get(a);f===void 0&&(f=[],xc.set(a,f)),f.push({onLoad:e,onError:r})}return a}const o=L2("img");function h(){c(),e&&e(this);const f=xc.get(this)||[];for(let d=0;d<f.length;d++){const u=f[d];u.onLoad&&u.onLoad(this)}xc.delete(this),s.manager.itemEnd(t)}function l(f){c(),r&&r(f),ed.remove(`image:${t}`);const d=xc.get(this)||[];for(let u=0;u<d.length;u++){const p=d[u];p.onError&&p.onError(f)}xc.delete(this),s.manager.itemError(t),s.manager.itemEnd(t)}function c(){o.removeEventListener("load",h,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",h,!1),o.addEventListener("error",l,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),ed.add(`image:${t}`,o),s.manager.itemStart(t),o.src=t,o}}class vJ extends Ig{constructor(t){super(t)}load(t,e,i,r){const s=new qo,a=new _J(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(o){s.image=o,s.needsUpdate=!0,e!==void 0&&e(s)},i,r),s}}class XQ extends Ja{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}const F4=new Cn;class YQ{constructor(t,e,i=0,r=1/0){this.ray=new Rb(t,e),this.near=i,this.far=r,this.camera=null,this.layers=new c7,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):Sa("Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return F4.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(F4),this}intersectObject(t,e=!0,i=[]){return F2(t,this,i,e),i.sort(I4),i}intersectObjects(t,e=!0,i=[]){for(let r=0,s=t.length;r<s;r++)F2(t[r],this,i,e);return i.sort(I4),i}}function I4(n,t){return n.distance-t.distance}function F2(n,t,e,i){let r=!0;if(n.layers.test(t.layers)&&n.raycast(t,e)===!1&&(r=!1),r===!0&&i===!0){const s=n.children;for(let a=0,o=s.length;a<o;a++)F2(s[a],t,e,!0)}}class ZQ{constructor(){this.type="ShapePath",this.color=new Er,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new N2,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,r){return this.currentPath.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,s,a){return this.currentPath.bezierCurveTo(t,e,i,r,s,a),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(y){const A=[];for(let _=0,x=y.length;_<x;_++){const v=y[_],b=new bx;b.curves=v.curves,A.push(b)}return A}function i(y,A){const _=A.length;let x=!1;for(let v=_-1,b=0;b<_;v=b++){let M=A[v],T=A[b],w=T.x-M.x,E=T.y-M.y;if(Math.abs(E)>Number.EPSILON){if(E<0&&(M=A[b],w=-w,T=A[v],E=-E),y.y<M.y||y.y>T.y)continue;if(y.y===M.y){if(y.x===M.x)return!0}else{const k=E*(y.x-M.x)-w*(y.y-M.y);if(k===0)return!0;if(k<0)continue;x=!x}}else{if(y.y!==M.y)continue;if(T.x<=y.x&&y.x<=M.x||M.x<=y.x&&y.x<=T.x)return!0}}return x}const r=Ib.isClockWise,s=this.subPaths;if(s.length===0)return[];let a,o,h;const l=[];if(s.length===1)return o=s[0],h=new bx,h.curves=o.curves,l.push(h),l;let c=!r(s[0].getPoints());c=t?!c:c;const f=[],d=[];let u=[],p=0,m;d[p]=void 0,u[p]=[];for(let y=0,A=s.length;y<A;y++)o=s[y],m=o.getPoints(),a=r(m),a=t?!a:a,a?(!c&&d[p]&&p++,d[p]={s:new bx,p:m},d[p].s.curves=o.curves,c&&p++,u[p]=[]):u[p].push({h:o,p:m[0]});if(!d[0])return e(s);if(d.length>1){let y=!1,A=0;for(let _=0,x=d.length;_<x;_++)f[_]=[];for(let _=0,x=d.length;_<x;_++){const v=u[_];for(let b=0;b<v.length;b++){const M=v[b];let T=!0;for(let w=0;w<d.length;w++)i(M.p,d[w].p)&&(_!==w&&A++,T?(T=!1,f[w].push(M)):y=!0);T&&f[_].push(M)}}A>0&&y===!1&&(u=f)}let g;for(let y=0,A=d.length;y<A;y++){h=d[y].s,l.push(h),g=u[y];for(let _=0,x=g.length;_<x;_++)h.holes.push(g[_].h)}return l}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:a7}}));typeof window<"u"&&(window.__THREE__?bi("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=a7);const bJ="/ndmvr-core/assets/HnotFilled-BH6p7qTV.png";function JQ(n,t,e,{scale:i,padding:r,origin:s}){const a=n.config??{};a.environment||(a.environment={}),a.environment.histogramPads||(a.environment.histogramPads=[]);const o=a.environment.histogramPads;let h=1,l=t.length;if(typeof e=="string"){const u=e.match(/^grid(\d+)x(\d+)$/i);u?(h=parseInt(u[1],10),l=parseInt(u[2],10)):(e==="simple"||e==="flex")&&(h=1,l=t.length)}h*l<t.length&&(l=Math.ceil(Math.sqrt(t.length)),h=Math.ceil(t.length/l));let f=0,d=0;return t.forEach(u=>{const p=s.x+d*(i.x+r.x)+i.x/2,m=s.y+(h-1-f)*(i.y+r.y)+i.y/2,g=s.z-i.z/2;o.push({id:u,position:{x:p,y:m,z:g},scale:{...i},padding:{...r},origin:{...s},grid:{row:f,col:d,rows:h,cols:l,disp_kind:e}}),d++,d>=l&&(d=0,f++)}),n}function QQ(n){const t={resetHistogram:"r",goToPreviousLayer:"z",hideOutlines:"o"};n.bindings=n.bindings||{};for(const e in t)n.bindings.hasOwnProperty(e)||(n.bindings[e]=t[e]);return n}function wJ(n,t=null){const e=typeof n=="string"?JSON.parse(n):n;function i(h){if(Array.isArray(h))return h;if(h&&typeof h=="object"&&"type"in h){const l=h.prefix??"histogram",c=h.type.match(/grid(\d+)x(\d+)x(\d+)/);if(!c)return[h];const f=+c[1],d=+c[2],u=+c[3],p=h.scale||{x:1,y:1,z:1},m=h.padding||{x:0,y:0,z:0},g=h.origin||{x:0,y:0,z:0},y=new St((p.x-m.x*(f-1))/f,(p.y-m.y*(d-1))/d,(p.z-m.z*(u-1))/u),A=[];let _=1;for(let x=0;x<f;x++)for(let v=0;v<d;v++)for(let b=0;b<u;b++)A.push({id:`${l}${_++}`,position:new St(g.x+x*(y.x+m.x)+y.x/2,g.y+v*(y.y+m.y)+y.y/2,g.z-b*(y.z+m.z)-y.z/2),scale:y.clone()});return A}return[h]}function r(h){const l={};for(const c in h){const f=h[c];f&&typeof f=="object"&&"x"in f&&"y"in f&&"z"in f&&Object.keys(f).length===3?l[c]=new St(f.x,f.y,f.z):typeof f=="string"&&f.startsWith("0x")?l[c]=new Er(parseInt(f)):f&&typeof f=="object"&&!Array.isArray(f)?l[c]=r(f):l[c]=f}return l}function s(h,l=null,c=null,f=!1){if(Array.isArray(h))return f?h:h.map(d=>s(d,l,h,!1));if(h&&typeof h=="object"){if(l==="histogramPads")return i(h).map(p=>r(p));if("x"in h&&"y"in h&&"z"in h&&Object.keys(h).length===3)return new St(h.x,h.y,h.z);const d={};for(const u in h){const p=u==="histogramPads";d[u]=s(h[u],u,h,p)}return"target"in d||(d.target={entity:"*",id:"*"}),d}return typeof h=="string"&&h.startsWith("0x")?new Er(parseInt(h)):h}function a(h,l){if(!h||Array.isArray(l)||!l||typeof l!="object"||l instanceof St||l instanceof Er)return l;const c={...h};for(const f in l){const d=h[f],u=l[f];d&&typeof d=="object"&&!Array.isArray(d)&&!(d instanceof St)&&!(d instanceof Er)&&u&&typeof u=="object"&&!Array.isArray(u)&&!(u instanceof St)&&!(u instanceof Er)?c[f]=a(d,u):c[f]=u}return c}const o=s(e);return a(t,o)}function SJ(n){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))return!1;return!0}function KQ(n,t){return["scale","padding","position"].every(i=>n[i]?.x===t[i]?.x&&n[i]?.y===t[i]?.y&&n[i]?.z===t[i]?.z)}function tK(n,t){const e=new vJ().load(bJ);e.colorSpace=Sr;const i=new u7({map:e,transparent:!0}),r=new LZ(i);return r.scale.set(...n.scale),r.position.set(...n.position),r.raycast=s=>{s._triggerSource==="shiftmousedbclick"&&t()},r}class MJ{#i;constructor(t){this.#i=Tr(t)}static async parseJson(t){const e=Tr(t),i=r=>{r&&typeof r=="object"&&(r.children&&SJ(r.children)?delete r.children:r.children&&Object.values(r.children).forEach(s=>{Array.isArray(s)&&s.forEach(a=>i(a))}))};return i(e),e}computeMaxInstancesPerLayer(){if(!this.#i)return;const t=this.#i.fXaxis.fNbins*this.#i.fYaxis.fNbins*this.#i.fZaxis.fNbins;let e=[];e.push(t);const i=(r,s=1)=>{let a=0;return s>=e.length&&e.push(0),Object.entries(r).forEach((o,h)=>{o[1].forEach(l=>{l&&(a=l.fXaxis.fNbins*l.fYaxis.fNbins*l.fZaxis.fNbins,a>e[s]&&(e[s]=a),l.children&&i(l.children,s+1))})}),e};return i(this.#i.children),Promise.resolve(e)}}let wx;class TJ{#i=new Map;getStream(t){return this.#i.has(t)||this.#i.set(t,new C2(1)),console.log("histogramSubjectGet with id: ",t),this.#i.get(t).asObservable()}async next(t){if(console.log("histogramSubjectNext with id: ",t.id," and event: ",t),!t.id)throw new Error("Missing id in event");if(typeof t.obj=="string")t.obj=await iZ.parseFile(t.obj);else if(typeof t.obj=="object")t.obj=await MJ.parseJson(t.obj),t.opts=t.opts||{},t.opts.config=wJ(t.opts.config);else throw new Error("Unsupported data type");this.#i.has(t.id)||this.#i.set(t.id,new C2(1)),this.#i.get(t.id).next(t)}}const eK=()=>(wx||(wx=new TJ),wx);let Sx;class EJ{#i;constructor(){this.#i=new eZ({inputDevice:"keyboard"})}getObservable(){return this.#i.asObservable()}next(t){let e=this.#i.getValue();t.inputDevice&&(e.inputDevice=t.inputDevice),this.#i.next(t)}}const CJ=()=>(Sx||(Sx=new EJ),Sx);let Mx;class PJ{#i;#r;constructor(){this.#i=document.createElement("a-entity"),this.#i.id="cameraRig",this.#i.setAttribute("position","0 1.6 0"),this.#i.innerHTML=`
|
|
4556
4556
|
<a-camera id="camera" wasd-controls-custom="acceleration: 10" wasd-controls="acceleration: 50">
|
|
4557
4557
|
</a-camera>
|
|
4558
4558
|
`,this.#r=document.createElement("a-entity"),this.#r.id="oculus-controller",this.#r.setAttribute("oculus-controller",""),CJ().getObservable().subscribe(this.handleStateChange.bind(this))}handleStateChange(t){const e=document.getElementById("cameraRig");if(t.inputDevice==="oculus"){if(!e||e.contains(this.#r))return;e.appendChild(this.#r)}else{if(!e||!e.contains(this.#r))return;e.removeChild(this.#r)}}getCamera(){return this.#i}}const kJ=()=>(Mx||(Mx=new PJ),Mx.getCamera());function iK(){const n=document.createElement("div");n.id="container";const t=LJ();return n.appendChild(t),t}function LJ(){const n=document.createElement("a-scene");n.id="a-min-scene",n.setAttribute("stats",""),n.setAttribute("ndmvr-raycaster",""),n.style.cssText="height: 100%; width: 100%";const t=document.createElement("a-sky");t.setAttribute("color","#ffffff");const e=kJ();return n.appendChild(e),n.appendChild(t),n}class Tx{constructor(t,e,i,r){this.url=t,this.ws=null,this.channel=i,this.connected=!1,this.connecting=!1,this.intentionalDisconnect=!1,this.reconnectAttempts=0,this.maxReconnectAttempts=10,this.reconnectTimeout=null,this.initTime=Date.now(),this.timeout=r||6e4,this.timeFlag=!0,e&&this.connect()}connect(){if(this.ws&&(this.ws.readyState===WebSocket.CONNECTING||this.ws.readyState===WebSocket.OPEN))return console.log("WebSocket already connecting/connected to: "+this.url),this;this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.intentionalDisconnect=!1,this.connecting=!0,console.log("Trying to establish websocket connection on address: "+this.url);try{this.ws=new WebSocket(this.url)}catch(t){return console.error("Failed to create WebSocket:",t),this.connecting=!1,this.emitConnectionEvent("error",{error:t}),this}return this.ws.onopen=()=>{console.log("Websocket connection established on address: "+this.url),this.connected=!0,this.connecting=!1,this.reconnectAttempts=0,this.timeFlag=!1,this.emitConnectionEvent("connected",{url:this.url})},this.ws.onmessage=t=>{this.channel.next(t.data)},this.ws.onerror=t=>{console.error("WebSocket error on "+this.url+":",t),this.connecting=!1,this.timeFlag||(this.initTime=Date.now(),this.timeFlag=!0),this.emitConnectionEvent("error",{url:this.url,event:t}),!this.intentionalDisconnect&&this.shouldReconnect()&&this.scheduleReconnect()},this.ws.onclose=t=>{console.log("WebSocket closed on "+this.url+", code: "+t.code+", reason: "+t.reason);const e=this.connected;this.connected=!1,this.connecting=!1,this.ws=null,this.timeFlag||(this.initTime=Date.now(),this.timeFlag=!0),this.emitConnectionEvent("closed",{url:this.url,code:t.code,reason:t.reason,wasConnected:e}),!this.intentionalDisconnect&&this.shouldReconnect()&&this.scheduleReconnect()},this}shouldReconnect(){const t=this.initTime+this.timeout<Date.now(),e=this.reconnectAttempts>=this.maxReconnectAttempts;return!t&&!e}scheduleReconnect(){if(this.reconnectTimeout)return;this.reconnectAttempts++;const t=Math.min(500*this.reconnectAttempts,5e3);console.log(`Scheduling reconnect attempt ${this.reconnectAttempts} in ${t}ms for ${this.url}`),this.reconnectTimeout=setTimeout(()=>{this.reconnectTimeout=null,this.intentionalDisconnect||this.connect()},t)}disconnect(){this.intentionalDisconnect=!0,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&((this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)&&this.ws.close(1e3,"Client disconnect"),this.ws=null),this.connected=!1,this.connecting=!1,this.reconnectAttempts=0}isConnected(){return this.connected&&this.ws&&this.ws.readyState===WebSocket.OPEN}isConnecting(){return this.connecting||this.ws&&this.ws.readyState===WebSocket.CONNECTING}getState(){if(!this.ws)return"CLOSED";switch(this.ws.readyState){case WebSocket.CONNECTING:return"CONNECTING";case WebSocket.OPEN:return"OPEN";case WebSocket.CLOSING:return"CLOSING";case WebSocket.CLOSED:return"CLOSED";default:return"UNKNOWN"}}emitConnectionEvent(t,e){const i={_brokerEvent:!0,type:t,url:this.url,timestamp:Date.now(),...e};this.channel.next(JSON.stringify(i))}send(t){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.warn("Cannot send: WebSocket not open");return}this.ws.send(t)}subscribe(t){return this.channel.subscribe({next:i=>t(i)})}unsubscribe(t){t.unsubscribe()}}let Ex;class NJ{#i;#r;constructor(){this.#i=new C2(1),this.#r=new Map}createWsFromParams=t=>{const e=t.get("autoConnect")==="true",i=Number(t.get("timeout"));t.getAll("ws").forEach(r=>{this.createWs(r,e,i)})};createWs=(t,e,i)=>{this.#r.has(t)&&this.#r.delete(t);const r=new Tx(t,e,this.#i,i);this.#r.set(t,r)};getBrokerByUrl=(t,e)=>{let i=this.#r.get(t);return i?e&&!i.isConnected()&&!i.isConnecting()&&i.connect():(i=new Tx(t,e,this.#i),this.#r.set(t,i)),i};connectWsByUrl=t=>{let e=this.#r.get(t);return e||(e=new Tx(t,!0,this.#i),this.#r.set(t,e)),e.connect(),e};disconnectWsByUrl=t=>{if(t){const e=this.#r.get(t);e&&e.disconnect()}else this.#r.forEach(e=>{e.disconnect()})};removeBrokerByUrl=t=>{const e=this.#r.get(t);e&&(e.disconnect(),this.#r.delete(t))};getBrokerStatus=t=>{const e=this.#r.get(t);return e?{exists:!0,connected:e.isConnected(),connecting:e.isConnecting(),state:e.getState(),url:e.url}:{exists:!1}};getAllBrokersStatus=()=>{const t={};return this.#r.forEach((e,i)=>{t[i]={connected:e.isConnected(),connecting:e.isConnecting(),state:e.getState()}}),t};getSubject=()=>this.#i}const RJ=()=>(Ex||(Ex=new NJ),Ex),nK=()=>{RJ().createWsFromParams(new URL(window.location.href).searchParams)};export{Bn as $,$Q as A,eZ as B,Er as C,UQ as D,u0 as E,jQ as F,qQ as G,WQ as H,XQ as I,tK as J,QQ as K,Ig as L,NZ as M,KQ as N,W5 as O,w7 as P,Br as Q,C2 as R,r7 as S,vJ as T,CJ as U,St as V,nK as W,iK as X,RJ as Y,Tr as Z,Xf as _,BQ as a,qE as a$,KG as a0,WG as a1,Ne as a2,r6 as a3,Of as a4,lt as a5,mg as a6,Vn as a7,Ff as a8,Y4 as a9,tt as aA,RV as aB,z2 as aC,HS as aD,ji as aE,BT as aF,um as aG,GE as aH,Co as aI,IG as aJ,Pt as aK,dD as aL,yv as aM,Pr as aN,Im as aO,th as aP,ps as aQ,ld as aR,Xi as aS,j1 as aT,Gu as aU,GJ as aV,X1 as aW,od as aX,W1 as aY,Q4 as aZ,J4 as a_,X4 as aa,sr as ab,Rm as ac,ir as ad,K as ae,eh as af,om as ag,nP as ah,eT as ai,eP as aj,tT as ak,Je as al,se as am,sa as an,DQ as ao,Y$ as ap,Kt as aq,U2 as ar,Xa as as,q4 as at,V4 as au,iP as av,Q as aw,RQ as ax,Go as ay,VJ as az,OQ as b,Fu as b$,ga as b0,C1 as b1,kf as b2,n0 as b3,Ql as b4,w1 as b5,yC as b6,Sn as b7,MH as b8,SH as b9,vs as bA,EV as bB,f1 as bC,FS as bD,wV as bE,TV as bF,Se as bG,LV as bH,q2 as bI,V2 as bJ,iT as bK,G1 as bL,Re as bM,kr as bN,Sl as bO,Nc as bP,GV as bQ,VV as bR,I2 as bS,gd as bT,DJ as bU,OJ as bV,IJ as bW,a6 as bX,zJ as bY,rP as bZ,GG as b_,Ct as ba,Ee as bb,Ci as bc,ba as bd,pw as be,pr as bf,Gv as bg,br as bh,Lo as bi,ih as bj,Ma as bk,$o as bl,SC as bm,Ic as bn,Wv as bo,Xd as bp,G2 as bq,qJ as br,yu as bs,Li as bt,Be as bu,zs as bv,Zi as bw,DS as bx,CV as by,PV as bz,M2 as c,$G as c$,BJ as c0,SV as c1,MD as c2,TD as c3,o6 as c4,n1 as c5,lr as c6,mv as c7,Rl as c8,j4 as c9,qS as cA,jm as cB,hr as cC,fr as cD,n$ as cE,Ad as cF,Hv as cG,wl as cH,$d as cI,dv as cJ,cr as cK,Xx as cL,$l as cM,UJ as cN,Dn as cO,Hc as cP,H1 as cQ,KE as cR,hf as cS,UE as cT,e1 as cU,lh as cV,id as cW,a$ as cX,Io as cY,fD as cZ,jv as c_,$4 as ca,sd as cb,W4 as cc,H4 as cd,un as ce,JE as cf,ue as cg,Ta as ch,gv as ci,Uc as cj,ZE as ck,iG as cl,qc as cm,UT as cn,No as co,fv as cp,Qt as cq,Gd as cr,Cx as cs,bC as ct,Pn as cu,Ha as cv,Ti as cw,i$ as cx,UN as cy,qT as cz,Bd as d,Cr as d0,Ai as d1,HG as d2,oP as d3,IQ as e,zQ as f,_e as g,JQ as h,Ba as i,YQ as j,VQ as k,qo as l,X8 as m,ZQ as n,YY as o,wJ as p,Lb as q,HY as r,Nt as s,FQ as t,d0 as u,eK as v,kJ as w,p7 as x,HQ as y,GQ as z};
|