brainsmatics 1.1.23 → 1.1.24

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.
@@ -4506,7 +4506,7 @@ echarts.use([`+U+"]);":"Unknown series "+D))}return}if(f==="tooltip"){if(E){proc
4506
4506
  Y: ${en[1]}
4507
4507
  `}},visualMap:{type:"piecewise",top:"middle",min:0,max:pt,left:10,splitNumber:pt,dimension:Xe,pieces:vn},grid:{left:120},xAxis:{},yAxis:{},series:{type:"scatter",encode:{tooltip:[0,1]},symbolSize:15,itemStyle:{borderColor:"#555"},datasetIndex:0}};_n&&Ne.setOption(_n),De&&(De.style.display="none"),Ne.on("click",lr=>{const en=lr.data;Ee(en[3],lr.color)})}return()=>{let Ce=Si.current;if(Ce){let xe=Dy(Ce);xe==null||xe.dispose()}if(or.current){let xe=Dy(or.current);xe==null||xe.dispose()}}},[Gn,pi]);const Ae=Ce=>{const xe=document.getElementById("spinner");xe&&(xe.style.display="block");const Ne=[];for(let De=0;De<v.length;De++){const it=n.find(ot=>ot.name===v[De]);if(it){const ot=it.path.lastIndexOf("\\"),pt=it.path.lastIndexOf("."),Xe=it.path.slice(ot+1,pt);Ne.push(Xe)}}fetch("http://192.168.50.30:8888/echarts_data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:Ne,n_clusters:Ce})}).then(De=>{if(De.ok)return De.json();throw xe&&(xe.style.display="none"),No.error({title:"Error",content:"Failed to fetch data for charts."}),new Error("Network response was not ok.")}).then(De=>{hi(De)})},Ee=(Ce,xe)=>{if(Ce){const Ne=n.find(De=>De.path.indexOf(Ce)!==-1);if(Ne){be.current.traverse(it=>{it.myMeshType==="SWC"&&it.traverse(ot=>{ot instanceof va&&ot.material.color.set(it.userData.initColor)})});const De=be.current.getObjectByName(Ne.name);De&&De.traverse(it=>{it instanceof va&&("#"+it.material.color.getHex().toString(16).padStart(6,"0")===xe?it.material.color.set(De.userData.initColor):it.material.color.set(xe))})}}};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:at,style:{width:"100%",marginBottom:8},options:Pe,placeholder:h("5000.5040")||"Input the region that soma locates",onSearch:Ot,onChange:dn,value:re}):S.createElement(jE,{ref:Ke,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:rr,onSearch:rr,treeData:$r(r)}),Y?S.createElement(gA,{ref:Ze,style:{width:"100%",marginBottom:8},options:Pe,placeholder:h("5000.5041")||"Input the region that neuron projects",onSearch:Ot,onChange:Un,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:Ri,onSearch:Ri,treeData:$r(r)}),z&&S.createElement(S.Fragment,null,S.createElement(jE,{treeData:Yt,value:We,onChange:In,treeCheckable:!0,placeholder:"Filter by data information",style:{width:"100%",marginTop:8}}),S.createElement(es,{style:{marginTop:"5px"}},S.createElement(sb,{onChange:Ce=>{kr(Ce.target.checked)}},h("7000.7025")||"只展示可用神经元"),S.createElement(es,{style:{fontStyle:"italic",marginTop:"5px"}},h("7000.7026")||"点击Color按钮,修改神经元颜色;点击Ana.按钮,显示神经元投射路径分析结果;点击Path按钮,在主界面显示神经元经过的脑结构;Src按钮展示了神经元数据的来源")),S.createElement(es,{style:{marginTop:"5px"}},S.createElement(Na,{onClick:()=>{const Ce=document.getElementById("spinner");Ce&&(Ce.style.display="block");const xe=[];for(let Ne=0;Ne<v.length;Ne++){const De=n.find(it=>it.name===v[Ne]);if(De){const it=De.path.lastIndexOf("\\"),ot=De.path.lastIndexOf("."),pt=De.path.slice(it+1,ot);xe.push(pt)}}fetch("http://192.168.50.30:8888/echarts_data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:xe})}).then(Ne=>{if(Ne.ok)return Ne.json();throw Ce&&(Ce.style.display="none"),No.error({title:"Error",content:"Failed to fetch data for charts."}),new Error("Network response was not ok.")}).then(Ne=>{hi(Ne),fr(!0)})}},h("7000.7027")||"显示折线图和点状图"))),S.createElement("div",null,S.createElement(No,{className:"Echart",open:Me,onOk:()=>{ft(!1)},onCancel:()=>{ft(!1)},width:"auto",footer:null},S.createElement(gg,{activeKey:Lt,onChange:Cn},S.createElement(tH,{tab:h("5000.7009")||"神经元末梢分布",key:"1"},Pn&&S.createElement(Gi,null,"Isocortex"),S.createElement(Ql,{ref:Rt,className:"Isocortex",Name:"Isocortex",t:h,data_change:At,data_c:dt.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"]}),tn&&S.createElement(Gi,null,"HPF"),S.createElement(Ql,{ref:cr[0],className:"HPF",Name:"HPF",t:h,data_change:At,data_c:dt.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(Ql,{ref:cr[1],className:"HPF",Name:"HPF",t:h,data_change:At,data_c:dt.current,col:["DG_d","DG_i","DG_V"],row:["mo","sg","po"]}),S.createElement(Ql,{ref:cr[2],className:"HPF",Name:"HPF",t:h,data_change:At,data_c:dt.current,col:["SUBd_1","SUBv_1","SUBd_2","SUBv_2","SUBd_3","SUBv_3","SUBd_4","SUBv_4","SUBd_","SUBv_"],row:["sp","sr","m"]}),gr&&S.createElement(Gi,null,"CNU"),S.createElement(Ql,{ref:En,className:"CNU",Name:"CNU",t:h,data_change:At,data_c:dt.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:["_"]}),Ft&&S.createElement(Gi,null,"OLF"),S.createElement(Ql,{ref:sr[0],className:"OLF",Name:"OLF",t:h,data_change:At,data_c:dt.current,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["gr","mi","ipl","opl","gl"]}),S.createElement(Ql,{ref:sr[1],className:"OLF",Name:"OLF",t:h,data_change:At,data_c:dt.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"]}),Vt&&S.createElement(Gi,null,"TH"),S.createElement(Ql,{ref:Wt,className:"TH",Name:"TH",t:h,data_change:At,data_c:dt.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:["_"]}),Br&&S.createElement(Gi,null,"HY"),S.createElement(Ql,{ref:Bt,className:"HY",Name:"HY",t:h,data_change:At,data_c:dt.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:["_"]}),$e&&S.createElement(Gi,null,"MB"),S.createElement(Ql,{ref:Qt,className:"MB",Name:"MB",t:h,data_change:At,data_c:dt.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:["_"]}),mn&&S.createElement(Gi,null,"HB"),S.createElement(Ql,{ref:On,className:"HB",Name:"HB",t:h,data_change:At,data_c:dt.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:["_"]}),qn&&S.createElement(Gi,null,"CB"),S.createElement(Ql,{ref:Vn[0],className:"CB",Name:"CB",t:h,data_change:At,data_c:dt.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(Ql,{ref:Vn[1],className:"CB",Name:"CB",t:h,data_change:At,data_c:dt.current,col:["FN","IP","DN","VeCB"],row:["_"]})),S.createElement(tH,{tab:h("5000.7011")||"神经元投射模式",key:"2"},r?S.createElement(Cze,{data:Nn,fbxTreeDatas:r}):null),S.createElement(tH,{tab:h("5000.7012")||"投射长度分布",key:"3"},Pn&&S.createElement(Gi,null,"Isocortex"),S.createElement(ec,{t:h,data_change:At,data_c:Nn,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"]}),tn&&S.createElement(Gi,null,"HPF"),S.createElement(ec,{t:h,data_change:At,data_c:Nn,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(ec,{t:h,data_change:At,data_c:Nn,col:["DG_d","DG_i","DG_V"],row:["mo","sg","po"]}),S.createElement(ec,{t:h,data_change:At,data_c:Nn,col:["SUBd_1","SUBv_1","SUBd_2","SUBv_2","SUBd_3","SUBv_3","SUBd_4","SUBv_4","SUBd_","SUBv_"],row:["sp","sr","m"]}),gr&&S.createElement(Gi,null,"CNU"),S.createElement(ec,{t:h,data_change:At,data_c:Nn,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:["_"]}),Ft&&S.createElement(Gi,null,"OLF"),S.createElement(ec,{t:h,data_change:At,data_c:Nn,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["gr","mi","ipl","opl","gl"]}),S.createElement(ec,{t:h,data_change:At,data_c:Nn,col:["MOB_","AOB_","AON_","TTv_","TTd_","DP_","PIR_","NLOT_","NLOT_","COAa_","COApm_","COApl_","PAA_","TR_"],row:["1","2","3","4","5","6a","2/3"]}),Vt&&S.createElement(Gi,null,"TH"),S.createElement(ec,{t:h,data_change:At,data_c:Nn,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:["_"]}),Br&&S.createElement(Gi,null,"HY"),S.createElement(ec,{t:h,data_change:At,data_c:Nn,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:["_"]}),$e&&S.createElement(Gi,null,"MB"),S.createElement(ec,{t:h,data_change:At,data_c:Nn,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:["_"]}),mn&&S.createElement(Gi,null,"HB"),S.createElement(ec,{t:h,data_change:At,data_c:Nn,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:["_"]}),qn&&S.createElement(Gi,null,"CB"),S.createElement(ec,{t:h,data_change:At,data_c:Nn,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,{t:h,data_change:At,data_c:Nn,col:["FN","IP","DN","VeCB"],row:["_"]})))),S.createElement(B6,{className:"SwcTable",rowSelection:cn,columns:di,dataSource:Ha,locale:un}),S.createElement("div",{style:{top:0,left:0,width:300,height:"100%",display:Gn?"block":"none",zIndex:1e3,position:"absolute",background:"#fff"}},S.createElement("div",{style:{position:"absolute",right:4,top:4,cursor:"pointer"},onClick:()=>{fr(!1),be.current.traverse(Ce=>{Ce.myMeshType==="SWC"&&Ce.traverse(xe=>{xe instanceof va&&xe.material.color.set(Ce.userData.initColor)})})}},"x"),S.createElement("div",{ref:Si,style:{width:"100%",height:"calc(50% - 22px)",marginTop:22}}),S.createElement("div",{ref:or,style:{width:"100%",height:"calc(50% - 22px)",marginTop:22}})))):S.createElement(S.Fragment,null,S.createElement(wtn,{style:{marginBottom:8},placeholder:"Search",onChange:Os,onKeyPress:Ce=>{Ce.stopPropagation()}}),S.createElement(N_,{showLine:!0,onExpand:Ii,defaultExpandParent:!0,expandedKeys:Z,onCheck:mr,checkable:!0,selectable:!1,treeData:Ha,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,Uv=new Array((e6+2)*2);Qw(Uv);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;)Uv[t*2+1]=8,t++,a[8]++;for(;t<=255;)Uv[t*2+1]=9,t++,a[9]++;for(;t<=279;)Uv[t*2+1]=7,t++,a[7]++;for(;t<=287;)Uv[t*2+1]=8,t++,a[8]++;for(Bze(Uv,e6+1,a),t=0;t<d_;t++)DI[t*2+1]=5,DI[t*2]=Fze(t,5);Pze=new oH(Uv,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,Uv),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,Uv,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,xs=3,By=258,$0=By+xs+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)},qs=(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>=xs)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+xs-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<xs)););}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>=xs&&(t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+xs-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>=xs)if(r=Ky(t,t.strstart-t.match_start,t.match_length-xs),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=xs){t.match_length--;do t.strstart++,t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+xs-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<xs-1?t.strstart:xs-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>=xs&&(t.ins_h=Qy(t,t.ins_h,t.window[t.strstart+xs-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=xs-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===xs&&t.strstart-t.match_start>4096)&&(t.match_length=xs-1)),t.prev_length>=xs&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-xs,r=Ky(t,t.strstart-1-t.prev_match,t.prev_length-xs),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+xs-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=xs-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<xs-1?t.strstart:xs-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>=xs&&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>=xs?(n=Ky(t,1,t.match_length-xs),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=xs-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+xs-1)/xs),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,qs(n,31),qs(n,139),qs(n,8),n.gzhead)qs(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)),qs(n,n.gzhead.time&255),qs(n,n.gzhead.time>>8&255),qs(n,n.gzhead.time>>16&255),qs(n,n.gzhead.time>>24&255),qs(n,n.level===9?2:n.strategy>=sL||n.level<2?4:0),qs(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(qs(n,n.gzhead.extra.length&255),qs(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(qs(n,0),qs(n,0),qs(n,0),qs(n,0),qs(n,0),qs(n,n.level===9?2:n.strategy>=sL||n.level<2?4:0),qs(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,qs(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,qs(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;qs(n,t.adler&255),qs(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?(qs(n,t.adler&255),qs(n,t.adler>>8&255),qs(n,t.adler>>16&255),qs(n,t.adler>>24&255),qs(n,t.total_in&255),qs(n,t.total_in>>8&255),qs(n,t.total_in>>16&255),qs(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>=xs;){let l=r.strstart,u=r.lookahead-(xs-1);do r.ins_h=Qy(r,r.ins_h,r.window[l+xs-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=xs-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=xs-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,Cv=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===Cv&&(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:Cv,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=Cv;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=Cv;case Cv: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=Cv;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===Cv&&(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=Cv;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===Cv?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)",Fv={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=Fv.inflateInit2(this.strm,e.windowBits);if(n!==s6)throw new Error(Q_[n]);if(this.header=new Sin,Fv.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=Fv.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=Fv.inflate(n,o),a===yH&&i&&(a=Fv.inflateSetDictionary(n,i),a===s6?a=Fv.inflate(n,o):a===NCe&&(a=yH));n.avail_in>0&&a===vH&&n.state.wrap>0&&t[n.next_in]!==0;)Fv.inflateReset(n),a=Fv.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=Fv.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 Ov("ifdCount",e)}get pageCount(){let e=0;for(this.decodeHeader();this._nextIFD;)e++,this.decodeIFD({ignoreImageData:!0},!0);if(e>0)return e;throw Ov("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 Ov("orientation",n);switch(e.type){case 0:case 1:case 2:case 3:this.readStripData(e);break;default:throw Ov("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 Ov("Compression","CCITT Group 3");case 32773:throw Ov("Compression","PackBits");default:throw Ov("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 Ov("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 Ov("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 Ov(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}[
4508
4508
  >/]`,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+`[
4509
- >]`),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"},Uo={};for(const t in SH)SH.hasOwnProperty(t)&&(Uo[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-802305ab.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-954d53d1.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 Uo.BYTE:case Uo.ASCII:case Uo.SBYTE:case Uo.UNDEFINED:return 1;case Uo.SHORT:case Uo.SSHORT:return 2;case Uo.LONG:case Uo.SLONG:case Uo.FLOAT:case Uo.IFD:return 4;case Uo.RATIONAL:case Uo.SRATIONAL:case Uo.DOUBLE:case Uo.LONG8:case Uo.SLONG8:case Uo.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 Uo.BYTE:case Uo.ASCII:case Uo.UNDEFINED:i=new Uint8Array(n),a=t.readUint8;break;case Uo.SBYTE:i=new Int8Array(n),a=t.readInt8;break;case Uo.SHORT:i=new Uint16Array(n),a=t.readUint16;break;case Uo.SSHORT:i=new Int16Array(n),a=t.readInt16;break;case Uo.LONG:case Uo.IFD:i=new Uint32Array(n),a=t.readUint32;break;case Uo.SLONG:i=new Int32Array(n),a=t.readInt32;break;case Uo.LONG8:case Uo.IFD8:i=new Array(n),a=t.readUint64;break;case Uo.SLONG8:i=new Array(n),a=t.readInt64;break;case Uo.RATIONAL:i=new Uint32Array(n*2),a=t.readUint32;break;case Uo.SRATIONAL:i=new Int32Array(n*2),a=t.readInt32;break;case Uo.FLOAT:i=new Float32Array(n),a=t.readFloat32;break;case Uo.DOUBLE:i=new Float64Array(n),a=t.readFloat64;break;default:throw new RangeError(`Invalid field type: ${e}`)}if(e===Uo.RATIONAL||e===Uo.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===Uo.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===Uo.RATIONAL||h===Uo.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,Uo.ASCII,n.length,e)){const o=Px(i,Uo.ASCII,r,e).split(`
4509
+ >]`),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"},Uo={};for(const t in SH)SH.hasOwnProperty(t)&&(Uo[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-3b711a3b.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-20dc18ad.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 Uo.BYTE:case Uo.ASCII:case Uo.SBYTE:case Uo.UNDEFINED:return 1;case Uo.SHORT:case Uo.SSHORT:return 2;case Uo.LONG:case Uo.SLONG:case Uo.FLOAT:case Uo.IFD:return 4;case Uo.RATIONAL:case Uo.SRATIONAL:case Uo.DOUBLE:case Uo.LONG8:case Uo.SLONG8:case Uo.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 Uo.BYTE:case Uo.ASCII:case Uo.UNDEFINED:i=new Uint8Array(n),a=t.readUint8;break;case Uo.SBYTE:i=new Int8Array(n),a=t.readInt8;break;case Uo.SHORT:i=new Uint16Array(n),a=t.readUint16;break;case Uo.SSHORT:i=new Int16Array(n),a=t.readInt16;break;case Uo.LONG:case Uo.IFD:i=new Uint32Array(n),a=t.readUint32;break;case Uo.SLONG:i=new Int32Array(n),a=t.readInt32;break;case Uo.LONG8:case Uo.IFD8:i=new Array(n),a=t.readUint64;break;case Uo.SLONG8:i=new Array(n),a=t.readInt64;break;case Uo.RATIONAL:i=new Uint32Array(n*2),a=t.readUint32;break;case Uo.SRATIONAL:i=new Int32Array(n*2),a=t.readInt32;break;case Uo.FLOAT:i=new Float32Array(n),a=t.readFloat32;break;case Uo.DOUBLE:i=new Float64Array(n),a=t.readFloat64;break;default:throw new RangeError(`Invalid field type: ${e}`)}if(e===Uo.RATIONAL||e===Uo.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===Uo.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===Uo.RATIONAL||h===Uo.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,Uo.ASCII,n.length,e)){const o=Px(i,Uo.ASCII,r,e).split(`
4510
4510
  `)[0],s=Number(o.split("=")[1].split(" ")[0])+o.length;s>r&&(i=await this.getSlice(e,s));const l=Px(i,Uo.ASCII,s,e);this.ghostValues={},l.split(`
4511
4511
  `).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):tc.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)):tc.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(`
4512
4512
  `),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 ns(()=>{!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:`${je(n)} ${je(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 io("loadingMove",{"0%":{transform:"translateY(0)"},"10%":{transform:"translateY(4px)"},"20%":{transform:"translateY(0)"},"30%":{transform:"translateY(-4px)"},"40%":{transform:"translateY(0)"}}),Eon=new io("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 ${je(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=ga(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=et(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:et(`${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:et(`${R}-header`,N.classNames.header,o.header),style:{...N.styles.header,...s.header}},b),Q,E&&S.createElement("div",{className:et(`${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:et(`${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=Gl(()=>{o&&P(U=>U+1)}),D=w.useMemo(()=>({onUpdate:N}),[]);return y(w.createElement(NHe.Provider,{value:D},w.createElement("div",nw({},u,{className:et(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(),Wr=nC(),Kl=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:Wr,overloadedBoolean:UHe,spaceSeparated:Kl},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:Wr,ariaColIndex:Wr,ariaColSpan:Wr,ariaControls:Kl,ariaCurrent:null,ariaDescribedBy:Kl,ariaDetails:null,ariaDisabled:Ou,ariaDropEffect:Kl,ariaErrorMessage:null,ariaExpanded:Ou,ariaFlowTo:Kl,ariaGrabbed:Ou,ariaHasPopup:null,ariaHidden:Ou,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Kl,ariaLevel:Wr,ariaLive:null,ariaModal:Ou,ariaMultiLine:Ou,ariaMultiSelectable:Ou,ariaOrientation:null,ariaOwns:Kl,ariaPlaceholder:null,ariaPosInSet:Wr,ariaPressed:Ou,ariaReadOnly:Ou,ariaRelevant:null,ariaRequired:Ou,ariaRoleDescription:Kl,ariaRowCount:Wr,ariaRowIndex:Wr,ariaRowSpan:Wr,ariaSelected:Ou,ariaSetSize:Wr,ariaSort:null,ariaValueMax:Wr,ariaValueMin:Wr,ariaValueNow:Wr,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:Kl,accessKey:Kl,action:null,allow:null,allowFullScreen:Oo,allowPaymentRequest:Oo,allowUserMedia:Oo,alt:null,as:null,async:Oo,autoCapitalize:null,autoComplete:Kl,autoFocus:Oo,autoPlay:Oo,blocking:Kl,capture:null,charSet:null,checked:Oo,cite:null,className:Kl,cols:Wr,colSpan:null,content:null,contentEditable:Ou,controls:Oo,controlsList:Kl,coords:Wr|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:Kl,height:Wr,hidden:Oo,high:Wr,href:null,hrefLang:null,htmlFor:Kl,httpEquiv:Kl,id:null,imageSizes:null,imageSrcSet:null,inert:Oo,inputMode:null,integrity:null,is:null,isMap:Oo,itemId:null,itemProp:Kl,itemRef:Kl,itemScope:Oo,itemType:Kl,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Oo,low:Wr,manifest:null,max:null,maxLength:Wr,media:null,method:null,min:null,minLength:Wr,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:Wr,pattern:null,ping:Kl,placeholder:null,playsInline:Oo,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Oo,referrerPolicy:null,rel:Kl,required:Oo,reversed:Oo,rows:Wr,rowSpan:Wr,sandbox:Kl,scope:null,scoped:Oo,seamless:Oo,selected:Oo,shadowRootClonable:Oo,shadowRootDelegatesFocus:Oo,shadowRootMode:null,shape:null,size:Wr,sizes:null,slot:null,span:Wr,spellCheck:Ou,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Wr,step:null,style:null,tabIndex:Wr,target:null,title:null,translate:null,type:null,typeMustMatch:Oo,useMap:null,value:Ou,width:Wr,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Kl,axis:null,background:null,bgColor:null,border:Wr,borderColor:null,bottomMargin:Wr,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:Wr,leftMargin:Wr,link:null,longDesc:null,lowSrc:null,marginHeight:Wr,marginWidth:Wr,noResize:Oo,noHref:Oo,noShade:Oo,noWrap:Oo,object:null,profile:null,prompt:null,rev:null,rightMargin:Wr,rules:null,scheme:null,scrolling:Ou,standby:null,summary:null,text:null,topMargin:Wr,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Wr,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Oo,disableRemotePlayback:Oo,prefix:null,property:null,results:Wr,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:Wr,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Wr,amplitude:Wr,arabicForm:null,ascent:Wr,attributeName:null,attributeType:null,azimuth:Wr,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Wr,by:null,calcMode:null,capHeight:Wr,className:Kl,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:Wr,diffuseConstant:Wr,direction:null,display:null,dur:null,divisor:Wr,dominantBaseline:null,download:Oo,dx:null,dy:null,edgeMode:null,editable:null,elevation:Wr,enableBackground:null,end:null,event:null,exponent:Wr,externalResourcesRequired:null,fill:null,fillOpacity:Wr,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:Wr,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Wr,horizOriginX:Wr,horizOriginY:Wr,id:null,ideographic:Wr,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Wr,k:Wr,k1:Wr,k2:Wr,k3:Wr,k4:Wr,kernelMatrix:Qp,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Wr,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:Wr,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:Wr,overlineThickness:Wr,paintOrder:null,panose1:null,path:null,pathLength:Wr,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Kl,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Wr,pointsAtY:Wr,pointsAtZ:Wr,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:Wr,specularExponent:Wr,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Wr,strikethroughThickness:Wr,string:null,stroke:null,strokeDashArray:Qp,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Wr,strokeOpacity:Wr,strokeWidth:null,style:null,surfaceScale:Wr,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qp,tabIndex:Wr,tableValues:null,target:null,targetX:Wr,targetY:Wr,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:Wr,underlineThickness:Wr,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Wr,values:null,vAlphabetic:Wr,vMathematical:Wr,vectorEffect:null,vHanging:Wr,vIdeographic:Wr,version:null,vertAdvY:Wr,vertOriginX:Wr,vertOriginY:Wr,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Wr,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=`
@@ -5691,7 +5691,7 @@ https://sweetalert2.github.io/#ajax-request`),fwn(t),typeof t.title=="string"&&(
5691
5691
  );
5692
5692
 
5693
5693
  }
5694
- `},hTn=(...t)=>{console!=null&&console.warn&&(lS(t[0])&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t))},cIe={},Uee=(...t)=>{lS(t[0])&&cIe[t[0]]||(lS(t[0])&&(cIe[t[0]]=new Date),hTn(...t))},LXe=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},Fee=(t,e,n)=>{t.loadNamespaces(e,LXe(t,n))},uIe=(t,e,n,r)=>{if(lS(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Fee(t,n,r);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,LXe(t,r))},gTn=(t,e,n={})=>!e.languages||!e.languages.length?(Uee("i18n.languages were undefined or empty",e.languages),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,i)=>{var a;if(((a=n.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,t))return!1}}),lS=t=>typeof t=="string",mTn=t=>typeof t=="object"&&t!==null,vTn=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,yTn={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},bTn=t=>yTn[t],ETn=t=>t.replace(vTn,bTn);let Bee={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:ETn};const STn=(t={})=>{Bee={...Bee,...t}},CTn=()=>Bee;let NXe;const xTn=t=>{NXe=t},_Tn=()=>NXe,wTn={type:"3rdParty",init(t){STn(t.options.react),xTn(t)}},TTn=S.createContext();class ITn{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const ATn=(t,e)=>{const n=S.useRef();return S.useEffect(()=>{n.current=e?n.current:t},[t,e]),n.current},MXe=(t,e,n,r)=>t.getFixedT(e,n,r),RTn=(t,e,n,r)=>S.useCallback(MXe(t,e,n,r),[t,e,n,r]),OTn=(t,e={})=>{var C,x,_,A;const{i18n:n}=e,{i18n:r,defaultNS:i}=S.useContext(TTn)||{},a=n||r||_Tn();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new ITn),!a){Uee("You will need to pass in an i18next instance by using initReactI18next");const P=(N,D)=>lS(D)?D:mTn(D)&&lS(D.defaultValue)?D.defaultValue:Array.isArray(N)?N[N.length-1]:N,R=[P,{},!1];return R.t=P,R.i18n={},R.ready=!1,R}(C=a.options.react)!=null&&C.wait&&Uee("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...CTn(),...a.options.react,...e},{useSuspense:s,keyPrefix:l}=o;let u=t||i||((x=a.options)==null?void 0:x.defaultNS);u=lS(u)?[u]:u||["translation"],(A=(_=a.reportNamespaces).addUsedNamespaces)==null||A.call(_,u);const d=(a.isInitialized||a.initializedStoreOnce)&&u.every(P=>gTn(P,a,o)),f=RTn(a,e.lng||null,o.nsMode==="fallback"?u:u[0],l),p=()=>f,h=()=>MXe(a,e.lng||null,o.nsMode==="fallback"?u:u[0],l),[g,y]=S.useState(p);let v=u.join();e.lng&&(v=`${e.lng}${v}`);const m=ATn(v),b=S.useRef(!0);S.useEffect(()=>{const{bindI18n:P,bindI18nStore:R}=o;b.current=!0,!d&&!s&&(e.lng?uIe(a,e.lng,u,()=>{b.current&&y(h)}):Fee(a,u,()=>{b.current&&y(h)})),d&&m&&m!==v&&b.current&&y(h);const N=()=>{b.current&&y(h)};return P&&(a==null||a.on(P,N)),R&&(a==null||a.store.on(R,N)),()=>{b.current=!1,a&&(P==null||P.split(" ").forEach(D=>a.off(D,N))),R&&a&&R.split(" ").forEach(D=>a.store.off(D,N))}},[a,v]),S.useEffect(()=>{b.current&&d&&y(p)},[a,l,d]);const E=[g,a,d];if(E.t=g,E.i18n=a,E.ready=d,d||!d&&!s)return E;throw new Promise(P=>{e.lng?uIe(a,e.lng,u,()=>P()):Fee(a,u,()=>P())})},fo=t=>typeof t=="string",a5=()=>{let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n},dIe=t=>t==null?"":""+t,LTn=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},NTn=/###/g,fIe=t=>t&&t.indexOf("###")>-1?t.replace(NTn,"."):t,pIe=t=>!t||fo(t),ZI=(t,e,n)=>{const r=fo(e)?e.split("."):e;let i=0;for(;i<r.length-1;){if(pIe(t))return{};const a=fIe(r[i]);!t[a]&&n&&(t[a]=new n),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++i}return pIe(t)?{}:{obj:t,k:fIe(r[i])}},hIe=(t,e,n)=>{const{obj:r,k:i}=ZI(t,e,Object);if(r!==void 0||e.length===1){r[i]=n;return}let a=e[e.length-1],o=e.slice(0,e.length-1),s=ZI(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=ZI(t,o,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},MTn=(t,e,n,r)=>{const{obj:i,k:a}=ZI(t,e,Object);i[a]=i[a]||[],i[a].push(n)},lP=(t,e)=>{const{obj:n,k:r}=ZI(t,e);if(n)return n[r]},PTn=(t,e,n)=>{const r=lP(t,n);return r!==void 0?r:lP(e,n)},PXe=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?fo(t[r])||t[r]instanceof String||fo(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):PXe(t[r],e[r],n):t[r]=e[r]);return t},Ux=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var DTn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const kTn=t=>fo(t)?t.replace(/[&<>"'\/]/g,e=>DTn[e]):t;class UTn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const FTn=[" ",",","?","!",";"],BTn=new UTn(20),$Tn=(t,e,n)=>{e=e||"",n=n||"";const r=FTn.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const i=BTn.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(n);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},$ee=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let i=t;for(let a=0;a<r.length;){if(!i||typeof i!="object")return;let o,s="";for(let l=a;l<r.length;++l)if(l!==a&&(s+=n),s+=r[l],o=i[s],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&l<r.length-1)continue;a+=l-a+1;break}i=o}return i},cP=t=>t==null?void 0:t.replace("_","-"),VTn={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};class uP{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||VTn,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,i){return i&&!this.debug?null:(fo(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new uP(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new uP(this.logger,e)}}var P0=new uP;class iU{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[s,l]=o;for(let u=0;u<l;u++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[s,l]=o;for(let u=0;u<l;u++)s.apply(s,[e,...r])})}}class gIe extends iU{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){var u,d;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,n],r&&(Array.isArray(r)?s.push(...r):fo(r)&&a?s.push(...r.split(a)):s.push(r)));const l=lP(this.data,s);return!l&&!n&&!r&&e.indexOf(".")>-1&&(e=s[0],n=s[1],r=s.slice(2).join(".")),l||!o||!fo(r)?l:$ee((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[n],r,a)}addResource(e,n,r,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,n];r&&(s=s.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(s=e.split("."),i=n,n=s[1]),this.addNamespaces(n),hIe(this.data,s,i),a.silent||this.emit("added",e,n,r,i)}addResources(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in r)(fo(r[a])||Array.isArray(r[a]))&&this.addResource(e,n,a,r[a],{silent:!0});i.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,i,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[e,n];e.indexOf(".")>-1&&(s=e.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=lP(this.data,s)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?PXe(l,r,a):l={...l,...r},hIe(this.data,s,l),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var DXe={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,i){return t.forEach(a=>{var o;e=((o=this.processors[a])==null?void 0:o.process(e,n,r,i))??e}),e}};const mIe={};class dP extends iU{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),LTn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=P0.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return(r==null?void 0:r.res)!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!$Tn(e,r,i);if(o&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:fo(a)?[a]:a};const u=e.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(a=u.shift()),e=u.join(i)}return{key:e,namespaces:fo(a)?[a]:a}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(e[e.length-1],n),l=s[s.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode"){if(d){const C=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${C}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${C}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:o}const f=this.resolve(e,n);let p=f==null?void 0:f.res;const h=(f==null?void 0:f.usedKey)||o,g=(f==null?void 0:f.exactUsedKey)||o,y=Object.prototype.toString.apply(p),v=["[object Number]","[object Function]","[object RegExp]"],m=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,E=!fo(p)&&typeof p!="boolean"&&typeof p!="number";if(b&&p&&E&&v.indexOf(y)<0&&!(fo(m)&&Array.isArray(p))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,p,{...n,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(f.res=C,f.usedParams=this.getUsedParamsDetails(n),f):C}if(a){const C=Array.isArray(p),x=C?[]:{},_=C?g:h;for(const A in p)if(Object.prototype.hasOwnProperty.call(p,A)){const P=`${_}${a}${A}`;x[A]=this.translate(P,{...n,joinArrays:!1,ns:s}),x[A]===P&&(x[A]=p[A])}p=x}}else if(b&&fo(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,e,n,r));else{let C=!1,x=!1;const _=n.count!==void 0&&!fo(n.count),A=dP.hasDefaultValue(n),P=_?this.pluralResolver.getSuffix(u,n.count,n):"",R=n.ordinal&&_?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",N=_&&!n.ordinal&&n.count===0,D=N&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${P}`]||n[`defaultValue${R}`]||n.defaultValue;!this.isValidLookup(p)&&A&&(C=!0,p=D),this.isValidLookup(p)||(x=!0,p=o);const z=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&x?void 0:p,B=A&&D!==p&&this.options.updateMissing;if(x||C||B){if(this.logger.log(B?"updateKey":"missingKey",u,l,o,B?D:p),a){const W=this.resolve(o,{...n,keySeparator:!1});W&&W.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let j=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let W=0;W<V.length;W++)j.push(V[W]);else this.options.saveMissingTo==="all"?j=this.languageUtils.toResolveHierarchy(n.lng||this.language):j.push(n.lng||this.language);const G=(W,Z,H)=>{var ee;const X=A&&H!==p?H:z;this.options.missingKeyHandler?this.options.missingKeyHandler(W,l,Z,X,B,n):(ee=this.backendConnector)!=null&&ee.saveMissing&&this.backendConnector.saveMissing(W,l,Z,X,B,n),this.emit("missingKey",W,l,Z,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&_?j.forEach(W=>{const Z=this.pluralResolver.getSuffixes(W,n);N&&n[`defaultValue${this.options.pluralSeparator}zero`]&&Z.indexOf(`${this.options.pluralSeparator}zero`)<0&&Z.push(`${this.options.pluralSeparator}zero`),Z.forEach(H=>{G([W],o+H,n[`defaultValue${H}`]||D)})}):G(j,o,D))}p=this.extendTranslation(p,e,n,f,r),x&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${l}:${o}`),(x||C)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,C?p:void 0))}return i?(f.res=p,f.usedParams=this.getUsedParamsDetails(n),f):p}extendTranslation(e,n,r,i,a){var u,d;var o=this;if((u=this.i18nFormat)!=null&&u.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=fo(e)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(f){const g=e.match(this.interpolator.nestingRegexp);p=g&&g.length}let h=r.replace&&!fo(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,r.lng||this.language||i.usedLng,r),f){const g=e.match(this.interpolator.nestingRegexp),y=g&&g.length;p<y&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var g=arguments.length,y=new Array(g),v=0;v<g;v++)y[v]=arguments[v];return(a==null?void 0:a[0])===y[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):o.translate(...y,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=fo(s)?[s]:s;return e!=null&&(l!=null&&l.length)&&r.applyPostProcessor!==!1&&(e=DXe.handle(l,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,a,o,s;return fo(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),d=u.key;i=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=n.count!==void 0&&!fo(n.count),h=p&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(fo(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var m,b;this.isValidLookup(r)||(s=v,!mIe[`${y[0]}-${v}`]&&((m=this.utils)!=null&&m.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(s))&&(mIe[`${y[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(E=>{var _;if(this.isValidLookup(r))return;o=E;const C=[d];if((_=this.i18nFormat)!=null&&_.addLookupKeys)this.i18nFormat.addLookupKeys(C,d,E,v,n);else{let A;p&&(A=this.pluralResolver.getSuffix(E,n.count,n));const P=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(C.push(d+A),n.ordinal&&A.indexOf(R)===0&&C.push(d+A.replace(R,this.options.pluralSeparator)),h&&C.push(d+P)),g){const N=`${d}${this.options.contextSeparator}${n.context}`;C.push(N),p&&(C.push(N+A),n.ordinal&&A.indexOf(R)===0&&C.push(N+A.replace(R,this.options.pluralSeparator)),h&&C.push(N+P))}}let x;for(;x=C.pop();)this.isValidLookup(r)||(a=x,r=this.getResource(E,v,x,n))}))})}),{res:r,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){var a;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,n,r,i):this.resourceStore.getResource(e,n,r,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!fo(e.replace);let i=r?e.replace:e;if(r&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const a of n)delete i[a]}return i}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class vIe{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=P0.create("languageUtils")}getScriptPartFromCode(e){if(e=cP(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=cP(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(fo(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{this.logger.warn(`failed to format code: ${e}`)}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(a=>{if(a===i)return a;if(!(a.indexOf("-")<0&&i.indexOf("-")<0)&&(a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),fo(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),i=[],a=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return fo(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):fo(e)&&a(this.formatLanguageCode(e)),r.forEach(o=>{i.indexOf(o)<0&&a(this.formatLanguageCode(o))}),i}}const yIe={zero:0,one:1,two:2,few:3,many:4,other:5},bIe={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class zTn{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=P0.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=cP(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let o;try{o=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),bIe;if(!e.match(/-|_/))return bIe;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,n)}return this.pluralRulesCache[a]=o,o}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(i=>`${n}${i}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,a)=>yIe[i]-yIe[a]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const EIe=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=PTn(t,e,n);return!a&&i&&fo(n)&&(a=$ee(t,n,r),a===void 0&&(a=$ee(e,n,r))),a},rq=t=>t.replace(/\$/g,"$$$$");class HTn{constructor(){var n;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P0.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:s,suffixEscaped:l,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:h,nestingSuffix:g,nestingSuffixEscaped:y,nestingOptionsSeparator:v,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=n!==void 0?n:kTn,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?Ux(a):o||"{{",this.suffix=s?Ux(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=p?Ux(p):h||Ux("$t("),this.nestingSuffix=g?Ux(g):y||Ux(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=m||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,i){var h;let a,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(g.indexOf(this.formatSeparator)<0){const b=EIe(n,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...i,...n,interpolationkey:g}):b}const y=g.split(this.formatSeparator),v=y.shift().trim(),m=y.join(this.formatSeparator).trim();return this.format(EIe(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),m,r,{...i,...n,interpolationkey:v})};this.resetRegExp();const d=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((h=i==null?void 0:i.interpolation)==null?void 0:h.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>rq(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?rq(this.escape(g)):rq(g)}].forEach(g=>{for(s=0;a=g.regex.exec(e);){const y=a[1].trim();if(o=u(y),o===void 0)if(typeof d=="function"){const m=d(e,a,i);o=fo(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,y))o="";else if(f){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),o="";else!fo(o)&&!this.useRawValueToEscape&&(o=dIe(o));const v=g.safeValue(o);if(e=e.replace(a[0],v),f?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,a,o;const s=(l,u)=>{const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const f=l.split(new RegExp(`${d}[ ]*{`));let p=`{${f[1]}`;l=f[0],p=this.interpolate(p,o);const h=p.match(/'/g),g=p.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!g||g.length%2!==0)&&(p=p.replace(/'/g,'"'));try{o=JSON.parse(p),u&&(o={...u,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${d}${p}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...r},o=o.replace&&!fo(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(f=>f.trim());i[1]=d.shift(),l=d,u=!0}if(a=n(s.call(this,i[1].trim(),o),o),a&&i[0]===e&&!fo(a))return a;fo(a)||(a=dIe(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),u&&(a=l.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],a),this.regexp.lastIndex=0}return e}}const GTn=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(o=>{if(o){const[s,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},Fx=t=>{const e={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=r+JSON.stringify(a);let s=e[o];return s||(s=t(cP(r),i),e[o]=s),s(n)}};class jTn{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P0.create("formatter"),this.options=e,this.formats={number:Fx((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return a=>i.format(a)}),currency:Fx((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>i.format(a)}),datetime:Fx((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return a=>i.format(a)}),relativetime:Fx((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return a=>i.format(a,r.range||"day")}),list:Fx((n,r)=>{const i=new Intl.ListFormat(n,{...r});return a=>i.format(a)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Fx(n)}format(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(s=>s.indexOf(")")>-1)){const s=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,s)].join(this.formatSeparator)}return a.reduce((s,l)=>{var f;const{formatName:u,formatOptions:d}=GTn(l);if(this.formats[u]){let p=s;try{const h=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},g=h.locale||h.lng||i.locale||i.lng||r;p=this.formats[u](s,g,{...d,...i,...h})}catch(h){this.logger.warn(h)}return p}else this.logger.warn(`there was no format function for ${u}`);return s},e)}}const WTn=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class XTn extends iU{constructor(e,n,r){var a,o;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=P0.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,r,i.backend,i)}queueLoad(e,n,r,i){const a={},o={},s={},l={};return e.forEach(u=>{let d=!0;n.forEach(f=>{const p=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?o[p]===void 0&&(o[p]=!0):(this.state[p]=1,d=!1,o[p]===void 0&&(o[p]=!0),a[p]===void 0&&(a[p]=!0),l[f]===void 0&&(l[f]=!0)))}),d||(s[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,n,r){const i=e.split("|"),a=i[0],o=i[1];n&&this.emit("failedLoading",a,o,n),!n&&r&&this.store.addResourceBundle(a,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const s={};this.queue.forEach(l=>{MTn(l.loaded,[a],o),WTn(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const d=l.loaded[u];d.length&&d.forEach(f=>{s[u][f]===void 0&&(s[u][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,i+1,a*2,o)},a);return}o(u,d)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(e,n);u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}return}return l(e,n,s)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();fo(e)&&(e=this.languageUtils.toResolveHierarchy(e)),fo(n)&&(n=[n]);const a=this.queueLoad(e,n,r,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),i=r[0],a=r[1];this.read(i,a,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${n}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${n}loaded namespace ${a} for language ${i}`,s),this.loaded(e,o,s)})}saveMissing(e,n,r,i,a){var l,u,d,f,p;let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((p=this.backend)!=null&&p.create){const h={...o,isUpdate:a},g=this.backend.create.bind(this.backend);if(g.length<6)try{let y;g.length===5?y=g(e,n,r,i,h):y=g(e,n,r,i),y&&typeof y.then=="function"?y.then(v=>s(null,v)).catch(s):s(null,y)}catch(y){s(y)}else g(e,n,r,i,s,h)}!e||!e[0]||this.store.addResource(e[0],n,r,i)}}}const SIe=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),fo(t[1])&&(e.defaultValue=t[1]),fo(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),CIe=t=>{var e,n;return fo(t.ns)&&(t.ns=[t.ns]),fo(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),fo(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},TL=()=>{},ZTn=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class h6 extends iU{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=CIe(e),this.services={},this.logger=P0,this.modules={external:[]},ZTn(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(fo(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=SIe();this.options={...i,...this.options,...CIe(n)},this.options.interpolation={...i.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?P0.init(a(this.modules.logger),this.options):P0.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=jTn;const f=new vIe(this.options);this.store=new gIe(this.options.resources,this.options);const p=this.services;p.logger=P0,p.resourceStore=this.store,p.languageUtils=f,p.pluralResolver=new zTn(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(p.formatter=a(d),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new HTn(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new XTn(a(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(h){for(var g=arguments.length,y=new Array(g>1?g-1:0),v=1;v<g;v++)y[v-1]=arguments[v];e.emit(h,...y)}),this.modules.languageDetector&&(p.languageDetector=a(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=a(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new dP(this.services,this.options),this.translator.on("*",function(h){for(var g=arguments.length,y=new Array(g>1?g-1:0),v=1;v<g;v++)y[v-1]=arguments[v];e.emit(h,...y)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=TL),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const l=a5(),u=()=>{const d=(f,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(p),r(f,p)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),l}loadResources(e){var a,o;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:TL;const i=fo(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&s.indexOf(f)<0&&s.push(f)})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>l(d)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,u=>l(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(e,n,r){const i=a5();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=TL),this.services.backendConnector.reload(e,n,a=>{i.resolve(),r(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&DXe.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const i=a5();this.emit("languageChanging",e);const a=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,u)=>{u?(a(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{var d,f;!e&&!l&&this.services.languageDetector&&(l=[]);const u=fo(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||a(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,p=>{o(p,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),i}getFixedT(e,n,r){var i=this;const a=function(o,s){let l;if(typeof s!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];l=i.options.overloadTranslationOptionHandler([o,s].concat(d))}else l={...s};l.lng=l.lng||a.lng,l.lngs=l.lngs||a.lngs,l.ns=l.ns||a.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||a.keyPrefix);const p=i.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(o)?h=o.map(g=>`${l.keyPrefix}${p}${g}`):h=l.keyPrefix?`${l.keyPrefix}${p}${o}`:o,i.t(h,l)};return fo(e)?a.lng=e:a.lngs=e,a.ns=n,a.keyPrefix=r,a}t(){var i;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(i=this.translator)==null?void 0:i.translate(...n)}exists(){var i;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(i=this.translator)==null?void 0:i.exists(...n)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const s=n.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!i||o(a,e)))}loadNamespaces(e,n){const r=a5();return this.options.ns?(fo(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=a5();fo(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){var i,a;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((a=this.services)==null?void 0:a.languageUtils)||new vIe(SIe());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new h6(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:TL;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new h6(i);return(e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new gIe(this.store.data,i),a.services.resourceStore=a.store),a.translator=new dP(a.services,i),a.translator.on("*",function(s){for(var l=arguments.length,u=new Array(l>1?l-1:0),d=1;d<l;d++)u[d-1]=arguments[d];a.emit(s,...u)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Nf=h6.createInstance();Nf.createInstance=h6.createInstance;Nf.createInstance;Nf.dir;Nf.init;Nf.loadResources;Nf.reloadResources;Nf.use;Nf.changeLanguage;Nf.getFixedT;Nf.t;Nf.exists;Nf.setDefaultNamespace;Nf.hasLoadedNamespace;Nf.loadNamespaces;Nf.loadLanguages;const qTn={"5000.0001":"2D registration","5000.0002":"Upload slice","5000.0003":"Upload Failed,please contact the administrator","5000.0004":"View result","5000.0005":"Downloading","5000.0006":"Select the range","5000.0007":"remove the range","5000.0008":"preview selected data","5000.0009":"Tips: press the 'A' key to switch between pan and zoom modes","5000.0010":"Set the downsampling rate","5000.5018":"Download selected data","5000.5012":"Normal mode","5000.5013":"Virtual surgery mode","5000.5014":"Atlas mapping","5000.5019":"Upload 3D image or swc file already mapped to STAM or CCF","5000.5020":"Map the uploaded data to the other atlas:","5000.5021":"Start","5000.5022":"Download","5000.5023":"View result","5000.5024":"Other atlases","5000.5025":"Setting","5000.5026":"Simple mode","5000.5027":"Select structure","5000.5028":"Select target","5000.5029":"Remove target","5000.5017":"Intelligent planning","5000.5030":"Planning","5000.5015":"Select the direction of conversion","5000.5016":"Cranial","2002.0301":"Information","5000.5031":"Block size:","5000.0019":"or press 'R' key to switch between Rotation mode and Translation mode","5000.5034":"Auto","5000.5035":"Manual","5000.5057":"Show 3D morphology","5000.5056":"Hide 3D morphology","5000.5058":"Unable to calculate a path to avoid the structures you selected","5000.0112":"Cancel","2002.0302":"View data","5000.0111":"Save","4000.0210":"Translate-X","2002.0300":"Neuron collaborative annotation platform","5000.0113":"Alias in Dong's nomenclature","4000.0212":"Translate-Z","4000.0211":"Translate-Y","4000.0214":"Rotate-Y","5000.0110":"Edit","4000.0213":"Rotate-X","4000.0216":"View high resolution slice","4000.0215":"Rotate-Z","4000.0218":"Coordinate","4000.0217":"Left hemisphere","4000.0219":"Datum Marks","4000.0100":"","4000.0221":"go to coronal","4000.0220":"SIZE","4000.0102":"Bregma","4000.0223":"go to horizontal","4000.0101":"unit:mm","4000.0222":"go to sagittal","4000.0104":"Sagittal sections","4000.0225":"guide","4000.0103":"Coronal sections","4000.0224":"go to arbitrary","2001.0402":"View data","4000.0106":"search anatomical structures","2001.0401":"Information","4000.0105":"Horizontal sections","4000.0226":"Finish","4000.0108":"Brain maps 4.0","4000.0229":"Next","2001.0403":"Vessel","4000.0107":"ARA ontology","4000.0228":"Skip","4000.0109":"Mouse Brain Atlas","2001.0400":"Cerebral vascular atlas","1000.0400":"Login","2002.0202":"View data","2002.0203":"After nonlinear registration, the registered image is then returned to the user. Additionally, users receive access to isotropic 1-micron resolution cytoarchitectural slice with the same position and angle.","2002.0200":"Automatic slice registration","2002.0201":"We provide an automatic brain slice registration service where users can upload single brain slice images stained with PI or DAPI. This service, through approximately 10 minutes of background computation, extracts a slice from the three-dimensional STAM that is closest to the position of the user-uploaded brain slice.","2002.0602":"The service provides information on the distance between the injection site and the cranial or intracranial datum marks, as well as the injection angle, based on user interactions.","2002.0600":"Stereotactic surgical navigation service","2002.0601":"We have incorporated a stereotaxic surgical navigation service into the three-dimensional visualization service page. Users can simulate the stereotaxic surgical procedure of injecting viruses into the mouse brain through interactive operations.","6000.0112":"Please enter an email address","6000.0110":"Please enter the purpose of the data","6000.0111":"Label image download","7000.0108":"Start","7000.0109":"Save","7000.0106":"Calculate the corresponding plane from the atlas","7000.0107":"View higher resolution image","4000.0201":"Anatomical Structure","7000.0104":"Get test image","4000.0200":"","7000.0105":"Upload","4000.0203":"Virtual surgery","7000.0102":"Description","4000.0202":"Assembling","7000.0103":"Choose the type of uploaded slice","4000.0205":"Magnitude","7000.0100":"","4000.0204":"Atlas reslicing","7000.0101":"Image registration service","4000.0207":"Scaling","4000.0206":"Frequency","2001.0101":"STAM's two-dimensional visualization service provides a digital map-style online browsing function with 700 coronal planes, 256 sagittal planes, and 367 horizontal planes.","4000.0209":"Reset","2001.0100":"2D visualization","4000.0208":"Select Target","2001.0103":"Users can observe individual standard profiles at different resolutions, navigate profiles at different locations along the same direction, and switch between the three standard profile directions. Each standard profile is a 20μm-thick projection image overlaid with a coordinate grid and annotated with boundaries of neuroanatomical structures.","2001.0102":"View data","1000.0302":"Contact us","2000.0800":"Manual Instruction","1000.0303":"Help","1000.0300":"About","1000.0301":"Introduction","2002.0103":"Users can choose the angle of interest and examine the isotropic 1-micron resolution cytoarchitectural brain slice at that angle. This service provides newly generated slices with annotations for brain regions and nuclei.","4000.0131":"Show Contour","2002.0500":"Anatomical knowledge base","4000.0130":"Show Atlas","2002.0101":"We also offer the service of visualizing slices at arbitrary angles.","2002.0102":"View data","4000.0132":"Nucleus Information","2002.0501":"We have developed a neuroanatomical knowledge base service for STAM.","7000.0113":"Upload and Download","2002.0502":"When users are exploring the three-dimensional topography of brain structures of interest using the two-dimensional and three-dimensional visualization services, they can conveniently access this knowledge base by right-clicking with the mouse. This allows them to query information related to the structure of interest, such as gene expression, neurotransmitters, projection pathways, and more. The knowledge base provides an entry point for the public to actively contribute, edit, and enhance neuroanatomical knowledge.","7000.0111":"Uploaded Image","7000.0112":"Output Image","7000.0110":"Any question about this online registration tool, welcome to contact atlas@brainsmatics.org","2002.0100":"Arbitrary-angle slice visualization","6000.0105":"Purpose of the data","6000.0106":"Submit","6000.0103":"Postal address","6000.0104":"E-mail","6000.0109":"Please enter a postal address","2000.2001":"Brain atlas and data","6000.0107":"Please enter the company name","6000.0108":"Please enter the contact person","2001.0203":"Users are capable of exploring the overall appearance as well as details of any anatomical structure of interest in three-dimensional space, from different perspectives and magnification levels. Additionally, through the assembly view feature, users can unfold the sub-structures contained within each brain region and nucleus, providing a detailed examination of the internal components.","2001.0200":"3D visualization","6000.0101":"Company Name","6000.0102":"Contact person","2001.0202":"View data","2001.0201":"STAM's three-dimensional visualization service reconstructs the three-dimensional topography of 915 brain regions and nuclei.","6000.0100":"","1000.0203":"Neuron collaborative annotation platform","1000.0204":"Data sharing service","1000.0200":"Tools","1000.0201":"High-resolution arbitrary angle reslicing service","1000.0202":"Image registration service","2000.2002":"Services","2000.0500":"Brains-Map","2002.0400":"Data sharing service","4000.0230":"Back","2002.0401":"Information","4000.0111":"D - V","4000.0232":"Step 2","4000.0110":"A - P","4000.0231":"Step 1","4000.0113":"Display","4000.0234":"Step 4","4000.0112":"M - L","4000.0233":"Step 3","2002.0402":"View data","4000.0115":"2D Navigation","4000.0236":"Select a structure on the left","4000.0114":"3D Atlas","4000.0235":"Click the start button","4000.0117":"Reset to default view","4000.0238":"Click the End button","4000.0116":"Annotation","4000.0237":"Left-click on the selected structure to<br> determine the injection site, <br>and then move the mouse to determine the injection direction","4000.0119":"Gridlines","4000.0118":"Information box","4000.0239":"Set the expanded length","4000.0120":"GO TO","4000.0241":"Click the icon here to expand the selected structure, <br> click the icon again to exit from the expanded state","5000.0101":"alias in Paxinos's nomenclature","4000.0240":"Sets the degree of zooming out of the <br>center expansion","5000.0100":"","4000.0122":"Introduction of this structure","4000.0243":"Right click on this structure in the model and select the face you need","5000.0103":"Reference","4000.0121":"3D Viewer","4000.0242":"Clear Target","5000.0102":"alias in Hof's nomenclature","4000.0124":"Zoom out","4000.0245":"Click to view higher resolution images","4000.0123":"Figure","4000.0244":"On the right side, you can drag the position of the section","0800.0801":"Operating Instructions The interface for the two-dimensional visualization service is illustrated below. The central area is the main window, used to display STAM's standard profiles (<span>①</span>) and the brain region annotations on these profiles (<span>②</span>). Users can use the left mouse button and scroll wheel in the main window to move, and zoom in to the resolution of the region of interest. When the user hovers the mouse over an annotation for a brain region or nucleus, the annotation switches to a blue highlighted mode (<span>③</span>), and the full name of the highlighted brain region or nucleus is displayed in the lower-left corner (<span>④</span>). The light gray grid behind the standard profile and annotations shows the distribution of the STAM coordinate system on the current standard profile (<span>⑤</span>). As the user moves the mouse, the real-time position of the mouse in the STAM coordinate system is displayed in the lower-left corner of the main window (<span>⑥</span>). Users can also observe the position of the current viewed standard profile in the entire mouse brain through the navigation window in the upper left corner (<span>⑦</span>). Users can freely switch to other profiles (<span>⑧</span>) or switch between different anatomical directions, such as coronal, sagittal, and horizontal planes (<span>⑨</span>). Additionally, users can search for brain regions or nuclei of interest in the input box (<span>⑩</span>) or navigate through the anatomical ontology tree (<span>⑪</span>). If the current viewed profile does not include the searched structure, it will jump to the nearest profile in the same direction that contains the structure. At the bottom of the main window is the button panel for the two-dimensional visualization service (<span>⑫</span>). The button functions, from left to right, include: zoom out, zoom in, reset view, full screen, switch to three-dimensional visualization service, switch to arbitrary angle cross-section visualization service, display mode switch, and jump to other profiles in the current anatomical direction.","4000.0126":"Reset","4000.0125":"Zoom in","4000.0128":"To 3d Viewer","5000.0109":"Chemical name","2001.0302":"View data","4000.0127":"Full Screen","5000.0108":"Disease name","2001.0701":"The Stereotaxic Topographic Atlas of the Mouse Brain (STAM) is a three-dimensional topographical atlas that depict the anatomical structures of the whole mouse brain, achieving precise single-cell resolution localization. This atlas is based on a three-dimensional Nissl-stained image dataset with isotropic one-micron resolution and is constructed by incorporating various auxiliary imaging data, including immunohistochemistry, neural circuit projections, and specific gene type neuron distribution data. Here, we established the STAM visualization platform, which includes services for exploring standard two-dimensional anatomical sections, three-dimensional topography, and arbitrary-angle slices of the brain atlas. The platform integrates different functionalities such as neuroanatomical knowledge base, stereotaxic surgical navigation, and automatic registration of user-uploaded slices. The STAM visualization platform is expected to provide an effective spatial localization benchmark for the registration and integration of results from single-cell level studies, such as multi-omics and neurocircuitry.","2001.0700":"The brief introduction to STAM","4000.0129":"E-mail","5000.0105":"Disease","5000.0104":"Gene","2001.0301":"Information","5000.0107":"Gene name","2001.0300":"Neuronal morphology database","5000.0106":"Chemical","1000.0104":"Cerebral vascular atlas","1000.0500":"Language","1000.0501":"Simplified Chinese","1000.0502":"English","1000.0100":"Atlas","1000.0101":"Stereotactic atlas","1000.0102":"Specific cell type distribution atlas","1000.0103":"Neuronal morphology database","0800.0803":"Operating Instructions The interface for the three-dimensional visualization service is illustrated as followed. The left side features the navigation window, while the right side is the main window. The main window displays the arbitrary angle slice of STAM (<span>①</span>) and the brain region annotations on that slice (<span>②</span>). Users can pan in the main window by holding down the left mouse button, zoom in using Ctrl + scroll wheel, or switch to different neighboring slices along the current angle by using the scroll wheel. On the right side of the main window is the list of brain regions and nuclei (<span>③</span>). When the user moves the mouse over the name of a structure of interest, the annotation for that structure in the main window is highlighted in light gray (<span>④</span>). Users can also move the mouse over the annotation of a structure of interest in the main window, and the name of that structure in the list of brain regions and nuclei on the right will automatically be highlighted. At this time, the name of the structure will also be displayed in the lower-left corner of the main window (<span>⑤</span>). Below the structure name is the scale bar of the slice image in the main window at the current resolution (<span>⑥</span>). In the navigation window on the left side, the central area displays the three-dimensional model of the right half of the mouse brain (<span>⑦</span>). The black plane corresponds to the position and angle of the slice in the main window (<span>⑧</span>). The red, green, and blue circles around the model are used to change the pitching, rotation, and rolling angles of the cross-section (<span>⑨</span>). Users can also input values in the lower-left corner of the navigation window to set the slice angle (<span>⑩</span>). The red, green, and blue arrows in the navigation window are used to determine the position of the slice along the given arbitrary angle in the three-dimensional space (<span>⑪</span>).","0800.0802":"Operating Instructions The interface for the three-dimensional visualization service is depicted as followed. The central area is the main window, which initially displays the outline of the mouse brain (<span>①</span>). On the left side of the main window is the anatomical ontology tree (<span>②</span>), where users can choose any structure of interest. By checking the three-dimensional model of the selected structure, it will be displayed in the main window (<span>③</span>), and the full name of the structure will appear in the lower-left corner of the main window (<span>④</span>). Users can use a long press of the left mouse button in the main window to select the observation angle and a long press of the right mouse button to pan the view. The gray grid behind the three-dimensional model represents the STAM coordinate system (<span>⑤</span>), with the coordinate origin selected by users from the candidates, indicated by a red sphere in the main window (<span>⑥</span>). As the user moves the mouse, the real-time position of the mouse in the STAM coordinate system is displayed in the lower-left corner of the main window (<span>⑦</span>). By clicking the blue three-dimensional cube icon to the right of any structure name in the anatomical naming tree, users can enter assembly view mode (<span>⑧</span>). In this mode, users can adjust parameters such as the degree of expansion of substructures to control the display effect (<span>⑨</span>).","0800.0805":`Operating Instructions The stereotaxic surgical navigation service is illustrated as followed and is integrated into the three-dimensional visualization service interface. Therefore, basic user interactions can refer to Section "Three-Dimensional Visualization Service." The surgical navigation panel is located on the right side of the main window. After clicking on the "Viral injection" tab, users can continue by clicking the "start programming" button to enter navigation mode (<span>①</span>). At this point, users can select brain regions or nuclei of interest from the anatomical naming tree on the left side of the interface. Once the three-dimensional model of the selected structure is displayed in the main window, users can use the left mouse button to set the injection site on the model (<span>②</span>). Subsequently, the surgical navigation service will automatically generate a ray emanating from the injection site, following the direction of the user's mouse movement (<span>③</span>). After adjusting the mouse position to set the injection direction, clicking the left mouse button again will generate a target point on the external surface of the mouse brain (<span>④</span>). The coordinates of the injection site and target point are displayed below the navigation service panel (<span>⑤</span>). These coordinates represent the relative positions of the two points to the user-selected datum marks, such as the Bregma point, in three-dimensional space. Users can also switch to any cranial and intracranial datum marks of interest. Additionally, the calculated information includes the angle between the user-selected injection direction and the three standard profiles of coronal, sagittal, and horizontal planes (<span>⑥</span>).`,"0800.0804":"Operating Instructions The interface for the neuroanatomical knowledge base service is depicted in the diagram below. Each brain region or nucleus has an independent page, and the example shown is a schematic representation of the knowledge base page for the Lateral dorsal nucleus of the thalamus (LD) nucleus. The page includes, from top to bottom, an overview of the structure of interest (<span>①</span>), aliases (<span>②</span>), references related to this structure (<span>③</span>), as well as information related to genes (<span>④</span>), chemicals (<span>⑤</span>), diseases (<span>⑥</span>), and more. For each gene, chemical, and disease, corresponding references are also listed. Additionally, we provide an entry point for users to edit the content. Users can click the Edit button on the right side of the page to submit edits, and we will review the content submitted by users in the background.","0800.0806":"Operating Instructions The brain slice automatic registration service interface is illustrated as followed. In the upper-left corner is the image upload panel (<span>①</span>), with a radio button on the left containing the currently allowed types of images for registration. After selecting the image type, users can click the Upload button on the right to upload the brain slice image for registration. Users can also click the “Get test image” button to download a test image and then upload it for testing. The uploaded image will be displayed in the lower-left corner of the interface (<span>②</span>). Once the upload is complete, click the “Start” button in the registration calculation panel on the upper-right side of the interface (<span>③</span>), and the background computation will begin. After the calculation is completed, the results will be displayed on the lower-right side of the interface (<span>④</span>). Users can click the “Save” button in the calculation panel to download the results locally. Alternatively, clicking the View higher resolution image button will navigate to the arbitrary angle slice service, allowing users to observe high-resolution cytoarchitectural images at the corresponding angle.","5000.0200":"Regions to avoid","5000.0201":"Structure for injecting","5000.0202":"Regions","5000.0204":"Vessels","5000.0205":"Vessels to avoid","5000.5060":"Hide neural circuit","5000.5061":"Show neural circuit","5000.5039":"Download the 3D image containing {{name}}","5000.5038":"Set {{name}} as the origin","5000.5040":"Input the region that soma locates","5000.5041":"Input the region that neuron projects","5000.0206":"Show vascular branches passing by","5000.0207":"Hide vascular branches passing by","5000.0208":"Show structures it supplies","5000.0209":"Hide structures it supplies","5000.5044":"Using this feature requires an API key. At this time, we provide a temporary key for testing. Click Go on button.","5000.5051":"Tip: Your API-key will be sent to the email address you provided. Please check your email after submission to ensure you have received the email containing your API-key.","5000.0011":"Sending emails","5000.5043":"Fill in the Key","5000.5042":"Request a Key","5000.5045":"Submit","5000.5049":"Key value","5000.5070":"Applicant","5000.5071":"Email","5000.5072":"Affiliation","5000.5073":"Purpose of use","5000.5050":"Save","5000.5052":"Neuronal circuits","5000.5053":"Input the inquired structure","5000.5047":"Commit failure","5000.5048":"Submit successfully","5000.5054":"Upstream","5000.5055":"Downstream","5000.5083":"Step 1","5000.5084":"Step 2","5000.5085":"Set Unfold Length","5000.5080":"Click the icon here to expand the selected structure. Clicking the icon again will allow you to exit from the expanded state","5000.5081":"Select a structure on the left side","5000.5082":"Please select injection mode,if automatic mode is selected, click on the left cell name to select the nucleus to bypass","5000.5086":"Chat with STAM","5000.6001":"Input an inquired structure to visualize the connectivity map, for example, ","5000.6002":"Language","5000.0012":"The current download file has exceeded the server transfer limit. You can choose to reduce the sampling level or send an email. Do you want to send an email?","5000.6003":"Neural circuit","5000.6004":"Hide this neuron","5000.6005":"Coronal view","5000.6006":"Sagittal view","5000.6007":"Horizontal view","5000.6008":"Click the button below to apply for downloading the 3D label image of the isotropic 10 micron resolution STAM map","5000.6009":"Requesting STAM labels","5000.6010":"Tip: The license for downloading will be sent to the email address you provided. Please check your email after submission to ensure you have received the email containing your license.","5000.6011":"Using this feature requires a license. If you do not have a license, please apply for one from us by click the button below.","5000.6012":"Request a license","5000.6013":"Fill in the license","5000.6014":"License number","5000.6015":"Inquire neurons that locate and project to","5000.6019":"Navigate the knowledge of {{focusVirusLineItem}}","5000.6020":"Navigate the knowledge of {{focusVirusLineItem}}'s parent {{lableValue}}","5000.6016":" RGB value","5000.6017":"Subcerebral region","5000.6018":"View higher resolution image","5000.6021":"Hide this branch","5000.6022":"Bounding box of {{lableStr}} as the range","5000.6023":"Hide 3D morphology of {{name}}","5000.6024":"Show 3D morphology of {{name}}","5000.6025":"Switch to coronal plane","5000.6026":"Switch to sagittal plane","5000.6027":"Switch to horizontal plane","5000.6028":"Switch to arbitrary plane","5000.6029":"Navigate the ","5000.6030":"whole-brain connectivity diagram","5000.6031":" consisting of single neuronal projections,or: ","5000.6032":",or: ","5000.6033":"Upload slice, or use the test ","5000.6034":" slices:","5000.6035":"Upload 3D image or swc file already mapped to STAM or CCF, otherwise use the test ","5000.6036":"3D image","5000.6037":"swc file:","5000.6038":"Data source: {{name}}","5000.6039":"Flat skull position","5000.6040":"Abundant projections","5000.6041":"New annotation","5000.6042":"Off","5000.6043":"On","5000.6044":"Grid","5000.6045":"Brain contour","5000.5087":"Step 3","5000.5088":"Step 4","8000.0001":"As shown in ①, on the left of the main window is the data panel, where users can select the anatomical nomenclature tree of STAM, cerebral vascular atlas registered to the STAM and neuron morphological data. You can also switch between different versions of anatomical nomenclature systems.","8000.0002":"As shown in ②, it can load three-dimensional models of brain regions or nuclei in the main window.","8000.0003":"As shown in ③, users can switch to different modes or functional modules.","8000.0004":"The 'Regions' tab includes the anatomical nomenclature tree of STAM, where you can select any number of structures of interest via checkboxes in the main window. The 'Neurons' tab is used to query and filter neuron morphological data with somas or projection targets located in regions of interest.","8000.0005":"Users can click on blue square icon in the anatomical nomenclature tree under the 'Regions' tab, all substructures of the clicked structure will be visualized in an assembled form in the main window, and the expansion magnitude can be set in the right panel. By default, this coordinate system uses the Bregma point as the origin. You can also switch the coordinate origin to any of the other 19 cranial or intracranial datum marks provided by STAM, and the coordinates of the objects visualized in the main window will be recalculated based on the new origin. Right click on any cranial or intracranial datum marks to save the STAM label image with the cranial or intracranial datum marks as the coordinate origin.","8000.0006":"Users can switch to the 'setting' tab on the bottom. The 'Left hemisphere' switch determines whether the left hemisphere is displayed in the main window, and it is off by default. The 'Coordinate' switch determines whether coordinate values are displayed in the main window, and it is on by default. The 'Datum Marks' switch determines whether datum marks are displayed in the main window, and it is on by default. The 'Cranial' switch determines whether the three-dimensional contour of the skull is displayed in the main window, and it is off by default. ","8000.0007":"We have developed a virtual surgery navigating service. Users can simulate the stereotaxic surgical procedure of injecting viruses into the mouse brain through interactive operations. Based on user inputs, the STAM provides the information on the distance and injection angle between the injection site and origin defined by cranial or intracranial datum marks.","8000.0008":"Firstly, select the brain region for injection. Next, select the injection target on the chosen brain region. Once the target is selected, a green dot follows the mouse cursor on the surface of the brain region's 3D model. At the same time, the Clear Target button becomes enabled, allowing the user to change the injection target if needed. Then, clicks 'Auto' to enter automatic type, the 'Structure for injecting' tab on the left data panel changes to 'Regions to avoid'. By clicking on the names of brain regions or nuclei to avoid, the selected text will highlight in bright red. Simultaneously, the 3D contours of these structures will be visualized in the main window. Next, clicking the 'Intellectual planning' button on the right panel initiates the process. After a few seconds, STAM returns a path originating from the injection target, avoiding all user-selected brain regions and nuclei.","8000.0009":"If the user selects “Manual” to enter the manual planning mode, the marked injection target turns into a blue dot. At the same time, the Clear Target button becomes enabled, allowing the user to change the injection target if needed. Once the target is set, a red dashed line extends from the injection target toward the current mouse position. The intersection of this dashed line with the outline of STAM (i.e., the injection entry point) is marked in green. Users can select different options under Path constraint for injection as needed. When the user identifies a suitable injection path, they can left-click to mark it. The marked path will then appear as a solid blue line in the main window, with the injection entry point displayed as a blue cone. The names of the brain regions and nuclei that the path passes through are arranged along the solid blue line according to their spatial positions. The right panel displays information about the angle between the injection path and the three standard anatomical directions, the injection target, and the injection entry point. If the user wishes to restart the entire virtual surgery process, they can click the “Reset” button on the right panel.","8000.0011":"As shown in ①, users can upload single brain slice images stained with PI or DAPI. This service will generate a corresponding atlas slice from STAM that is closest in position to the uploaded brain slice. The computed angle and position will then be displayed in the main window.","8000.0012":"Users can upload the 2D brain slice image in tif/tiff format for registration from your local device. Then select the type of the uploaded image. Next, click the 'Start' button in the 'Calculate the corresponding plane from the atlas' button group and wait for the result from the server. Once the calculation is complete, a preview image of the calculation result will appear below the 'Start' button, which can be enlarged by left-clicking. The 'Save' button to the right of the 'Start' button will also become clickable. By clicking this 'Save' button, users can download the calculation result to their local device.","8000.0013":"Right-click on the corresponding brain region or nucleus in the main window can jump to Arbitrary plane visualization and neuroanatomical knowledge base.","8000.0014":"As shown in ① and ②, users can select any region of interest within the 3D space of STAM and download the original images of the selected region at different sampling rates.","8000.0015":"Users can click “Select the range” button and orange-lined box will appear in the main window. Users can control the box's translation by left-clicking and dragging the red, green, and blue arrows, respectively. When an arrow is selected, it will be highlighted as bright yellow. ","8000.0016":"Users can switch from translation mode to scaling mode by pressing the 'A' key on the keyboard. In this mode, the arrows will change to squares, and dragging these squares will resize the box. Once the spatial range for the data to be downloaded is determined, users can click the 'preview selected data' button. This will visualize the images within the selected range in the main window using volume rendering.","8000.0017":"By dragging the 'Set the downsampling rate' slider, users can select the sampling rate for the data to be downloaded. The specific sampling rate value can be seen in the black-backgrounded tip above the slider. If the data size does not exceed 1 GB, clicking the 'Downloading' button to download it directly; When the value is exceeded, it will invoke the user's email client (such as Outlook) and automatically fill in the email body with the selected download range and sampling rate information. By clicking the send button, users can submit a data download request to the STAM website.","8000.0018":"We support users in uploading 3D image data and neuronal morphology data previously registered to the Common Coordinate Framework (CCF), then mapping it onto STAM, and directly visualizing it in 3D space. We also support reverse mapping, which allows data of the same type that has been registered to STAM to be mapped onto the CCF.","8000.0019":"Users can click the 'Upload' button in the right panel to upload 3D image data or neuronal morphology data that has been previously registered to either the CCF or STAM. After the uploading is completed, selecting the direction of conversion (either from STAM to CCF or vice versa) , select YES or NO for the option “The vertical size of CCF is expanded to 9 mm”in the 'Select the direction of conversion' radio button. Then, click the 'Start' button to start the calculation on the STAM server. At this point, the 'Start' button enters the waiting status.After uploading an SWC file, the slider/input box with the 1-100 μm range becomes available. The user can then adjust the resolution value of the neuron, select YES or NO for the option “The vertical size of CCF is expanded to 9 mm”, and finally click the Start button to perform the computation.","8000.0020":"After waiting for about 10 minutes, the STAM server finishes the calculation and returns the results. At this point, both the 'Save' button and the 'View result' button become clickable. Clicking the 'Save' button allows you to download the results to your local device; clicking the 'View result' button lets you preview the calculation results in the main window.","8000.0021":"We provide services to visualize atlas reslicing from any angle. Users can choose reslicing of STAM at any position and angle of interest, browse the brain regions and nucleus annotations on that reslicing, and jump from this reslicing to the isotropic 1-micron resolution reslicing provided by the STAM arbitrary section service.","8000.0022":"As shown in ①, on the left of the main window is the data panel, which has the same function as the data panel in “Stereotaxic topography visualization”. The central area is the main window.","8000.0023":"As shown in ②, users can also achieve translation and rotation of the atlas reslicing by dragging the sliders. The specific translation and rotation values can be seen in the black-background tip above the slider.","8000.0024":"Users can control the atlas reslicing's translation by left-clicking and dragging the red, green, and blue arrows, respectively. Users can switch from translation mode to rotation mode by pressing the 'R' key on the keyboard. In this mode, the arrows will change to sphere, and dragging these spheres will control the rotation of the atlas reslicing. ","8000.0025":"Users can also achieve translation and rotation of the atlas reslicing by dragging sliders. Users can clicking the “View higher resolution image” button can jump to Arbitrary plane visualization and click the “Requesting STAM labels” button and fill in the license to download 3D label images of isotropic 10 micron resolution STAM atlas.","8000.0026":"We provide services to visualize neuronal circuits of whole mouse brain somas or projection targets. Users can select any neural circuit data with somas or projection targets located in brain region or nuclei of interest, and examine the corresponding brain region and nuclei annotations of the neural circuit.","8000.0027":"As shown in ①, on the left of the main window is the data panel, which has the same function as 'Stereotaxic topography visualization'. The 'Neurons' tab is used to query and filter neuron morphological data with somas or projection targets located in regions of interest.","8000.0028":"As shown in ②, users can search for the brain region or nucleus of interest in the search box.","8000.0029":"As shown in ③, it is a neural circuit connection diagram composed of several brain regions and nucleus substructures.","8000.0030":"Users can click the 'whole brain connectivity diagram' button or search for the brain region or nucleus of interest in the search box to pop up a neural circuit connection diagram composed of several brain regions and nucleus substructures. Different dots represent different brain regions and nuclei, and the name of the brain region or nuclei is displayed next to the dot. Users can hover the mouse over dot or the name of a brain region or nuclei, left and right click the dot.","8000.0031":"Double click any dot representing a brain region or nuclei to hide the neural circuit connection diagram window and return to the main window page, displaying the upstream and downstream connection relationships of that structure. The neural circuits projected to the selected brain area and nucleus are displayed in the Upstream window, and the projection target areas of the selected brain area and nucleus are displayed in the Downstream window. Users can select any number of neurons of interest via checkboxes and visualize them in the main window.","8000.0032":"Query of anatomical structures, cerebral vascular, and neurons","8000.0033":"Visualize anatomical substructures and switch coordinate origin","8000.0034":"Visualization function settings","8000.0035":"Automatic planning mode","8000.0036":"Manual planning mode","8000.0037":"Upload brain slice image and calculate or download registration result","8000.0038":"Function of page jump","8000.0039":"Zoom mode to select the range of original image data and previews the image","8000.0040":"Select the sampling rate of the data and download","8000.0041":"Upload 3D image data and calculate","8000.0042":"Preview or download the result after the calculation is completed","8000.0043":"Translate or rotate the slice of the atlas for sectional view","8000.0044":"Download 3D label images of isotropic 10 micron resolution STAM atlas","8000.0045":"View the neural circuit connectivity diagram and interact","8000.0046":"Display the upstream and downstream connections of any user-appointed brain structure","8000.0047":"ranslation mode to select the range of original image data","5000.7001":"atlas","5000.7002":"first","5000.7003":"second","5000.7000":"(Optional) Upload the second slice, which is previously co-registered to the first uploaded slice","5000.7004":"opacity","5000.7005":"Terminals","5000.7006":"Visibility","5000.7007":"Branchings","5000.7008":"Analysis","5000.7009":"Distribution of neuron terminals","5000.7010":"terminals","5000.7011":"Pattern of neuron projections","5000.7012":"Distribution of projection length","5000.7013":"fliplr","7000.7014":"Also, you can download the ","7000.7015":" plugins for this function. If you want to use the test data, click","7000.7016":" here ","7000.7017":"to download.","7000.7018":"Issue report","7000.7019":"Set as the focus","7000.7020":"Reset the focus","7000.7021":"Reslicing Mode","7000.7022":"Translate","7000.7023":"Rotate","7000.7024":"Control mode","7000.7025":"Display available neurons only","7000.7026":"Click the Color button to modify the neuron color; click the Ana. button to display the analysis results of the neuron's projection pathway; click the Path button to show the brain structures traversed by the neuron on the main window; the Src button displays the source of the neuron data.","7000.7027":"Feedback","7000.7028":"Display line chart and scatter plot","5000.7026":"Request timed out, download failed","5000.7027":"computational failure","5000.7028":"Cannot find a satisfactory path","5000.7029":"Too many regions to avoid, please try again in 3 minutes","5000.7031":"If you haven't applied for the key, you can click it.","8000.00031":"As shown in ④, the toolbars from left to right are: Return to Home, Switch Coronal sections, Switch Sagittal sections, Switch Horizontal sections, Reset View, Display Settings, Feedback.","5000.7030":"Click here to download the queried results","5000.7032":"Neuron registration","5000.7033":"Cloud atlas","5000.7034":"Send successful!","5000.7035":"Server exception","5000.7036":"Hide the cloud atlas of this nuclear group","5000.7037":"View the cloud atlas of this nuclear group","11000.0001":"Year","11000.0002":"Type","5000.7040":"The vertical size of CCF is expanded to 9mm","5000.7041":"YES","5000.7042":"NO","5000.7043":"functionalLoop","5000.7044":"Functional circuit analysis","5000.7045":"AI assistant","5000.7046":"Planning mode:","5000.7047":"Path constraint","5000.7048":"Arbitrary","5000.7049":"Default mode is manual; You can switch to Auto mode to perform intelligent planning","5000.7050":"Please down-sample the slice image to ~10μm/pixel before uploading"},YTn={"2002.0301":"提供基于多人在线协作模式,神经元重建","5000.0112":"取消","2002.0302":"查看数据","5000.0111":"提交","4000.0210":"平移-X","2002.0300":"神经元协同标注平台","5000.0113":"董宏伟命名系统别名","4000.0212":"平移-Z","4000.0211":"平移-Y","4000.0214":"角度-Y","5000.0110":"编辑","4000.0213":"角度-X","4000.0216":"查看高分辨率切片","4000.0215":"角度-Z","4000.0218":"坐标","4000.0217":"左半脑","4000.0219":"基准点","4000.0100":"","4000.0221":"转到冠状面","4000.0220":"大小","4000.0102":"前囟","4000.0223":"转到水平面","4000.0101":"单位:毫米","4000.0222":"转到矢状面","4000.0104":"矢状面","4000.0225":"引导","4000.0103":"冠状面","4000.0224":"转到任意面","2001.0402":"查看数据","4000.0106":"脑解剖结构检索","2001.0401":"探索血管图谱数据库","4000.0105":"水平面","4000.0226":"完成","4000.0108":"脑地图4.0命名系统","4000.0229":"下一步","2001.0403":"血管","4000.0107":"艾伦参考脑命名系统","4000.0228":"跳过","4000.0109":"小鼠脑图谱","2001.0400":"血管图谱","1000.0400":"登录","2002.0202":"查看数据","2002.0200":"配准服务","2002.0201":"提供脑片配准服务","6000.0112":"请输入电子邮箱","6000.0110":"请输入数据用途","6000.0111":"Label图像下载","7000.0108":"开始计算","7000.0109":"下载保存","7000.0106":"计算与上传图像对应的图谱切面","7000.0107":"查看更高分辨率的图像","4000.0201":"解剖结构","4000.0443":"先在左侧选择一个结构","7000.0104":"获取测试图像","4000.0200":"","7000.0105":"上传","4000.0203":"虚拟手术","4000.0445":"在右侧可以拖动截面的位置","7000.0102":"描述","4000.0202":"装配图","4000.0444":"在模型中右击选择你需要的面","7000.0103":"选择上传图像的类型","4000.0205":"展开幅度","7000.0100":"","4000.0204":"图谱切面","4000.0446":"点击查看更高分辨率的图像跳转","7000.0101":"配准服务","4000.0207":"缩放","4000.0206":"步长","2001.0101":"探索立体定位图谱的2D/3D图像信息","4000.0209":"重置","2001.0100":"立体定位图谱","4000.0208":"选择靶点","2001.0102":"查看数据","1000.0302":"联系我们","1000.0303":"帮助","1000.0300":"关于","1000.0301":"简介","4000.0131":"仅显示结构轮廓","4000.0130":"显示图谱","2002.0101":"提供高分辨任意角度切面服务","2002.0102":"查看数据","4000.0132":"核团信息","7000.0113":"上传和下载","7000.0111":"上传的图像","7000.0112":"输出的图像","7000.0110":"如果对这个在线注册工具有任何疑问,欢迎联系atlas@brainsmatics.org","2002.0100":"高分辨任意角度切面服务","6000.0105":"数据用途","6000.0106":"提交","6000.0103":"通讯地址","6000.0104":"电子邮箱","6000.0109":"请输入通讯地址","2000.2001":"图谱和数据","6000.0107":"请输入单位名称","6000.0108":"请输入联系人员","2001.0200":"特定类型细胞分布图谱","6000.0101":"单位名称","6000.0102":"联系人员","2001.0202":"查看数据","2001.0201":"探索特定类型细胞分布图谱的2D/3D图像信息","6000.0100":"","1000.0203":"神经元协同标注平台","1000.0204":"数据共享服务","1000.0200":"工具","1000.0201":"高分辨任意角度切面服务","1000.0202":"配准服务","2000.2002":"服务","2000.0500":"脑图谱","2002.0400":"数据共享服务","4000.0230":"上一步","2002.0401":"Label图像下载服务","4000.0111":"背-腹","4000.0232":"第二步","4000.0110":"前-后","4000.0231":"第一步","4000.0113":"显示","4000.0234":"第四步","4000.0112":"内-外","4000.0233":"第三步","2002.0402":"查看数据","4000.0115":"二维浏览","4000.0236":"在左侧选择一个结构","4000.0114":"三维图谱","4000.0235":'点击"开始"按钮',"4000.0117":"重置为默认视图","4000.0238":'点击"结束"按钮',"4000.0116":"标注","4000.0237":"在选择的结构上左键点击确定注射位点,<br>再通过移动鼠标确定注射方向","4000.0119":"网格线","4000.0118":"信息框","4000.0239":"设置展开长度","4000.0120":"前往","4000.0241":"点击此处图标,选中的结构会展开,<br>再次点击该图标后可以从展开状态中退出","5000.0101":"Paxinos命名系统别名","4000.0240":"设置中心展开的缩小程度","5000.0100":"","4000.0122":"该结构介绍","5000.0103":"参考","4000.0121":"三维浏览器","4000.0242":"清除靶点","5000.0102":"Hof命名系统别名","4000.0124":"缩小","4000.0123":"图示","4000.0126":"重置","4000.0125":"放大","4000.0128":"前往三维浏览器","5000.0109":"化学物质名称","2001.0302":"查看数据","4000.0127":"全屏","5000.0108":"疾病名称","4000.0129":"查看高分辨率图像","5000.0105":"疾病","5000.0104":"基因","2001.0301":"探索神经元形态数据库","5000.0107":"基因名称","2001.0300":"神经元形态数据库","5000.0106":"化学物质","1000.0104":"血管图谱","1000.0100":"脑图谱数据","1000.0101":"立体定位图谱","1000.0102":"特定类型细胞分布图谱","1000.0103":"神经元形态数据库","5000.0001":"脑片配准","5000.0002":"上传图像","5000.0003":"上传失败,请联系管理员","5000.0004":"显示结果","5000.0005":"数据下载","5000.0006":"选取下载范围","5000.0007":"取消选取范围","5000.0008":"预览下载图像","5000.0009":"提示:按A键切换平移和缩放模式","5000.0010":"设置采样倍数","5000.5012":"默认模式","5000.5013":"虚拟手术模式","5000.5014":"图谱映射","5000.5015":"选择转换方向","5000.5016":"颅骨","5000.5018":"下载所选范围","5000.5019":"上传已配准到STAM或CCF的3D图像或swc文件","5000.5020":"将上传数据映射到另一个图谱:","5000.5021":"开始计算","5000.5022":"下载保存","5000.5023":"显示结果","5000.5024":"其它图谱","5000.5025":"设置","5000.5026":"极简模式","5000.5027":"选择注射脑区","5000.5028":"选择注射靶点","5000.5029":"清除注射靶点","5000.5017":"开始智能规划","5000.5030":"规划中","5000.5031":"数据块预估大小:","5000.5032":"显示其他","5000.5033":"控制面板","5000.0019":"也可以按R在旋转模式和平移模式之间切换","5000.5034":"自动","5000.5035":"手动","5000.5057":"显示三维形貌","5000.5056":"隐藏三维形貌","5000.5058":"无法规划路径以避开勾选的结构","5000.5060":"隐藏投射路径","5000.5061":"显示投射路径","5000.5039":"下载{{name}}周围的原始图像","5000.5038":"切换{{name}}为坐标原点","5000.5040":"输入胞体所在脑区简写或全称","5000.5041":"输入投射所在脑区简写或全称","5000.0206":"显示穿过的血管分支","5000.0207":"隐藏穿过的血管分支","5000.0208":"显示被供血的结构","5000.0209":"隐藏被供血的结构","5000.5044":"使用该功能需要一个API Key。目前我们提供了一个临时的测试Key。请点击Go on按钮","5000.5051":"提示:key值将会发送到所填邮箱账号上,请提交完后关注邮箱是否收到信息。","5000.0011":"发送邮件","5000.5043":"填写Key","5000.5042":"申请Key","5000.5045":"提交","5000.5049":"Key值","5000.5070":"申请人","5000.5071":"邮箱","5000.5072":"所属单位","5000.5073":"使用目的","5000.5050":"保存","5000.5052":"神经环路","5000.5053":"请输入待查询的结构","5000.5047":"提交失败","5000.5048":"提交成功","5000.5054":"上游结构","5000.5055":"下游结构","5000.5083":"步骤一","5000.5084":"步骤二","5000.5085":"设置展开长度","5000.5080":"单击此处的图标以展开所选结构。再次单击图标将允许您退出展开状态","5000.5081":"选择左侧的结构","5000.5082":"请选择注射模式,如果选择自动模式,点击左侧细胞名称选择细胞核进行计算","5000.5086":"对话STAM","5000.6001":"输入一个待查询结构,可视化其连接图谱。可以试着填入 ","5000.6002":"语言切换","5000.0012":"当前下载文件已超出服务器传输限制,您可以选择降低采样等级或者发送邮件,是否发送邮件?","5000.6003":"投射路径","5000.6004":"隐藏该神经元","5000.6005":"冠状视图","5000.6006":"矢状视图","5000.6007":"水平视图","5000.6008":"点击下方按钮,申请下载各向同性10微米分辨率的STAM图谱3D标签图像","5000.6009":"请求STAM标签","5000.6010":"提示:下载所用的许可号将会发送到您所填写的邮箱,请在提交结束后关注是否收到包含许可号的邮件。","5000.6011":"请注意,使用此功能需要提供下载许可号,如果您没有下载许可号,请点击下方按钮向我们申请","5000.6012":"申请下载许可号","5000.6013":"填写下载许可号","5000.6014":"许可号","5000.6015":"查询位于或投射到该结构的神经元","5000.6019":"浏览 {{focusVirusLineItem}} 的知识库页面","5000.6020":"浏览 {{focusVirusLineItem}} 的父结构 {{lableValue}} 的知识库页面","5000.6016":" RGB值","5000.6017":"所属脑区","5000.6018":"查看更高分辨率图像","5000.6021":"隐藏该分支","5000.6022":"设置 {{lableStr}} 的包围盒为下载范围","5000.6023":"隐藏 {{name}} 的三维形貌","5000.6024":"显示 {{name}} 的三维形貌","5000.6025":"切换到冠状面","5000.6026":"切换到矢状面","5000.6027":"切换到水平面","5000.6028":"切换到任意角度切面","5000.6029":"探索由单神经元投射所构成的","5000.6030":"全脑连接范式图","5000.6031":"。您也可以:","5000.6032":"","5000.6033":"上传脑片图像,或使用","5000.6034":"的测试脑片图像:","5000.6035":"上传已配准到STAM或CCF的3D图像或swc文件,或使用测试","5000.6036":"3D图像","5000.6037":"swc文件:","5000.6038":"数据来源: {{name}}","5000.6039":"平颅方位","5000.6040":"投射丰富","5000.6041":"新标注","5000.6042":"关闭","5000.6043":"启用","5000.6044":"网格","5000.6045":"脑外轮廓","5000.5087":"步骤三","5000.5088":"步骤四","8000.0001":"如①所示,在主窗口左侧的是数据面板,用户可以在该选项卡下选择STAM的解剖命名树,配准到STAM上的完整脑血管图谱和神经元数据。用户也可以切换两个不同版本的命名系统。","8000.0002":"如②所示,主窗口中可以加载脑区、核团的三维模型。","8000.0003":"如③所示,用户可以切换不同的模式或者功能模块","8000.0004":"Regions选项卡包含的是STAM的解剖命名树,用户可以在该选项卡下的复选框中选择任意数量的感兴趣结构,在主窗口中可视化;Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。","8000.0005":"用户可以点击Regions选项卡下的解剖命名树中蓝色的方块图标,此时主窗口中会以组装的形式可视化用户点击结构的所有子结构,同时展开幅度可在右侧面板设置。默认情况下,该坐标系统以Bregma点作为原点。户也可以将坐标原点切换为STAM的其它任意19个颅骨或颅内基准点,主窗口中可视化对象的坐标值将根据新的原点重新计算。右击任意基准点,可以保存以基准点为坐标原点的STAM标签图像。","8000.0006":"用户可以在页面底部切换到setting选项卡。Left hemisphere开关决定是否展示左半脑,默认为Off。Coordinate开关决定是否在主窗口中显示坐标数值,默认为On。Datum Marks开关决定是否在主窗口中显示基准点,默认为On。Cranial开关决定是否在主窗口中显示颅骨的三维轮廓,默认为Off。","8000.0007":"我们提供了虚拟手术导航服务,用户可以通过交互操作,模拟向小鼠脑注射病毒的立体定位手术过程。STAM会根据用户操作,返回注射位点与作为坐标原点的颅骨或颅内基准点之间的距离和注射角度信息。","8000.0008":"首先,选择注射的大脑区域。接着,在所选的大脑区域上选择注射目标。目标选定后,一个绿色点会出现在该大脑区域三维模型的表面,并随着鼠标光标移动。同时,Clear Target 按钮会变为可用状态,用户可根据需要更改注射目标。随后,点击 Auto 按钮进入自动模式,此时左侧数据面板中的 Structure for injecting 标签会变为 Regions to avoid。通过点击需要避开的脑区或核团名称,所选文本会以鲜红色高亮显示,同时这些结构的三维轮廓会在主窗口中呈现。接下来,点击右侧面板上的 Intellectual planning 按钮即可启动计算。几秒钟后,STAM 会生成一条路径,该路径从注射目标出发,并避开所有用户所选择的大脑区域和核团。","8000.0009":"如果用户选择 “Manual” 进入手动规划模式,已标记的注射目标会变为一个蓝点。与此同时,Clear Target 按钮会变为可用状态,用户可根据需要更改注射目标。目标设定后,一条红色虚线会从注射目标出发,延伸到当前鼠标位置。这条虚线与 STAM 轮廓的交点(即注射入口点)会以绿色标记。用户可以根据需要选择 Path constraint 中的不同选项进行注射。当用户确定合适的注射路径后,可以通过鼠标左键点击进行标记。被标记的路径将在主窗口中显示为一条蓝色实线,注射入口点则显示为一个蓝色圆锥。路径经过的大脑区域和核团的名称会按照其空间位置沿蓝色实线路径依次排列。右侧面板会显示关于注射路径与三个标准解剖方向之间的角度、注射目标以及注射入口点的信息。如果用户希望重新开始整个虚拟手术过程,可以点击右侧面板中的 “Reset” 按钮。","8000.0011":"如①所示,用户可上传PI或DAPI染色的单张脑片图像,该服务将通过约1分钟的服务器端计算,从STAM中重切出一张与用户上传的脑片位置最接近的图谱切面,并根据计算出来的角度和位置显示在主窗口中。","8000.0012":"用户可以从本地上传待配准的tif/tiff格式的二维脑片图像。然后选择上传图像的类型。接着点击Calculate the corresponding plane from the atlas按钮组中的Start按钮,等待后台返回计算结果。计算完成后,Start按钮下方会出现计算结果的预览图,可左键单击放大查看。Start按钮右侧的Save按钮此时也变为可点击,用户单击该按钮,可以将计算结果下载到本地。","8000.0013":"在主窗口右击相应的脑区、核团,可以跳转到任意剖面可视化和脑解剖知识库页面。","8000.0014":"如①和②所示,用户可以在STAM所在的三维空间中选取任意感兴趣范围,并以不同的采样倍数下载自己选取范围内的原始图像。","8000.0015":"用户可以点击“Select the range”按钮,然后主窗口中出现一个橙色线条的方框。用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制方框在各个方向上的平移,当某个方向的箭头被用户选中时,该箭头会变为高亮的黄色。","8000.0016":"用户也可以通过按下键盘上的“A”,将范围选取操作从平移模式切换为缩放模式。此时方框的箭头会变为方块,拖动方块,就可以改变方框的大小。经过上述操作明确了待下载数据的空间范围后,可以点击“预览下载图像”按钮,通过体绘制,在主窗口中对该范围内的图像进行可视化。","8000.0017":"拖动“Set the downsampling rate”滑动条,用户可以选择待下载数据的采样倍数;具体的倍数值可通过滑块上方的黑色背景提示文字查看。当数据量没有超过1 GB时,点击Downloading按钮可直接下载;当超过该数值,点击Downloading按钮会唤起用户终端的邮箱管理工具(如Outlook等),并自动将待下载范围和采样倍数信息填入邮件中,此时用户点击邮件发送按钮,即可向STAM网站发送数据下载申请。","8000.0018":"我们支持用户上传此前已经配准到Common Coordinate Framework(CCF)的三维图像数据和神经元完整形态数据,并将其映射到STAM上,并直接在三维空间中进行可视化;我们也支持反向映射,即将已经配准到STAM的同类型数据映射到CCF上。","8000.0019":"用户点击右侧面板的Upload按钮,上传已配准到CCF或者STAM的三维图像数据或神经元形态学数据。上传结束后,在Select the direction of conversion单选框中,确定数据的映射方向是从STAM到CCF还是反过来。此后点击Start按钮,STAM的服务器端开始计算,Start按钮变为等待状态。当上传swc文件,1-100微米标准的滑动条/输入框变为可操作状态,用户可调整该神经元的分辨率数值,然后CCF的垂直方向尺寸已扩展到9mm项选择YES或者NO,最后点击Start按钮进行计算。","8000.0020":"等待约10分钟后,STAM的服务器端完成计算并返回结果。此时Save按钮和View result按钮均变为可点击状态。点击Save按钮,可以将计算结果下载到本地;点击View result按钮,可以在主窗口中预览计算结果。","8000.0021":"我们提供了沿任意角度可视化脑图谱切面的服务。用户可以查看感兴趣的STAM任意位置和角度的切面,浏览该切面上的脑区、核团标注,并由该图谱切面跳转到STAM任意切面服务所提供的各向同性1微米分辨率切面。","8000.0022":"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同。位于正中区域的是主窗口。","8000.0023":"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。具体的平移、旋转数值可通过滑块上方的黑色背景提示文字查看。","8000.0024":"用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制图谱切面的平移。用户也可以通过按下键盘上的“R”,将范围选取操作从平移模式切换为旋转模式。此时箭头会变为球形,沿球形拖动,就可以控制图谱切面的旋转。","8000.0025":"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。点击viewer higher resolution image按钮可以跳转到任意剖面可视化界面。点击Requesting STAM labels按钮,填入许可证即可下载各向同性10微米分辨率的STAM图谱3D标签图像。","8000.0026":"我们提供全脑的胞体或投射靶区的神经环路数据可视化服务。用户可以选择感兴趣的任意胞体或投射靶区在脑区、核团的神经环路数据,并查看数据对应的脑区、核团标注。","8000.0027":"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同,其中Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。","8000.0028":"如②所示,用户可以在搜索框中搜索感兴趣脑区、核团。","8000.0029":"如③所示,这是一个由若干个脑区、核团子结构组成的神经环路连接示意图。","8000.0030":"用户可以点击“whole-brain connectivity diagram”按钮或在搜索框中搜索感兴趣脑区、核团,即可弹出由若干个脑区、核团子结构组成的神经环路连接示意图。不同圆点表示不同的脑区、核团结构,圆点旁边显示的是脑区、核团的名称。用户可以将鼠标移动到圆点、脑区或核团的名称上,左击或右击圆点。","8000.0031":"双击任意一个代表某个脑区、核团结构的圆点,神经环路连接示意图窗口隐藏,回到主窗口页面,显示该结构的上下游连接关系。在Upstream窗口中展示了投射到选中脑区、核团的神经环路,在Downstream窗口中展示了选中脑区、核团的投射靶区。用户可以用复选框选择任意数量的感兴趣神经元,在主窗口中可视化。","8000.0032":"解剖结构、脑血管和神经元查询","8000.0033":"可视化解剖子结构并切换坐标原点","8000.0034":"可视化功能设置","8000.0035":"自动导航模式","8000.0036":"手动导航模式","8000.0037":"上传脑片图像并计算或下载配准结果","8000.0038":"页面跳转功能","8000.0039":"缩放模式选择原始图像数据的范围并预览图像","8000.0040":"选择数据的采样倍数并下载","8000.0041":"上传三维图像数据并计算","8000.0042":"计算完成后预览或下载结果","8000.0043":"平移或旋转图谱切面","8000.0044":"下载高分辨率的STAM图谱3D标签图像","8000.0045":"查看神经环路连接示意图并交互","8000.0046":"显示用户指定脑区上下游连接关系","8000.0047":"平移模式选择原始图像数据的范围","8000.0048":"","5000.7001":"图谱","5000.7002":"脑片1","5000.7003":"脑片2","5000.7000":"(可选)上传第二张脑片图像,默认该图像已经配准到了第一张上传的脑片图像上","5000.7004":"阻光度","5000.7005":"末梢点","5000.7006":"可见性","5000.7007":"分支点","5000.7008":"分析","5000.7009":"神经元末梢分布","5000.7010":"末梢点","5000.7011":"神经元投射模式","5000.7012":"投射长度分布","5000.7013":"左右翻转","7000.7014":"您也可以在此下载","7000.7015":"的插件;您可能需要使用测试数据,请","7000.7016":"在此","7000.7017":"下载。","7000.7018":"报告问题","7000.7019":"设置为焦点","7000.7020":"重置焦点","7000.7021":"重切片模式","7000.7022":"平移 ","7000.7023":"旋转","7000.7024":"控制模式","7000.7025":"只展示可用神经元","7000.7026":"点击Color按钮,修改神经元颜色;点击Ana.按钮,显示神经元投射路径分析结果;点击Path按钮,在主界面显示神经元经过的脑结构;Src按钮展示了神经元数据的来源","7000.7027":"反馈","7000.7028":"显示折线图和点状图","5000.7026":"请求超时,下载失败","5000.7027":"计算失败","5000.7028":"没有合适的路径","5000.7029":"请求过于频繁,请3分钟之后再试","5000.7030":"点此下载查询结果","5000.7031":"如果你没有申请过key可以点击","5000.7032":"神经元配准","8000.00031":"如④所示,工具栏从左到右依次是,回到首页、切换冠状面、切换矢状面、切换水平面、重置视角、显示设置、反馈。","5000.7033":"文献云图","5000.7034":"发送成功!","5000.7035":"服务端异常","5000.7036":"隐藏该核团的文献云图","5000.7037":"查看该核团的文献云图","11000.0001":"年份","11000.0002":"类型","5000.7040":"CCF的垂直方向尺寸已扩展到9mm","5000.7041":"是","5000.7042":"否","5000.7043":"功能环路","5000.7044":"功能环路分析","5000.7045":"AI 助手","5000.7046":"路径规划模式:","5000.7047":"路径限制","5000.7048":"任意角度","5000.7049":"默认模式为手动;您也可以切换到自动模式,执行【自动规划】","5000.7050":"请将图像采样到10微米/像素后再上传"},KTn="en_us",JTn={zh_cn:"zh",en_us:"en"},kXe=localStorage.getItem("lang")||KTn,QTn=JTn[kXe]||"en";localStorage.setItem("lang",kXe);Nf.use(wTn).init({resources:{en:{translation:qTn},zh:{translation:YTn}},lng:QTn,fallbackLng:"en",interpolation:{escapeValue:!1}});const{Content:e4n}=hD;var Zh=new Ere({antialias:!0,logarithmicDepthBuffer:!0});Zh.localClippingEnabled=!0;var t4n=new c1(window.innerWidth-450,window.innerHeight);const iq=new dTn(Zh,t4n);let xIe;new OXe(pTn);let n4n=new URL(window.location.href),Vm=new URLSearchParams(n4n.search),_Ie=Vm.get("datumMarkVisibility"),wIe=Vm.get("regionsChecked"),TIe=Vm.get("vesselsChecked"),IIe=Vm.get("neuronsChecked");Vm.get("leftHemisphereVisibility");let AIe=Vm.get("terminalVisibility"),RIe=Vm.get("branchingVisibility"),OIe=Vm.get("branchingColor"),LIe=Vm.get("gridVisibility"),NIe=Vm.get("echart_Value"),MIe=Vm.get("leftTabIndex");const r4n=t=>{const{atlasTopography:e,cerebralVessels:n,datumMarks:r,atlasColormap:i,atlasOntology:a,resourceTab:o,toolTab:s,ScaleNum:l,lang:u,home:d,ServerUrl:f}=t,{t:p}=OTn(),h=S.useRef({}),g=S.useRef(null),y=S.useRef(new sIe(Vi.current,Zh.domElement)),[v,m]=S.useState(1),b=S.useRef(1),[E,C]=S.useState(_Ie?JSON.parse(_Ie):!0),x=S.useRef(null),_=S.useRef(null),A=S.useRef([]),P=S.useRef(null),R=S.useRef(null),N=S.useRef(!1),D=S.useRef(!1),[U,z]=S.useState(!0),[B,j]=S.useState([]),V=S.useRef(2),[G,W]=S.useState(""),Z=S.useRef([]),H=S.useRef([]),X=S.useRef(new va),[ee,K]=S.useState("nucleusColour"),Y=S.useRef(1),Q=S.useRef(null),[re,ne]=S.useState(!0),oe=S.useRef(),de=S.useRef(),ue=S.useRef(),pe=S.useRef(),[ie,Se]=S.useState(wIe?JSON.parse(wIe):[]),[ae,ve]=S.useState(TIe?JSON.parse(TIe):[]),[fe,Re]=S.useState(IIe?JSON.parse(IIe):[]),ze=S.useRef(Gn=>new Ie),[Je,Fe]=S.useState(!1),Te=S.useRef(new Ie),[qe,me]=S.useState(new Ie),[he,Ve]=S.useState(MIe?parseInt(MIe):1),Pe=S.useRef(!1),[Ue,at]=S.useState(!1),Ke=S.useRef(""),[Ze,ct]=S.useState(3),yt=S.useRef(null),wt=S.useRef([]),[lt,dt]=S.useState(""),We=S.useRef(()=>{}),[rt,mt]=S.useState(1),Me=S.useRef(1),[ft,Yt]=S.useState({}),[Ht,At]=S.useState(""),Zt=S.useRef({}),[tn,bn]=S.useState(""),[Pn,Dn]=S.useState(""),[qn,Rr]=S.useState({}),[Br,Jn]=S.useState(NIe||""),[Vt,Wn]=S.useState(!1),[mn,hr]=S.useState(0),[gr,ht]=S.useState({}),Ft=S.useRef({}),[gn,$e]=S.useState(LIe?JSON.parse(LIe):!0),[St,Lt]=S.useState([]),[Pt,Rt]=S.useState([]),[Wt,Bt]=S.useState([]),[Qt,On]=S.useState(!1),[qt,zt]=S.useState({});localStorage.setItem("lang",u||"en"),Zi.current=l,So.current=-5.7,Ka.current=-6,po.current=-7.0055;const[nn,Nn]=S.useState([]),kn=S.useRef({start:RIe?JSON.parse(RIe):!0,end:AIe?JSON.parse(AIe):!0,start_color:OIe||"#A7B5A1"});S.useEffect(()=>{var Si;be.current=new LM,Vi.current=new Id(45,(window.innerWidth-450)/window.innerHeight,.01,1e4),Vi.current.position.set(18,-10,-10),Vi.current.up.set(0,-1,0),Vi.current.lookAt(new Ie(0,0,0)),b3.current=new z_(16777215,4.5,0,.04),b3.current.position.set(18,-10,-10),be.current.add(b3.current),be.current.background=new Ir("#fff"),(Si=g.current)==null||Si.appendChild(Zh.domElement),Zh.setSize(window.innerWidth-450,window.innerHeight),y.current=new sIe(Vi.current,Zh.domElement);let Gn=new URL(window.location.href),fr=new URLSearchParams(Gn.search),pi=fr.get("cameraInfo"),hi=fr.get("controllerInfo");if(pi&&hi){let or=JSON.parse(pi),Er=JSON.parse(hi);Vi.current.position.set(or.cameraPosition.x,or.cameraPosition.y,or.cameraPosition.z),b3.current.position.set(or.cameraPosition.x,or.cameraPosition.y,or.cameraPosition.z),Vi.current.rotation.set(or.cameraRotation.x,or.cameraRotation.y,or.cameraRotation.z),y.current.reset(),y.current.target.set(Er.controlsTarget.x,Er.controlsTarget.y,Er.controlsTarget.z),y.current.object.position.set(Er.controlsPosition.x,Er.controlsPosition.y,Er.controlsPosition.z),y.current.object.up.set(Er.controlsUp.x,Er.controlsUp.y,Er.controlsUp.z),y.current.update(),Vi.current.updateMatrixWorld()}y.current.rotateSpeed=10,y.current.zoomSpeed=6,y.current.minDistance=1,y.current.maxDistance=6e3,y.current.staticMoving=!0,y.current.addEventListener("change",function(or){b3.current.position.set(Vi.current.position.x,Vi.current.position.y,Vi.current.position.z);const Er=JSON.stringify({cameraPosition:Vi.current.position,cameraRotation:Vi.current.rotation}),ni=JSON.stringify({controlsTarget:y.current.target,controlsPosition:y.current.object.position,controlsUp:y.current.object.up});let Zn=new URL(window.location.href),Gr=new URLSearchParams(Zn.search);Gr.set("cameraInfo",Er),Gr.set("controllerInfo",ni),Zn.search=Gr.toString(),window.history.replaceState({},"",Zn)}),window.addEventListener("resize",cr),window.addEventListener("wheel",En),document.addEventListener("contextmenu",function(or){or.preventDefault()}),xIe=new fTn(be.current,Vi.current),iq.addPass(xIe),sr(),f&&kr(f),fetch("/app-api/p2p-api/folders").then(or=>{if(!or.ok)throw new Error(`HTTP error! Status: ${or.status}`);return or.json()}).then(or=>{if(or.code===200){let Er=[{title:"Local",value:"0",key:"0",children:[]},{title:"Web",value:"1",key:"1",children:[]}];or.data.forEach(ni=>{const Zn={title:ni.path,key:ni.name,value:ni.path};ni.path.length>46?Er[1].children.push(Zn):Er[0].children.push(Zn)}),Nn(Er)}}).catch(or=>{console.error("Fetch error:",or)})},[]),S.useEffect(()=>{Cr(Wt)},[Wt]);const Cr=Gn=>{fetch("/app-api/p2p-api/swctree",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:Gn}),redirect:"follow"}).then(fr=>fr.json()).then(fr=>{Rt(fr.data.swctree),zt(fr.data.soma_axon_data)}).catch(fr=>console.log("error",fr))};S.useEffect(()=>{let Gn=new URL(window.location.href),fr=new URLSearchParams(Gn.search);fr.set("leftTabIndex",String(he)),Gn.search=fr.toString(),window.history.replaceState({},"",Gn)},[he]);async function kr(Gn){try{const fr=await fetch(Gn);if(!fr.ok)throw new Error("Network response was not ok "+fr.statusText);const pi=await fr.json();pi.code===200?Lt(pi.data):console.error("Failed to fetch tab:",pi.message)}catch(fr){console.error("Error fetching data:",fr),alert("接口不可用,请检查服务器状态。")}}const cr=()=>{Zh.setSize(window.innerWidth-450,window.innerHeight),Vi.current.aspect=(window.innerWidth-450)/window.innerHeight,Vi.current.updateProjectionMatrix()},En=()=>{y.current.update();const Gn=Vi.current.position;let fr=be.current.getObjectByName("DR-anterior");if(fr){const pi=Gn.distanceTo(fr.position);for(let hi in h.current)h.current[hi].contentobj.children.forEach(or=>{or.levels.forEach((Er,ni)=>{ni===0?Er.object.visible=pi<9:ni===1&&(Er.object.visible=pi>=9)})});be.current.traverse(function(hi){hi.name==="lineNameMesh"&&hi.type==="Mesh"&&(pi<9&&pi>=6?hi.scale.x!=.3&&hi.scale.set(.3,.3,.3):pi<6?hi.scale.x!=.2&&hi.scale.set(.2,.2,.2):hi.scale.x!=.5&&hi.scale.set(.5,.5,.5))})}},sr=()=>{requestAnimationFrame(sr),y.current.update(),Vi.current.updateMatrixWorld(),be.current.traverse(function(Gn){Gn.name==="lineNameMesh"&&Gn.type==="Mesh"&&(Gn.up.set(0,-1,0),Gn.rotation.copy(Vi.current.rotation))}),iq.render()},Vn=Gn=>{Ve(Gn),V.current=Gn},Fn=Gn=>{mt(Gn.target.value),Me.current=Gn.target.value};return S.createElement(hD,{className:"content",style:{overflowX:"hidden"}},S.createElement(e4n,{className:"Box3D",style:{height:"100%",display:"flex"}},S.createElement("div",{style:{height:"calc(100vh - 5px)",overflowY:"auto",background:"#fff",padding:10,position:"relative",borderRight:"1px solid #ccc"}},S.createElement(gg,{onChange:Vn,activeKey:he.toString(),style:{width:300},defaultActiveKey:"1"},o.includes("label")?S.createElement(I5,{forceRender:!0,tab:Y.current==2?Ze===2?"Regions to avoid":"Structure for injecting":"Regions",key:String(o.indexOf("label")+1)},S.createElement(XN,{regionData:e,tasktype:"task3D",ref:oe,setdatum:C,offset_factor_R:b,vesselObj:h,treeDatas:a,type:"fbx",leftTreeRef:_,resourceTab:o,baozhaRef:x,needBaozha:!0,offset_factor:v,renderer:Zh,axis_font:A,t:p,json_name:ee,title:"Regions",showimage:re,setCheckItems:Se,checkItems:ie,outflag:Je,clickPoint:Te,setendPoint:me,automaticGroup:wt,mode:rt,echartValue:Br,setEchartValue:Jn,updatePage:ft,auxRef:de})):null,o.includes("vessel")?S.createElement(I5,{forceRender:!0,tab:Ze===2?"Vessels to avoid":"Vessels",key:String(o.indexOf("vessel")+1)},S.createElement(XN,{regionData:e,tasktype:"task3D",ref:ue,offset_factor_R:b,offset_factor:v,vesselObj:h,treeDatas:n,type:"vessel",axis_font:A,t:p,renderer:Zh,title:"Vessel",setdatum:function(Gn){throw new Error("Function not implemented.")},json_name:"",setCheckItems:ve,checkItems:ae,clickPoint:Te,automaticGroup:wt,mode:rt})):null,o.includes("neurons")?S.createElement(I5,{forceRender:!0,disabled:Ze===1,tab:"Neurons",key:String(o.indexOf("neurons")+1)},S.createElement(XN,{regionData:e,tasktype:"task3D",ref:pe,offset_factor_R:b,offset_factor:v,vesselObj:h,treeDatas:Pt,fbxTreeDatas:a,type:"swc",axis_font:A,t:p,renderer:Zh,title:"Neuron",setdatum:function(Gn){throw new Error("Function not implemented.")},json_name:"",swclist:[],metadata:!1,setCheckItems:Re,checkItems:fe,clickPoint:Te,mode:rt,axon_check:qt,swcnameMesh:Zt,childRef:oe,PointShow:kn,Selected:Wt,setSelected:Bt,setFormshow:On,Selectoptions:nn,formshow:Qt})):null,St.map((Gn,fr)=>S.createElement(I5,{forceRender:!0,tab:Gn.name,key:fr+3},S.createElement("p",null,Gn.name))))),S.createElement(cDe,{datum:E,regionData:e,renderer:Zh,controls:y,vesselObj:h,pointDatas:r,currentRef:g,setHrefStr:W,menutagShow:U,setMenuTagShow:z,angleRef:P,jiaoduRef:R,menuTag:B,axis_font:A,startselect:N,mouseflag:D,linemeshs_jing:X,points:Z,points2:H,activetabIndex:Y,fetchCoordinateFunc:ze,checkItems:ie,outflag:Je,clickPoint:Te,setoutflag:Fe,endPoint:qe,outflagRef:Pe,setShowModeChoose:at,virusModeValue:Ke,pipelineClickEvent:yt,focusVirusLineItem:lt,setFocusVirusLineItem:dt,responsefunc:We,mode:Me,childRef:oe,setUpdatePage:Yt,t:p,setSwcItem:At,swcItem:Ht,swcnameMesh:Zt,axon_check:qt,automaticGroup:wt,setCheckItems:Se,vesselRef:ue,swcRef:pe,setLableStr:Dn,setVesselStr:bn,vesselStr:tn,lableStr:Pn,tabIndex:V,updatePage:ft,sectionsInfoRef:Ft,setSectionsInfo:ht,gray_value:i,Luguchecked:mn,gridShow:gn,setNodeStr:Rr}),s.length!=0?S.createElement(vWe,{regionData:e,lefttab:o,righttab:s,ref:de,renderer:Zh,controls:y,offset_factor_R:b,setoffset_factor:m,baozhaRef:x,hrefStr:G,leftTreeRef:_,centerRef:g,childRef:oe,angleRef:P,jiaoduRef:R,mouseflag:D,menutagShow:U,setMenuTag:j,t:p,startselect:N,linemeshs_jing:X,points:Z,points2:H,activetabIndex:Y,material:Q,setShowimage:ne,checkItems:ie,fetchCoordinateFunc:ze,setoutflag:Fe,outflag:Je,clickPoint:Te,setendPoint:me,outflagRef:Pe,setdatum:C,datum:E,axis_font:A,modeChoose:Ue,setShowModeChoose:at,virusModeValue:Ke,setShowTabNums:ct,pipelineClickEvent:yt,automaticGroup:wt,focusVirusLineItem:lt,setMenuTagShow:z,responsefunc:We,mode:rt,setCheckItems:Se,setLeftMenuTabIndex:Ve,updatePage:ft,swcItem:Ht,axon_check:qt,swcnameMesh:Zt,vesselRef:ue,setMode:mt,vesselStr:tn,lableStr:Pn,swcRef:pe,setShowSettingModal:Wn,showSettingModal:Vt,fbxTreeDatas:a,composer:iq,echartValue:Br,setEchartValue:Jn,setSectionsInfo:ht,sectionsInfo:gr,sectionsInfoRef:Ft,gray_value:i,setLuguchecked:hr,Luguchecked:mn,setGridShow:$e,PointShow:kn,nodeStr:qn}):null,S.createElement(pXe,{t:p,home:d,controls:y,setUpdatePage:Yt,setShowSettingModal:Wn,auxRef:de,activetabIndex:Y,index:!1,setFormshow:On,Selectoptions:nn}),s.length==0?S.createElement(_a.Group,{value:rt,onChange:Fn,style:{position:"absolute",right:0,background:"#fff",padding:10,borderLeft:"1px solid rgb(225, 218, 218)"}},S.createElement(_a,{style:{width:131},value:0},p("5000.5026")||"极简模式"),S.createElement(_a,{style:{width:131},value:1},p("5000.5012")||"普通模式"),S.createElement(_a,{style:{width:131},value:2},p("5000.5013")||"病毒标记模式")):null))},i4n=new jS,a4n=S.memo(t=>{const{functionLoopSwcData:e,t:n}=t,[r,i]=S.useState([]),a=S.useRef({}),[o,s]=S.useState({}),l=async g=>{if(!a.current[g]){p([...r,g]),setTimeout(()=>{l(g)},500);return}if(i(v=>v.includes(g)?v:[...v,g]),!a.current[g].visible)d(a.current[g],g),a.current[g].visible=!0;else{const v=be.current.getObjectByName("functionLoopGroup");if(v){const m=v.children.filter(b=>b.userData.fathername===g);for(let b=0;b<m.length;b++)v.remove(m[b])}a.current[g].visible=!1}s({})},u=[{title:"Name",dataIndex:"name",render:g=>S.createElement("a",null,g)},{title:"Path",dataIndex:"img",align:"center",width:50,render:(g,y)=>S.createElement(qi,{placement:"right",title:n("5000.6003")||"投射路径"},S.createElement("svg",{width:"20px",height:"20px",viewBox:"0 0 200 200",version:"1.1",xmlns:"http://www.w3.org/2000/svg",cursor:"pointer",pointerEvents:y.show?"auto":"none",onClick:v=>{l(y.name)}},S.createElement("g",{id:"#1296dbff"},S.createElement("path",{fill:a.current[y.name]&&a.current[y.name].visible?"#1296db":"#515151",opacity:"1.00",d:" M 49.85 22.81 C 59.71 14.23 76.52 14.87 85.29 24.74 C 87.48 27.08 88.68 30.09 90.41 32.73 C 91.80 33.49 93.46 33.21 94.98 33.33 C 111.66 33.26 128.35 33.27 145.03 33.31 C 156.32 33.34 168.08 37.82 175.15 46.90 C 184.45 58.34 185.39 75.18 179.31 88.32 C 175.60 95.86 169.21 102.22 161.27 105.20 C 155.18 107.71 148.53 108.28 142.00 108.29 C 112.98 108.27 83.95 108.30 54.93 108.29 C 47.32 108.11 39.18 111.60 35.74 118.72 C 31.96 126.77 32.58 137.41 38.92 144.04 C 43.19 148.73 49.91 149.96 55.98 150.00 C 72.33 150.03 88.68 149.95 105.04 150.04 C 106.56 150.01 108.10 150.00 109.60 149.65 C 111.78 145.95 113.50 141.75 117.13 139.15 C 126.54 131.15 141.94 131.52 150.80 140.19 C 153.70 142.84 155.15 146.56 157.28 149.78 C 164.10 150.58 171.02 149.34 177.82 150.39 C 184.67 152.33 185.10 163.99 178.15 166.09 C 171.31 167.70 164.18 165.87 157.29 167.06 C 155.14 170.31 153.62 174.04 150.68 176.70 C 140.24 186.50 121.13 185.09 112.96 173.05 C 111.06 170.87 110.76 166.29 107.04 166.72 C 93.69 166.66 80.35 166.74 67.00 166.71 C 57.97 166.58 48.53 167.54 39.99 163.97 C 31.40 160.72 23.97 154.20 20.28 145.72 C 13.84 131.17 16.41 112.32 28.35 101.31 C 36.18 93.81 47.48 91.52 58.00 91.71 C 87.34 91.67 116.69 91.78 146.03 91.68 C 153.59 91.69 161.48 87.76 164.60 80.60 C 168.03 72.44 167.24 61.77 160.57 55.44 C 156.20 51.22 149.90 49.98 144.02 50.00 C 128.01 49.96 112.00 50.06 95.99 49.95 C 94.12 49.98 92.23 49.93 90.41 50.34 C 88.22 54.05 86.50 58.25 82.87 60.85 C 73.46 68.85 58.08 68.47 49.22 59.81 C 46.25 57.21 44.85 53.43 42.73 50.21 C 35.91 49.42 28.99 50.67 22.20 49.60 C 15.26 47.64 14.91 36.10 21.94 33.95 C 28.72 32.23 35.86 34.16 42.71 32.94 C 44.97 29.49 46.61 25.52 49.85 22.81 M 63.32 34.12 C 56.99 36.45 57.07 46.16 62.70 49.22 C 65.17 50.16 68.00 50.11 70.52 49.39 C 73.84 47.68 75.46 43.66 74.83 40.07 C 74.41 34.85 67.77 32.10 63.32 34.12 M 130.37 150.45 C 125.27 151.88 123.75 158.64 126.14 162.91 C 128.25 166.43 133.18 167.23 136.81 165.90 C 141.61 164.64 142.31 158.29 140.69 154.36 C 139.16 150.30 134.12 149.42 130.37 150.45 Z"}))))},{title:"Src.",dataIndex:"image",render:(g,y)=>{const v=y.type;return S.createElement(qi,{placement:"right",title:n("5000.6038",{name:v})||'数据来源"'+v+'"'},S.createElement("a",{href:y.url,target:"_blank"},S.createElement("img",{src:y.image,width:"20px",height:"20px"})))}}],d=(g,y)=>{if(Object.keys(g).length>0){const v=Vi.current.position;let m=be.current.getObjectByName("DR-anterior"),b=0;m&&(b=v.distanceTo(m.position));for(let E in g){if(E==="visible")continue;let{point:C,color:x}=g[E];i4n.load("/staticresource/fonts/helvetiker_bold.typeface.json",function(_){const A=new W6(E.replace("_111",""),{font:_,size:.3,height:.01}),P=new Dl({color:x,specular:0,shininess:0}),R=new ar(A,P),N=b<6?.2:b<9?.3:.5;R.scale.set(N,N,N),R.position.set(C[0]*.01,C[1]*.01,C[2]*.01),R.name="functionSwcText",R.userData.name=E.replace("_111",""),R.userData.fathername=y,R.translateY(Ka.current),R.translateZ(po.current),R.translateX(So.current),A.center();const D=be.current.getObjectByName("functionLoopGroup");D&&D.add(R)})}}},f=(g,y,v,m,b)=>{const E=document.getElementById("spinner");E&&(E.style.display="block"),fetch(g).then(C=>C.json()).then(C=>{let x=Ka.current,_=So.current,A=po.current,P=new eu;const R=new eu;let N=[],D=[];const U={};for(let Q=0;Q<Object.keys(C.length).length;Q++){const re=Object.keys(C.length)[Q];let ne=C.line.findLastIndex(oe=>oe.end_name===re);ne>-1&&(U[re]={},U[re].point=[C.position[C.line[ne].end].x,C.position[C.line[ne].end].y,C.position[C.line[ne].end].z],U[re].name=re,U[re].color=b===0?"rgb(125, 235, 129)":"#2E7D32",U[re].visible=!1)}a.current[y]?a.current[y]={...a.current[y],...U}:a.current[y]=U,C.line.forEach((Q,re)=>{let ne=C.position[Q.end],oe=C.position[Q.start];N.push(ne.x*.01,ne.y*.01,ne.z*.01),D.push(oe.x*.01,oe.y*.01,oe.z*.01)});let z=new Di;z.setAttribute("position",new da(N,3));let B=new oh({glslVersion:Kf,uniforms:{color:{value:new Ir(v)},scale:{value:window.innerHeight/2},size:{value:.05},opacity:{value:1}},vertexShader:`
5694
+ `},hTn=(...t)=>{console!=null&&console.warn&&(lS(t[0])&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t))},cIe={},Uee=(...t)=>{lS(t[0])&&cIe[t[0]]||(lS(t[0])&&(cIe[t[0]]=new Date),hTn(...t))},LXe=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},Fee=(t,e,n)=>{t.loadNamespaces(e,LXe(t,n))},uIe=(t,e,n,r)=>{if(lS(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Fee(t,n,r);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,LXe(t,r))},gTn=(t,e,n={})=>!e.languages||!e.languages.length?(Uee("i18n.languages were undefined or empty",e.languages),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,i)=>{var a;if(((a=n.bindI18n)==null?void 0:a.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,t))return!1}}),lS=t=>typeof t=="string",mTn=t=>typeof t=="object"&&t!==null,vTn=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,yTn={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},bTn=t=>yTn[t],ETn=t=>t.replace(vTn,bTn);let Bee={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:ETn};const STn=(t={})=>{Bee={...Bee,...t}},CTn=()=>Bee;let NXe;const xTn=t=>{NXe=t},_Tn=()=>NXe,wTn={type:"3rdParty",init(t){STn(t.options.react),xTn(t)}},TTn=S.createContext();class ITn{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const ATn=(t,e)=>{const n=S.useRef();return S.useEffect(()=>{n.current=e?n.current:t},[t,e]),n.current},MXe=(t,e,n,r)=>t.getFixedT(e,n,r),RTn=(t,e,n,r)=>S.useCallback(MXe(t,e,n,r),[t,e,n,r]),OTn=(t,e={})=>{var C,x,_,A;const{i18n:n}=e,{i18n:r,defaultNS:i}=S.useContext(TTn)||{},a=n||r||_Tn();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new ITn),!a){Uee("You will need to pass in an i18next instance by using initReactI18next");const P=(N,D)=>lS(D)?D:mTn(D)&&lS(D.defaultValue)?D.defaultValue:Array.isArray(N)?N[N.length-1]:N,R=[P,{},!1];return R.t=P,R.i18n={},R.ready=!1,R}(C=a.options.react)!=null&&C.wait&&Uee("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...CTn(),...a.options.react,...e},{useSuspense:s,keyPrefix:l}=o;let u=t||i||((x=a.options)==null?void 0:x.defaultNS);u=lS(u)?[u]:u||["translation"],(A=(_=a.reportNamespaces).addUsedNamespaces)==null||A.call(_,u);const d=(a.isInitialized||a.initializedStoreOnce)&&u.every(P=>gTn(P,a,o)),f=RTn(a,e.lng||null,o.nsMode==="fallback"?u:u[0],l),p=()=>f,h=()=>MXe(a,e.lng||null,o.nsMode==="fallback"?u:u[0],l),[g,y]=S.useState(p);let v=u.join();e.lng&&(v=`${e.lng}${v}`);const m=ATn(v),b=S.useRef(!0);S.useEffect(()=>{const{bindI18n:P,bindI18nStore:R}=o;b.current=!0,!d&&!s&&(e.lng?uIe(a,e.lng,u,()=>{b.current&&y(h)}):Fee(a,u,()=>{b.current&&y(h)})),d&&m&&m!==v&&b.current&&y(h);const N=()=>{b.current&&y(h)};return P&&(a==null||a.on(P,N)),R&&(a==null||a.store.on(R,N)),()=>{b.current=!1,a&&(P==null||P.split(" ").forEach(D=>a.off(D,N))),R&&a&&R.split(" ").forEach(D=>a.store.off(D,N))}},[a,v]),S.useEffect(()=>{b.current&&d&&y(p)},[a,l,d]);const E=[g,a,d];if(E.t=g,E.i18n=a,E.ready=d,d||!d&&!s)return E;throw new Promise(P=>{e.lng?uIe(a,e.lng,u,()=>P()):Fee(a,u,()=>P())})},fo=t=>typeof t=="string",a5=()=>{let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n},dIe=t=>t==null?"":""+t,LTn=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},NTn=/###/g,fIe=t=>t&&t.indexOf("###")>-1?t.replace(NTn,"."):t,pIe=t=>!t||fo(t),ZI=(t,e,n)=>{const r=fo(e)?e.split("."):e;let i=0;for(;i<r.length-1;){if(pIe(t))return{};const a=fIe(r[i]);!t[a]&&n&&(t[a]=new n),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++i}return pIe(t)?{}:{obj:t,k:fIe(r[i])}},hIe=(t,e,n)=>{const{obj:r,k:i}=ZI(t,e,Object);if(r!==void 0||e.length===1){r[i]=n;return}let a=e[e.length-1],o=e.slice(0,e.length-1),s=ZI(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=ZI(t,o,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},MTn=(t,e,n,r)=>{const{obj:i,k:a}=ZI(t,e,Object);i[a]=i[a]||[],i[a].push(n)},lP=(t,e)=>{const{obj:n,k:r}=ZI(t,e);if(n)return n[r]},PTn=(t,e,n)=>{const r=lP(t,n);return r!==void 0?r:lP(e,n)},PXe=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?fo(t[r])||t[r]instanceof String||fo(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):PXe(t[r],e[r],n):t[r]=e[r]);return t},Ux=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var DTn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const kTn=t=>fo(t)?t.replace(/[&<>"'\/]/g,e=>DTn[e]):t;class UTn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const FTn=[" ",",","?","!",";"],BTn=new UTn(20),$Tn=(t,e,n)=>{e=e||"",n=n||"";const r=FTn.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const i=BTn.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(n);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},$ee=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let i=t;for(let a=0;a<r.length;){if(!i||typeof i!="object")return;let o,s="";for(let l=a;l<r.length;++l)if(l!==a&&(s+=n),s+=r[l],o=i[s],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&l<r.length-1)continue;a+=l-a+1;break}i=o}return i},cP=t=>t==null?void 0:t.replace("_","-"),VTn={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};class uP{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||VTn,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,i){return i&&!this.debug?null:(fo(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new uP(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new uP(this.logger,e)}}var P0=new uP;class iU{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[s,l]=o;for(let u=0;u<l;u++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[s,l]=o;for(let u=0;u<l;u++)s.apply(s,[e,...r])})}}class gIe extends iU{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){var u,d;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,n],r&&(Array.isArray(r)?s.push(...r):fo(r)&&a?s.push(...r.split(a)):s.push(r)));const l=lP(this.data,s);return!l&&!n&&!r&&e.indexOf(".")>-1&&(e=s[0],n=s[1],r=s.slice(2).join(".")),l||!o||!fo(r)?l:$ee((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[n],r,a)}addResource(e,n,r,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,n];r&&(s=s.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(s=e.split("."),i=n,n=s[1]),this.addNamespaces(n),hIe(this.data,s,i),a.silent||this.emit("added",e,n,r,i)}addResources(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in r)(fo(r[a])||Array.isArray(r[a]))&&this.addResource(e,n,a,r[a],{silent:!0});i.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,i,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[e,n];e.indexOf(".")>-1&&(s=e.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=lP(this.data,s)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?PXe(l,r,a):l={...l,...r},hIe(this.data,s,l),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var DXe={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,i){return t.forEach(a=>{var o;e=((o=this.processors[a])==null?void 0:o.process(e,n,r,i))??e}),e}};const mIe={};class dP extends iU{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),LTn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=P0.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return(r==null?void 0:r.res)!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!$Tn(e,r,i);if(o&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:fo(a)?[a]:a};const u=e.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(a=u.shift()),e=u.join(i)}return{key:e,namespaces:fo(a)?[a]:a}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(e[e.length-1],n),l=s[s.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode"){if(d){const C=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${C}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${C}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:o}const f=this.resolve(e,n);let p=f==null?void 0:f.res;const h=(f==null?void 0:f.usedKey)||o,g=(f==null?void 0:f.exactUsedKey)||o,y=Object.prototype.toString.apply(p),v=["[object Number]","[object Function]","[object RegExp]"],m=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,E=!fo(p)&&typeof p!="boolean"&&typeof p!="number";if(b&&p&&E&&v.indexOf(y)<0&&!(fo(m)&&Array.isArray(p))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,p,{...n,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(f.res=C,f.usedParams=this.getUsedParamsDetails(n),f):C}if(a){const C=Array.isArray(p),x=C?[]:{},_=C?g:h;for(const A in p)if(Object.prototype.hasOwnProperty.call(p,A)){const P=`${_}${a}${A}`;x[A]=this.translate(P,{...n,joinArrays:!1,ns:s}),x[A]===P&&(x[A]=p[A])}p=x}}else if(b&&fo(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,e,n,r));else{let C=!1,x=!1;const _=n.count!==void 0&&!fo(n.count),A=dP.hasDefaultValue(n),P=_?this.pluralResolver.getSuffix(u,n.count,n):"",R=n.ordinal&&_?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",N=_&&!n.ordinal&&n.count===0,D=N&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${P}`]||n[`defaultValue${R}`]||n.defaultValue;!this.isValidLookup(p)&&A&&(C=!0,p=D),this.isValidLookup(p)||(x=!0,p=o);const z=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&x?void 0:p,B=A&&D!==p&&this.options.updateMissing;if(x||C||B){if(this.logger.log(B?"updateKey":"missingKey",u,l,o,B?D:p),a){const W=this.resolve(o,{...n,keySeparator:!1});W&&W.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let j=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let W=0;W<V.length;W++)j.push(V[W]);else this.options.saveMissingTo==="all"?j=this.languageUtils.toResolveHierarchy(n.lng||this.language):j.push(n.lng||this.language);const G=(W,Z,H)=>{var ee;const X=A&&H!==p?H:z;this.options.missingKeyHandler?this.options.missingKeyHandler(W,l,Z,X,B,n):(ee=this.backendConnector)!=null&&ee.saveMissing&&this.backendConnector.saveMissing(W,l,Z,X,B,n),this.emit("missingKey",W,l,Z,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&_?j.forEach(W=>{const Z=this.pluralResolver.getSuffixes(W,n);N&&n[`defaultValue${this.options.pluralSeparator}zero`]&&Z.indexOf(`${this.options.pluralSeparator}zero`)<0&&Z.push(`${this.options.pluralSeparator}zero`),Z.forEach(H=>{G([W],o+H,n[`defaultValue${H}`]||D)})}):G(j,o,D))}p=this.extendTranslation(p,e,n,f,r),x&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${l}:${o}`),(x||C)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,C?p:void 0))}return i?(f.res=p,f.usedParams=this.getUsedParamsDetails(n),f):p}extendTranslation(e,n,r,i,a){var u,d;var o=this;if((u=this.i18nFormat)!=null&&u.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=fo(e)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(f){const g=e.match(this.interpolator.nestingRegexp);p=g&&g.length}let h=r.replace&&!fo(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,r.lng||this.language||i.usedLng,r),f){const g=e.match(this.interpolator.nestingRegexp),y=g&&g.length;p<y&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var g=arguments.length,y=new Array(g),v=0;v<g;v++)y[v]=arguments[v];return(a==null?void 0:a[0])===y[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):o.translate(...y,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=fo(s)?[s]:s;return e!=null&&(l!=null&&l.length)&&r.applyPostProcessor!==!1&&(e=DXe.handle(l,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,a,o,s;return fo(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),d=u.key;i=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=n.count!==void 0&&!fo(n.count),h=p&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(fo(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{var m,b;this.isValidLookup(r)||(s=v,!mIe[`${y[0]}-${v}`]&&((m=this.utils)!=null&&m.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(s))&&(mIe[`${y[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(E=>{var _;if(this.isValidLookup(r))return;o=E;const C=[d];if((_=this.i18nFormat)!=null&&_.addLookupKeys)this.i18nFormat.addLookupKeys(C,d,E,v,n);else{let A;p&&(A=this.pluralResolver.getSuffix(E,n.count,n));const P=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(C.push(d+A),n.ordinal&&A.indexOf(R)===0&&C.push(d+A.replace(R,this.options.pluralSeparator)),h&&C.push(d+P)),g){const N=`${d}${this.options.contextSeparator}${n.context}`;C.push(N),p&&(C.push(N+A),n.ordinal&&A.indexOf(R)===0&&C.push(N+A.replace(R,this.options.pluralSeparator)),h&&C.push(N+P))}}let x;for(;x=C.pop();)this.isValidLookup(r)||(a=x,r=this.getResource(E,v,x,n))}))})}),{res:r,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){var a;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,n,r,i):this.resourceStore.getResource(e,n,r,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!fo(e.replace);let i=r?e.replace:e;if(r&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const a of n)delete i[a]}return i}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class vIe{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=P0.create("languageUtils")}getScriptPartFromCode(e){if(e=cP(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=cP(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(fo(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{this.logger.warn(`failed to format code: ${e}`)}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(a=>{if(a===i)return a;if(!(a.indexOf("-")<0&&i.indexOf("-")<0)&&(a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),fo(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),i=[],a=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return fo(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):fo(e)&&a(this.formatLanguageCode(e)),r.forEach(o=>{i.indexOf(o)<0&&a(this.formatLanguageCode(o))}),i}}const yIe={zero:0,one:1,two:2,few:3,many:4,other:5},bIe={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class zTn{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=P0.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=cP(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let o;try{o=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),bIe;if(!e.match(/-|_/))return bIe;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,n)}return this.pluralRulesCache[a]=o,o}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(i=>`${n}${i}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,a)=>yIe[i]-yIe[a]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const EIe=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=PTn(t,e,n);return!a&&i&&fo(n)&&(a=$ee(t,n,r),a===void 0&&(a=$ee(e,n,r))),a},rq=t=>t.replace(/\$/g,"$$$$");class HTn{constructor(){var n;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P0.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:s,suffixEscaped:l,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:h,nestingSuffix:g,nestingSuffixEscaped:y,nestingOptionsSeparator:v,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=n!==void 0?n:kTn,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?Ux(a):o||"{{",this.suffix=s?Ux(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=p?Ux(p):h||Ux("$t("),this.nestingSuffix=g?Ux(g):y||Ux(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=m||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,i){var h;let a,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(g.indexOf(this.formatSeparator)<0){const b=EIe(n,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...i,...n,interpolationkey:g}):b}const y=g.split(this.formatSeparator),v=y.shift().trim(),m=y.join(this.formatSeparator).trim();return this.format(EIe(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),m,r,{...i,...n,interpolationkey:v})};this.resetRegExp();const d=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((h=i==null?void 0:i.interpolation)==null?void 0:h.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>rq(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?rq(this.escape(g)):rq(g)}].forEach(g=>{for(s=0;a=g.regex.exec(e);){const y=a[1].trim();if(o=u(y),o===void 0)if(typeof d=="function"){const m=d(e,a,i);o=fo(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,y))o="";else if(f){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),o="";else!fo(o)&&!this.useRawValueToEscape&&(o=dIe(o));const v=g.safeValue(o);if(e=e.replace(a[0],v),f?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,a,o;const s=(l,u)=>{const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const f=l.split(new RegExp(`${d}[ ]*{`));let p=`{${f[1]}`;l=f[0],p=this.interpolate(p,o);const h=p.match(/'/g),g=p.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!g||g.length%2!==0)&&(p=p.replace(/'/g,'"'));try{o=JSON.parse(p),u&&(o={...u,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${d}${p}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...r},o=o.replace&&!fo(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(f=>f.trim());i[1]=d.shift(),l=d,u=!0}if(a=n(s.call(this,i[1].trim(),o),o),a&&i[0]===e&&!fo(a))return a;fo(a)||(a=dIe(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),u&&(a=l.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],a),this.regexp.lastIndex=0}return e}}const GTn=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(o=>{if(o){const[s,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},Fx=t=>{const e={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=r+JSON.stringify(a);let s=e[o];return s||(s=t(cP(r),i),e[o]=s),s(n)}};class jTn{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P0.create("formatter"),this.options=e,this.formats={number:Fx((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return a=>i.format(a)}),currency:Fx((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>i.format(a)}),datetime:Fx((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return a=>i.format(a)}),relativetime:Fx((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return a=>i.format(a,r.range||"day")}),list:Fx((n,r)=>{const i=new Intl.ListFormat(n,{...r});return a=>i.format(a)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Fx(n)}format(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(s=>s.indexOf(")")>-1)){const s=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,s)].join(this.formatSeparator)}return a.reduce((s,l)=>{var f;const{formatName:u,formatOptions:d}=GTn(l);if(this.formats[u]){let p=s;try{const h=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},g=h.locale||h.lng||i.locale||i.lng||r;p=this.formats[u](s,g,{...d,...i,...h})}catch(h){this.logger.warn(h)}return p}else this.logger.warn(`there was no format function for ${u}`);return s},e)}}const WTn=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class XTn extends iU{constructor(e,n,r){var a,o;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=P0.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,r,i.backend,i)}queueLoad(e,n,r,i){const a={},o={},s={},l={};return e.forEach(u=>{let d=!0;n.forEach(f=>{const p=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?o[p]===void 0&&(o[p]=!0):(this.state[p]=1,d=!1,o[p]===void 0&&(o[p]=!0),a[p]===void 0&&(a[p]=!0),l[f]===void 0&&(l[f]=!0)))}),d||(s[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,n,r){const i=e.split("|"),a=i[0],o=i[1];n&&this.emit("failedLoading",a,o,n),!n&&r&&this.store.addResourceBundle(a,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const s={};this.queue.forEach(l=>{MTn(l.loaded,[a],o),WTn(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const d=l.loaded[u];d.length&&d.forEach(f=>{s[u][f]===void 0&&(s[u][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,i+1,a*2,o)},a);return}o(u,d)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(e,n);u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}return}return l(e,n,s)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();fo(e)&&(e=this.languageUtils.toResolveHierarchy(e)),fo(n)&&(n=[n]);const a=this.queueLoad(e,n,r,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),i=r[0],a=r[1];this.read(i,a,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${n}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${n}loaded namespace ${a} for language ${i}`,s),this.loaded(e,o,s)})}saveMissing(e,n,r,i,a){var l,u,d,f,p;let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((p=this.backend)!=null&&p.create){const h={...o,isUpdate:a},g=this.backend.create.bind(this.backend);if(g.length<6)try{let y;g.length===5?y=g(e,n,r,i,h):y=g(e,n,r,i),y&&typeof y.then=="function"?y.then(v=>s(null,v)).catch(s):s(null,y)}catch(y){s(y)}else g(e,n,r,i,s,h)}!e||!e[0]||this.store.addResource(e[0],n,r,i)}}}const SIe=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),fo(t[1])&&(e.defaultValue=t[1]),fo(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),CIe=t=>{var e,n;return fo(t.ns)&&(t.ns=[t.ns]),fo(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),fo(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},TL=()=>{},ZTn=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class h6 extends iU{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=CIe(e),this.services={},this.logger=P0,this.modules={external:[]},ZTn(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(fo(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=SIe();this.options={...i,...this.options,...CIe(n)},this.options.interpolation={...i.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?P0.init(a(this.modules.logger),this.options):P0.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=jTn;const f=new vIe(this.options);this.store=new gIe(this.options.resources,this.options);const p=this.services;p.logger=P0,p.resourceStore=this.store,p.languageUtils=f,p.pluralResolver=new zTn(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(p.formatter=a(d),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new HTn(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new XTn(a(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(h){for(var g=arguments.length,y=new Array(g>1?g-1:0),v=1;v<g;v++)y[v-1]=arguments[v];e.emit(h,...y)}),this.modules.languageDetector&&(p.languageDetector=a(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=a(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new dP(this.services,this.options),this.translator.on("*",function(h){for(var g=arguments.length,y=new Array(g>1?g-1:0),v=1;v<g;v++)y[v-1]=arguments[v];e.emit(h,...y)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=TL),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const l=a5(),u=()=>{const d=(f,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(p),r(f,p)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),l}loadResources(e){var a,o;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:TL;const i=fo(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&s.indexOf(f)<0&&s.push(f)})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>l(d)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,u=>l(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(e,n,r){const i=a5();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=TL),this.services.backendConnector.reload(e,n,a=>{i.resolve(),r(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&DXe.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const i=a5();this.emit("languageChanging",e);const a=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,u)=>{u?(a(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{var d,f;!e&&!l&&this.services.languageDetector&&(l=[]);const u=fo(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||a(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,p=>{o(p,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),i}getFixedT(e,n,r){var i=this;const a=function(o,s){let l;if(typeof s!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];l=i.options.overloadTranslationOptionHandler([o,s].concat(d))}else l={...s};l.lng=l.lng||a.lng,l.lngs=l.lngs||a.lngs,l.ns=l.ns||a.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||a.keyPrefix);const p=i.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(o)?h=o.map(g=>`${l.keyPrefix}${p}${g}`):h=l.keyPrefix?`${l.keyPrefix}${p}${o}`:o,i.t(h,l)};return fo(e)?a.lng=e:a.lngs=e,a.ns=n,a.keyPrefix=r,a}t(){var i;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(i=this.translator)==null?void 0:i.translate(...n)}exists(){var i;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(i=this.translator)==null?void 0:i.exists(...n)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const s=n.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!i||o(a,e)))}loadNamespaces(e,n){const r=a5();return this.options.ns?(fo(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=a5();fo(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){var i,a;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((a=this.services)==null?void 0:a.languageUtils)||new vIe(SIe());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new h6(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:TL;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new h6(i);return(e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new gIe(this.store.data,i),a.services.resourceStore=a.store),a.translator=new dP(a.services,i),a.translator.on("*",function(s){for(var l=arguments.length,u=new Array(l>1?l-1:0),d=1;d<l;d++)u[d-1]=arguments[d];a.emit(s,...u)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Nf=h6.createInstance();Nf.createInstance=h6.createInstance;Nf.createInstance;Nf.dir;Nf.init;Nf.loadResources;Nf.reloadResources;Nf.use;Nf.changeLanguage;Nf.getFixedT;Nf.t;Nf.exists;Nf.setDefaultNamespace;Nf.hasLoadedNamespace;Nf.loadNamespaces;Nf.loadLanguages;const qTn={"5000.0001":"2D registration","5000.0002":"Upload slice","5000.0003":"Upload Failed,please contact the administrator","5000.0004":"View result","5000.0005":"Downloading","5000.0006":"Select the range","5000.0007":"remove the range","5000.0008":"preview selected data","5000.0009":"Tips: press the 'A' key to switch between pan and zoom modes","5000.0010":"Set the downsampling rate","5000.5018":"Download selected data","5000.5012":"Normal mode","5000.5013":"Virtual surgery mode","5000.5014":"Atlas mapping","5000.5019":"Upload 3D image or swc file already mapped to STAM or CCF","5000.5020":"Map the uploaded data to the other atlas:","5000.5021":"Start","5000.5022":"Download","5000.5023":"View result","5000.5024":"Other atlases","5000.5025":"Setting","5000.5026":"Simple mode","5000.5027":"Select structure","5000.5028":"Select target","5000.5029":"Remove target","5000.5017":"Intelligent planning","5000.5030":"Planning","5000.5015":"Select the direction of conversion","5000.5016":"Cranial","2002.0301":"Information","5000.5031":"Block size:","5000.0019":"or press 'R' key to switch between Rotation mode and Translation mode","5000.5034":"Auto","5000.5035":"Manual","5000.5057":"Show 3D morphology","5000.5056":"Hide 3D morphology","5000.5058":"Unable to calculate a path to avoid the structures you selected","5000.0112":"Cancel","2002.0302":"View data","5000.0111":"Save","4000.0210":"Translate-X","2002.0300":"Neuron collaborative annotation platform","5000.0113":"Alias in Dong's nomenclature","4000.0212":"Translate-Z","4000.0211":"Translate-Y","4000.0214":"Rotate-Y","5000.0110":"Edit","4000.0213":"Rotate-X","4000.0216":"View high resolution slice","4000.0215":"Rotate-Z","4000.0218":"Coordinate","4000.0217":"Left hemisphere","4000.0219":"Datum Marks","4000.0100":"","4000.0221":"go to coronal","4000.0220":"SIZE","4000.0102":"Bregma","4000.0223":"go to horizontal","4000.0101":"unit:mm","4000.0222":"go to sagittal","4000.0104":"Sagittal sections","4000.0225":"guide","4000.0103":"Coronal sections","4000.0224":"go to arbitrary","2001.0402":"View data","4000.0106":"search anatomical structures","2001.0401":"Information","4000.0105":"Horizontal sections","4000.0226":"Finish","4000.0108":"Brain maps 4.0","4000.0229":"Next","2001.0403":"Vessel","4000.0107":"ARA ontology","4000.0228":"Skip","4000.0109":"Mouse Brain Atlas","2001.0400":"Cerebral vascular atlas","1000.0400":"Login","2002.0202":"View data","2002.0203":"After nonlinear registration, the registered image is then returned to the user. Additionally, users receive access to isotropic 1-micron resolution cytoarchitectural slice with the same position and angle.","2002.0200":"Automatic slice registration","2002.0201":"We provide an automatic brain slice registration service where users can upload single brain slice images stained with PI or DAPI. This service, through approximately 10 minutes of background computation, extracts a slice from the three-dimensional STAM that is closest to the position of the user-uploaded brain slice.","2002.0602":"The service provides information on the distance between the injection site and the cranial or intracranial datum marks, as well as the injection angle, based on user interactions.","2002.0600":"Stereotactic surgical navigation service","2002.0601":"We have incorporated a stereotaxic surgical navigation service into the three-dimensional visualization service page. Users can simulate the stereotaxic surgical procedure of injecting viruses into the mouse brain through interactive operations.","6000.0112":"Please enter an email address","6000.0110":"Please enter the purpose of the data","6000.0111":"Label image download","7000.0108":"Start","7000.0109":"Save","7000.0106":"Calculate the corresponding plane from the atlas","7000.0107":"View higher resolution image","4000.0201":"Anatomical Structure","7000.0104":"Get test image","4000.0200":"","7000.0105":"Upload","4000.0203":"Virtual surgery","7000.0102":"Description","4000.0202":"Assembling","7000.0103":"Choose the type of uploaded slice","4000.0205":"Magnitude","7000.0100":"","4000.0204":"Atlas reslicing","7000.0101":"Image registration service","4000.0207":"Scaling","4000.0206":"Frequency","2001.0101":"STAM's two-dimensional visualization service provides a digital map-style online browsing function with 700 coronal planes, 256 sagittal planes, and 367 horizontal planes.","4000.0209":"Reset","2001.0100":"2D visualization","4000.0208":"Select Target","2001.0103":"Users can observe individual standard profiles at different resolutions, navigate profiles at different locations along the same direction, and switch between the three standard profile directions. Each standard profile is a 20μm-thick projection image overlaid with a coordinate grid and annotated with boundaries of neuroanatomical structures.","2001.0102":"View data","1000.0302":"Contact us","2000.0800":"Manual Instruction","1000.0303":"Help","1000.0300":"About","1000.0301":"Introduction","2002.0103":"Users can choose the angle of interest and examine the isotropic 1-micron resolution cytoarchitectural brain slice at that angle. This service provides newly generated slices with annotations for brain regions and nuclei.","4000.0131":"Show Contour","2002.0500":"Anatomical knowledge base","4000.0130":"Show Atlas","2002.0101":"We also offer the service of visualizing slices at arbitrary angles.","2002.0102":"View data","4000.0132":"Nucleus Information","2002.0501":"We have developed a neuroanatomical knowledge base service for STAM.","7000.0113":"Upload and Download","2002.0502":"When users are exploring the three-dimensional topography of brain structures of interest using the two-dimensional and three-dimensional visualization services, they can conveniently access this knowledge base by right-clicking with the mouse. This allows them to query information related to the structure of interest, such as gene expression, neurotransmitters, projection pathways, and more. The knowledge base provides an entry point for the public to actively contribute, edit, and enhance neuroanatomical knowledge.","7000.0111":"Uploaded Image","7000.0112":"Output Image","7000.0110":"Any question about this online registration tool, welcome to contact atlas@brainsmatics.org","2002.0100":"Arbitrary-angle slice visualization","6000.0105":"Purpose of the data","6000.0106":"Submit","6000.0103":"Postal address","6000.0104":"E-mail","6000.0109":"Please enter a postal address","2000.2001":"Brain atlas and data","6000.0107":"Please enter the company name","6000.0108":"Please enter the contact person","2001.0203":"Users are capable of exploring the overall appearance as well as details of any anatomical structure of interest in three-dimensional space, from different perspectives and magnification levels. Additionally, through the assembly view feature, users can unfold the sub-structures contained within each brain region and nucleus, providing a detailed examination of the internal components.","2001.0200":"3D visualization","6000.0101":"Company Name","6000.0102":"Contact person","2001.0202":"View data","2001.0201":"STAM's three-dimensional visualization service reconstructs the three-dimensional topography of 915 brain regions and nuclei.","6000.0100":"","1000.0203":"Neuron collaborative annotation platform","1000.0204":"Data sharing service","1000.0200":"Tools","1000.0201":"High-resolution arbitrary angle reslicing service","1000.0202":"Image registration service","2000.2002":"Services","2000.0500":"Brains-Map","2002.0400":"Data sharing service","4000.0230":"Back","2002.0401":"Information","4000.0111":"D - V","4000.0232":"Step 2","4000.0110":"A - P","4000.0231":"Step 1","4000.0113":"Display","4000.0234":"Step 4","4000.0112":"M - L","4000.0233":"Step 3","2002.0402":"View data","4000.0115":"2D Navigation","4000.0236":"Select a structure on the left","4000.0114":"3D Atlas","4000.0235":"Click the start button","4000.0117":"Reset to default view","4000.0238":"Click the End button","4000.0116":"Annotation","4000.0237":"Left-click on the selected structure to<br> determine the injection site, <br>and then move the mouse to determine the injection direction","4000.0119":"Gridlines","4000.0118":"Information box","4000.0239":"Set the expanded length","4000.0120":"GO TO","4000.0241":"Click the icon here to expand the selected structure, <br> click the icon again to exit from the expanded state","5000.0101":"alias in Paxinos's nomenclature","4000.0240":"Sets the degree of zooming out of the <br>center expansion","5000.0100":"","4000.0122":"Introduction of this structure","4000.0243":"Right click on this structure in the model and select the face you need","5000.0103":"Reference","4000.0121":"3D Viewer","4000.0242":"Clear Target","5000.0102":"alias in Hof's nomenclature","4000.0124":"Zoom out","4000.0245":"Click to view higher resolution images","4000.0123":"Figure","4000.0244":"On the right side, you can drag the position of the section","0800.0801":"Operating Instructions The interface for the two-dimensional visualization service is illustrated below. The central area is the main window, used to display STAM's standard profiles (<span>①</span>) and the brain region annotations on these profiles (<span>②</span>). Users can use the left mouse button and scroll wheel in the main window to move, and zoom in to the resolution of the region of interest. When the user hovers the mouse over an annotation for a brain region or nucleus, the annotation switches to a blue highlighted mode (<span>③</span>), and the full name of the highlighted brain region or nucleus is displayed in the lower-left corner (<span>④</span>). The light gray grid behind the standard profile and annotations shows the distribution of the STAM coordinate system on the current standard profile (<span>⑤</span>). As the user moves the mouse, the real-time position of the mouse in the STAM coordinate system is displayed in the lower-left corner of the main window (<span>⑥</span>). Users can also observe the position of the current viewed standard profile in the entire mouse brain through the navigation window in the upper left corner (<span>⑦</span>). Users can freely switch to other profiles (<span>⑧</span>) or switch between different anatomical directions, such as coronal, sagittal, and horizontal planes (<span>⑨</span>). Additionally, users can search for brain regions or nuclei of interest in the input box (<span>⑩</span>) or navigate through the anatomical ontology tree (<span>⑪</span>). If the current viewed profile does not include the searched structure, it will jump to the nearest profile in the same direction that contains the structure. At the bottom of the main window is the button panel for the two-dimensional visualization service (<span>⑫</span>). The button functions, from left to right, include: zoom out, zoom in, reset view, full screen, switch to three-dimensional visualization service, switch to arbitrary angle cross-section visualization service, display mode switch, and jump to other profiles in the current anatomical direction.","4000.0126":"Reset","4000.0125":"Zoom in","4000.0128":"To 3d Viewer","5000.0109":"Chemical name","2001.0302":"View data","4000.0127":"Full Screen","5000.0108":"Disease name","2001.0701":"The Stereotaxic Topographic Atlas of the Mouse Brain (STAM) is a three-dimensional topographical atlas that depict the anatomical structures of the whole mouse brain, achieving precise single-cell resolution localization. This atlas is based on a three-dimensional Nissl-stained image dataset with isotropic one-micron resolution and is constructed by incorporating various auxiliary imaging data, including immunohistochemistry, neural circuit projections, and specific gene type neuron distribution data. Here, we established the STAM visualization platform, which includes services for exploring standard two-dimensional anatomical sections, three-dimensional topography, and arbitrary-angle slices of the brain atlas. The platform integrates different functionalities such as neuroanatomical knowledge base, stereotaxic surgical navigation, and automatic registration of user-uploaded slices. The STAM visualization platform is expected to provide an effective spatial localization benchmark for the registration and integration of results from single-cell level studies, such as multi-omics and neurocircuitry.","2001.0700":"The brief introduction to STAM","4000.0129":"E-mail","5000.0105":"Disease","5000.0104":"Gene","2001.0301":"Information","5000.0107":"Gene name","2001.0300":"Neuronal morphology database","5000.0106":"Chemical","1000.0104":"Cerebral vascular atlas","1000.0500":"Language","1000.0501":"Simplified Chinese","1000.0502":"English","1000.0100":"Atlas","1000.0101":"Stereotactic atlas","1000.0102":"Specific cell type distribution atlas","1000.0103":"Neuronal morphology database","0800.0803":"Operating Instructions The interface for the three-dimensional visualization service is illustrated as followed. The left side features the navigation window, while the right side is the main window. The main window displays the arbitrary angle slice of STAM (<span>①</span>) and the brain region annotations on that slice (<span>②</span>). Users can pan in the main window by holding down the left mouse button, zoom in using Ctrl + scroll wheel, or switch to different neighboring slices along the current angle by using the scroll wheel. On the right side of the main window is the list of brain regions and nuclei (<span>③</span>). When the user moves the mouse over the name of a structure of interest, the annotation for that structure in the main window is highlighted in light gray (<span>④</span>). Users can also move the mouse over the annotation of a structure of interest in the main window, and the name of that structure in the list of brain regions and nuclei on the right will automatically be highlighted. At this time, the name of the structure will also be displayed in the lower-left corner of the main window (<span>⑤</span>). Below the structure name is the scale bar of the slice image in the main window at the current resolution (<span>⑥</span>). In the navigation window on the left side, the central area displays the three-dimensional model of the right half of the mouse brain (<span>⑦</span>). The black plane corresponds to the position and angle of the slice in the main window (<span>⑧</span>). The red, green, and blue circles around the model are used to change the pitching, rotation, and rolling angles of the cross-section (<span>⑨</span>). Users can also input values in the lower-left corner of the navigation window to set the slice angle (<span>⑩</span>). The red, green, and blue arrows in the navigation window are used to determine the position of the slice along the given arbitrary angle in the three-dimensional space (<span>⑪</span>).","0800.0802":"Operating Instructions The interface for the three-dimensional visualization service is depicted as followed. The central area is the main window, which initially displays the outline of the mouse brain (<span>①</span>). On the left side of the main window is the anatomical ontology tree (<span>②</span>), where users can choose any structure of interest. By checking the three-dimensional model of the selected structure, it will be displayed in the main window (<span>③</span>), and the full name of the structure will appear in the lower-left corner of the main window (<span>④</span>). Users can use a long press of the left mouse button in the main window to select the observation angle and a long press of the right mouse button to pan the view. The gray grid behind the three-dimensional model represents the STAM coordinate system (<span>⑤</span>), with the coordinate origin selected by users from the candidates, indicated by a red sphere in the main window (<span>⑥</span>). As the user moves the mouse, the real-time position of the mouse in the STAM coordinate system is displayed in the lower-left corner of the main window (<span>⑦</span>). By clicking the blue three-dimensional cube icon to the right of any structure name in the anatomical naming tree, users can enter assembly view mode (<span>⑧</span>). In this mode, users can adjust parameters such as the degree of expansion of substructures to control the display effect (<span>⑨</span>).","0800.0805":`Operating Instructions The stereotaxic surgical navigation service is illustrated as followed and is integrated into the three-dimensional visualization service interface. Therefore, basic user interactions can refer to Section "Three-Dimensional Visualization Service." The surgical navigation panel is located on the right side of the main window. After clicking on the "Viral injection" tab, users can continue by clicking the "start programming" button to enter navigation mode (<span>①</span>). At this point, users can select brain regions or nuclei of interest from the anatomical naming tree on the left side of the interface. Once the three-dimensional model of the selected structure is displayed in the main window, users can use the left mouse button to set the injection site on the model (<span>②</span>). Subsequently, the surgical navigation service will automatically generate a ray emanating from the injection site, following the direction of the user's mouse movement (<span>③</span>). After adjusting the mouse position to set the injection direction, clicking the left mouse button again will generate a target point on the external surface of the mouse brain (<span>④</span>). The coordinates of the injection site and target point are displayed below the navigation service panel (<span>⑤</span>). These coordinates represent the relative positions of the two points to the user-selected datum marks, such as the Bregma point, in three-dimensional space. Users can also switch to any cranial and intracranial datum marks of interest. Additionally, the calculated information includes the angle between the user-selected injection direction and the three standard profiles of coronal, sagittal, and horizontal planes (<span>⑥</span>).`,"0800.0804":"Operating Instructions The interface for the neuroanatomical knowledge base service is depicted in the diagram below. Each brain region or nucleus has an independent page, and the example shown is a schematic representation of the knowledge base page for the Lateral dorsal nucleus of the thalamus (LD) nucleus. The page includes, from top to bottom, an overview of the structure of interest (<span>①</span>), aliases (<span>②</span>), references related to this structure (<span>③</span>), as well as information related to genes (<span>④</span>), chemicals (<span>⑤</span>), diseases (<span>⑥</span>), and more. For each gene, chemical, and disease, corresponding references are also listed. Additionally, we provide an entry point for users to edit the content. Users can click the Edit button on the right side of the page to submit edits, and we will review the content submitted by users in the background.","0800.0806":"Operating Instructions The brain slice automatic registration service interface is illustrated as followed. In the upper-left corner is the image upload panel (<span>①</span>), with a radio button on the left containing the currently allowed types of images for registration. After selecting the image type, users can click the Upload button on the right to upload the brain slice image for registration. Users can also click the “Get test image” button to download a test image and then upload it for testing. The uploaded image will be displayed in the lower-left corner of the interface (<span>②</span>). Once the upload is complete, click the “Start” button in the registration calculation panel on the upper-right side of the interface (<span>③</span>), and the background computation will begin. After the calculation is completed, the results will be displayed on the lower-right side of the interface (<span>④</span>). Users can click the “Save” button in the calculation panel to download the results locally. Alternatively, clicking the View higher resolution image button will navigate to the arbitrary angle slice service, allowing users to observe high-resolution cytoarchitectural images at the corresponding angle.","5000.0200":"Regions to avoid","5000.0201":"Structure for injecting","5000.0202":"Regions","5000.0204":"Vessels","5000.0205":"Vessels to avoid","5000.5060":"Hide neural circuit","5000.5061":"Show neural circuit","5000.5039":"Download the 3D image containing {{name}}","5000.5038":"Set {{name}} as the origin","5000.5040":"Input the region that soma locates","5000.5041":"Input the region that neuron projects","5000.0206":"Show vascular branches passing by","5000.0207":"Hide vascular branches passing by","5000.0208":"Show structures it supplies","5000.0209":"Hide structures it supplies","5000.5044":"Using this feature requires an API key. At this time, we provide a temporary key for testing. Click Go on button.","5000.5051":"Tip: Your API-key will be sent to the email address you provided. Please check your email after submission to ensure you have received the email containing your API-key.","5000.0011":"Sending emails","5000.5043":"Fill in the Key","5000.5042":"Request a Key","5000.5045":"Submit","5000.5049":"Key value","5000.5070":"Applicant","5000.5071":"Email","5000.5072":"Affiliation","5000.5073":"Purpose of use","5000.5050":"Save","5000.5052":"Neuronal circuits","5000.5053":"Input the inquired structure","5000.5047":"Commit failure","5000.5048":"Submit successfully","5000.5054":"Upstream","5000.5055":"Downstream","5000.5083":"Step 1","5000.5084":"Step 2","5000.5085":"Set Unfold Length","5000.5080":"Click the icon here to expand the selected structure. Clicking the icon again will allow you to exit from the expanded state","5000.5081":"Select a structure on the left side","5000.5082":"Please select injection mode,if automatic mode is selected, click on the left cell name to select the nucleus to bypass","5000.5086":"Chat with STAM","5000.6001":"Input an inquired structure to visualize the connectivity map, for example, ","5000.6002":"Language","5000.0012":"The current download file has exceeded the server transfer limit. You can choose to reduce the sampling level or send an email. Do you want to send an email?","5000.6003":"Neural circuit","5000.6004":"Hide this neuron","5000.6005":"Coronal view","5000.6006":"Sagittal view","5000.6007":"Horizontal view","5000.6008":"Click the button below to apply for downloading the 3D label image of the isotropic 10 micron resolution STAM map","5000.6009":"Requesting STAM labels","5000.6010":"Tip: The license for downloading will be sent to the email address you provided. Please check your email after submission to ensure you have received the email containing your license.","5000.6011":"Using this feature requires a license. If you do not have a license, please apply for one from us by click the button below.","5000.6012":"Request a license","5000.6013":"Fill in the license","5000.6014":"License number","5000.6015":"Inquire neurons that locate and project to","5000.6019":"Navigate the knowledge of {{focusVirusLineItem}}","5000.6020":"Navigate the knowledge of {{focusVirusLineItem}}'s parent {{lableValue}}","5000.6016":" RGB value","5000.6017":"Subcerebral region","5000.6018":"View higher resolution image","5000.6021":"Hide this branch","5000.6022":"Bounding box of {{lableStr}} as the range","5000.6023":"Hide 3D morphology of {{name}}","5000.6024":"Show 3D morphology of {{name}}","5000.6025":"Switch to coronal plane","5000.6026":"Switch to sagittal plane","5000.6027":"Switch to horizontal plane","5000.6028":"Switch to arbitrary plane","5000.6029":"Navigate the ","5000.6030":"whole-brain connectivity diagram","5000.6031":" consisting of single neuronal projections,or: ","5000.6032":",or: ","5000.6033":"Upload slice, or use the test ","5000.6034":" slices:","5000.6035":"Upload 3D image or swc file already mapped to STAM or CCF, otherwise use the test ","5000.6036":"3D image","5000.6037":"swc file:","5000.6038":"Data source: {{name}}","5000.6039":"Flat skull position","5000.6040":"Abundant projections","5000.6041":"New annotation","5000.6042":"Off","5000.6043":"On","5000.6044":"Grid","5000.6045":"Brain contour","5000.5087":"Step 3","5000.5088":"Step 4","8000.0001":"As shown in ①, on the left of the main window is the data panel, where users can select the anatomical nomenclature tree of STAM, cerebral vascular atlas registered to the STAM and neuron morphological data. You can also switch between different versions of anatomical nomenclature systems.","8000.0002":"As shown in ②, it can load three-dimensional models of brain regions or nuclei in the main window.","8000.0003":"As shown in ③, users can switch to different modes or functional modules.","8000.0004":"The 'Regions' tab includes the anatomical nomenclature tree of STAM, where you can select any number of structures of interest via checkboxes in the main window. The 'Neurons' tab is used to query and filter neuron morphological data with somas or projection targets located in regions of interest.","8000.0005":"Users can click on blue square icon in the anatomical nomenclature tree under the 'Regions' tab, all substructures of the clicked structure will be visualized in an assembled form in the main window, and the expansion magnitude can be set in the right panel. By default, this coordinate system uses the Bregma point as the origin. You can also switch the coordinate origin to any of the other 19 cranial or intracranial datum marks provided by STAM, and the coordinates of the objects visualized in the main window will be recalculated based on the new origin. Right click on any cranial or intracranial datum marks to save the STAM label image with the cranial or intracranial datum marks as the coordinate origin.","8000.0006":"Users can switch to the 'setting' tab on the bottom. The 'Left hemisphere' switch determines whether the left hemisphere is displayed in the main window, and it is off by default. The 'Coordinate' switch determines whether coordinate values are displayed in the main window, and it is on by default. The 'Datum Marks' switch determines whether datum marks are displayed in the main window, and it is on by default. The 'Cranial' switch determines whether the three-dimensional contour of the skull is displayed in the main window, and it is off by default. ","8000.0007":"We have developed a virtual surgery navigating service. Users can simulate the stereotaxic surgical procedure of injecting viruses into the mouse brain through interactive operations. Based on user inputs, the STAM provides the information on the distance and injection angle between the injection site and origin defined by cranial or intracranial datum marks.","8000.0008":"Firstly, select the brain region for injection. Next, select the injection target on the chosen brain region. Once the target is selected, a green dot follows the mouse cursor on the surface of the brain region's 3D model. At the same time, the Clear Target button becomes enabled, allowing the user to change the injection target if needed. Then, clicks 'Auto' to enter automatic type, the 'Structure for injecting' tab on the left data panel changes to 'Regions to avoid'. By clicking on the names of brain regions or nuclei to avoid, the selected text will highlight in bright red. Simultaneously, the 3D contours of these structures will be visualized in the main window. Next, clicking the 'Intellectual planning' button on the right panel initiates the process. After a few seconds, STAM returns a path originating from the injection target, avoiding all user-selected brain regions and nuclei.","8000.0009":"If the user selects “Manual” to enter the manual planning mode, the marked injection target turns into a blue dot. At the same time, the Clear Target button becomes enabled, allowing the user to change the injection target if needed. Once the target is set, a red dashed line extends from the injection target toward the current mouse position. The intersection of this dashed line with the outline of STAM (i.e., the injection entry point) is marked in green. Users can select different options under Path constraint for injection as needed. When the user identifies a suitable injection path, they can left-click to mark it. The marked path will then appear as a solid blue line in the main window, with the injection entry point displayed as a blue cone. The names of the brain regions and nuclei that the path passes through are arranged along the solid blue line according to their spatial positions. The right panel displays information about the angle between the injection path and the three standard anatomical directions, the injection target, and the injection entry point. If the user wishes to restart the entire virtual surgery process, they can click the “Reset” button on the right panel.","8000.0011":"As shown in ①, users can upload single brain slice images stained with PI or DAPI. This service will generate a corresponding atlas slice from STAM that is closest in position to the uploaded brain slice. The computed angle and position will then be displayed in the main window.","8000.0012":"Users can upload the 2D brain slice image in tif/tiff format for registration from your local device. Then select the type of the uploaded image. Next, click the 'Start' button in the 'Calculate the corresponding plane from the atlas' button group and wait for the result from the server. Once the calculation is complete, a preview image of the calculation result will appear below the 'Start' button, which can be enlarged by left-clicking. The 'Save' button to the right of the 'Start' button will also become clickable. By clicking this 'Save' button, users can download the calculation result to their local device.","8000.0013":"Right-click on the corresponding brain region or nucleus in the main window can jump to Arbitrary plane visualization and neuroanatomical knowledge base.","8000.0014":"As shown in ① and ②, users can select any region of interest within the 3D space of STAM and download the original images of the selected region at different sampling rates.","8000.0015":"Users can click “Select the range” button and orange-lined box will appear in the main window. Users can control the box's translation by left-clicking and dragging the red, green, and blue arrows, respectively. When an arrow is selected, it will be highlighted as bright yellow. ","8000.0016":"Users can switch from translation mode to scaling mode by pressing the 'A' key on the keyboard. In this mode, the arrows will change to squares, and dragging these squares will resize the box. Once the spatial range for the data to be downloaded is determined, users can click the 'preview selected data' button. This will visualize the images within the selected range in the main window using volume rendering.","8000.0017":"By dragging the 'Set the downsampling rate' slider, users can select the sampling rate for the data to be downloaded. The specific sampling rate value can be seen in the black-backgrounded tip above the slider. If the data size does not exceed 1 GB, clicking the 'Downloading' button to download it directly; When the value is exceeded, it will invoke the user's email client (such as Outlook) and automatically fill in the email body with the selected download range and sampling rate information. By clicking the send button, users can submit a data download request to the STAM website.","8000.0018":"We support users in uploading 3D image data and neuronal morphology data previously registered to the Common Coordinate Framework (CCF), then mapping it onto STAM, and directly visualizing it in 3D space. We also support reverse mapping, which allows data of the same type that has been registered to STAM to be mapped onto the CCF.","8000.0019":"Users can click the 'Upload' button in the right panel to upload 3D image data or neuronal morphology data that has been previously registered to either the CCF or STAM. After the uploading is completed, selecting the direction of conversion (either from STAM to CCF or vice versa) , select YES or NO for the option “The vertical size of CCF is expanded to 9 mm”in the 'Select the direction of conversion' radio button. Then, click the 'Start' button to start the calculation on the STAM server. At this point, the 'Start' button enters the waiting status.After uploading an SWC file, the slider/input box with the 1-100 μm range becomes available. The user can then adjust the resolution value of the neuron, select YES or NO for the option “The vertical size of CCF is expanded to 9 mm”, and finally click the Start button to perform the computation.","8000.0020":"After waiting for about 10 minutes, the STAM server finishes the calculation and returns the results. At this point, both the 'Save' button and the 'View result' button become clickable. Clicking the 'Save' button allows you to download the results to your local device; clicking the 'View result' button lets you preview the calculation results in the main window.","8000.0021":"We provide services to visualize atlas reslicing from any angle. Users can choose reslicing of STAM at any position and angle of interest, browse the brain regions and nucleus annotations on that reslicing, and jump from this reslicing to the isotropic 1-micron resolution reslicing provided by the STAM arbitrary section service.","8000.0022":"As shown in ①, on the left of the main window is the data panel, which has the same function as the data panel in “Stereotaxic topography visualization”. The central area is the main window.","8000.0023":"As shown in ②, users can also achieve translation and rotation of the atlas reslicing by dragging the sliders. The specific translation and rotation values can be seen in the black-background tip above the slider.","8000.0024":"Users can control the atlas reslicing's translation by left-clicking and dragging the red, green, and blue arrows, respectively. Users can switch from translation mode to rotation mode by pressing the 'R' key on the keyboard. In this mode, the arrows will change to sphere, and dragging these spheres will control the rotation of the atlas reslicing. ","8000.0025":"Users can also achieve translation and rotation of the atlas reslicing by dragging sliders. Users can clicking the “View higher resolution image” button can jump to Arbitrary plane visualization and click the “Requesting STAM labels” button and fill in the license to download 3D label images of isotropic 10 micron resolution STAM atlas.","8000.0026":"We provide services to visualize neuronal circuits of whole mouse brain somas or projection targets. Users can select any neural circuit data with somas or projection targets located in brain region or nuclei of interest, and examine the corresponding brain region and nuclei annotations of the neural circuit.","8000.0027":"As shown in ①, on the left of the main window is the data panel, which has the same function as 'Stereotaxic topography visualization'. The 'Neurons' tab is used to query and filter neuron morphological data with somas or projection targets located in regions of interest.","8000.0028":"As shown in ②, users can search for the brain region or nucleus of interest in the search box.","8000.0029":"As shown in ③, it is a neural circuit connection diagram composed of several brain regions and nucleus substructures.","8000.0030":"Users can click the 'whole brain connectivity diagram' button or search for the brain region or nucleus of interest in the search box to pop up a neural circuit connection diagram composed of several brain regions and nucleus substructures. Different dots represent different brain regions and nuclei, and the name of the brain region or nuclei is displayed next to the dot. Users can hover the mouse over dot or the name of a brain region or nuclei, left and right click the dot.","8000.0031":"Double click any dot representing a brain region or nuclei to hide the neural circuit connection diagram window and return to the main window page, displaying the upstream and downstream connection relationships of that structure. The neural circuits projected to the selected brain area and nucleus are displayed in the Upstream window, and the projection target areas of the selected brain area and nucleus are displayed in the Downstream window. Users can select any number of neurons of interest via checkboxes and visualize them in the main window.","8000.0032":"Query of anatomical structures, cerebral vascular, and neurons","8000.0033":"Visualize anatomical substructures and switch coordinate origin","8000.0034":"Visualization function settings","8000.0035":"Automatic planning mode","8000.0036":"Manual planning mode","8000.0037":"Upload brain slice image and calculate or download registration result","8000.0038":"Function of page jump","8000.0039":"Zoom mode to select the range of original image data and previews the image","8000.0040":"Select the sampling rate of the data and download","8000.0041":"Upload 3D image data and calculate","8000.0042":"Preview or download the result after the calculation is completed","8000.0043":"Translate or rotate the slice of the atlas for sectional view","8000.0044":"Download 3D label images of isotropic 10 micron resolution STAM atlas","8000.0045":"View the neural circuit connectivity diagram and interact","8000.0046":"Display the upstream and downstream connections of any user-appointed brain structure","8000.0047":"ranslation mode to select the range of original image data","5000.7001":"atlas","5000.7002":"first","5000.7003":"second","5000.7000":"(Optional) Upload the second slice, which is previously co-registered to the first uploaded slice","5000.7004":"opacity","5000.7005":"Terminals","5000.7006":"Visibility","5000.7007":"Branchings","5000.7008":"Analysis","5000.7009":"Distribution of neuron terminals","5000.7010":"terminals","5000.7011":"Pattern of neuron projections","5000.7012":"Distribution of projection length","5000.7013":"fliplr","7000.7014":"Also, you can download the ","7000.7015":" plugins for this function. If you want to use the test data, click","7000.7016":" here ","7000.7017":"to download.","7000.7018":"Issue report","7000.7019":"Set as the focus","7000.7020":"Reset the focus","7000.7021":"Reslicing Mode","7000.7022":"Translate","7000.7023":"Rotate","7000.7024":"Control mode","7000.7025":"Display available neurons only","7000.7026":"Click the Color button to modify the neuron color; click the Ana. button to display the analysis results of the neuron's projection pathway; click the Path button to show the brain structures traversed by the neuron on the main window; the Src button displays the source of the neuron data.","7000.7027":"Feedback","7000.7028":"Display line chart and scatter plot","5000.7026":"Request timed out, download failed","5000.7027":"computational failure","5000.7028":"Cannot find a satisfactory path","5000.7029":"Too many regions to avoid, please try again in 3 minutes","5000.7031":"If you haven't applied for the key, you can click it.","8000.00031":"As shown in ④, the toolbars from left to right are: Return to Home, Switch Coronal sections, Switch Sagittal sections, Switch Horizontal sections, Reset View, Display Settings, Feedback.","5000.7030":"Click here to download the queried results","5000.7032":"Neuron registration","5000.7033":"Cloud atlas","5000.7034":"Send successful!","5000.7035":"Server exception","5000.7036":"Hide the cloud atlas of this nuclear group","5000.7037":"View the cloud atlas of this nuclear group","11000.0001":"Year","11000.0002":"Type","5000.7040":"The vertical size of CCF is expanded to 9mm","5000.7041":"YES","5000.7042":"NO","5000.7043":"functionalLoop","5000.7044":"Functional circuit analysis","5000.7045":"AI assistant","5000.7046":"Planning mode:","5000.7047":"Path constraint","5000.7048":"Arbitrary","5000.7049":"Default mode is manual; You can switch to Auto mode to perform intelligent planning","5000.7050":"Please down-sample the slice image to ~10μm/pixel before uploading","5000.70251":"Analysis neurons"},YTn={"2002.0301":"提供基于多人在线协作模式,神经元重建","5000.0112":"取消","2002.0302":"查看数据","5000.0111":"提交","4000.0210":"平移-X","2002.0300":"神经元协同标注平台","5000.0113":"董宏伟命名系统别名","4000.0212":"平移-Z","4000.0211":"平移-Y","4000.0214":"角度-Y","5000.0110":"编辑","4000.0213":"角度-X","4000.0216":"查看高分辨率切片","4000.0215":"角度-Z","4000.0218":"坐标","4000.0217":"左半脑","4000.0219":"基准点","4000.0100":"","4000.0221":"转到冠状面","4000.0220":"大小","4000.0102":"前囟","4000.0223":"转到水平面","4000.0101":"单位:毫米","4000.0222":"转到矢状面","4000.0104":"矢状面","4000.0225":"引导","4000.0103":"冠状面","4000.0224":"转到任意面","2001.0402":"查看数据","4000.0106":"脑解剖结构检索","2001.0401":"探索血管图谱数据库","4000.0105":"水平面","4000.0226":"完成","4000.0108":"脑地图4.0命名系统","4000.0229":"下一步","2001.0403":"血管","4000.0107":"艾伦参考脑命名系统","4000.0228":"跳过","4000.0109":"小鼠脑图谱","2001.0400":"血管图谱","1000.0400":"登录","2002.0202":"查看数据","2002.0200":"配准服务","2002.0201":"提供脑片配准服务","6000.0112":"请输入电子邮箱","6000.0110":"请输入数据用途","6000.0111":"Label图像下载","7000.0108":"开始计算","7000.0109":"下载保存","7000.0106":"计算与上传图像对应的图谱切面","7000.0107":"查看更高分辨率的图像","4000.0201":"解剖结构","4000.0443":"先在左侧选择一个结构","7000.0104":"获取测试图像","4000.0200":"","7000.0105":"上传","4000.0203":"虚拟手术","4000.0445":"在右侧可以拖动截面的位置","7000.0102":"描述","4000.0202":"装配图","4000.0444":"在模型中右击选择你需要的面","7000.0103":"选择上传图像的类型","4000.0205":"展开幅度","7000.0100":"","4000.0204":"图谱切面","4000.0446":"点击查看更高分辨率的图像跳转","7000.0101":"配准服务","4000.0207":"缩放","4000.0206":"步长","2001.0101":"探索立体定位图谱的2D/3D图像信息","4000.0209":"重置","2001.0100":"立体定位图谱","4000.0208":"选择靶点","2001.0102":"查看数据","1000.0302":"联系我们","1000.0303":"帮助","1000.0300":"关于","1000.0301":"简介","4000.0131":"仅显示结构轮廓","4000.0130":"显示图谱","2002.0101":"提供高分辨任意角度切面服务","2002.0102":"查看数据","4000.0132":"核团信息","7000.0113":"上传和下载","7000.0111":"上传的图像","7000.0112":"输出的图像","7000.0110":"如果对这个在线注册工具有任何疑问,欢迎联系atlas@brainsmatics.org","2002.0100":"高分辨任意角度切面服务","6000.0105":"数据用途","6000.0106":"提交","6000.0103":"通讯地址","6000.0104":"电子邮箱","6000.0109":"请输入通讯地址","2000.2001":"图谱和数据","6000.0107":"请输入单位名称","6000.0108":"请输入联系人员","2001.0200":"特定类型细胞分布图谱","6000.0101":"单位名称","6000.0102":"联系人员","2001.0202":"查看数据","2001.0201":"探索特定类型细胞分布图谱的2D/3D图像信息","6000.0100":"","1000.0203":"神经元协同标注平台","1000.0204":"数据共享服务","1000.0200":"工具","1000.0201":"高分辨任意角度切面服务","1000.0202":"配准服务","2000.2002":"服务","2000.0500":"脑图谱","2002.0400":"数据共享服务","4000.0230":"上一步","2002.0401":"Label图像下载服务","4000.0111":"背-腹","4000.0232":"第二步","4000.0110":"前-后","4000.0231":"第一步","4000.0113":"显示","4000.0234":"第四步","4000.0112":"内-外","4000.0233":"第三步","2002.0402":"查看数据","4000.0115":"二维浏览","4000.0236":"在左侧选择一个结构","4000.0114":"三维图谱","4000.0235":'点击"开始"按钮',"4000.0117":"重置为默认视图","4000.0238":'点击"结束"按钮',"4000.0116":"标注","4000.0237":"在选择的结构上左键点击确定注射位点,<br>再通过移动鼠标确定注射方向","4000.0119":"网格线","4000.0118":"信息框","4000.0239":"设置展开长度","4000.0120":"前往","4000.0241":"点击此处图标,选中的结构会展开,<br>再次点击该图标后可以从展开状态中退出","5000.0101":"Paxinos命名系统别名","4000.0240":"设置中心展开的缩小程度","5000.0100":"","4000.0122":"该结构介绍","5000.0103":"参考","4000.0121":"三维浏览器","4000.0242":"清除靶点","5000.0102":"Hof命名系统别名","4000.0124":"缩小","4000.0123":"图示","4000.0126":"重置","4000.0125":"放大","4000.0128":"前往三维浏览器","5000.0109":"化学物质名称","2001.0302":"查看数据","4000.0127":"全屏","5000.0108":"疾病名称","4000.0129":"查看高分辨率图像","5000.0105":"疾病","5000.0104":"基因","2001.0301":"探索神经元形态数据库","5000.0107":"基因名称","2001.0300":"神经元形态数据库","5000.0106":"化学物质","1000.0104":"血管图谱","1000.0100":"脑图谱数据","1000.0101":"立体定位图谱","1000.0102":"特定类型细胞分布图谱","1000.0103":"神经元形态数据库","5000.0001":"脑片配准","5000.0002":"上传图像","5000.0003":"上传失败,请联系管理员","5000.0004":"显示结果","5000.0005":"数据下载","5000.0006":"选取下载范围","5000.0007":"取消选取范围","5000.0008":"预览下载图像","5000.0009":"提示:按A键切换平移和缩放模式","5000.0010":"设置采样倍数","5000.5012":"默认模式","5000.5013":"虚拟手术模式","5000.5014":"图谱映射","5000.5015":"选择转换方向","5000.5016":"颅骨","5000.5018":"下载所选范围","5000.5019":"上传已配准到STAM或CCF的3D图像或swc文件","5000.5020":"将上传数据映射到另一个图谱:","5000.5021":"开始计算","5000.5022":"下载保存","5000.5023":"显示结果","5000.5024":"其它图谱","5000.5025":"设置","5000.5026":"极简模式","5000.5027":"选择注射脑区","5000.5028":"选择注射靶点","5000.5029":"清除注射靶点","5000.5017":"开始智能规划","5000.5030":"规划中","5000.5031":"数据块预估大小:","5000.5032":"显示其他","5000.5033":"控制面板","5000.0019":"也可以按R在旋转模式和平移模式之间切换","5000.5034":"自动","5000.5035":"手动","5000.5057":"显示三维形貌","5000.5056":"隐藏三维形貌","5000.5058":"无法规划路径以避开勾选的结构","5000.5060":"隐藏投射路径","5000.5061":"显示投射路径","5000.5039":"下载{{name}}周围的原始图像","5000.5038":"切换{{name}}为坐标原点","5000.5040":"输入胞体所在脑区简写或全称","5000.5041":"输入投射所在脑区简写或全称","5000.0206":"显示穿过的血管分支","5000.0207":"隐藏穿过的血管分支","5000.0208":"显示被供血的结构","5000.0209":"隐藏被供血的结构","5000.5044":"使用该功能需要一个API Key。目前我们提供了一个临时的测试Key。请点击Go on按钮","5000.5051":"提示:key值将会发送到所填邮箱账号上,请提交完后关注邮箱是否收到信息。","5000.0011":"发送邮件","5000.5043":"填写Key","5000.5042":"申请Key","5000.5045":"提交","5000.5049":"Key值","5000.5070":"申请人","5000.5071":"邮箱","5000.5072":"所属单位","5000.5073":"使用目的","5000.5050":"保存","5000.5052":"神经环路","5000.5053":"请输入待查询的结构","5000.5047":"提交失败","5000.5048":"提交成功","5000.5054":"上游结构","5000.5055":"下游结构","5000.5083":"步骤一","5000.5084":"步骤二","5000.5085":"设置展开长度","5000.5080":"单击此处的图标以展开所选结构。再次单击图标将允许您退出展开状态","5000.5081":"选择左侧的结构","5000.5082":"请选择注射模式,如果选择自动模式,点击左侧细胞名称选择细胞核进行计算","5000.5086":"对话STAM","5000.6001":"输入一个待查询结构,可视化其连接图谱。可以试着填入 ","5000.6002":"语言切换","5000.0012":"当前下载文件已超出服务器传输限制,您可以选择降低采样等级或者发送邮件,是否发送邮件?","5000.6003":"投射路径","5000.6004":"隐藏该神经元","5000.6005":"冠状视图","5000.6006":"矢状视图","5000.6007":"水平视图","5000.6008":"点击下方按钮,申请下载各向同性10微米分辨率的STAM图谱3D标签图像","5000.6009":"请求STAM标签","5000.6010":"提示:下载所用的许可号将会发送到您所填写的邮箱,请在提交结束后关注是否收到包含许可号的邮件。","5000.6011":"请注意,使用此功能需要提供下载许可号,如果您没有下载许可号,请点击下方按钮向我们申请","5000.6012":"申请下载许可号","5000.6013":"填写下载许可号","5000.6014":"许可号","5000.6015":"查询位于或投射到该结构的神经元","5000.6019":"浏览 {{focusVirusLineItem}} 的知识库页面","5000.6020":"浏览 {{focusVirusLineItem}} 的父结构 {{lableValue}} 的知识库页面","5000.6016":" RGB值","5000.6017":"所属脑区","5000.6018":"查看更高分辨率图像","5000.6021":"隐藏该分支","5000.6022":"设置 {{lableStr}} 的包围盒为下载范围","5000.6023":"隐藏 {{name}} 的三维形貌","5000.6024":"显示 {{name}} 的三维形貌","5000.6025":"切换到冠状面","5000.6026":"切换到矢状面","5000.6027":"切换到水平面","5000.6028":"切换到任意角度切面","5000.6029":"探索由单神经元投射所构成的","5000.6030":"全脑连接范式图","5000.6031":"。您也可以:","5000.6032":"","5000.6033":"上传脑片图像,或使用","5000.6034":"的测试脑片图像:","5000.6035":"上传已配准到STAM或CCF的3D图像或swc文件,或使用测试","5000.6036":"3D图像","5000.6037":"swc文件:","5000.6038":"数据来源: {{name}}","5000.6039":"平颅方位","5000.6040":"投射丰富","5000.6041":"新标注","5000.6042":"关闭","5000.6043":"启用","5000.6044":"网格","5000.6045":"脑外轮廓","5000.5087":"步骤三","5000.5088":"步骤四","8000.0001":"如①所示,在主窗口左侧的是数据面板,用户可以在该选项卡下选择STAM的解剖命名树,配准到STAM上的完整脑血管图谱和神经元数据。用户也可以切换两个不同版本的命名系统。","8000.0002":"如②所示,主窗口中可以加载脑区、核团的三维模型。","8000.0003":"如③所示,用户可以切换不同的模式或者功能模块","8000.0004":"Regions选项卡包含的是STAM的解剖命名树,用户可以在该选项卡下的复选框中选择任意数量的感兴趣结构,在主窗口中可视化;Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。","8000.0005":"用户可以点击Regions选项卡下的解剖命名树中蓝色的方块图标,此时主窗口中会以组装的形式可视化用户点击结构的所有子结构,同时展开幅度可在右侧面板设置。默认情况下,该坐标系统以Bregma点作为原点。户也可以将坐标原点切换为STAM的其它任意19个颅骨或颅内基准点,主窗口中可视化对象的坐标值将根据新的原点重新计算。右击任意基准点,可以保存以基准点为坐标原点的STAM标签图像。","8000.0006":"用户可以在页面底部切换到setting选项卡。Left hemisphere开关决定是否展示左半脑,默认为Off。Coordinate开关决定是否在主窗口中显示坐标数值,默认为On。Datum Marks开关决定是否在主窗口中显示基准点,默认为On。Cranial开关决定是否在主窗口中显示颅骨的三维轮廓,默认为Off。","8000.0007":"我们提供了虚拟手术导航服务,用户可以通过交互操作,模拟向小鼠脑注射病毒的立体定位手术过程。STAM会根据用户操作,返回注射位点与作为坐标原点的颅骨或颅内基准点之间的距离和注射角度信息。","8000.0008":"首先,选择注射的大脑区域。接着,在所选的大脑区域上选择注射目标。目标选定后,一个绿色点会出现在该大脑区域三维模型的表面,并随着鼠标光标移动。同时,Clear Target 按钮会变为可用状态,用户可根据需要更改注射目标。随后,点击 Auto 按钮进入自动模式,此时左侧数据面板中的 Structure for injecting 标签会变为 Regions to avoid。通过点击需要避开的脑区或核团名称,所选文本会以鲜红色高亮显示,同时这些结构的三维轮廓会在主窗口中呈现。接下来,点击右侧面板上的 Intellectual planning 按钮即可启动计算。几秒钟后,STAM 会生成一条路径,该路径从注射目标出发,并避开所有用户所选择的大脑区域和核团。","8000.0009":"如果用户选择 “Manual” 进入手动规划模式,已标记的注射目标会变为一个蓝点。与此同时,Clear Target 按钮会变为可用状态,用户可根据需要更改注射目标。目标设定后,一条红色虚线会从注射目标出发,延伸到当前鼠标位置。这条虚线与 STAM 轮廓的交点(即注射入口点)会以绿色标记。用户可以根据需要选择 Path constraint 中的不同选项进行注射。当用户确定合适的注射路径后,可以通过鼠标左键点击进行标记。被标记的路径将在主窗口中显示为一条蓝色实线,注射入口点则显示为一个蓝色圆锥。路径经过的大脑区域和核团的名称会按照其空间位置沿蓝色实线路径依次排列。右侧面板会显示关于注射路径与三个标准解剖方向之间的角度、注射目标以及注射入口点的信息。如果用户希望重新开始整个虚拟手术过程,可以点击右侧面板中的 “Reset” 按钮。","8000.0011":"如①所示,用户可上传PI或DAPI染色的单张脑片图像,该服务将通过约1分钟的服务器端计算,从STAM中重切出一张与用户上传的脑片位置最接近的图谱切面,并根据计算出来的角度和位置显示在主窗口中。","8000.0012":"用户可以从本地上传待配准的tif/tiff格式的二维脑片图像。然后选择上传图像的类型。接着点击Calculate the corresponding plane from the atlas按钮组中的Start按钮,等待后台返回计算结果。计算完成后,Start按钮下方会出现计算结果的预览图,可左键单击放大查看。Start按钮右侧的Save按钮此时也变为可点击,用户单击该按钮,可以将计算结果下载到本地。","8000.0013":"在主窗口右击相应的脑区、核团,可以跳转到任意剖面可视化和脑解剖知识库页面。","8000.0014":"如①和②所示,用户可以在STAM所在的三维空间中选取任意感兴趣范围,并以不同的采样倍数下载自己选取范围内的原始图像。","8000.0015":"用户可以点击“Select the range”按钮,然后主窗口中出现一个橙色线条的方框。用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制方框在各个方向上的平移,当某个方向的箭头被用户选中时,该箭头会变为高亮的黄色。","8000.0016":"用户也可以通过按下键盘上的“A”,将范围选取操作从平移模式切换为缩放模式。此时方框的箭头会变为方块,拖动方块,就可以改变方框的大小。经过上述操作明确了待下载数据的空间范围后,可以点击“预览下载图像”按钮,通过体绘制,在主窗口中对该范围内的图像进行可视化。","8000.0017":"拖动“Set the downsampling rate”滑动条,用户可以选择待下载数据的采样倍数;具体的倍数值可通过滑块上方的黑色背景提示文字查看。当数据量没有超过1 GB时,点击Downloading按钮可直接下载;当超过该数值,点击Downloading按钮会唤起用户终端的邮箱管理工具(如Outlook等),并自动将待下载范围和采样倍数信息填入邮件中,此时用户点击邮件发送按钮,即可向STAM网站发送数据下载申请。","8000.0018":"我们支持用户上传此前已经配准到Common Coordinate Framework(CCF)的三维图像数据和神经元完整形态数据,并将其映射到STAM上,并直接在三维空间中进行可视化;我们也支持反向映射,即将已经配准到STAM的同类型数据映射到CCF上。","8000.0019":"用户点击右侧面板的Upload按钮,上传已配准到CCF或者STAM的三维图像数据或神经元形态学数据。上传结束后,在Select the direction of conversion单选框中,确定数据的映射方向是从STAM到CCF还是反过来。此后点击Start按钮,STAM的服务器端开始计算,Start按钮变为等待状态。当上传swc文件,1-100微米标准的滑动条/输入框变为可操作状态,用户可调整该神经元的分辨率数值,然后CCF的垂直方向尺寸已扩展到9mm项选择YES或者NO,最后点击Start按钮进行计算。","8000.0020":"等待约10分钟后,STAM的服务器端完成计算并返回结果。此时Save按钮和View result按钮均变为可点击状态。点击Save按钮,可以将计算结果下载到本地;点击View result按钮,可以在主窗口中预览计算结果。","8000.0021":"我们提供了沿任意角度可视化脑图谱切面的服务。用户可以查看感兴趣的STAM任意位置和角度的切面,浏览该切面上的脑区、核团标注,并由该图谱切面跳转到STAM任意切面服务所提供的各向同性1微米分辨率切面。","8000.0022":"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同。位于正中区域的是主窗口。","8000.0023":"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。具体的平移、旋转数值可通过滑块上方的黑色背景提示文字查看。","8000.0024":"用户通过长按鼠标左键,拖动红、绿、蓝三种颜色的箭头,可以控制图谱切面的平移。用户也可以通过按下键盘上的“R”,将范围选取操作从平移模式切换为旋转模式。此时箭头会变为球形,沿球形拖动,就可以控制图谱切面的旋转。","8000.0025":"用户也可以通过拖动滑动条,实现图谱切面的平移和旋转。点击viewer higher resolution image按钮可以跳转到任意剖面可视化界面。点击Requesting STAM labels按钮,填入许可证即可下载各向同性10微米分辨率的STAM图谱3D标签图像。","8000.0026":"我们提供全脑的胞体或投射靶区的神经环路数据可视化服务。用户可以选择感兴趣的任意胞体或投射靶区在脑区、核团的神经环路数据,并查看数据对应的脑区、核团标注。","8000.0027":"如①所示,在窗口左侧的是数据面板,与“三维自然形貌可视化”中的数据面板功能相同,其中Neurons选项卡用于查询胞体或投射靶区位于感兴趣脑区的神经元数据。","8000.0028":"如②所示,用户可以在搜索框中搜索感兴趣脑区、核团。","8000.0029":"如③所示,这是一个由若干个脑区、核团子结构组成的神经环路连接示意图。","8000.0030":"用户可以点击“whole-brain connectivity diagram”按钮或在搜索框中搜索感兴趣脑区、核团,即可弹出由若干个脑区、核团子结构组成的神经环路连接示意图。不同圆点表示不同的脑区、核团结构,圆点旁边显示的是脑区、核团的名称。用户可以将鼠标移动到圆点、脑区或核团的名称上,左击或右击圆点。","8000.0031":"双击任意一个代表某个脑区、核团结构的圆点,神经环路连接示意图窗口隐藏,回到主窗口页面,显示该结构的上下游连接关系。在Upstream窗口中展示了投射到选中脑区、核团的神经环路,在Downstream窗口中展示了选中脑区、核团的投射靶区。用户可以用复选框选择任意数量的感兴趣神经元,在主窗口中可视化。","8000.0032":"解剖结构、脑血管和神经元查询","8000.0033":"可视化解剖子结构并切换坐标原点","8000.0034":"可视化功能设置","8000.0035":"自动导航模式","8000.0036":"手动导航模式","8000.0037":"上传脑片图像并计算或下载配准结果","8000.0038":"页面跳转功能","8000.0039":"缩放模式选择原始图像数据的范围并预览图像","8000.0040":"选择数据的采样倍数并下载","8000.0041":"上传三维图像数据并计算","8000.0042":"计算完成后预览或下载结果","8000.0043":"平移或旋转图谱切面","8000.0044":"下载高分辨率的STAM图谱3D标签图像","8000.0045":"查看神经环路连接示意图并交互","8000.0046":"显示用户指定脑区上下游连接关系","8000.0047":"平移模式选择原始图像数据的范围","8000.0048":"","5000.7001":"图谱","5000.7002":"脑片1","5000.7003":"脑片2","5000.7000":"(可选)上传第二张脑片图像,默认该图像已经配准到了第一张上传的脑片图像上","5000.7004":"阻光度","5000.7005":"末梢点","5000.7006":"可见性","5000.7007":"分支点","5000.7008":"分析","5000.7009":"神经元末梢分布","5000.7010":"末梢点","5000.7011":"神经元投射模式","5000.7012":"投射长度分布","5000.7013":"左右翻转","7000.7014":"您也可以在此下载","7000.7015":"的插件;您可能需要使用测试数据,请","7000.7016":"在此","7000.7017":"下载。","7000.7018":"报告问题","7000.7019":"设置为焦点","7000.7020":"重置焦点","7000.7021":"重切片模式","7000.7022":"平移 ","7000.7023":"旋转","7000.7024":"控制模式","7000.7025":"只展示可用神经元","7000.7026":"点击Color按钮,修改神经元颜色;点击Ana.按钮,显示神经元投射路径分析结果;点击Path按钮,在主界面显示神经元经过的脑结构;Src按钮展示了神经元数据的来源","7000.7027":"反馈","7000.7028":"显示折线图和点状图","5000.7026":"请求超时,下载失败","5000.7027":"计算失败","5000.7028":"没有合适的路径","5000.7029":"请求过于频繁,请3分钟之后再试","5000.7030":"点此下载查询结果","5000.7031":"如果你没有申请过key可以点击","5000.7032":"神经元配准","8000.00031":"如④所示,工具栏从左到右依次是,回到首页、切换冠状面、切换矢状面、切换水平面、重置视角、显示设置、反馈。","5000.7033":"文献云图","5000.7034":"发送成功!","5000.7035":"服务端异常","5000.7036":"隐藏该核团的文献云图","5000.7037":"查看该核团的文献云图","11000.0001":"年份","11000.0002":"类型","5000.7040":"CCF的垂直方向尺寸已扩展到9mm","5000.7041":"是","5000.7042":"否","5000.7043":"功能环路","5000.7044":"功能环路分析","5000.7045":"AI 助手","5000.7046":"路径规划模式:","5000.7047":"路径限制","5000.7048":"任意角度","5000.7049":"默认模式为手动;您也可以切换到自动模式,执行【自动规划】","5000.7050":"请将图像采样到10微米/像素后再上传","5000.70251":"分析神经元"},KTn="en_us",JTn={zh_cn:"zh",en_us:"en"},kXe=localStorage.getItem("lang")||KTn,QTn=JTn[kXe]||"en";localStorage.setItem("lang",kXe);Nf.use(wTn).init({resources:{en:{translation:qTn},zh:{translation:YTn}},lng:QTn,fallbackLng:"en",interpolation:{escapeValue:!1}});const{Content:e4n}=hD;var Zh=new Ere({antialias:!0,logarithmicDepthBuffer:!0});Zh.localClippingEnabled=!0;var t4n=new c1(window.innerWidth-450,window.innerHeight);const iq=new dTn(Zh,t4n);let xIe;new OXe(pTn);let n4n=new URL(window.location.href),Vm=new URLSearchParams(n4n.search),_Ie=Vm.get("datumMarkVisibility"),wIe=Vm.get("regionsChecked"),TIe=Vm.get("vesselsChecked"),IIe=Vm.get("neuronsChecked");Vm.get("leftHemisphereVisibility");let AIe=Vm.get("terminalVisibility"),RIe=Vm.get("branchingVisibility"),OIe=Vm.get("branchingColor"),LIe=Vm.get("gridVisibility"),NIe=Vm.get("echart_Value"),MIe=Vm.get("leftTabIndex");const r4n=t=>{const{atlasTopography:e,cerebralVessels:n,datumMarks:r,atlasColormap:i,atlasOntology:a,resourceTab:o,toolTab:s,ScaleNum:l,lang:u,home:d,ServerUrl:f}=t,{t:p}=OTn(),h=S.useRef({}),g=S.useRef(null),y=S.useRef(new sIe(Vi.current,Zh.domElement)),[v,m]=S.useState(1),b=S.useRef(1),[E,C]=S.useState(_Ie?JSON.parse(_Ie):!0),x=S.useRef(null),_=S.useRef(null),A=S.useRef([]),P=S.useRef(null),R=S.useRef(null),N=S.useRef(!1),D=S.useRef(!1),[U,z]=S.useState(!0),[B,j]=S.useState([]),V=S.useRef(2),[G,W]=S.useState(""),Z=S.useRef([]),H=S.useRef([]),X=S.useRef(new va),[ee,K]=S.useState("nucleusColour"),Y=S.useRef(1),Q=S.useRef(null),[re,ne]=S.useState(!0),oe=S.useRef(),de=S.useRef(),ue=S.useRef(),pe=S.useRef(),[ie,Se]=S.useState(wIe?JSON.parse(wIe):[]),[ae,ve]=S.useState(TIe?JSON.parse(TIe):[]),[fe,Re]=S.useState(IIe?JSON.parse(IIe):[]),ze=S.useRef(Gn=>new Ie),[Je,Fe]=S.useState(!1),Te=S.useRef(new Ie),[qe,me]=S.useState(new Ie),[he,Ve]=S.useState(MIe?parseInt(MIe):1),Pe=S.useRef(!1),[Ue,at]=S.useState(!1),Ke=S.useRef(""),[Ze,ct]=S.useState(3),yt=S.useRef(null),wt=S.useRef([]),[lt,dt]=S.useState(""),We=S.useRef(()=>{}),[rt,mt]=S.useState(1),Me=S.useRef(1),[ft,Yt]=S.useState({}),[Ht,At]=S.useState(""),Zt=S.useRef({}),[tn,bn]=S.useState(""),[Pn,Dn]=S.useState(""),[qn,Rr]=S.useState({}),[Br,Jn]=S.useState(NIe||""),[Vt,Wn]=S.useState(!1),[mn,hr]=S.useState(0),[gr,ht]=S.useState({}),Ft=S.useRef({}),[gn,$e]=S.useState(LIe?JSON.parse(LIe):!0),[St,Lt]=S.useState([]),[Pt,Rt]=S.useState([]),[Wt,Bt]=S.useState([]),[Qt,On]=S.useState(!1),[qt,zt]=S.useState({});localStorage.setItem("lang",u||"en"),Zi.current=l,So.current=-5.7,Ka.current=-6,po.current=-7.0055;const[nn,Nn]=S.useState([]),kn=S.useRef({start:RIe?JSON.parse(RIe):!0,end:AIe?JSON.parse(AIe):!0,start_color:OIe||"#A7B5A1"});S.useEffect(()=>{var Si;be.current=new LM,Vi.current=new Id(45,(window.innerWidth-450)/window.innerHeight,.01,1e4),Vi.current.position.set(18,-10,-10),Vi.current.up.set(0,-1,0),Vi.current.lookAt(new Ie(0,0,0)),b3.current=new z_(16777215,4.5,0,.04),b3.current.position.set(18,-10,-10),be.current.add(b3.current),be.current.background=new Ir("#fff"),(Si=g.current)==null||Si.appendChild(Zh.domElement),Zh.setSize(window.innerWidth-450,window.innerHeight),y.current=new sIe(Vi.current,Zh.domElement);let Gn=new URL(window.location.href),fr=new URLSearchParams(Gn.search),pi=fr.get("cameraInfo"),hi=fr.get("controllerInfo");if(pi&&hi){let or=JSON.parse(pi),Er=JSON.parse(hi);Vi.current.position.set(or.cameraPosition.x,or.cameraPosition.y,or.cameraPosition.z),b3.current.position.set(or.cameraPosition.x,or.cameraPosition.y,or.cameraPosition.z),Vi.current.rotation.set(or.cameraRotation.x,or.cameraRotation.y,or.cameraRotation.z),y.current.reset(),y.current.target.set(Er.controlsTarget.x,Er.controlsTarget.y,Er.controlsTarget.z),y.current.object.position.set(Er.controlsPosition.x,Er.controlsPosition.y,Er.controlsPosition.z),y.current.object.up.set(Er.controlsUp.x,Er.controlsUp.y,Er.controlsUp.z),y.current.update(),Vi.current.updateMatrixWorld()}y.current.rotateSpeed=10,y.current.zoomSpeed=6,y.current.minDistance=1,y.current.maxDistance=6e3,y.current.staticMoving=!0,y.current.addEventListener("change",function(or){b3.current.position.set(Vi.current.position.x,Vi.current.position.y,Vi.current.position.z);const Er=JSON.stringify({cameraPosition:Vi.current.position,cameraRotation:Vi.current.rotation}),ni=JSON.stringify({controlsTarget:y.current.target,controlsPosition:y.current.object.position,controlsUp:y.current.object.up});let Zn=new URL(window.location.href),Gr=new URLSearchParams(Zn.search);Gr.set("cameraInfo",Er),Gr.set("controllerInfo",ni),Zn.search=Gr.toString(),window.history.replaceState({},"",Zn)}),window.addEventListener("resize",cr),window.addEventListener("wheel",En),document.addEventListener("contextmenu",function(or){or.preventDefault()}),xIe=new fTn(be.current,Vi.current),iq.addPass(xIe),sr(),f&&kr(f),fetch("/app-api/p2p-api/folders").then(or=>{if(!or.ok)throw new Error(`HTTP error! Status: ${or.status}`);return or.json()}).then(or=>{if(or.code===200){let Er=[{title:"Local",value:"0",key:"0",children:[]},{title:"Web",value:"1",key:"1",children:[]}];or.data.forEach(ni=>{const Zn={title:ni.path,key:ni.name,value:ni.path};ni.path.length>46?Er[1].children.push(Zn):Er[0].children.push(Zn)}),Nn(Er)}}).catch(or=>{console.error("Fetch error:",or)})},[]),S.useEffect(()=>{Cr(Wt)},[Wt]);const Cr=Gn=>{fetch("/app-api/p2p-api/swctree",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:Gn}),redirect:"follow"}).then(fr=>fr.json()).then(fr=>{Rt(fr.data.swctree),zt(fr.data.soma_axon_data)}).catch(fr=>console.log("error",fr))};S.useEffect(()=>{let Gn=new URL(window.location.href),fr=new URLSearchParams(Gn.search);fr.set("leftTabIndex",String(he)),Gn.search=fr.toString(),window.history.replaceState({},"",Gn)},[he]);async function kr(Gn){try{const fr=await fetch(Gn);if(!fr.ok)throw new Error("Network response was not ok "+fr.statusText);const pi=await fr.json();pi.code===200?Lt(pi.data):console.error("Failed to fetch tab:",pi.message)}catch(fr){console.error("Error fetching data:",fr),alert("接口不可用,请检查服务器状态。")}}const cr=()=>{Zh.setSize(window.innerWidth-450,window.innerHeight),Vi.current.aspect=(window.innerWidth-450)/window.innerHeight,Vi.current.updateProjectionMatrix()},En=()=>{y.current.update();const Gn=Vi.current.position;let fr=be.current.getObjectByName("DR-anterior");if(fr){const pi=Gn.distanceTo(fr.position);for(let hi in h.current)h.current[hi].contentobj.children.forEach(or=>{or.levels.forEach((Er,ni)=>{ni===0?Er.object.visible=pi<9:ni===1&&(Er.object.visible=pi>=9)})});be.current.traverse(function(hi){hi.name==="lineNameMesh"&&hi.type==="Mesh"&&(pi<9&&pi>=6?hi.scale.x!=.3&&hi.scale.set(.3,.3,.3):pi<6?hi.scale.x!=.2&&hi.scale.set(.2,.2,.2):hi.scale.x!=.5&&hi.scale.set(.5,.5,.5))})}},sr=()=>{requestAnimationFrame(sr),y.current.update(),Vi.current.updateMatrixWorld(),be.current.traverse(function(Gn){Gn.name==="lineNameMesh"&&Gn.type==="Mesh"&&(Gn.up.set(0,-1,0),Gn.rotation.copy(Vi.current.rotation))}),iq.render()},Vn=Gn=>{Ve(Gn),V.current=Gn},Fn=Gn=>{mt(Gn.target.value),Me.current=Gn.target.value};return S.createElement(hD,{className:"content",style:{overflowX:"hidden"}},S.createElement(e4n,{className:"Box3D",style:{height:"100%",display:"flex"}},S.createElement("div",{style:{height:"calc(100vh - 5px)",overflowY:"auto",background:"#fff",padding:10,position:"relative",borderRight:"1px solid #ccc"}},S.createElement(gg,{onChange:Vn,activeKey:he.toString(),style:{width:300},defaultActiveKey:"1"},o.includes("label")?S.createElement(I5,{forceRender:!0,tab:Y.current==2?Ze===2?"Regions to avoid":"Structure for injecting":"Regions",key:String(o.indexOf("label")+1)},S.createElement(XN,{regionData:e,tasktype:"task3D",ref:oe,setdatum:C,offset_factor_R:b,vesselObj:h,treeDatas:a,type:"fbx",leftTreeRef:_,resourceTab:o,baozhaRef:x,needBaozha:!0,offset_factor:v,renderer:Zh,axis_font:A,t:p,json_name:ee,title:"Regions",showimage:re,setCheckItems:Se,checkItems:ie,outflag:Je,clickPoint:Te,setendPoint:me,automaticGroup:wt,mode:rt,echartValue:Br,setEchartValue:Jn,updatePage:ft,auxRef:de})):null,o.includes("vessel")?S.createElement(I5,{forceRender:!0,tab:Ze===2?"Vessels to avoid":"Vessels",key:String(o.indexOf("vessel")+1)},S.createElement(XN,{regionData:e,tasktype:"task3D",ref:ue,offset_factor_R:b,offset_factor:v,vesselObj:h,treeDatas:n,type:"vessel",axis_font:A,t:p,renderer:Zh,title:"Vessel",setdatum:function(Gn){throw new Error("Function not implemented.")},json_name:"",setCheckItems:ve,checkItems:ae,clickPoint:Te,automaticGroup:wt,mode:rt})):null,o.includes("neurons")?S.createElement(I5,{forceRender:!0,disabled:Ze===1,tab:"Neurons",key:String(o.indexOf("neurons")+1)},S.createElement(XN,{regionData:e,tasktype:"task3D",ref:pe,offset_factor_R:b,offset_factor:v,vesselObj:h,treeDatas:Pt,fbxTreeDatas:a,type:"swc",axis_font:A,t:p,renderer:Zh,title:"Neuron",setdatum:function(Gn){throw new Error("Function not implemented.")},json_name:"",swclist:[],metadata:!1,setCheckItems:Re,checkItems:fe,clickPoint:Te,mode:rt,axon_check:qt,swcnameMesh:Zt,childRef:oe,PointShow:kn,Selected:Wt,setSelected:Bt,setFormshow:On,Selectoptions:nn,formshow:Qt})):null,St.map((Gn,fr)=>S.createElement(I5,{forceRender:!0,tab:Gn.name,key:fr+3},S.createElement("p",null,Gn.name))))),S.createElement(cDe,{datum:E,regionData:e,renderer:Zh,controls:y,vesselObj:h,pointDatas:r,currentRef:g,setHrefStr:W,menutagShow:U,setMenuTagShow:z,angleRef:P,jiaoduRef:R,menuTag:B,axis_font:A,startselect:N,mouseflag:D,linemeshs_jing:X,points:Z,points2:H,activetabIndex:Y,fetchCoordinateFunc:ze,checkItems:ie,outflag:Je,clickPoint:Te,setoutflag:Fe,endPoint:qe,outflagRef:Pe,setShowModeChoose:at,virusModeValue:Ke,pipelineClickEvent:yt,focusVirusLineItem:lt,setFocusVirusLineItem:dt,responsefunc:We,mode:Me,childRef:oe,setUpdatePage:Yt,t:p,setSwcItem:At,swcItem:Ht,swcnameMesh:Zt,axon_check:qt,automaticGroup:wt,setCheckItems:Se,vesselRef:ue,swcRef:pe,setLableStr:Dn,setVesselStr:bn,vesselStr:tn,lableStr:Pn,tabIndex:V,updatePage:ft,sectionsInfoRef:Ft,setSectionsInfo:ht,gray_value:i,Luguchecked:mn,gridShow:gn,setNodeStr:Rr}),s.length!=0?S.createElement(vWe,{regionData:e,lefttab:o,righttab:s,ref:de,renderer:Zh,controls:y,offset_factor_R:b,setoffset_factor:m,baozhaRef:x,hrefStr:G,leftTreeRef:_,centerRef:g,childRef:oe,angleRef:P,jiaoduRef:R,mouseflag:D,menutagShow:U,setMenuTag:j,t:p,startselect:N,linemeshs_jing:X,points:Z,points2:H,activetabIndex:Y,material:Q,setShowimage:ne,checkItems:ie,fetchCoordinateFunc:ze,setoutflag:Fe,outflag:Je,clickPoint:Te,setendPoint:me,outflagRef:Pe,setdatum:C,datum:E,axis_font:A,modeChoose:Ue,setShowModeChoose:at,virusModeValue:Ke,setShowTabNums:ct,pipelineClickEvent:yt,automaticGroup:wt,focusVirusLineItem:lt,setMenuTagShow:z,responsefunc:We,mode:rt,setCheckItems:Se,setLeftMenuTabIndex:Ve,updatePage:ft,swcItem:Ht,axon_check:qt,swcnameMesh:Zt,vesselRef:ue,setMode:mt,vesselStr:tn,lableStr:Pn,swcRef:pe,setShowSettingModal:Wn,showSettingModal:Vt,fbxTreeDatas:a,composer:iq,echartValue:Br,setEchartValue:Jn,setSectionsInfo:ht,sectionsInfo:gr,sectionsInfoRef:Ft,gray_value:i,setLuguchecked:hr,Luguchecked:mn,setGridShow:$e,PointShow:kn,nodeStr:qn}):null,S.createElement(pXe,{t:p,home:d,controls:y,setUpdatePage:Yt,setShowSettingModal:Wn,auxRef:de,activetabIndex:Y,index:!1,setFormshow:On,Selectoptions:nn}),s.length==0?S.createElement(_a.Group,{value:rt,onChange:Fn,style:{position:"absolute",right:0,background:"#fff",padding:10,borderLeft:"1px solid rgb(225, 218, 218)"}},S.createElement(_a,{style:{width:131},value:0},p("5000.5026")||"极简模式"),S.createElement(_a,{style:{width:131},value:1},p("5000.5012")||"普通模式"),S.createElement(_a,{style:{width:131},value:2},p("5000.5013")||"病毒标记模式")):null))},i4n=new jS,a4n=S.memo(t=>{const{functionLoopSwcData:e,t:n}=t,[r,i]=S.useState([]),a=S.useRef({}),[o,s]=S.useState({}),l=async g=>{if(!a.current[g]){p([...r,g]),setTimeout(()=>{l(g)},500);return}if(i(v=>v.includes(g)?v:[...v,g]),!a.current[g].visible)d(a.current[g],g),a.current[g].visible=!0;else{const v=be.current.getObjectByName("functionLoopGroup");if(v){const m=v.children.filter(b=>b.userData.fathername===g);for(let b=0;b<m.length;b++)v.remove(m[b])}a.current[g].visible=!1}s({})},u=[{title:"Name",dataIndex:"name",render:g=>S.createElement("a",null,g)},{title:"Path",dataIndex:"img",align:"center",width:50,render:(g,y)=>S.createElement(qi,{placement:"right",title:n("5000.6003")||"投射路径"},S.createElement("svg",{width:"20px",height:"20px",viewBox:"0 0 200 200",version:"1.1",xmlns:"http://www.w3.org/2000/svg",cursor:"pointer",pointerEvents:y.show?"auto":"none",onClick:v=>{l(y.name)}},S.createElement("g",{id:"#1296dbff"},S.createElement("path",{fill:a.current[y.name]&&a.current[y.name].visible?"#1296db":"#515151",opacity:"1.00",d:" M 49.85 22.81 C 59.71 14.23 76.52 14.87 85.29 24.74 C 87.48 27.08 88.68 30.09 90.41 32.73 C 91.80 33.49 93.46 33.21 94.98 33.33 C 111.66 33.26 128.35 33.27 145.03 33.31 C 156.32 33.34 168.08 37.82 175.15 46.90 C 184.45 58.34 185.39 75.18 179.31 88.32 C 175.60 95.86 169.21 102.22 161.27 105.20 C 155.18 107.71 148.53 108.28 142.00 108.29 C 112.98 108.27 83.95 108.30 54.93 108.29 C 47.32 108.11 39.18 111.60 35.74 118.72 C 31.96 126.77 32.58 137.41 38.92 144.04 C 43.19 148.73 49.91 149.96 55.98 150.00 C 72.33 150.03 88.68 149.95 105.04 150.04 C 106.56 150.01 108.10 150.00 109.60 149.65 C 111.78 145.95 113.50 141.75 117.13 139.15 C 126.54 131.15 141.94 131.52 150.80 140.19 C 153.70 142.84 155.15 146.56 157.28 149.78 C 164.10 150.58 171.02 149.34 177.82 150.39 C 184.67 152.33 185.10 163.99 178.15 166.09 C 171.31 167.70 164.18 165.87 157.29 167.06 C 155.14 170.31 153.62 174.04 150.68 176.70 C 140.24 186.50 121.13 185.09 112.96 173.05 C 111.06 170.87 110.76 166.29 107.04 166.72 C 93.69 166.66 80.35 166.74 67.00 166.71 C 57.97 166.58 48.53 167.54 39.99 163.97 C 31.40 160.72 23.97 154.20 20.28 145.72 C 13.84 131.17 16.41 112.32 28.35 101.31 C 36.18 93.81 47.48 91.52 58.00 91.71 C 87.34 91.67 116.69 91.78 146.03 91.68 C 153.59 91.69 161.48 87.76 164.60 80.60 C 168.03 72.44 167.24 61.77 160.57 55.44 C 156.20 51.22 149.90 49.98 144.02 50.00 C 128.01 49.96 112.00 50.06 95.99 49.95 C 94.12 49.98 92.23 49.93 90.41 50.34 C 88.22 54.05 86.50 58.25 82.87 60.85 C 73.46 68.85 58.08 68.47 49.22 59.81 C 46.25 57.21 44.85 53.43 42.73 50.21 C 35.91 49.42 28.99 50.67 22.20 49.60 C 15.26 47.64 14.91 36.10 21.94 33.95 C 28.72 32.23 35.86 34.16 42.71 32.94 C 44.97 29.49 46.61 25.52 49.85 22.81 M 63.32 34.12 C 56.99 36.45 57.07 46.16 62.70 49.22 C 65.17 50.16 68.00 50.11 70.52 49.39 C 73.84 47.68 75.46 43.66 74.83 40.07 C 74.41 34.85 67.77 32.10 63.32 34.12 M 130.37 150.45 C 125.27 151.88 123.75 158.64 126.14 162.91 C 128.25 166.43 133.18 167.23 136.81 165.90 C 141.61 164.64 142.31 158.29 140.69 154.36 C 139.16 150.30 134.12 149.42 130.37 150.45 Z"}))))},{title:"Src.",dataIndex:"image",render:(g,y)=>{const v=y.type;return S.createElement(qi,{placement:"right",title:n("5000.6038",{name:v})||'数据来源"'+v+'"'},S.createElement("a",{href:y.url,target:"_blank"},S.createElement("img",{src:y.image,width:"20px",height:"20px"})))}}],d=(g,y)=>{if(Object.keys(g).length>0){const v=Vi.current.position;let m=be.current.getObjectByName("DR-anterior"),b=0;m&&(b=v.distanceTo(m.position));for(let E in g){if(E==="visible")continue;let{point:C,color:x}=g[E];i4n.load("/staticresource/fonts/helvetiker_bold.typeface.json",function(_){const A=new W6(E.replace("_111",""),{font:_,size:.3,height:.01}),P=new Dl({color:x,specular:0,shininess:0}),R=new ar(A,P),N=b<6?.2:b<9?.3:.5;R.scale.set(N,N,N),R.position.set(C[0]*.01,C[1]*.01,C[2]*.01),R.name="functionSwcText",R.userData.name=E.replace("_111",""),R.userData.fathername=y,R.translateY(Ka.current),R.translateZ(po.current),R.translateX(So.current),A.center();const D=be.current.getObjectByName("functionLoopGroup");D&&D.add(R)})}}},f=(g,y,v,m,b)=>{const E=document.getElementById("spinner");E&&(E.style.display="block"),fetch(g).then(C=>C.json()).then(C=>{let x=Ka.current,_=So.current,A=po.current,P=new eu;const R=new eu;let N=[],D=[];const U={};for(let Q=0;Q<Object.keys(C.length).length;Q++){const re=Object.keys(C.length)[Q];let ne=C.line.findLastIndex(oe=>oe.end_name===re);ne>-1&&(U[re]={},U[re].point=[C.position[C.line[ne].end].x,C.position[C.line[ne].end].y,C.position[C.line[ne].end].z],U[re].name=re,U[re].color=b===0?"rgb(125, 235, 129)":"#2E7D32",U[re].visible=!1)}a.current[y]?a.current[y]={...a.current[y],...U}:a.current[y]=U,C.line.forEach((Q,re)=>{let ne=C.position[Q.end],oe=C.position[Q.start];N.push(ne.x*.01,ne.y*.01,ne.z*.01),D.push(oe.x*.01,oe.y*.01,oe.z*.01)});let z=new Di;z.setAttribute("position",new da(N,3));let B=new oh({glslVersion:Kf,uniforms:{color:{value:new Ir(v)},scale:{value:window.innerHeight/2},size:{value:.05},opacity:{value:1}},vertexShader:`
5695
5695
  precision highp float;
5696
5696
  in vec3 position;
5697
5697
  uniform mat4 modelMatrix;