brainsmatics 1.1.29 → 1.1.30

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.
@@ -4500,9 +4500,9 @@ echarts.use([`+U+"]);":"Unknown series "+D))}return}if(f==="tooltip"){if(E){proc
4500
4500
  Coefficient`,nameTextStyle:{fontSize:12,overflow:"break",width:80,lineHeight:14}},tooltip:{position:"top-right",trigger:"axis",axisPointer:{type:"line"},formatter:function(Vn){const Nn=Vn[0].data;return`
4501
4501
  x:<strong>${Vn[0].name}</strong><br/>
4502
4502
  y:<strong>${Nn.toFixed(8)}</strong>
4503
- `}},series:[{data:Ve.data,type:"line",markLine:{symbol:"none",silent:!0,data:$t!==-1?[{xAxis:$t,lineStyle:{type:"solid",color:"#c23531"},label:{show:!0,formatter:"{b}"}}]:[]}},{name:"Event Catcher",type:"bar",barWidth:"100%",data:Ve.data,itemStyle:{color:"transparent"},tooltip:{show:!1}}]},fn&&je.setOption(fn),je.on("click",Vn=>{ot(Vn.name)});let Bt={dataset:[{source:Jt}],tooltip:{position:"top",trigger:"item",formatter:function(Vn){const Nn=Vn&&Vn.value!==void 0?Vn.value:Vn&&Vn.data&&Vn.data.value!==void 0?Vn.data.value:Vn&&Vn.data?Vn.data:null,Pr=Array.isArray(Nn)?Nn:[],ui=Vn&&Vn.marker?Vn.marker:"",ri=Pr[2]??"",Br=Pr[3]??"",cr=Pr[0]??"",Ni=Pr[1]??"";return`${ui} <strong>${ri}</strong><br/>name: ${Br}<br/>X: ${cr}<br/>Y: ${Ni}`}},visualMap:{orient:"horizontal",type:"piecewise",top:20,left:"center",dimension:It,pieces:an,show:!1},grid:{top:65+20*Math.ceil(an.length/5)},xAxis:{name:h("5000.7057")||"t-SNE 1",nameLocation:"end",nameRotate:90},yAxis:{name:h("5000.7058")||"t-SNE 2"},series:{type:"scatter",encode:{tooltip:[0,1]},symbolSize:15,itemStyle:{borderColor:"#555"},datasetIndex:0}};const ar=dt(an,Je.getWidth(),Je,It);Je.setOption({graphic:ar}),Bt&&Je.setOption(Bt),at&&(at.style.display="none"),Je.on("click",Vn=>{const Nn=Vn&&Vn.value!==void 0?Vn.value:Vn&&Vn.data&&Vn.data.value!==void 0?Vn.data.value:Vn&&Vn.data?Vn.data:null;Array.isArray(Nn)&&Nn[3]&&gt(Nn[3],Vn.color)})}return()=>{let we=xi.current;if(we){let je=Dy(we);je==null||je.dispose()}if(lr.current){let je=Dy(lr.current);je==null||je.dispose()}}},[Xn,gi]);const Ee=(we,je,Je,at)=>{var Jt,Nt;const Ve=we.value,lt=je.getOption(),ft=lt.dataset&&lt.dataset[0]&&lt.dataset[0].source||[],It=hr.current.includes(Ve)?hr.current.filter(an=>an!==Ve):hr.current.concat(Ve);if(hr.current=It,be.current.traverse(an=>{an.myMeshType==="SWC"&&an.traverse(fn=>{fn instanceof ha&&fn.material.color.set(an.userData.initColor)})}),hr.current.length===0){je.setOption({series:[{data:ft}],graphic:dt(Je,je.getWidth(),je,at)});return}if(lt.series&&((Jt=lt.series)==null?void 0:Jt.length)>0){const an=ft.map(fn=>{const $t=Array.isArray(fn)?fn[at]:fn[at]??fn.cluster,Bt=hr.current.includes($t);return{value:fn,itemStyle:{borderColor:Bt?"#ff0000":"transparent",borderWidth:Bt?2:0,opacity:Bt?1:.15}}});lt.series=[{data:an}],lt.graphic=dt(Je,je.getWidth(),je,at),je.setOption(lt);for(let fn=0;fn<hr.current.length;fn++){const $t=hr.current[fn],Bt=ft.filter(ar=>(Array.isArray(ar)?ar[at]:ar[at]??ar.cluster)===$t);for(let ar=0;ar<Bt.length;ar++){const Vn=Bt[ar][3],Nn=(Nt=Je.find(Pr=>Pr.value===$t))==null?void 0:Nt.color;if(Vn){const Pr=n.find(ui=>ui.path.indexOf(Vn)!==-1);if(Pr){const ui=be.current.getObjectByName(Pr.name);ui&&ui.traverse(ri=>{ri instanceof ha&&("#"+ri.material.color.getHex().toString(16).padStart(6,"0")===Nn?ri.material.color.set(ui.userData.initColor):ri.material.color.set(Nn))})}}}}}};function dt(we,je,Je,at){const Nt=Math.floor((je-40)/50);return we.map((an,fn)=>{const $t=Math.floor(fn/Nt),ar=30+fn%Nt*50,Vn=25+$t*20;return{type:"group",left:ar,top:Vn,children:[{type:"rect",shape:{width:20,height:15},style:{fill:an.color,stroke:hr.current.includes(an.value)?"#ff0000":"#333"},onclick:()=>Ee(an,Je,we,at),cursor:"pointer",tooltip:{show:!1}},{type:"text",left:20+2,top:3,style:{text:an.label,fill:"#000",fontSize:14},onclick:()=>Ee(an,Je,we,at),cursor:"pointer",tooltip:{show:!1}}]}})}const ot=we=>{const je=document.getElementById("spinner");je&&(je.style.display="block");const Je=[];for(let at=0;at<v.length;at++){const Ve=n.find(lt=>lt.name===v[at]);if(Ve){const lt=Ve.path.lastIndexOf("\\"),ft=Ve.path.lastIndexOf("."),It=Ve.path.slice(lt+1,ft);Je.push(It)}}fetch("/app-api/echarts-api/echarts_data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:Je,n_clusters:we})}).then(at=>{if(at.ok)return at.json();throw je&&(je.style.display="none"),vo.error({title:"Error",content:"Failed to fetch data for charts."}),new Error("Network response was not ok.")}).then(at=>{be.current.traverse(Ve=>{Ve.myMeshType==="SWC"&&Ve.traverse(lt=>{lt instanceof ha&&lt.material.color.set(Ve.userData.initColor)})}),mi(at),hr.current=[]})},gt=(we,je)=>{if(we){const Je=n.find(at=>at.path.indexOf(we)!==-1);if(Je){be.current.traverse(Ve=>{Ve.myMeshType==="SWC"&&Ve.traverse(lt=>{lt instanceof ha&&lt.material.color.set(Ve.userData.initColor)})});const at=be.current.getObjectByName(Je.name);at&&at.traverse(Ve=>{Ve instanceof ha&&("#"+Ve.material.color.getHex().toString(16).padStart(6,"0")===je?Ve.material.color.set(at.userData.initColor):Ve.material.color.set(je))})}}};return S.createElement("div",{ref:l,style:{transition:"all ease-in 0.5s"}},s==="swc"?S.createElement(S.Fragment,null,re?S.createElement(gA,{ref:rt,style:{width:"100%",marginBottom:8},options:Ne,placeholder:h("5000.5040")||"Input the region that soma locates",onSearch:Xt,onChange:Er,value:re}):S.createElement(jE,{ref:qe,showSearch:!0,style:{width:"100%",marginBottom:8},value:re,dropdownStyle:{maxHeight:400,overflow:"hidden"},placeholder:h("5000.5040")||"Input the region that soma locates",allowClear:!0,treeDefaultExpandAll:!1,onChange:hn,onSearch:hn,treeData:oi(r)}),Y?S.createElement(gA,{ref:We,style:{width:"100%",marginBottom:8},options:Ne,placeholder:h("5000.5041")||"Input the region that neuron projects",onSearch:Xt,onChange:or,value:Y}):S.createElement(jE,{showSearch:!0,ref:ct,style:{width:"100%"},value:Y,dropdownStyle:{maxHeight:400,overflow:"hidden",marginBottom:8},placeholder:h("5000.5041")||"Input the region that neuron projects",allowClear:!0,treeDefaultExpandAll:!1,onChange:Bn,onSearch:Bn,treeData:oi(r)}),z&&S.createElement(S.Fragment,null,S.createElement(jE,{treeData:en,value:Ge,onChange:_n,treeCheckable:!0,placeholder:"Filter by data information",style:{width:"100%",marginTop:8}}),S.createElement(ts,{style:{marginTop:"5px"}},S.createElement(sb,{onChange:we=>{Ur(we.target.checked)}},h("7000.7025")||"只展示可用神经元"),S.createElement(ts,{style:{fontStyle:"italic",marginTop:"5px"}},h("7000.7026")||"点击Color按钮,修改神经元颜色;点击Ana.按钮,显示神经元投射路径分析结果;点击Path按钮,在主界面显示神经元经过的脑结构;Src按钮展示了神经元数据的来源")),S.createElement(ts,{style:{marginTop:"5px",marginBottom:5}},S.createElement(Na,{onClick:()=>{const we=document.getElementById("spinner");we&&(we.style.display="block");const je=[];for(let Je=0;Je<v.length;Je++){const at=n.find(Ve=>Ve.name===v[Je]);if(at){const Ve=at.path.lastIndexOf("\\"),lt=at.path.lastIndexOf("."),ft=at.path.slice(Ve+1,lt);je.push(ft)}}fetch("/app-api/echarts-api/echarts_data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:je})}).then(Je=>{if(Je.ok)return Je.json();throw we&&(we.style.display="none"),vo.error({title:"Error",content:"Failed to fetch data for charts."}),new Error("Network response was not ok.")}).then(Je=>{mi(Je),gr(!0);let at=document.getElementById("leftContent");at&&(at.scrollTop=0,at.style.overflowY="hidden")})}},h("5000.70251")||"显示折线图和点状图"))),S.createElement("div",null,S.createElement(vo,{className:"Echart",open:Le,onOk:()=>{ht(!1)},onCancel:()=>{ht(!1)},width:"auto",footer:null},S.createElement(gg,{activeKey:Mt,onChange:Ie},S.createElement(tH,{tab:h("5000.7009")||"神经元末梢分布",key:"1"},kn&&S.createElement(Zi,null,"Isocortex"),S.createElement(ec,{ref:Ot,className:"Isocortex",Name:"Isocortex",t:h,data_change:Rt,data_c:pt.current,col:["RSPv_","FRP_","MOp_","MOs_","SSp_","SSp-n_","SSp-bfd_","SSp-ll_","SSp-m_","SSp-ul_","SSp-tr_","SSp-un_","SSs_","GU_","VISC_","AUDd_","AUDp_","AUDpo_","AUDv_","VISal_","VISam_","VISl_","VISp_","VISpl_","VISpm_","VISli_","VISpor_","ACAd_","ACAv_","PL_","ILA_","ORB_","AId_","AIp_","AIv_","RSPagl_","RSPd_","PTLp_","TEa_","PERI_","ECT_"],row:["1","2/3","5","6a","6b"]}),rn&&S.createElement(Zi,null,"HPF"),S.createElement(ec,{ref:dr[0],className:"HPF",Name:"HPF",t:h,data_change:Rt,data_c:pt.current,col:["CA1_","CA1_dd","CA1_d","CA1_i","CA1_v","CA1_vv","CA2_dd","CA2_d","CA2_i","CA2_v","CA2_vv","CA3_dd","CA3_d","CA3_i","CA3_v","CA3_vv"],row:["so","sp","slu","sr","slm"]}),S.createElement(ec,{ref:dr[1],className:"HPF",Name:"HPF",t:h,data_change:Rt,data_c:pt.current,col:["DG_d","DG_i","DG_V"],row:["mo","sg","po"]}),S.createElement(ec,{ref:dr[2],className:"HPF",Name:"HPF",t:h,data_change:Rt,data_c:pt.current,col:["SUBd_1","SUBv_1","SUBd_2","SUBv_2","SUBd_3","SUBv_3","SUBd_4","SUBv_4","SUBd_","SUBv_"],row:["sp","sr","m"]}),br&&S.createElement(Zi,null,"CNU"),S.createElement(ec,{ref:Cn,className:"CNU",Name:"CNU",t:h,data_change:Rt,data_c:pt.current,col:["CP_","ACBv_","ACBd_","FS_","OTisl_","OTislm_","OT1","OT2","OT3","LSc","LSr_","SF","SH","AAA","BA","CEAc","CEAm","IA","MEAad","MEAav","MEApd","MEApv","GPe","GPi","SI","MA","NDB","TRS","PALc","BSTse","BAC"],row:["_"]}),Vt&&S.createElement(Zi,null,"OLF"),S.createElement(ec,{ref:ur[0],className:"OLF",Name:"OLF",t:h,data_change:Rt,data_c:pt.current,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["gr","mi","ipl","opl","gl"]}),S.createElement(ec,{ref:ur[1],className:"OLF",Name:"OLF",t:h,data_change:Rt,data_c:pt.current,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["1","2","3","4","5","6a","2/3"]}),Gt&&S.createElement(Zi,null,"TH"),S.createElement(ec,{ref:qt,className:"TH",Name:"TH",t:h,data_change:Rt,data_c:pt.current,col:["VAL","VM","VPL","VPLpc","VPM","VPMpc","PoT","SPFm","SPFp","SPA","PP","MGd","MGv","MGm","LGdsh","LGdco","LGdip","LP","PO","POL","SGN","Eth","REth","AV","AMd","AMv","AD","IAM","IAD","LD","IMD","MDc","MDl","MDm","SMT","PR","PVT","PT","RE","Xi","RH","CM","PCN","CL","PF","PIL","RT","IGL","IntG","LGvl","LGvm","SubG","MH","LH","PIN"],row:["_"]}),zr&&S.createElement(Zi,null,"HY"),S.createElement(ec,{ref:zt,className:"HY",Name:"HY",t:h,data_change:Rt,data_c:pt.current,col:["SO","NC","PVHam","PVHmm","PVHpmm","PVHpml","PVHap","PVHmpd","PVHpv","PVa","PVi","ARH","ADP","AHA","AVP","DMHa","DMHp","DMHv","MEPO","MPO","OV","PD","PS","PSCH","PVp","PVpo","SBPV","SCH","SFO","VMPO","VLPO","AVPV","AHNa","AHNc","AHNd","AHNp","LM","MMme","MMl","MMm","MMp","MMd","SUMm","SUMl","TMd","TMv","MPNc","MPNl","MPNm","PMd","PMv","PVHdp","PVHf","PVHlp","PVHmpv","VMHa","VMHc","VMHdm","VMHvl","PH","LHA","LPO","PST","PSTN","RCH","PeF","STN","TU","A13","FF","ZIr","ZIc","ZId","ZIv","ME"],row:["_"]}),Ue&&S.createElement(Zi,null,"MB"),S.createElement(ec,{ref:nn,className:"MB",Name:"MB",t:h,data_change:Rt,data_c:pt.current,col:["SCop","SCsg","SCzo","ICc","ICd","ICe","NB","SAG","PBG","MEV","SCO","SNr","VTA","RR","MRNm","MRNmg","MRNp","SCdg","SCdw","SCiw","SCig-a","SCig-b","SCig-c","PRC","INC","ND","Su3","PAGdm","PAGl","PAGvl","PAGdl","PAGvm","APN","MPT","NOT","NPC","OP","PPT","RPF","InCo","CUN","RN","III","MA3","EW","IV","PA4","VTN","AT","LT","DT","MT","SNl","SNc","PPN","IF","IPR","IPC","IPA","IPL","IPI","IPDM","IPDL","IPRL","RL","CLI","DR"],row:["_"]}),bn&&S.createElement(Zi,null,"HB"),S.createElement(ec,{ref:Ln,className:"HB",Name:"HB",t:h,data_change:Rt,data_c:pt.current,col:["NLLd","NLLh","NLLv","PSV","KF","PBlc","PBld","PBle","PBls","PBlv","PBme","PBmm","PBmv","POR","SOCm","SOCl","B","DTN","LTN","PDTg","PCG","PG","PRNc","PRNv","SG","SSN","SUT","TRN","V","P5","Acs5","PC5","I5","CSl","CSm","LC","LDT","NI","PRNr","RPO","SLC","SLD","AP","CNlam","CNspg","DCO","VCO","CU","GR","ECU","NTB","NTSce","NTSco","NTSge","NTSl","NTSm","SPVC","SPVI","SPVOcdm","SPVOmdmd","SPVOmdmv","SPVOrdm","SPVOvl","Pa5","z","VI","ACVI","VII","ACVII","EV","AMBd","AMBv","DMX","ECO","GRN","ICB","IO","LRNm","LRNp","ISN","LIN","IRN","MARN","MDRNd","MDRNv","PARN","PAS","PGRNd","PGRNl","NIS","NR","PRP","PMR","PPYd","PPYs","LAV","MV","SPIV","SUV","XII","x","y","RM","RPA","RO"],row:["_"]}),Kn&&S.createElement(Zi,null,"CB"),S.createElement(ec,{ref:Gn[0],className:"CB",Name:"CB",t:h,data_change:Rt,data_c:pt.current,col:["LING_","LING_","CENT2_","CENT2_","CENT3_","CENT3_","CUL4/5_","CUL4/5_","DEC_","DEC_","FOTU_","FOTU_","PYR_","PYR_","UVU_","UVU_","NOD_","NOD_","SIM_","SIM_","ANcr1_","ANcr1_","ANcr2_","ANcr2_","PRM_","PRM_","COPY_","COPY_","PFL_","PFL_","FL_","FL_","IP","DN"],row:["gr","mo"]}),S.createElement(ec,{ref:Gn[1],className:"CB",Name:"CB",t:h,data_change:Rt,data_c:pt.current,col:["FN","IP","DN","VeCB"],row:["_"]})),S.createElement(tH,{tab:h("5000.7011")||"神经元投射模式",key:"2"},r?S.createElement(Cze,{data:Pn,fbxTreeDatas:r}):null),S.createElement(tH,{tab:h("5000.7012")||"投射长度分布",key:"3"},kn&&S.createElement(Zi,null,"Isocortex"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["RSPv_","FRP_","MOp_","MOs_","SSp_","SSp-n_","SSp-bfd_","SSp-ll_","SSp-m_","SSp-ul_","SSp-tr_","SSp-un_","SSs_","GU_","VISC_","AUDd_","AUDp_","AUDpo_","AUDv_","VISal_","VISam_","VISl_","VISp_","VISpl_","VISpm_","VISli_","VISpor_","ACAd_","ACAv_","PL_","ILA_","ORB_","AId_","AIp_","AIv_","RSPagl_","RSPd_","PTLp_","TEa_","PERI_","ECT_"],row:["1","2/3","5","6a","6b"]}),rn&&S.createElement(Zi,null,"HPF"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["CA1_d","CA1_i","CA1_v","CA1_","CA3_dd","CA3_d","CA3_i","CA3_v","CA3_vv","CA2_"],row:["so","sp","slu","sr","slm"]}),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["DG_d","DG_i","DG_V"],row:["mo","sg","po"]}),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["SUBd_1","SUBv_1","SUBd_2","SUBv_2","SUBd_3","SUBv_3","SUBd_4","SUBv_4","SUBd_","SUBv_"],row:["sp","sr","m"]}),br&&S.createElement(Zi,null,"CNU"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["CP_","ACBv_","ACBd_","FS_","OTisl_","OTislm_","OT1","OT2","OT3","LSc","LSr_","SF","SH","AAA","BA","CEAc","CEAm","IA","MEAad","MEAav","MEApd","MEApv","GPe","GPi","SI","MA","NDB","TRS","PALc","BSTse","BAC"],row:["_"]}),Vt&&S.createElement(Zi,null,"OLF"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["gr","mi","ipl","opl","gl"]}),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["1","2","3","4","5","6a","2/3"]}),Gt&&S.createElement(Zi,null,"TH"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["VAL","VM","VPL","VPLpc","VPM","VPMpc","PoT","SPFm","SPFp","SPA","PP","MGd","MGv","MGm","LGdsh","LGdco","LGdip","LP","PO","POL","SGN","Eth","REth","AV","AMd","AMv","AD","IAM","IAD","LD","IMD","MDc","MDl","MDm","SMT","PR","PVT","PT","RE","Xi","RH","CM","PCN","CL","PF","PIL","RT","IGL","IntG","LGvl","LGvm","SubG","MH","LH","PIN"],row:["_"]}),zr&&S.createElement(Zi,null,"HY"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["SO","NC","PVHam","PVHmm","PVHpmm","PVHpml","PVHap","PVHmpd","PVHpv","PVa","PVi","ARH","ADP","AHA","AVP","DMHa","DMHp","DMHv","MEPO","MPO","OV","PD","PS","PSCH","PVp","PVpo","SBPV","SCH","SFO","VMPO","VLPO","AVPV","AHNa","AHNc","AHNd","AHNp","LM","MMme","MMl","MMm","MMp","MMd","SUMm","SUMl","TMd","TMv","MPNc","MPNl","MPNm","PMd","PMv","PVHdp","PVHf","PVHlp","PVHmpv","VMHa","VMHc","VMHdm","VMHvl","PH","LHA","LPO","PST","PSTN","RCH","PeF","STN","TU","A13","FF","ZIr","ZIc","ZId","ZIv","ME"],row:["_"]}),Ue&&S.createElement(Zi,null,"MB"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["SCop","SCsg","SCzo","ICc","ICd","ICe","NB","SAG","PBG","MEV","SCO","SNr","VTA","RR","MRNm","MRNmg","MRNp","SCdg","SCdw","SCiw","SCig-a","SCig-b","SCig-c","PRC","INC","ND","Su3","PAGdm","PAGl","PAGvl","PAGdl","PAGvm","APN","MPT","NOT","NPC","OP","PPT","RPF","InCo","CUN","RN","III","MA3","EW","IV","PA4","VTN","AT","LT","DT","MT","SNl","SNc","PPN","IF","IPR","IPC","IPA","IPL","IPI","IPDM","IPDL","IPRL","RL","CLI","DR"],row:["_"]}),bn&&S.createElement(Zi,null,"HB"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["NLLd","NLLh","NLLv","PSV","KF","PBlc","PBld","PBle","PBls","PBlv","PBme","PBmm","PBmv","POR","SOCm","SOCl","B","DTN","LTN","PDTg","PCG","PG","PRNc","PRNv","SG","SSN","SUT","TRN","V","P5","Acs5","PC5","I5","CSl","CSm","LC","LDT","NI","PRNr","RPO","SLC","SLD","AP","CNlam","CNspg","DCO","VCO","CU","GR","ECU","NTB","NTSce","NTSco","NTSge","NTSl","NTSm","SPVC","SPVI","SPVOcdm","SPVOmdmd","SPVOmdmv","SPVOrdm","SPVOvl","Pa5","z","VI","ACVI","VII","ACVII","EV","AMBd","AMBv","DMX","ECO","GRN","ICB","IO","LRNm","LRNp","ISN","LIN","IRN","MARN","MDRNd","MDRNv","PARN","PAS","PGRNd","PGRNl","NIS","NR","PRP","PMR","PPYd","PPYs","LAV","MV","SPIV","SUV","XII","x","y","RM","RPA","RO"],row:["_"]}),Kn&&S.createElement(Zi,null,"CB"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["LING_","LING_","CENT2_","CENT2_","CENT3_","CENT3_","CUL4/5_","CUL4/5_","DEC_","DEC_","FOTU_","FOTU_","PYR_","PYR_","UVU_","UVU_","NOD_","NOD_","SIM_","SIM_","ANcr1_","ANcr1_","ANcr2_","ANcr2_","PRM_","PRM_","COPY_","COPY_","PFL_","PFL_","FL_","FL_","IP","DN"],row:["gr","mo"]}),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["FN","IP","DN","VeCB"],row:["_"]})))),S.createElement(B6,{className:"SwcTable",rowSelection:An,columns:ai,dataSource:xa,locale:dn}),S.createElement("div",{style:{top:0,left:0,width:310,height:"100vh",display:Xn?"block":"none",zIndex:998,overflowX:"hidden",position:"absolute",background:"#fff"}},S.createElement(Na,{type:"text",shape:"circle",icon:S.createElement(Z0,null),style:{position:"absolute",right:4,top:4},onClick:()=>{gr(!1),hr.current=[];let we=document.getElementById("leftContent");we&&(we.style.overflowY="auto"),be.current.traverse(je=>{je.myMeshType==="SWC"&&je.traverse(Je=>{Je instanceof ha&&Je.material.color.set(je.userData.initColor)})})}}),S.createElement("div",{style:{marginTop:40}},S.createElement("h1",{style:{marginLeft:15,margin:0,display:"block",textAlign:"center"}},h("5000.7052")||"基于神经元形态的聚类及评估"),S.createElement("div",{style:{display:"flex",justifyContent:"center",marginTop:10}},S.createElement("a",{onClick:()=>{vo.info({title:h("5000.7061")||"Introduction",content:S.createElement("div",null,S.createElement("p",null,h("5000.7056")||"折线图:本图根据投射靶区分布情况,对所选单神经元进行了不同数量的聚类,并对聚类结果使用轮廓系数进行了评估。通常来说,轮廓系数越大,表示聚类效果越好。您可以点击鼠标左键,选中一个您满意的聚类数。"))})}},h("5000.7061")||"使用说明"))),S.createElement("div",{ref:xi,style:{width:"100%",height:"300px"}}),S.createElement("div",null,S.createElement("h1",{style:{marginLeft:25,margin:0,display:"block",textAlign:"center"}},h("5000.7059")||"聚类神经元的降维与可视化"),S.createElement("div",{style:{display:"flex",justifyContent:"center",marginTop:10}},S.createElement("a",{onClick:()=>{vo.info({title:h("5000.7061")||"使用说明",content:S.createElement("div",null,S.createElement("p",null,h("5000.7060")||"点状图:本图根据t-SNE算法,将神经元以散点形式绘制在了由2个主成分所构成的分布图上,每种颜色代表1个类别。点击分布图中的任意一个点,该点所对应的神经元将在主窗口中被重新渲染为所属类别的颜色。点击分布图上方代表任意一个类别的色块,所有属于该类别的神经元都将在主窗口中被重新渲染为该类别的颜色。"))})}},h("5000.7061")||"使用说明"))),S.createElement("div",{ref:lr,style:{width:"100%",height:"440px"}})))):S.createElement(S.Fragment,null,S.createElement(wtn,{style:{marginBottom:8},placeholder:"Search",onChange:Oi,onKeyPress:we=>{we.stopPropagation()}}),S.createElement(N_,{showLine:!0,onExpand:zo,defaultExpandParent:!0,expandedKeys:Z,onCheck:Ci,checkable:!0,selectable:!1,treeData:xa,checkedKeys:v,checkStrictly:!0,autoExpandParent:ee,style:{paddingLeft:"2px"}})))});let Rtn=new URL(window.location.href),Otn=new URLSearchParams(Rtn.search),BSe=Otn.get("brainContourOpacity");const Ltn=t=>{const{regionData:e}=t,[n,r]=S.useState(!1);return S.useEffect(()=>{let i=BSe?JSON.parse(BSe):.3;Sy({filepath:e+"/data/FBX/outline.FBX",index:"Brain",color:"0xcccccc",opacity:i,offsetZ:0,R:1,callback:function(){r(!1)}})},[]),S.createElement("div",{id:"spinner",style:{position:"absolute",zIndex:999,left:0,top:0,width:"100%",height:"100%",display:`${n?"block":"none"}`,opacity:.7,backgroundColor:"#ffffff"}},S.createElement("div",{style:{position:"absolute",zIndex:999,left:"50%",top:"50%",fontWeight:"bold",textAlign:"center"}},S.createElement(gD,{spinning:!0,size:"large"}),S.createElement("br",null),"Loading....wait..."))};(function(t){if(t.TextEncoder&&t.TextDecoder)return!1;function e(r="utf-8"){if(r!=="utf-8")throw new RangeError(`Failed to construct 'TextEncoder': The encoding label provided ('${r}') is invalid.`)}Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(r,i={stream:!1}){if(i.stream)throw new Error("Failed to encode: the 'stream' option is unsupported.");let a=0;const o=r.length;let s=0,l=Math.max(32,o+(o>>1)+7),u=new Uint8Array(l>>3<<3);for(;a<o;){let d=r.charCodeAt(a++);if(d>=55296&&d<=56319){if(a<o){const f=r.charCodeAt(a);(f&64512)===56320&&(++a,d=((d&1023)<<10)+(f&1023)+65536)}if(d>=55296&&d<=56319)continue}if(s+4>u.length){l+=8,l*=1+a/r.length*2,l=l>>3<<3;const f=new Uint8Array(l);f.set(u),u=f}if(d&4294967168)if(!(d&4294965248))u[s++]=d>>6&31|192;else if(!(d&4294901760))u[s++]=d>>12&15|224,u[s++]=d>>6&63|128;else if(!(d&4292870144))u[s++]=d>>18&7|240,u[s++]=d>>12&63|128,u[s++]=d>>6&63|128;else continue;else{u[s++]=d;continue}u[s++]=d&63|128}return u.slice(0,s)};function n(r="utf-8",i={fatal:!1}){if(r!=="utf-8")throw new RangeError(`Failed to construct 'TextDecoder': The encoding label provided ('${r}') is invalid.`);if(i.fatal)throw new Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(r,i={stream:!1}){if(i.stream)throw new Error("Failed to decode: the 'stream' option is unsupported.");const a=new Uint8Array(r);let o=0;const s=a.length,l=[];for(;o<s;){const u=a[o++];if(u===0)break;if(!(u&128))l.push(u);else if((u&224)===192){const d=a[o++]&63;l.push((u&31)<<6|d)}else if((u&240)===224){const d=a[o++]&63,f=a[o++]&63;l.push((u&31)<<12|d<<6|f)}else if((u&248)===240){const d=a[o++]&63,f=a[o++]&63,p=a[o++]&63;let h=(u&7)<<18|d<<12|f<<6|p;h>65535&&(h-=65536,l.push(h>>>10&1023|55296),h=56320|h&1023),l.push(h)}}return String.fromCharCode.apply(null,l)},t.TextEncoder=e,t.TextDecoder=n})(typeof window<"u"?window:typeof self<"u"?self:globalThis);function $Se(t,e="utf8"){return new TextDecoder(e).decode(t)}const Ntn=new TextEncoder;function Mtn(t){return Ntn.encode(t)}const Ptn=1024*8,Dtn=(()=>{const t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),iH={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class Ak{constructor(e=Ptn,n={}){let r=!1;typeof e=="number"?e=new ArrayBuffer(e):(r=!0,this.lastWrittenByte=e.byteLength);const i=n.offset?n.offset>>>0:0,a=e.byteLength-i;let o=i;(ArrayBuffer.isView(e)||e instanceof Ak)&&(e.byteLength!==e.buffer.byteLength&&(o=e.byteOffset+i),e=e.buffer),r?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=e,this.length=a,this.byteLength=a,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const r=(this.offset+e)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,n){const r=iH[n].BYTES_PER_ELEMENT*e,i=this.byteOffset+this.offset,a=this.buffer.slice(i,i+r);if(this.littleEndian===Dtn&&n!=="uint8"&&n!=="int8"){const s=new Uint8Array(this.buffer.slice(i,i+r));s.reverse();const l=new iH[n](s.buffer);return this.offset+=r,l.reverse(),l}const o=new iH[n](a);return this.offset+=r,o}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let n="";for(let r=0;r<e;r++)n+=this.readChar();return n}readUtf8(e=1){return $Se(this.readBytes(e))}decodeText(e=1,n="utf-8"){return $Se(this.readBytes(e),n)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let n=0;n<e.length;n++)this._data.setUint8(this.offset++,e[n]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let n=0;n<e.length;n++)this.writeUint8(e.charCodeAt(n));return this}writeUtf8(e){return this.writeBytes(Mtn(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function ktn(t){if(t.compression!==1)throw new Error("missing mandatory StripByteCounts field in compressed image");const e=t.rowsPerStrip*t.width*t.samplesPerPixel*(t.bitsPerSample/8);return new Array(t.stripOffsets.length).fill(e)}function Utn(t,e,n){let r=0;for(;r<t.length;){for(let i=n;i<e*n;i+=n)for(let a=0;a<n;a++)t[r+i+a]=t[r+i+a]+t[r+i-(n-a)]&255;r+=e*n}}function Ftn(t,e,n){let r=0;for(;r<t.length;){for(let i=n;i<e*n;i+=n)for(let a=0;a<n;a++)t[r+i+a]=t[r+i+a]+t[r+i-(n-a)]&65535;r+=e*n}}const XQ={33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",36864:"ExifVersion",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBiasValue",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",37396:"SubjectArea",37500:"MakerNote",37510:"UserComment",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42240:"Gamma"},xze={};for(const t in XQ)xze[XQ[t]]=Number(t);const Btn=Object.freeze(Object.defineProperty({__proto__:null,tagsById:XQ,tagsByName:xze},Symbol.toStringTag,{value:"Module"})),ZQ={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},_ze={};for(const t in ZQ)_ze[ZQ[t]]=Number(t);const $tn=Object.freeze(Object.defineProperty({__proto__:null,tagsById:ZQ,tagsByName:_ze},Symbol.toStringTag,{value:"Module"})),qQ={254:"NewSubfileType",255:"SubfileType",256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:"Threshholding",264:"CellWidth",265:"CellLength",266:"FillOrder",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",288:"FreeOffsets",289:"FreeByteCounts",290:"GrayResponseUnit",291:"GrayResponseCurve",296:"ResolutionUnit",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",320:"ColorMap",338:"ExtraSamples",33432:"Copyright",269:"DocumentName",285:"PageName",286:"XPosition",287:"YPosition",292:"T4Options",293:"T6Options",297:"PageNumber",301:"TransferFunction",317:"Predictor",318:"WhitePoint",319:"PrimaryChromaticities",321:"HalftoneHints",322:"TileWidth",323:"TileLength",324:"TileOffsets",325:"TileByteCounts",326:"BadFaxLines",327:"CleanFaxData",328:"ConsecutiveBadFaxLines",330:"SubIFDs",332:"InkSet",333:"InkNames",334:"NumberOfInks",336:"DotRange",337:"TargetPrinter",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",342:"TransferRange",343:"ClipPath",344:"XClipPathUnits",345:"YClipPathUnits",346:"Indexed",347:"JPEGTables",351:"OPIProxy",400:"GlobalParametersIFD",401:"ProfileType",402:"FaxProfile",403:"CodingMethods",404:"VersionYear",405:"ModeNumber",433:"Decode",434:"DefaultImageColor",512:"JPEGProc",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",515:"JPEGRestartInterval",517:"JPEGLosslessPredictors",518:"JPEGPointTransforms",519:"JPEGQTables",520:"JPEGDCTables",521:"JPEGACTables",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite",559:"StripRowCounts",700:"XMP",32781:"ImageID",34732:"ImageLayer",32932:"WangAnnotatio",33445:"MDFileTag",33446:"MDScalePixel",33447:"MDColorTable",33448:"MDLabName",33449:"MDSampleInfo",33450:"MDPrepDate",33451:"MDPrepTime",33452:"MDFileUnits",33550:"ModelPixelScaleTag",33723:"IPTC",33918:"INGRPacketDataTag",33919:"INGRFlagRegisters",33920:"IrasBTransformationMatrix",33922:"ModelTiepointTag",34264:"ModelTransformationTag",34377:"Photoshop",34665:"ExifIFD",34675:"ICCProfile",34735:"GeoKeyDirectoryTag",34736:"GeoDoubleParamsTag",34737:"GeoAsciiParamsTag",34853:"GPSIFD",34908:"HylaFAXFaxRecvParams",34909:"HylaFAXFaxSubAddress",34910:"HylaFAXFaxRecvTime",37724:"ImageSourceData",40965:"InteroperabilityIFD",42112:"GDAL_METADATA",42113:"GDAL_NODATA",50215:"OceScanjobDescription",50216:"OceApplicationSelector",50217:"OceIdentificationNumber",50218:"OceImageLogicCharacteristics",50706:"DNGVersion",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50710:"CFAPlaneColor",50711:"CFALayout",50712:"LinearizationTable",50713:"BlackLevelRepeatDim",50714:"BlackLevel",50715:"BlackLevelDeltaH",50716:"BlackLevelDeltaV",50717:"WhiteLevel",50718:"DefaultScale",50719:"DefaultCropOrigin",50720:"DefaultCropSize",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50733:"BayerGreenSplit",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"LensInfo",50737:"ChromaBlurRadius",50738:"AntiAliasStrength",50740:"DNGPrivateData",50741:"MakerNoteSafety",50778:"CalibrationIlluminant1",50779:"CalibrationIlluminant2",50780:"BestQualityScale",50784:"AliasLayerMetadata"},wze={};for(const t in qQ)wze[qQ[t]]=Number(t);const Vtn=Object.freeze(Object.defineProperty({__proto__:null,tagsById:qQ,tagsByName:wze},Symbol.toStringTag,{value:"Module"})),VSe={standard:Vtn,exif:Btn,gps:$tn};class Tze{constructor(e){if(!e)throw new Error("missing kind");this.data=new Uint8Array,this.fields=new Map,this.kind=e,this._hasMap=!1,this._map={}}get(e){if(typeof e=="number")return this.fields.get(e);if(typeof e=="string")return this.fields.get(VSe[this.kind].tagsByName[e]);throw new Error("expected a number or string")}get map(){if(!this._hasMap){const e=VSe[this.kind].tagsById;for(const n of this.fields.keys())e[n]&&(this._map[e[n]]=this.fields.get(n));this._hasMap=!0}return this._map}}const Ize=new Map([[1,[1,zSe]],[2,[1,Gtn]],[3,[2,jtn]],[4,[4,Wtn]],[5,[8,Xtn]],[6,[1,Ztn]],[7,[1,zSe]],[8,[2,qtn]],[9,[4,Ytn]],[10,[8,Ktn]],[11,[4,Jtn]],[12,[8,Qtn]]]);function ztn(t,e){const n=Ize.get(t);if(!n)throw new Error(`type not found: ${t}`);return n[0]*e}function Htn(t,e,n){const r=Ize.get(e);if(!r)throw new Error(`type not found: ${e}`);return r[1](t,n)}function zSe(t,e){if(e===1)return t.readUint8();const n=new Uint8Array(e);for(let r=0;r<e;r++)n[r]=t.readUint8();return n}function Gtn(t,e){const n=[];let r="";for(let i=0;i<e;i++){const a=String.fromCharCode(t.readUint8());a==="\0"?(n.push(r),r=""):r+=a}return n.length===1?n[0]:n}function jtn(t,e){if(e===1)return t.readUint16();const n=new Uint16Array(e);for(let r=0;r<e;r++)n[r]=t.readUint16();return n}function Wtn(t,e){if(e===1)return t.readUint32();const n=new Uint32Array(e);for(let r=0;r<e;r++)n[r]=t.readUint32();return n}function Xtn(t,e){if(e===1)return t.readUint32()/t.readUint32();const n=new Array(e);for(let r=0;r<e;r++)n[r]=t.readUint32()/t.readUint32();return n}function Ztn(t,e){if(e===1)return t.readInt8();const n=new Int8Array(e);for(let r=0;r<e;r++)n[r]=t.readInt8();return n}function qtn(t,e){if(e===1)return t.readInt16();const n=new Int16Array(e);for(let r=0;r<e;r++)n[r]=t.readInt16();return n}function Ytn(t,e){if(e===1)return t.readInt32();const n=new Int32Array(e);for(let r=0;r<e;r++)n[r]=t.readInt32();return n}function Ktn(t,e){if(e===1)return t.readInt32()/t.readInt32();const n=new Array(e);for(let r=0;r<e;r++)n[r]=t.readInt32()/t.readInt32();return n}function Jtn(t,e){if(e===1)return t.readFloat32();const n=new Float32Array(e);for(let r=0;r<e;r++)n[r]=t.readFloat32();return n}function Qtn(t,e){if(e===1)return t.readFloat64();const n=new Float64Array(e);for(let r=0;r<e;r++)n[r]=t.readFloat64();return n}const enn=256,HSe=257,GSe=258,jSe=9;let ME=[];function tnn(){if(ME.length===0){for(let e=0;e<256;e++)ME.push([e]);const t=[];for(let e=256;e<4096;e++)ME.push(t)}}const nnn=[511,1023,2047,4095],rnn=[0,0,0,0,0,0,0,0,0,511,1023,2047,4095];class inn{constructor(e){this.nextData=0,this.nextBits=0,this.bytePointer=0,this.tableLength=GSe,this.currentBitLength=jSe,this.stripArray=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.outData=new Ak(e.byteLength),this.initializeTable()}decode(){let e=0,n=0;for(;(e=this.getNextCode())!==HSe;)if(e===enn){if(this.initializeTable(),e=this.getNextCode(),e===HSe)break;this.writeString(this.stringFromCode(e)),n=e}else if(this.isInTable(e))this.writeString(this.stringFromCode(e)),this.addStringToTable(this.stringFromCode(n).concat(this.stringFromCode(e)[0])),n=e;else{const i=this.stringFromCode(n).concat(this.stringFromCode(n)[0]);this.writeString(i),this.addStringToTable(i),n=e}const r=this.outData.toArray();return new DataView(r.buffer,r.byteOffset,r.byteLength)}initializeTable(){tnn(),this.tableLength=GSe,this.currentBitLength=jSe}writeString(e){this.outData.writeBytes(e)}stringFromCode(e){return ME[e]}isInTable(e){return e<this.tableLength}addStringToTable(e){if(ME[this.tableLength++]=e,ME.length>4096)throw ME=[],new Error("LZW decoding error. Please open an issue at https://github.com/image-js/tiff/issues/new/choose (include a test image).");this.tableLength===rnn[this.currentBitLength]&&this.currentBitLength++}getNextCode(){this.nextData=this.nextData<<8|this.stripArray[this.bytePointer++]&255,this.nextBits+=8,this.nextBits<this.currentBitLength&&(this.nextData=this.nextData<<8|this.stripArray[this.bytePointer++]&255,this.nextBits+=8);const e=this.nextData>>this.nextBits-this.currentBitLength&nnn[this.currentBitLength-9];return this.nextBits-=this.currentBitLength,this.bytePointer>this.stripArray.length?257:e}}function ann(t){return new inn(t).decode()}const onn=/^(\d{4}):(\d{2}):(\d{2}) (\d{2}):(\d{2}):(\d{2})$/;class WSe extends Tze{constructor(){super("standard")}get size(){return this.width*this.height}get width(){return this.imageWidth}get height(){return this.imageLength}get components(){return this.samplesPerPixel}get date(){const e=new Date,n=onn.exec(this.dateTime);if(n===null)throw new Error(`invalid dateTime: ${this.dateTime}`);return e.setFullYear(Number(n[1]),Number(n[2])-1,Number(n[3])),e.setHours(Number(n[4]),Number(n[5]),Number(n[6])),e}get newSubfileType(){return this.get("NewSubfileType")}get imageWidth(){return this.get("ImageWidth")}get imageLength(){return this.get("ImageLength")}get bitsPerSample(){const e=this.get("BitsPerSample");return e&&typeof e!="number"?e[0]:e}get alpha(){const e=this.extraSamples;return e?e[0]!==0:!1}get associatedAlpha(){const e=this.extraSamples;return e?e[0]===1:!1}get extraSamples(){return oL(this.get("ExtraSamples"))}get compression(){return this.get("Compression")||1}get type(){return this.get("PhotometricInterpretation")}get fillOrder(){return this.get("FillOrder")||1}get documentName(){return this.get("DocumentName")}get imageDescription(){return this.get("ImageDescription")}get stripOffsets(){return oL(this.get("StripOffsets"))}get orientation(){return this.get("Orientation")}get samplesPerPixel(){return this.get("SamplesPerPixel")||1}get rowsPerStrip(){return this.get("RowsPerStrip")}get stripByteCounts(){return oL(this.get("StripByteCounts"))}get minSampleValue(){return this.get("MinSampleValue")||0}get maxSampleValue(){return this.get("MaxSampleValue")||2**this.bitsPerSample-1}get xResolution(){return this.get("XResolution")}get yResolution(){return this.get("YResolution")}get planarConfiguration(){return this.get("PlanarConfiguration")||1}get resolutionUnit(){return this.get("ResolutionUnit")||2}get dateTime(){return this.get("DateTime")}get predictor(){return this.get("Predictor")||1}get sampleFormat(){return oL(this.get("SampleFormat")||1)[0]}get sMinSampleValue(){return this.get("SMinSampleValue")||this.minSampleValue}get sMaxSampleValue(){return this.get("SMaxSampleValue")||this.maxSampleValue}get palette(){const e=2**this.bitsPerSample,n=this.get("ColorMap");if(!n)return;if(n.length!==3*e)throw new Error(`ColorMap size must be ${e}`);const r=[];for(let i=0;i<e;i++)r.push([n[i],n[i+e],n[i+2*e]]);return r}}function oL(t){return typeof t=="number"?[t]:t}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const snn=4,XSe=0,ZSe=1,lnn=2;function Qw(t){let e=t.length;for(;--e>=0;)t[e]=0}const cnn=0,Aze=1,unn=2,dnn=3,fnn=258,Xae=29,p8=256,e6=p8+1+Xae,d_=30,Zae=19,Rze=2*e6+1,PE=15,aH=16,pnn=7,qae=256,Oze=16,Lze=17,Nze=18,YQ=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),VN=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),hnn=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Mze=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gnn=512,Fv=new Array((e6+2)*2);Qw(Fv);const DI=new Array(d_*2);Qw(DI);const t6=new Array(gnn);Qw(t6);const n6=new Array(fnn-dnn+1);Qw(n6);const Yae=new Array(Xae);Qw(Yae);const D7=new Array(d_);Qw(D7);function oH(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let Pze,Dze,kze;function sH(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const Uze=t=>t<256?t6[t]:t6[256+(t>>>7)],r6=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},Lp=(t,e,n)=>{t.bi_valid>aH-n?(t.bi_buf|=e<<t.bi_valid&65535,r6(t,t.bi_buf),t.bi_buf=e>>aH-t.bi_valid,t.bi_valid+=n-aH):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},I0=(t,e,n)=>{Lp(t,n[e*2],n[e*2+1])},Fze=(t,e)=>{let n=0;do n|=t&1,t>>>=1,n<<=1;while(--e>0);return n>>>1},mnn=t=>{t.bi_valid===16?(r6(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},vnn=(t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,l=e.stat_desc.max_length;let u,d,f,p,h,g,y=0;for(p=0;p<=PE;p++)t.bl_count[p]=0;for(n[t.heap[t.heap_max]*2+1]=0,u=t.heap_max+1;u<Rze;u++)d=t.heap[u],p=n[n[d*2+1]*2+1]+1,p>l&&(p=l,y++),n[d*2+1]=p,!(d>r)&&(t.bl_count[p]++,h=0,d>=s&&(h=o[d-s]),g=n[d*2],t.opt_len+=g*(p+h),a&&(t.static_len+=g*(i[d*2+1]+h)));if(y!==0){do{for(p=l-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[l]--,y-=2}while(y>0);for(p=l;p!==0;p--)for(d=t.bl_count[p];d!==0;)f=t.heap[--u],!(f>r)&&(n[f*2+1]!==p&&(t.opt_len+=(p-n[f*2+1])*n[f*2],n[f*2+1]=p),d--)}},Bze=(t,e,n)=>{const r=new Array(PE+1);let i=0,a,o;for(a=1;a<=PE;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=Fze(r[s]++,s))}},ynn=()=>{let t,e,n,r,i;const a=new Array(PE+1);for(n=0,r=0;r<Xae-1;r++)for(Yae[r]=n,t=0;t<1<<YQ[r];t++)n6[n++]=r;for(n6[n-1]=r,i=0,r=0;r<16;r++)for(D7[r]=i,t=0;t<1<<VN[r];t++)t6[i++]=r;for(i>>=7;r<d_;r++)for(D7[r]=i<<7,t=0;t<1<<VN[r]-7;t++)t6[256+i++]=r;for(e=0;e<=PE;e++)a[e]=0;for(t=0;t<=143;)Fv[t*2+1]=8,t++,a[8]++;for(;t<=255;)Fv[t*2+1]=9,t++,a[9]++;for(;t<=279;)Fv[t*2+1]=7,t++,a[7]++;for(;t<=287;)Fv[t*2+1]=8,t++,a[8]++;for(Bze(Fv,e6+1,a),t=0;t<d_;t++)DI[t*2+1]=5,DI[t*2]=Fze(t,5);Pze=new oH(Fv,YQ,p8+1,e6,PE),Dze=new oH(DI,VN,0,d_,PE),kze=new oH(new Array(0),hnn,0,Zae,pnn)},$ze=t=>{let e;for(e=0;e<e6;e++)t.dyn_ltree[e*2]=0;for(e=0;e<d_;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Zae;e++)t.bl_tree[e*2]=0;t.dyn_ltree[qae*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Vze=t=>{t.bi_valid>8?r6(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},qSe=(t,e,n,r)=>{const i=e*2,a=n*2;return t[i]<t[a]||t[i]===t[a]&&r[e]<=r[n]},lH=(t,e,n)=>{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i<t.heap_len&&qSe(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!qSe(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r},YSe=(t,e,n)=>{let r,i,a=0,o,s;if(t.sym_next!==0)do r=t.pending_buf[t.sym_buf+a++]&255,r+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],r===0?I0(t,i,e):(o=n6[i],I0(t,o+p8+1,e),s=YQ[o],s!==0&&(i-=Yae[o],Lp(t,i,s)),r--,o=Uze(r),I0(t,o,n),s=VN[o],s!==0&&(r-=D7[o],Lp(t,r,s)));while(a<t.sym_next);I0(t,qae,e)},KQ=(t,e)=>{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems;let o,s,l=-1,u;for(t.heap_len=0,t.heap_max=Rze,o=0;o<a;o++)n[o*2]!==0?(t.heap[++t.heap_len]=l=o,t.depth[o]=0):n[o*2+1]=0;for(;t.heap_len<2;)u=t.heap[++t.heap_len]=l<2?++l:0,n[u*2]=1,t.depth[u]=0,t.opt_len--,i&&(t.static_len-=r[u*2+1]);for(e.max_code=l,o=t.heap_len>>1;o>=1;o--)lH(t,n,o);u=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],lH(t,n,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,n[u*2]=n[o*2]+n[s*2],t.depth[u]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,n[o*2+1]=n[s*2+1]=u,t.heap[1]=u++,lH(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],vnn(t,e),Bze(n,l,t.bl_count)},KSe=(t,e,n)=>{let r,i=-1,a,o=e[0*2+1],s=0,l=7,u=4;for(o===0&&(l=138,u=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=e[(r+1)*2+1],!(++s<l&&a===o)&&(s<u?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[Oze*2]++):s<=10?t.bl_tree[Lze*2]++:t.bl_tree[Nze*2]++,s=0,i=a,o===0?(l=138,u=3):a===o?(l=6,u=3):(l=7,u=4))},JSe=(t,e,n)=>{let r,i=-1,a,o=e[0*2+1],s=0,l=7,u=4;for(o===0&&(l=138,u=3),r=0;r<=n;r++)if(a=o,o=e[(r+1)*2+1],!(++s<l&&a===o)){if(s<u)do I0(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(I0(t,a,t.bl_tree),s--),I0(t,Oze,t.bl_tree),Lp(t,s-3,2)):s<=10?(I0(t,Lze,t.bl_tree),Lp(t,s-3,3)):(I0(t,Nze,t.bl_tree),Lp(t,s-11,7));s=0,i=a,o===0?(l=138,u=3):a===o?(l=6,u=3):(l=7,u=4)}},bnn=t=>{let e;for(KSe(t,t.dyn_ltree,t.l_desc.max_code),KSe(t,t.dyn_dtree,t.d_desc.max_code),KQ(t,t.bl_desc),e=Zae-1;e>=3&&t.bl_tree[Mze[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},Enn=(t,e,n,r)=>{let i;for(Lp(t,e-257,5),Lp(t,n-1,5),Lp(t,r-4,4),i=0;i<r;i++)Lp(t,t.bl_tree[Mze[i]*2+1],3);JSe(t,t.dyn_ltree,e-1),JSe(t,t.dyn_dtree,n-1)},Snn=t=>{let e=4093624447,n;for(n=0;n<=31;n++,e>>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return XSe;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return ZSe;for(n=32;n<p8;n++)if(t.dyn_ltree[n*2]!==0)return ZSe;return XSe};let QSe=!1;const Cnn=t=>{QSe||(ynn(),QSe=!0),t.l_desc=new sH(t.dyn_ltree,Pze),t.d_desc=new sH(t.dyn_dtree,Dze),t.bl_desc=new sH(t.bl_tree,kze),t.bi_buf=0,t.bi_valid=0,$ze(t)},zze=(t,e,n,r)=>{Lp(t,(cnn<<1)+(r?1:0),3),Vze(t),r6(t,n),r6(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},xnn=t=>{Lp(t,Aze<<1,3),I0(t,qae,Fv),mnn(t)},_nn=(t,e,n,r)=>{let i,a,o=0;t.level>0?(t.strm.data_type===lnn&&(t.strm.data_type=Snn(t)),KQ(t,t.l_desc),KQ(t,t.d_desc),o=bnn(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&e!==-1?zze(t,e,n,r):t.strategy===snn||a===i?(Lp(t,(Aze<<1)+(r?1:0),3),YSe(t,Fv,DI)):(Lp(t,(unn<<1)+(r?1:0),3),Enn(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),YSe(t,t.dyn_ltree,t.dyn_dtree)),$ze(t),r&&Vze(t)},wnn=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(n6[n]+p8+1)*2]++,t.dyn_dtree[Uze(e)*2]++),t.sym_next===t.sym_end);var Tnn=Cnn,Inn=zze,Ann=_nn,Rnn=wnn,Onn=xnn,Lnn={_tr_init:Tnn,_tr_stored_block:Inn,_tr_flush_block:Ann,_tr_tally:Rnn,_tr_align:Onn};const Nnn=(t,e,n,r)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+e[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0};var i6=Nnn;const Mnn=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},Pnn=new Uint32Array(Mnn()),Dnn=(t,e,n,r)=>{const i=Pnn,a=r+n;t^=-1;for(let o=r;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1};var _d=Dnn,Q_={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},h8={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:knn,_tr_stored_block:JQ,_tr_flush_block:Unn,_tr_tally:Ky,_tr_align:Fnn}=Lnn,{Z_NO_FLUSH:Jy,Z_PARTIAL_FLUSH:Bnn,Z_FULL_FLUSH:$nn,Z_FINISH:dg,Z_BLOCK:eCe,Z_OK:Xd,Z_STREAM_END:tCe,Z_STREAM_ERROR:B0,Z_DATA_ERROR:Vnn,Z_BUF_ERROR:cH,Z_DEFAULT_COMPRESSION:znn,Z_FILTERED:Hnn,Z_HUFFMAN_ONLY:sL,Z_RLE:Gnn,Z_FIXED:jnn,Z_DEFAULT_STRATEGY:Wnn,Z_UNKNOWN:Xnn,Z_DEFLATED:Rk}=h8,Znn=9,qnn=15,Ynn=8,Knn=29,Jnn=256,QQ=Jnn+1+Knn,Qnn=30,ern=19,trn=2*QQ+1,nrn=15,Ts=3,By=258,$0=By+Ts+1,rrn=32,ew=42,Kae=57,eee=69,tee=73,nee=91,ree=103,DE=113,W5=666,Jf=1,eT=2,LS=3,tT=4,irn=3,kE=(t,e)=>(t.msg=Q_[e],e),nCe=t=>t*2-(t>4?9:0),Cy=t=>{let e=t.length;for(;--e>=0;)t[e]=0},arn=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do n=t.head[--r],t.head[r]=n>=i?n-i:0;while(--e);e=i,r=e;do n=t.prev[--r],t.prev[r]=n>=i?n-i:0;while(--e)};let orn=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask,Qy=orn;const th=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))},ch=(t,e)=>{Unn(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,th(t.strm)},Ys=(t,e)=>{t.pending_buf[t.pending++]=e},K4=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},iee=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),t.state.wrap===1?t.adler=i6(t.adler,e,i,n):t.state.wrap===2&&(t.adler=_d(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},Hze=(t,e)=>{let n=t.max_chain_length,r=t.strstart,i,a,o=t.prev_length,s=t.nice_match;const l=t.strstart>t.w_size-$0?t.strstart-(t.w_size-$0):0,u=t.window,d=t.w_mask,f=t.prev,p=t.strstart+By;let h=u[r+o-1],g=u[r+o];t.prev_length>=t.good_match&&(n>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(u[i+o]!==g||u[i+o-1]!==h||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<p);if(a=By-(p-r),r=p-By,a>o){if(t.match_start=e,o=a,a>=s)break;h=u[r+o-1],g=u[r+o]}}while((e=f[e&d])>l&&--n!==0);return o<=t.lookahead?o:t.lookahead},tw=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-$0)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),arn(t),r+=e),t.strm.avail_in===0)break;if(n=iee(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=Ts)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Qy(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Qy(t,t.ins_h,t.window[i+Ts-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<Ts)););}while(t.lookahead<$0&&t.strm.avail_in!==0)},Gze=(t,e)=>{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r,i,a,o=0,s=t.strm.avail_in;do{if(r=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,r>i+t.strm.avail_in&&(r=i+t.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&e!==dg||e===Jy||r!==i+t.strm.avail_in)))break;o=e===dg&&r===i+t.strm.avail_in?1:0,JQ(t,0,0,o),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,th(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(iee(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?tT:e!==Jy&&e!==dg&&t.strm.avail_in===0&&t.strstart===t.block_start?eT:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(iee(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,n=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=n||(i||e===dg)&&e!==Jy&&t.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=e===dg&&t.strm.avail_in===0&&r===i?1:0,JQ(t,t.block_start,r,o),t.block_start+=r,th(t.strm)),o?LS:Jf)},uH=(t,e)=>{let n,r;for(;;){if(t.lookahead<$0){if(tw(t),t.lookahead<$0&&e===Jy)return Jf;if(t.lookahead===0)break}if(n=0,t.lookahead>=Ts&&(t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+Ts-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),n!==0&&t.strstart-n<=t.w_size-$0&&(t.match_length=Hze(t,n)),t.match_length>=Ts)if(r=Ky(t,t.strstart-t.match_start,t.match_length-Ts),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Ts){t.match_length--;do t.strstart++,t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+Ts-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+1]);else r=Ky(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(ch(t,!1),t.strm.avail_out===0))return Jf}return t.insert=t.strstart<Ts-1?t.strstart:Ts-1,e===dg?(ch(t,!0),t.strm.avail_out===0?LS:tT):t.sym_next&&(ch(t,!1),t.strm.avail_out===0)?Jf:eT},Nx=(t,e)=>{let n,r,i;for(;;){if(t.lookahead<$0){if(tw(t),t.lookahead<$0&&e===Jy)return Jf;if(t.lookahead===0)break}if(n=0,t.lookahead>=Ts&&(t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+Ts-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Ts-1,n!==0&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-$0&&(t.match_length=Hze(t,n),t.match_length<=5&&(t.strategy===Hnn||t.match_length===Ts&&t.strstart-t.match_start>4096)&&(t.match_length=Ts-1)),t.prev_length>=Ts&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Ts,r=Ky(t,t.strstart-1-t.prev_match,t.prev_length-Ts),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+Ts-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Ts-1,t.strstart++,r&&(ch(t,!1),t.strm.avail_out===0))return Jf}else if(t.match_available){if(r=Ky(t,0,t.window[t.strstart-1]),r&&ch(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return Jf}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=Ky(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Ts-1?t.strstart:Ts-1,e===dg?(ch(t,!0),t.strm.avail_out===0?LS:tT):t.sym_next&&(ch(t,!1),t.strm.avail_out===0)?Jf:eT},srn=(t,e)=>{let n,r,i,a;const o=t.window;for(;;){if(t.lookahead<=By){if(tw(t),t.lookahead<=By&&e===Jy)return Jf;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Ts&&t.strstart>0&&(i=t.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=t.strstart+By;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);t.match_length=By-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Ts?(n=Ky(t,1,t.match_length-Ts),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Ky(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(ch(t,!1),t.strm.avail_out===0))return Jf}return t.insert=0,e===dg?(ch(t,!0),t.strm.avail_out===0?LS:tT):t.sym_next&&(ch(t,!1),t.strm.avail_out===0)?Jf:eT},lrn=(t,e)=>{let n;for(;;){if(t.lookahead===0&&(tw(t),t.lookahead===0)){if(e===Jy)return Jf;break}if(t.match_length=0,n=Ky(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(ch(t,!1),t.strm.avail_out===0))return Jf}return t.insert=0,e===dg?(ch(t,!0),t.strm.avail_out===0?LS:tT):t.sym_next&&(ch(t,!1),t.strm.avail_out===0)?Jf:eT};function l0(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const X5=[new l0(0,0,0,0,Gze),new l0(4,4,8,4,uH),new l0(4,5,16,8,uH),new l0(4,6,32,32,uH),new l0(4,4,16,16,Nx),new l0(8,16,32,32,Nx),new l0(8,16,128,128,Nx),new l0(8,32,128,256,Nx),new l0(32,128,258,1024,Nx),new l0(32,258,258,4096,Nx)],crn=t=>{t.window_size=2*t.w_size,Cy(t.head),t.max_lazy_match=X5[t.level].max_lazy,t.good_match=X5[t.level].good_length,t.nice_match=X5[t.level].nice_length,t.max_chain_length=X5[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Ts-1,t.match_available=0,t.ins_h=0};function urn(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Rk,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(trn*2),this.dyn_dtree=new Uint16Array((2*Qnn+1)*2),this.bl_tree=new Uint16Array((2*ern+1)*2),Cy(this.dyn_ltree),Cy(this.dyn_dtree),Cy(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(nrn+1),this.heap=new Uint16Array(2*QQ+1),Cy(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*QQ+1),Cy(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const g8=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==ew&&e.status!==Kae&&e.status!==eee&&e.status!==tee&&e.status!==nee&&e.status!==ree&&e.status!==DE&&e.status!==W5?1:0},jze=t=>{if(g8(t))return kE(t,B0);t.total_in=t.total_out=0,t.data_type=Xnn;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Kae:e.wrap?ew:DE,t.adler=e.wrap===2?0:1,e.last_flush=-2,knn(e),Xd},Wze=t=>{const e=jze(t);return e===Xd&&crn(t.state),e},drn=(t,e)=>g8(t)||t.state.wrap!==2?B0:(t.state.gzhead=e,Xd),Xze=(t,e,n,r,i,a)=>{if(!t)return B0;let o=1;if(e===znn&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>Znn||n!==Rk||r<8||r>15||e<0||e>9||a<0||a>jnn||r===8&&o!==1)return kE(t,B0);r===8&&(r=9);const s=new urn;return t.state=s,s.strm=t,s.status=ew,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Ts-1)/Ts),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=n,Wze(t)},frn=(t,e)=>Xze(t,e,Rk,qnn,Ynn,Wnn),prn=(t,e)=>{if(g8(t)||e>eCe||e<0)return t?kE(t,B0):B0;const n=t.state;if(!t.output||t.avail_in!==0&&!t.input||n.status===W5&&e!==dg)return kE(t,t.avail_out===0?cH:B0);const r=n.last_flush;if(n.last_flush=e,n.pending!==0){if(th(t),t.avail_out===0)return n.last_flush=-1,Xd}else if(t.avail_in===0&&nCe(e)<=nCe(r)&&e!==dg)return kE(t,cH);if(n.status===W5&&t.avail_in!==0)return kE(t,cH);if(n.status===ew&&n.wrap===0&&(n.status=DE),n.status===ew){let i=Rk+(n.w_bits-8<<4)<<8,a=-1;if(n.strategy>=sL||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=rrn),i+=31-i%31,K4(n,i),n.strstart!==0&&(K4(n,t.adler>>>16),K4(n,t.adler&65535)),t.adler=1,n.status=DE,th(t),n.pending!==0)return n.last_flush=-1,Xd}if(n.status===Kae){if(t.adler=0,Ys(n,31),Ys(n,139),Ys(n,8),n.gzhead)Ys(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ys(n,n.gzhead.time&255),Ys(n,n.gzhead.time>>8&255),Ys(n,n.gzhead.time>>16&255),Ys(n,n.gzhead.time>>24&255),Ys(n,n.level===9?2:n.strategy>=sL||n.level<2?4:0),Ys(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Ys(n,n.gzhead.extra.length&255),Ys(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=_d(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=eee;else if(Ys(n,0),Ys(n,0),Ys(n,0),Ys(n,0),Ys(n,0),Ys(n,n.level===9?2:n.strategy>=sL||n.level<2?4:0),Ys(n,irn),n.status=DE,th(t),n.pending!==0)return n.last_flush=-1,Xd}if(n.status===eee){if(n.gzhead.extra){let i=n.pending,a=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+a>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,th(t),n.pending!==0)return n.last_flush=-1,Xd;i=0,a-=s}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending+=a,n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=tee}if(n.status===tee){if(n.gzhead.name){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i)),th(t),n.pending!==0)return n.last_flush=-1,Xd;i=0}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,Ys(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=nee}if(n.status===nee){if(n.gzhead.comment){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i)),th(t),n.pending!==0)return n.last_flush=-1,Xd;i=0}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,Ys(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i))}n.status=ree}if(n.status===ree){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(th(t),n.pending!==0))return n.last_flush=-1,Xd;Ys(n,t.adler&255),Ys(n,t.adler>>8&255),t.adler=0}if(n.status=DE,th(t),n.pending!==0)return n.last_flush=-1,Xd}if(t.avail_in!==0||n.lookahead!==0||e!==Jy&&n.status!==W5){let i=n.level===0?Gze(n,e):n.strategy===sL?lrn(n,e):n.strategy===Gnn?srn(n,e):X5[n.level].func(n,e);if((i===LS||i===tT)&&(n.status=W5),i===Jf||i===LS)return t.avail_out===0&&(n.last_flush=-1),Xd;if(i===eT&&(e===Bnn?Fnn(n):e!==eCe&&(JQ(n,0,0,!1),e===$nn&&(Cy(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),th(t),t.avail_out===0))return n.last_flush=-1,Xd}return e!==dg?Xd:n.wrap<=0?tCe:(n.wrap===2?(Ys(n,t.adler&255),Ys(n,t.adler>>8&255),Ys(n,t.adler>>16&255),Ys(n,t.adler>>24&255),Ys(n,t.total_in&255),Ys(n,t.total_in>>8&255),Ys(n,t.total_in>>16&255),Ys(n,t.total_in>>24&255)):(K4(n,t.adler>>>16),K4(n,t.adler&65535)),th(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Xd:tCe)},hrn=t=>{if(g8(t))return B0;const e=t.state.status;return t.state=null,e===DE?kE(t,Vnn):Xd},grn=(t,e)=>{let n=e.length;if(g8(t))return B0;const r=t.state,i=r.wrap;if(i===2||i===1&&r.status!==ew||r.lookahead)return B0;if(i===1&&(t.adler=i6(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Cy(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(e.subarray(n-r.w_size,n),0),e=l,n=r.w_size}const a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,tw(r);r.lookahead>=Ts;){let l=r.strstart,u=r.lookahead-(Ts-1);do r.ins_h=Qy(r,r.ins_h,r.window[l+Ts-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=Ts-1,tw(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Ts-1,r.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,r.wrap=i,Xd};var mrn=frn,vrn=Xze,yrn=Wze,brn=jze,Ern=drn,Srn=prn,Crn=hrn,xrn=grn,_rn="pako deflate (from Nodeca project)",kI={deflateInit:mrn,deflateInit2:vrn,deflateReset:yrn,deflateResetKeep:brn,deflateSetHeader:Ern,deflate:Srn,deflateEnd:Crn,deflateSetDictionary:xrn,deflateInfo:_rn};const wrn=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Trn=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)wrn(n,r)&&(t[r]=n[r])}}return t},Irn=t=>{let e=0;for(let r=0,i=t.length;r<i;r++)e+=t[r].length;const n=new Uint8Array(e);for(let r=0,i=0,a=t.length;r<a;r++){let o=t[r];n.set(o,i),i+=o.length}return n},Ok={assign:Trn,flattenChunks:Irn};let Zze=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Zze=!1}const a6=new Uint8Array(256);for(let t=0;t<256;t++)a6[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;a6[254]=a6[254]=1;var Arn=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,i,a,o=t.length,s=0;for(i=0;i<o;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?e[a++]=n:n<2048?(e[a++]=192|n>>>6,e[a++]=128|n&63):n<65536?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|n&63):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|n&63);return e};const Rrn=(t,e)=>{if(e<65534&&t.subarray&&Zze)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n};var Orn=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,i;const a=new Array(n*2);for(i=0,r=0;r<n;){let o=t[r++];if(o<128){a[i++]=o;continue}let s=a6[o];if(s>4){a[i++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<n;)o=o<<6|t[r++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return Rrn(a,i)},Lrn=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+a6[t[n]]>e?n:e},o6={string2buf:Arn,buf2string:Orn,utf8border:Lrn};function Nrn(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var qze=Nrn;const Yze=Object.prototype.toString,{Z_NO_FLUSH:Mrn,Z_SYNC_FLUSH:Prn,Z_FULL_FLUSH:Drn,Z_FINISH:krn,Z_OK:k7,Z_STREAM_END:Urn,Z_DEFAULT_COMPRESSION:Frn,Z_DEFAULT_STRATEGY:Brn,Z_DEFLATED:$rn}=h8;function Jae(t){this.options=Ok.assign({level:Frn,method:$rn,chunkSize:16384,windowBits:15,memLevel:8,strategy:Brn},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qze,this.strm.avail_out=0;let n=kI.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==k7)throw new Error(Q_[n]);if(e.header&&kI.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=o6.string2buf(e.dictionary):Yze.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,n=kI.deflateSetDictionary(this.strm,r),n!==k7)throw new Error(Q_[n]);this._dict_set=!0}}Jae.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?krn:Mrn,typeof t=="string"?n.input=o6.string2buf(t):Yze.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===Prn||a===Drn)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=kI.deflate(n,a),i===Urn)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=kI.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===k7;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};Jae.prototype.onData=function(t){this.chunks.push(t)};Jae.prototype.onEnd=function(t){t===k7&&(this.result=Ok.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const lL=16209,Vrn=16191;var zrn=function(e,n){let r,i,a,o,s,l,u,d,f,p,h,g,y,v,m,b,E,C,x,_,A,P,R,N;const D=e.state;r=e.next_in,R=e.input,i=r+(e.avail_in-5),a=e.next_out,N=e.output,o=a-(n-e.avail_out),s=a+(e.avail_out-257),l=D.dmax,u=D.wsize,d=D.whave,f=D.wnext,p=D.window,h=D.hold,g=D.bits,y=D.lencode,v=D.distcode,m=(1<<D.lenbits)-1,b=(1<<D.distbits)-1;e:do{g<15&&(h+=R[r++]<<g,g+=8,h+=R[r++]<<g,g+=8),E=y[h&m];t:for(;;){if(C=E>>>24,h>>>=C,g-=C,C=E>>>16&255,C===0)N[a++]=E&65535;else if(C&16){x=E&65535,C&=15,C&&(g<C&&(h+=R[r++]<<g,g+=8),x+=h&(1<<C)-1,h>>>=C,g-=C),g<15&&(h+=R[r++]<<g,g+=8,h+=R[r++]<<g,g+=8),E=v[h&b];n:for(;;){if(C=E>>>24,h>>>=C,g-=C,C=E>>>16&255,C&16){if(_=E&65535,C&=15,g<C&&(h+=R[r++]<<g,g+=8,g<C&&(h+=R[r++]<<g,g+=8)),_+=h&(1<<C)-1,_>l){e.msg="invalid distance too far back",D.mode=lL;break e}if(h>>>=C,g-=C,C=a-o,_>C){if(C=_-C,C>d&&D.sane){e.msg="invalid distance too far back",D.mode=lL;break e}if(A=0,P=p,f===0){if(A+=u-C,C<x){x-=C;do N[a++]=p[A++];while(--C);A=a-_,P=N}}else if(f<C){if(A+=u+f-C,C-=f,C<x){x-=C;do N[a++]=p[A++];while(--C);if(A=0,f<x){C=f,x-=C;do N[a++]=p[A++];while(--C);A=a-_,P=N}}}else if(A+=f-C,C<x){x-=C;do N[a++]=p[A++];while(--C);A=a-_,P=N}for(;x>2;)N[a++]=P[A++],N[a++]=P[A++],N[a++]=P[A++],x-=3;x&&(N[a++]=P[A++],x>1&&(N[a++]=P[A++]))}else{A=a-_;do N[a++]=N[A++],N[a++]=N[A++],N[a++]=N[A++],x-=3;while(x>2);x&&(N[a++]=N[A++],x>1&&(N[a++]=N[A++]))}}else if(C&64){e.msg="invalid distance code",D.mode=lL;break e}else{E=v[(E&65535)+(h&(1<<C)-1)];continue n}break}}else if(C&64)if(C&32){D.mode=Vrn;break e}else{e.msg="invalid literal/length code",D.mode=lL;break e}else{E=y[(E&65535)+(h&(1<<C)-1)];continue t}break}}while(r<i&&a<s);x=g>>3,r-=x,g-=x<<3,h&=(1<<g)-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=a<s?257+(s-a):257-(a-s),D.hold=h,D.bits=g};const Mx=15,rCe=852,iCe=592,aCe=0,dH=1,oCe=2,Hrn=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Grn=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),jrn=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Wrn=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Xrn=(t,e,n,r,i,a,o,s)=>{const l=s.bits;let u=0,d=0,f=0,p=0,h=0,g=0,y=0,v=0,m=0,b=0,E,C,x,_,A,P=null,R;const N=new Uint16Array(Mx+1),D=new Uint16Array(Mx+1);let U=null,z,B,j;for(u=0;u<=Mx;u++)N[u]=0;for(d=0;d<r;d++)N[e[n+d]]++;for(h=l,p=Mx;p>=1&&N[p]===0;p--);if(h>p&&(h=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(f=1;f<p&&N[f]===0;f++);for(h<f&&(h=f),v=1,u=1;u<=Mx;u++)if(v<<=1,v-=N[u],v<0)return-1;if(v>0&&(t===aCe||p!==1))return-1;for(D[1]=0,u=1;u<Mx;u++)D[u+1]=D[u]+N[u];for(d=0;d<r;d++)e[n+d]!==0&&(o[D[e[n+d]]++]=d);if(t===aCe?(P=U=o,R=20):t===dH?(P=Hrn,U=Grn,R=257):(P=jrn,U=Wrn,R=0),b=0,d=0,u=f,A=a,g=h,y=0,x=-1,m=1<<h,_=m-1,t===dH&&m>rCe||t===oCe&&m>iCe)return 1;for(;;){z=u-y,o[d]+1<R?(B=0,j=o[d]):o[d]>=R?(B=U[o[d]-R],j=P[o[d]-R]):(B=32+64,j=0),E=1<<u-y,C=1<<g,f=C;do C-=E,i[A+(b>>y)+C]=z<<24|B<<16|j|0;while(C!==0);for(E=1<<u-1;b&E;)E>>=1;if(E!==0?(b&=E-1,b+=E):b=0,d++,--N[u]===0){if(u===p)break;u=e[n+o[d]]}if(u>h&&(b&_)!==x){for(y===0&&(y=h),A+=f,g=u-y,v=1<<g;g+y<p&&(v-=N[g+y],!(v<=0));)g++,v<<=1;if(m+=1<<g,t===dH&&m>rCe||t===oCe&&m>iCe)return 1;x=b&_,i[x]=h<<24|g<<16|A-a|0}}return b!==0&&(i[A+b]=u-y<<24|64<<16|0),s.bits=h,0};var UI=Xrn;const Zrn=0,Kze=1,Jze=2,{Z_FINISH:sCe,Z_BLOCK:qrn,Z_TREES:cL,Z_OK:NS,Z_STREAM_END:Yrn,Z_NEED_DICT:Krn,Z_STREAM_ERROR:wg,Z_DATA_ERROR:Qze,Z_MEM_ERROR:eHe,Z_BUF_ERROR:Jrn,Z_DEFLATED:lCe}=h8,Lk=16180,cCe=16181,uCe=16182,dCe=16183,fCe=16184,pCe=16185,hCe=16186,gCe=16187,mCe=16188,vCe=16189,U7=16190,xv=16191,fH=16192,yCe=16193,pH=16194,bCe=16195,ECe=16196,SCe=16197,CCe=16198,uL=16199,dL=16200,xCe=16201,_Ce=16202,wCe=16203,TCe=16204,ICe=16205,hH=16206,ACe=16207,RCe=16208,wc=16209,tHe=16210,nHe=16211,Qrn=852,ein=592,tin=15,nin=tin,OCe=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function rin(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const tC=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Lk||e.mode>nHe?1:0},rHe=t=>{if(tC(t))return wg;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Lk,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Qrn),e.distcode=e.distdyn=new Int32Array(ein),e.sane=1,e.back=-1,NS},iHe=t=>{if(tC(t))return wg;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,rHe(t)},aHe=(t,e)=>{let n;if(tC(t))return wg;const r=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?wg:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,iHe(t))},oHe=(t,e)=>{if(!t)return wg;const n=new rin;t.state=n,n.strm=t,n.window=null,n.mode=Lk;const r=aHe(t,e);return r!==NS&&(t.state=null),r},iin=t=>oHe(t,nin);let LCe=!0,gH,mH;const ain=t=>{if(LCe){gH=new Int32Array(512),mH=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(UI(Kze,t.lens,0,288,gH,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;UI(Jze,t.lens,0,32,mH,0,t.work,{bits:5}),LCe=!1}t.lencode=gH,t.lenbits=9,t.distcode=mH,t.distbits=5},sHe=(t,e,n,r)=>{let i;const a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(e.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(e.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(e.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},oin=(t,e)=>{let n,r,i,a,o,s,l,u,d,f,p,h,g,y,v=0,m,b,E,C,x,_,A,P;const R=new Uint8Array(4);let N,D;const U=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(tC(t)||!t.output||!t.input&&t.avail_in!==0)return wg;n=t.state,n.mode===xv&&(n.mode=fH),o=t.next_out,i=t.output,l=t.avail_out,a=t.next_in,r=t.input,s=t.avail_in,u=n.hold,d=n.bits,f=s,p=l,P=NS;e:for(;;)switch(n.mode){case Lk:if(n.wrap===0){n.mode=fH;break}for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,R[0]=u&255,R[1]=u>>>8&255,n.check=_d(n.check,R,2,0),u=0,d=0,n.mode=cCe;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){t.msg="incorrect header check",n.mode=wc;break}if((u&15)!==lCe){t.msg="unknown compression method",n.mode=wc;break}if(u>>>=4,d-=4,A=(u&15)+8,n.wbits===0&&(n.wbits=A),A>15||A>n.wbits){t.msg="invalid window size",n.mode=wc;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=u&512?vCe:xv,u=0,d=0;break;case cCe:for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.flags=u,(n.flags&255)!==lCe){t.msg="unknown compression method",n.mode=wc;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=wc;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,n.check=_d(n.check,R,2,0)),u=0,d=0,n.mode=uCe;case uCe:for(;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,R[2]=u>>>16&255,R[3]=u>>>24&255,n.check=_d(n.check,R,4,0)),u=0,d=0,n.mode=dCe;case dCe:for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,n.check=_d(n.check,R,2,0)),u=0,d=0,n.mode=fCe;case fCe:if(n.flags&1024){for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,n.check=_d(n.check,R,2,0)),u=0,d=0}else n.head&&(n.head.extra=null);n.mode=pCe;case pCe:if(n.flags&1024&&(h=n.length,h>s&&(h=s),h&&(n.head&&(A=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+h),A)),n.flags&512&&n.wrap&4&&(n.check=_d(n.check,r,h,a)),s-=h,a+=h,n.length-=h),n.length))break e;n.length=0,n.mode=hCe;case hCe:if(n.flags&2048){if(s===0)break e;h=0;do A=r[a+h++],n.head&&A&&n.length<65536&&(n.head.name+=String.fromCharCode(A));while(A&&h<s);if(n.flags&512&&n.wrap&4&&(n.check=_d(n.check,r,h,a)),s-=h,a+=h,A)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=gCe;case gCe:if(n.flags&4096){if(s===0)break e;h=0;do A=r[a+h++],n.head&&A&&n.length<65536&&(n.head.comment+=String.fromCharCode(A));while(A&&h<s);if(n.flags&512&&n.wrap&4&&(n.check=_d(n.check,r,h,a)),s-=h,a+=h,A)break e}else n.head&&(n.head.comment=null);n.mode=mCe;case mCe:if(n.flags&512){for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.wrap&4&&u!==(n.check&65535)){t.msg="header crc mismatch",n.mode=wc;break}u=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=xv;break;case vCe:for(;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}t.adler=n.check=OCe(u),u=0,d=0,n.mode=U7;case U7:if(n.havedict===0)return t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=u,n.bits=d,Krn;t.adler=n.check=1,n.mode=xv;case xv:if(e===qrn||e===cL)break e;case fH:if(n.last){u>>>=d&7,d-=d&7,n.mode=hH;break}for(;d<3;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}switch(n.last=u&1,u>>>=1,d-=1,u&3){case 0:n.mode=yCe;break;case 1:if(ain(n),n.mode=uL,e===cL){u>>>=2,d-=2;break e}break;case 2:n.mode=ECe;break;case 3:t.msg="invalid block type",n.mode=wc}u>>>=2,d-=2;break;case yCe:for(u>>>=d&7,d-=d&7;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){t.msg="invalid stored block lengths",n.mode=wc;break}if(n.length=u&65535,u=0,d=0,n.mode=pH,e===cL)break e;case pH:n.mode=bCe;case bCe:if(h=n.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;i.set(r.subarray(a,a+h),o),s-=h,a+=h,l-=h,o+=h,n.length-=h;break}n.mode=xv;break;case ECe:for(;d<14;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.nlen=(u&31)+257,u>>>=5,d-=5,n.ndist=(u&31)+1,u>>>=5,d-=5,n.ncode=(u&15)+4,u>>>=4,d-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=wc;break}n.have=0,n.mode=SCe;case SCe:for(;n.have<n.ncode;){for(;d<3;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.lens[U[n.have++]]=u&7,u>>>=3,d-=3}for(;n.have<19;)n.lens[U[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,N={bits:n.lenbits},P=UI(Zrn,n.lens,0,19,n.lencode,0,n.work,N),n.lenbits=N.bits,P){t.msg="invalid code lengths set",n.mode=wc;break}n.have=0,n.mode=CCe;case CCe:for(;n.have<n.nlen+n.ndist;){for(;v=n.lencode[u&(1<<n.lenbits)-1],m=v>>>24,b=v>>>16&255,E=v&65535,!(m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(E<16)u>>>=m,d-=m,n.lens[n.have++]=E;else{if(E===16){for(D=m+2;d<D;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(u>>>=m,d-=m,n.have===0){t.msg="invalid bit length repeat",n.mode=wc;break}A=n.lens[n.have-1],h=3+(u&3),u>>>=2,d-=2}else if(E===17){for(D=m+3;d<D;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=m,d-=m,A=0,h=3+(u&7),u>>>=3,d-=3}else{for(D=m+7;d<D;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=m,d-=m,A=0,h=11+(u&127),u>>>=7,d-=7}if(n.have+h>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=wc;break}for(;h--;)n.lens[n.have++]=A}}if(n.mode===wc)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=wc;break}if(n.lenbits=9,N={bits:n.lenbits},P=UI(Kze,n.lens,0,n.nlen,n.lencode,0,n.work,N),n.lenbits=N.bits,P){t.msg="invalid literal/lengths set",n.mode=wc;break}if(n.distbits=6,n.distcode=n.distdyn,N={bits:n.distbits},P=UI(Jze,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,N),n.distbits=N.bits,P){t.msg="invalid distances set",n.mode=wc;break}if(n.mode=uL,e===cL)break e;case uL:n.mode=dL;case dL:if(s>=6&&l>=258){t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=u,n.bits=d,zrn(t,p),o=t.next_out,i=t.output,l=t.avail_out,a=t.next_in,r=t.input,s=t.avail_in,u=n.hold,d=n.bits,n.mode===xv&&(n.back=-1);break}for(n.back=0;v=n.lencode[u&(1<<n.lenbits)-1],m=v>>>24,b=v>>>16&255,E=v&65535,!(m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(b&&!(b&240)){for(C=m,x=b,_=E;v=n.lencode[_+((u&(1<<C+x)-1)>>C)],m=v>>>24,b=v>>>16&255,E=v&65535,!(C+m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=C,d-=C,n.back+=C}if(u>>>=m,d-=m,n.back+=m,n.length=E,b===0){n.mode=ICe;break}if(b&32){n.back=-1,n.mode=xv;break}if(b&64){t.msg="invalid literal/length code",n.mode=wc;break}n.extra=b&15,n.mode=xCe;case xCe:if(n.extra){for(D=n.extra;d<D;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=_Ce;case _Ce:for(;v=n.distcode[u&(1<<n.distbits)-1],m=v>>>24,b=v>>>16&255,E=v&65535,!(m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(!(b&240)){for(C=m,x=b,_=E;v=n.distcode[_+((u&(1<<C+x)-1)>>C)],m=v>>>24,b=v>>>16&255,E=v&65535,!(C+m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=C,d-=C,n.back+=C}if(u>>>=m,d-=m,n.back+=m,b&64){t.msg="invalid distance code",n.mode=wc;break}n.offset=E,n.extra=b&15,n.mode=wCe;case wCe:if(n.extra){for(D=n.extra;d<D;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=wc;break}n.mode=TCe;case TCe:if(l===0)break e;if(h=p-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=wc;break}h>n.wnext?(h-=n.wnext,g=n.wsize-h):g=n.wnext-h,h>n.length&&(h=n.length),y=n.window}else y=i,g=o-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do i[o++]=y[g++];while(--h);n.length===0&&(n.mode=dL);break;case ICe:if(l===0)break e;i[o++]=n.length,l--,n.mode=dL;break;case hH:if(n.wrap){for(;d<32;){if(s===0)break e;s--,u|=r[a++]<<d,d+=8}if(p-=l,t.total_out+=p,n.total+=p,n.wrap&4&&p&&(t.adler=n.check=n.flags?_d(n.check,i,p,o-p):i6(n.check,i,p,o-p)),p=l,n.wrap&4&&(n.flags?u:OCe(u))!==n.check){t.msg="incorrect data check",n.mode=wc;break}u=0,d=0}n.mode=ACe;case ACe:if(n.wrap&&n.flags){for(;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.wrap&4&&u!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=wc;break}u=0,d=0}n.mode=RCe;case RCe:P=Yrn;break e;case wc:P=Qze;break e;case tHe:return eHe;case nHe:default:return wg}return t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=u,n.bits=d,(n.wsize||p!==t.avail_out&&n.mode<wc&&(n.mode<hH||e!==sCe))&&sHe(t,t.output,t.next_out,p-t.avail_out),f-=t.avail_in,p-=t.avail_out,t.total_in+=f,t.total_out+=p,n.total+=p,n.wrap&4&&p&&(t.adler=n.check=n.flags?_d(n.check,i,p,t.next_out-p):i6(n.check,i,p,t.next_out-p)),t.data_type=n.bits+(n.last?64:0)+(n.mode===xv?128:0)+(n.mode===uL||n.mode===pH?256:0),(f===0&&p===0||e===sCe)&&P===NS&&(P=Jrn),P},sin=t=>{if(tC(t))return wg;let e=t.state;return e.window&&(e.window=null),t.state=null,NS},lin=(t,e)=>{if(tC(t))return wg;const n=t.state;return n.wrap&2?(n.head=e,e.done=!1,NS):wg},cin=(t,e)=>{const n=e.length;let r,i,a;return tC(t)||(r=t.state,r.wrap!==0&&r.mode!==U7)?wg:r.mode===U7&&(i=1,i=i6(i,e,n,0),i!==r.check)?Qze:(a=sHe(t,e,n,n),a?(r.mode=tHe,eHe):(r.havedict=1,NS))};var uin=iHe,din=aHe,fin=rHe,pin=iin,hin=oHe,gin=oin,min=sin,vin=lin,yin=cin,bin="pako inflate (from Nodeca project)",Bv={inflateReset:uin,inflateReset2:din,inflateResetKeep:fin,inflateInit:pin,inflateInit2:hin,inflate:gin,inflateEnd:min,inflateGetHeader:vin,inflateSetDictionary:yin,inflateInfo:bin};function Ein(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Sin=Ein;const lHe=Object.prototype.toString,{Z_NO_FLUSH:Cin,Z_FINISH:xin,Z_OK:s6,Z_STREAM_END:vH,Z_NEED_DICT:yH,Z_STREAM_ERROR:_in,Z_DATA_ERROR:NCe,Z_MEM_ERROR:win}=h8;function m8(t){this.options=Ok.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qze,this.strm.avail_out=0;let n=Bv.inflateInit2(this.strm,e.windowBits);if(n!==s6)throw new Error(Q_[n]);if(this.header=new Sin,Bv.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=o6.string2buf(e.dictionary):lHe.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=Bv.inflateSetDictionary(this.strm,e.dictionary),n!==s6)))throw new Error(Q_[n])}m8.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?xin:Cin,lHe.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=Bv.inflate(n,o),a===yH&&i&&(a=Bv.inflateSetDictionary(n,i),a===s6?a=Bv.inflate(n,o):a===NCe&&(a=yH));n.avail_in>0&&a===vH&&n.state.wrap>0&&t[n.next_in]!==0;)Bv.inflateReset(n),a=Bv.inflate(n,o);switch(a){case _in:case NCe:case yH:case win:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||a===vH))if(this.options.to==="string"){let l=o6.utf8border(n.output,n.next_out),u=n.next_out-l,d=o6.buf2string(n.output,l);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(l,l+u),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===s6&&s===0)){if(a===vH)return a=Bv.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};m8.prototype.onData=function(t){this.chunks.push(t)};m8.prototype.onEnd=function(t){t===s6&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ok.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Qae(t,e){const n=new m8(e);if(n.push(t),n.err)throw n.msg||Q_[n.err];return n.result}function Tin(t,e){return e=e||{},e.raw=!0,Qae(t,e)}var Iin=m8,Ain=Qae,Rin=Tin,Oin=Qae,Lin=h8,Nin={Inflate:Iin,inflate:Ain,inflateRaw:Rin,ungzip:Oin,constants:Lin};const{Inflate:U4n,inflate:Min,inflateRaw:F4n,ungzip:B4n}=Nin;var cHe=Min;function Pin(t){const e=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n=cHe(e);return new DataView(n.buffer,n.byteOffset,n.byteLength)}const Din={ignoreImageData:!1};class uHe extends Ak{constructor(e){super(e),this._nextIFD=0}get isMultiPage(){let e=0;for(this.decodeHeader();this._nextIFD;)if(e++,this.decodeIFD({ignoreImageData:!0},!0),e===2)return!0;if(e===1)return!1;throw Lv("ifdCount",e)}get pageCount(){let e=0;for(this.decodeHeader();this._nextIFD;)e++,this.decodeIFD({ignoreImageData:!0},!0);if(e>0)return e;throw Lv("ifdCount",e)}decode(e={}){const{pages:n}=e;$in(n);const r=n?Math.max(...n):1/0;e={...Din,...e};const i=[];this.decodeHeader();let a=0;for(;this._nextIFD;){if(n){if(n.includes(a)?i.push(this.decodeIFD(e,!0)):this.decodeIFD({ignoreImageData:!0},!0),a===r)break}else i.push(this.decodeIFD(e,!0));a++}if(a<r&&r!==1/0)throw new RangeError(`Index ${r} is out of bounds. The stack only contains ${a} images.`);return i}decodeHeader(){const e=this.readUint16();if(e===18761)this.setLittleEndian();else if(e===19789)this.setBigEndian();else throw new Error(`invalid byte order: 0x${e.toString(16)}`);if(this.readUint16()!==42)throw new Error("not a TIFF file");this._nextIFD=this.readUint32()}decodeIFD(e,n){this.seek(this._nextIFD);let r;if(n)r=new WSe;else{if(!e.kind)throw new Error("kind is missing");r=new Tze(e.kind)}const i=this.readUint16();for(let a=0;a<i;a++)this.decodeIFDEntry(r);if(!e.ignoreImageData){if(!(r instanceof WSe))throw new Error("must be a tiff ifd");this.decodeImageData(r)}return this._nextIFD=this.readUint32(),r}decodeIFDEntry(e){const n=this.offset,r=this.readUint16(),i=this.readUint16(),a=this.readUint32();if(i<1||i>12){this.skip(4);return}ztn(i,a)>4&&this.seek(this.readUint32());const s=Htn(this,i,a);if(e.fields.set(r,s),r===34665||r===34853){const l=this.offset;let u="exif";r===34665?u="exif":r===34853&&(u="gps"),this._nextIFD=s,e[u]=this.decodeIFD({kind:u,ignoreImageData:!0},!1),this.offset=l}this.seek(n),this.skip(12)}decodeImageData(e){const n=e.orientation;if(n&&n!==1)throw Lv("orientation",n);switch(e.type){case 0:case 1:case 2:case 3:this.readStripData(e);break;default:throw Lv("image type",e.type)}if(this.applyPredictor(e),this.convertAlpha(e),e.type===0){const i=2**e.bitsPerSample-1;for(let a=0;a<e.data.length;a++)e.data[a]=i-e.data[a]}}readStripData(e){const n=e.width,r=e.height,i=e.bitsPerSample,a=e.sampleFormat,o=n*r*e.samplesPerPixel,s=kin(o,i,a),u=e.rowsPerStrip*n*e.samplesPerPixel,d=e.stripOffsets,f=e.stripByteCounts||ktn(e);let p=o,h=0;for(let g=0;g<d.length;g++){const y=new DataView(this.buffer,this.byteOffset+d[g],f[g]),v=p>u?u:p;p-=v;let m=y;switch(e.compression){case 1:break;case 5:{m=ann(y);break}case 8:{m=Pin(y);break}case 2:throw Lv("Compression","CCITT Group 3");case 32773:throw Lv("Compression","PackBits");default:throw Lv("Compression",e.compression)}h=this.fillUncompressed(i,a,s,m,h,v)}e.data=s}fillUncompressed(e,n,r,i,a,o){if(e===8)return Uin(r,i,a,o);if(e===16)return Fin(r,i,a,o,this.isLittleEndian());if(e===32&&n===3)return Bin(r,i,a,o,this.isLittleEndian());throw Lv("bitDepth",e)}applyPredictor(e){const n=e.bitsPerSample;switch(e.predictor){case 1:break;case 2:{if(n===8)Utn(e.data,e.width,e.components);else if(n===16)Ftn(e.data,e.width,e.components);else throw new Error(`Horizontal differencing is only supported for images with a bit depth of ${n}`);break}default:throw new Error(`invalid predictor: ${e.predictor}`)}}convertAlpha(e){if(e.alpha&&e.associatedAlpha){const{data:n,components:r,maxSampleValue:i}=e;for(let a=0;a<n.length;a+=r){const o=n[a+r-1];for(let s=0;s<r-1;s++)n[a+s]=Math.round(n[a+s]*i/o)}}}}function kin(t,e,n){if(e===8)return new Uint8Array(t);if(e===16)return new Uint16Array(t);if(e===32&&n===3)return new Float32Array(t);throw Lv("bit depth / sample format",`${e} / ${n}`)}function Uin(t,e,n,r){for(let i=0;i<r;i++)t[n++]=e.getUint8(i);return n}function Fin(t,e,n,r,i){for(let a=0;a<r*2;a+=2)t[n++]=e.getUint16(a,i);return n}function Bin(t,e,n,r,i){for(let a=0;a<r*4;a+=4)t[n++]=e.getFloat32(a,i);return n}function Lv(t,e){return new Error(`Unsupported ${t}: ${e}`)}function $in(t){if(t){for(const e of t)if(e<0||!Number.isInteger(e))throw new RangeError(`Index ${e} is invalid. Must be a positive integer.`)}}function bH(t,e){return new uHe(t).decode(e)}function MCe(t){return new uHe(t).pageCount}function af(t){return(e,...n)=>Vin(t,e,n)}function nT(t,e){return af(dHe(t,e).get)}const{apply:Vin,construct:$4n,defineProperty:V4n,get:z4n,getOwnPropertyDescriptor:dHe,getPrototypeOf:eoe,has:H4n,ownKeys:zin,set:G4n,setPrototypeOf:j4n}=Reflect,{iterator:v8,species:W4n,toStringTag:Hin,for:X4n}=Symbol,Gin=Object,{create:toe,defineProperty:jin,freeze:Z4n,is:q4n}=Gin,Win=Array,Xin=Win.prototype,fHe=Xin[v8],Zin=af(fHe),pHe=ArrayBuffer,qin=pHe.prototype;nT(qin,"byteLength");const PCe=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;PCe&&nT(PCe.prototype,"byteLength");const hHe=eoe(Uint8Array);hHe.from;const dp=hHe.prototype;dp[v8];af(dp.keys);af(dp.values);af(dp.entries);af(dp.set);af(dp.reverse);af(dp.fill);af(dp.copyWithin);af(dp.sort);af(dp.slice);af(dp.subarray);nT(dp,"buffer");nT(dp,"byteOffset");nT(dp,"length");nT(dp,Hin);const Yin=Uint8Array,gHe=Uint16Array,noe=Uint32Array,Kin=Float32Array,l6=eoe([][v8]()),mHe=af(l6.next),Jin=af(function*(){}().next),Qin=eoe(l6),ean=DataView.prototype,tan=af(ean.getUint16),roe=WeakMap,vHe=roe.prototype,yHe=af(vHe.get),nan=af(vHe.set),bHe=new roe,ran=toe(null,{next:{value:function(){const e=yHe(bHe,this);return mHe(e)}},[v8]:{value:function(){return this}}});function ian(t){if(t[v8]===fHe&&l6.next===mHe)return t;const e=toe(ran);return nan(bHe,e,Zin(t)),e}const aan=new roe,oan=toe(Qin,{next:{value:function(){const e=yHe(aan,this);return Jin(e)},writable:!0,configurable:!0}});for(const t of zin(l6))t!=="next"&&jin(oan,t,dHe(l6,t));const EHe=new pHe(4),san=new Kin(EHe),lan=new noe(EHe),c0=new gHe(512),u0=new Yin(512);for(let t=0;t<256;++t){const e=t-127;e<-24?(c0[t]=0,c0[t|256]=32768,u0[t]=24,u0[t|256]=24):e<-14?(c0[t]=1024>>-e-14,c0[t|256]=1024>>-e-14|32768,u0[t]=-e-1,u0[t|256]=-e-1):e<=15?(c0[t]=e+15<<10,c0[t|256]=e+15<<10|32768,u0[t]=13,u0[t|256]=13):e<128?(c0[t]=31744,c0[t|256]=64512,u0[t]=24,u0[t|256]=24):(c0[t]=31744,c0[t|256]=64512,u0[t]=13,u0[t|256]=13)}const ioe=new noe(2048);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;!(e&8388608);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,ioe[t]=e|n}for(let t=1024;t<2048;++t)ioe[t]=939524096+(t-1024<<13);const rT=new noe(64);for(let t=1;t<31;++t)rT[t]=t<<23;rT[31]=1199570944;rT[32]=2147483648;for(let t=33;t<63;++t)rT[t]=2147483648+(t-32<<23);rT[63]=3347054592;const SHe=new gHe(64);for(let t=1;t<64;++t)t!==32&&(SHe[t]=1024);function can(t){const e=t>>10;return lan[0]=ioe[SHe[e]+(t&1023)]+rT[e],san[0]}function CHe(t,e,...n){return can(tan(t,e,...ian(n)))}var f_={},uan={get exports(){return f_},set exports(t){f_=t}};function xHe(t,e,n){const r=n&&n.debug||!1;r&&console.log("[xml-utils] getting "+e+" in "+t);const i=typeof t=="object"?t.outer:t,a=i.slice(0,i.indexOf(">")+1),o=['"',"'"];for(let s=0;s<o.length;s++){const l=o[s],u=e+"\\="+l+"([^"+l+"]*)"+l;r&&console.log("[xml-utils] pattern:",u);const f=new RegExp(u).exec(a);if(r&&console.log("[xml-utils] match:",f),f)return f[1]}}uan.exports=xHe;f_.default=xHe;var F7={},dan={get exports(){return F7},set exports(t){F7=t}},B7={},fan={get exports(){return B7},set exports(t){B7=t}},$7={},pan={get exports(){return $7},set exports(t){$7=t}};function _He(t,e,n){const i=new RegExp(e).exec(t.slice(n));return i?n+i.index:-1}pan.exports=_He;$7.default=_He;var V7={},han={get exports(){return V7},set exports(t){V7=t}};function wHe(t,e,n){const i=new RegExp(e).exec(t.slice(n));return i?n+i.index+i[0].length-1:-1}han.exports=wHe;V7.default=wHe;var z7={},gan={get exports(){return z7},set exports(t){z7=t}};function THe(t,e){const n=new RegExp(e,"g"),r=t.match(n);return r?r.length:0}gan.exports=THe;z7.default=THe;const man=$7,EH=V7,DCe=z7;function IHe(t,e,n){const r=n&&n.debug||!1,i=!(n&&typeof n.nested===!1),a=n&&n.startIndex||0;r&&console.log("[xml-utils] starting findTagByName with",e," and ",n);const o=man(t,`<${e}[
4503
+ `}},series:[{data:Ve.data,type:"line",markLine:{symbol:"none",silent:!0,data:$t!==-1?[{xAxis:$t,lineStyle:{type:"solid",color:"#c23531"},label:{show:!0,formatter:"{b}"}}]:[]}},{name:"Event Catcher",type:"bar",barWidth:"100%",data:Ve.data,itemStyle:{color:"transparent"},tooltip:{show:!1}}]},fn&&je.setOption(fn),je.on("click",Vn=>{ot(Vn.name)});let Bt={dataset:[{source:Jt}],tooltip:{position:"top",trigger:"item",formatter:function(Vn){const Nn=Vn&&Vn.value!==void 0?Vn.value:Vn&&Vn.data&&Vn.data.value!==void 0?Vn.data.value:Vn&&Vn.data?Vn.data:null,Pr=Array.isArray(Nn)?Nn:[],ui=Vn&&Vn.marker?Vn.marker:"",ri=Pr[2]??"",Br=Pr[3]??"",cr=Pr[0]??"",Ni=Pr[1]??"";return`${ui} <strong>${ri}</strong><br/>name: ${Br}<br/>X: ${cr}<br/>Y: ${Ni}`}},visualMap:{orient:"horizontal",type:"piecewise",top:20,left:"center",dimension:It,pieces:an,show:!1},grid:{top:65+20*Math.ceil(an.length/5)},xAxis:{name:h("5000.7057")||"t-SNE 1",nameLocation:"end",nameRotate:90},yAxis:{name:h("5000.7058")||"t-SNE 2"},series:{type:"scatter",encode:{tooltip:[0,1]},symbolSize:10,itemStyle:{borderColor:"#555"},datasetIndex:0}};const ar=dt(an,Je.getWidth(),Je,It);Je.setOption({graphic:ar}),Bt&&Je.setOption(Bt),at&&(at.style.display="none"),Je.on("click",Vn=>{const Nn=Vn&&Vn.value!==void 0?Vn.value:Vn&&Vn.data&&Vn.data.value!==void 0?Vn.data.value:Vn&&Vn.data?Vn.data:null;Array.isArray(Nn)&&Nn[3]&&gt(Nn[3],Vn.color)})}return()=>{let we=xi.current;if(we){let je=Dy(we);je==null||je.dispose()}if(lr.current){let je=Dy(lr.current);je==null||je.dispose()}}},[Xn,gi]);const Ee=(we,je,Je,at)=>{var Jt,Nt;const Ve=we.value,lt=je.getOption(),ft=lt.dataset&&lt.dataset[0]&&lt.dataset[0].source||[],It=hr.current.includes(Ve)?hr.current.filter(an=>an!==Ve):hr.current.concat(Ve);if(hr.current=It,be.current.traverse(an=>{an.myMeshType==="SWC"&&an.traverse(fn=>{fn instanceof ha&&fn.material.color.set(an.userData.initColor)})}),hr.current.length===0){je.setOption({series:[{data:ft}],graphic:dt(Je,je.getWidth(),je,at)});return}if(lt.series&&((Jt=lt.series)==null?void 0:Jt.length)>0){const an=ft.map(fn=>{const $t=Array.isArray(fn)?fn[at]:fn[at]??fn.cluster,Bt=hr.current.includes($t);return{value:fn,itemStyle:{borderColor:Bt?"#ff0000":"transparent",borderWidth:Bt?2:0,opacity:Bt?1:.15}}});lt.series=[{data:an}],lt.graphic=dt(Je,je.getWidth(),je,at),je.setOption(lt);for(let fn=0;fn<hr.current.length;fn++){const $t=hr.current[fn],Bt=ft.filter(ar=>(Array.isArray(ar)?ar[at]:ar[at]??ar.cluster)===$t);for(let ar=0;ar<Bt.length;ar++){const Vn=Bt[ar][3],Nn=(Nt=Je.find(Pr=>Pr.value===$t))==null?void 0:Nt.color;if(Vn){const Pr=n.find(ui=>ui.path.indexOf(Vn)!==-1);if(Pr){const ui=be.current.getObjectByName(Pr.name);ui&&ui.traverse(ri=>{ri instanceof ha&&("#"+ri.material.color.getHex().toString(16).padStart(6,"0")===Nn?ri.material.color.set(ui.userData.initColor):ri.material.color.set(Nn))})}}}}}};function dt(we,je,Je,at){const Nt=Math.floor((je-40)/50);return we.map((an,fn)=>{const $t=Math.floor(fn/Nt),ar=30+fn%Nt*50,Vn=25+$t*20;return{type:"group",left:ar,top:Vn,children:[{type:"rect",shape:{width:20,height:15},style:{fill:an.color,stroke:hr.current.includes(an.value)?"#ff0000":"#333"},onclick:()=>Ee(an,Je,we,at),cursor:"pointer",tooltip:{show:!1}},{type:"text",left:20+2,top:3,style:{text:an.label,fill:"#000",fontSize:14},onclick:()=>Ee(an,Je,we,at),cursor:"pointer",tooltip:{show:!1}}]}})}const ot=we=>{const je=document.getElementById("spinner");je&&(je.style.display="block");const Je=[];for(let at=0;at<v.length;at++){const Ve=n.find(lt=>lt.name===v[at]);if(Ve){const lt=Ve.path.lastIndexOf("\\"),ft=Ve.path.lastIndexOf("."),It=Ve.path.slice(lt+1,ft);Je.push(It)}}fetch("/app-api/echarts-api/echarts_data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:Je,n_clusters:we})}).then(at=>{if(at.ok)return at.json();throw je&&(je.style.display="none"),vo.error({title:"Error",content:"Failed to fetch data for charts."}),new Error("Network response was not ok.")}).then(at=>{be.current.traverse(Ve=>{Ve.myMeshType==="SWC"&&Ve.traverse(lt=>{lt instanceof ha&&lt.material.color.set(Ve.userData.initColor)})}),mi(at),hr.current=[]})},gt=(we,je)=>{if(we){const Je=n.find(at=>at.path.indexOf(we)!==-1);if(Je){be.current.traverse(Ve=>{Ve.myMeshType==="SWC"&&Ve.traverse(lt=>{lt instanceof ha&&lt.material.color.set(Ve.userData.initColor)})});const at=be.current.getObjectByName(Je.name);at&&at.traverse(Ve=>{Ve instanceof ha&&("#"+Ve.material.color.getHex().toString(16).padStart(6,"0")===je?Ve.material.color.set(at.userData.initColor):Ve.material.color.set(je))})}}};return S.createElement("div",{ref:l,style:{transition:"all ease-in 0.5s"}},s==="swc"?S.createElement(S.Fragment,null,re?S.createElement(gA,{ref:rt,style:{width:"100%",marginBottom:8},options:Ne,placeholder:h("5000.5040")||"Input the region that soma locates",onSearch:Xt,onChange:Er,value:re}):S.createElement(jE,{ref:qe,showSearch:!0,style:{width:"100%",marginBottom:8},value:re,dropdownStyle:{maxHeight:400,overflow:"hidden"},placeholder:h("5000.5040")||"Input the region that soma locates",allowClear:!0,treeDefaultExpandAll:!1,onChange:hn,onSearch:hn,treeData:oi(r)}),Y?S.createElement(gA,{ref:We,style:{width:"100%",marginBottom:8},options:Ne,placeholder:h("5000.5041")||"Input the region that neuron projects",onSearch:Xt,onChange:or,value:Y}):S.createElement(jE,{showSearch:!0,ref:ct,style:{width:"100%"},value:Y,dropdownStyle:{maxHeight:400,overflow:"hidden",marginBottom:8},placeholder:h("5000.5041")||"Input the region that neuron projects",allowClear:!0,treeDefaultExpandAll:!1,onChange:Bn,onSearch:Bn,treeData:oi(r)}),z&&S.createElement(S.Fragment,null,S.createElement(jE,{treeData:en,value:Ge,onChange:_n,treeCheckable:!0,placeholder:"Filter by data information",style:{width:"100%",marginTop:8}}),S.createElement(ts,{style:{marginTop:"5px"}},S.createElement(sb,{onChange:we=>{Ur(we.target.checked)}},h("7000.7025")||"只展示可用神经元"),S.createElement(ts,{style:{fontStyle:"italic",marginTop:"5px"}},h("7000.7026")||"点击Color按钮,修改神经元颜色;点击Ana.按钮,显示神经元投射路径分析结果;点击Path按钮,在主界面显示神经元经过的脑结构;Src按钮展示了神经元数据的来源")),S.createElement(ts,{style:{marginTop:"5px",marginBottom:5}},S.createElement(Na,{onClick:()=>{const we=document.getElementById("spinner");we&&(we.style.display="block");const je=[];for(let Je=0;Je<v.length;Je++){const at=n.find(Ve=>Ve.name===v[Je]);if(at){const Ve=at.path.lastIndexOf("\\"),lt=at.path.lastIndexOf("."),ft=at.path.slice(Ve+1,lt);je.push(ft)}}fetch("/app-api/echarts-api/echarts_data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:je})}).then(Je=>{if(Je.ok)return Je.json();throw we&&(we.style.display="none"),vo.error({title:"Error",content:"Failed to fetch data for charts."}),new Error("Network response was not ok.")}).then(Je=>{mi(Je),gr(!0);let at=document.getElementById("leftContent");at&&(at.scrollTop=0,at.style.overflow="hidden")})}},h("5000.70251")||"显示折线图和点状图"))),S.createElement("div",null,S.createElement(vo,{className:"Echart",open:Le,onOk:()=>{ht(!1)},onCancel:()=>{ht(!1)},width:"auto",footer:null},S.createElement(gg,{activeKey:Mt,onChange:Ie},S.createElement(tH,{tab:h("5000.7009")||"神经元末梢分布",key:"1"},kn&&S.createElement(Zi,null,"Isocortex"),S.createElement(ec,{ref:Ot,className:"Isocortex",Name:"Isocortex",t:h,data_change:Rt,data_c:pt.current,col:["RSPv_","FRP_","MOp_","MOs_","SSp_","SSp-n_","SSp-bfd_","SSp-ll_","SSp-m_","SSp-ul_","SSp-tr_","SSp-un_","SSs_","GU_","VISC_","AUDd_","AUDp_","AUDpo_","AUDv_","VISal_","VISam_","VISl_","VISp_","VISpl_","VISpm_","VISli_","VISpor_","ACAd_","ACAv_","PL_","ILA_","ORB_","AId_","AIp_","AIv_","RSPagl_","RSPd_","PTLp_","TEa_","PERI_","ECT_"],row:["1","2/3","5","6a","6b"]}),rn&&S.createElement(Zi,null,"HPF"),S.createElement(ec,{ref:dr[0],className:"HPF",Name:"HPF",t:h,data_change:Rt,data_c:pt.current,col:["CA1_","CA1_dd","CA1_d","CA1_i","CA1_v","CA1_vv","CA2_dd","CA2_d","CA2_i","CA2_v","CA2_vv","CA3_dd","CA3_d","CA3_i","CA3_v","CA3_vv"],row:["so","sp","slu","sr","slm"]}),S.createElement(ec,{ref:dr[1],className:"HPF",Name:"HPF",t:h,data_change:Rt,data_c:pt.current,col:["DG_d","DG_i","DG_V"],row:["mo","sg","po"]}),S.createElement(ec,{ref:dr[2],className:"HPF",Name:"HPF",t:h,data_change:Rt,data_c:pt.current,col:["SUBd_1","SUBv_1","SUBd_2","SUBv_2","SUBd_3","SUBv_3","SUBd_4","SUBv_4","SUBd_","SUBv_"],row:["sp","sr","m"]}),br&&S.createElement(Zi,null,"CNU"),S.createElement(ec,{ref:Cn,className:"CNU",Name:"CNU",t:h,data_change:Rt,data_c:pt.current,col:["CP_","ACBv_","ACBd_","FS_","OTisl_","OTislm_","OT1","OT2","OT3","LSc","LSr_","SF","SH","AAA","BA","CEAc","CEAm","IA","MEAad","MEAav","MEApd","MEApv","GPe","GPi","SI","MA","NDB","TRS","PALc","BSTse","BAC"],row:["_"]}),Vt&&S.createElement(Zi,null,"OLF"),S.createElement(ec,{ref:ur[0],className:"OLF",Name:"OLF",t:h,data_change:Rt,data_c:pt.current,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["gr","mi","ipl","opl","gl"]}),S.createElement(ec,{ref:ur[1],className:"OLF",Name:"OLF",t:h,data_change:Rt,data_c:pt.current,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["1","2","3","4","5","6a","2/3"]}),Gt&&S.createElement(Zi,null,"TH"),S.createElement(ec,{ref:qt,className:"TH",Name:"TH",t:h,data_change:Rt,data_c:pt.current,col:["VAL","VM","VPL","VPLpc","VPM","VPMpc","PoT","SPFm","SPFp","SPA","PP","MGd","MGv","MGm","LGdsh","LGdco","LGdip","LP","PO","POL","SGN","Eth","REth","AV","AMd","AMv","AD","IAM","IAD","LD","IMD","MDc","MDl","MDm","SMT","PR","PVT","PT","RE","Xi","RH","CM","PCN","CL","PF","PIL","RT","IGL","IntG","LGvl","LGvm","SubG","MH","LH","PIN"],row:["_"]}),zr&&S.createElement(Zi,null,"HY"),S.createElement(ec,{ref:zt,className:"HY",Name:"HY",t:h,data_change:Rt,data_c:pt.current,col:["SO","NC","PVHam","PVHmm","PVHpmm","PVHpml","PVHap","PVHmpd","PVHpv","PVa","PVi","ARH","ADP","AHA","AVP","DMHa","DMHp","DMHv","MEPO","MPO","OV","PD","PS","PSCH","PVp","PVpo","SBPV","SCH","SFO","VMPO","VLPO","AVPV","AHNa","AHNc","AHNd","AHNp","LM","MMme","MMl","MMm","MMp","MMd","SUMm","SUMl","TMd","TMv","MPNc","MPNl","MPNm","PMd","PMv","PVHdp","PVHf","PVHlp","PVHmpv","VMHa","VMHc","VMHdm","VMHvl","PH","LHA","LPO","PST","PSTN","RCH","PeF","STN","TU","A13","FF","ZIr","ZIc","ZId","ZIv","ME"],row:["_"]}),Ue&&S.createElement(Zi,null,"MB"),S.createElement(ec,{ref:nn,className:"MB",Name:"MB",t:h,data_change:Rt,data_c:pt.current,col:["SCop","SCsg","SCzo","ICc","ICd","ICe","NB","SAG","PBG","MEV","SCO","SNr","VTA","RR","MRNm","MRNmg","MRNp","SCdg","SCdw","SCiw","SCig-a","SCig-b","SCig-c","PRC","INC","ND","Su3","PAGdm","PAGl","PAGvl","PAGdl","PAGvm","APN","MPT","NOT","NPC","OP","PPT","RPF","InCo","CUN","RN","III","MA3","EW","IV","PA4","VTN","AT","LT","DT","MT","SNl","SNc","PPN","IF","IPR","IPC","IPA","IPL","IPI","IPDM","IPDL","IPRL","RL","CLI","DR"],row:["_"]}),bn&&S.createElement(Zi,null,"HB"),S.createElement(ec,{ref:Ln,className:"HB",Name:"HB",t:h,data_change:Rt,data_c:pt.current,col:["NLLd","NLLh","NLLv","PSV","KF","PBlc","PBld","PBle","PBls","PBlv","PBme","PBmm","PBmv","POR","SOCm","SOCl","B","DTN","LTN","PDTg","PCG","PG","PRNc","PRNv","SG","SSN","SUT","TRN","V","P5","Acs5","PC5","I5","CSl","CSm","LC","LDT","NI","PRNr","RPO","SLC","SLD","AP","CNlam","CNspg","DCO","VCO","CU","GR","ECU","NTB","NTSce","NTSco","NTSge","NTSl","NTSm","SPVC","SPVI","SPVOcdm","SPVOmdmd","SPVOmdmv","SPVOrdm","SPVOvl","Pa5","z","VI","ACVI","VII","ACVII","EV","AMBd","AMBv","DMX","ECO","GRN","ICB","IO","LRNm","LRNp","ISN","LIN","IRN","MARN","MDRNd","MDRNv","PARN","PAS","PGRNd","PGRNl","NIS","NR","PRP","PMR","PPYd","PPYs","LAV","MV","SPIV","SUV","XII","x","y","RM","RPA","RO"],row:["_"]}),Kn&&S.createElement(Zi,null,"CB"),S.createElement(ec,{ref:Gn[0],className:"CB",Name:"CB",t:h,data_change:Rt,data_c:pt.current,col:["LING_","LING_","CENT2_","CENT2_","CENT3_","CENT3_","CUL4/5_","CUL4/5_","DEC_","DEC_","FOTU_","FOTU_","PYR_","PYR_","UVU_","UVU_","NOD_","NOD_","SIM_","SIM_","ANcr1_","ANcr1_","ANcr2_","ANcr2_","PRM_","PRM_","COPY_","COPY_","PFL_","PFL_","FL_","FL_","IP","DN"],row:["gr","mo"]}),S.createElement(ec,{ref:Gn[1],className:"CB",Name:"CB",t:h,data_change:Rt,data_c:pt.current,col:["FN","IP","DN","VeCB"],row:["_"]})),S.createElement(tH,{tab:h("5000.7011")||"神经元投射模式",key:"2"},r?S.createElement(Cze,{data:Pn,fbxTreeDatas:r}):null),S.createElement(tH,{tab:h("5000.7012")||"投射长度分布",key:"3"},kn&&S.createElement(Zi,null,"Isocortex"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["RSPv_","FRP_","MOp_","MOs_","SSp_","SSp-n_","SSp-bfd_","SSp-ll_","SSp-m_","SSp-ul_","SSp-tr_","SSp-un_","SSs_","GU_","VISC_","AUDd_","AUDp_","AUDpo_","AUDv_","VISal_","VISam_","VISl_","VISp_","VISpl_","VISpm_","VISli_","VISpor_","ACAd_","ACAv_","PL_","ILA_","ORB_","AId_","AIp_","AIv_","RSPagl_","RSPd_","PTLp_","TEa_","PERI_","ECT_"],row:["1","2/3","5","6a","6b"]}),rn&&S.createElement(Zi,null,"HPF"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["CA1_d","CA1_i","CA1_v","CA1_","CA3_dd","CA3_d","CA3_i","CA3_v","CA3_vv","CA2_"],row:["so","sp","slu","sr","slm"]}),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["DG_d","DG_i","DG_V"],row:["mo","sg","po"]}),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["SUBd_1","SUBv_1","SUBd_2","SUBv_2","SUBd_3","SUBv_3","SUBd_4","SUBv_4","SUBd_","SUBv_"],row:["sp","sr","m"]}),br&&S.createElement(Zi,null,"CNU"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["CP_","ACBv_","ACBd_","FS_","OTisl_","OTislm_","OT1","OT2","OT3","LSc","LSr_","SF","SH","AAA","BA","CEAc","CEAm","IA","MEAad","MEAav","MEApd","MEApv","GPe","GPi","SI","MA","NDB","TRS","PALc","BSTse","BAC"],row:["_"]}),Vt&&S.createElement(Zi,null,"OLF"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["gr","mi","ipl","opl","gl"]}),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["1","2","3","4","5","6a","2/3"]}),Gt&&S.createElement(Zi,null,"TH"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["VAL","VM","VPL","VPLpc","VPM","VPMpc","PoT","SPFm","SPFp","SPA","PP","MGd","MGv","MGm","LGdsh","LGdco","LGdip","LP","PO","POL","SGN","Eth","REth","AV","AMd","AMv","AD","IAM","IAD","LD","IMD","MDc","MDl","MDm","SMT","PR","PVT","PT","RE","Xi","RH","CM","PCN","CL","PF","PIL","RT","IGL","IntG","LGvl","LGvm","SubG","MH","LH","PIN"],row:["_"]}),zr&&S.createElement(Zi,null,"HY"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["SO","NC","PVHam","PVHmm","PVHpmm","PVHpml","PVHap","PVHmpd","PVHpv","PVa","PVi","ARH","ADP","AHA","AVP","DMHa","DMHp","DMHv","MEPO","MPO","OV","PD","PS","PSCH","PVp","PVpo","SBPV","SCH","SFO","VMPO","VLPO","AVPV","AHNa","AHNc","AHNd","AHNp","LM","MMme","MMl","MMm","MMp","MMd","SUMm","SUMl","TMd","TMv","MPNc","MPNl","MPNm","PMd","PMv","PVHdp","PVHf","PVHlp","PVHmpv","VMHa","VMHc","VMHdm","VMHvl","PH","LHA","LPO","PST","PSTN","RCH","PeF","STN","TU","A13","FF","ZIr","ZIc","ZId","ZIv","ME"],row:["_"]}),Ue&&S.createElement(Zi,null,"MB"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["SCop","SCsg","SCzo","ICc","ICd","ICe","NB","SAG","PBG","MEV","SCO","SNr","VTA","RR","MRNm","MRNmg","MRNp","SCdg","SCdw","SCiw","SCig-a","SCig-b","SCig-c","PRC","INC","ND","Su3","PAGdm","PAGl","PAGvl","PAGdl","PAGvm","APN","MPT","NOT","NPC","OP","PPT","RPF","InCo","CUN","RN","III","MA3","EW","IV","PA4","VTN","AT","LT","DT","MT","SNl","SNc","PPN","IF","IPR","IPC","IPA","IPL","IPI","IPDM","IPDL","IPRL","RL","CLI","DR"],row:["_"]}),bn&&S.createElement(Zi,null,"HB"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["NLLd","NLLh","NLLv","PSV","KF","PBlc","PBld","PBle","PBls","PBlv","PBme","PBmm","PBmv","POR","SOCm","SOCl","B","DTN","LTN","PDTg","PCG","PG","PRNc","PRNv","SG","SSN","SUT","TRN","V","P5","Acs5","PC5","I5","CSl","CSm","LC","LDT","NI","PRNr","RPO","SLC","SLD","AP","CNlam","CNspg","DCO","VCO","CU","GR","ECU","NTB","NTSce","NTSco","NTSge","NTSl","NTSm","SPVC","SPVI","SPVOcdm","SPVOmdmd","SPVOmdmv","SPVOrdm","SPVOvl","Pa5","z","VI","ACVI","VII","ACVII","EV","AMBd","AMBv","DMX","ECO","GRN","ICB","IO","LRNm","LRNp","ISN","LIN","IRN","MARN","MDRNd","MDRNv","PARN","PAS","PGRNd","PGRNl","NIS","NR","PRP","PMR","PPYd","PPYs","LAV","MV","SPIV","SUV","XII","x","y","RM","RPA","RO"],row:["_"]}),Kn&&S.createElement(Zi,null,"CB"),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["LING_","LING_","CENT2_","CENT2_","CENT3_","CENT3_","CUL4/5_","CUL4/5_","DEC_","DEC_","FOTU_","FOTU_","PYR_","PYR_","UVU_","UVU_","NOD_","NOD_","SIM_","SIM_","ANcr1_","ANcr1_","ANcr2_","ANcr2_","PRM_","PRM_","COPY_","COPY_","PFL_","PFL_","FL_","FL_","IP","DN"],row:["gr","mo"]}),S.createElement(tc,{t:h,data_change:Rt,data_c:Pn,col:["FN","IP","DN","VeCB"],row:["_"]})))),S.createElement(B6,{className:"SwcTable",rowSelection:An,columns:ai,dataSource:xa,locale:dn}),S.createElement("div",{style:{top:0,left:0,width:310,height:"100vh",display:Xn?"block":"none",zIndex:998,overflowX:"hidden",position:"absolute",background:"#fff"}},S.createElement(Na,{type:"text",shape:"circle",icon:S.createElement(Z0,null),style:{position:"absolute",right:4,top:4},onClick:()=>{gr(!1),hr.current=[];let we=document.getElementById("leftContent");we&&(we.style.overflow="auto"),be.current.traverse(je=>{je.myMeshType==="SWC"&&je.traverse(Je=>{Je instanceof ha&&Je.material.color.set(je.userData.initColor)})})}}),S.createElement("div",{style:{marginTop:40}},S.createElement("h1",{style:{marginLeft:15,margin:0,display:"block",textAlign:"center"}},h("5000.7052")||"基于神经元形态的聚类及评估"),S.createElement("div",{style:{display:"flex",justifyContent:"center",marginTop:10}},S.createElement("a",{onClick:()=>{vo.info({title:h("5000.7061")||"Introduction",content:S.createElement("div",null,S.createElement("p",null,h("5000.7056")||"折线图:本图根据投射靶区分布情况,对所选单神经元进行了不同数量的聚类,并对聚类结果使用轮廓系数进行了评估。通常来说,轮廓系数越大,表示聚类效果越好。您可以点击鼠标左键,选中一个您满意的聚类数。"))})}},h("5000.7061")||"使用说明"))),S.createElement("div",{ref:xi,style:{width:"100%",height:"300px"}}),S.createElement("div",null,S.createElement("h1",{style:{marginLeft:25,margin:0,display:"block",textAlign:"center"}},h("5000.7059")||"聚类神经元的降维与可视化"),S.createElement("div",{style:{display:"flex",justifyContent:"center",marginTop:10}},S.createElement("a",{onClick:()=>{vo.info({title:h("5000.7061")||"使用说明",content:S.createElement("div",null,S.createElement("p",null,h("5000.7060")||"点状图:本图根据t-SNE算法,将神经元以散点形式绘制在了由2个主成分所构成的分布图上,每种颜色代表1个类别。点击分布图中的任意一个点,该点所对应的神经元将在主窗口中被重新渲染为所属类别的颜色。点击分布图上方代表任意一个类别的色块,所有属于该类别的神经元都将在主窗口中被重新渲染为该类别的颜色。"))})}},h("5000.7061")||"使用说明"))),S.createElement("div",{ref:lr,style:{width:"100%",height:"440px"}})))):S.createElement(S.Fragment,null,S.createElement(wtn,{style:{marginBottom:8},placeholder:"Search",onChange:Oi,onKeyPress:we=>{we.stopPropagation()}}),S.createElement(N_,{showLine:!0,onExpand:zo,defaultExpandParent:!0,expandedKeys:Z,onCheck:Ci,checkable:!0,selectable:!1,treeData:xa,checkedKeys:v,checkStrictly:!0,autoExpandParent:ee,style:{paddingLeft:"2px"}})))});let Rtn=new URL(window.location.href),Otn=new URLSearchParams(Rtn.search),BSe=Otn.get("brainContourOpacity");const Ltn=t=>{const{regionData:e}=t,[n,r]=S.useState(!1);return S.useEffect(()=>{let i=BSe?JSON.parse(BSe):.3;Sy({filepath:e+"/data/FBX/outline.FBX",index:"Brain",color:"0xcccccc",opacity:i,offsetZ:0,R:1,callback:function(){r(!1)}})},[]),S.createElement("div",{id:"spinner",style:{position:"absolute",zIndex:999,left:0,top:0,width:"100%",height:"100%",display:`${n?"block":"none"}`,opacity:.7,backgroundColor:"#ffffff"}},S.createElement("div",{style:{position:"absolute",zIndex:999,left:"50%",top:"50%",fontWeight:"bold",textAlign:"center"}},S.createElement(gD,{spinning:!0,size:"large"}),S.createElement("br",null),"Loading....wait..."))};(function(t){if(t.TextEncoder&&t.TextDecoder)return!1;function e(r="utf-8"){if(r!=="utf-8")throw new RangeError(`Failed to construct 'TextEncoder': The encoding label provided ('${r}') is invalid.`)}Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(r,i={stream:!1}){if(i.stream)throw new Error("Failed to encode: the 'stream' option is unsupported.");let a=0;const o=r.length;let s=0,l=Math.max(32,o+(o>>1)+7),u=new Uint8Array(l>>3<<3);for(;a<o;){let d=r.charCodeAt(a++);if(d>=55296&&d<=56319){if(a<o){const f=r.charCodeAt(a);(f&64512)===56320&&(++a,d=((d&1023)<<10)+(f&1023)+65536)}if(d>=55296&&d<=56319)continue}if(s+4>u.length){l+=8,l*=1+a/r.length*2,l=l>>3<<3;const f=new Uint8Array(l);f.set(u),u=f}if(d&4294967168)if(!(d&4294965248))u[s++]=d>>6&31|192;else if(!(d&4294901760))u[s++]=d>>12&15|224,u[s++]=d>>6&63|128;else if(!(d&4292870144))u[s++]=d>>18&7|240,u[s++]=d>>12&63|128,u[s++]=d>>6&63|128;else continue;else{u[s++]=d;continue}u[s++]=d&63|128}return u.slice(0,s)};function n(r="utf-8",i={fatal:!1}){if(r!=="utf-8")throw new RangeError(`Failed to construct 'TextDecoder': The encoding label provided ('${r}') is invalid.`);if(i.fatal)throw new Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(r,i={stream:!1}){if(i.stream)throw new Error("Failed to decode: the 'stream' option is unsupported.");const a=new Uint8Array(r);let o=0;const s=a.length,l=[];for(;o<s;){const u=a[o++];if(u===0)break;if(!(u&128))l.push(u);else if((u&224)===192){const d=a[o++]&63;l.push((u&31)<<6|d)}else if((u&240)===224){const d=a[o++]&63,f=a[o++]&63;l.push((u&31)<<12|d<<6|f)}else if((u&248)===240){const d=a[o++]&63,f=a[o++]&63,p=a[o++]&63;let h=(u&7)<<18|d<<12|f<<6|p;h>65535&&(h-=65536,l.push(h>>>10&1023|55296),h=56320|h&1023),l.push(h)}}return String.fromCharCode.apply(null,l)},t.TextEncoder=e,t.TextDecoder=n})(typeof window<"u"?window:typeof self<"u"?self:globalThis);function $Se(t,e="utf8"){return new TextDecoder(e).decode(t)}const Ntn=new TextEncoder;function Mtn(t){return Ntn.encode(t)}const Ptn=1024*8,Dtn=(()=>{const t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),iH={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class Ak{constructor(e=Ptn,n={}){let r=!1;typeof e=="number"?e=new ArrayBuffer(e):(r=!0,this.lastWrittenByte=e.byteLength);const i=n.offset?n.offset>>>0:0,a=e.byteLength-i;let o=i;(ArrayBuffer.isView(e)||e instanceof Ak)&&(e.byteLength!==e.buffer.byteLength&&(o=e.byteOffset+i),e=e.buffer),r?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=e,this.length=a,this.byteLength=a,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const r=(this.offset+e)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,n){const r=iH[n].BYTES_PER_ELEMENT*e,i=this.byteOffset+this.offset,a=this.buffer.slice(i,i+r);if(this.littleEndian===Dtn&&n!=="uint8"&&n!=="int8"){const s=new Uint8Array(this.buffer.slice(i,i+r));s.reverse();const l=new iH[n](s.buffer);return this.offset+=r,l.reverse(),l}const o=new iH[n](a);return this.offset+=r,o}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let n="";for(let r=0;r<e;r++)n+=this.readChar();return n}readUtf8(e=1){return $Se(this.readBytes(e))}decodeText(e=1,n="utf-8"){return $Se(this.readBytes(e),n)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let n=0;n<e.length;n++)this._data.setUint8(this.offset++,e[n]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let n=0;n<e.length;n++)this.writeUint8(e.charCodeAt(n));return this}writeUtf8(e){return this.writeBytes(Mtn(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function ktn(t){if(t.compression!==1)throw new Error("missing mandatory StripByteCounts field in compressed image");const e=t.rowsPerStrip*t.width*t.samplesPerPixel*(t.bitsPerSample/8);return new Array(t.stripOffsets.length).fill(e)}function Utn(t,e,n){let r=0;for(;r<t.length;){for(let i=n;i<e*n;i+=n)for(let a=0;a<n;a++)t[r+i+a]=t[r+i+a]+t[r+i-(n-a)]&255;r+=e*n}}function Ftn(t,e,n){let r=0;for(;r<t.length;){for(let i=n;i<e*n;i+=n)for(let a=0;a<n;a++)t[r+i+a]=t[r+i+a]+t[r+i-(n-a)]&65535;r+=e*n}}const XQ={33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",36864:"ExifVersion",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBiasValue",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",37396:"SubjectArea",37500:"MakerNote",37510:"UserComment",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42240:"Gamma"},xze={};for(const t in XQ)xze[XQ[t]]=Number(t);const Btn=Object.freeze(Object.defineProperty({__proto__:null,tagsById:XQ,tagsByName:xze},Symbol.toStringTag,{value:"Module"})),ZQ={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},_ze={};for(const t in ZQ)_ze[ZQ[t]]=Number(t);const $tn=Object.freeze(Object.defineProperty({__proto__:null,tagsById:ZQ,tagsByName:_ze},Symbol.toStringTag,{value:"Module"})),qQ={254:"NewSubfileType",255:"SubfileType",256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:"Threshholding",264:"CellWidth",265:"CellLength",266:"FillOrder",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",288:"FreeOffsets",289:"FreeByteCounts",290:"GrayResponseUnit",291:"GrayResponseCurve",296:"ResolutionUnit",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",320:"ColorMap",338:"ExtraSamples",33432:"Copyright",269:"DocumentName",285:"PageName",286:"XPosition",287:"YPosition",292:"T4Options",293:"T6Options",297:"PageNumber",301:"TransferFunction",317:"Predictor",318:"WhitePoint",319:"PrimaryChromaticities",321:"HalftoneHints",322:"TileWidth",323:"TileLength",324:"TileOffsets",325:"TileByteCounts",326:"BadFaxLines",327:"CleanFaxData",328:"ConsecutiveBadFaxLines",330:"SubIFDs",332:"InkSet",333:"InkNames",334:"NumberOfInks",336:"DotRange",337:"TargetPrinter",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",342:"TransferRange",343:"ClipPath",344:"XClipPathUnits",345:"YClipPathUnits",346:"Indexed",347:"JPEGTables",351:"OPIProxy",400:"GlobalParametersIFD",401:"ProfileType",402:"FaxProfile",403:"CodingMethods",404:"VersionYear",405:"ModeNumber",433:"Decode",434:"DefaultImageColor",512:"JPEGProc",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",515:"JPEGRestartInterval",517:"JPEGLosslessPredictors",518:"JPEGPointTransforms",519:"JPEGQTables",520:"JPEGDCTables",521:"JPEGACTables",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite",559:"StripRowCounts",700:"XMP",32781:"ImageID",34732:"ImageLayer",32932:"WangAnnotatio",33445:"MDFileTag",33446:"MDScalePixel",33447:"MDColorTable",33448:"MDLabName",33449:"MDSampleInfo",33450:"MDPrepDate",33451:"MDPrepTime",33452:"MDFileUnits",33550:"ModelPixelScaleTag",33723:"IPTC",33918:"INGRPacketDataTag",33919:"INGRFlagRegisters",33920:"IrasBTransformationMatrix",33922:"ModelTiepointTag",34264:"ModelTransformationTag",34377:"Photoshop",34665:"ExifIFD",34675:"ICCProfile",34735:"GeoKeyDirectoryTag",34736:"GeoDoubleParamsTag",34737:"GeoAsciiParamsTag",34853:"GPSIFD",34908:"HylaFAXFaxRecvParams",34909:"HylaFAXFaxSubAddress",34910:"HylaFAXFaxRecvTime",37724:"ImageSourceData",40965:"InteroperabilityIFD",42112:"GDAL_METADATA",42113:"GDAL_NODATA",50215:"OceScanjobDescription",50216:"OceApplicationSelector",50217:"OceIdentificationNumber",50218:"OceImageLogicCharacteristics",50706:"DNGVersion",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50710:"CFAPlaneColor",50711:"CFALayout",50712:"LinearizationTable",50713:"BlackLevelRepeatDim",50714:"BlackLevel",50715:"BlackLevelDeltaH",50716:"BlackLevelDeltaV",50717:"WhiteLevel",50718:"DefaultScale",50719:"DefaultCropOrigin",50720:"DefaultCropSize",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50733:"BayerGreenSplit",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"LensInfo",50737:"ChromaBlurRadius",50738:"AntiAliasStrength",50740:"DNGPrivateData",50741:"MakerNoteSafety",50778:"CalibrationIlluminant1",50779:"CalibrationIlluminant2",50780:"BestQualityScale",50784:"AliasLayerMetadata"},wze={};for(const t in qQ)wze[qQ[t]]=Number(t);const Vtn=Object.freeze(Object.defineProperty({__proto__:null,tagsById:qQ,tagsByName:wze},Symbol.toStringTag,{value:"Module"})),VSe={standard:Vtn,exif:Btn,gps:$tn};class Tze{constructor(e){if(!e)throw new Error("missing kind");this.data=new Uint8Array,this.fields=new Map,this.kind=e,this._hasMap=!1,this._map={}}get(e){if(typeof e=="number")return this.fields.get(e);if(typeof e=="string")return this.fields.get(VSe[this.kind].tagsByName[e]);throw new Error("expected a number or string")}get map(){if(!this._hasMap){const e=VSe[this.kind].tagsById;for(const n of this.fields.keys())e[n]&&(this._map[e[n]]=this.fields.get(n));this._hasMap=!0}return this._map}}const Ize=new Map([[1,[1,zSe]],[2,[1,Gtn]],[3,[2,jtn]],[4,[4,Wtn]],[5,[8,Xtn]],[6,[1,Ztn]],[7,[1,zSe]],[8,[2,qtn]],[9,[4,Ytn]],[10,[8,Ktn]],[11,[4,Jtn]],[12,[8,Qtn]]]);function ztn(t,e){const n=Ize.get(t);if(!n)throw new Error(`type not found: ${t}`);return n[0]*e}function Htn(t,e,n){const r=Ize.get(e);if(!r)throw new Error(`type not found: ${e}`);return r[1](t,n)}function zSe(t,e){if(e===1)return t.readUint8();const n=new Uint8Array(e);for(let r=0;r<e;r++)n[r]=t.readUint8();return n}function Gtn(t,e){const n=[];let r="";for(let i=0;i<e;i++){const a=String.fromCharCode(t.readUint8());a==="\0"?(n.push(r),r=""):r+=a}return n.length===1?n[0]:n}function jtn(t,e){if(e===1)return t.readUint16();const n=new Uint16Array(e);for(let r=0;r<e;r++)n[r]=t.readUint16();return n}function Wtn(t,e){if(e===1)return t.readUint32();const n=new Uint32Array(e);for(let r=0;r<e;r++)n[r]=t.readUint32();return n}function Xtn(t,e){if(e===1)return t.readUint32()/t.readUint32();const n=new Array(e);for(let r=0;r<e;r++)n[r]=t.readUint32()/t.readUint32();return n}function Ztn(t,e){if(e===1)return t.readInt8();const n=new Int8Array(e);for(let r=0;r<e;r++)n[r]=t.readInt8();return n}function qtn(t,e){if(e===1)return t.readInt16();const n=new Int16Array(e);for(let r=0;r<e;r++)n[r]=t.readInt16();return n}function Ytn(t,e){if(e===1)return t.readInt32();const n=new Int32Array(e);for(let r=0;r<e;r++)n[r]=t.readInt32();return n}function Ktn(t,e){if(e===1)return t.readInt32()/t.readInt32();const n=new Array(e);for(let r=0;r<e;r++)n[r]=t.readInt32()/t.readInt32();return n}function Jtn(t,e){if(e===1)return t.readFloat32();const n=new Float32Array(e);for(let r=0;r<e;r++)n[r]=t.readFloat32();return n}function Qtn(t,e){if(e===1)return t.readFloat64();const n=new Float64Array(e);for(let r=0;r<e;r++)n[r]=t.readFloat64();return n}const enn=256,HSe=257,GSe=258,jSe=9;let ME=[];function tnn(){if(ME.length===0){for(let e=0;e<256;e++)ME.push([e]);const t=[];for(let e=256;e<4096;e++)ME.push(t)}}const nnn=[511,1023,2047,4095],rnn=[0,0,0,0,0,0,0,0,0,511,1023,2047,4095];class inn{constructor(e){this.nextData=0,this.nextBits=0,this.bytePointer=0,this.tableLength=GSe,this.currentBitLength=jSe,this.stripArray=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.outData=new Ak(e.byteLength),this.initializeTable()}decode(){let e=0,n=0;for(;(e=this.getNextCode())!==HSe;)if(e===enn){if(this.initializeTable(),e=this.getNextCode(),e===HSe)break;this.writeString(this.stringFromCode(e)),n=e}else if(this.isInTable(e))this.writeString(this.stringFromCode(e)),this.addStringToTable(this.stringFromCode(n).concat(this.stringFromCode(e)[0])),n=e;else{const i=this.stringFromCode(n).concat(this.stringFromCode(n)[0]);this.writeString(i),this.addStringToTable(i),n=e}const r=this.outData.toArray();return new DataView(r.buffer,r.byteOffset,r.byteLength)}initializeTable(){tnn(),this.tableLength=GSe,this.currentBitLength=jSe}writeString(e){this.outData.writeBytes(e)}stringFromCode(e){return ME[e]}isInTable(e){return e<this.tableLength}addStringToTable(e){if(ME[this.tableLength++]=e,ME.length>4096)throw ME=[],new Error("LZW decoding error. Please open an issue at https://github.com/image-js/tiff/issues/new/choose (include a test image).");this.tableLength===rnn[this.currentBitLength]&&this.currentBitLength++}getNextCode(){this.nextData=this.nextData<<8|this.stripArray[this.bytePointer++]&255,this.nextBits+=8,this.nextBits<this.currentBitLength&&(this.nextData=this.nextData<<8|this.stripArray[this.bytePointer++]&255,this.nextBits+=8);const e=this.nextData>>this.nextBits-this.currentBitLength&nnn[this.currentBitLength-9];return this.nextBits-=this.currentBitLength,this.bytePointer>this.stripArray.length?257:e}}function ann(t){return new inn(t).decode()}const onn=/^(\d{4}):(\d{2}):(\d{2}) (\d{2}):(\d{2}):(\d{2})$/;class WSe extends Tze{constructor(){super("standard")}get size(){return this.width*this.height}get width(){return this.imageWidth}get height(){return this.imageLength}get components(){return this.samplesPerPixel}get date(){const e=new Date,n=onn.exec(this.dateTime);if(n===null)throw new Error(`invalid dateTime: ${this.dateTime}`);return e.setFullYear(Number(n[1]),Number(n[2])-1,Number(n[3])),e.setHours(Number(n[4]),Number(n[5]),Number(n[6])),e}get newSubfileType(){return this.get("NewSubfileType")}get imageWidth(){return this.get("ImageWidth")}get imageLength(){return this.get("ImageLength")}get bitsPerSample(){const e=this.get("BitsPerSample");return e&&typeof e!="number"?e[0]:e}get alpha(){const e=this.extraSamples;return e?e[0]!==0:!1}get associatedAlpha(){const e=this.extraSamples;return e?e[0]===1:!1}get extraSamples(){return oL(this.get("ExtraSamples"))}get compression(){return this.get("Compression")||1}get type(){return this.get("PhotometricInterpretation")}get fillOrder(){return this.get("FillOrder")||1}get documentName(){return this.get("DocumentName")}get imageDescription(){return this.get("ImageDescription")}get stripOffsets(){return oL(this.get("StripOffsets"))}get orientation(){return this.get("Orientation")}get samplesPerPixel(){return this.get("SamplesPerPixel")||1}get rowsPerStrip(){return this.get("RowsPerStrip")}get stripByteCounts(){return oL(this.get("StripByteCounts"))}get minSampleValue(){return this.get("MinSampleValue")||0}get maxSampleValue(){return this.get("MaxSampleValue")||2**this.bitsPerSample-1}get xResolution(){return this.get("XResolution")}get yResolution(){return this.get("YResolution")}get planarConfiguration(){return this.get("PlanarConfiguration")||1}get resolutionUnit(){return this.get("ResolutionUnit")||2}get dateTime(){return this.get("DateTime")}get predictor(){return this.get("Predictor")||1}get sampleFormat(){return oL(this.get("SampleFormat")||1)[0]}get sMinSampleValue(){return this.get("SMinSampleValue")||this.minSampleValue}get sMaxSampleValue(){return this.get("SMaxSampleValue")||this.maxSampleValue}get palette(){const e=2**this.bitsPerSample,n=this.get("ColorMap");if(!n)return;if(n.length!==3*e)throw new Error(`ColorMap size must be ${e}`);const r=[];for(let i=0;i<e;i++)r.push([n[i],n[i+e],n[i+2*e]]);return r}}function oL(t){return typeof t=="number"?[t]:t}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const snn=4,XSe=0,ZSe=1,lnn=2;function Qw(t){let e=t.length;for(;--e>=0;)t[e]=0}const cnn=0,Aze=1,unn=2,dnn=3,fnn=258,Xae=29,p8=256,e6=p8+1+Xae,d_=30,Zae=19,Rze=2*e6+1,PE=15,aH=16,pnn=7,qae=256,Oze=16,Lze=17,Nze=18,YQ=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),VN=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),hnn=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Mze=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gnn=512,Fv=new Array((e6+2)*2);Qw(Fv);const DI=new Array(d_*2);Qw(DI);const t6=new Array(gnn);Qw(t6);const n6=new Array(fnn-dnn+1);Qw(n6);const Yae=new Array(Xae);Qw(Yae);const D7=new Array(d_);Qw(D7);function oH(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let Pze,Dze,kze;function sH(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const Uze=t=>t<256?t6[t]:t6[256+(t>>>7)],r6=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},Lp=(t,e,n)=>{t.bi_valid>aH-n?(t.bi_buf|=e<<t.bi_valid&65535,r6(t,t.bi_buf),t.bi_buf=e>>aH-t.bi_valid,t.bi_valid+=n-aH):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},I0=(t,e,n)=>{Lp(t,n[e*2],n[e*2+1])},Fze=(t,e)=>{let n=0;do n|=t&1,t>>>=1,n<<=1;while(--e>0);return n>>>1},mnn=t=>{t.bi_valid===16?(r6(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},vnn=(t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,l=e.stat_desc.max_length;let u,d,f,p,h,g,y=0;for(p=0;p<=PE;p++)t.bl_count[p]=0;for(n[t.heap[t.heap_max]*2+1]=0,u=t.heap_max+1;u<Rze;u++)d=t.heap[u],p=n[n[d*2+1]*2+1]+1,p>l&&(p=l,y++),n[d*2+1]=p,!(d>r)&&(t.bl_count[p]++,h=0,d>=s&&(h=o[d-s]),g=n[d*2],t.opt_len+=g*(p+h),a&&(t.static_len+=g*(i[d*2+1]+h)));if(y!==0){do{for(p=l-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[l]--,y-=2}while(y>0);for(p=l;p!==0;p--)for(d=t.bl_count[p];d!==0;)f=t.heap[--u],!(f>r)&&(n[f*2+1]!==p&&(t.opt_len+=(p-n[f*2+1])*n[f*2],n[f*2+1]=p),d--)}},Bze=(t,e,n)=>{const r=new Array(PE+1);let i=0,a,o;for(a=1;a<=PE;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=Fze(r[s]++,s))}},ynn=()=>{let t,e,n,r,i;const a=new Array(PE+1);for(n=0,r=0;r<Xae-1;r++)for(Yae[r]=n,t=0;t<1<<YQ[r];t++)n6[n++]=r;for(n6[n-1]=r,i=0,r=0;r<16;r++)for(D7[r]=i,t=0;t<1<<VN[r];t++)t6[i++]=r;for(i>>=7;r<d_;r++)for(D7[r]=i<<7,t=0;t<1<<VN[r]-7;t++)t6[256+i++]=r;for(e=0;e<=PE;e++)a[e]=0;for(t=0;t<=143;)Fv[t*2+1]=8,t++,a[8]++;for(;t<=255;)Fv[t*2+1]=9,t++,a[9]++;for(;t<=279;)Fv[t*2+1]=7,t++,a[7]++;for(;t<=287;)Fv[t*2+1]=8,t++,a[8]++;for(Bze(Fv,e6+1,a),t=0;t<d_;t++)DI[t*2+1]=5,DI[t*2]=Fze(t,5);Pze=new oH(Fv,YQ,p8+1,e6,PE),Dze=new oH(DI,VN,0,d_,PE),kze=new oH(new Array(0),hnn,0,Zae,pnn)},$ze=t=>{let e;for(e=0;e<e6;e++)t.dyn_ltree[e*2]=0;for(e=0;e<d_;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Zae;e++)t.bl_tree[e*2]=0;t.dyn_ltree[qae*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Vze=t=>{t.bi_valid>8?r6(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},qSe=(t,e,n,r)=>{const i=e*2,a=n*2;return t[i]<t[a]||t[i]===t[a]&&r[e]<=r[n]},lH=(t,e,n)=>{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i<t.heap_len&&qSe(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!qSe(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r},YSe=(t,e,n)=>{let r,i,a=0,o,s;if(t.sym_next!==0)do r=t.pending_buf[t.sym_buf+a++]&255,r+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],r===0?I0(t,i,e):(o=n6[i],I0(t,o+p8+1,e),s=YQ[o],s!==0&&(i-=Yae[o],Lp(t,i,s)),r--,o=Uze(r),I0(t,o,n),s=VN[o],s!==0&&(r-=D7[o],Lp(t,r,s)));while(a<t.sym_next);I0(t,qae,e)},KQ=(t,e)=>{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems;let o,s,l=-1,u;for(t.heap_len=0,t.heap_max=Rze,o=0;o<a;o++)n[o*2]!==0?(t.heap[++t.heap_len]=l=o,t.depth[o]=0):n[o*2+1]=0;for(;t.heap_len<2;)u=t.heap[++t.heap_len]=l<2?++l:0,n[u*2]=1,t.depth[u]=0,t.opt_len--,i&&(t.static_len-=r[u*2+1]);for(e.max_code=l,o=t.heap_len>>1;o>=1;o--)lH(t,n,o);u=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],lH(t,n,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,n[u*2]=n[o*2]+n[s*2],t.depth[u]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,n[o*2+1]=n[s*2+1]=u,t.heap[1]=u++,lH(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],vnn(t,e),Bze(n,l,t.bl_count)},KSe=(t,e,n)=>{let r,i=-1,a,o=e[0*2+1],s=0,l=7,u=4;for(o===0&&(l=138,u=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=e[(r+1)*2+1],!(++s<l&&a===o)&&(s<u?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[Oze*2]++):s<=10?t.bl_tree[Lze*2]++:t.bl_tree[Nze*2]++,s=0,i=a,o===0?(l=138,u=3):a===o?(l=6,u=3):(l=7,u=4))},JSe=(t,e,n)=>{let r,i=-1,a,o=e[0*2+1],s=0,l=7,u=4;for(o===0&&(l=138,u=3),r=0;r<=n;r++)if(a=o,o=e[(r+1)*2+1],!(++s<l&&a===o)){if(s<u)do I0(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(I0(t,a,t.bl_tree),s--),I0(t,Oze,t.bl_tree),Lp(t,s-3,2)):s<=10?(I0(t,Lze,t.bl_tree),Lp(t,s-3,3)):(I0(t,Nze,t.bl_tree),Lp(t,s-11,7));s=0,i=a,o===0?(l=138,u=3):a===o?(l=6,u=3):(l=7,u=4)}},bnn=t=>{let e;for(KSe(t,t.dyn_ltree,t.l_desc.max_code),KSe(t,t.dyn_dtree,t.d_desc.max_code),KQ(t,t.bl_desc),e=Zae-1;e>=3&&t.bl_tree[Mze[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},Enn=(t,e,n,r)=>{let i;for(Lp(t,e-257,5),Lp(t,n-1,5),Lp(t,r-4,4),i=0;i<r;i++)Lp(t,t.bl_tree[Mze[i]*2+1],3);JSe(t,t.dyn_ltree,e-1),JSe(t,t.dyn_dtree,n-1)},Snn=t=>{let e=4093624447,n;for(n=0;n<=31;n++,e>>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return XSe;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return ZSe;for(n=32;n<p8;n++)if(t.dyn_ltree[n*2]!==0)return ZSe;return XSe};let QSe=!1;const Cnn=t=>{QSe||(ynn(),QSe=!0),t.l_desc=new sH(t.dyn_ltree,Pze),t.d_desc=new sH(t.dyn_dtree,Dze),t.bl_desc=new sH(t.bl_tree,kze),t.bi_buf=0,t.bi_valid=0,$ze(t)},zze=(t,e,n,r)=>{Lp(t,(cnn<<1)+(r?1:0),3),Vze(t),r6(t,n),r6(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},xnn=t=>{Lp(t,Aze<<1,3),I0(t,qae,Fv),mnn(t)},_nn=(t,e,n,r)=>{let i,a,o=0;t.level>0?(t.strm.data_type===lnn&&(t.strm.data_type=Snn(t)),KQ(t,t.l_desc),KQ(t,t.d_desc),o=bnn(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&e!==-1?zze(t,e,n,r):t.strategy===snn||a===i?(Lp(t,(Aze<<1)+(r?1:0),3),YSe(t,Fv,DI)):(Lp(t,(unn<<1)+(r?1:0),3),Enn(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),YSe(t,t.dyn_ltree,t.dyn_dtree)),$ze(t),r&&Vze(t)},wnn=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(n6[n]+p8+1)*2]++,t.dyn_dtree[Uze(e)*2]++),t.sym_next===t.sym_end);var Tnn=Cnn,Inn=zze,Ann=_nn,Rnn=wnn,Onn=xnn,Lnn={_tr_init:Tnn,_tr_stored_block:Inn,_tr_flush_block:Ann,_tr_tally:Rnn,_tr_align:Onn};const Nnn=(t,e,n,r)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+e[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0};var i6=Nnn;const Mnn=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},Pnn=new Uint32Array(Mnn()),Dnn=(t,e,n,r)=>{const i=Pnn,a=r+n;t^=-1;for(let o=r;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1};var _d=Dnn,Q_={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},h8={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:knn,_tr_stored_block:JQ,_tr_flush_block:Unn,_tr_tally:Ky,_tr_align:Fnn}=Lnn,{Z_NO_FLUSH:Jy,Z_PARTIAL_FLUSH:Bnn,Z_FULL_FLUSH:$nn,Z_FINISH:dg,Z_BLOCK:eCe,Z_OK:Xd,Z_STREAM_END:tCe,Z_STREAM_ERROR:B0,Z_DATA_ERROR:Vnn,Z_BUF_ERROR:cH,Z_DEFAULT_COMPRESSION:znn,Z_FILTERED:Hnn,Z_HUFFMAN_ONLY:sL,Z_RLE:Gnn,Z_FIXED:jnn,Z_DEFAULT_STRATEGY:Wnn,Z_UNKNOWN:Xnn,Z_DEFLATED:Rk}=h8,Znn=9,qnn=15,Ynn=8,Knn=29,Jnn=256,QQ=Jnn+1+Knn,Qnn=30,ern=19,trn=2*QQ+1,nrn=15,Ts=3,By=258,$0=By+Ts+1,rrn=32,ew=42,Kae=57,eee=69,tee=73,nee=91,ree=103,DE=113,W5=666,Jf=1,eT=2,LS=3,tT=4,irn=3,kE=(t,e)=>(t.msg=Q_[e],e),nCe=t=>t*2-(t>4?9:0),Cy=t=>{let e=t.length;for(;--e>=0;)t[e]=0},arn=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do n=t.head[--r],t.head[r]=n>=i?n-i:0;while(--e);e=i,r=e;do n=t.prev[--r],t.prev[r]=n>=i?n-i:0;while(--e)};let orn=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask,Qy=orn;const th=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))},ch=(t,e)=>{Unn(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,th(t.strm)},Ys=(t,e)=>{t.pending_buf[t.pending++]=e},K4=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},iee=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),t.state.wrap===1?t.adler=i6(t.adler,e,i,n):t.state.wrap===2&&(t.adler=_d(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},Hze=(t,e)=>{let n=t.max_chain_length,r=t.strstart,i,a,o=t.prev_length,s=t.nice_match;const l=t.strstart>t.w_size-$0?t.strstart-(t.w_size-$0):0,u=t.window,d=t.w_mask,f=t.prev,p=t.strstart+By;let h=u[r+o-1],g=u[r+o];t.prev_length>=t.good_match&&(n>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(u[i+o]!==g||u[i+o-1]!==h||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<p);if(a=By-(p-r),r=p-By,a>o){if(t.match_start=e,o=a,a>=s)break;h=u[r+o-1],g=u[r+o]}}while((e=f[e&d])>l&&--n!==0);return o<=t.lookahead?o:t.lookahead},tw=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-$0)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),arn(t),r+=e),t.strm.avail_in===0)break;if(n=iee(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=Ts)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Qy(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Qy(t,t.ins_h,t.window[i+Ts-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<Ts)););}while(t.lookahead<$0&&t.strm.avail_in!==0)},Gze=(t,e)=>{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r,i,a,o=0,s=t.strm.avail_in;do{if(r=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,r>i+t.strm.avail_in&&(r=i+t.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&e!==dg||e===Jy||r!==i+t.strm.avail_in)))break;o=e===dg&&r===i+t.strm.avail_in?1:0,JQ(t,0,0,o),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,th(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(iee(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?tT:e!==Jy&&e!==dg&&t.strm.avail_in===0&&t.strstart===t.block_start?eT:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(iee(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,n=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=n||(i||e===dg)&&e!==Jy&&t.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=e===dg&&t.strm.avail_in===0&&r===i?1:0,JQ(t,t.block_start,r,o),t.block_start+=r,th(t.strm)),o?LS:Jf)},uH=(t,e)=>{let n,r;for(;;){if(t.lookahead<$0){if(tw(t),t.lookahead<$0&&e===Jy)return Jf;if(t.lookahead===0)break}if(n=0,t.lookahead>=Ts&&(t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+Ts-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),n!==0&&t.strstart-n<=t.w_size-$0&&(t.match_length=Hze(t,n)),t.match_length>=Ts)if(r=Ky(t,t.strstart-t.match_start,t.match_length-Ts),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Ts){t.match_length--;do t.strstart++,t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+Ts-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+1]);else r=Ky(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(ch(t,!1),t.strm.avail_out===0))return Jf}return t.insert=t.strstart<Ts-1?t.strstart:Ts-1,e===dg?(ch(t,!0),t.strm.avail_out===0?LS:tT):t.sym_next&&(ch(t,!1),t.strm.avail_out===0)?Jf:eT},Nx=(t,e)=>{let n,r,i;for(;;){if(t.lookahead<$0){if(tw(t),t.lookahead<$0&&e===Jy)return Jf;if(t.lookahead===0)break}if(n=0,t.lookahead>=Ts&&(t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+Ts-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Ts-1,n!==0&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-$0&&(t.match_length=Hze(t,n),t.match_length<=5&&(t.strategy===Hnn||t.match_length===Ts&&t.strstart-t.match_start>4096)&&(t.match_length=Ts-1)),t.prev_length>=Ts&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Ts,r=Ky(t,t.strstart-1-t.prev_match,t.prev_length-Ts),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+Ts-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Ts-1,t.strstart++,r&&(ch(t,!1),t.strm.avail_out===0))return Jf}else if(t.match_available){if(r=Ky(t,0,t.window[t.strstart-1]),r&&ch(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return Jf}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=Ky(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Ts-1?t.strstart:Ts-1,e===dg?(ch(t,!0),t.strm.avail_out===0?LS:tT):t.sym_next&&(ch(t,!1),t.strm.avail_out===0)?Jf:eT},srn=(t,e)=>{let n,r,i,a;const o=t.window;for(;;){if(t.lookahead<=By){if(tw(t),t.lookahead<=By&&e===Jy)return Jf;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Ts&&t.strstart>0&&(i=t.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=t.strstart+By;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);t.match_length=By-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Ts?(n=Ky(t,1,t.match_length-Ts),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Ky(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(ch(t,!1),t.strm.avail_out===0))return Jf}return t.insert=0,e===dg?(ch(t,!0),t.strm.avail_out===0?LS:tT):t.sym_next&&(ch(t,!1),t.strm.avail_out===0)?Jf:eT},lrn=(t,e)=>{let n;for(;;){if(t.lookahead===0&&(tw(t),t.lookahead===0)){if(e===Jy)return Jf;break}if(t.match_length=0,n=Ky(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(ch(t,!1),t.strm.avail_out===0))return Jf}return t.insert=0,e===dg?(ch(t,!0),t.strm.avail_out===0?LS:tT):t.sym_next&&(ch(t,!1),t.strm.avail_out===0)?Jf:eT};function l0(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const X5=[new l0(0,0,0,0,Gze),new l0(4,4,8,4,uH),new l0(4,5,16,8,uH),new l0(4,6,32,32,uH),new l0(4,4,16,16,Nx),new l0(8,16,32,32,Nx),new l0(8,16,128,128,Nx),new l0(8,32,128,256,Nx),new l0(32,128,258,1024,Nx),new l0(32,258,258,4096,Nx)],crn=t=>{t.window_size=2*t.w_size,Cy(t.head),t.max_lazy_match=X5[t.level].max_lazy,t.good_match=X5[t.level].good_length,t.nice_match=X5[t.level].nice_length,t.max_chain_length=X5[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Ts-1,t.match_available=0,t.ins_h=0};function urn(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Rk,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(trn*2),this.dyn_dtree=new Uint16Array((2*Qnn+1)*2),this.bl_tree=new Uint16Array((2*ern+1)*2),Cy(this.dyn_ltree),Cy(this.dyn_dtree),Cy(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(nrn+1),this.heap=new Uint16Array(2*QQ+1),Cy(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*QQ+1),Cy(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const g8=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==ew&&e.status!==Kae&&e.status!==eee&&e.status!==tee&&e.status!==nee&&e.status!==ree&&e.status!==DE&&e.status!==W5?1:0},jze=t=>{if(g8(t))return kE(t,B0);t.total_in=t.total_out=0,t.data_type=Xnn;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Kae:e.wrap?ew:DE,t.adler=e.wrap===2?0:1,e.last_flush=-2,knn(e),Xd},Wze=t=>{const e=jze(t);return e===Xd&&crn(t.state),e},drn=(t,e)=>g8(t)||t.state.wrap!==2?B0:(t.state.gzhead=e,Xd),Xze=(t,e,n,r,i,a)=>{if(!t)return B0;let o=1;if(e===znn&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>Znn||n!==Rk||r<8||r>15||e<0||e>9||a<0||a>jnn||r===8&&o!==1)return kE(t,B0);r===8&&(r=9);const s=new urn;return t.state=s,s.strm=t,s.status=ew,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Ts-1)/Ts),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=n,Wze(t)},frn=(t,e)=>Xze(t,e,Rk,qnn,Ynn,Wnn),prn=(t,e)=>{if(g8(t)||e>eCe||e<0)return t?kE(t,B0):B0;const n=t.state;if(!t.output||t.avail_in!==0&&!t.input||n.status===W5&&e!==dg)return kE(t,t.avail_out===0?cH:B0);const r=n.last_flush;if(n.last_flush=e,n.pending!==0){if(th(t),t.avail_out===0)return n.last_flush=-1,Xd}else if(t.avail_in===0&&nCe(e)<=nCe(r)&&e!==dg)return kE(t,cH);if(n.status===W5&&t.avail_in!==0)return kE(t,cH);if(n.status===ew&&n.wrap===0&&(n.status=DE),n.status===ew){let i=Rk+(n.w_bits-8<<4)<<8,a=-1;if(n.strategy>=sL||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=rrn),i+=31-i%31,K4(n,i),n.strstart!==0&&(K4(n,t.adler>>>16),K4(n,t.adler&65535)),t.adler=1,n.status=DE,th(t),n.pending!==0)return n.last_flush=-1,Xd}if(n.status===Kae){if(t.adler=0,Ys(n,31),Ys(n,139),Ys(n,8),n.gzhead)Ys(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ys(n,n.gzhead.time&255),Ys(n,n.gzhead.time>>8&255),Ys(n,n.gzhead.time>>16&255),Ys(n,n.gzhead.time>>24&255),Ys(n,n.level===9?2:n.strategy>=sL||n.level<2?4:0),Ys(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Ys(n,n.gzhead.extra.length&255),Ys(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=_d(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=eee;else if(Ys(n,0),Ys(n,0),Ys(n,0),Ys(n,0),Ys(n,0),Ys(n,n.level===9?2:n.strategy>=sL||n.level<2?4:0),Ys(n,irn),n.status=DE,th(t),n.pending!==0)return n.last_flush=-1,Xd}if(n.status===eee){if(n.gzhead.extra){let i=n.pending,a=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+a>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,th(t),n.pending!==0)return n.last_flush=-1,Xd;i=0,a-=s}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending+=a,n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=tee}if(n.status===tee){if(n.gzhead.name){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i)),th(t),n.pending!==0)return n.last_flush=-1,Xd;i=0}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,Ys(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=nee}if(n.status===nee){if(n.gzhead.comment){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i)),th(t),n.pending!==0)return n.last_flush=-1,Xd;i=0}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,Ys(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(t.adler=_d(t.adler,n.pending_buf,n.pending-i,i))}n.status=ree}if(n.status===ree){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(th(t),n.pending!==0))return n.last_flush=-1,Xd;Ys(n,t.adler&255),Ys(n,t.adler>>8&255),t.adler=0}if(n.status=DE,th(t),n.pending!==0)return n.last_flush=-1,Xd}if(t.avail_in!==0||n.lookahead!==0||e!==Jy&&n.status!==W5){let i=n.level===0?Gze(n,e):n.strategy===sL?lrn(n,e):n.strategy===Gnn?srn(n,e):X5[n.level].func(n,e);if((i===LS||i===tT)&&(n.status=W5),i===Jf||i===LS)return t.avail_out===0&&(n.last_flush=-1),Xd;if(i===eT&&(e===Bnn?Fnn(n):e!==eCe&&(JQ(n,0,0,!1),e===$nn&&(Cy(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),th(t),t.avail_out===0))return n.last_flush=-1,Xd}return e!==dg?Xd:n.wrap<=0?tCe:(n.wrap===2?(Ys(n,t.adler&255),Ys(n,t.adler>>8&255),Ys(n,t.adler>>16&255),Ys(n,t.adler>>24&255),Ys(n,t.total_in&255),Ys(n,t.total_in>>8&255),Ys(n,t.total_in>>16&255),Ys(n,t.total_in>>24&255)):(K4(n,t.adler>>>16),K4(n,t.adler&65535)),th(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Xd:tCe)},hrn=t=>{if(g8(t))return B0;const e=t.state.status;return t.state=null,e===DE?kE(t,Vnn):Xd},grn=(t,e)=>{let n=e.length;if(g8(t))return B0;const r=t.state,i=r.wrap;if(i===2||i===1&&r.status!==ew||r.lookahead)return B0;if(i===1&&(t.adler=i6(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Cy(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(e.subarray(n-r.w_size,n),0),e=l,n=r.w_size}const a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,tw(r);r.lookahead>=Ts;){let l=r.strstart,u=r.lookahead-(Ts-1);do r.ins_h=Qy(r,r.ins_h,r.window[l+Ts-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=Ts-1,tw(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Ts-1,r.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,r.wrap=i,Xd};var mrn=frn,vrn=Xze,yrn=Wze,brn=jze,Ern=drn,Srn=prn,Crn=hrn,xrn=grn,_rn="pako deflate (from Nodeca project)",kI={deflateInit:mrn,deflateInit2:vrn,deflateReset:yrn,deflateResetKeep:brn,deflateSetHeader:Ern,deflate:Srn,deflateEnd:Crn,deflateSetDictionary:xrn,deflateInfo:_rn};const wrn=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Trn=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)wrn(n,r)&&(t[r]=n[r])}}return t},Irn=t=>{let e=0;for(let r=0,i=t.length;r<i;r++)e+=t[r].length;const n=new Uint8Array(e);for(let r=0,i=0,a=t.length;r<a;r++){let o=t[r];n.set(o,i),i+=o.length}return n},Ok={assign:Trn,flattenChunks:Irn};let Zze=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Zze=!1}const a6=new Uint8Array(256);for(let t=0;t<256;t++)a6[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;a6[254]=a6[254]=1;var Arn=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,i,a,o=t.length,s=0;for(i=0;i<o;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?e[a++]=n:n<2048?(e[a++]=192|n>>>6,e[a++]=128|n&63):n<65536?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|n&63):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|n&63);return e};const Rrn=(t,e)=>{if(e<65534&&t.subarray&&Zze)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n};var Orn=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,i;const a=new Array(n*2);for(i=0,r=0;r<n;){let o=t[r++];if(o<128){a[i++]=o;continue}let s=a6[o];if(s>4){a[i++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<n;)o=o<<6|t[r++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return Rrn(a,i)},Lrn=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+a6[t[n]]>e?n:e},o6={string2buf:Arn,buf2string:Orn,utf8border:Lrn};function Nrn(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var qze=Nrn;const Yze=Object.prototype.toString,{Z_NO_FLUSH:Mrn,Z_SYNC_FLUSH:Prn,Z_FULL_FLUSH:Drn,Z_FINISH:krn,Z_OK:k7,Z_STREAM_END:Urn,Z_DEFAULT_COMPRESSION:Frn,Z_DEFAULT_STRATEGY:Brn,Z_DEFLATED:$rn}=h8;function Jae(t){this.options=Ok.assign({level:Frn,method:$rn,chunkSize:16384,windowBits:15,memLevel:8,strategy:Brn},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qze,this.strm.avail_out=0;let n=kI.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==k7)throw new Error(Q_[n]);if(e.header&&kI.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=o6.string2buf(e.dictionary):Yze.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,n=kI.deflateSetDictionary(this.strm,r),n!==k7)throw new Error(Q_[n]);this._dict_set=!0}}Jae.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?krn:Mrn,typeof t=="string"?n.input=o6.string2buf(t):Yze.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===Prn||a===Drn)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=kI.deflate(n,a),i===Urn)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=kI.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===k7;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};Jae.prototype.onData=function(t){this.chunks.push(t)};Jae.prototype.onEnd=function(t){t===k7&&(this.result=Ok.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const lL=16209,Vrn=16191;var zrn=function(e,n){let r,i,a,o,s,l,u,d,f,p,h,g,y,v,m,b,E,C,x,_,A,P,R,N;const D=e.state;r=e.next_in,R=e.input,i=r+(e.avail_in-5),a=e.next_out,N=e.output,o=a-(n-e.avail_out),s=a+(e.avail_out-257),l=D.dmax,u=D.wsize,d=D.whave,f=D.wnext,p=D.window,h=D.hold,g=D.bits,y=D.lencode,v=D.distcode,m=(1<<D.lenbits)-1,b=(1<<D.distbits)-1;e:do{g<15&&(h+=R[r++]<<g,g+=8,h+=R[r++]<<g,g+=8),E=y[h&m];t:for(;;){if(C=E>>>24,h>>>=C,g-=C,C=E>>>16&255,C===0)N[a++]=E&65535;else if(C&16){x=E&65535,C&=15,C&&(g<C&&(h+=R[r++]<<g,g+=8),x+=h&(1<<C)-1,h>>>=C,g-=C),g<15&&(h+=R[r++]<<g,g+=8,h+=R[r++]<<g,g+=8),E=v[h&b];n:for(;;){if(C=E>>>24,h>>>=C,g-=C,C=E>>>16&255,C&16){if(_=E&65535,C&=15,g<C&&(h+=R[r++]<<g,g+=8,g<C&&(h+=R[r++]<<g,g+=8)),_+=h&(1<<C)-1,_>l){e.msg="invalid distance too far back",D.mode=lL;break e}if(h>>>=C,g-=C,C=a-o,_>C){if(C=_-C,C>d&&D.sane){e.msg="invalid distance too far back",D.mode=lL;break e}if(A=0,P=p,f===0){if(A+=u-C,C<x){x-=C;do N[a++]=p[A++];while(--C);A=a-_,P=N}}else if(f<C){if(A+=u+f-C,C-=f,C<x){x-=C;do N[a++]=p[A++];while(--C);if(A=0,f<x){C=f,x-=C;do N[a++]=p[A++];while(--C);A=a-_,P=N}}}else if(A+=f-C,C<x){x-=C;do N[a++]=p[A++];while(--C);A=a-_,P=N}for(;x>2;)N[a++]=P[A++],N[a++]=P[A++],N[a++]=P[A++],x-=3;x&&(N[a++]=P[A++],x>1&&(N[a++]=P[A++]))}else{A=a-_;do N[a++]=N[A++],N[a++]=N[A++],N[a++]=N[A++],x-=3;while(x>2);x&&(N[a++]=N[A++],x>1&&(N[a++]=N[A++]))}}else if(C&64){e.msg="invalid distance code",D.mode=lL;break e}else{E=v[(E&65535)+(h&(1<<C)-1)];continue n}break}}else if(C&64)if(C&32){D.mode=Vrn;break e}else{e.msg="invalid literal/length code",D.mode=lL;break e}else{E=y[(E&65535)+(h&(1<<C)-1)];continue t}break}}while(r<i&&a<s);x=g>>3,r-=x,g-=x<<3,h&=(1<<g)-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=a<s?257+(s-a):257-(a-s),D.hold=h,D.bits=g};const Mx=15,rCe=852,iCe=592,aCe=0,dH=1,oCe=2,Hrn=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Grn=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),jrn=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Wrn=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Xrn=(t,e,n,r,i,a,o,s)=>{const l=s.bits;let u=0,d=0,f=0,p=0,h=0,g=0,y=0,v=0,m=0,b=0,E,C,x,_,A,P=null,R;const N=new Uint16Array(Mx+1),D=new Uint16Array(Mx+1);let U=null,z,B,j;for(u=0;u<=Mx;u++)N[u]=0;for(d=0;d<r;d++)N[e[n+d]]++;for(h=l,p=Mx;p>=1&&N[p]===0;p--);if(h>p&&(h=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(f=1;f<p&&N[f]===0;f++);for(h<f&&(h=f),v=1,u=1;u<=Mx;u++)if(v<<=1,v-=N[u],v<0)return-1;if(v>0&&(t===aCe||p!==1))return-1;for(D[1]=0,u=1;u<Mx;u++)D[u+1]=D[u]+N[u];for(d=0;d<r;d++)e[n+d]!==0&&(o[D[e[n+d]]++]=d);if(t===aCe?(P=U=o,R=20):t===dH?(P=Hrn,U=Grn,R=257):(P=jrn,U=Wrn,R=0),b=0,d=0,u=f,A=a,g=h,y=0,x=-1,m=1<<h,_=m-1,t===dH&&m>rCe||t===oCe&&m>iCe)return 1;for(;;){z=u-y,o[d]+1<R?(B=0,j=o[d]):o[d]>=R?(B=U[o[d]-R],j=P[o[d]-R]):(B=32+64,j=0),E=1<<u-y,C=1<<g,f=C;do C-=E,i[A+(b>>y)+C]=z<<24|B<<16|j|0;while(C!==0);for(E=1<<u-1;b&E;)E>>=1;if(E!==0?(b&=E-1,b+=E):b=0,d++,--N[u]===0){if(u===p)break;u=e[n+o[d]]}if(u>h&&(b&_)!==x){for(y===0&&(y=h),A+=f,g=u-y,v=1<<g;g+y<p&&(v-=N[g+y],!(v<=0));)g++,v<<=1;if(m+=1<<g,t===dH&&m>rCe||t===oCe&&m>iCe)return 1;x=b&_,i[x]=h<<24|g<<16|A-a|0}}return b!==0&&(i[A+b]=u-y<<24|64<<16|0),s.bits=h,0};var UI=Xrn;const Zrn=0,Kze=1,Jze=2,{Z_FINISH:sCe,Z_BLOCK:qrn,Z_TREES:cL,Z_OK:NS,Z_STREAM_END:Yrn,Z_NEED_DICT:Krn,Z_STREAM_ERROR:wg,Z_DATA_ERROR:Qze,Z_MEM_ERROR:eHe,Z_BUF_ERROR:Jrn,Z_DEFLATED:lCe}=h8,Lk=16180,cCe=16181,uCe=16182,dCe=16183,fCe=16184,pCe=16185,hCe=16186,gCe=16187,mCe=16188,vCe=16189,U7=16190,xv=16191,fH=16192,yCe=16193,pH=16194,bCe=16195,ECe=16196,SCe=16197,CCe=16198,uL=16199,dL=16200,xCe=16201,_Ce=16202,wCe=16203,TCe=16204,ICe=16205,hH=16206,ACe=16207,RCe=16208,wc=16209,tHe=16210,nHe=16211,Qrn=852,ein=592,tin=15,nin=tin,OCe=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function rin(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const tC=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Lk||e.mode>nHe?1:0},rHe=t=>{if(tC(t))return wg;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Lk,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Qrn),e.distcode=e.distdyn=new Int32Array(ein),e.sane=1,e.back=-1,NS},iHe=t=>{if(tC(t))return wg;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,rHe(t)},aHe=(t,e)=>{let n;if(tC(t))return wg;const r=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?wg:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,iHe(t))},oHe=(t,e)=>{if(!t)return wg;const n=new rin;t.state=n,n.strm=t,n.window=null,n.mode=Lk;const r=aHe(t,e);return r!==NS&&(t.state=null),r},iin=t=>oHe(t,nin);let LCe=!0,gH,mH;const ain=t=>{if(LCe){gH=new Int32Array(512),mH=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(UI(Kze,t.lens,0,288,gH,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;UI(Jze,t.lens,0,32,mH,0,t.work,{bits:5}),LCe=!1}t.lencode=gH,t.lenbits=9,t.distcode=mH,t.distbits=5},sHe=(t,e,n,r)=>{let i;const a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(e.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(e.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(e.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},oin=(t,e)=>{let n,r,i,a,o,s,l,u,d,f,p,h,g,y,v=0,m,b,E,C,x,_,A,P;const R=new Uint8Array(4);let N,D;const U=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(tC(t)||!t.output||!t.input&&t.avail_in!==0)return wg;n=t.state,n.mode===xv&&(n.mode=fH),o=t.next_out,i=t.output,l=t.avail_out,a=t.next_in,r=t.input,s=t.avail_in,u=n.hold,d=n.bits,f=s,p=l,P=NS;e:for(;;)switch(n.mode){case Lk:if(n.wrap===0){n.mode=fH;break}for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,R[0]=u&255,R[1]=u>>>8&255,n.check=_d(n.check,R,2,0),u=0,d=0,n.mode=cCe;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){t.msg="incorrect header check",n.mode=wc;break}if((u&15)!==lCe){t.msg="unknown compression method",n.mode=wc;break}if(u>>>=4,d-=4,A=(u&15)+8,n.wbits===0&&(n.wbits=A),A>15||A>n.wbits){t.msg="invalid window size",n.mode=wc;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=u&512?vCe:xv,u=0,d=0;break;case cCe:for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.flags=u,(n.flags&255)!==lCe){t.msg="unknown compression method",n.mode=wc;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=wc;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,n.check=_d(n.check,R,2,0)),u=0,d=0,n.mode=uCe;case uCe:for(;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,R[2]=u>>>16&255,R[3]=u>>>24&255,n.check=_d(n.check,R,4,0)),u=0,d=0,n.mode=dCe;case dCe:for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,n.check=_d(n.check,R,2,0)),u=0,d=0,n.mode=fCe;case fCe:if(n.flags&1024){for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,n.check=_d(n.check,R,2,0)),u=0,d=0}else n.head&&(n.head.extra=null);n.mode=pCe;case pCe:if(n.flags&1024&&(h=n.length,h>s&&(h=s),h&&(n.head&&(A=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+h),A)),n.flags&512&&n.wrap&4&&(n.check=_d(n.check,r,h,a)),s-=h,a+=h,n.length-=h),n.length))break e;n.length=0,n.mode=hCe;case hCe:if(n.flags&2048){if(s===0)break e;h=0;do A=r[a+h++],n.head&&A&&n.length<65536&&(n.head.name+=String.fromCharCode(A));while(A&&h<s);if(n.flags&512&&n.wrap&4&&(n.check=_d(n.check,r,h,a)),s-=h,a+=h,A)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=gCe;case gCe:if(n.flags&4096){if(s===0)break e;h=0;do A=r[a+h++],n.head&&A&&n.length<65536&&(n.head.comment+=String.fromCharCode(A));while(A&&h<s);if(n.flags&512&&n.wrap&4&&(n.check=_d(n.check,r,h,a)),s-=h,a+=h,A)break e}else n.head&&(n.head.comment=null);n.mode=mCe;case mCe:if(n.flags&512){for(;d<16;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.wrap&4&&u!==(n.check&65535)){t.msg="header crc mismatch",n.mode=wc;break}u=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=xv;break;case vCe:for(;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}t.adler=n.check=OCe(u),u=0,d=0,n.mode=U7;case U7:if(n.havedict===0)return t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=u,n.bits=d,Krn;t.adler=n.check=1,n.mode=xv;case xv:if(e===qrn||e===cL)break e;case fH:if(n.last){u>>>=d&7,d-=d&7,n.mode=hH;break}for(;d<3;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}switch(n.last=u&1,u>>>=1,d-=1,u&3){case 0:n.mode=yCe;break;case 1:if(ain(n),n.mode=uL,e===cL){u>>>=2,d-=2;break e}break;case 2:n.mode=ECe;break;case 3:t.msg="invalid block type",n.mode=wc}u>>>=2,d-=2;break;case yCe:for(u>>>=d&7,d-=d&7;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){t.msg="invalid stored block lengths",n.mode=wc;break}if(n.length=u&65535,u=0,d=0,n.mode=pH,e===cL)break e;case pH:n.mode=bCe;case bCe:if(h=n.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;i.set(r.subarray(a,a+h),o),s-=h,a+=h,l-=h,o+=h,n.length-=h;break}n.mode=xv;break;case ECe:for(;d<14;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.nlen=(u&31)+257,u>>>=5,d-=5,n.ndist=(u&31)+1,u>>>=5,d-=5,n.ncode=(u&15)+4,u>>>=4,d-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=wc;break}n.have=0,n.mode=SCe;case SCe:for(;n.have<n.ncode;){for(;d<3;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.lens[U[n.have++]]=u&7,u>>>=3,d-=3}for(;n.have<19;)n.lens[U[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,N={bits:n.lenbits},P=UI(Zrn,n.lens,0,19,n.lencode,0,n.work,N),n.lenbits=N.bits,P){t.msg="invalid code lengths set",n.mode=wc;break}n.have=0,n.mode=CCe;case CCe:for(;n.have<n.nlen+n.ndist;){for(;v=n.lencode[u&(1<<n.lenbits)-1],m=v>>>24,b=v>>>16&255,E=v&65535,!(m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(E<16)u>>>=m,d-=m,n.lens[n.have++]=E;else{if(E===16){for(D=m+2;d<D;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(u>>>=m,d-=m,n.have===0){t.msg="invalid bit length repeat",n.mode=wc;break}A=n.lens[n.have-1],h=3+(u&3),u>>>=2,d-=2}else if(E===17){for(D=m+3;d<D;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=m,d-=m,A=0,h=3+(u&7),u>>>=3,d-=3}else{for(D=m+7;d<D;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=m,d-=m,A=0,h=11+(u&127),u>>>=7,d-=7}if(n.have+h>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=wc;break}for(;h--;)n.lens[n.have++]=A}}if(n.mode===wc)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=wc;break}if(n.lenbits=9,N={bits:n.lenbits},P=UI(Kze,n.lens,0,n.nlen,n.lencode,0,n.work,N),n.lenbits=N.bits,P){t.msg="invalid literal/lengths set",n.mode=wc;break}if(n.distbits=6,n.distcode=n.distdyn,N={bits:n.distbits},P=UI(Jze,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,N),n.distbits=N.bits,P){t.msg="invalid distances set",n.mode=wc;break}if(n.mode=uL,e===cL)break e;case uL:n.mode=dL;case dL:if(s>=6&&l>=258){t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=u,n.bits=d,zrn(t,p),o=t.next_out,i=t.output,l=t.avail_out,a=t.next_in,r=t.input,s=t.avail_in,u=n.hold,d=n.bits,n.mode===xv&&(n.back=-1);break}for(n.back=0;v=n.lencode[u&(1<<n.lenbits)-1],m=v>>>24,b=v>>>16&255,E=v&65535,!(m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(b&&!(b&240)){for(C=m,x=b,_=E;v=n.lencode[_+((u&(1<<C+x)-1)>>C)],m=v>>>24,b=v>>>16&255,E=v&65535,!(C+m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=C,d-=C,n.back+=C}if(u>>>=m,d-=m,n.back+=m,n.length=E,b===0){n.mode=ICe;break}if(b&32){n.back=-1,n.mode=xv;break}if(b&64){t.msg="invalid literal/length code",n.mode=wc;break}n.extra=b&15,n.mode=xCe;case xCe:if(n.extra){for(D=n.extra;d<D;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=_Ce;case _Ce:for(;v=n.distcode[u&(1<<n.distbits)-1],m=v>>>24,b=v>>>16&255,E=v&65535,!(m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(!(b&240)){for(C=m,x=b,_=E;v=n.distcode[_+((u&(1<<C+x)-1)>>C)],m=v>>>24,b=v>>>16&255,E=v&65535,!(C+m<=d);){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}u>>>=C,d-=C,n.back+=C}if(u>>>=m,d-=m,n.back+=m,b&64){t.msg="invalid distance code",n.mode=wc;break}n.offset=E,n.extra=b&15,n.mode=wCe;case wCe:if(n.extra){for(D=n.extra;d<D;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=wc;break}n.mode=TCe;case TCe:if(l===0)break e;if(h=p-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=wc;break}h>n.wnext?(h-=n.wnext,g=n.wsize-h):g=n.wnext-h,h>n.length&&(h=n.length),y=n.window}else y=i,g=o-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do i[o++]=y[g++];while(--h);n.length===0&&(n.mode=dL);break;case ICe:if(l===0)break e;i[o++]=n.length,l--,n.mode=dL;break;case hH:if(n.wrap){for(;d<32;){if(s===0)break e;s--,u|=r[a++]<<d,d+=8}if(p-=l,t.total_out+=p,n.total+=p,n.wrap&4&&p&&(t.adler=n.check=n.flags?_d(n.check,i,p,o-p):i6(n.check,i,p,o-p)),p=l,n.wrap&4&&(n.flags?u:OCe(u))!==n.check){t.msg="incorrect data check",n.mode=wc;break}u=0,d=0}n.mode=ACe;case ACe:if(n.wrap&&n.flags){for(;d<32;){if(s===0)break e;s--,u+=r[a++]<<d,d+=8}if(n.wrap&4&&u!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=wc;break}u=0,d=0}n.mode=RCe;case RCe:P=Yrn;break e;case wc:P=Qze;break e;case tHe:return eHe;case nHe:default:return wg}return t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=u,n.bits=d,(n.wsize||p!==t.avail_out&&n.mode<wc&&(n.mode<hH||e!==sCe))&&sHe(t,t.output,t.next_out,p-t.avail_out),f-=t.avail_in,p-=t.avail_out,t.total_in+=f,t.total_out+=p,n.total+=p,n.wrap&4&&p&&(t.adler=n.check=n.flags?_d(n.check,i,p,t.next_out-p):i6(n.check,i,p,t.next_out-p)),t.data_type=n.bits+(n.last?64:0)+(n.mode===xv?128:0)+(n.mode===uL||n.mode===pH?256:0),(f===0&&p===0||e===sCe)&&P===NS&&(P=Jrn),P},sin=t=>{if(tC(t))return wg;let e=t.state;return e.window&&(e.window=null),t.state=null,NS},lin=(t,e)=>{if(tC(t))return wg;const n=t.state;return n.wrap&2?(n.head=e,e.done=!1,NS):wg},cin=(t,e)=>{const n=e.length;let r,i,a;return tC(t)||(r=t.state,r.wrap!==0&&r.mode!==U7)?wg:r.mode===U7&&(i=1,i=i6(i,e,n,0),i!==r.check)?Qze:(a=sHe(t,e,n,n),a?(r.mode=tHe,eHe):(r.havedict=1,NS))};var uin=iHe,din=aHe,fin=rHe,pin=iin,hin=oHe,gin=oin,min=sin,vin=lin,yin=cin,bin="pako inflate (from Nodeca project)",Bv={inflateReset:uin,inflateReset2:din,inflateResetKeep:fin,inflateInit:pin,inflateInit2:hin,inflate:gin,inflateEnd:min,inflateGetHeader:vin,inflateSetDictionary:yin,inflateInfo:bin};function Ein(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Sin=Ein;const lHe=Object.prototype.toString,{Z_NO_FLUSH:Cin,Z_FINISH:xin,Z_OK:s6,Z_STREAM_END:vH,Z_NEED_DICT:yH,Z_STREAM_ERROR:_in,Z_DATA_ERROR:NCe,Z_MEM_ERROR:win}=h8;function m8(t){this.options=Ok.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qze,this.strm.avail_out=0;let n=Bv.inflateInit2(this.strm,e.windowBits);if(n!==s6)throw new Error(Q_[n]);if(this.header=new Sin,Bv.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=o6.string2buf(e.dictionary):lHe.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=Bv.inflateSetDictionary(this.strm,e.dictionary),n!==s6)))throw new Error(Q_[n])}m8.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?xin:Cin,lHe.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=Bv.inflate(n,o),a===yH&&i&&(a=Bv.inflateSetDictionary(n,i),a===s6?a=Bv.inflate(n,o):a===NCe&&(a=yH));n.avail_in>0&&a===vH&&n.state.wrap>0&&t[n.next_in]!==0;)Bv.inflateReset(n),a=Bv.inflate(n,o);switch(a){case _in:case NCe:case yH:case win:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||a===vH))if(this.options.to==="string"){let l=o6.utf8border(n.output,n.next_out),u=n.next_out-l,d=o6.buf2string(n.output,l);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(l,l+u),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===s6&&s===0)){if(a===vH)return a=Bv.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};m8.prototype.onData=function(t){this.chunks.push(t)};m8.prototype.onEnd=function(t){t===s6&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ok.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Qae(t,e){const n=new m8(e);if(n.push(t),n.err)throw n.msg||Q_[n.err];return n.result}function Tin(t,e){return e=e||{},e.raw=!0,Qae(t,e)}var Iin=m8,Ain=Qae,Rin=Tin,Oin=Qae,Lin=h8,Nin={Inflate:Iin,inflate:Ain,inflateRaw:Rin,ungzip:Oin,constants:Lin};const{Inflate:U4n,inflate:Min,inflateRaw:F4n,ungzip:B4n}=Nin;var cHe=Min;function Pin(t){const e=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n=cHe(e);return new DataView(n.buffer,n.byteOffset,n.byteLength)}const Din={ignoreImageData:!1};class uHe extends Ak{constructor(e){super(e),this._nextIFD=0}get isMultiPage(){let e=0;for(this.decodeHeader();this._nextIFD;)if(e++,this.decodeIFD({ignoreImageData:!0},!0),e===2)return!0;if(e===1)return!1;throw Lv("ifdCount",e)}get pageCount(){let e=0;for(this.decodeHeader();this._nextIFD;)e++,this.decodeIFD({ignoreImageData:!0},!0);if(e>0)return e;throw Lv("ifdCount",e)}decode(e={}){const{pages:n}=e;$in(n);const r=n?Math.max(...n):1/0;e={...Din,...e};const i=[];this.decodeHeader();let a=0;for(;this._nextIFD;){if(n){if(n.includes(a)?i.push(this.decodeIFD(e,!0)):this.decodeIFD({ignoreImageData:!0},!0),a===r)break}else i.push(this.decodeIFD(e,!0));a++}if(a<r&&r!==1/0)throw new RangeError(`Index ${r} is out of bounds. The stack only contains ${a} images.`);return i}decodeHeader(){const e=this.readUint16();if(e===18761)this.setLittleEndian();else if(e===19789)this.setBigEndian();else throw new Error(`invalid byte order: 0x${e.toString(16)}`);if(this.readUint16()!==42)throw new Error("not a TIFF file");this._nextIFD=this.readUint32()}decodeIFD(e,n){this.seek(this._nextIFD);let r;if(n)r=new WSe;else{if(!e.kind)throw new Error("kind is missing");r=new Tze(e.kind)}const i=this.readUint16();for(let a=0;a<i;a++)this.decodeIFDEntry(r);if(!e.ignoreImageData){if(!(r instanceof WSe))throw new Error("must be a tiff ifd");this.decodeImageData(r)}return this._nextIFD=this.readUint32(),r}decodeIFDEntry(e){const n=this.offset,r=this.readUint16(),i=this.readUint16(),a=this.readUint32();if(i<1||i>12){this.skip(4);return}ztn(i,a)>4&&this.seek(this.readUint32());const s=Htn(this,i,a);if(e.fields.set(r,s),r===34665||r===34853){const l=this.offset;let u="exif";r===34665?u="exif":r===34853&&(u="gps"),this._nextIFD=s,e[u]=this.decodeIFD({kind:u,ignoreImageData:!0},!1),this.offset=l}this.seek(n),this.skip(12)}decodeImageData(e){const n=e.orientation;if(n&&n!==1)throw Lv("orientation",n);switch(e.type){case 0:case 1:case 2:case 3:this.readStripData(e);break;default:throw Lv("image type",e.type)}if(this.applyPredictor(e),this.convertAlpha(e),e.type===0){const i=2**e.bitsPerSample-1;for(let a=0;a<e.data.length;a++)e.data[a]=i-e.data[a]}}readStripData(e){const n=e.width,r=e.height,i=e.bitsPerSample,a=e.sampleFormat,o=n*r*e.samplesPerPixel,s=kin(o,i,a),u=e.rowsPerStrip*n*e.samplesPerPixel,d=e.stripOffsets,f=e.stripByteCounts||ktn(e);let p=o,h=0;for(let g=0;g<d.length;g++){const y=new DataView(this.buffer,this.byteOffset+d[g],f[g]),v=p>u?u:p;p-=v;let m=y;switch(e.compression){case 1:break;case 5:{m=ann(y);break}case 8:{m=Pin(y);break}case 2:throw Lv("Compression","CCITT Group 3");case 32773:throw Lv("Compression","PackBits");default:throw Lv("Compression",e.compression)}h=this.fillUncompressed(i,a,s,m,h,v)}e.data=s}fillUncompressed(e,n,r,i,a,o){if(e===8)return Uin(r,i,a,o);if(e===16)return Fin(r,i,a,o,this.isLittleEndian());if(e===32&&n===3)return Bin(r,i,a,o,this.isLittleEndian());throw Lv("bitDepth",e)}applyPredictor(e){const n=e.bitsPerSample;switch(e.predictor){case 1:break;case 2:{if(n===8)Utn(e.data,e.width,e.components);else if(n===16)Ftn(e.data,e.width,e.components);else throw new Error(`Horizontal differencing is only supported for images with a bit depth of ${n}`);break}default:throw new Error(`invalid predictor: ${e.predictor}`)}}convertAlpha(e){if(e.alpha&&e.associatedAlpha){const{data:n,components:r,maxSampleValue:i}=e;for(let a=0;a<n.length;a+=r){const o=n[a+r-1];for(let s=0;s<r-1;s++)n[a+s]=Math.round(n[a+s]*i/o)}}}}function kin(t,e,n){if(e===8)return new Uint8Array(t);if(e===16)return new Uint16Array(t);if(e===32&&n===3)return new Float32Array(t);throw Lv("bit depth / sample format",`${e} / ${n}`)}function Uin(t,e,n,r){for(let i=0;i<r;i++)t[n++]=e.getUint8(i);return n}function Fin(t,e,n,r,i){for(let a=0;a<r*2;a+=2)t[n++]=e.getUint16(a,i);return n}function Bin(t,e,n,r,i){for(let a=0;a<r*4;a+=4)t[n++]=e.getFloat32(a,i);return n}function Lv(t,e){return new Error(`Unsupported ${t}: ${e}`)}function $in(t){if(t){for(const e of t)if(e<0||!Number.isInteger(e))throw new RangeError(`Index ${e} is invalid. Must be a positive integer.`)}}function bH(t,e){return new uHe(t).decode(e)}function MCe(t){return new uHe(t).pageCount}function af(t){return(e,...n)=>Vin(t,e,n)}function nT(t,e){return af(dHe(t,e).get)}const{apply:Vin,construct:$4n,defineProperty:V4n,get:z4n,getOwnPropertyDescriptor:dHe,getPrototypeOf:eoe,has:H4n,ownKeys:zin,set:G4n,setPrototypeOf:j4n}=Reflect,{iterator:v8,species:W4n,toStringTag:Hin,for:X4n}=Symbol,Gin=Object,{create:toe,defineProperty:jin,freeze:Z4n,is:q4n}=Gin,Win=Array,Xin=Win.prototype,fHe=Xin[v8],Zin=af(fHe),pHe=ArrayBuffer,qin=pHe.prototype;nT(qin,"byteLength");const PCe=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;PCe&&nT(PCe.prototype,"byteLength");const hHe=eoe(Uint8Array);hHe.from;const dp=hHe.prototype;dp[v8];af(dp.keys);af(dp.values);af(dp.entries);af(dp.set);af(dp.reverse);af(dp.fill);af(dp.copyWithin);af(dp.sort);af(dp.slice);af(dp.subarray);nT(dp,"buffer");nT(dp,"byteOffset");nT(dp,"length");nT(dp,Hin);const Yin=Uint8Array,gHe=Uint16Array,noe=Uint32Array,Kin=Float32Array,l6=eoe([][v8]()),mHe=af(l6.next),Jin=af(function*(){}().next),Qin=eoe(l6),ean=DataView.prototype,tan=af(ean.getUint16),roe=WeakMap,vHe=roe.prototype,yHe=af(vHe.get),nan=af(vHe.set),bHe=new roe,ran=toe(null,{next:{value:function(){const e=yHe(bHe,this);return mHe(e)}},[v8]:{value:function(){return this}}});function ian(t){if(t[v8]===fHe&&l6.next===mHe)return t;const e=toe(ran);return nan(bHe,e,Zin(t)),e}const aan=new roe,oan=toe(Qin,{next:{value:function(){const e=yHe(aan,this);return Jin(e)},writable:!0,configurable:!0}});for(const t of zin(l6))t!=="next"&&jin(oan,t,dHe(l6,t));const EHe=new pHe(4),san=new Kin(EHe),lan=new noe(EHe),c0=new gHe(512),u0=new Yin(512);for(let t=0;t<256;++t){const e=t-127;e<-24?(c0[t]=0,c0[t|256]=32768,u0[t]=24,u0[t|256]=24):e<-14?(c0[t]=1024>>-e-14,c0[t|256]=1024>>-e-14|32768,u0[t]=-e-1,u0[t|256]=-e-1):e<=15?(c0[t]=e+15<<10,c0[t|256]=e+15<<10|32768,u0[t]=13,u0[t|256]=13):e<128?(c0[t]=31744,c0[t|256]=64512,u0[t]=24,u0[t|256]=24):(c0[t]=31744,c0[t|256]=64512,u0[t]=13,u0[t|256]=13)}const ioe=new noe(2048);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;!(e&8388608);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,ioe[t]=e|n}for(let t=1024;t<2048;++t)ioe[t]=939524096+(t-1024<<13);const rT=new noe(64);for(let t=1;t<31;++t)rT[t]=t<<23;rT[31]=1199570944;rT[32]=2147483648;for(let t=33;t<63;++t)rT[t]=2147483648+(t-32<<23);rT[63]=3347054592;const SHe=new gHe(64);for(let t=1;t<64;++t)t!==32&&(SHe[t]=1024);function can(t){const e=t>>10;return lan[0]=ioe[SHe[e]+(t&1023)]+rT[e],san[0]}function CHe(t,e,...n){return can(tan(t,e,...ian(n)))}var f_={},uan={get exports(){return f_},set exports(t){f_=t}};function xHe(t,e,n){const r=n&&n.debug||!1;r&&console.log("[xml-utils] getting "+e+" in "+t);const i=typeof t=="object"?t.outer:t,a=i.slice(0,i.indexOf(">")+1),o=['"',"'"];for(let s=0;s<o.length;s++){const l=o[s],u=e+"\\="+l+"([^"+l+"]*)"+l;r&&console.log("[xml-utils] pattern:",u);const f=new RegExp(u).exec(a);if(r&&console.log("[xml-utils] match:",f),f)return f[1]}}uan.exports=xHe;f_.default=xHe;var F7={},dan={get exports(){return F7},set exports(t){F7=t}},B7={},fan={get exports(){return B7},set exports(t){B7=t}},$7={},pan={get exports(){return $7},set exports(t){$7=t}};function _He(t,e,n){const i=new RegExp(e).exec(t.slice(n));return i?n+i.index:-1}pan.exports=_He;$7.default=_He;var V7={},han={get exports(){return V7},set exports(t){V7=t}};function wHe(t,e,n){const i=new RegExp(e).exec(t.slice(n));return i?n+i.index+i[0].length-1:-1}han.exports=wHe;V7.default=wHe;var z7={},gan={get exports(){return z7},set exports(t){z7=t}};function THe(t,e){const n=new RegExp(e,"g"),r=t.match(n);return r?r.length:0}gan.exports=THe;z7.default=THe;const man=$7,EH=V7,DCe=z7;function IHe(t,e,n){const r=n&&n.debug||!1,i=!(n&&typeof n.nested===!1),a=n&&n.startIndex||0;r&&console.log("[xml-utils] starting findTagByName with",e," and ",n);const o=man(t,`<${e}[
4504
4504
  >/]`,a);if(r&&console.log("[xml-utils] start:",o),o===-1)return;const s=t.slice(o+e.length);let l=EH(s,"^[^<]*[ /]>",0);const u=l!==-1&&s[l-1]==="/";if(r&&console.log("[xml-utils] selfClosing:",u),u===!1)if(i){let h=0,g=1,y=0;for(;(l=EH(s,"[ /]"+e+">",h))!==-1;){const v=s.substring(h,l+1);if(g+=DCe(v,"<"+e+`[
4505
- >]`),y+=DCe(v,"</"+e+">"),y>=g)break;h=l}}else l=EH(s,"[ /]"+e+">",0);const d=o+e.length+l+1;if(r&&console.log("[xml-utils] end:",d),d===-1)return;const f=t.slice(o,d);let p;return u?p=null:p=f.slice(f.indexOf(">")+1,f.lastIndexOf("<")),{inner:p,outer:f,start:o,end:d}}fan.exports=IHe;B7.default=IHe;const van=B7;function AHe(t,e,n){const r=[],i=n&&n.debug||!1,a=n&&typeof n.nested=="boolean"?n.nested:!0;let o=n&&n.startIndex||0,s;for(;s=van(t,e,{debug:i,startIndex:o});)a?o=s.start+1+e.length:o=s.end,r.push(s);return i&&console.log("findTagsByName found",r.length,"tags"),r}dan.exports=AHe;F7.default=AHe;const FI={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},y0={};for(const t in FI)FI.hasOwnProperty(t)&&(y0[FI[t]]=parseInt(t,10));const yan=[y0.BitsPerSample,y0.ExtraSamples,y0.SampleFormat,y0.StripByteCounts,y0.StripOffsets,y0.StripRowCounts,y0.TileByteCounts,y0.TileOffsets,y0.SubIFDs],SH={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},Fo={};for(const t in SH)SH.hasOwnProperty(t)&&(Fo[SH[t]]=parseInt(t,10));const qp={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},ban={Unspecified:0,Assocalpha:1,Unassalpha:2},Ean={Version:0,AddCompression:1},San={None:0,Deflate:1,Zstandard:2},Can={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function xan(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3);let a;for(let o=0,s=0;o<t.length;++o,s+=3)a=256-t[o]/e*256,i[s]=a,i[s+1]=a,i[s+2]=a;return i}function _an(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3);let a;for(let o=0,s=0;o<t.length;++o,s+=3)a=t[o]/e*256,i[s]=a,i[s+1]=a,i[s+2]=a;return i}function wan(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3),a=e.length/3,o=e.length/3*2;for(let s=0,l=0;s<t.length;++s,l+=3){const u=t[s];i[l]=e[u]/65536*256,i[l+1]=e[u+a]/65536*256,i[l+2]=e[u+o]/65536*256}return i}function Tan(t){const{width:e,height:n}=t,r=new Uint8Array(e*n*3);for(let i=0,a=0;i<t.length;i+=4,a+=3){const o=t[i],s=t[i+1],l=t[i+2],u=t[i+3];r[a]=255*((255-o)/256)*((255-u)/256),r[a+1]=255*((255-s)/256)*((255-u)/256),r[a+2]=255*((255-l)/256)*((255-u)/256)}return r}function Ian(t){const{width:e,height:n}=t,r=new Uint8ClampedArray(e*n*3);for(let i=0,a=0;i<t.length;i+=3,a+=3){const o=t[i],s=t[i+1],l=t[i+2];r[a]=o+1.402*(l-128),r[a+1]=o-.34414*(s-128)-.71414*(l-128),r[a+2]=o+1.772*(s-128)}return r}const Aan=.95047,Ran=1,Oan=1.08883;function Lan(t){const{width:e,height:n}=t,r=new Uint8Array(e*n*3);for(let i=0,a=0;i<t.length;i+=3,a+=3){const o=t[i+0],s=t[i+1]<<24>>24,l=t[i+2]<<24>>24;let u=(o+16)/116,d=s/500+u,f=u-l/200,p,h,g;d=Aan*(d*d*d>.008856?d*d*d:(d-16/116)/7.787),u=Ran*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),f=Oan*(f*f*f>.008856?f*f*f:(f-16/116)/7.787),p=d*3.2406+u*-1.5372+f*-.4986,h=d*-.9689+u*1.8758+f*.0415,g=d*.0557+u*-.204+f*1.057,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,h=h>.0031308?1.055*h**(1/2.4)-.055:12.92*h,g=g>.0031308?1.055*g**(1/2.4)-.055:12.92*g,r[a]=Math.max(0,Math.min(1,p))*255,r[a+1]=Math.max(0,Math.min(1,h))*255,r[a+2]=Math.max(0,Math.min(1,g))*255}return r}const RHe=new Map;function Nb(t,e){Array.isArray(t)||(t=[t]),t.forEach(n=>RHe.set(n,e))}async function Nan(t){const e=RHe.get(t.Compression);if(!e)throw new Error(`Unknown compression method identifier: ${t.Compression}`);const n=await e();return new n(t)}Nb([void 0,1],()=>Promise.resolve().then(()=>require("./raw-9c0f4034.js")).then(t=>t.default));Nb(5,()=>Promise.resolve().then(()=>require("./lzw-f00e8c8c.js")).then(t=>t.default));Nb(6,()=>{throw new Error("old style JPEG compression is not supported.")});Nb(7,()=>Promise.resolve().then(()=>require("./jpeg-f3c7cefc.js")).then(t=>t.default));Nb([8,32946],()=>Promise.resolve().then(()=>require("./deflate-6ca69617.js")).then(t=>t.default));Nb(32773,()=>Promise.resolve().then(()=>require("./packbits-58fd9c05.js")).then(t=>t.default));Nb(34887,()=>Promise.resolve().then(()=>require("./lerc-f84f2604.js")).then(async t=>(await t.zstd.init(),t)).then(t=>t.default));Nb(50001,()=>Promise.resolve().then(()=>require("./webimage-bc81928d.js")).then(t=>t.default));function Nk(t,e,n,r=1){return new(Object.getPrototypeOf(t)).constructor(e*n*r)}function Man(t,e,n,r,i){const a=e/r,o=n/i;return t.map(s=>{const l=Nk(s,r,i);for(let u=0;u<i;++u){const d=Math.min(Math.round(o*u),n-1);for(let f=0;f<r;++f){const p=Math.min(Math.round(a*f),e-1),h=s[d*e+p];l[u*r+f]=h}}return l})}function p_(t,e,n){return(1-n)*t+n*e}function Pan(t,e,n,r,i){const a=e/r,o=n/i;return t.map(s=>{const l=Nk(s,r,i);for(let u=0;u<i;++u){const d=o*u,f=Math.floor(d),p=Math.min(Math.ceil(d),n-1);for(let h=0;h<r;++h){const g=a*h,y=g%1,v=Math.floor(g),m=Math.min(Math.ceil(g),e-1),b=s[f*e+v],E=s[f*e+m],C=s[p*e+v],x=s[p*e+m],_=p_(p_(b,E,y),p_(C,x,y),d%1);l[u*r+h]=_}}return l})}function Dan(t,e,n,r,i,a="nearest"){switch(a.toLowerCase()){case"nearest":return Man(t,e,n,r,i);case"bilinear":case"linear":return Pan(t,e,n,r,i);default:throw new Error(`Unsupported resampling method: '${a}'`)}}function kan(t,e,n,r,i,a){const o=e/r,s=n/i,l=Nk(t,r,i,a);for(let u=0;u<i;++u){const d=Math.min(Math.round(s*u),n-1);for(let f=0;f<r;++f){const p=Math.min(Math.round(o*f),e-1);for(let h=0;h<a;++h){const g=t[d*e*a+p*a+h];l[u*r*a+f*a+h]=g}}}return l}function Uan(t,e,n,r,i,a){const o=e/r,s=n/i,l=Nk(t,r,i,a);for(let u=0;u<i;++u){const d=s*u,f=Math.floor(d),p=Math.min(Math.ceil(d),n-1);for(let h=0;h<r;++h){const g=o*h,y=g%1,v=Math.floor(g),m=Math.min(Math.ceil(g),e-1);for(let b=0;b<a;++b){const E=t[f*e*a+v*a+b],C=t[f*e*a+m*a+b],x=t[p*e*a+v*a+b],_=t[p*e*a+m*a+b],A=p_(p_(E,C,y),p_(x,_,y),d%1);l[u*r*a+h*a+b]=A}}}return l}function Fan(t,e,n,r,i,a,o="nearest"){switch(o.toLowerCase()){case"nearest":return kan(t,e,n,r,i,a);case"bilinear":case"linear":return Uan(t,e,n,r,i,a);default:throw new Error(`Unsupported resampling method: '${o}'`)}}function Ban(t,e,n){let r=0;for(let i=e;i<n;++i)r+=t[i];return r}function aee(t,e,n){switch(t){case 1:if(e<=8)return new Uint8Array(n);if(e<=16)return new Uint16Array(n);if(e<=32)return new Uint32Array(n);break;case 2:if(e===8)return new Int8Array(n);if(e===16)return new Int16Array(n);if(e===32)return new Int32Array(n);break;case 3:switch(e){case 16:case 32:return new Float32Array(n);case 64:return new Float64Array(n)}break}throw Error("Unsupported data format/bitsPerSample")}function $an(t,e){return(t===1||t===2)&&e<=32&&e%8===0?!1:!(t===3&&(e===16||e===32||e===64))}function Van(t,e,n,r,i,a,o){const s=new DataView(t),l=n===2?o*a:o*a*r,u=n===2?1:r,d=aee(e,i,l),f=parseInt("1".repeat(i),2);if(e===1){let p;n===1?p=r*i:p=i;let h=a*p;h&7&&(h=h+7&-8);for(let g=0;g<o;++g){const y=g*h;for(let v=0;v<a;++v){const m=y+v*u*i;for(let b=0;b<u;++b){const E=m+b*i,C=(g*a+v)*u+b,x=Math.floor(E/8),_=E%8;if(_+i<=8)d[C]=s.getUint8(x)>>8-i-_&f;else if(_+i<=16)d[C]=s.getUint16(x)>>16-i-_&f;else if(_+i<=24){const A=s.getUint16(x)<<8|s.getUint8(x+2);d[C]=A>>24-i-_&f}else d[C]=s.getUint32(x)>>32-i-_&f}}}}return d.buffer}class zan{constructor(e,n,r,i,a,o){this.fileDirectory=e,this.geoKeys=n,this.dataView=r,this.littleEndian=i,this.tiles=a?{}:null,this.isTiled=!e.StripOffsets;const s=e.PlanarConfiguration;if(this.planarConfiguration=typeof s>"u"?1:s,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}getBytesPerPixel(){let e=0;for(let n=0;n<this.fileDirectory.BitsPerSample.length;++n)e+=this.getSampleByteSize(n);return e}getSampleByteSize(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${e} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}getReaderForSample(e){const n=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,r=this.fileDirectory.BitsPerSample[e];switch(n){case 1:if(r<=8)return DataView.prototype.getUint8;if(r<=16)return DataView.prototype.getUint16;if(r<=32)return DataView.prototype.getUint32;break;case 2:if(r<=8)return DataView.prototype.getInt8;if(r<=16)return DataView.prototype.getInt16;if(r<=32)return DataView.prototype.getInt32;break;case 3:switch(r){case 16:return function(i,a){return CHe(this,i,a)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(e=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}getBitsPerSample(e=0){return this.fileDirectory.BitsPerSample[e]}getArrayForSample(e,n){const r=this.getSampleFormat(e),i=this.getBitsPerSample(e);return aee(r,i,n)}async getTileOrStrip(e,n,r,i,a){const o=Math.ceil(this.getWidth()/this.getTileWidth()),s=Math.ceil(this.getHeight()/this.getTileHeight());let l;const{tiles:u}=this;this.planarConfiguration===1?l=n*o+e:this.planarConfiguration===2&&(l=r*o*s+n*o+e);let d,f;this.isTiled?(d=this.fileDirectory.TileOffsets[l],f=this.fileDirectory.TileByteCounts[l]):(d=this.fileDirectory.StripOffsets[l],f=this.fileDirectory.StripByteCounts[l]);const p=(await this.source.fetch([{offset:d,length:f}],a))[0];let h;return u===null||!u[l]?(h=(async()=>{let g=await i.decode(this.fileDirectory,p);const y=this.getSampleFormat(),v=this.getBitsPerSample();return $an(y,v)&&(g=Van(g,y,this.planarConfiguration,this.getSamplesPerPixel(),v,this.getTileWidth(),this.getBlockHeight(n))),g})(),u!==null&&(u[l]=h)):h=u[l],{x:e,y:n,sample:r,data:await h}}async _readRaster(e,n,r,i,a,o,s,l,u){const d=this.getTileWidth(),f=this.getTileHeight(),p=this.getWidth(),h=this.getHeight(),g=Math.max(Math.floor(e[0]/d),0),y=Math.min(Math.ceil(e[2]/d),Math.ceil(p/d)),v=Math.max(Math.floor(e[1]/f),0),m=Math.min(Math.ceil(e[3]/f),Math.ceil(h/f)),b=e[2]-e[0];let E=this.getBytesPerPixel();const C=[],x=[];for(let P=0;P<n.length;++P)this.planarConfiguration===1?C.push(Ban(this.fileDirectory.BitsPerSample,0,n[P])/8):C.push(0),x.push(this.getReaderForSample(n[P]));const _=[],{littleEndian:A}=this;for(let P=v;P<m;++P)for(let R=g;R<y;++R){let N;this.planarConfiguration===1&&(N=this.getTileOrStrip(R,P,0,a,u));for(let D=0;D<n.length;++D){const U=D,z=n[D];this.planarConfiguration===2&&(E=this.getSampleByteSize(z),N=this.getTileOrStrip(R,P,z,a,u));const B=N.then(j=>{const V=j.data,G=new DataView(V),W=this.getBlockHeight(j.y),Z=j.y*f,H=j.x*d,X=Z+W,ee=(j.x+1)*d,K=x[U],Y=Math.min(W,W-(X-e[3]),h-Z),Q=Math.min(d,d-(ee-e[2]),p-H);for(let re=Math.max(0,e[1]-Z);re<Y;++re)for(let ne=Math.max(0,e[0]-H);ne<Q;++ne){const oe=(re*d+ne)*E,de=K.call(G,oe+C[U],A);let ue;i?(ue=(re+Z-e[1])*b*n.length+(ne+H-e[0])*n.length+U,r[ue]=de):(ue=(re+Z-e[1])*b+ne+H-e[0],r[U][ue]=de)}});_.push(B)}}if(await Promise.all(_),o&&e[2]-e[0]!==o||s&&e[3]-e[1]!==s){let P;return i?P=Fan(r,e[2]-e[0],e[3]-e[1],o,s,n.length,l):P=Dan(r,e[2]-e[0],e[3]-e[1],o,s,l),P.width=o,P.height=s,P}return r.width=o||e[2]-e[0],r.height=s||e[3]-e[1],r}async readRasters({window:e,samples:n=[],interleave:r,pool:i=null,width:a,height:o,resampleMethod:s,fillValue:l,signal:u}={}){const d=e||[0,0,this.getWidth(),this.getHeight()];if(d[0]>d[2]||d[1]>d[3])throw new Error("Invalid subsets");const f=d[2]-d[0],p=d[3]-d[1],h=f*p,g=this.getSamplesPerPixel();if(!n||!n.length)for(let b=0;b<g;++b)n.push(b);else for(let b=0;b<n.length;++b)if(n[b]>=g)return Promise.reject(new RangeError(`Invalid sample index '${n[b]}'.`));let y;if(r){const b=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,E=Math.max.apply(null,this.fileDirectory.BitsPerSample);y=aee(b,E,h*n.length),l&&y.fill(l)}else{y=[];for(let b=0;b<n.length;++b){const E=this.getArrayForSample(n[b],h);Array.isArray(l)&&b<l.length?E.fill(l[b]):l&&!Array.isArray(l)&&E.fill(l),y.push(E)}}const v=i||await Nan(this.fileDirectory);return await this._readRaster(d,n,y,r,v,a,o,s,u)}async readRGB({window:e,interleave:n=!0,pool:r=null,width:i,height:a,resampleMethod:o,enableAlpha:s=!1,signal:l}={}){const u=e||[0,0,this.getWidth(),this.getHeight()];if(u[0]>u[2]||u[1]>u[3])throw new Error("Invalid subsets");const d=this.fileDirectory.PhotometricInterpretation;if(d===qp.RGB){let m=[0,1,2];if(this.fileDirectory.ExtraSamples!==ban.Unspecified&&s){m=[];for(let b=0;b<this.fileDirectory.BitsPerSample.length;b+=1)m.push(b)}return this.readRasters({window:e,interleave:n,samples:m,pool:r,width:i,height:a,resampleMethod:o,signal:l})}let f;switch(d){case qp.WhiteIsZero:case qp.BlackIsZero:case qp.Palette:f=[0];break;case qp.CMYK:f=[0,1,2,3];break;case qp.YCbCr:case qp.CIELab:f=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const p={window:u,interleave:!0,samples:f,pool:r,width:i,height:a,resampleMethod:o,signal:l},{fileDirectory:h}=this,g=await this.readRasters(p),y=2**this.fileDirectory.BitsPerSample[0];let v;switch(d){case qp.WhiteIsZero:v=xan(g,y);break;case qp.BlackIsZero:v=_an(g,y);break;case qp.Palette:v=wan(g,h.ColorMap);break;case qp.CMYK:v=Tan(g);break;case qp.YCbCr:v=Ian(g);break;case qp.CIELab:v=Lan(g);break;default:throw new Error("Unsupported photometric interpretation.")}if(!n){const m=new Uint8Array(v.length/3),b=new Uint8Array(v.length/3),E=new Uint8Array(v.length/3);for(let C=0,x=0;C<v.length;C+=3,++x)m[x]=v[C],b[x]=v[C+1],E[x]=v[C+2];v=[m,b,E]}return v.width=g.width,v.height=g.height,v}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const e=[];for(let n=0;n<this.fileDirectory.ModelTiepoint.length;n+=6)e.push({i:this.fileDirectory.ModelTiepoint[n],j:this.fileDirectory.ModelTiepoint[n+1],k:this.fileDirectory.ModelTiepoint[n+2],x:this.fileDirectory.ModelTiepoint[n+3],y:this.fileDirectory.ModelTiepoint[n+4],z:this.fileDirectory.ModelTiepoint[n+5]});return e}getGDALMetadata(e=null){const n={};if(!this.fileDirectory.GDAL_METADATA)return null;const r=this.fileDirectory.GDAL_METADATA;let i=F7(r,"Item");e===null?i=i.filter(a=>f_(a,"sample")===void 0):i=i.filter(a=>Number(f_(a,"sample"))===e);for(let a=0;a<i.length;++a){const o=i[a];n[f_(o,"name")]=o.inner}return n}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}getOrigin(){const e=this.fileDirectory.ModelTiepoint,n=this.fileDirectory.ModelTransformation;if(e&&e.length===6)return[e[3],e[4],e[5]];if(n)return[n[3],n[7],n[11]];throw new Error("The image does not have an affine transformation.")}getResolution(e=null){const n=this.fileDirectory.ModelPixelScale,r=this.fileDirectory.ModelTransformation;if(n)return[n[0],-n[1],n[2]];if(r)return r[1]===0&&r[4]===0?[r[0],-r[5],r[10]]:[Math.sqrt(r[0]*r[0]+r[4]*r[4]),-Math.sqrt(r[1]*r[1]+r[5]*r[5]),r[10]];if(e){const[i,a,o]=e.getResolution();return[i*e.getWidth()/this.getWidth(),a*e.getHeight()/this.getHeight(),o*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return this.geoKeys.GTRasterTypeGeoKey===1}getBoundingBox(e=!1){const n=this.getHeight(),r=this.getWidth();if(this.fileDirectory.ModelTransformation&&!e){const[i,a,o,s,l,u,d,f]=this.fileDirectory.ModelTransformation,h=[[0,0],[0,n],[r,0],[r,n]].map(([v,m])=>[s+i*v+a*m,f+l*v+u*m]),g=h.map(v=>v[0]),y=h.map(v=>v[1]);return[Math.min(...g),Math.min(...y),Math.max(...g),Math.max(...y)]}else{const i=this.getOrigin(),a=this.getResolution(),o=i[0],s=i[1],l=o+a[0]*r,u=s+a[1]*n;return[Math.min(o,l),Math.min(s,u),Math.max(o,l),Math.max(s,u)]}}}const Han=zan;class Gan{constructor(e){this._dataView=new DataView(e)}get buffer(){return this._dataView.buffer}getUint64(e,n){const r=this.getUint32(e,n),i=this.getUint32(e+4,n);let a;if(n){if(a=r+2**32*i,!Number.isSafeInteger(a))throw new Error(`${a} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return a}if(a=2**32*r+i,!Number.isSafeInteger(a))throw new Error(`${a} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return a}getInt64(e,n){let r=0;const i=(this._dataView.getUint8(e+(n?7:0))&128)>0;let a=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(e+(n?o:7-o));i&&(a?s!==0&&(s=~(s-1)&255,a=!1):s=~s&255),r+=s*256**o}return i&&(r=-r),r}getUint8(e,n){return this._dataView.getUint8(e,n)}getInt8(e,n){return this._dataView.getInt8(e,n)}getUint16(e,n){return this._dataView.getUint16(e,n)}getInt16(e,n){return this._dataView.getInt16(e,n)}getUint32(e,n){return this._dataView.getUint32(e,n)}getInt32(e,n){return this._dataView.getInt32(e,n)}getFloat16(e,n){return CHe(this._dataView,e,n)}getFloat32(e,n){return this._dataView.getFloat32(e,n)}getFloat64(e,n){return this._dataView.getFloat64(e,n)}}class jan{constructor(e,n,r,i){this._dataView=new DataView(e),this._sliceOffset=n,this._littleEndian=r,this._bigTiff=i}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(e,n){return this.sliceOffset<=e&&this.sliceTop>=e+n}readUint8(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}readInt8(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}readUint16(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}readInt16(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}readUint32(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}readInt32(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}readFloat32(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}readFloat64(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}readUint64(e){const n=this.readUint32(e),r=this.readUint32(e+4);let i;if(this._littleEndian){if(i=n+2**32*r,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}if(i=2**32*n+r,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}readInt64(e){let n=0;const r=(this._dataView.getUint8(e+(this._littleEndian?7:0))&128)>0;let i=!0;for(let a=0;a<8;a++){let o=this._dataView.getUint8(e+(this._littleEndian?a:7-a));r&&(i?o!==0&&(o=~(o-1)&255,i=!1):o=~o&255),n+=o*256**a}return r&&(n=-n),n}readOffset(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}}class Wan{async fetch(e,n=void 0){return Promise.all(e.map(r=>this.fetchSlice(r,n)))}async fetchSlice(e){throw new Error(`fetching of slice ${e} not possible, not implemented`)}get fileSize(){return null}async close(){}}class aoe extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,aoe),this.name="AbortError"}}class Xan extends Wan{constructor(e){super(),this.arrayBuffer=e}fetchSlice(e,n){if(n&&n.aborted)throw new aoe("Request aborted");return this.arrayBuffer.slice(e.offset,e.offset+e.length)}}function Zan(t){return new Xan(t)}function oee(t){switch(t){case Fo.BYTE:case Fo.ASCII:case Fo.SBYTE:case Fo.UNDEFINED:return 1;case Fo.SHORT:case Fo.SSHORT:return 2;case Fo.LONG:case Fo.SLONG:case Fo.FLOAT:case Fo.IFD:return 4;case Fo.RATIONAL:case Fo.SRATIONAL:case Fo.DOUBLE:case Fo.LONG8:case Fo.SLONG8:case Fo.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${t}`)}}function qan(t){const e=t.GeoKeyDirectory;if(!e)return null;const n={};for(let r=4;r<=e[3]*4;r+=4){const i=Can[e[r]],a=e[r+1]?FI[e[r+1]]:null,o=e[r+2],s=e[r+3];let l=null;if(!a)l=s;else{if(l=t[a],typeof l>"u"||l===null)throw new Error(`Could not get value of geoKey '${i}'.`);typeof l=="string"?l=l.substring(s,s+o-1):l.subarray&&(l=l.subarray(s,s+o),o===1&&(l=l[0]))}n[i]=l}return n}function Px(t,e,n,r){let i=null,a=null;const o=oee(e);switch(e){case Fo.BYTE:case Fo.ASCII:case Fo.UNDEFINED:i=new Uint8Array(n),a=t.readUint8;break;case Fo.SBYTE:i=new Int8Array(n),a=t.readInt8;break;case Fo.SHORT:i=new Uint16Array(n),a=t.readUint16;break;case Fo.SSHORT:i=new Int16Array(n),a=t.readInt16;break;case Fo.LONG:case Fo.IFD:i=new Uint32Array(n),a=t.readUint32;break;case Fo.SLONG:i=new Int32Array(n),a=t.readInt32;break;case Fo.LONG8:case Fo.IFD8:i=new Array(n),a=t.readUint64;break;case Fo.SLONG8:i=new Array(n),a=t.readInt64;break;case Fo.RATIONAL:i=new Uint32Array(n*2),a=t.readUint32;break;case Fo.SRATIONAL:i=new Int32Array(n*2),a=t.readInt32;break;case Fo.FLOAT:i=new Float32Array(n),a=t.readFloat32;break;case Fo.DOUBLE:i=new Float64Array(n),a=t.readFloat64;break;default:throw new RangeError(`Invalid field type: ${e}`)}if(e===Fo.RATIONAL||e===Fo.SRATIONAL)for(let s=0;s<n;s+=2)i[s]=a.call(t,r+s*o),i[s+1]=a.call(t,r+(s*o+4));else for(let s=0;s<n;++s)i[s]=a.call(t,r+s*o);return e===Fo.ASCII?new TextDecoder("utf-8").decode(i):i}class Yan{constructor(e,n,r){this.fileDirectory=e,this.geoKeyDirectory=n,this.nextIFDByteOffset=r}}class fL extends Error{constructor(e){super(`No image at index ${e}`),this.index=e}}class Kan{async readRasters(e={}){const{window:n,width:r,height:i}=e;let{resX:a,resY:o,bbox:s}=e;const l=await this.getImage();let u=l;const d=await this.getImageCount(),f=l.getBoundingBox();if(n&&s)throw new Error('Both "bbox" and "window" passed.');if(r||i){if(n){const[g,y]=l.getOrigin(),[v,m]=l.getResolution();s=[g+n[0]*v,y+n[1]*m,g+n[2]*v,y+n[3]*m]}const h=s||f;if(r){if(a)throw new Error("Both width and resX passed");a=(h[2]-h[0])/r}if(i){if(o)throw new Error("Both width and resY passed");o=(h[3]-h[1])/i}}if(a||o){const h=[];for(let g=0;g<d;++g){const y=await this.getImage(g),{SubfileType:v,NewSubfileType:m}=y.fileDirectory;(g===0||v===2||m&1)&&h.push(y)}h.sort((g,y)=>g.getWidth()-y.getWidth());for(let g=0;g<h.length;++g){const y=h[g],v=(f[2]-f[0])/y.getWidth(),m=(f[3]-f[1])/y.getHeight();if(u=y,a&&a>v||o&&o>m)break}}let p=n;if(s){const[h,g]=l.getOrigin(),[y,v]=u.getResolution(l);p=[Math.round((s[0]-h)/y),Math.round((s[1]-g)/v),Math.round((s[2]-h)/y),Math.round((s[3]-g)/v)],p=[Math.min(p[0],p[2]),Math.min(p[1],p[3]),Math.max(p[0],p[2]),Math.max(p[1],p[3])]}return u.readRasters({...e,window:p})}}class ooe extends Kan{constructor(e,n,r,i,a={}){super(),this.source=e,this.littleEndian=n,this.bigTiff=r,this.firstIFDOffset=i,this.cache=a.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(e,n){const r=this.bigTiff?4048:1024;return new jan((await this.source.fetch([{offset:e,length:typeof n<"u"?n:r}]))[0],e,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(e){const n=this.bigTiff?20:12,r=this.bigTiff?8:2;let i=await this.getSlice(e);const a=this.bigTiff?i.readUint64(e):i.readUint16(e),o=a*n+(this.bigTiff?16:6);i.covers(e,o)||(i=await this.getSlice(e,o));const s={};let l=e+(this.bigTiff?8:2);for(let f=0;f<a;l+=n,++f){const p=i.readUint16(l),h=i.readUint16(l+2),g=this.bigTiff?i.readUint64(l+4):i.readUint32(l+4);let y,v;const m=oee(h),b=l+(this.bigTiff?12:8);if(m*g<=(this.bigTiff?8:4))y=Px(i,h,g,b);else{const E=i.readOffset(b),C=oee(h)*g;if(i.covers(E,C))y=Px(i,h,g,E);else{const x=await this.getSlice(E,C);y=Px(x,h,g,E)}}g===1&&yan.indexOf(p)===-1&&!(h===Fo.RATIONAL||h===Fo.SRATIONAL)?v=y[0]:v=y,s[FI[p]]=v}const u=qan(s),d=i.readOffset(e+r+n*a);return new Yan(s,u,d)}async requestIFD(e){if(this.ifdRequests[e])return this.ifdRequests[e];if(e===0)return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[e];if(!this.ifdRequests[e-1])try{this.ifdRequests[e-1]=this.requestIFD(e-1)}catch(n){throw n instanceof fL?new fL(e):n}return this.ifdRequests[e]=(async()=>{const n=await this.ifdRequests[e-1];if(n.nextIFDByteOffset===0)throw new fL(e);return this.parseFileDirectoryAt(n.nextIFDByteOffset)})(),this.ifdRequests[e]}async getImage(e=0){const n=await this.requestIFD(e);return new Han(n.fileDirectory,n.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let e=0,n=!0;for(;n;)try{await this.requestIFD(e),++e}catch(r){if(r instanceof fL)n=!1;else throw r}return e}async getGhostValues(){const e=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const n="GDAL_STRUCTURAL_METADATA_SIZE=",r=n.length+100;let i=await this.getSlice(e,r);if(n===Px(i,Fo.ASCII,n.length,e)){const o=Px(i,Fo.ASCII,r,e).split(`
4505
+ >]`),y+=DCe(v,"</"+e+">"),y>=g)break;h=l}}else l=EH(s,"[ /]"+e+">",0);const d=o+e.length+l+1;if(r&&console.log("[xml-utils] end:",d),d===-1)return;const f=t.slice(o,d);let p;return u?p=null:p=f.slice(f.indexOf(">")+1,f.lastIndexOf("<")),{inner:p,outer:f,start:o,end:d}}fan.exports=IHe;B7.default=IHe;const van=B7;function AHe(t,e,n){const r=[],i=n&&n.debug||!1,a=n&&typeof n.nested=="boolean"?n.nested:!0;let o=n&&n.startIndex||0,s;for(;s=van(t,e,{debug:i,startIndex:o});)a?o=s.start+1+e.length:o=s.end,r.push(s);return i&&console.log("findTagsByName found",r.length,"tags"),r}dan.exports=AHe;F7.default=AHe;const FI={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},y0={};for(const t in FI)FI.hasOwnProperty(t)&&(y0[FI[t]]=parseInt(t,10));const yan=[y0.BitsPerSample,y0.ExtraSamples,y0.SampleFormat,y0.StripByteCounts,y0.StripOffsets,y0.StripRowCounts,y0.TileByteCounts,y0.TileOffsets,y0.SubIFDs],SH={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},Fo={};for(const t in SH)SH.hasOwnProperty(t)&&(Fo[SH[t]]=parseInt(t,10));const qp={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},ban={Unspecified:0,Assocalpha:1,Unassalpha:2},Ean={Version:0,AddCompression:1},San={None:0,Deflate:1,Zstandard:2},Can={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function xan(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3);let a;for(let o=0,s=0;o<t.length;++o,s+=3)a=256-t[o]/e*256,i[s]=a,i[s+1]=a,i[s+2]=a;return i}function _an(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3);let a;for(let o=0,s=0;o<t.length;++o,s+=3)a=t[o]/e*256,i[s]=a,i[s+1]=a,i[s+2]=a;return i}function wan(t,e){const{width:n,height:r}=t,i=new Uint8Array(n*r*3),a=e.length/3,o=e.length/3*2;for(let s=0,l=0;s<t.length;++s,l+=3){const u=t[s];i[l]=e[u]/65536*256,i[l+1]=e[u+a]/65536*256,i[l+2]=e[u+o]/65536*256}return i}function Tan(t){const{width:e,height:n}=t,r=new Uint8Array(e*n*3);for(let i=0,a=0;i<t.length;i+=4,a+=3){const o=t[i],s=t[i+1],l=t[i+2],u=t[i+3];r[a]=255*((255-o)/256)*((255-u)/256),r[a+1]=255*((255-s)/256)*((255-u)/256),r[a+2]=255*((255-l)/256)*((255-u)/256)}return r}function Ian(t){const{width:e,height:n}=t,r=new Uint8ClampedArray(e*n*3);for(let i=0,a=0;i<t.length;i+=3,a+=3){const o=t[i],s=t[i+1],l=t[i+2];r[a]=o+1.402*(l-128),r[a+1]=o-.34414*(s-128)-.71414*(l-128),r[a+2]=o+1.772*(s-128)}return r}const Aan=.95047,Ran=1,Oan=1.08883;function Lan(t){const{width:e,height:n}=t,r=new Uint8Array(e*n*3);for(let i=0,a=0;i<t.length;i+=3,a+=3){const o=t[i+0],s=t[i+1]<<24>>24,l=t[i+2]<<24>>24;let u=(o+16)/116,d=s/500+u,f=u-l/200,p,h,g;d=Aan*(d*d*d>.008856?d*d*d:(d-16/116)/7.787),u=Ran*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),f=Oan*(f*f*f>.008856?f*f*f:(f-16/116)/7.787),p=d*3.2406+u*-1.5372+f*-.4986,h=d*-.9689+u*1.8758+f*.0415,g=d*.0557+u*-.204+f*1.057,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,h=h>.0031308?1.055*h**(1/2.4)-.055:12.92*h,g=g>.0031308?1.055*g**(1/2.4)-.055:12.92*g,r[a]=Math.max(0,Math.min(1,p))*255,r[a+1]=Math.max(0,Math.min(1,h))*255,r[a+2]=Math.max(0,Math.min(1,g))*255}return r}const RHe=new Map;function Nb(t,e){Array.isArray(t)||(t=[t]),t.forEach(n=>RHe.set(n,e))}async function Nan(t){const e=RHe.get(t.Compression);if(!e)throw new Error(`Unknown compression method identifier: ${t.Compression}`);const n=await e();return new n(t)}Nb([void 0,1],()=>Promise.resolve().then(()=>require("./raw-9c0f4034.js")).then(t=>t.default));Nb(5,()=>Promise.resolve().then(()=>require("./lzw-f00e8c8c.js")).then(t=>t.default));Nb(6,()=>{throw new Error("old style JPEG compression is not supported.")});Nb(7,()=>Promise.resolve().then(()=>require("./jpeg-f3c7cefc.js")).then(t=>t.default));Nb([8,32946],()=>Promise.resolve().then(()=>require("./deflate-468945ee.js")).then(t=>t.default));Nb(32773,()=>Promise.resolve().then(()=>require("./packbits-58fd9c05.js")).then(t=>t.default));Nb(34887,()=>Promise.resolve().then(()=>require("./lerc-a9582ff5.js")).then(async t=>(await t.zstd.init(),t)).then(t=>t.default));Nb(50001,()=>Promise.resolve().then(()=>require("./webimage-bc81928d.js")).then(t=>t.default));function Nk(t,e,n,r=1){return new(Object.getPrototypeOf(t)).constructor(e*n*r)}function Man(t,e,n,r,i){const a=e/r,o=n/i;return t.map(s=>{const l=Nk(s,r,i);for(let u=0;u<i;++u){const d=Math.min(Math.round(o*u),n-1);for(let f=0;f<r;++f){const p=Math.min(Math.round(a*f),e-1),h=s[d*e+p];l[u*r+f]=h}}return l})}function p_(t,e,n){return(1-n)*t+n*e}function Pan(t,e,n,r,i){const a=e/r,o=n/i;return t.map(s=>{const l=Nk(s,r,i);for(let u=0;u<i;++u){const d=o*u,f=Math.floor(d),p=Math.min(Math.ceil(d),n-1);for(let h=0;h<r;++h){const g=a*h,y=g%1,v=Math.floor(g),m=Math.min(Math.ceil(g),e-1),b=s[f*e+v],E=s[f*e+m],C=s[p*e+v],x=s[p*e+m],_=p_(p_(b,E,y),p_(C,x,y),d%1);l[u*r+h]=_}}return l})}function Dan(t,e,n,r,i,a="nearest"){switch(a.toLowerCase()){case"nearest":return Man(t,e,n,r,i);case"bilinear":case"linear":return Pan(t,e,n,r,i);default:throw new Error(`Unsupported resampling method: '${a}'`)}}function kan(t,e,n,r,i,a){const o=e/r,s=n/i,l=Nk(t,r,i,a);for(let u=0;u<i;++u){const d=Math.min(Math.round(s*u),n-1);for(let f=0;f<r;++f){const p=Math.min(Math.round(o*f),e-1);for(let h=0;h<a;++h){const g=t[d*e*a+p*a+h];l[u*r*a+f*a+h]=g}}}return l}function Uan(t,e,n,r,i,a){const o=e/r,s=n/i,l=Nk(t,r,i,a);for(let u=0;u<i;++u){const d=s*u,f=Math.floor(d),p=Math.min(Math.ceil(d),n-1);for(let h=0;h<r;++h){const g=o*h,y=g%1,v=Math.floor(g),m=Math.min(Math.ceil(g),e-1);for(let b=0;b<a;++b){const E=t[f*e*a+v*a+b],C=t[f*e*a+m*a+b],x=t[p*e*a+v*a+b],_=t[p*e*a+m*a+b],A=p_(p_(E,C,y),p_(x,_,y),d%1);l[u*r*a+h*a+b]=A}}}return l}function Fan(t,e,n,r,i,a,o="nearest"){switch(o.toLowerCase()){case"nearest":return kan(t,e,n,r,i,a);case"bilinear":case"linear":return Uan(t,e,n,r,i,a);default:throw new Error(`Unsupported resampling method: '${o}'`)}}function Ban(t,e,n){let r=0;for(let i=e;i<n;++i)r+=t[i];return r}function aee(t,e,n){switch(t){case 1:if(e<=8)return new Uint8Array(n);if(e<=16)return new Uint16Array(n);if(e<=32)return new Uint32Array(n);break;case 2:if(e===8)return new Int8Array(n);if(e===16)return new Int16Array(n);if(e===32)return new Int32Array(n);break;case 3:switch(e){case 16:case 32:return new Float32Array(n);case 64:return new Float64Array(n)}break}throw Error("Unsupported data format/bitsPerSample")}function $an(t,e){return(t===1||t===2)&&e<=32&&e%8===0?!1:!(t===3&&(e===16||e===32||e===64))}function Van(t,e,n,r,i,a,o){const s=new DataView(t),l=n===2?o*a:o*a*r,u=n===2?1:r,d=aee(e,i,l),f=parseInt("1".repeat(i),2);if(e===1){let p;n===1?p=r*i:p=i;let h=a*p;h&7&&(h=h+7&-8);for(let g=0;g<o;++g){const y=g*h;for(let v=0;v<a;++v){const m=y+v*u*i;for(let b=0;b<u;++b){const E=m+b*i,C=(g*a+v)*u+b,x=Math.floor(E/8),_=E%8;if(_+i<=8)d[C]=s.getUint8(x)>>8-i-_&f;else if(_+i<=16)d[C]=s.getUint16(x)>>16-i-_&f;else if(_+i<=24){const A=s.getUint16(x)<<8|s.getUint8(x+2);d[C]=A>>24-i-_&f}else d[C]=s.getUint32(x)>>32-i-_&f}}}}return d.buffer}class zan{constructor(e,n,r,i,a,o){this.fileDirectory=e,this.geoKeys=n,this.dataView=r,this.littleEndian=i,this.tiles=a?{}:null,this.isTiled=!e.StripOffsets;const s=e.PlanarConfiguration;if(this.planarConfiguration=typeof s>"u"?1:s,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}getBytesPerPixel(){let e=0;for(let n=0;n<this.fileDirectory.BitsPerSample.length;++n)e+=this.getSampleByteSize(n);return e}getSampleByteSize(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${e} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}getReaderForSample(e){const n=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,r=this.fileDirectory.BitsPerSample[e];switch(n){case 1:if(r<=8)return DataView.prototype.getUint8;if(r<=16)return DataView.prototype.getUint16;if(r<=32)return DataView.prototype.getUint32;break;case 2:if(r<=8)return DataView.prototype.getInt8;if(r<=16)return DataView.prototype.getInt16;if(r<=32)return DataView.prototype.getInt32;break;case 3:switch(r){case 16:return function(i,a){return CHe(this,i,a)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(e=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}getBitsPerSample(e=0){return this.fileDirectory.BitsPerSample[e]}getArrayForSample(e,n){const r=this.getSampleFormat(e),i=this.getBitsPerSample(e);return aee(r,i,n)}async getTileOrStrip(e,n,r,i,a){const o=Math.ceil(this.getWidth()/this.getTileWidth()),s=Math.ceil(this.getHeight()/this.getTileHeight());let l;const{tiles:u}=this;this.planarConfiguration===1?l=n*o+e:this.planarConfiguration===2&&(l=r*o*s+n*o+e);let d,f;this.isTiled?(d=this.fileDirectory.TileOffsets[l],f=this.fileDirectory.TileByteCounts[l]):(d=this.fileDirectory.StripOffsets[l],f=this.fileDirectory.StripByteCounts[l]);const p=(await this.source.fetch([{offset:d,length:f}],a))[0];let h;return u===null||!u[l]?(h=(async()=>{let g=await i.decode(this.fileDirectory,p);const y=this.getSampleFormat(),v=this.getBitsPerSample();return $an(y,v)&&(g=Van(g,y,this.planarConfiguration,this.getSamplesPerPixel(),v,this.getTileWidth(),this.getBlockHeight(n))),g})(),u!==null&&(u[l]=h)):h=u[l],{x:e,y:n,sample:r,data:await h}}async _readRaster(e,n,r,i,a,o,s,l,u){const d=this.getTileWidth(),f=this.getTileHeight(),p=this.getWidth(),h=this.getHeight(),g=Math.max(Math.floor(e[0]/d),0),y=Math.min(Math.ceil(e[2]/d),Math.ceil(p/d)),v=Math.max(Math.floor(e[1]/f),0),m=Math.min(Math.ceil(e[3]/f),Math.ceil(h/f)),b=e[2]-e[0];let E=this.getBytesPerPixel();const C=[],x=[];for(let P=0;P<n.length;++P)this.planarConfiguration===1?C.push(Ban(this.fileDirectory.BitsPerSample,0,n[P])/8):C.push(0),x.push(this.getReaderForSample(n[P]));const _=[],{littleEndian:A}=this;for(let P=v;P<m;++P)for(let R=g;R<y;++R){let N;this.planarConfiguration===1&&(N=this.getTileOrStrip(R,P,0,a,u));for(let D=0;D<n.length;++D){const U=D,z=n[D];this.planarConfiguration===2&&(E=this.getSampleByteSize(z),N=this.getTileOrStrip(R,P,z,a,u));const B=N.then(j=>{const V=j.data,G=new DataView(V),W=this.getBlockHeight(j.y),Z=j.y*f,H=j.x*d,X=Z+W,ee=(j.x+1)*d,K=x[U],Y=Math.min(W,W-(X-e[3]),h-Z),Q=Math.min(d,d-(ee-e[2]),p-H);for(let re=Math.max(0,e[1]-Z);re<Y;++re)for(let ne=Math.max(0,e[0]-H);ne<Q;++ne){const oe=(re*d+ne)*E,de=K.call(G,oe+C[U],A);let ue;i?(ue=(re+Z-e[1])*b*n.length+(ne+H-e[0])*n.length+U,r[ue]=de):(ue=(re+Z-e[1])*b+ne+H-e[0],r[U][ue]=de)}});_.push(B)}}if(await Promise.all(_),o&&e[2]-e[0]!==o||s&&e[3]-e[1]!==s){let P;return i?P=Fan(r,e[2]-e[0],e[3]-e[1],o,s,n.length,l):P=Dan(r,e[2]-e[0],e[3]-e[1],o,s,l),P.width=o,P.height=s,P}return r.width=o||e[2]-e[0],r.height=s||e[3]-e[1],r}async readRasters({window:e,samples:n=[],interleave:r,pool:i=null,width:a,height:o,resampleMethod:s,fillValue:l,signal:u}={}){const d=e||[0,0,this.getWidth(),this.getHeight()];if(d[0]>d[2]||d[1]>d[3])throw new Error("Invalid subsets");const f=d[2]-d[0],p=d[3]-d[1],h=f*p,g=this.getSamplesPerPixel();if(!n||!n.length)for(let b=0;b<g;++b)n.push(b);else for(let b=0;b<n.length;++b)if(n[b]>=g)return Promise.reject(new RangeError(`Invalid sample index '${n[b]}'.`));let y;if(r){const b=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,E=Math.max.apply(null,this.fileDirectory.BitsPerSample);y=aee(b,E,h*n.length),l&&y.fill(l)}else{y=[];for(let b=0;b<n.length;++b){const E=this.getArrayForSample(n[b],h);Array.isArray(l)&&b<l.length?E.fill(l[b]):l&&!Array.isArray(l)&&E.fill(l),y.push(E)}}const v=i||await Nan(this.fileDirectory);return await this._readRaster(d,n,y,r,v,a,o,s,u)}async readRGB({window:e,interleave:n=!0,pool:r=null,width:i,height:a,resampleMethod:o,enableAlpha:s=!1,signal:l}={}){const u=e||[0,0,this.getWidth(),this.getHeight()];if(u[0]>u[2]||u[1]>u[3])throw new Error("Invalid subsets");const d=this.fileDirectory.PhotometricInterpretation;if(d===qp.RGB){let m=[0,1,2];if(this.fileDirectory.ExtraSamples!==ban.Unspecified&&s){m=[];for(let b=0;b<this.fileDirectory.BitsPerSample.length;b+=1)m.push(b)}return this.readRasters({window:e,interleave:n,samples:m,pool:r,width:i,height:a,resampleMethod:o,signal:l})}let f;switch(d){case qp.WhiteIsZero:case qp.BlackIsZero:case qp.Palette:f=[0];break;case qp.CMYK:f=[0,1,2,3];break;case qp.YCbCr:case qp.CIELab:f=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const p={window:u,interleave:!0,samples:f,pool:r,width:i,height:a,resampleMethod:o,signal:l},{fileDirectory:h}=this,g=await this.readRasters(p),y=2**this.fileDirectory.BitsPerSample[0];let v;switch(d){case qp.WhiteIsZero:v=xan(g,y);break;case qp.BlackIsZero:v=_an(g,y);break;case qp.Palette:v=wan(g,h.ColorMap);break;case qp.CMYK:v=Tan(g);break;case qp.YCbCr:v=Ian(g);break;case qp.CIELab:v=Lan(g);break;default:throw new Error("Unsupported photometric interpretation.")}if(!n){const m=new Uint8Array(v.length/3),b=new Uint8Array(v.length/3),E=new Uint8Array(v.length/3);for(let C=0,x=0;C<v.length;C+=3,++x)m[x]=v[C],b[x]=v[C+1],E[x]=v[C+2];v=[m,b,E]}return v.width=g.width,v.height=g.height,v}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const e=[];for(let n=0;n<this.fileDirectory.ModelTiepoint.length;n+=6)e.push({i:this.fileDirectory.ModelTiepoint[n],j:this.fileDirectory.ModelTiepoint[n+1],k:this.fileDirectory.ModelTiepoint[n+2],x:this.fileDirectory.ModelTiepoint[n+3],y:this.fileDirectory.ModelTiepoint[n+4],z:this.fileDirectory.ModelTiepoint[n+5]});return e}getGDALMetadata(e=null){const n={};if(!this.fileDirectory.GDAL_METADATA)return null;const r=this.fileDirectory.GDAL_METADATA;let i=F7(r,"Item");e===null?i=i.filter(a=>f_(a,"sample")===void 0):i=i.filter(a=>Number(f_(a,"sample"))===e);for(let a=0;a<i.length;++a){const o=i[a];n[f_(o,"name")]=o.inner}return n}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}getOrigin(){const e=this.fileDirectory.ModelTiepoint,n=this.fileDirectory.ModelTransformation;if(e&&e.length===6)return[e[3],e[4],e[5]];if(n)return[n[3],n[7],n[11]];throw new Error("The image does not have an affine transformation.")}getResolution(e=null){const n=this.fileDirectory.ModelPixelScale,r=this.fileDirectory.ModelTransformation;if(n)return[n[0],-n[1],n[2]];if(r)return r[1]===0&&r[4]===0?[r[0],-r[5],r[10]]:[Math.sqrt(r[0]*r[0]+r[4]*r[4]),-Math.sqrt(r[1]*r[1]+r[5]*r[5]),r[10]];if(e){const[i,a,o]=e.getResolution();return[i*e.getWidth()/this.getWidth(),a*e.getHeight()/this.getHeight(),o*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return this.geoKeys.GTRasterTypeGeoKey===1}getBoundingBox(e=!1){const n=this.getHeight(),r=this.getWidth();if(this.fileDirectory.ModelTransformation&&!e){const[i,a,o,s,l,u,d,f]=this.fileDirectory.ModelTransformation,h=[[0,0],[0,n],[r,0],[r,n]].map(([v,m])=>[s+i*v+a*m,f+l*v+u*m]),g=h.map(v=>v[0]),y=h.map(v=>v[1]);return[Math.min(...g),Math.min(...y),Math.max(...g),Math.max(...y)]}else{const i=this.getOrigin(),a=this.getResolution(),o=i[0],s=i[1],l=o+a[0]*r,u=s+a[1]*n;return[Math.min(o,l),Math.min(s,u),Math.max(o,l),Math.max(s,u)]}}}const Han=zan;class Gan{constructor(e){this._dataView=new DataView(e)}get buffer(){return this._dataView.buffer}getUint64(e,n){const r=this.getUint32(e,n),i=this.getUint32(e+4,n);let a;if(n){if(a=r+2**32*i,!Number.isSafeInteger(a))throw new Error(`${a} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return a}if(a=2**32*r+i,!Number.isSafeInteger(a))throw new Error(`${a} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return a}getInt64(e,n){let r=0;const i=(this._dataView.getUint8(e+(n?7:0))&128)>0;let a=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(e+(n?o:7-o));i&&(a?s!==0&&(s=~(s-1)&255,a=!1):s=~s&255),r+=s*256**o}return i&&(r=-r),r}getUint8(e,n){return this._dataView.getUint8(e,n)}getInt8(e,n){return this._dataView.getInt8(e,n)}getUint16(e,n){return this._dataView.getUint16(e,n)}getInt16(e,n){return this._dataView.getInt16(e,n)}getUint32(e,n){return this._dataView.getUint32(e,n)}getInt32(e,n){return this._dataView.getInt32(e,n)}getFloat16(e,n){return CHe(this._dataView,e,n)}getFloat32(e,n){return this._dataView.getFloat32(e,n)}getFloat64(e,n){return this._dataView.getFloat64(e,n)}}class jan{constructor(e,n,r,i){this._dataView=new DataView(e),this._sliceOffset=n,this._littleEndian=r,this._bigTiff=i}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(e,n){return this.sliceOffset<=e&&this.sliceTop>=e+n}readUint8(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}readInt8(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}readUint16(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}readInt16(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}readUint32(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}readInt32(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}readFloat32(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}readFloat64(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}readUint64(e){const n=this.readUint32(e),r=this.readUint32(e+4);let i;if(this._littleEndian){if(i=n+2**32*r,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}if(i=2**32*n+r,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}readInt64(e){let n=0;const r=(this._dataView.getUint8(e+(this._littleEndian?7:0))&128)>0;let i=!0;for(let a=0;a<8;a++){let o=this._dataView.getUint8(e+(this._littleEndian?a:7-a));r&&(i?o!==0&&(o=~(o-1)&255,i=!1):o=~o&255),n+=o*256**a}return r&&(n=-n),n}readOffset(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}}class Wan{async fetch(e,n=void 0){return Promise.all(e.map(r=>this.fetchSlice(r,n)))}async fetchSlice(e){throw new Error(`fetching of slice ${e} not possible, not implemented`)}get fileSize(){return null}async close(){}}class aoe extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,aoe),this.name="AbortError"}}class Xan extends Wan{constructor(e){super(),this.arrayBuffer=e}fetchSlice(e,n){if(n&&n.aborted)throw new aoe("Request aborted");return this.arrayBuffer.slice(e.offset,e.offset+e.length)}}function Zan(t){return new Xan(t)}function oee(t){switch(t){case Fo.BYTE:case Fo.ASCII:case Fo.SBYTE:case Fo.UNDEFINED:return 1;case Fo.SHORT:case Fo.SSHORT:return 2;case Fo.LONG:case Fo.SLONG:case Fo.FLOAT:case Fo.IFD:return 4;case Fo.RATIONAL:case Fo.SRATIONAL:case Fo.DOUBLE:case Fo.LONG8:case Fo.SLONG8:case Fo.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${t}`)}}function qan(t){const e=t.GeoKeyDirectory;if(!e)return null;const n={};for(let r=4;r<=e[3]*4;r+=4){const i=Can[e[r]],a=e[r+1]?FI[e[r+1]]:null,o=e[r+2],s=e[r+3];let l=null;if(!a)l=s;else{if(l=t[a],typeof l>"u"||l===null)throw new Error(`Could not get value of geoKey '${i}'.`);typeof l=="string"?l=l.substring(s,s+o-1):l.subarray&&(l=l.subarray(s,s+o),o===1&&(l=l[0]))}n[i]=l}return n}function Px(t,e,n,r){let i=null,a=null;const o=oee(e);switch(e){case Fo.BYTE:case Fo.ASCII:case Fo.UNDEFINED:i=new Uint8Array(n),a=t.readUint8;break;case Fo.SBYTE:i=new Int8Array(n),a=t.readInt8;break;case Fo.SHORT:i=new Uint16Array(n),a=t.readUint16;break;case Fo.SSHORT:i=new Int16Array(n),a=t.readInt16;break;case Fo.LONG:case Fo.IFD:i=new Uint32Array(n),a=t.readUint32;break;case Fo.SLONG:i=new Int32Array(n),a=t.readInt32;break;case Fo.LONG8:case Fo.IFD8:i=new Array(n),a=t.readUint64;break;case Fo.SLONG8:i=new Array(n),a=t.readInt64;break;case Fo.RATIONAL:i=new Uint32Array(n*2),a=t.readUint32;break;case Fo.SRATIONAL:i=new Int32Array(n*2),a=t.readInt32;break;case Fo.FLOAT:i=new Float32Array(n),a=t.readFloat32;break;case Fo.DOUBLE:i=new Float64Array(n),a=t.readFloat64;break;default:throw new RangeError(`Invalid field type: ${e}`)}if(e===Fo.RATIONAL||e===Fo.SRATIONAL)for(let s=0;s<n;s+=2)i[s]=a.call(t,r+s*o),i[s+1]=a.call(t,r+(s*o+4));else for(let s=0;s<n;++s)i[s]=a.call(t,r+s*o);return e===Fo.ASCII?new TextDecoder("utf-8").decode(i):i}class Yan{constructor(e,n,r){this.fileDirectory=e,this.geoKeyDirectory=n,this.nextIFDByteOffset=r}}class fL extends Error{constructor(e){super(`No image at index ${e}`),this.index=e}}class Kan{async readRasters(e={}){const{window:n,width:r,height:i}=e;let{resX:a,resY:o,bbox:s}=e;const l=await this.getImage();let u=l;const d=await this.getImageCount(),f=l.getBoundingBox();if(n&&s)throw new Error('Both "bbox" and "window" passed.');if(r||i){if(n){const[g,y]=l.getOrigin(),[v,m]=l.getResolution();s=[g+n[0]*v,y+n[1]*m,g+n[2]*v,y+n[3]*m]}const h=s||f;if(r){if(a)throw new Error("Both width and resX passed");a=(h[2]-h[0])/r}if(i){if(o)throw new Error("Both width and resY passed");o=(h[3]-h[1])/i}}if(a||o){const h=[];for(let g=0;g<d;++g){const y=await this.getImage(g),{SubfileType:v,NewSubfileType:m}=y.fileDirectory;(g===0||v===2||m&1)&&h.push(y)}h.sort((g,y)=>g.getWidth()-y.getWidth());for(let g=0;g<h.length;++g){const y=h[g],v=(f[2]-f[0])/y.getWidth(),m=(f[3]-f[1])/y.getHeight();if(u=y,a&&a>v||o&&o>m)break}}let p=n;if(s){const[h,g]=l.getOrigin(),[y,v]=u.getResolution(l);p=[Math.round((s[0]-h)/y),Math.round((s[1]-g)/v),Math.round((s[2]-h)/y),Math.round((s[3]-g)/v)],p=[Math.min(p[0],p[2]),Math.min(p[1],p[3]),Math.max(p[0],p[2]),Math.max(p[1],p[3])]}return u.readRasters({...e,window:p})}}class ooe extends Kan{constructor(e,n,r,i,a={}){super(),this.source=e,this.littleEndian=n,this.bigTiff=r,this.firstIFDOffset=i,this.cache=a.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(e,n){const r=this.bigTiff?4048:1024;return new jan((await this.source.fetch([{offset:e,length:typeof n<"u"?n:r}]))[0],e,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(e){const n=this.bigTiff?20:12,r=this.bigTiff?8:2;let i=await this.getSlice(e);const a=this.bigTiff?i.readUint64(e):i.readUint16(e),o=a*n+(this.bigTiff?16:6);i.covers(e,o)||(i=await this.getSlice(e,o));const s={};let l=e+(this.bigTiff?8:2);for(let f=0;f<a;l+=n,++f){const p=i.readUint16(l),h=i.readUint16(l+2),g=this.bigTiff?i.readUint64(l+4):i.readUint32(l+4);let y,v;const m=oee(h),b=l+(this.bigTiff?12:8);if(m*g<=(this.bigTiff?8:4))y=Px(i,h,g,b);else{const E=i.readOffset(b),C=oee(h)*g;if(i.covers(E,C))y=Px(i,h,g,E);else{const x=await this.getSlice(E,C);y=Px(x,h,g,E)}}g===1&&yan.indexOf(p)===-1&&!(h===Fo.RATIONAL||h===Fo.SRATIONAL)?v=y[0]:v=y,s[FI[p]]=v}const u=qan(s),d=i.readOffset(e+r+n*a);return new Yan(s,u,d)}async requestIFD(e){if(this.ifdRequests[e])return this.ifdRequests[e];if(e===0)return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[e];if(!this.ifdRequests[e-1])try{this.ifdRequests[e-1]=this.requestIFD(e-1)}catch(n){throw n instanceof fL?new fL(e):n}return this.ifdRequests[e]=(async()=>{const n=await this.ifdRequests[e-1];if(n.nextIFDByteOffset===0)throw new fL(e);return this.parseFileDirectoryAt(n.nextIFDByteOffset)})(),this.ifdRequests[e]}async getImage(e=0){const n=await this.requestIFD(e);return new Han(n.fileDirectory,n.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let e=0,n=!0;for(;n;)try{await this.requestIFD(e),++e}catch(r){if(r instanceof fL)n=!1;else throw r}return e}async getGhostValues(){const e=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const n="GDAL_STRUCTURAL_METADATA_SIZE=",r=n.length+100;let i=await this.getSlice(e,r);if(n===Px(i,Fo.ASCII,n.length,e)){const o=Px(i,Fo.ASCII,r,e).split(`
4506
4506
  `)[0],s=Number(o.split("=")[1].split(" ")[0])+o.length;s>r&&(i=await this.getSlice(e,s));const l=Px(i,Fo.ASCII,s,e);this.ghostValues={},l.split(`
4507
4507
  `).filter(u=>u.length>0).map(u=>u.split("=")).forEach(([u,d])=>{this.ghostValues[u]=d})}return this.ghostValues}static async fromSource(e,n,r){const i=(await e.fetch([{offset:0,length:1024}],r))[0],a=new Gan(i),o=a.getUint16(0,0);let s;if(o===18761)s=!0;else if(o===19789)s=!1;else throw new TypeError("Invalid byte order value.");const l=a.getUint16(2,s);let u;if(l===42)u=!1;else if(l===43){if(u=!0,a.getUint16(4,s)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const d=u?a.getUint64(8,s):a.getUint32(4,s);return new ooe(e,s,u,d,n)}close(){return typeof this.source.close=="function"?this.source.close():!1}}async function kCe(t,e){return ooe.fromSource(Zan(t),e)}const Jan=({axon_check:t,fbxTreeDatas:e,setLeftMenuTabIndex:n,swcRef:r,setIsChartOpen:i,setEchartValue:a,setChartValue:o,reset:s})=>{const l=S.useRef(null),u=S.useRef(null),[d,f]=S.useState(!1),[p,h]=S.useState(""),[g,y]=S.useState(""),[v,m]=S.useState({x:0,y:0}),b=S.useRef([]),E=S.useRef([]),C=S.useRef(null),x=S.useRef(null),[_,A]=S.useState(!0),P=S.useRef("#000"),[R,N]=S.useState(["Isocortex","OLF","HPF","CTXsp","STR","PAL","IB","MB","HB","CB","VS","fiber tract"]),[D,U]=S.useState({nodes:[],links:[],categories:[]});let z=S.useRef(null),B=!1;const j=(X,ee)=>{N(K=>[...K.filter(Y=>!X.includes(Y)),...ee])};S.useEffect(()=>{N(["Isocortex","OLF","HPF","CTXsp","STR","PAL","IB","MB","HB","CB","VS","fiber tract"])},[s]);const V=(X,ee)=>ee.map(K=>{const Y=X.find(re=>re.id===K.source),Q=X.find(re=>re.id===K.target);return{...K,lineStyle:{color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:Q.itemStyle.color},{offset:1,color:Y.itemStyle.color}]},width:1,curveness:.3}}});S.useEffect(()=>{G(R)},[R]);const G=X=>{fetch("/app-api/d-api/connectivity",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:X})}).then(ee=>ee.json()).then(ee=>{ee.code==200?U(ee.node):nc.error(ee.message)})};S.useEffect(()=>{u.current=Dy(l.current),u.current.clear();const X=()=>u.current.getOption().series[0].data,ee={tooltip:{formatter:ne=>{var oe,de;return ne.dataType==="node"?`${ne.data.fullname} (${ne.data.name})<br>Downstream: ${((oe=t[ne.data.name].down)==null?void 0:oe.length)??0} projection neuron(s)<br>Upstream: projected by ${((de=t[ne.data.name].up)==null?void 0:de.length)??0} neuron(s)`:(ne.dataType,"")}},animationDurationUpdate:1500,animationEasingUpdate:"quinticInOut",series:[{name:"Les Miserables",type:"graph",layout:"circular",circular:{rotateLabel:!0},data:D.nodes,links:V(D.nodes,D.links),categories:D.categories,roam:!0,label:{show:!0,position:"right",formatter:"{b}",textStyle:{fontSize:20}},lineStyle:{color:"source",curveness:.3}}]};function K(ne){if(ne.event.event.preventDefault(),ne.dataType=="node"){const oe=Y(ne.data.name,e);let de=W(oe);de&&j(de,[oe.name])}if(ne.dataType=="edge"){const oe=X().find(ue=>ue.id===ne.data.source),de=X().find(ue=>ue.id===ne.data.target);b.current=t[oe.name].soma.filter(function(ue){return t[de.name].axon.indexOf(ue)>-1}),E.current=t[de.name].soma.filter(function(ue){return t[oe.name].axon.indexOf(ue)>-1}),h(oe.name),y(de.name),m({x:ne.event.event.clientX+2,y:ne.event.event.clientY}),f(!0),P.current=ne.data.lineStyle.color.colorStops[0].color}}const Y=(ne,oe)=>{let de={name:""};for(let ue=0;ue<oe.length;ue++){const pe=oe[ue];if(pe.children){if(pe.children.some(ie=>ie.name===ne)){de=pe;break}else if(Y(ne,pe.children)){de=Y(ne,pe.children);break}}}return de},Q=ne=>{clearTimeout(z.current),B=!0,a(ne.data.name),o(ne.data.name),i(!1)},re=ne=>{z.current=setTimeout(()=>{if(!B){const oe=Z(ne.data.name,e);if(oe){let de=[];"children"in oe?(oe.children.forEach(ue=>{de.push(ue.name)}),j([ne.data.name],de)):nc.error("No child node")}}B=!1},300)};return u.current.setOption(ee),u.current.on("click",re),u.current.on("dblclick",Q),u.current.on("contextmenu",K),()=>{u.current.off("click",re),u.current.off("dblclick",Q),u.current.off("contextmenu",K)}},[e,D]);const W=X=>{const ee=[],K=Y=>{ee.push(Y.name),Y.children&&Y.children.forEach(Q=>K(Q))};return K(X),ee},Z=(X,ee)=>{let K=[],Y=!1,Q;for(let re=0;re<ee.length;re++)K.push(ee[re]);for(;K.length>0&&!Y;){let re=K.pop();if(re.name==X){Y=!0,Q=re;break}else if(re.children)for(let ne=0;ne<re.children.length;ne++)K.push(re.children[ne])}return Q},H=[{key:"1",label:S.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:X=>{n(3),r.current.setSearchValue(g),r.current.setSomaValue(p),f(!1),i(!1)}},p," →",g,": ",b.current.length," projection neruon(s)")},{key:"2",label:S.createElement("a",{target:"_blank",style:{width:"150px",textAlign:"center"},onClick:X=>{n(3),r.current.setSearchValue(p),r.current.setSomaValue(g),f(!1),i(!1)}},g," →",p,": ",E.current.length," projection neruon(s)")}];return S.createElement(S.Fragment,null,S.createElement("div",{style:{overflow:"hidden",position:"absolute",width:"500px",height:"200px"}},S.createElement("div",{ref:C,style:{zIndex:9,position:"absolute",backgroundColor:"#f1f1f180",borderTopRightRadius:"5px",borderTopLeftRadius:"5px",borderBottomRightRadius:"5px",transform:_?"translateY(0)":"translateY(-99%)",transition:"transform 0.3s ease-in-out",padding:"5px"}},S.createElement("p",{style:{paddingLeft:"10px",paddingRight:"10px"}},"- Mouse-over a node to see upstream and downstream neuron numbers",S.createElement("br",null),"- Left-click a node to expand its children structures",S.createElement("br",null),"- Righ-click a node to collapse to its parent structure",S.createElement("br",null),"- Double-click a node to visualize all its projections in the main window",S.createElement("br",null),"- Righ-click a line to see the projections between two connected nodes",S.createElement("br",null),"- Left-click the popup menu of the line to inquire the projection neurons"),S.createElement("a",{style:{zIndex:9,position:"absolute",bottom:"-28px",left:0,display:"flex"},onClick:()=>{A(!_)}},S.createElement("div",{style:{width:"90px",height:"28px",display:"flex",justifyContent:"center",borderBottomRightRadius:"5px",borderBottomLeftRadius:"5px",backgroundColor:"#f1f1f180"}},S.createElement("div",{style:{display:"flex",alignItems:"center",color:"#000"}},"Help   ",S.createElement("div",{ref:x,style:{width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent",borderBottom:_?"10px solid #000":0,borderTop:_?0:"10px solid #000"}})))))),S.createElement(HS,{menu:{items:H},open:d,overlayStyle:{position:"absolute",left:v.x,top:v.y,width:"auto",minWidth:"auto",border:`2px solid ${P}`},overlayClassName:"pipeline_dropdown"},S.createElement("div",{ref:l,style:{width:"100%",height:"calc(100vh - 75px)"},onMouseEnter:()=>{f(!1)}})))};class Qan{constructor(e,n,r,i,a,o,s){e0(this,"name");e0(this,"branches");e0(this,"indices");e0(this,"points");e0(this,"numSoma");e0(this,"vao");e0(this,"vbo");e0(this,"ebo");e0(this,"viewType",0);this.name=n,this.branches=[],this.indices=[],this.points=[],this.numSoma=0,this.vao=null,this.vbo=null,this.ebo=null,o&&(this.viewType=o);for(var l=null,u=e.split(`
4508
4508
  `),d=0;d<u.length;++d)if(u[d][0]!="#"){if(u[d].length==0&&l!=null){l.count=this.indices.length-l.start,this.branches.push(l),l=null;continue}var f=u[d].trim().split(" "),p=parseInt(f[0]);if(i!=null)if(a!=null)var h=parseFloat(f[2])+parseFloat(a[0])-parseFloat(i[0]),g=parseFloat(f[3])+parseFloat(a[2])-parseFloat(i[2]),y=parseFloat(f[4])+parseFloat(a[4])-parseFloat(i[4]);else var h=parseFloat(f[2])+parseFloat(r[0])-parseFloat(i[0]),g=parseFloat(f[3])+parseFloat(r[2])-parseFloat(i[2]),y=parseFloat(f[4])+parseFloat(r[4])-parseFloat(i[4]);else if(a!=null)var h=parseFloat(f[2])+parseFloat(a[0])-parseFloat(r[0]),g=parseFloat(f[3])+parseFloat(a[2])-parseFloat(r[2]),y=parseFloat(f[4])+parseFloat(a[4])-parseFloat(r[4]);else if(o)var h=parseFloat(f[2])+parseFloat(r[0])-s[0],g=parseFloat(f[3])+parseFloat(r[2])-s[2],y=parseFloat(f[4])+parseFloat(r[4])-s[4];else var h=parseFloat(f[2]),g=parseFloat(f[3]),y=parseFloat(f[4]);var v=parseInt(f[6]);p==1?(l={start:0},this.indices.push(0),this.numSoma=1):v!=p-1||v==-1?(l.count=this.indices.length-l.start,this.branches.push(l),l={start:this.indices.length},v!=-1?this.indices.push(v-1):this.numSoma+=1,this.indices.push(this.points.length/3)):this.indices.push(this.points.length/3),this.points.push(h),this.points.push(g),this.points.push(y)}l&&(l.count=this.indices.length-l.start,this.branches.push(l))}}const eon="1.2.0",ton=S.createContext({}),non=ton,ron={classNames:{},styles:{},className:"",style:{}},ion=t=>{const e=S.useContext(non);return S.useMemo(()=>({...ron,...e[t]}),[e[t]])},aon=ion;function nw(){return nw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},nw.apply(null,arguments)}function H7(){const{getPrefixCls:t,direction:e,csp:n,iconPrefixCls:r,theme:i}=S.useContext(Rg.ConfigContext);return{theme:i,getPrefixCls:t,direction:e,csp:n,iconPrefixCls:r}}process.env.NODE_ENV;const oon=eA(RK.defaultAlgorithm),son={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},OHe=(t,e,n)=>{const r=n.getDerivativeToken(t),{override:i,...a}=e;let o={...r,override:i};return o=TP(o),a&&Object.entries(a).forEach(([s,l])=>{const{theme:u,...d}=l;let f=d;u&&(f=OHe({...o,...d},{override:d},u)),o[s]=f}),o};function lon(){const{token:t,hashed:e,theme:n=oon,override:r,cssVar:i}=S.useContext(RK._internalContext),[a,o,s]=qAe(n,[RK.defaultSeed,t],{salt:`${eon}-${e||""}`,override:r,getComputedToken:OHe,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:hte,ignore:Y6e,preserve:son}});return[n,s,e?o:"",a,i]}const{genStyleHooks:con,genComponentStyleHook:Y4n,genSubStyleComponent:K4n}=q6e({usePrefix:()=>{const{getPrefixCls:t,iconPrefixCls:e}=H7();return{iconPrefixCls:e,rootPrefixCls:t()}},useToken:()=>{const[t,e,n,r,i]=lon();return{theme:t,realToken:e,hashId:n,token:r,cssVar:i}},useCSP:()=>{const{csp:t}=H7();return t??{}},layer:{name:"antdx",dependencies:["antd"]}});function pL(t){return typeof t=="string"}const uon=(t,e,n,r)=>{const i=w.useRef(""),[a,o]=w.useState(1),s=e&&pL(t);return rs(()=>{!s&&pL(t)?o(t.length):pL(t)&&pL(i.current)&&t.indexOf(i.current)!==0&&o(1),i.current=t},[t]),w.useEffect(()=>{if(s&&a<t.length){const u=setTimeout(()=>{o(d=>d+n)},r);return()=>{clearTimeout(u)}}},[a,e,t]),[s?t.slice(0,a):t,s&&a<t.length]},don=uon;function fon(t){return w.useMemo(()=>{if(!t)return[!1,0,0,null];let e={step:1,interval:50,suffix:null};return typeof t=="object"&&(e={...e,...t}),[!0,e.step,e.interval,e.suffix]},[t])}const pon=({prefixCls:t})=>S.createElement("span",{className:`${t}-dot`},S.createElement("i",{className:`${t}-dot-item`,key:"item-1"}),S.createElement("i",{className:`${t}-dot-item`,key:"item-2"}),S.createElement("i",{className:`${t}-dot-item`,key:"item-3"})),hon=pon,gon=t=>{const{componentCls:e,paddingSM:n,padding:r}=t;return{[e]:{[`${e}-content`]:{"&-filled,&-outlined,&-shadow":{padding:`${He(n)} ${He(r)}`,borderRadius:t.borderRadiusLG},"&-filled":{backgroundColor:t.colorFillContent},"&-outlined":{border:`1px solid ${t.colorBorderSecondary}`},"&-shadow":{boxShadow:t.boxShadowTertiary}}}}},mon=t=>{const{componentCls:e,fontSize:n,lineHeight:r,paddingSM:i,padding:a,calc:o}=t,s=o(n).mul(r).div(2).add(i).equal(),l=`${e}-content`;return{[e]:{[l]:{"&-round":{borderRadius:{_skip_check_:!0,value:s},paddingInline:o(a).mul(1.25).equal()}},[`&-start ${l}-corner`]:{borderStartStartRadius:t.borderRadiusXS},[`&-end ${l}-corner`]:{borderStartEndRadius:t.borderRadiusXS}}}},von=t=>{const{componentCls:e,padding:n}=t;return{[`${e}-list`]:{display:"flex",flexDirection:"column",gap:n,overflowY:"auto","&::-webkit-scrollbar":{width:8,backgroundColor:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:t.colorTextTertiary,borderRadius:t.borderRadiusSM},"&":{scrollbarWidth:"thin",scrollbarColor:`${t.colorTextTertiary} transparent`}}}},yon=von,bon=new ao("loadingMove",{"0%":{transform:"translateY(0)"},"10%":{transform:"translateY(4px)"},"20%":{transform:"translateY(0)"},"30%":{transform:"translateY(-4px)"},"40%":{transform:"translateY(0)"}}),Eon=new ao("cursorBlink",{"0%":{opacity:1},"50%":{opacity:0},"100%":{opacity:1}}),Son=t=>{const{componentCls:e,fontSize:n,lineHeight:r,paddingSM:i,colorText:a,calc:o}=t;return{[e]:{display:"flex",columnGap:i,[`&${e}-end`]:{justifyContent:"end",flexDirection:"row-reverse",[`& ${e}-content-wrapper`]:{alignItems:"flex-end"}},[`&${e}-rtl`]:{direction:"rtl"},[`&${e}-typing ${e}-content:last-child::after`]:{content:'"|"',fontWeight:900,userSelect:"none",opacity:1,marginInlineStart:"0.1em",animationName:Eon,animationDuration:"0.8s",animationIterationCount:"infinite",animationTimingFunction:"linear"},[`& ${e}-avatar`]:{display:"inline-flex",justifyContent:"center",alignSelf:"flex-start"},[`& ${e}-header, & ${e}-footer`]:{fontSize:n,lineHeight:r,color:t.colorText},[`& ${e}-header`]:{marginBottom:t.paddingXXS},[`& ${e}-footer`]:{marginTop:i},[`& ${e}-content-wrapper`]:{flex:"auto",display:"flex",flexDirection:"column",alignItems:"flex-start",minWidth:0,maxWidth:"100%"},[`& ${e}-content`]:{position:"relative",boxSizing:"border-box",minWidth:0,maxWidth:"100%",color:a,fontSize:t.fontSize,lineHeight:t.lineHeight,minHeight:o(i).mul(2).add(o(r).mul(n)).equal(),wordBreak:"break-word",[`& ${e}-dot`]:{position:"relative",height:"100%",display:"flex",alignItems:"center",columnGap:t.marginXS,padding:`0 ${He(t.paddingXXS)}`,"&-item":{backgroundColor:t.colorPrimary,borderRadius:"100%",width:4,height:4,animationName:bon,animationDuration:"2s",animationIterationCount:"infinite",animationTimingFunction:"linear","&:nth-child(1)":{animationDelay:"0s"},"&:nth-child(2)":{animationDelay:"0.2s"},"&:nth-child(3)":{animationDelay:"0.4s"}}}}}}},Con=()=>({}),LHe=con("Bubble",t=>{const e=ya(t,{});return[Son(e),yon(e),gon(e),mon(e)]},Con),NHe=S.createContext({}),xon=(t,e)=>{const{prefixCls:n,className:r,rootClassName:i,style:a,classNames:o={},styles:s={},avatar:l,placement:u="start",loading:d=!1,loadingRender:f,typing:p,content:h="",messageRender:g,variant:y="filled",shape:v,onTypingComplete:m,header:b,footer:E,...C}=t,{onUpdate:x}=S.useContext(NHe),_=S.useRef(null);S.useImperativeHandle(e,()=>({nativeElement:_.current}));const{direction:A,getPrefixCls:P}=H7(),R=P("bubble",n),N=aon("bubble"),[D,U,z,B]=fon(p),[j,V]=don(h,D,U,z);S.useEffect(()=>{x==null||x()},[j]);const G=S.useRef(!1);S.useEffect(()=>{!V&&!d?G.current||(G.current=!0,m==null||m()):G.current=!1},[V,d]);const[W,Z,H]=LHe(R),X=Qe(R,i,N.className,r,Z,H,`${R}-${u}`,{[`${R}-rtl`]:A==="rtl",[`${R}-typing`]:V&&!d&&!g&&!B}),ee=S.useMemo(()=>S.isValidElement(l)?l:S.createElement($dt,l),[l]),K=S.useMemo(()=>g?g(j):j,[j,g]);let Y;d?Y=f?f():S.createElement(hon,{prefixCls:R}):Y=S.createElement(S.Fragment,null,K,V&&B);let Q=S.createElement("div",{style:{...N.styles.content,...s.content},className:Qe(`${R}-content`,`${R}-content-${y}`,v&&`${R}-content-${v}`,N.classNames.content,o.content)},Y);return(b||E)&&(Q=S.createElement("div",{className:`${R}-content-wrapper`},b&&S.createElement("div",{className:Qe(`${R}-header`,N.classNames.header,o.header),style:{...N.styles.header,...s.header}},b),Q,E&&S.createElement("div",{className:Qe(`${R}-footer`,N.classNames.footer,o.footer),style:{...N.styles.footer,...s.footer}},typeof E=="function"?E(K):E))),W(S.createElement("div",nw({style:{...N.style,...a},className:X},C,{ref:_}),l&&S.createElement("div",{style:{...N.styles.avatar,...s.avatar},className:Qe(`${R}-avatar`,N.classNames.avatar,o.avatar)},ee),Q))},MHe=S.forwardRef(xon);process.env.NODE_ENV!=="production"&&(MHe.displayName="Bubble");const soe=MHe;function _on(t,e){const n=w.useCallback((r,i)=>typeof e=="function"?e(r,i):e?e[r.role]||{}:{},[e]);return w.useMemo(()=>(t||[]).map((r,i)=>{const a=r.key??`preset_${i}`;return{...n(r,i),...r,key:a}}),[t,n])}const won=({_key:t,...e},n)=>w.createElement(soe,nw({},e,{ref:r=>{var i;r?n.current[t]=r:(i=n.current)==null||delete i[t]}})),Ton=w.memo(w.forwardRef(won)),Ion=1,Aon=(t,e)=>{const{prefixCls:n,rootClassName:r,className:i,items:a,autoScroll:o=!0,roles:s,...l}=t,u=Pp(l,{attr:!0,aria:!0}),d=w.useRef(null),f=w.useRef({}),{getPrefixCls:p}=H7(),h=p("bubble",n),g=`${h}-list`,[y,v,m]=LHe(h),[b,E]=w.useState(!1);w.useEffect(()=>(E(!0),()=>{E(!1)}),[]);const C=_on(a,s),[x,_]=w.useState(!0),[A,P]=w.useState(0),R=U=>{const z=U.target;_(z.scrollHeight-Math.abs(z.scrollTop)-z.clientHeight<=Ion)};w.useEffect(()=>{o&&d.current&&x&&d.current.scrollTo({top:d.current.scrollHeight})},[A]),w.useEffect(()=>{var U;if(o){const z=(U=C[C.length-2])==null?void 0:U.key,B=f.current[z];if(B){const{nativeElement:j}=B,{top:V,bottom:G}=j.getBoundingClientRect(),{top:W,bottom:Z}=d.current.getBoundingClientRect();V<Z&&G>W&&(P(X=>X+1),_(!0))}}},[C.length]),w.useImperativeHandle(e,()=>({nativeElement:d.current,scrollTo:({key:U,offset:z,behavior:B="smooth",block:j})=>{if(typeof z=="number")d.current.scrollTo({top:z,behavior:B});else if(U!==void 0){const V=f.current[U];if(V){const G=C.findIndex(W=>W.key===U);_(G===C.length-1),V.nativeElement.scrollIntoView({behavior:B,block:j})}}}}));const N=jl(()=>{o&&P(U=>U+1)}),D=w.useMemo(()=>({onUpdate:N}),[]);return y(w.createElement(NHe.Provider,{value:D},w.createElement("div",nw({},u,{className:Qe(g,r,i,v,m,{[`${g}-reach-end`]:x}),ref:d,onScroll:R}),C.map(({key:U,...z})=>w.createElement(Ton,nw({},z,{key:U,_key:U,ref:f,typing:b?z.typing:!1}))))))},PHe=w.forwardRef(Aon);process.env.NODE_ENV!=="production"&&(PHe.displayName="BubbleList");const Ron=PHe;soe.List=Ron;function UCe(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const o=n.slice(i,r).trim();(o||!a)&&e.push(o),i=r+1,r=n.indexOf(",",i)}return e}function DHe(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Oon=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lon=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Non={};function FCe(t,e){return((e||Non).jsx?Lon:Oon).test(t)}const Mon=/[ \t\n\f\r]/g;function Pon(t){return typeof t=="object"?t.type==="text"?BCe(t.value):!1:BCe(t)}function BCe(t){return t.replace(Mon,"")===""}let y8=class{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}};y8.prototype.normal={};y8.prototype.property={};y8.prototype.space=void 0;function kHe(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new y8(n,r,e)}function c6(t){return t.toLowerCase()}let Bp=class{constructor(e,n){this.attribute=n,this.property=e}};Bp.prototype.attribute="";Bp.prototype.booleanish=!1;Bp.prototype.boolean=!1;Bp.prototype.commaOrSpaceSeparated=!1;Bp.prototype.commaSeparated=!1;Bp.prototype.defined=!1;Bp.prototype.mustUseProperty=!1;Bp.prototype.number=!1;Bp.prototype.overloadedBoolean=!1;Bp.prototype.property="";Bp.prototype.spaceSeparated=!1;Bp.prototype.space=void 0;let Don=0;const Oo=nC(),Ou=nC(),UHe=nC(),Xr=nC(),Jl=nC(),h_=nC(),Qp=nC();function nC(){return 2**++Don}const see=Object.freeze(Object.defineProperty({__proto__:null,boolean:Oo,booleanish:Ou,commaOrSpaceSeparated:Qp,commaSeparated:h_,number:Xr,overloadedBoolean:UHe,spaceSeparated:Jl},Symbol.toStringTag,{value:"Module"})),CH=Object.keys(see);let loe=class extends Bp{constructor(e,n,r,i){let a=-1;if(super(e,n),$Ce(this,"space",i),typeof r=="number")for(;++a<CH.length;){const o=CH[a];$Ce(this,CH[a],(r&see[o])===see[o])}}};loe.prototype.defined=!0;function $Ce(t,e,n){n&&(t[e]=n)}function iT(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const a=new loe(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),e[r]=a,n[c6(r)]=r,n[c6(a.attribute)]=r}return new y8(e,n,t.space)}const FHe=iT({properties:{ariaActiveDescendant:null,ariaAtomic:Ou,ariaAutoComplete:null,ariaBusy:Ou,ariaChecked:Ou,ariaColCount:Xr,ariaColIndex:Xr,ariaColSpan:Xr,ariaControls:Jl,ariaCurrent:null,ariaDescribedBy:Jl,ariaDetails:null,ariaDisabled:Ou,ariaDropEffect:Jl,ariaErrorMessage:null,ariaExpanded:Ou,ariaFlowTo:Jl,ariaGrabbed:Ou,ariaHasPopup:null,ariaHidden:Ou,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Jl,ariaLevel:Xr,ariaLive:null,ariaModal:Ou,ariaMultiLine:Ou,ariaMultiSelectable:Ou,ariaOrientation:null,ariaOwns:Jl,ariaPlaceholder:null,ariaPosInSet:Xr,ariaPressed:Ou,ariaReadOnly:Ou,ariaRelevant:null,ariaRequired:Ou,ariaRoleDescription:Jl,ariaRowCount:Xr,ariaRowIndex:Xr,ariaRowSpan:Xr,ariaSelected:Ou,ariaSetSize:Xr,ariaSort:null,ariaValueMax:Xr,ariaValueMin:Xr,ariaValueNow:Xr,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function BHe(t,e){return e in t?t[e]:e}function $He(t,e){return BHe(t,e.toLowerCase())}const kon=iT({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:h_,acceptCharset:Jl,accessKey:Jl,action:null,allow:null,allowFullScreen:Oo,allowPaymentRequest:Oo,allowUserMedia:Oo,alt:null,as:null,async:Oo,autoCapitalize:null,autoComplete:Jl,autoFocus:Oo,autoPlay:Oo,blocking:Jl,capture:null,charSet:null,checked:Oo,cite:null,className:Jl,cols:Xr,colSpan:null,content:null,contentEditable:Ou,controls:Oo,controlsList:Jl,coords:Xr|h_,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Oo,defer:Oo,dir:null,dirName:null,disabled:Oo,download:UHe,draggable:Ou,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Oo,formTarget:null,headers:Jl,height:Xr,hidden:Oo,high:Xr,href:null,hrefLang:null,htmlFor:Jl,httpEquiv:Jl,id:null,imageSizes:null,imageSrcSet:null,inert:Oo,inputMode:null,integrity:null,is:null,isMap:Oo,itemId:null,itemProp:Jl,itemRef:Jl,itemScope:Oo,itemType:Jl,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Oo,low:Xr,manifest:null,max:null,maxLength:Xr,media:null,method:null,min:null,minLength:Xr,multiple:Oo,muted:Oo,name:null,nonce:null,noModule:Oo,noValidate:Oo,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Oo,optimum:Xr,pattern:null,ping:Jl,placeholder:null,playsInline:Oo,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Oo,referrerPolicy:null,rel:Jl,required:Oo,reversed:Oo,rows:Xr,rowSpan:Xr,sandbox:Jl,scope:null,scoped:Oo,seamless:Oo,selected:Oo,shadowRootClonable:Oo,shadowRootDelegatesFocus:Oo,shadowRootMode:null,shape:null,size:Xr,sizes:null,slot:null,span:Xr,spellCheck:Ou,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Xr,step:null,style:null,tabIndex:Xr,target:null,title:null,translate:null,type:null,typeMustMatch:Oo,useMap:null,value:Ou,width:Xr,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Jl,axis:null,background:null,bgColor:null,border:Xr,borderColor:null,bottomMargin:Xr,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Oo,declare:Oo,event:null,face:null,frame:null,frameBorder:null,hSpace:Xr,leftMargin:Xr,link:null,longDesc:null,lowSrc:null,marginHeight:Xr,marginWidth:Xr,noResize:Oo,noHref:Oo,noShade:Oo,noWrap:Oo,object:null,profile:null,prompt:null,rev:null,rightMargin:Xr,rules:null,scheme:null,scrolling:Ou,standby:null,summary:null,text:null,topMargin:Xr,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Xr,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Oo,disableRemotePlayback:Oo,prefix:null,property:null,results:Xr,security:null,unselectable:null},space:"html",transform:$He}),Uon=iT({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Qp,accentHeight:Xr,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Xr,amplitude:Xr,arabicForm:null,ascent:Xr,attributeName:null,attributeType:null,azimuth:Xr,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Xr,by:null,calcMode:null,capHeight:Xr,className:Jl,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Xr,diffuseConstant:Xr,direction:null,display:null,dur:null,divisor:Xr,dominantBaseline:null,download:Oo,dx:null,dy:null,edgeMode:null,editable:null,elevation:Xr,enableBackground:null,end:null,event:null,exponent:Xr,externalResourcesRequired:null,fill:null,fillOpacity:Xr,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:h_,g2:h_,glyphName:h_,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Xr,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Xr,horizOriginX:Xr,horizOriginY:Xr,id:null,ideographic:Xr,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Xr,k:Xr,k1:Xr,k2:Xr,k3:Xr,k4:Xr,kernelMatrix:Qp,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Xr,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Xr,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Xr,overlineThickness:Xr,paintOrder:null,panose1:null,path:null,pathLength:Xr,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Jl,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Xr,pointsAtY:Xr,pointsAtZ:Xr,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qp,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qp,rev:Qp,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qp,requiredFeatures:Qp,requiredFonts:Qp,requiredFormats:Qp,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Xr,specularExponent:Xr,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Xr,strikethroughThickness:Xr,string:null,stroke:null,strokeDashArray:Qp,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Xr,strokeOpacity:Xr,strokeWidth:null,style:null,surfaceScale:Xr,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qp,tabIndex:Xr,tableValues:null,target:null,targetX:Xr,targetY:Xr,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qp,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Xr,underlineThickness:Xr,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Xr,values:null,vAlphabetic:Xr,vMathematical:Xr,vectorEffect:null,vHanging:Xr,vIdeographic:Xr,version:null,vertAdvY:Xr,vertOriginX:Xr,vertOriginY:Xr,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Xr,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:BHe}),VHe=iT({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),zHe=iT({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$He}),HHe=iT({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Fon={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Bon=/[A-Z]/g,VCe=/-[a-z]/g,$on=/^data[-\w.:]+$/i;function coe(t,e){const n=c6(e);let r=e,i=Bp;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$on.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(VCe,zon);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!VCe.test(a)){let o=a.replace(Bon,Von);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=loe}return new i(r,e)}function Von(t){return"-"+t.toLowerCase()}function zon(t){return t.charAt(1).toUpperCase()}const Mk=kHe([FHe,kon,VHe,zHe,HHe],"html"),aT=kHe([FHe,Uon,VHe,zHe,HHe],"svg");function zCe(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function GHe(t){return t.join(" ").trim()}var uoe={},HCe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Hon=/\n/g,Gon=/^\s*/,jon=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Won=/^:\s*/,Xon=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Zon=/^[;\s]*/,qon=/^\s+|\s+$/g,Yon=`