UNPKG

jsrootdi

Version:
2 lines 573 kB
// https://root.cern/js/ v7.6.101 !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).JSROOT=t.JSROOT||{})}(this,(function(t){"use strict";const e="dev 8/05/2024",i=!!("object"==typeof process&&It(process.versions)&&process.versions.node&&process.versions.v8),n={id_counter:1},s="undefined"==typeof document&&"undefined"==typeof location?void 0:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("jsroot.js",document.baseURI).href;let r="";if(s&&Xt(s)){const t=s.indexOf("modules/core.mjs");t>=0?(r=s.slice(0,t),i||console.log(`Set jsroot source_dir to ${r}, ${e}`)):(i||console.log(`jsroot bundle, ${e}`),n.ignore_v6=!0)}let a=i;function o(){return a}function h(){return i}const l=h()?t=>Buffer.from(t,"base64").toString("latin1"):globalThis?.atob,c=h()?t=>Buffer.from(t,"latin1").toString("base64"):globalThis?.btoa,f={isFirefox:!0,isSafari:!1,isChrome:!1,isWin:!1,touches:!1,screenWidth:1200};function d(t){if(t.length<14||0!==t.indexOf("[object "))return 0;const e=t.indexOf("Array]");return e<0||e!==t.length-6?0:14===t.length?1:2}"undefined"!=typeof document&&"undefined"!=typeof window&&"undefined"!=typeof navigator&&(navigator.userAgentData?.brands?.forEach((t=>{"HeadlessChrome"===t.brand?(f.isChromeHeadless=!0,f.chromeVersion=parseInt(t.version)):"Chromium"===t.brand&&(f.isChrome=!0,f.chromeVersion=parseInt(t.version))})),f.chromeVersion?(f.isFirefox=!1,f.isWin="Windows"===navigator.userAgentData.platform):(f.isFirefox=navigator.userAgent.indexOf("Firefox")>=0,f.isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,f.isChrome=!!window.chrome,f.isChromeHeadless=navigator.userAgent.indexOf("HeadlessChrome")>=0,f.chromeVersion=f.isChrome||f.isChromeHeadless?parseInt(navigator.userAgent.match(/Chrom(?:e|ium)\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/)[1]):0,f.isWin=navigator.userAgent.indexOf("Windows")>=0),f.touches="ontouchend"in document,f.screenWidth=window.screen?.width??1200);const u={Render3D:{Default:0,WebGL:1,WebGLImage:2,SVG:3,fromString(t){return"webgl"===t||"gl"===t?this.WebGL:"img"===t?this.WebGLImage:"svg"===t?this.SVG:this.Default}},Embed3D:{NoEmbed:-1,Default:0,Overlay:1,Embed:2,EmbedSVG:3,fromString(t){return"embed"===t?this.Embed:"overlay"===t?this.Overlay:this.Default}},Latex:{Off:0,Symbols:1,Normal:2,MathJax:3,AlwaysMathJax:4,fromString(t){if(!t||!Xt(t))return this.Normal;switch(t){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 e=parseInt(t);return Number.isInteger(e)&&e>=this.Off&&e<=this.AlwaysMathJax?e:this.Normal}}},g={Render3D:u.Render3D.Default,Render3DBatch:u.Render3D.Default,Embed3D:u.Embed3D.Default,Tooltip:!i,TooltipAnimation:500,ContextMenu:!i,Zooming:!i,ZoomMouse:!i,ZoomWheel:!i,ZoomTouch:!i,MoveResize:!f.touches&&!i,HandleKeys:!i,DragAndDrop:!i,DragGraphs:!0,ProgressBox:!i,ToolBar:!i&&"popup",ToolBarSide:"left",ToolBarVert:!1,CanEnlarge:!0,CanAdjustFrame:!1,ApproxTextSize:!1,OptimizeDraw:1,AutoStat:!0,FrameNDC:{},SmallPad:{width:150,height:100},Palette:57,Latex:u.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:!0,MaxRanges:200,WithCredentials:!1,SkipStreamerInfos:!1,OnlyLastCycle:!1,DarkMode:!1,PreferSavedPoints:!1,AxisTiltAngle:25,StripAxisLabels:!0,FuncAsCurve:!1,TimeZone:"",NewTabUrl:"",NewTabUrlPars:"",NewTabUrlExportSettings:!1},p={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,fHatchesLineWidth:1,fHatchesSpacing:1,fCandleWhiskerRange:1,fCandleBoxRange:.5,fCandleScaled:!1,fViolinScaled:!0,fOrthoCamera:!1,fXAxisExpXOffset:0,fXAxisExpYOffset:0,fYAxisExpXOffset:0,fYAxisExpYOffset:0,fAxisMaxDigits:5,fStripDecimals:!0,fBarWidth:1};function m(){return i?n.nodejs_document:"undefined"!=typeof document?document:"object"==typeof window?window.document:void 0}async function x(t){if(i){let e,i;return Promise.resolve().then((function(){return Wd})).then((t=>(e=t.tmpNameSync()+".js",Promise.resolve().then((function(){return Wd}))))).then((n=>(i=n,i.writeFileSync(e,t),import("file://"+e)))).finally((()=>i.unlinkSync(e)))}if("undefined"!=typeof document){const e=document.getElementsByTagName("script");for(let i=0;i<e.length;++i)if(e[i].innerHTML===t)return!0;return(t.indexOf("JSROOT.require")>=0?async function(){return(globalThis.JSROOT?Promise.resolve(!0):_(r+"scripts/JSRoot.core.js")).then((()=>{if(globalThis.JSROOT?._complete_loading)return globalThis.JSROOT._complete_loading()})).then((()=>globalThis.JSROOT))}():Promise.resolve(!0)).then((()=>{const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.innerHTML=t,document.head.appendChild(e),Ht(!0,10)}))}return!1}async function _(t){if(!t)return!0;if(Xt(t)&&t.indexOf(";")>=0&&(t=t.split(";")),!Xt(t)){const e=t,i=()=>!e.length||_(e.shift()).then(i,i);return i()}0===t.indexOf("$$$")&&(0===(t=t.slice(3)).indexOf("style/")&&t.indexOf(".css")<0&&(t+=".css"),t=r+t);const e=t.indexOf(".css")>0;if(i)return e?null:0===t.indexOf("http:")||0===t.indexOf("https:")?k(t,"text").then((t=>x(t))):0===t.indexOf("./")?Promise.resolve().then((function(){return Wd})).then((e=>x(e.readFileSync(t)))):import(t);const n=e=>{if(e===t)return!0;const i=e.indexOf(t);return i>0&&i+t.length===e.length&&"/"===e[i-1]};if(e){const t=document.getElementsByTagName("link");for(let e=0;e<t.length;++e)if(t[e].href&&"text/css"===t[e].type&&"stylesheet"===t[e].rel&&n(t[e].href))return!0}else{const t=document.getElementsByTagName("script");for(let e=0;e<t.length;++e)if(n(t[e].src))return!0}let s;return e?(s=document.createElement("link"),s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("href",t)):(s=document.createElement("script"),s.setAttribute("type","text/javascript"),s.setAttribute("src",t)),new Promise(((e,i)=>{s.onload=()=>e(!0),s.onerror=()=>{s.remove(),i(Error(`Fail to load ${t}`))},document.head.appendChild(s)}))}function y(t){return 1<<t}function b(t,e,i){if(!t)return null;if(e){const i=e.obj.indexOf(t);if(i>=0)return e.clones[i]}else e={obj:[],clones:[],nofunc:i};const n=d(Object.prototype.toString.apply(t));if(1===n){const i=[];e.obj.push(t),e.clones.push(i);for(let n=0;n<t.length;++n)i.push(It(t[n])?b(t[n],e):t[n]);return i}if(2===n){const i=[];e.obj.push(t),e.clones.push(i);for(let e=0;e<t.length;++e)i.push(t[e]);return i}const s={};e.obj.push(t),e.clones.push(s);for(const i in t)It(t[i])?s[i]=b(t[i],e):e.nofunc&&Et(t[i])||(s[i]=t[i]);return s}const v=Object.assign;function w(t,e){v(t,function(t,e){let i=jt[t];const n=void 0!==i;n||(i={});t!==S&&t!==P&&void 0===e?.fBits||void 0===i.TestBit&&(i.TestBit=function(t){return!!(this.fBits&t)},i.InvertBit=function(t){this.fBits=this.fBits^16777215&t});if(n)return i;t!==z&&t!==F||(i.Clear=function(){this.arr=[],this.opt=[]},i.Add=function(t,e){this.arr.push(t),this.opt.push(Xt(e)?e:"")},i.AddFirst=function(t,e){this.arr.unshift(t),this.opt.unshift(Xt(e)?e:"")},i.RemoveAt=function(t){this.arr.splice(t,1),this.opt.splice(t,1)});t!==R&&t!==G||(i.AddText=function(t){const e=Lt(tt);e.fTitle=t,e.fTextAlign=0,e.fTextColor=0,e.fTextFont=0,e.fTextSize=0,this.fLines.Add(e)},i.Clear=function(){this.fLines.Clear()});0!==t.indexOf(wt)&&t!==Mt||(i.addFormula=function(t){t&&(void 0===this.formulas&&(this.formulas=[]),this.formulas.push(t))},i.GetParName=function(t){if(this.fParams?.fParNames)return this.fParams.fParNames[t];if(this.fFormula?.fParams)for(let e=0,i=this.fFormula.fParams;e<i.length;++e)if(i[e].second===t)return i[e].first;return this.fNames&&this.fNames[t]?this.fNames[t]:`p${t}`},i.GetParValue=function(t){return this.fParams?.fParameters?this.fParams.fParameters[t]:this.fFormula?.fClingParameters?this.fFormula.fClingParameters[t]:this.fParams?this.fParams[t]:void 0},i.GetParError=function(t){return this.fParErrors?this.fParErrors[t]:void 0},i.GetNumPars=function(){return this.fNpar});0!==t.indexOf(j)&&t!==E||t===X||t===Y||(i.IsInside=function(t,e){const i=this.fX,n=this.fY;let s=0,r=this.fNpoints-1,a=!1;for(;s<this.fNpoints;++s)(n[s]<e&&n[r]>=e||n[r]<e&&n[s]>=e)&&i[s]+(e-n[s])/(n[r]-n[s])*(i[r]-i[s])<t&&(a=!a),r=s;return a});0!==t.indexOf(pt)&&0!==t.indexOf(_t)&&0!==t.indexOf(vt)||(i.getBinError=function(t){return t>=this.fNcells&&(t=this.fNcells-1),t<0&&(t=0),t<this.fSumw2.length?Math.sqrt(this.fSumw2[t]):Math.sqrt(Math.abs(this.fArray[t]))},i.setBinContent=function(t,e){this.fEntries++,this.fTsumw=0,t>=0&&t<this.fArray.length&&(this.fArray[t]=e)});0===t.indexOf(pt)&&(i.getBin=function(t){return t},i.getBinContent=function(t){return this.fArray[t]},i.Fill=function(t,e){const i=this.fXaxis,n=Math.max(0,1+Math.min(i.fNbins,Math.floor((t-i.fXmin)/(i.fXmax-i.fXmin)*i.fNbins)));this.fArray[n]+=e??1,this.fEntries++});0===t.indexOf(_t)&&(i.getBin=function(t,e){return t+(this.fXaxis.fNbins+2)*e},i.getBinContent=function(t,e){return this.fArray[this.getBin(t,e)]},i.Fill=function(t,e,i){const n=this.fXaxis,s=this.fYaxis,r=Math.max(0,1+Math.min(n.fNbins,Math.floor((t-n.fXmin)/(n.fXmax-n.fXmin)*n.fNbins))),a=Math.max(0,1+Math.min(s.fNbins,Math.floor((e-s.fXmin)/(s.fXmax-s.fXmin)*s.fNbins)));this.fArray[r+(n.fNbins+2)*a]+=i??1,this.fEntries++});0===t.indexOf(vt)&&(i.getBin=function(t,e,i){return t+(this.fXaxis.fNbins+2)*(e+(this.fYaxis.fNbins+2)*i)},i.getBinContent=function(t,e,i){return this.fArray[this.getBin(t,e,i)]},i.Fill=function(t,e,i,n){const s=this.fXaxis,r=this.fYaxis,a=this.fZaxis,o=Math.max(0,1+Math.min(s.fNbins,Math.floor((t-s.fXmin)/(s.fXmax-s.fXmin)*s.fNbins))),h=Math.max(0,1+Math.min(r.fNbins,Math.floor((e-r.fXmin)/(r.fXmax-r.fXmin)*r.fNbins))),l=Math.max(0,1+Math.min(a.fNbins,Math.floor((i-a.fXmin)/(a.fXmax-a.fXmin)*a.fNbins)));this.fArray[o+(s.fNbins+2)*(h+(r.fNbins+2)*l)]+=n??1,this.fEntries++});t!==ht&&t!==lt||(i.Divide=function(t,e,i=.01,n=.01){if(!e){const i=t;if(i<2)return this;(t=e=Math.round(Math.sqrt(i)))*e<i&&(t+=1)}if(t*e<2)return 0;this.fPrimitives.Clear();const s=1/e,r=1/t;let a=0;for(let o=0;o<e;o++){const e=1-o*s-n;let h=e-s+2*n;if(h<0&&(h=0),!(h>e))for(let n=0;n<t;n++){const t=n*r+i,s=t+r-2*i;if(t>s)continue;a++;const o=Lt(ht);o.fName=o.fTitle=`${this.fName}_${a}`,o.fNumber=a,this._typename!==lt?(o.fAbsWNDC=(s-t)*this.fAbsWNDC,o.fAbsHNDC=(e-h)*this.fAbsHNDC,o.fAbsXlowNDC=this.fAbsXlowNDC+t*this.fAbsWNDC,o.fAbsYlowNDC=this.fAbsYlowNDC+h*this.fAbsWNDC):(o.fAbsWNDC=s-t,o.fAbsHNDC=e-h,o.fAbsXlowNDC=t,o.fAbsYlowNDC=h),this.fPrimitives.Add(o)}}return t*e},i.GetPad=function(t){return this.fPrimitives.arr.find((e=>e._typename===ht&&e.fNumber===t))});0===t.indexOf(Tt)&&(t===St?(i.getBin=function(t,e,i){return t+(this.fXaxis.fNbins+2)*(e+(this.fYaxis.fNbins+2)*i)},i.getBinContent=function(t,e,i){const n=this.getBin(t,e,i);return n<0||n>=this.fNcells||this.fBinEntries[n]<1e-300?0:this.fArray?this.fArray[n]/this.fBinEntries[n]:0},i.getBinEntries=function(t,e,i){const n=this.getBin(t,e,i);return n<0||n>=this.fNcells?0:this.fBinEntries[n]}):t===kt?(i.getBin=function(t,e){return t+(this.fXaxis.fNbins+2)*e},i.getBinContent=function(t,e){const i=this.getBin(t,e);return i<0||i>=this.fNcells||this.fBinEntries[i]<1e-300?0:this.fArray?this.fArray[i]/this.fBinEntries[i]:0},i.getBinEntries=function(t,e){const i=this.getBin(t,e);return i<0||i>=this.fNcells?0:this.fBinEntries[i]}):(i.getBin=function(t){return t},i.getBinContent=function(t){return t<0||t>=this.fNcells||this.fBinEntries[t]<1e-300?0:this.fArray?this.fArray[t]/this.fBinEntries[t]:0}),i.getBinEffectiveEntries=function(t){if(t<0||t>=this.fNcells)return 0;const e=this.fBinEntries[t];if(!this.fBinSumw2||this.fBinSumw2.length!==this.fNcells)return e;const i=this.fBinSumw2[t];return i>0?e*e/i:0},i.getBinError=function(t){if(t<0||t>=this.fNcells)return 0;const e=this.fArray[t],i=this.fBinEntries[t],n=this.fSumw2[t],s=this.getBinEffectiveEntries(t);if(i<1e-300)return 0;const r={kERRORMEAN:0,kERRORSPREAD:1,kERRORSPREADI:2,kERRORSPREADG:3};if(this.fErrorMode===r.kERRORSPREADG)return 1/Math.sqrt(i);const a=e/i,o=Math.sqrt(Math.abs(n/i-a**2));return this.fErrorMode===r.kERRORSPREADI?0!==o?o/Math.sqrt(s):1/Math.sqrt(12*s):this.fErrorMode===r.kERRORSPREAD?o:o/Math.sqrt(s)});t===gt&&(i.GetBinLowEdge=function(t){return this.fNbins<=0?0:this.fXbins.length>0&&t>0&&t<=this.fNbins?this.fXbins[t-1]:this.fXmin+(t-1)*(this.fXmax-this.fXmin)/this.fNbins},i.GetBinCenter=function(t){return this.fNbins<=0?0:this.fXbins.length>0&&t>0&&t<this.fNbins?(this.fXbins[t-1]+this.fXbins[t])/2:this.fXmin+(t-.5)*(this.fXmax-this.fXmin)/this.fNbins});0===t.indexOf("ROOT::Math::LorentzVector")&&(i.Px=i.X=function(){return this.fCoordinates.Px()},i.Py=i.Y=function(){return this.fCoordinates.Py()},i.Pz=i.Z=function(){return this.fCoordinates.Pz()},i.E=i.T=function(){return this.fCoordinates.E()},i.M2=function(){return this.fCoordinates.M2()},i.M=function(){return this.fCoordinates.M()},i.R=i.P=function(){return this.fCoordinates.R()},i.P2=function(){return this.P()*this.P()},i.Pt=i.pt=function(){return Math.sqrt(this.P2())},i.Phi=i.phi=function(){return Math.atan2(this.fCoordinates.Py(),this.fCoordinates.Px())},i.Eta=i.eta=function(){return Math.atanh(this.Pz()/this.P())});0===t.indexOf("ROOT::Math::PxPyPzE4D")&&(i.Px=i.X=function(){return this.fX},i.Py=i.Y=function(){return this.fY},i.Pz=i.Z=function(){return this.fZ},i.E=i.T=function(){return this.fT},i.P2=function(){return this.fX**2+this.fY**2+this.fZ**2},i.R=i.P=function(){return Math.sqrt(this.P2())},i.Mag2=i.M2=function(){return this.fT**2-this.fX**2-this.fY**2-this.fZ**2},i.Mag=i.M=function(){return this.M2()>=0?Math.sqrt(this.M2()):-Math.sqrt(-this.M2())},i.Perp2=i.Pt2=function(){return this.fX**2+this.fY**2},i.Pt=i.pt=function(){return Math.sqrt(this.P2())},i.Phi=i.phi=function(){return Math.atan2(this.fY,this.fX)},i.Eta=i.eta=function(){return Math.atanh(this.Pz/this.P())});return jt[t]=i,i}(e||t._typename,t))}function M(t){if(!t)return null;const e=Xt(t)?JSON.parse(t):t,i=[];let n;const s=t=>{if(null==t)return;if(Xt(t)){if(n||t.length<6||0!==t.indexOf("$ref:"))return;const e=parseInt(t.slice(5));if(!Number.isInteger(e)||e<0||e>=i.length)return;return n=!1,i[e]}if("object"!=typeof t)return;if(d(Object.prototype.toString.apply(t))>0){for(let e=0;e<t.length;++e){const i=s(t[e]);void 0!==i&&(t[e]=i)}return}const e=Object.keys(t),r=e.length;if(!1!==n&&1===r&&"$ref"===e[0]){const e=parseInt(t.$ref);if(!Number.isInteger(e)||e<0||e>=i.length)return;return n=!0,i[e]}if(!1!==n&&r>1&&"$arr"===e[0]&&"len"===e[1]){let i;switch(t.$arr){case"Int8":i=new Int8Array(t.len);break;case"Uint8":i=new Uint8Array(t.len);break;case"Int16":i=new Int16Array(t.len);break;case"Uint16":i=new Uint16Array(t.len);break;case"Int32":i=new Int32Array(t.len);break;case"Uint32":i=new Uint32Array(t.len);break;case"Float32":i=new Float32Array(t.len);break;case"Int64":case"Uint64":case"Float64":i=new Float64Array(t.len);break;default:i=new Array(t.len)}if(i.fill("Bool"!==t.$arr&&0),void 0!==t.b){const e=l(t.b);if(!i.buffer)throw new Error("base64 coding supported only for native arrays with binary data");{const n=new DataView(i.buffer,t.o||0),s=Math.min(e.length,n.byteLength);for(let t=0;t<s;++t)n.setUint8(t,e.charCodeAt(t))}}else{let n=2,s=0;for(;n<r;){if("p"===e[n][0]&&(s=t[e[n++]]),"v"!==e[n][0])throw new Error(`Unexpected member ${e[n]} in array decoding`);const a=t[e[n++]];if("object"==typeof a)for(let t=0;t<a.length;++t)i[s++]=a[t];else if(i[s++]=a,n<r&&"n"===e[n][0]){let r=t[e[n++]];for(;--r;)i[s++]=a}}}return i}if(!1!==n&&3===r&&"$pair"===e[0]&&"first"===e[1]&&"second"===e[2]){n=!0;const e=s(t.first),i=s(t.second);return void 0!==e&&(t.first=e),void 0!==i&&(t.second=i),t._typename=t.$pair,void delete t.$pair}if(!(i.indexOf(t)>=0)){i.push(t),t._typename&&w(t);for(let i=0;i<r;++i){const n=e[i],r=s(t[n]);void 0!==r&&(t[n]=r)}}};return s(e),e}function C(t,e){if(!It(t))return"";const i=[],n=t=>{if(Et(t))return;if(null==t||!It(t))return t;if(d(Object.prototype.toString.apply(t))>0){const e=new Array(t.length);for(let i=0;i<t.length;++i)e[i]=n(t[i]);return e}const e=i.indexOf(t);if(e>=0)return{$ref:e};const s=Object.keys(t),r=s.length,a={};if(3===r&&"$pair"===s[0]&&"first"===s[1]&&"second"===s[2])return a.$pair=t.$pair,a.first=n(t.first),a.second=n(t.second),a;i.push(t);for(let e=0;e<r;++e){const i=s[e];i&&"$"!==i[0]&&(a[i]=n(t[i]))}return a},s=n(t);return JSON.stringify(s,null,e)}function T(t,e,n,s,r){function a(r){r.http_callback=Et(n)?n.bind(r):()=>{},r.error_callback=Et(s)?s.bind(r):function(t){console.warn(t.message),this.http_callback(null)}.bind(r),e||(e="buf");let a="GET",o=!0;const h=e.indexOf(";sync");switch(h>0&&(e=e.slice(0,h),o=!1),e){case"head":a="HEAD";break;case"posttext":a="POST",e="text";break;case"postbuf":a="POST",e="buf";break;case"post":case"multi":a="POST"}return r.kind=e,g.WithCredentials&&(r.withCredentials=!0),g.HandleWrongHttpResponse&&"GET"===a&&Et(r.addEventListener)&&r.addEventListener("progress",function(t){t.lengthComputable&&this.expected_size&&t.loaded>this.expected_size&&(this.did_abort=!0,this.abort(),this.error_callback(Error(`Server sends more bytes ${t.loaded} than expected ${this.expected_size}. Abort I/O operation`),598))}.bind(r)),r.onreadystatechange=function(){if(!this.did_abort){if(2===this.readyState&&this.expected_size){const t=parseInt(this.getResponseHeader("Content-Length"));if(Number.isInteger(t)&&t>this.expected_size&&!g.HandleWrongHttpResponse)return this.did_abort=!0,this.abort(),this.error_callback(Error(`Server response size ${t} larger than expected ${this.expected_size}. Abort I/O operation`),599)}if(4===this.readyState){if(200!==this.status&&206!==this.status&&!f.qt5&&(0!==this.status||0!==t.indexOf("file://")&&0!==t.indexOf("blob:")))return this.error_callback(Error(`Fail to load url ${t}`),this.status);if(this.nodejs_checkzip&&"gzip"===this.getResponseHeader("content-encoding"))return Promise.resolve().then((function(){return Wd})).then((t=>{const e=t.unzipSync(Buffer.from(this.response)),i=JSON.parse(e);return this.http_callback(M(i))}));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(M(this.responseText));case"multi":return this.http_callback(function(t){if(!t)return null;const e=JSON.parse(t);if(e?.length)for(let t=0;t<e.length;++t)e[t]=M(e[t]);return e}(this.responseText));case"head":return this.http_callback(this)}if(void 0===this.responseType)return this.http_callback(this.responseText);if("bin"===this.kind&&"byteLength"in this.response){const t=new Uint8Array(this.response);let e="";for(let i=0;i<t.length;++i)e+=String.fromCharCode(t[i]);return this.http_callback(e)}this.http_callback(this.response)}}},r.open(a,t,o),"bin"!==e&&"buf"!==e||(r.responseType="arraybuffer"),i&&"GET"===a&&"object"===e&&t.indexOf(".json.gz")>0&&(r.nodejs_checkzip=!0,r.responseType="arraybuffer"),r}if(h()){if(!r)throw Error("Not allowed to create http requests in node.js without promise");return Promise.resolve().then((function(){return Wd})).then((t=>a(new t.default)))}const o=a(new XMLHttpRequest);return r?Promise.resolve(o):o}async function k(t,e,i){return new Promise(((n,s)=>{T(t,e,n,s,!0).then((t=>t.send(i||null)))}))}const S="TObject",P="TNamed",$="TObjString",z="TList",F="THashList",N="TObjArray",A="TAttLine",D="TAttFill",L="TAttMarker",O="TAttText",B="THStack",j="TGraph",I="TMultiGraph",E="TCutG",X="TGraphPolargram",Y="TGraphTime",H="TPave",R="TPaveText",G="TPaveStats",U="TPavesText",Z="TPaveLabel",W="TPaveClass",q="TDiamond",V="TLegend",K="TLegendEntry",J="TPaletteAxis",Q="TText",tt="TLatex",et="TColor",it="TLine",nt="TBox",st="TPolyLine",rt="TPolyLine3D",at="TPolyMarker3D",ot="TAttPad",ht="TPad",lt="TCanvas",ct="TFrame",ft="TAttCanvas",dt="TGaxis",ut="TAttAxis",gt="TAxis",pt="TH1",mt="TH1I",xt="TH1D",_t="TH2",yt="TH2I",bt="TH2F",vt="TH3",wt="TF1",Mt="TF2",Ct="TF3",Tt="TProfile",kt="TProfile2D",St="TProfile3D",Pt="TGeoVolume",$t="TGeoNode",zt="TGeoNodeMatrix",Ft=-1111,Nt=y(9),At="inspect",Dt="title";function Lt(t,e){const i=e||{};switch(t){case S:v(i,{fUniqueID:0,fBits:0});break;case P:v(i,{fUniqueID:0,fBits:0,fName:"",fTitle:""});break;case z:case F:v(i,{name:t,arr:[],opt:[]});break;case ut:v(i,{fNdivisions:510,fAxisColor:1,fLabelColor:1,fLabelFont:42,fLabelOffset:.005,fLabelSize:.035,fTickLength:.03,fTitleOffset:1,fTitleSize:.035,fTitleColor:1,fTitleFont:42});break;case gt:Lt(P,i),Lt(ut,i),v(i,{fNbins:1,fXmin:0,fXmax:1,fXbins:[],fFirst:0,fLast:0,fBits2:0,fTimeDisplay:!1,fTimeFormat:"",fLabels:null,fModLabs:null});break;case A:v(i,{fLineColor:1,fLineStyle:1,fLineWidth:1});break;case D:v(i,{fFillColor:0,fFillStyle:0});break;case L:v(i,{fMarkerColor:1,fMarkerStyle:1,fMarkerSize:1});break;case it:Lt(S,i),Lt(A,i),v(i,{fX1:0,fX2:1,fY1:0,fY2:1});break;case nt:Lt(S,i),Lt(A,i),Lt(D,i),v(i,{fX1:0,fX2:1,fY1:0,fY2:1});break;case H:Lt(nt,i),v(i,{fX1NDC:0,fY1NDC:0,fX2NDC:1,fY2NDC:1,fBorderSize:0,fInit:1,fShadowColor:1,fCornerRadius:0,fOption:"brNDC",fName:""});break;case O:v(i,{fTextAngle:0,fTextSize:0,fTextAlign:22,fTextColor:1,fTextFont:42});break;case R:Lt(H,i),Lt(O,i),v(i,{fLabel:"",fLongest:27,fMargin:.05,fLines:Lt(z)});break;case G:Lt(R,i),v(i,{fFillColor:p.fStatColor,fFillStyle:p.fStatStyle,fTextFont:p.fStatFont,fTextSize:p.fStatFontSize,fTextColor:p.fStatTextColor,fBorderSize:p.fStatBorderSize,fOptFit:0,fOptStat:0,fFitFormat:"",fStatFormat:"",fParent:null});break;case V:Lt(H,i),Lt(O,i),v(i,{fColumnSeparation:0,fEntrySeparation:.1,fMargin:.25,fNColumns:1,fPrimitives:Lt(z),fName:H,fBorderSize:p.fLegendBorderSize,fTextFont:p.fLegendFont,fTextSize:p.fLegendTextSize,fFillColor:p.fLegendFillColor});break;case J:Lt(H,i),v(i,{fAxis:Lt(dt),fH:null,fName:H});break;case K:Lt(S,i),Lt(O,i),Lt(A,i),Lt(D,i),Lt(L,i),v(i,{fLabel:"",fObject:null,fOption:"",fTextAlign:0,fTextColor:0,fTextFont:0});break;case Q:Lt(P,i),Lt(O,i),v(i,{fLimitFactorSize:3,fOriginSize:.04});break;case tt:Lt(Q,i),Lt(A,i),v(i,{fX:0,fY:0});break;case $:Lt(S,i),v(i,{fString:""});break;case pt:Lt(P,i),Lt(A,i),Lt(D,i),Lt(L,i),v(i,{fBits:8,fNcells:0,fXaxis:Lt(gt),fYaxis:Lt(gt),fZaxis:Lt(gt),fFillColor:p.fHistFillColor,fFillStyle:p.fHistFillStyle,fLineColor:p.fHistLineColor,fLineStyle:p.fHistLineStyle,fLineWidth:p.fHistLineWidth,fBarOffset:0,fBarWidth:1e3,fEntries:0,fTsumw:0,fTsumw2:0,fTsumwx:0,fTsumwx2:0,fMaximum:Ft,fMinimum:Ft,fNormFactor:0,fContour:[],fSumw2:[],fOption:"",fFunctions:Lt(z),fBufferSize:0,fBuffer:[],fBinStatErrOpt:0,fStatOverflows:2});break;case mt:case xt:case"TH1L64":case"TH1F":case"TH1S":case"TH1C":Lt(pt,i),i.fArray=[];break;case _t:Lt(pt,i),v(i,{fScalefactor:1,fTsumwy:0,fTsumwy2:0,fTsumwxy:0});break;case yt:case"TH2L64":case bt:case"TH2D":case"TH2S":case"TH2C":Lt(_t,i),i.fArray=[];break;case vt:Lt(pt,i),v(i,{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":Lt(vt,i),i.fArray=[];break;case B:Lt(P,i),v(i,{fHists:Lt(z),fHistogram:null,fMaximum:Ft,fMinimum:Ft});break;case j:Lt(P,i),Lt(A,i),Lt(D,i),Lt(L,i),v(i,{fFunctions:Lt(z),fHistogram:null,fMaxSize:0,fMaximum:Ft,fMinimum:Ft,fNpoints:0,fX:[],fY:[]});break;case"TGraphAsymmErrors":Lt(j,i),v(i,{fEXlow:[],fEXhigh:[],fEYlow:[],fEYhigh:[]});break;case I:Lt(P,i),v(i,{fFunctions:Lt(z),fGraphs:Lt(z),fHistogram:null,fMaximum:Ft,fMinimum:Ft});break;case X:Lt(P,i),Lt(O,i),Lt(A,i),v(i,{fRadian:!0,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 st:Lt(S,i),Lt(A,i),Lt(D,i),v(i,{fLastPoint:-1,fN:0,fOption:"",fX:null,fY:null});break;case dt:Lt(it,i),Lt(O,i),v(i,{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 ot:v(i,{fLeftMargin:p.fPadLeftMargin,fRightMargin:p.fPadRightMargin,fBottomMargin:p.fPadBottomMargin,fTopMargin:p.fPadTopMargin,fXfile:2,fYfile:2,fAfile:1,fXstat:.99,fYstat:.99,fAstat:2,fFrameFillColor:p.fFrameFillColor,fFrameFillStyle:p.fFrameFillStyle,fFrameLineColor:p.fFrameLineColor,fFrameLineWidth:p.fFrameLineWidth,fFrameLineStyle:p.fFrameLineStyle,fFrameBorderSize:p.fFrameBorderSize,fFrameBorderMode:p.fFrameBorderMode});break;case ht:Lt(S,i),Lt(A,i),Lt(D,i),Lt(ot,i),v(i,{fFillColor:p.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:p.fOptLogx,fLogy:p.fOptLogy,fLogz:p.fOptLogz,fTickx:p.fPadTickX,fTicky:p.fPadTickY,fPadPaint:0,fCrosshair:0,fCrosshairPos:0,fBorderSize:p.fPadBorderSize,fBorderMode:p.fPadBorderMode,fModified:!1,fGridx:p.fPadGridX,fGridy:p.fPadGridY,fAbsCoord:!1,fEditable:!0,fFixedAspectRatio:!1,fPrimitives:Lt(z),fExecs:null,fName:"pad",fTitle:"canvas"});break;case ft:v(i,{fXBetween:2,fYBetween:2,fTitleFromTop:1.2,fXdate:.2,fYdate:.3,fAdate:1});break;case lt:Lt(ht,i),v(i,{fFillColor:p.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:p.fCanvasBorderSize,fBorderMode:p.fCanvasBorderMode,fCw:500,fCh:300,fCatt:Lt(ft),kMoveOpaque:!0,kResizeOpaque:!0,fHighLightColor:5,fBatch:!0,kShowEventStatus:!1,kAutoExec:!0,kMenuBar:!0});break;case Pt:Lt(P,i),Lt(A,i),Lt(D,i),v(i,{fGeoAtt:0,fFinder:null,fMedium:null,fNodes:null,fNtotal:0,fNumber:0,fRefCount:0,fShape:null,fVoxels:null});break;case $t:Lt(P,i),v(i,{fGeoAtt:0,fMother:null,fNovlp:0,fNumber:0,fOverlaps:null,fVolume:null});break;case zt:Lt($t,i),v(i,{fMatrix:null});break;case"TGeoTrack":Lt(S,i),Lt(A,i),Lt(L,i),v(i,{fGeoAtt:0,fNpoints:0,fPoints:[]});break;case rt:Lt(S,i),Lt(A,i),v(i,{fLastPoint:-1,fN:0,fOption:"",fP:[]});break;case at:Lt(S,i),Lt(L,i),v(i,{fLastPoint:-1,fN:0,fName:"",fOption:"",fP:[]})}return i._typename=t,w(i,t),i}function Ot(t,e,i,n){const s=Lt(t);if(!s.fXaxis||!s.fYaxis||!s.fZaxis)return null;switch(s.fName="hist",s.fTitle="title",e&&v(s.fXaxis,{fNbins:e,fXmin:0,fXmax:e}),i&&v(s.fYaxis,{fNbins:i,fXmin:0,fXmax:i}),n&&v(s.fZaxis,{fNbins:n,fXmin:0,fXmax:n}),parseInt(t[2])){case 1:e&&(s.fNcells=e+2);break;case 2:e&&i&&(s.fNcells=(e+2)*(i+2));break;case 3:e&&i&&n&&(s.fNcells=(e+2)*(i+2)*(n+2))}if(s.fNcells>0){switch(t[3]){case"C":s.fArray=new Int8Array(s.fNcells);break;case"S":s.fArray=new Int16Array(s.fNcells);break;case"I":s.fArray=new Int32Array(s.fNcells);break;case"F":s.fArray=new Float32Array(s.fNcells);break;case"L":case"D":s.fArray=new Float64Array(s.fNcells);break;default:s.fArray=new Array(s.fNcells)}s.fArray.fill(0)}return s}function Bt(t,e){const i=Lt(st);return t&&(i.fN=t,e?(i.fX=new Int32Array(t),i.fY=new Int32Array(t)):(i.fX=new Float32Array(t),i.fY=new Float32Array(t))),i}const jt={};function It(t){return t&&"object"==typeof t}function Et(t){return"function"==typeof t}function Xt(t){return"string"==typeof t}function Yt(t){return It(t)&&Et(t.then)}function Ht(t,e){return new Promise((i=>{setTimeout((()=>{const e=Et(t)?t():t;i(e)}),e)}))}function Rt(t){return Yt(t)?t:Promise.resolve(t)}function Gt(t,e,i){t.prototype=e.prototype=i,i.constructor=t}function Ut(t,e){var i=Object.create(t.prototype);for(var n in e)i[n]=e[n];return i}function Zt(){}p.fXaxis=Lt(ut),p.fYaxis=Lt(ut),p.fZaxis=Lt(ut);var Wt=.7,qt=1/Wt,Vt="\\s*([+-]?\\d+)\\s*",Kt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qt=/^#([0-9a-f]{3,8})$/,te=new RegExp(`^rgb\\(${Vt},${Vt},${Vt}\\)$`),ee=new RegExp(`^rgb\\(${Jt},${Jt},${Jt}\\)$`),ie=new RegExp(`^rgba\\(${Vt},${Vt},${Vt},${Kt}\\)$`),ne=new RegExp(`^rgba\\(${Jt},${Jt},${Jt},${Kt}\\)$`),se=new RegExp(`^hsl\\(${Kt},${Jt},${Jt}\\)$`),re=new RegExp(`^hsla\\(${Kt},${Jt},${Jt},${Kt}\\)$`),ae={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};function oe(){return this.rgb().formatHex()}function he(){return this.rgb().formatRgb()}function le(t){var e,i;return t=(t+"").trim().toLowerCase(),(e=Qt.exec(t))?(i=e[1].length,e=parseInt(e[1],16),6===i?ce(e):3===i?new ge(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===i?fe(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===i?fe(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=te.exec(t))?new ge(e[1],e[2],e[3],1):(e=ee.exec(t))?new ge(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ie.exec(t))?fe(e[1],e[2],e[3],e[4]):(e=ne.exec(t))?fe(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=se.exec(t))?be(e[1],e[2]/100,e[3]/100,1):(e=re.exec(t))?be(e[1],e[2]/100,e[3]/100,e[4]):ae.hasOwnProperty(t)?ce(ae[t]):"transparent"===t?new ge(NaN,NaN,NaN,0):null}function ce(t){return new ge(t>>16&255,t>>8&255,255&t,1)}function fe(t,e,i,n){return n<=0&&(t=e=i=NaN),new ge(t,e,i,n)}function de(t){return t instanceof Zt||(t=le(t)),t?new ge((t=t.rgb()).r,t.g,t.b,t.opacity):new ge}function ue(t,e,i,n){return 1===arguments.length?de(t):new ge(t,e,i,null==n?1:n)}function ge(t,e,i,n){this.r=+t,this.g=+e,this.b=+i,this.opacity=+n}function pe(){return`#${ye(this.r)}${ye(this.g)}${ye(this.b)}`}function me(){const t=xe(this.opacity);return`${1===t?"rgb(":"rgba("}${_e(this.r)}, ${_e(this.g)}, ${_e(this.b)}${1===t?")":`, ${t})`}`}function xe(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function _e(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ye(t){return((t=_e(t))<16?"0":"")+t.toString(16)}function be(t,e,i,n){return n<=0?t=e=i=NaN:i<=0||i>=1?t=e=NaN:e<=0&&(t=NaN),new we(t,e,i,n)}function ve(t){if(t instanceof we)return new we(t.h,t.s,t.l,t.opacity);if(t instanceof Zt||(t=le(t)),!t)return new we;if(t instanceof we)return t;var e=(t=t.rgb()).r/255,i=t.g/255,n=t.b/255,s=Math.min(e,i,n),r=Math.max(e,i,n),a=NaN,o=r-s,h=(r+s)/2;return o?(a=e===r?(i-n)/o+6*(i<n):i===r?(n-e)/o+2:(e-i)/o+4,o/=h<.5?r+s:2-r-s,a*=60):o=h>0&&h<1?0:a,new we(a,o,h,t.opacity)}function we(t,e,i,n){this.h=+t,this.s=+e,this.l=+i,this.opacity=+n}function Me(t){return(t=(t||0)%360)<0?t+360:t}function Ce(t){return Math.max(0,Math.min(1,t||0))}function Te(t,e,i){return 255*(t<60?e+(i-e)*t/60:t<180?i:t<240?e+(i-e)*(240-t)/60:e)}Gt(Zt,le,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:oe,formatHex:oe,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ve(this).formatHsl()},formatRgb:he,toString:he}),Gt(ge,ue,Ut(Zt,{brighter(t){return t=null==t?qt:Math.pow(qt,t),new ge(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Wt:Math.pow(Wt,t),new ge(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ge(_e(this.r),_e(this.g),_e(this.b),xe(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:pe,formatHex:pe,formatHex8:function(){return`#${ye(this.r)}${ye(this.g)}${ye(this.b)}${ye(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:me,toString:me})),Gt(we,(function(t,e,i,n){return 1===arguments.length?ve(t):new we(t,e,i,null==n?1:n)}),Ut(Zt,{brighter(t){return t=null==t?qt:Math.pow(qt,t),new we(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Wt:Math.pow(Wt,t),new we(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*e,s=2*i-n;return new ge(Te(t>=240?t-240:t+120,s,n),Te(t,s,n),Te(t<120?t+240:t-120,s,n),this.opacity)},clamp(){return new we(Me(this.h),Ce(this.s),Ce(this.l),xe(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 t=xe(this.opacity);return`${1===t?"hsl(":"hsla("}${Me(this.h)}, ${100*Ce(this.s)}%, ${100*Ce(this.l)}%${1===t?")":`, ${t})`}`}}));const ke=Math.PI/180,Se=180/Math.PI,Pe=.96422,$e=1,ze=.82521,Fe=4/29,Ne=6/29,Ae=3*Ne*Ne,De=Ne*Ne*Ne;function Le(t){if(t instanceof Oe)return new Oe(t.l,t.a,t.b,t.opacity);if(t instanceof Xe)return Ye(t);t instanceof ge||(t=de(t));var e,i,n=Ee(t.r),s=Ee(t.g),r=Ee(t.b),a=Be((.2225045*n+.7168786*s+.0606169*r)/$e);return n===s&&s===r?e=i=a:(e=Be((.4360747*n+.3850649*s+.1430804*r)/Pe),i=Be((.0139322*n+.0971045*s+.7141733*r)/ze)),new Oe(116*a-16,500*(e-a),200*(a-i),t.opacity)}function Oe(t,e,i,n){this.l=+t,this.a=+e,this.b=+i,this.opacity=+n}function Be(t){return t>De?Math.pow(t,1/3):t/Ae+Fe}function je(t){return t>Ne?t*t*t:Ae*(t-Fe)}function Ie(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ee(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Xe(t,e,i,n){this.h=+t,this.c=+e,this.l=+i,this.opacity=+n}function Ye(t){if(isNaN(t.h))return new Oe(t.l,0,0,t.opacity);var e=t.h*ke;return new Oe(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Gt(Oe,(function(t,e,i,n){return 1===arguments.length?Le(t):new Oe(t,e,i,null==n?1:n)}),Ut(Zt,{brighter(t){return new Oe(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Oe(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,i=isNaN(this.b)?t:t-this.b/200;return new ge(Ie(3.1338561*(e=Pe*je(e))-1.6168667*(t=$e*je(t))-.4906146*(i=ze*je(i))),Ie(-.9787684*e+1.9161415*t+.033454*i),Ie(.0719453*e-.2289914*t+1.4052427*i),this.opacity)}})),Gt(Xe,(function(t,e,i,n){return 1===arguments.length?function(t){if(t instanceof Xe)return new Xe(t.h,t.c,t.l,t.opacity);if(t instanceof Oe||(t=Le(t)),0===t.a&&0===t.b)return new Xe(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Se;return new Xe(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Xe(t,e,i,null==n?1:n)}),Ut(Zt,{brighter(t){return new Xe(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new Xe(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return Ye(this).rgb()}}));var He=-.14861,Re=1.78277,Ge=-.29227,Ue=-.90649,Ze=1.97294,We=Ze*Ue,qe=Ze*Re,Ve=Re*Ge-Ue*He;function Ke(t,e,i,n){this.h=+t,this.s=+e,this.l=+i,this.opacity=+n}Gt(Ke,(function(t,e,i,n){return 1===arguments.length?function(t){if(t instanceof Ke)return new Ke(t.h,t.s,t.l,t.opacity);t instanceof ge||(t=de(t));var e=t.r/255,i=t.g/255,n=t.b/255,s=(Ve*n+We*e-qe*i)/(Ve+We-qe),r=n-s,a=(Ze*(i-s)-Ge*r)/Ue,o=Math.sqrt(a*a+r*r)/(Ze*s*(1-s)),h=o?Math.atan2(a,r)*Se-120:NaN;return new Ke(h<0?h+360:h,o,s,t.opacity)}(t):new Ke(t,e,i,null==n?1:n)}),Ut(Zt,{brighter(t){return t=null==t?qt:Math.pow(qt,t),new Ke(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Wt:Math.pow(Wt,t),new Ke(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*ke,e=+this.l,i=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),s=Math.sin(t);return new ge(255*(e+i*(He*n+Re*s)),255*(e+i*(Ge*n+Ue*s)),255*(e+i*(Ze*n)),this.opacity)}}));var Je=Math.abs,Qe=Math.cos,ti=Math.sin,ei=Math.PI,ii=ei/2,ni=2*ei,si=Math.max,ri=1e-12;function ai(t,e){return Array.from({length:e-t},((e,i)=>t+i))}function oi(){return function(t,e){var i=0,n=null,s=null,r=null;function a(a){var o,h=a.length,l=new Array(h),c=ai(0,h),f=new Array(h*h),d=new Array(h),u=0;a=Float64Array.from({length:h*h},e?(t,e)=>a[e%h][e/h|0]:(t,e)=>a[e/h|0][e%h]);for(let e=0;e<h;++e){let i=0;for(let n=0;n<h;++n)i+=a[e*h+n]+t*a[n*h+e];u+=l[e]=i}o=(u=si(0,ni-i*h)/u)?i:ni/h;{let e=0;n&&c.sort(((t,e)=>n(l[t],l[e])));for(const i of c){const n=e;if(t){const t=ai(1+~h,h).filter((t=>t<0?a[~t*h+i]:a[i*h+t]));s&&t.sort(((t,e)=>s(t<0?-a[~t*h+i]:a[i*h+t],e<0?-a[~e*h+i]:a[i*h+e])));for(const n of t)if(n<0){(f[~n*h+i]||(f[~n*h+i]={source:null,target:null})).target={index:i,startAngle:e,endAngle:e+=a[~n*h+i]*u,value:a[~n*h+i]}}else{(f[i*h+n]||(f[i*h+n]={source:null,target:null})).source={index:i,startAngle:e,endAngle:e+=a[i*h+n]*u,value:a[i*h+n]}}d[i]={index:i,startAngle:n,endAngle:e,value:l[i]}}else{const t=ai(0,h).filter((t=>a[i*h+t]||a[t*h+i]));s&&t.sort(((t,e)=>s(a[i*h+t],a[i*h+e])));for(const n of t){let t;if(i<n?(t=f[i*h+n]||(f[i*h+n]={source:null,target:null}),t.source={index:i,startAngle:e,endAngle:e+=a[i*h+n]*u,value:a[i*h+n]}):(t=f[n*h+i]||(f[n*h+i]={source:null,target:null}),t.target={index:i,startAngle:e,endAngle:e+=a[i*h+n]*u,value:a[i*h+n]},i===n&&(t.source=t.target)),t.source&&t.target&&t.source.value<t.target.value){const e=t.source;t.source=t.target,t.target=e}}d[i]={index:i,startAngle:n,endAngle:e,value:l[i]}}e+=o}}return(f=Object.values(f)).groups=d,r?f.sort(r):f}return a.padAngle=function(t){return arguments.length?(i=si(0,t),a):i},a.sortGroups=function(t){return arguments.length?(n=t,a):n},a.sortSubgroups=function(t){return arguments.length?(s=t,a):s},a.sortChords=function(t){return arguments.length?(null==t?r=null:(e=t,r=function(t,i){return e(t.source.value+t.target.value,i.source.value+i.target.value)})._=t,a):r&&r._;var e},a}(!1,!1)}const hi=Math.PI,li=2*hi,ci=1e-6,fi=li-ci;function di(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=arguments[e]+t[e]}class ui{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?di:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return di;const i=10**e;return function(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=Math.round(arguments[e]*i)/i+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(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,n){this._append`Q${+t},${+e},${this._x1=+i},${this._y1=+n}`}bezierCurveTo(t,e,i,n,s,r){this._append`C${+t},${+e},${+i},${+n},${this._x1=+s},${this._y1=+r}`}arcTo(t,e,i,n,s){if(t=+t,e=+e,i=+i,n=+n,(s=+s)<0)throw new Error(`negative radius: ${s}`);let r=this._x1,a=this._y1,o=i-t,h=n-e,l=r-t,c=a-e,f=l*l+c*c;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>ci)if(Math.abs(c*o-h*l)>ci&&s){let d=i-r,u=n-a,g=o*o+h*h,p=d*d+u*u,m=Math.sqrt(g),x=Math.sqrt(f),_=s*Math.tan((hi-Math.acos((g+f-p)/(2*m*x)))/2),y=_/x,b=_/m;Math.abs(y-1)>ci&&this._append`L${t+y*l},${e+y*c}`,this._append`A${s},${s},0,0,${+(c*d>l*u)},${this._x1=t+b*o},${this._y1=e+b*h}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,i,n,s,r){if(t=+t,e=+e,r=!!r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(n),o=i*Math.sin(n),h=t+a,l=e+o,c=1^r,f=r?n-s:s-n;null===this._x1?this._append`M${h},${l}`:(Math.abs(this._x1-h)>ci||Math.abs(this._y1-l)>ci)&&this._append`L${h},${l}`,i&&(f<0&&(f=f%li+li),f>fi?this._append`A${i},${i},0,1,${c},${t-a},${e-o}A${i},${i},0,1,${c},${this._x1=h},${this._y1=l}`:f>ci&&this._append`A${i},${i},0,${+(f>=hi)},${c},${this._x1=t+i*Math.cos(s)},${this._y1=e+i*Math.sin(s)}`)}rect(t,e,i,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${i=+i}v${+n}h${-i}Z`}toString(){return this._}}function gi(){return new ui}gi.prototype=ui.prototype;var pi=Array.prototype.slice;function mi(t){return function(){return t}}function xi(t){return t.source}function _i(t){return t.target}function yi(t){return t.radius}function bi(t){return t.startAngle}function vi(t){return t.endAngle}function wi(){return 0}function Mi(){return function(t){var e=xi,i=_i,n=yi,s=yi,r=bi,a=vi,o=wi,h=null;function l(){var l,c=e.apply(this,arguments),f=i.apply(this,arguments),d=o.apply(this,arguments)/2,u=pi.call(arguments),g=+n.apply(this,(u[0]=c,u)),p=r.apply(this,u)-ii,m=a.apply(this,u)-ii,x=+s.apply(this,(u[0]=f,u)),_=r.apply(this,u)-ii,y=a.apply(this,u)-ii;if(h||(h=l=gi()),d>ri&&(Je(m-p)>2*d+ri?m>p?(p+=d,m-=d):(p-=d,m+=d):p=m=(p+m)/2,Je(y-_)>2*d+ri?y>_?(_+=d,y-=d):(_-=d,y+=d):_=y=(_+y)/2),h.moveTo(g*Qe(p),g*ti(p)),h.arc(0,0,g,p,m),p!==_||m!==y)if(t){var b=x-+t.apply(this,arguments),v=(_+y)/2;h.quadraticCurveTo(0,0,b*Qe(_),b*ti(_)),h.lineTo(x*Qe(v),x*ti(v)),h.lineTo(b*Qe(y),b*ti(y))}else h.quadraticCurveTo(0,0,x*Qe(_),x*ti(_)),h.arc(0,0,x,_,y);if(h.quadraticCurveTo(0,0,g*Qe(p),g*ti(p)),h.closePath(),l)return h=null,l+""||null}return t&&(l.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:mi(+e),l):t}),l.radius=function(t){return arguments.length?(n=s="function"==typeof t?t:mi(+t),l):n},l.sourceRadius=function(t){return arguments.length?(n="function"==typeof t?t:mi(+t),l):n},l.targetRadius=function(t){return arguments.length?(s="function"==typeof t?t:mi(+t),l):s},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:mi(+t),l):r},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:mi(+t),l):a},l.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:mi(+t),l):o},l.source=function(t){return arguments.length?(e=t,l):e},l.target=function(t){return arguments.length?(i=t,l):i},l.context=function(t){return arguments.length?(h=null==t?null:t,l):h},l}()}var Ci={value:()=>{}};function Ti(){for(var t,e=0,i=arguments.length,n={};e<i;++e){if(!(t=arguments[e]+"")||t in n||/[\s.]/.test(t))throw new Error("illegal type: "+t);n[t]=[]}return new ki(n)}function ki(t){this._=t}function Si(t,e){for(var i,n=0,s=t.length;n<s;++n)if((i=t[n]).name===e)return i.value}function Pi(t,e,i){for(var n=0,s=t.length;n<s;++n)if(t[n].name===e){t[n]=Ci,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=i&&t.push({name:e,value:i}),t}ki.prototype=Ti.prototype={constructor:ki,on:function(t,e){var i,n,s=this._,r=(n=s,(t+"").trim().split(/^|\s+/).map((function(t){var e="",i=t.indexOf(".");if(i>=0&&(e=t.slice(i+1),t=t.slice(0,i)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,o=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)s[i]=Pi(s[i],t.name,e);else if(null==e)for(i in s)s[i]=Pi(s[i],t.name,null);return this}for(;++a<o;)if((i=(t=r[a]).type)&&(i=Si(s[i],t.name)))return i},copy:function(){var t={},e=this._;for(var i in e)t[i]=e[i].slice();return new ki(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var i,n,s=new Array(i),r=0;r<i;++r)s[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=0,i=(n=this._[t]).length;r<i;++r)n[r].value.apply(e,s)},apply:function(t,e,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],s=0,r=n.length;s<r;++s)n[s].value.apply(e,i)}};var $i="http://www.w3.org/1999/xhtml",zi={svg:"http://www.w3.org/2000/svg",xhtml:$i,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fi(t){var e=t+="",i=e.indexOf(":");return i>=0&&"xmlns"!==(e=t.slice(0,i))&&(t=t.slice(i+1)),zi.hasOwnProperty(e)?{space:zi[e],local:t}:t}function Ni(t){return function(){var e=this.ownerDocument,i=this.namespaceURI;return i===$i&&e.documentElement.namespaceURI===$i?e.createElement(t):e.createElementNS(i,t)}}function Ai(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Di(t){var e=Fi(t);return(e.local?Ai:Ni)(e)}function Li(){}function Oi(t){return null==t?Li:function(){return this.querySelector(t)}}function Bi(){return[]}function ji(t){return null==t?Bi:function(){return this.querySelectorAll(t)}}function Ii(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function Ei(t){return function(){return this.matches(t)}}function Xi(t){return function(e){return e.matches(t)}}var Yi=Array.prototype.find;function Hi(){return this.firstElementChild}var Ri=Array.prototype.filter;function Gi(){return Array.from(this.children)}function Ui(t){return new Array(t.length)}function Zi(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function Wi(t,e,i,n,s,r){for(var a,o=0,h=e.length,l=r.length;o<l;++o)(a=e[o])?(a.__data__=r[o],n[o]=a):i[o]=new Zi(t,r[o]);for(;o<h;++o)(a=e[o])&&(s[o]=a)}function qi(t,e,i,n,s,r,a){var o,h,l,c=new Map,f=e.length,d=r.length,u=new Array(f);for(o=0;o<f;++o)(h=e[o])&&(u[o]=l=a.call(h,h.__data__,o,e)+"",c.has(l)?s[o]=h:c.set(l,h));for(o=0;o<d;++o)l=a.call(t,r[o],o,r)+"",(h=c.get(l))?(n[o]=h,h.__data__=r[o],c.delete(l)):i[o]=new Zi(t,r[o]);for(o=0;o<f;++o)(h=e[o])&&c.get(u[o])===h&&(s[o]=h)}function Vi(t){return t.__data__}function Ki(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Ji(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Qi(t){return function(){this.removeAttribute(t)}}function tn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function en(t,e){return function(){this.setAttribute(t,e)}}function nn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function sn(t,e){return function(){var i=e.apply(this,arguments);null==i?this.removeAttribute(t):this.setAttribute(t,i)}}function rn(t,e){return function(){var i=e.apply(this,arguments);null==i?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function an(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function on(t){return function(){this.style.removeProperty(t)}}function hn(t,e,i){return function(){this.style.setProperty(t,e,i)}}function ln(t,e,i){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,i)}}function cn(t,e){return t.style.getPropertyValue(e)||an(t).getComputedStyle(t,null).getPropertyValue(e)}function fn(t){return function(){delete t