const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MoveTorrentFileDialog-Dhy8JCS7.js","./ColoredChip.vue_vue_type_script_setup_true_lang-DosC_URk.js","./index-BhWmfNB5.js","./vue-DFryKk-1.js","./vuetify-XtA0Y0Oj.js","./index-X6gg79ld.css","./BulkRenameFilesDialog-CXJ2V15O.js","./BulkRenameFilesDialog-CKEu44go.css","./browserAll-C1HMKx36.js","./webworkerAll-D3jJ_Vry.js","./colorToUniform-C2GHuDhf.js","./CanvasPool-BAToQajg.js","./WebGPURenderer-WqxaCEVy.js","./SharedSystems-B1uG7cSA.js","./WebGLRenderer-DlZELJmP.js"])))=>i.map(i=>d[i]); import{b as ve,a as vo,_ as wo}from"./ColoredChip.vue_vue_type_script_setup_true_lang-DosC_URk.js";import{s as Qt,c as Z,a as Yi,a6 as Gr,a0 as Xi,d as pt,V as Co,Q as yt,r as bs,l as Ao,A as Ue,a7 as rr,h as vt,H as So,B as N,D as q,G as v,m as x,I as W,J as G,u as D,K as He,M as Rt,L as Wi,O as Ye,S as Y,N as j,X as gs,U as ji,w as Je,z as ts,q as vs,n as Se,$ as Nr,T as $t,F as Pt,E as qi,a2 as Cr,R as To,W as Vr,v as ko,a8 as Ki,a9 as Zi,P as Po}from"./vue-DFryKk-1.js";import{bp as rt,a1 as Qi,$ as we,u as ee,F as ws,o as Wt,a2 as Mo,ae as Ji,p as Cs,bq as Te,c as tn,e as As,f as pe,g as en,a as Jt,i as Xe,j as ke,k as ht,d as Ht,l as We,br as Or,J as Io,K as Eo,q as dt,s as st,v as zr,bs as Do,a5 as Vt,V as At,ah as sn,bn as Ro,a8 as Ss,R as _s,U as Fo,ax as Bo,W as Ts,ac as ye,C as me,A as ge,a4 as $o,be as Go,r as ys,t as je,an as Lr,bk as fe,z as No,bt as Is,bh as Vo,bc as Oo,bd as zo,bl as Ur,bu as Lo,bv as Uo,I as Ho,ap as Yo,ai as ir,b8 as Xo,bw as Wo,aO as jo,au as qo,ag as nr,a0 as rn,bx as Ko,by as Es,ad as nn,b as Zo,m as Qo,aw as Hr,b2 as Jo,b0 as ta,a3 as ea,b1 as xe,a7 as sa,__tla as __tla_0}from"./index-BhWmfNB5.js";import{a as on,u as ra}from"./vuetify-XtA0Y0Oj.js";let Ls,Kn,Mt,Tt,ne,lt,te,Ps,_n,Cl,Xt,ai,qe,it,ql,ih,St,_t,mr,kh,ns,dr,Ct,lh,hi,ci,Tl,la,re,Ft,bn,Zn,ft,gt,fh,Rh,Qh,tu,nu,au,lu,Be,Ve,Ui,ph,mh,Pr,Ae,Me,fo,Ai,wi,Wa,xs,qa,go,Yc,Ah,Ze,ps,jt,Ci,aa,Mr,Wn,En,qt,Xn,Zh,qr,Jh,ru,so,ll,ou,Ir,_e,ut,Yt,Ln,ja,uu;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{var le=(r=>(r[r.DISABLED=0]="DISABLED",r[r.NOT_YET_CONTACTED=1]="NOT_YET_CONTACTED",r[r.WORKING=2]="WORKING",r[r.UPDATING=3]="UPDATING",r[r.NOT_WORKING=4]="NOT_WORKING",r))(le||{});class ia{type;id;fullName;name;availability;priority;progress;size;get selectedSize(){return this.wanted?this.size:0}get childrenIds(){return[this.id]}get wanted(){return this.priority!==rt.DO_NOT_DOWNLOAD}deepCount=[0,1];constructor(t,e){this.type="file",this.name=e,this.id=t.index,this.fullName=t.name,this.availability=t.availability,this.priority=t.priority,this.progress=t.progress,this.size=t.size}buildCache(){}isSelected(t){return t.has(this.fullName)}}class an{type;id;fullName;name;children;priority=rt.DO_NOT_DOWNLOAD;childrenIds=[];wanted=null;progress=0;deepCount=[1,0];size=0;selectedSize=0;constructor(t,e){this.type="folder",this.id=e,this.fullName=e,this.name=t,this.children=[]}buildCache(){if(this.children.length===0){this.priority=rt.DO_NOT_DOWNLOAD,this.childrenIds=[],this.wanted=null,this.progress=0,this.deepCount=[1,0],this.size=0,this.selectedSize=0;return}this.children.forEach(e=>{e.buildCache()}),this.priority=this.children.map(e=>e.priority).reduce((e,s)=>e===rt.MIXED||e===s?e:rt.MIXED),this.childrenIds=this.children.map(e=>e.childrenIds??[]).flat(),this.wanted=this.children.map(e=>e.wanted).some(Boolean);const t=this.children.filter(e=>e.wanted);if(t.length===0)this.progress=0;else{const e=t.reduce((s,i)=>[s[0]+i.selectedSize*i.progress,s[1]+i.selectedSize],[0,0]);this.progress=e[0]/e[1]}this.deepCount=this.children.map(e=>e.deepCount).reduce((e,s)=>[e[0]+s[0],e[1]+s[1]],[1,0]),this.size=this.children.map(e=>e.size).reduce((e,s)=>e+s,0),this.selectedSize=this.children.filter(e=>e.wanted).map(e=>e.selectedSize).reduce((e,s)=>e+s,0)}isSelected(t){return t.has(this.fullName)}}function Yr(){return new an("(root)","")}function na(r,t){const e=Qt(Yr()),s=Z(()=>{const n=(o,a)=>{const l=a===""?o.name:a+"/"+o.name;if(o.type==="folder"&&Gr(t).has(o.fullName)){const u=o.children.toSorted((h,c)=>h.type==="folder"&&c.type==="file"?-1:h.type==="file"&&c.type==="folder"?1:Qi.textWithNumbers.asc(h.name,c.name)).flatMap(h=>n(h,l));return[o,...u]}else return[o]};return n(e.value,"")});function i(){const n=Yr(),o=Gr(r)??[];for(const a of o){let l=n;a.name.replace(/\\/g,"/").split("/").reduce((u,h)=>{const c=u===""?h:u+"/"+h;if(u===a.name.substring(0,a.name.lastIndexOf("/")))l.children.push(new ia(a,h));else{const g=l.children.find(d=>d.name===h);if(g)l=g;else{const d=new an(h,c);l.children.push(d),l=d}}return c},"")}e.value=n,n.buildCache()}return Yi(()=>{i()}),{tree:e,flatTree:s}}const oa={pdf:"mdi-file-pdf-box",png:"mdi-file-image",jpg:"mdi-file-image",jpeg:"mdi-file-image",tiff:"mdi-file-image",doc:"mdi-file-document",docx:"mdi-file-document",txt:"mdi-file-document",nfo:"mdi-information-variant-box",mp3:"mdi-music",wav:"mdi-music",flac:"mdi-music",avi:"mdi-movie",mp4:"mdi-movie",mkv:"mdi-movie",mov:"mdi-movie",wmv:"mdi-movie",srt:"mdi-subtitles",idx:"mdi-subtitles",sub:"mdi-subtitles",rar:"mdi-zip-box-outline",zip:"mdi-zip-box-outline",gz:"mdi-zip-box-outline","7z":"mdi-zip-box-outline",iso:"mdi-zip-box-outline",exe:"mdi-application-brackets",msi:"mdi-application-brackets",dmg:"mdi-application-brackets",deb:"mdi-application-brackets",jar:"mdi-application-brackets"};aa=function(r){const t=r.split(".").pop()?.toLowerCase()||"";return oa[t]||"mdi-file"};let se,ha,ua,ca,da,fa,pa,ma,Xr,ga,_a,ya,xa,ba,va,wa;se=Xi("torrentDetail",()=>{const r=pt("overview"),t=pt();async function e(s){t.value=await we.getTorrentProperties(s)}return{tab:r,properties:t,fetchProperties:e,$reset:()=>{t.value=void 0}}},{persistence:{enabled:!0,storageItems:[{storage:localStorage,includePaths:["tab"]}]}});_e=Xi("content",()=>{const{t:r}=ee(),t=Co(),e=ws(),{fileContentInterval:s}=yt(Wt()),i=Z(()=>t.params.hash),n=bs({isVisible:!1,offset:[0,0]}),o=Qt([]),a=Qt(""),{results:l}=Mo(o,a,S=>S.name),u=Qt(new Set([""])),{flatTree:h}=na(l,u),c=Qt(new Set),g=Qt(""),d=Z(()=>c.value.size===0?[]:h.value.filter(S=>c.value.has(S.fullName))),m=Z(()=>d.value.length>0?d.value[0]:null),_=Z(()=>d.value.map(S=>S.childrenIds).flat().filter((S,k,I)=>I.indexOf(S)===k)),p=Z(()=>[{text:r(`torrentDetail.content.rename.${m.value?.type||"file"}`),icon:"mdi-rename",hidden:c.value.size>1||m.value?.fullName==="",action:()=>E(m.value)},{text:r("torrentDetail.content.rename.bulk"),icon:"mdi-rename",hidden:c.value.size!==1||(m.value?.type||"file")==="file",action:()=>O(Ao(m.value))},{text:r("torrentDetail.content.invert_priority"),icon:"mdi-checkbox-intermediate-variant",action:L},{text:r("torrentDetail.content.priority"),icon:"mdi-trending-up",children:[{text:r("constants.file_priority.max"),icon:"mdi-arrow-up",action:()=>$(_.value,rt.MAXIMAL)},{text:r("constants.file_priority.high"),icon:"mdi-arrow-top-right",action:()=>$(_.value,rt.HIGH)},{text:r("constants.file_priority.normal"),icon:"mdi-minus",action:()=>$(_.value,rt.NORMAL)},{text:r("constants.file_priority.unwanted"),icon:"mdi-cancel",action:()=>$(_.value,rt.DO_NOT_DOWNLOAD)}]},{text:"Collapse All",icon:"mdi-unfold-less-horizontal",action:y},{text:"Expand All",icon:"mdi-unfold-more-horizontal",action:w}]),b=Ji(function*(){yield M()}).drop(),C=Qt(!1),{isActive:T,pause:F,resume:B}=Cs(b.perform,s,{immediate:!1,immediateCallback:!0});async function M(){o.value=await U(i.value),await Ue()}async function E(S){const{default:k}=await Te(async()=>{const{default:V}=await import("./MoveTorrentFileDialog-Dhy8JCS7.js");return{default:V}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),I={hash:i.value,isFolder:S.type==="folder",oldName:S.fullName};e.createDialog(k,I,b.perform)}async function O(S){const{default:k}=await Te(async()=>{const{default:V}=await import("./BulkRenameFilesDialog-CXJ2V15O.js");return{default:V}},__vite__mapDeps([6,2,3,4,5,1,7]),import.meta.url),I={hash:i.value,node:S};e.createDialog(k,I,b.perform)}async function L(){const S=d.value.flatMap(z=>z.childrenIds),k=o.value.filter(z=>S.includes(z.index)),I=k.filter(z=>z.priority!==rt.DO_NOT_DOWNLOAD).map(z=>z.index),V=k.filter(z=>z.priority===rt.DO_NOT_DOWNLOAD).map(z=>z.index);await Promise.all([$(V,rt.NORMAL),$(I,rt.DO_NOT_DOWNLOAD)])}async function R(S,k,I){await we.renameFile(S,k,I)}async function A(S,k,I){await we.renameFolder(S,k,I)}async function $(S,k){await we.setTorrentFilePriority(i.value,S,k),b.perform()}async function U(S,k){return await we.getTorrentFiles(S,k)}async function X(S){return await we.getTorrentPieceStates(S)}function tt(S,k){S.stopPropagation();const I=k.type==="file"?k.fullName.slice(0,k.fullName.lastIndexOf("/")):k.fullName;u.value.has(I)||(u.value.add(I),rr(u))}function f(S,k){S.stopPropagation();const I=k.type==="file"||!u.value.has(k.fullName)?k.fullName.slice(0,k.fullName.lastIndexOf("/")):k.fullName;u.value.has(I)&&(u.value.delete(I),c.value.has(k.fullName)&&(c.value.delete(k.fullName),c.value.add(I),g.value=I),rr(u))}function y(){u.value=new Set([""])}function w(){u.value=o.value.flatMap(S=>S.name.replaceAll("\\","/").split("/").reduce((k,I,V,z)=>[...k,...VS.add(k),new Set([""]))}async function P(S){S.wanted?await $(S.childrenIds,rt.DO_NOT_DOWNLOAD):await $(S.childrenIds,rt.NORMAL)}return{rightClickProperties:n,internalSelection:c,lastSelected:g,menuData:p,filenameFilter:a,cachedFiles:o,openedItems:u,filteredFiles:l,flatTree:h,updateFileTreeTask:b,timerForcedPause:C,isTimerActive:T,pauseTimer:F,resumeTimer:B,renameTorrentFile:R,renameTorrentFolder:A,setFilePriority:$,fetchFiles:U,fetchPieceState:X,openNode:tt,closeNode:f,collapseAll:y,expandAll:w,toggleFileSelection:P,$reset:()=>{F(),b.clear(),c.value.clear(),g.value="",a.value="",o.value=[],u.value=new Set([""])}}});la=vt({__name:"MoveTorrentFileDialog",props:{guid:{},hash:{},isFolder:{type:Boolean},oldName:{}},setup(r){const t=r,{isOpened:e}=tn(t.guid),{t:s}=ee(),i=_e(),n=pt(),o=pt(),a=pt(!1),l=bs({newName:""}),u=[g=>!!g||s("dialogs.moveTorrent.required")];async function h(){await n.value?.validate(),a.value&&(t.isFolder?await i.renameTorrentFolder(t.hash,t.oldName,l.newName):await i.renameTorrentFile(t.hash,t.oldName,l.newName),c())}const c=()=>{e.value=!1};return So(()=>{if(l.newName=t.oldName,t.isFolder)Ue(()=>o.value?.select());else{const g=l.newName.lastIndexOf("/"),d=l.newName.lastIndexOf(".");Ue(()=>{o.value?.setSelectionRange(g+1,d==-1?l.newName.length:d)})}}),(g,d)=>(N(),q(We,{modelValue:D(e),"onUpdate:modelValue":d[3]||(d[3]=m=>Ye(e)?e.value=m:null)},{default:v(()=>[x(Ht,null,{default:v(()=>[x(As,null,{default:v(()=>[W(G(D(s)("dialogs.moveTorrentFile.title",1+Number(g.isFolder))),1)]),_:1}),x(pe,null,{default:v(()=>[x(D(en),{modelValue:a.value,"onUpdate:modelValue":d[1]||(d[1]=m=>a.value=m),ref_key:"form",ref:n,onSubmit:d[2]||(d[2]=He(()=>{},["prevent"]))},{default:v(()=>[g.oldName?(N(),q(Jt,{key:0,"model-value":g.oldName,disabled:"",label:g.$t("dialogs.moveTorrentFile.oldName")},null,8,["model-value","label"])):Rt("",!0),x(Jt,{modelValue:l.newName,"onUpdate:modelValue":d[0]||(d[0]=m=>l.newName=m),ref_key:"input",ref:o,rules:u,autofocus:"",label:g.$t("dialogs.moveTorrent.newPath"),onKeydown:Wi(h,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),x(Xe,null,{default:v(()=>[x(ke),x(ht,{color:"error",onClick:c},{default:v(()=>[W(G(g.$t("common.cancel")),1)]),_:1}),x(ht,{color:"accent",disabled:!a.value,onClick:h},{default:v(()=>[W(G(g.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});ha={style:{"white-space":"nowrap"}};ua=vt({__name:"ContentFilterDialog",props:{guid:{}},setup(r){const t=r,{t:e}=ee(),{isOpened:s}=tn(t.guid),i=_e(),n=Wt(),o=Z(()=>i.cachedFiles.map(p=>p.size).reduce((p,b)=>[p[0]===-1||bp[1]?b:p[1]],[-1,-1])),a=Z(()=>Array.from(new Set(i.cachedFiles.map(p=>Or(p.name)[1])).values())),l=Z(()=>a.value.map(p=>p===""?{title:e("common.none"),value:""}:{title:`.${p}`,value:p}).sort((p,b)=>Qi.text.asc(p.title,b.title))),u=[{title:e("constants.file_priority.unwanted"),value:rt.DO_NOT_DOWNLOAD},{title:e("constants.file_priority.normal"),value:rt.NORMAL},{title:e("constants.file_priority.high"),value:rt.HIGH},{title:e("constants.file_priority.max"),value:rt.MAXIMAL}],h=bs({extensions:[],priority:[],size:o.value}),c=Z(()=>i.cachedFiles.filter(p=>(!h.extensions.length||h.extensions.includes(Or(p.name)[1]))&&(!h.priority.length||h.priority.includes(p.priority))&&p.size>=h.size[0]&&p.size<=h.size[1])),g=Z(()=>c.value.reduce((p,b)=>p+b.size,0));function d(){i.setFilePriority(c.value.map(p=>p.index),rt.DO_NOT_DOWNLOAD),_()}function m(){const p=c.value.filter(b=>b.priority===rt.DO_NOT_DOWNLOAD).map(b=>b.index);i.setFilePriority(p,rt.NORMAL),_()}function _(){s.value=!1}return(p,b)=>(N(),q(We,{modelValue:D(s),"onUpdate:modelValue":b[5]||(b[5]=C=>Ye(s)?s.value=C:null),fullscreen:p.$vuetify.display.mobile},{default:v(()=>[x(Ht,null,{default:v(()=>[x(As,{class:"ios-margin"},{default:v(()=>[x(Io,{color:"transparent"},{default:v(()=>[x(Eo,null,{default:v(()=>[W(G(p.$t("torrentDetail.content.filter.title")),1)]),_:1}),x(ht,{icon:"mdi-close",onClick:_})]),_:1})]),_:1}),x(pe,null,{default:v(()=>[x(dt,null,{default:v(()=>[x(st,{cols:"4",class:"d-flex align-center"},{default:v(()=>[W(G(p.$t("torrentDetail.content.filter.extensions")),1)]),_:1}),x(st,{cols:"8"},{default:v(()=>[x(zr,{modelValue:h.extensions,"onUpdate:modelValue":b[0]||(b[0]=C=>h.extensions=C),items:l.value,placeholder:p.$t("common.disabled"),"persistent-placeholder":"",multiple:"","hide-details":""},null,8,["modelValue","items","placeholder"])]),_:1})]),_:1}),x(dt,null,{default:v(()=>[x(st,{cols:"4",class:"d-flex align-center"},{default:v(()=>[W(G(p.$t("torrentDetail.content.filter.priority")),1)]),_:1}),x(st,{cols:"8"},{default:v(()=>[x(zr,{modelValue:h.priority,"onUpdate:modelValue":b[1]||(b[1]=C=>h.priority=C),items:u,placeholder:p.$t("common.disabled"),"persistent-placeholder":"",multiple:"","hide-details":""},null,8,["modelValue","placeholder"])]),_:1})]),_:1}),x(dt,null,{default:v(()=>[x(st,{cols:"4",class:"d-flex align-center"},{default:v(()=>[W(G(p.$t("torrentDetail.content.filter.size")),1)]),_:1}),x(st,{cols:"8"},{default:v(()=>[x(Do,{modelValue:h.size,"onUpdate:modelValue":b[4]||(b[4]=C=>h.size=C),direction:p.$vuetify.display.mobile?"vertical":"horizontal",color:"primary",disabled:o.value[0]===o.value[1],min:o.value[0],max:o.value[1],step:1,density:"compact","thumb-label":"always","hide-details":""},{"thumb-label":v(({modelValue:C})=>[Y("div",ha,G(D(Vt)(C,D(n).useBinarySize)),1)]),prepend:v(()=>[x(Jt,{modelValue:h.size[0],"onUpdate:modelValue":b[2]||(b[2]=C=>h.size[0]=C),"hide-spin-buttons":"",density:"compact",style:{width:"130px"},type:"number",variant:"outlined","hide-details":"","single-line":""},null,8,["modelValue"])]),append:v(()=>[x(Jt,{modelValue:h.size[1],"onUpdate:modelValue":b[3]||(b[3]=C=>h.size[1]=C),"hide-spin-buttons":"",density:"compact",style:{width:"130px"},type:"number",variant:"outlined","hide-details":"","single-line":""},null,8,["modelValue"])]),_:1},8,["modelValue","direction","disabled","min","max"])]),_:1})]),_:1}),x(dt,null,{default:v(()=>[x(st,{cols:"12"},{default:v(()=>[W(G(p.$t("torrentDetail.content.filter.preview",{count:c.value.length,total:D(i).cachedFiles.length,size:D(Vt)(g.value,D(n).useBinarySize)})),1)]),_:1})]),_:1})]),_:1}),x(Xe,null,{default:v(()=>[x(ht,{color:"error",onClick:d},{default:v(()=>[W(G(p.$t("torrentDetail.content.filter.exclude")),1)]),_:1}),x(ht,{color:"success",onClick:m},{default:v(()=>[W(G(p.$t("torrentDetail.content.filter.include")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","fullscreen"]))}});ca={class:"d-flex"};da={key:1,class:"d-flex align-center spacer"};fa={class:"d-flex flex-column overflow-hidden text-no-wrap mr-3"};pa={class:"text-grey"};ma={class:"d-flex align-center"};Xr="#ffe476";ga=vt({__name:"ContentNode",props:{node:{}},emits:["onRightClick"],setup(r){const t=r,{t:e}=ee(),{mobile:s}=on(),i=_e(),{internalSelection:n,lastSelected:o,openedItems:a}=yt(i),l=Wt(),u=Z(()=>{if(t.node.fullName==="")return 0;const m=t.node.fullName.split("/").length,_=s.value?12:24;return m*_});function h(m,_){Ro(m)?(n.value.has(_.fullName)?n.value.delete(_.fullName):n.value.add(_.fullName),rr(n)):n.value=new Set([_.fullName]),o.value=_.fullName}function c(m){return m.wanted?m.progress===1?"green":"":"grey"}function g(m){const[_,p]=m.deepCount,b=[];return _>1&&b.push(e("torrentDetail.content.folderInfo",_-1)),p>0&&b.push(e("torrentDetail.content.fileInfo",p)),b.join(", ")}function d(m){const _=Vt(m.size,l.useBinarySize),p=Vt(m.selectedSize,l.useBinarySize);let b;if(m.type==="folder"){let C=_;m.selectedSize>0&&(C+=` (${p})`),b=[C,g(m)]}else b=[_];return b.join(" | ")}return(m,_)=>(N(),j("div",{class:gs(["d-flex flex-column py-2 pr-3",m.node.isSelected(D(n))?"selected":""]),style:ji(`padding-left: ${u.value}px`),onClick:_[2]||(_[2]=He(p=>h(p,m.node),["stop"])),onContextmenu:_[3]||(_[3]=p=>m.$emit("onRightClick",p,m.node))},[Y("div",ca,[Y("div",{class:"d-flex align-center",onClick:_[0]||(_[0]=He(p=>D(i).toggleFileSelection(m.node),["stop"]))},[m.node.priority===D(rt).MIXED?(N(),q(At,{key:0,color:c(m.node),icon:"mdi-checkbox-intermediate-variant"},null,8,["color"])):m.node.wanted?(N(),q(At,{key:1,color:c(m.node),icon:"mdi-checkbox-marked"},null,8,["color"])):(N(),q(At,{key:2,color:c(m.node),icon:"mdi-checkbox-blank-outline"},null,8,["color"]))]),m.node.type==="folder"?(N(),j("div",{key:0,class:"d-flex align-center spacer cursor-pointer",onClick:_[1]||(_[1]=p=>D(a).has(m.node.fullName)?D(i).closeNode(p,m.node):D(i).openNode(p,m.node))},[x(At,null,{default:v(()=>[W(G(D(a).has(m.node.fullName)?"mdi-chevron-up":"mdi-chevron-down"),1)]),_:1}),m.node.fullName===""?(N(),q(At,{key:0,icon:"mdi-file-tree"})):D(a).has(m.node.fullName)?(N(),q(At,{key:1,icon:"mdi-folder-open",color:Xr})):(N(),q(At,{key:2,icon:"mdi-folder",color:Xr}))])):(N(),j("div",da,[x(At,{icon:D(aa)(m.node.name)},null,8,["icon"])])),Y("div",fa,[Y("div",{class:gs(`text-${c(m.node)}`)},G(m.node.name),3),Y("div",pa,G(d(m.node)),1)]),x(ke),Y("div",ma,[m.node.priority===D(rt).MAXIMAL?(N(),q(At,{key:0,color:"error"},{default:v(()=>_[4]||(_[4]=[W("mdi-arrow-up")])),_:1})):m.node.priority===D(rt).HIGH?(N(),q(At,{key:1,color:"warning"},{default:v(()=>_[5]||(_[5]=[W("mdi-arrow-top-right")])),_:1})):m.node.priority===D(rt).NORMAL?(N(),q(At,{key:2},{default:v(()=>_[6]||(_[6]=[W("mdi-minus")])),_:1})):m.node.priority===D(rt).MIXED?(N(),q(At,{key:3},{default:v(()=>_[7]||(_[7]=[W("mdi-tilde")])),_:1})):m.node.priority===D(rt).DO_NOT_DOWNLOAD?(N(),q(At,{key:4,color:"grey"},{default:v(()=>_[8]||(_[8]=[W("mdi-cancel")])),_:1})):Rt("",!0)])]),x(sn,{"model-value":m.node.progress,max:1,color:c(m.node),rounded:"sm"},null,8,["model-value","color"])],38))}});_a=Ss(ga,[["__scopeId","data-v-276db43b"]]);ya={class:"mt-2 mx-3 d-flex flex-gap align-center"};xa=vt({__name:"Content",props:{torrent:{},isActive:{type:Boolean}},setup(r){const t=r,{height:e}=on(),s=_e(),{rightClickProperties:i,filenameFilter:n,flatTree:o,internalSelection:a,lastSelected:l,timerForcedPause:u,isTimerActive:h}=yt(s),c=ws(),g=pt(),d=Z(()=>e.value-48*2-64-12*2-56-8);async function m(M,E){i.value.isVisible&&(i.value.isVisible=!1,await Ue()),Object.assign(i.value,{isVisible:!0,offset:[M.pageX,M.pageY],hash:t.torrent.hash}),a.value.size<=1&&(a.value=new Set([E.fullName]),l.value=E.fullName)}const _=pt();function p(M,E){_.value=setTimeout(()=>{m(M,E)},500)}function b(){clearTimeout(_.value)}Je(()=>t.isActive,M=>{M&&!u.value?s.resumeTimer():s.pauseTimer()}),ts(()=>{t.isActive&&s.resumeTimer(),document.addEventListener("keydown",B)}),vs(()=>{s.$reset(),document.removeEventListener("keydown",B)});function C(){u.value=!0,s.pauseTimer()}function T(){u.value=!1,s.resumeTimer()}function F(){c.createDialog(ua)}function B(M){let E;(A=>{A.ArrowUp="ArrowUp",A.ArrowDown="ArrowDown",A.ArrowLeft="ArrowLeft",A.ArrowRight="ArrowRight",A.Spacebar=" "})(E||(E={}));const O=M.key;if(c.hasActiveDialog||!Object.values(E).includes(O))return!1;M.preventDefault();const L=o.value.findIndex(A=>A.fullName===l.value);let R=L;switch(O){case"ArrowUp":L>0&&R--;break;case"ArrowDown":LA.fullName===l.value);break;case"ArrowRight":s.openNode(M,o.value[L]);break;case" ":s.toggleFileSelection(o.value[L]).then();break}return L!==R&&(l.value=o.value[R].fullName,a.value=new Set([l.value]),g.value?.scrollToIndex(Math.max(0,R-Math.floor(d.value/68/2)))),!0}return(M,E)=>(N(),q(Ht,null,{default:v(()=>[Y("div",ya,[x(Jt,{modelValue:D(n),"onUpdate:modelValue":E[0]||(E[0]=O=>Ye(n)?n.value=O:null),"hide-details":"",clearable:"",placeholder:M.$t("torrentDetail.content.filter_placeholder"),onKeydown:E[1]||(E[1]=He(()=>{},["stop"]))},null,8,["modelValue","placeholder"]),x(_s,{text:M.$t("torrentDetail.content.filter.activator"),location:"bottom"},{activator:v(({props:O})=>[x(ht,Se(O,{icon:"mdi-select-multiple",color:"primary",onClick:F}),null,16)]),_:1},8,["text"]),x(_s,{text:D(h)?M.$t("common.pause"):M.$t("common.resume"),location:"bottom"},{activator:v(({props:O})=>[x(ht,Se(O,{icon:D(h)?"mdi-timer-pause":"mdi-timer-play",color:"primary",onClick:E[2]||(E[2]=L=>D(h)?C():T())}),null,16,["icon"])]),_:1},8,["text"])]),x(D(Fo),{ref_key:"scrollView",ref:g,items:D(o),height:d.value,"item-height":"68",class:"pa-2"},{default:v(({item:O})=>[x(_a,{node:O,onTouchcancel:b,onTouchend:b,onTouchmove:b,onTouchstart:L=>p(L.touches.item(0),O),onOnRightClick:E[3]||(E[3]=(L,R)=>m(L,R))},null,8,["node","onTouchstart"])]),_:1},8,["items","height"])]),_:1}))}});ba={};va={class:"pl-4"};wa={class:"pr-4"};function Ca(r,t){return N(),q(st,{cols:"12",sm:"6",lg:"3"},{default:v(()=>[x(Bo,{rounded:"xl",class:"d-flex align-center py-2 border"},{default:v(()=>[Y("div",va,[Nr(r.$slots,"title")]),x(ke),Y("div",wa,[Nr(r.$slots,"text")])]),_:3})]),_:3})}const Nt=Ss(ba,[["render",Ca]]),Aa=vt({__name:"PanelBoolean",props:{torrent:{}},setup(r){const t=r,e=Ts(),{properties:s}=yt(se()),i=Z({get:()=>t.torrent.auto_tmm,set:u=>e.toggleAutoTmm([t.torrent.hash],u)}),n=Z({get:()=>t.torrent.f_l_piece_prio,set:()=>e.toggleFLPiecePrio([t.torrent.hash])}),o=Z({get:()=>t.torrent.forced,set:u=>{u?e.forceStartTorrents([t.torrent.hash]):e.resumeTorrents([t.torrent.hash])}}),a=Z({get:()=>t.torrent.seq_dl,set:()=>e.toggleSeqDl([t.torrent.hash])}),l=Z({get:()=>t.torrent.super_seeding,set:u=>e.setSuperSeeding([t.torrent.hash],u)});return(u,h)=>(N(),q(ge,{title:u.$t("torrentDetail.info.boolean_values")},{default:v(()=>[x(me,null,{default:v(()=>[x(dt,null,{default:v(()=>[x(Nt,null,{title:v(()=>[x(ye,{modelValue:i.value,"onUpdate:modelValue":h[0]||(h[0]=c=>i.value=c),"hide-details":"",density:"compact",label:u.$t("torrent.properties.auto_tmm")},null,8,["modelValue","label"])]),_:1}),x(Nt,null,{title:v(()=>[x(ye,{modelValue:n.value,"onUpdate:modelValue":h[1]||(h[1]=c=>n.value=c),"hide-details":"",density:"compact",label:u.$t("torrent.properties.f_l_piece_prio")},null,8,["modelValue","label"])]),_:1}),x(Nt,null,{title:v(()=>[x(ye,{modelValue:o.value,"onUpdate:modelValue":h[2]||(h[2]=c=>o.value=c),"hide-details":"",density:"compact",label:u.$t("torrent.properties.forced")},null,8,["modelValue","label"])]),_:1}),x(Nt,null,{title:v(()=>[x(ye,{modelValue:a.value,"onUpdate:modelValue":h[3]||(h[3]=c=>a.value=c),"hide-details":"",density:"compact",label:u.$t("torrent.properties.seq_dl")},null,8,["modelValue","label"])]),_:1}),x(Nt,null,{title:v(()=>[x(ye,{modelValue:l.value,"onUpdate:modelValue":h[4]||(h[4]=c=>l.value=c),"hide-details":"",density:"compact",label:u.$t("torrent.properties.super_seeding")},null,8,["modelValue","label"])]),_:1}),x(Nt,null,{title:v(()=>[x(ye,{disabled:"","model-value":D(s)?.is_private,"hide-details":"",density:"compact",label:u.$t("torrent.properties.is_private")},null,8,["model-value","label"])]),_:1})]),_:1})]),_:1})]),_:1},8,["title"]))}}),Sa=vt({__name:"PanelData",props:{torrent:{}},setup(r){const t=r,{properties:e}=yt(se()),{useBinarySize:s}=yt(Wt()),i=[{title:"downloaded",getter:()=>t.torrent.downloaded},{title:"downloaded_session",getter:()=>t.torrent.downloaded_session},{title:"uploaded",getter:()=>t.torrent.uploaded},{title:"uploaded_session",getter:()=>t.torrent.uploaded_session},{title:"size",getter:()=>t.torrent.size},{title:"total_size",getter:()=>t.torrent.total_size},{title:"total_wasted",getter:()=>e.value?.total_wasted??0},{title:"amount_left",getter:()=>t.torrent.amount_left},{title:"global_volume",getter:()=>t.torrent.globalVolume}];return(n,o)=>(N(),q(ge,{title:n.$t("torrentDetail.info.data_values")},{default:v(()=>[x(me,null,{default:v(()=>[x(dt,null,{default:v(()=>[(N(),j(Pt,null,$t(i,a=>x(Nt,null,{title:v(()=>[W(G(n.$t(`torrent.properties.${a.title}`)),1)]),text:v(()=>[W(G(D(Vt)(a.getter(),D(s))),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),Ta=vt({__name:"PanelDatetime",props:{torrent:{}},setup(r){const t=r,{properties:e}=yt(se()),{dateFormat:s}=yt(Wt()),i=[{title:"added_on",getter:()=>t.torrent.added_on},{title:"completed_on",getter:()=>t.torrent.completed_on},{title:"creation_date",getter:()=>e.value?.creation_date??0},{title:"last_activity",getter:()=>t.torrent.last_activity},{title:"seen_complete",getter:()=>t.torrent.seen_complete}];return(n,o)=>(N(),q(ge,{title:n.$t("torrentDetail.info.datetime_values")},{default:v(()=>[x(me,null,{default:v(()=>[x(dt,null,{default:v(()=>[(N(),j(Pt,null,$t(i,a=>x(Nt,null,qi({title:v(()=>[W(G(n.$t(`torrent.properties.${a.title}`)),1)]),_:2},[a.getter()>0?{name:"text",fn:v(()=>[W(G(D($o)(a.getter(),D(s))),1)]),key:"0"}:{name:"text",fn:v(()=>[W(G(n.$t("common.NA")),1)]),key:"1"}]),1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),ka=vt({__name:"PanelDuration",props:{torrent:{}},setup(r){const t=r,{properties:e}=yt(se()),{durationFormat:s}=yt(Wt()),i=[{title:"seeding_time",unit:"s",getter:()=>t.torrent.seeding_time},{title:"seeding_time_limit",unit:"m",getter:()=>t.torrent.seeding_time_limit},{title:"inactive_seeding_time_limit",unit:"m",getter:()=>t.torrent.inactive_seeding_time_limit},{title:"time_active",unit:"s",getter:()=>t.torrent.time_active},{title:"reannounce",unit:"s",getter:()=>e.value?.reannounce??0}];return(n,o)=>(N(),q(ge,{title:n.$t("torrentDetail.info.duration_values")},{default:v(()=>[x(me,null,{default:v(()=>[x(dt,null,{default:v(()=>[(N(),j(Pt,null,$t(i,a=>x(Nt,null,qi({title:v(()=>[W(G(n.$t(`torrent.properties.${a.title}`)),1)]),_:2},[a.getter()>0?{name:"text",fn:v(()=>[W(G(D(Go)(a.getter(),a.unit,D(s))),1)]),key:"0"}:{name:"text",fn:v(()=>[W(G(n.$t("common.NA")),1)]),key:"1"}]),1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),Pa={key:0,class:"d-flex flex-gap-row-small flex-gap-column"},Ma=vt({__name:"PanelLongText",props:{torrent:{}},setup(r){const t=r,{properties:e}=yt(se()),s=[{title:"content_path",getter:()=>t.torrent.content_path},{title:"download_path",getter:()=>t.torrent.download_path},{title:"hash",getter:()=>t.torrent.hash},{title:"infohash_v1",getter:()=>t.torrent.infohash_v1},{title:"infohash_v2",getter:()=>t.torrent.infohash_v2},{title:"magnet",getter:()=>t.torrent.magnet},{title:"name",getter:()=>t.torrent.name},{title:"save_path",getter:()=>t.torrent.savePath},{title:"tracker",getter:()=>t.torrent.tracker},{title:"comment",getter:()=>e.value?.comment},{title:"created_by",getter:()=>e.value?.created_by}];return(i,n)=>(N(),q(ge,{title:i.$t("torrentDetail.info.long_text_values")},{default:v(()=>[x(me,null,{default:v(()=>[x(ys,null,{default:v(()=>[(N(),j(Pt,null,$t(s,o=>x(je,{title:i.$t(`torrent.properties.${o.title}`)},{default:v(()=>[x(Lr,null,{default:v(()=>[W(G(o.getter()||i.$t("common.none")),1)]),_:2},1024)]),_:2},1032,["title"])),64)),x(je,{title:i.$t("torrent.properties.tags")},{default:v(()=>[i.torrent.tags?.length?(N(),j("div",Pa,[(N(!0),j(Pt,null,$t(i.torrent.tags,o=>(N(),q(ve,{defaultColor:"tag",value:o},null,8,["value"]))),256))])):(N(),q(Lr,{key:1},{default:v(()=>[W(G(i.$t("torrent.properties.empty_tags")),1)]),_:1}))]),_:1},8,["title"])]),_:1})]),_:1})]),_:1},8,["title"]))}}),Ia=vt({__name:"PanelSpeed",props:{torrent:{}},setup(r){const t=r,{properties:e}=yt(se()),{useBitSpeed:s}=yt(Wt()),i=[{title:"download_limit",getter:()=>t.torrent.dl_limit},{title:"download_speed",getter:()=>t.torrent.dlspeed},{title:"avg_download_speed",getter:()=>e.value?.dl_speed_avg??0},{title:"upload_limit",getter:()=>t.torrent.up_limit},{title:"upload_speed",getter:()=>t.torrent.upspeed},{title:"avg_upload_speed",getter:()=>e.value?.up_speed_avg??0},{title:"global_speed",getter:()=>t.torrent.globalSpeed}];return(n,o)=>(N(),q(ge,{title:n.$t("torrentDetail.info.speed_values")},{default:v(()=>[x(me,null,{default:v(()=>[x(dt,null,{default:v(()=>[(N(),j(Pt,null,$t(i,a=>x(Nt,null,{title:v(()=>[W(G(n.$t(`torrent.properties.${a.title}`)),1)]),text:v(()=>[W(G(D(fe)(a.getter(),D(s))),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),Ea=vt({__name:"PanelText",props:{torrent:{}},setup(r){const t=r,{t:e,getTorrentStateString:s}=ee(),{properties:i}=yt(se()),n=[{title:"available_peers",getter:()=>t.torrent.available_peers},{title:"available_seeds",getter:()=>t.torrent.available_seeds},{title:"ratio",getter:()=>t.torrent.ratio},{title:"ratio_limit",getter:()=>t.torrent.ratio_limit},{title:"num_leechs",getter:()=>t.torrent.num_leechs},{title:"num_seeds",getter:()=>t.torrent.num_seeds},{title:"availability",getter:()=>t.torrent.availability},{title:"eta",getter:()=>t.torrent.eta},{title:"category",getter:()=>t.torrent.category||e("common.NA")},{title:"state",getter:()=>s(t.torrent.state)},{title:"trackers_count",getter:()=>t.torrent.trackers_count},{title:"priority",getter:()=>t.torrent.priority},{title:"nb_connections",getter:()=>i.value?.nb_connections??0},{title:"nb_connections_limit",getter:()=>i.value?.nb_connections_limit??0}];return(o,a)=>(N(),q(ge,{title:o.$t("torrentDetail.info.text_values")},{default:v(()=>[x(me,null,{default:v(()=>[x(dt,null,{default:v(()=>[(N(),j(Pt,null,$t(n,l=>x(Nt,null,{title:v(()=>[W(G(o.$t(`torrent.properties.${l.title}`)),1)]),text:v(()=>[W(G(l.getter()),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),Da=vt({__name:"Info",props:{torrent:{},isActive:{type:Boolean}},setup(r){return(t,e)=>(N(),q(ys,null,{default:v(()=>[x(je,null,{default:v(()=>[x(No,null,{default:v(()=>[x(Ta,{torrent:t.torrent},null,8,["torrent"]),x(ka,{torrent:t.torrent},null,8,["torrent"]),x(Aa,{torrent:t.torrent},null,8,["torrent"]),x(Sa,{torrent:t.torrent},null,8,["torrent"]),x(Ia,{torrent:t.torrent},null,8,["torrent"]),x(Ea,{torrent:t.torrent},null,8,["torrent"]),x(Ma,{torrent:t.torrent},null,8,["torrent"])]),_:1})]),_:1})]),_:1}))}}),Ra=class or{constructor(t,e){this.low=t,this.high=e}clone(){return new or(this.low,this.high)}get max(){return this.clone()}less_than(t){return this.lowt.high?this.high:t.high)}output(){return[this.low,this.high]}static comparable_max(t,e){return t.merge(e)}static comparable_less_than(t,e){return tl&&([a,l]=[l,a]),this.item.key=new Ra(a,l)}this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.value===void 0&&this.left===null&&this.right===null&&this.color===at}_value_less_than(t){return this.item.value&&t.item.value&&this.item.value.less_than?this.item.value.less_than(t.item.value):this.item.valuet++),t}get keys(){let t=[];return this.tree_walk(this.root,e=>t.push(e.item.key.output?e.item.key.output():e.item.key)),t}get values(){let t=[];return this.tree_walk(this.root,e=>t.push(e.item.value)),t}get items(){let t=[];return this.tree_walk(this.root,e=>t.push({key:e.item.key.output?e.item.key.output():e.item.key,value:e.item.value})),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,e=t){if(t===void 0)return;let s=new oe(t,e,this.nil_node,this.nil_node,null,wt);return this.tree_insert(s),this.recalc_max(s),s}exist(t,e=t){let s=new oe(t,e);return!!this.tree_search(this.root,s)}remove(t,e=t){let s=new oe(t,e),i=this.tree_search(this.root,s);return i&&this.tree_delete(i),i}search(t,e=(s,i)=>s===i?i.output():s){let s=new oe(t),i=[];return this.tree_search_interval(this.root,s,i),i.map(n=>e(n.item.value,n.item.key))}intersect_any(t){let e=new oe(t);return this.tree_find_any_interval(this.root,e)}forEach(t){this.tree_walk(this.root,e=>t(e.item.key,e.item.value))}map(t){const e=new Ar;return this.tree_walk(this.root,s=>e.insert(s.item.key,t(s.item.value,s.item.key))),e}*iterate(t,e=(s,i)=>s===i?i.output():s){let s;for(t?s=this.tree_search_nearest_forward(this.root,new oe(t)):this.root&&(s=this.local_minimum(this.root));s;)yield e(s.item.value,s.item.key),s=this.tree_successor(s)}recalc_max(t){let e=t;for(;e.parent!=null;)e.parent.update_max(),e=e.parent}tree_insert(t){let e=this.root,s=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{for(;e!==this.nil_node;)s=e,t.less_than(e)?e=e.left:e=e.right;t.parent=s,t.less_than(s)?s.left=t:s.right=t}this.insert_fixup(t)}insert_fixup(t){let e,s;for(e=t;e!==this.root&&e.parent.color===wt;)e.parent===e.parent.parent.left?(s=e.parent.parent.right,s.color===wt?(e.parent.color=at,s.color=at,e.parent.parent.color=wt,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,this.rotate_left(e)),e.parent.color=at,e.parent.parent.color=wt,this.rotate_right(e.parent.parent))):(s=e.parent.parent.left,s.color===wt?(e.parent.color=at,s.color=at,e.parent.parent.color=wt,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,this.rotate_right(e)),e.parent.color=at,e.parent.parent.color=wt,this.rotate_left(e.parent.parent)));this.root.color=at}tree_delete(t){let e,s;t.left===this.nil_node||t.right===this.nil_node?e=t:e=this.tree_successor(t),e.left!==this.nil_node?s=e.left:s=e.right,s.parent=e.parent,e===this.root?this.root=s:(e===e.parent.left?e.parent.left=s:e.parent.right=s,e.parent.update_max()),this.recalc_max(s),e!==t&&(t.copy_data(e),t.update_max(),this.recalc_max(t)),e.color===at&&this.delete_fixup(s)}delete_fixup(t){let e=t,s;for(;e!==this.root&&e.parent!=null&&e.color===at;)e===e.parent.left?(s=e.parent.right,s.color===wt&&(s.color=at,e.parent.color=wt,this.rotate_left(e.parent),s=e.parent.right),s.left.color===at&&s.right.color===at?(s.color=wt,e=e.parent):(s.right.color===at&&(s.color=wt,s.left.color=at,this.rotate_right(s),s=e.parent.right),s.color=e.parent.color,e.parent.color=at,s.right.color=at,this.rotate_left(e.parent),e=this.root)):(s=e.parent.left,s.color===wt&&(s.color=at,e.parent.color=wt,this.rotate_right(e.parent),s=e.parent.left),s.left.color===at&&s.right.color===at?(s.color=wt,e=e.parent):(s.left.color===at&&(s.color=wt,s.right.color=at,this.rotate_left(s),s=e.parent.left),s.color=e.parent.color,e.parent.color=at,s.left.color=at,this.rotate_right(e.parent),e=this.root));e.color=at}tree_search(t,e){if(!(t==null||t===this.nil_node))return e.equal_to(t)?t:e.less_than(t)?this.tree_search(t.left,e):this.tree_search(t.right,e)}tree_search_nearest_forward(t,e){let s,i=t;for(;i&&i!==this.nil_node;)i.less_than(e)?i.intersect(e)?(s=i,i=i.left):i=i.right:((!s||i.less_than(s))&&(s=i),i=i.left);return s||null}tree_search_interval(t,e,s){t!=null&&t!==this.nil_node&&(t.left!==this.nil_node&&!t.not_intersect_left_subtree(e)&&this.tree_search_interval(t.left,e,s),t.intersect(e)&&s.push(t),t.right!==this.nil_node&&!t.not_intersect_right_subtree(e)&&this.tree_search_interval(t.right,e,s))}tree_find_any_interval(t,e){let s=!1;return t!=null&&t!==this.nil_node&&(t.left!==this.nil_node&&!t.not_intersect_left_subtree(e)&&(s=this.tree_find_any_interval(t.left,e)),s||(s=t.intersect(e)),!s&&t.right!==this.nil_node&&!t.not_intersect_right_subtree(e)&&(s=this.tree_find_any_interval(t.right,e))),s}local_minimum(t){let e=t;for(;e.left!=null&&e.left!==this.nil_node;)e=e.left;return e}local_maximum(t){let e=t;for(;e.right!=null&&e.right!==this.nil_node;)e=e.right;return e}tree_successor(t){let e,s,i;if(t.right!==this.nil_node)e=this.local_minimum(t.right);else{for(s=t,i=t.parent;i!=null&&i.right===s;)s=i,i=i.parent;e=i}return e}rotate_left(t){let e=t.right;t.right=e.left,e.left!==this.nil_node&&(e.left.parent=t),e.parent=t.parent,t===this.root?this.root=e:t===t.parent.left?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e,t!=null&&t!==this.nil_node&&t.update_max(),e=t.parent,e!=null&&e!==this.nil_node&&e.update_max()}rotate_right(t){let e=t.left;t.left=e.right,e.right!==this.nil_node&&(e.right.parent=t),e.parent=t.parent,t===this.root?this.root=e:t===t.parent.left?t.parent.left=e:t.parent.right=e,e.right=t,t.parent=e,t!==null&&t!==this.nil_node&&t.update_max(),e=t.parent,e!=null&&e!==this.nil_node&&e.update_max()}tree_walk(t,e){t!=null&&t!==this.nil_node&&(this.tree_walk(t.left,e),e(t),this.tree_walk(t.right,e))}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(e){e.color===wt&&(e.left.color===at&&e.right.color===at||(t=!1))}),t}testBlackHeightProperty(t){let e=0,s=0,i=0;if(t.color===at&&e++,t.left!==this.nil_node?s=this.testBlackHeightProperty(t.left):s=1,t.right!==this.nil_node?i=this.testBlackHeightProperty(t.right):i=1,s!==i)throw new Error("Red-black height property violated");return e+=s,e}}lt=(r=>(r.Application="application",r.WebGLPipes="webgl-pipes",r.WebGLPipesAdaptor="webgl-pipes-adaptor",r.WebGLSystem="webgl-system",r.WebGPUPipes="webgpu-pipes",r.WebGPUPipesAdaptor="webgpu-pipes-adaptor",r.WebGPUSystem="webgpu-system",r.CanvasSystem="canvas-system",r.CanvasPipesAdaptor="canvas-pipes-adaptor",r.CanvasPipes="canvas-pipes",r.Asset="asset",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser",r.MaskEffect="mask-effect",r.BlendMode="blend-mode",r.TextureSource="texture-source",r.Environment="environment",r.ShapeBuilder="shape-builder",r.Batcher="batcher",r))(lt||{});let ar,es,Fa,Ba;ar=r=>{if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");r={...typeof r.extension!="object"?{type:r.extension}:r.extension,ref:r}}if(typeof r=="object")r={...r};else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r};es=(r,t)=>ar(r).priority??t;jt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(ar).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...r){return r.map(ar).forEach(t=>{t.type.forEach(e=>{const s=this._addHandlers,i=this._queue;s[e]?s[e]?.(t):(i[e]=i[e]||[],i[e]?.push(t))})}),this},handle(r,t,e){const s=this._addHandlers,i=this._removeHandlers;if(s[r]||i[r])throw new Error(`Extension type ${r} already has a handler`);s[r]=t,i[r]=e;const n=this._queue;return n[r]&&(n[r]?.forEach(o=>t(o)),delete n[r]),this},handleByMap(r,t){return this.handle(r,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(r,t,e=-1){return this.handle(r,s=>{t.findIndex(n=>n.name===s.name)>=0||(t.push({name:s.name,value:s.ref}),t.sort((n,o)=>es(o.value,e)-es(n.value,e)))},s=>{const i=t.findIndex(n=>n.name===s.name);i!==-1&&t.splice(i,1)})},handleByList(r,t,e=-1){return this.handle(r,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((i,n)=>es(n,e)-es(i,e)))},s=>{const i=t.indexOf(s.ref);i!==-1&&t.splice(i,1)})}};Fa={extension:{type:lt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Te(()=>import("./browserAll-C1HMKx36.js"),__vite__mapDeps([8,9,10,11,1,2,3,4,5]),import.meta.url)}};Ba={extension:{type:lt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Te(()=>import("./webworkerAll-D3jJ_Vry.js"),__vite__mapDeps([9,10,11,1,2,3,4,5]),import.meta.url)}};class Dt{constructor(t,e,s){this._x=e||0,this._y=s||0,this._observer=t}clone(t){return new Dt(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=0 y=0 scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var Ds={exports:{}},Wr;function $a(){return Wr||(Wr=1,function(r){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function i(l,u,h){this.fn=l,this.context=u,this.once=h||!1}function n(l,u,h,c,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var d=new i(h,c||l,g),m=e?e+u:u;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],d]:l._events[m].push(d):(l._events[m]=d,l._eventsCount++),l}function o(l,u){--l._eventsCount===0?l._events=new s:delete l._events[u]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],h,c;if(this._eventsCount===0)return u;for(c in h=this._events)t.call(h,c)&&u.push(e?c.slice(1):c);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},a.prototype.listeners=function(u){var h=e?e+u:u,c=this._events[h];if(!c)return[];if(c.fn)return[c.fn];for(var g=0,d=c.length,m=new Array(d);ghe[r],uY:r=>ue[r],vX:r=>ce[r],vY:r=>de[r],inv:r=>r&8?r&15:-r&7,add:(r,t)=>lr[r][t],sub:(r,t)=>lr[r][ct.inv(t)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,t)=>Math.abs(r)*2<=Math.abs(t)?t>=0?ct.S:ct.N:Math.abs(t)*2<=Math.abs(r)?r>0?ct.E:ct.W:t>0?r>0?ct.SE:ct.SW:r>0?ct.NE:ct.NW,matrixAppendRotationInv:(r,t,e=0,s=0)=>{const i=ln[ct.inv(t)];i.tx=e,i.ty=s,r.append(i)}},rs=[new St,new St,new St,new St];Ct=class{constructor(t=0,e=0,s=0,i=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(i)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Ct(0,0,0,0)}clone(){return new Ct(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=l&&t<=u&&e>=h&&e<=c&&!(t>g&&tm&&e<_)}intersects(t,e){if(!e){const O=this.xt.right?t.right:this.right)<=O)return!1;const R=this.yt.bottom?t.bottom:this.bottom)>R}const s=this.left,i=this.right,n=this.top,o=this.bottom;if(i<=s||o<=n)return!1;const a=rs[0].set(t.left,t.top),l=rs[1].set(t.left,t.bottom),u=rs[2].set(t.right,t.top),h=rs[3].set(t.right,t.bottom);if(u.x<=a.x||l.y<=a.y)return!1;const c=Math.sign(e.a*e.d-e.b*e.c);if(c===0||(e.apply(a,a),e.apply(l,l),e.apply(u,u),e.apply(h,h),Math.max(a.x,l.x,u.x,h.x)<=s||Math.min(a.x,l.x,u.x,h.x)>=i||Math.max(a.y,l.y,u.y,h.y)<=n||Math.min(a.y,l.y,u.y,h.y)>=o))return!1;const g=c*(l.y-a.y),d=c*(a.x-l.x),m=g*s+d*n,_=g*i+d*n,p=g*s+d*o,b=g*i+d*o;if(Math.max(m,_,p,b)<=g*a.x+d*a.y||Math.min(m,_,p,b)>=g*h.x+d*h.y)return!1;const C=c*(a.y-u.y),T=c*(u.x-a.x),F=C*s+T*n,B=C*i+T*n,M=C*s+T*o,E=C*i+T*o;return!(Math.max(F,B,M,E)<=C*a.x+T*a.y||Math.min(F,B,M,E)>=C*h.x+T*h.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(s-e,0),this.y=i,this.height=Math.max(n-i,0),this}ceil(t=1,e=.001){const s=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=s-this.x,this.height=i-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=i,this.height=n-i,this}getBounds(t){return t||(t=new Ct),t.copyFrom(this),t}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};const Fs={default:-1};_t=function(r="default"){return Fs[r]===void 0&&(Fs[r]=-1),++Fs[r]};let jr,Ha;jr={};gt="8.0.0";Ha="8.3.4";ft=function(r,t,e=3){if(jr[t])return;let s=new Error().stack;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${r}`):(s=s.split(` `).splice(e).join(` `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} Deprecated since v${r}`),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${r}`),console.warn(s))),jr[t]=!0};const hn=()=>{};qr=function(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1};function Kr(r){return!(r&r-1)&&!!r}function Ya(r){const t={};for(const e in r)r[e]!==void 0&&(t[e]=r[e]);return t}const Zr=Object.create(null);function Xa(r){const t=Zr[r];return t===void 0&&(Zr[r]=_t("resource")),t}const un=class cn extends re{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...cn.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){ft(gt,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Xa(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};un.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};Wa=un;const dn=class fn extends re{constructor(t={}){super(),this.options=t,this.uid=_t("textureSource"),this._resourceType="textureSource",this._resourceId=_t("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...fn.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new Wa(Ya(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=_t("resource"),this.emit("change",this),this.emit("unload",this)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,s){s||(s=this._resolution),t||(t=this.width),e||(e=this.height);const i=Math.round(t*s),n=Math.round(e*s);return this.width=i/s,this.height=n/s,this._resolution=s,this.pixelWidth===i&&this.pixelHeight===n?!1:(this._refreshPOT(),this.pixelWidth=i,this.pixelHeight=n,this.emit("resize",this),this._resourceId=_t("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Kr(this.pixelWidth)&&Kr(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};dn.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};qt=dn;class Sr extends qt{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let s=t.format;s||(e instanceof Float32Array?s="rgba32float":e instanceof Int32Array||e instanceof Uint32Array?s="rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?s="rgba16uint":(e instanceof Int8Array,s="bgra8unorm")),super({...t,resource:e,format:s}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}Sr.extension=lt.TextureSource;const Qr=new it;ja=class{constructor(t,e){this.mapCoord=new it,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof e>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this.texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){e===void 0&&(e=t);const s=this.mapCoord;for(let i=0;ithis.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Ct);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Jr,this}set(t,e,s,i){this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}addFrame(t,e,s,i,n){n||(n=this.matrix);const o=n.a,a=n.b,l=n.c,u=n.d,h=n.tx,c=n.ty;let g=this.minX,d=this.minY,m=this.maxX,_=this.maxY,p=o*t+l*e+h,b=a*t+u*e+c;pm&&(m=p),b>_&&(_=b),p=o*s+l*e+h,b=a*s+u*e+c,pm&&(m=p),b>_&&(_=b),p=o*t+l*i+h,b=a*t+u*i+c,pm&&(m=p),b>_&&(_=b),p=o*s+l*i+h,b=a*s+u*i+c,pm&&(m=p),b>_&&(_=b),this.minX=g,this.minY=d,this.maxX=m,this.maxY=_}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxXthis.maxX?g:this.maxX,this.maxY=d>this.maxY?d:this.maxY,g=o*e+l*n+h,d=a*e+u*n+c,this.minX=gthis.maxX?g:this.maxX,this.maxY=d>this.maxY?d:this.maxY,g=o*i+l*n+h,d=a*i+u*n+c,this.minX=gthis.maxX?g:this.maxX,this.maxY=d>this.maxY?d:this.maxY}fit(t){return this.minXt.right&&(this.maxX=t.right),this.minYt.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,s,i){return this.minXe&&(this.maxX=e),this.minYi&&(this.maxY=i),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new Xt(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,s,i){let n=this.minX,o=this.minY,a=this.maxX,l=this.maxY;i||(i=this.matrix);const u=i.a,h=i.b,c=i.c,g=i.d,d=i.tx,m=i.ty;for(let _=e;_a?C:a,l=T>l?T:l}this.minX=n,this.minY=o,this.maxX=a,this.maxY=l}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}};var Ka={grad:.9,turn:360,rad:360/(2*Math.PI)},Zt=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},bt=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*r)/e+0},Bt=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),r>e?e:r>t?r:t},pn=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},ti=function(r){return{r:Bt(r.r,0,255),g:Bt(r.g,0,255),b:Bt(r.b,0,255),a:Bt(r.a)}},Bs=function(r){return{r:bt(r.r),g:bt(r.g),b:bt(r.b),a:bt(r.a,3)}},Za=/^#([0-9a-f]{3,8})$/i,is=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},mn=function(r){var t=r.r,e=r.g,s=r.b,i=r.a,n=Math.max(t,e,s),o=n-Math.min(t,e,s),a=o?n===t?(e-s)/o:n===e?2+(s-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:i}},gn=function(r){var t=r.h,e=r.s,s=r.v,i=r.a;t=t/360*6,e/=100,s/=100;var n=Math.floor(t),o=s*(1-e),a=s*(1-(t-n)*e),l=s*(1-(1-t+n)*e),u=n%6;return{r:255*[s,a,o,o,l,s][u],g:255*[l,s,s,a,o,o][u],b:255*[o,o,l,s,s,a][u],a:i}},ei=function(r){return{h:pn(r.h),s:Bt(r.s,0,100),l:Bt(r.l,0,100),a:Bt(r.a)}},si=function(r){return{h:bt(r.h),s:bt(r.s),l:bt(r.l),a:bt(r.a,3)}},ri=function(r){return gn((e=(t=r).s,{h:t.h,s:(e*=((s=t.l)<50?s:100-s)/100)>0?2*e/(s+e)*100:0,v:s+e,a:t.a}));var t,e,s},Oe=function(r){return{h:(t=mn(r)).h,s:(i=(200-(e=t.s))*(s=t.v)/100)>0&&i<200?e*s/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,e,s,i},Qa=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ja=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tl=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,el=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hr={string:[[function(r){var t=Za.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?bt(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?bt(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=tl.exec(r)||el.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:ti({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(r){var t=Qa.exec(r)||Ja.exec(r);if(!t)return null;var e,s,i=ei({h:(e=t[1],s=t[2],s===void 0&&(s="deg"),Number(e)*(Ka[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return ri(i)},"hsl"]],object:[[function(r){var t=r.r,e=r.g,s=r.b,i=r.a,n=i===void 0?1:i;return Zt(t)&&Zt(e)&&Zt(s)?ti({r:Number(t),g:Number(e),b:Number(s),a:Number(n)}):null},"rgb"],[function(r){var t=r.h,e=r.s,s=r.l,i=r.a,n=i===void 0?1:i;if(!Zt(t)||!Zt(e)||!Zt(s))return null;var o=ei({h:Number(t),s:Number(e),l:Number(s),a:Number(n)});return ri(o)},"hsl"],[function(r){var t=r.h,e=r.s,s=r.v,i=r.a,n=i===void 0?1:i;if(!Zt(t)||!Zt(e)||!Zt(s))return null;var o=function(a){return{h:pn(a.h),s:Bt(a.s,0,100),v:Bt(a.v,0,100),a:Bt(a.a)}}({h:Number(t),s:Number(e),v:Number(s),a:Number(n)});return gn(o)},"hsv"]]},ii=function(r,t){for(var e=0;e=.5},r.prototype.toHex=function(){return t=Bs(this.rgba),e=t.r,s=t.g,i=t.b,o=(n=t.a)<1?is(bt(255*n)):"","#"+is(e)+is(s)+is(i)+o;var t,e,s,i,n,o},r.prototype.toRgb=function(){return Bs(this.rgba)},r.prototype.toRgbString=function(){return t=Bs(this.rgba),e=t.r,s=t.g,i=t.b,(n=t.a)<1?"rgba("+e+", "+s+", "+i+", "+n+")":"rgb("+e+", "+s+", "+i+")";var t,e,s,i,n},r.prototype.toHsl=function(){return si(Oe(this.rgba))},r.prototype.toHslString=function(){return t=si(Oe(this.rgba)),e=t.h,s=t.s,i=t.l,(n=t.a)<1?"hsla("+e+", "+s+"%, "+i+"%, "+n+")":"hsl("+e+", "+s+"%, "+i+"%)";var t,e,s,i,n},r.prototype.toHsv=function(){return t=mn(this.rgba),{h:bt(t.h),s:bt(t.s),v:bt(t.v),a:bt(t.a,3)};var t},r.prototype.invert=function(){return Lt({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},r.prototype.saturate=function(t){return t===void 0&&(t=.1),Lt($s(this.rgba,t))},r.prototype.desaturate=function(t){return t===void 0&&(t=.1),Lt($s(this.rgba,-t))},r.prototype.grayscale=function(){return Lt($s(this.rgba,-1))},r.prototype.lighten=function(t){return t===void 0&&(t=.1),Lt(ni(this.rgba,t))},r.prototype.darken=function(t){return t===void 0&&(t=.1),Lt(ni(this.rgba,-t))},r.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},r.prototype.alpha=function(t){return typeof t=="number"?Lt({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):bt(this.rgba.a,3);var e},r.prototype.hue=function(t){var e=Oe(this.rgba);return typeof t=="number"?Lt({h:t,s:e.s,l:e.l,a:e.a}):bt(e.h)},r.prototype.isEqual=function(t){return this.toHex()===Lt(t).toHex()},r}(),Lt=function(r){return r instanceof ur?r:new ur(r)},oi=[],rl=function(r){r.forEach(function(t){oi.indexOf(t)<0&&(t(ur,hr),oi.push(t))})};function il(r,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var i in e)s[e[i]]=i;var n={};r.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,u=s[this.toHex()];if(u)return u;if(o?.closest){var h=this.toRgb(),c=1/0,g="black";if(!n.length)for(var d in e)n[d]=new r(e[d]).toRgb();for(var m in e){var _=(a=h,l=n[m],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));_n===e[o]);if(t!==null&&e!==null){const n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,s,i]=this._components;return{r:t,g:e,b:s,a:i}}toRgb(){const[t,e,s]=this._components;return{r:t,g:e,b:s}}toRgbaString(){const[t,e,s]=this.toUint8RgbArray();return`rgba(${t},${e},${s},${this.alpha})`}toUint8RgbArray(t){const[e,s,i]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(e*255),t[1]=Math.round(s*255),t[2]=Math.round(i*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[e,s,i,n]=this._components;return t[0]=e,t[1]=s,t[2]=i,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[e,s,i]=this._components;return t[0]=e,t[1]=s,t[2]=i,t}toNumber(){return this._int}toBgrNumber(){const[t,e,s]=this.toUint8RgbArray();return(s<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,s,i,n]=$e._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=s,this._components[2]*=i,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let s=this._int>>16&255,i=this._int>>8&255,n=this._int&255;return e&&(s=s*t+.5|0,i=i*t+.5|0,n=n*t+.5|0),(t*255<<24)+(s<<16)+(i<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this}_normalize(t){let e,s,i,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const o=t;e=(o>>16&255)/255,s=(o>>8&255)/255,i=(o&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,s,i,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,s,i,n=255]=t,e/=255,s/=255,i/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const a=$e.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}const o=Lt(t);o.isValid()&&({r:e,g:s,b:i,a:n}=o.rgba,e/=255,s/=255,i/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=s,this._components[2]=i,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,e,s]=this._components;this._int=(t*255<<16)+(e*255<<8)+(s*255|0)}_clamp(t,e=0,s=1){return typeof t=="number"?Math.min(Math.max(t,e),s):(t.forEach((i,n)=>{t[n]=Math.min(Math.max(i,e),s)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof $e||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};Pe.shared=new Pe;Pe._temp=new Pe;Pe.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;Ft=Pe;const nl={cullArea:null,cullable:!1,cullableChildren:!0};class Tr{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e0?e=this._pool[--this._index]:e=new this._classType,e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0}}class ol{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new Tr(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(e=>{const s=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[s]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}}let al;te=new ol;al={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(r){typeof r=="boolean"&&r===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(r===!0?{}:r))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(r){ft("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r)}};ll=function(r,t,e){const s=r.length;let i;if(t>=s||e===0)return;e=t+e>s?s-t:e;const n=s-e;for(i=t;i0&&s<=e){for(let o=e-1;o>=r;o--){const a=this.children[o];a&&(i.push(a),a.parent=null)}ll(this.children,r,e);const n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(i);for(let o=0;o=this.children.length)throw new Error(`getChildAt: Index (${r}) does not exist.`);return this.children[r]},setChildIndex(r,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(r),this.addChildAt(r,t)},getChildIndex(r){const t=this.children.indexOf(r);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(r,t){this.allowChildren||ft(gt,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:e}=this;if(t<0||t>e.length)throw new Error(`${r}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);if(r.parent){const i=r.parent.children.indexOf(r);if(r.parent===this&&i===t)return r;i!==-1&&r.parent.children.splice(i,1)}t===e.length?e.push(r):e.splice(t,0,r),r.parent=this,r.didChange=!0,r._updateFlags=15;const s=this.renderGroup||this.parentRenderGroup;return s&&s.addChild(r),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",r,this,t),r.emit("added",this),r},swapChildren(r,t){if(r===t)return;const e=this.getChildIndex(r),s=this.getChildIndex(t);this.children[e]=t,this.children[s]=r;const i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...r){return r.length===1?this.reparentChildAt(r[0],this.children.length):(r.forEach(t=>this.reparentChildAt(t,this.children.length)),r[0])},reparentChildAt(r,t){if(r.parent===this)return this.setChildIndex(r,t),r;const e=r.worldTransform.clone();r.removeFromParent(),this.addChildAt(r,t);const s=this.worldTransform.clone();return s.invert(),e.prepend(s),r.setFromMatrix(e),r}};ai=class{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;ee.priority-s.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(r){const t=this.effects.indexOf(r);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(r){const t=this._maskEffect;t?.mask!==r&&(t&&(this.removeEffect(t),cr.returnMaskEffect(t),this._maskEffect=null),r!=null&&(this._maskEffect=cr.getMaskEffect(r),this.addEffect(this._maskEffect)))},setMask(r){this._maskOptions={...this._maskOptions,...r},r.mask&&(this.mask=r.mask),this._markStructureAsChanged()},get mask(){return this._maskEffect?.mask},set filters(r){!Array.isArray(r)&&r&&(r=[r]);const t=this._filterEffect||(this._filterEffect=new ai);r=r;const e=r?.length>0,s=t.filters?.length>0,i=e!==s;r=Array.isArray(r)?r.slice(0):r,t.filters=Object.freeze(r),i&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=r??null))},get filters(){return this._filterEffect?.filters},set filterArea(r){this._filterEffect||(this._filterEffect=new ai),this._filterEffect.filterArea=r},get filterArea(){return this._filterEffect?.filterArea}};dl={label:null,get name(){return ft(gt,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){ft(gt,"Container.name property has been removed, use Container.label instead"),this.label=r},getChildByName(r,t=!1){return this.getChildByLabel(r,t)},getChildByLabel(r,t=!1){const e=this.children;for(let s=0;s>16&255,s=r>>8&255,i=r&255,n=t>>16&255,o=t>>8&255,a=t&255,l=e*n/255|0,u=s*o/255|0,h=i*a/255|0;return(l<<16)+(u<<8)+h}const li=16777215;hi=function(r,t){return r===li?t:t===li?r:xn(r,t)};function fs(r){return((r&255)<<16)+(r&65280)+(r>>16&255)}const fl={getGlobalAlpha(r){if(r)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,e=this.parent;for(;e;)t*=e.alpha,e=e.parent;return t},getGlobalTransform(r,t){if(t)return r.copyFrom(this.worldTransform);this.updateLocalTransform();const e=kr(this,kt.get().identity());return r.appendFrom(this.localTransform,e),kt.return(e),r},getGlobalTint(r){if(r)return this.renderGroup?fs(this.renderGroup.worldColor):this.parentRenderGroup?fs(hi(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,e=this.parent;for(;e;)t=hi(t,e.localColor),e=e.parent;return fs(t)}};let Ns=0;const ui=500;Yt=function(...r){Ns!==ui&&(Ns++,Ns===ui?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r))};bn=function(r,t,e){return t.clear(),e||(e=it.IDENTITY),vn(r,t,e,r,!0),t.isValid||t.set(0,0,0,0),t};function vn(r,t,e,s,i){let n;if(i)n=kt.get(),n=e.copyTo(n);else{if(!r.visible||!r.measurable)return;r.updateLocalTransform();const l=r.localTransform;n=kt.get(),n.appendFrom(l,e)}const o=t,a=!!r.effects.length;if(a&&(t=Me.get().clear()),r.boundsArea)t.addRect(r.boundsArea,n);else{r.renderPipeId&&(t.matrix=n,t.addBounds(r.bounds));const l=r.children;for(let u=0;u-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);const e=t.children;for(let s=0;s0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(){for(let t=0;tthis.addChild(e)),t.parent?.addChild(this)}static mixin(t){Object.defineProperties(Tt.prototype,Object.getOwnPropertyDescriptors(t))}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||ft(gt,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let i=0;i1){for(let i=0;i-1&&(this._didViewChangeTick++,this.children.splice(s,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parent=null,this.emit("childRemoved",e,this,s),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=te.get(Al,this),this.groupTransform=it.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),te.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new it),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*Va}set angle(t){this.rotation=t*Oa}get pivot(){return this._pivot===Os&&(this._pivot=new Dt(this,0,0)),this._pivot}set pivot(t){this._pivot===Os&&(this._pivot=new Dt(this,0,0)),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===Vs&&(this._skew=new Dt(this,0,0)),this._skew}set skew(t){this._skew===Vs&&(this._skew=new Dt(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===zs&&(this._scale=new Dt(this,1,1)),this._scale}set scale(t){this._scale===zs&&(this._scale=new Dt(this,0,0)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});const e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){const s=this.getLocalBounds();typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,s.width),e!==void 0&&this._setHeight(e,s.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX||1:this.scale.x,typeof t.scaleY=="number"?t.scaleY||1:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const e=this.localTransform,s=this._scale,i=this._pivot,n=this._position,o=s._x,a=s._y,l=i._x,u=i._y;e.a=this._cx*o,e.b=this._sx*o,e.c=this._cy*a,e.d=this._sy*a,e.tx=n._x-(l*e.a+u*e.c),e.ty=n._y-(l*e.b+u*e.d)}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=ci,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const s=Ft.shared.setValue(t??16777215).toBgrNumber();s!==this.localColor&&(this.localColor=s,this._updateFlags|=ci,this._onUpdate())}get tint(){return fs(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Tl,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const e=t?2:0;(this.localDisplayStatus&2)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ls,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const e=t?0:4;(this.localDisplayStatus&4)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ls,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const e=t?1:0;(this.localDisplayStatus&1)!==e&&(this._updateFlags|=Ls,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0;let e;if(this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof t=="boolean"?t:t?.children)&&e)for(let i=0;i=e.minX&&s<=e.maxX&&i>=e.minY&&i<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}destroy(t){super.destroy(t),this._bounds=null}}qe=class extends An{constructor(t=ut.EMPTY){t instanceof ut&&(t={texture:t});const{texture:e=ut.EMPTY,anchor:s,roundPixels:i,width:n,height:o,...a}=t;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new Dt({_onUpdate:()=>{this.onViewUpdate()}}),s?this.anchor=s:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=i??!1,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o)}static from(t,e=!1){return t instanceof ut?new qe(t):new qe(ut.from(t,e))}set texture(t){t||(t=ut.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return qa(this._visualBounds,this._anchor,this._texture,0),this._visualBounds}get sourceBounds(){return ft("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,e=this._texture,s=this._bounds,{width:i,height:n}=e.orig;s.minX=-t._x*i,s.maxX=s.minX+i,s.minY=-t._y*n,s.maxY=s.minY+n}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){const s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),e!==void 0&&this._setHeight(e,this._texture.orig.height)}};const kl=new Xt;function Sn(r,t,e){const s=kl;r.measurable=!0,_n(r,e,s),t.addBoundsMask(s),r.measurable=!1}function Tn(r,t,e){const s=Me.get();r.measurable=!0;const i=kt.get().identity(),n=kn(r,e,i);bn(r,s,n),r.measurable=!1,t.addBoundsMask(s),kt.return(i),Me.return(s)}function kn(r,t,e){return r?(r!==t&&(kn(r.parent,t,e),r.updateLocalTransform(),e.append(r.localTransform)),e):(Yt("Mask bounds, renderable is not inside the root container"),e)}class Pn{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof qe),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask=null}addBounds(t,e){this.inverse||Sn(this.mask,t,e)}addLocalBounds(t,e){Tn(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof qe}}Pn.extension=lt.MaskEffect;class Mn{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}Mn.extension=lt.MaskEffect;class In{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null}addBounds(t,e){Sn(this.mask,t,e)}addLocalBounds(t,e){Tn(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof Tt}}In.extension=lt.MaskEffect;const Pl={createCanvas:(r,t)=>{const e=document.createElement("canvas");return e.width=r,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,t)=>fetch(r,t),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")};let di=Pl;ne={get(){return di},set(r){di=r}};En=class extends qt{constructor(t){t.resource||(t.resource=ne.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,s=this._resolution){const i=super.resize(t,e,s);return i&&this.resizeCanvas(),i}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}};En.extension=lt.TextureSource;Pr=class extends qt{constructor(t){if(t.resource&&globalThis.HTMLImageElement&&t.resource instanceof HTMLImageElement){const e=ne.get().createCanvas(t.resource.width,t.resource.height);e.getContext("2d").drawImage(t.resource,0,0,t.resource.width,t.resource.height),t.resource=e,Yt("ImageSource: Image element passed, converting to canvas. Use CanvasSource instead.")}super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}};Pr.extension=lt.TextureSource;dr=(r=>(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(dr||{});class Us{constructor(t,e=null,s=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=s,this._once=i}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const Dn=class Et{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Us(null,null,1/0),this.deltaMS=1/Et.targetFPMS,this.elapsedMS=1/Et.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,s=dr.NORMAL){return this._addListener(new Us(t,e,s))}addOnce(t,e,s=dr.NORMAL){return this._addListener(new Us(t,e,s,!0))}_addListener(t){let e=this._head.next,s=this._head;if(!e)t.connect(s);else{for(;e;){if(t.priority>e.priority){t.connect(s);break}s=e,e=e.next}t.previous||t.connect(s)}return this._startIfPossible(),this}remove(t,e){let s=this._head.next;for(;s;)s.match(t,e)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const n=t-this._lastFrame|0;if(n{const t=document.createElement("canvas").getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return"premultiply-alpha-on-upload";const s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s);const i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(i),t.deleteTexture(s),t.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Hs}const ks=class Rn extends qt{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...Rn.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=ns.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await Ml(),this._load=new Promise((s,i)=>{this.isValid?s(this):(this._resolve=s,this._reject=i,e.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(ns.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(ns.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ns.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};ks.extension=lt.TextureSource;ks.defaultOptions={...qt.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};ks.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Il=ks;const Ce=(r,t,e=!1)=>(Array.isArray(r)||(r=[r]),t?r.map(s=>typeof s=="string"||e?t(s):s):r);class El{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||Yt(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const s=Ce(t);let i;for(let l=0;l{n.set(l,e)});const o=[...n.keys()],a={cacheKeys:o,keys:s};s.forEach(l=>{this._cacheMap.set(l,a)}),o.forEach(l=>{const u=i?i[l]:e;this._cache.has(l)&&this._cache.get(l)!==u&&Yt("[Cache] already has key:",l),this._cache.set(l,n.get(l))})}remove(t){if(!this._cacheMap.has(t)){Yt(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(i=>{this._cache.delete(i)}),e.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}let fr;Ae=new El;fr=[];jt.handleByList(lt.TextureSource,fr);function Fn(r={}){const t=r&&r.resource,e=t?r.resource:r,s=t?r:{resource:r};for(let i=0;i{Ae.has(s)&&Ae.remove(s)}),t||Ae.set(s,n),n}function Rl(r,t=!1){return typeof r=="string"?Ae.get(r):r instanceof qt?new ut({source:r}):Dl(r,t)}ut.from=Rl;qt.from=Fn;jt.add(Pn,Mn,In,Il,Pr,En,Sr);var Bn=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(Bn||{});function Gt(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function Ee(r){return r.split("?")[0].split("#")[0]}function Fl(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bl(r,t,e){return r.replace(new RegExp(Fl(t),"g"),e)}function $l(r,t){let e="",s=0,i=-1,n=0,o=-1;for(let a=0;a<=r.length;++a){if(a2){const l=e.lastIndexOf("/");if(l!==e.length-1){l===-1?(e="",s=0):(e=e.slice(0,l),s=e.length-1-e.lastIndexOf("/")),i=a,n=0;continue}}else if(e.length===2||e.length===1){e="",s=0,i=a,n=0;continue}}}else e.length>0?e+=`/${r.slice(i+1,a)}`:e=r.slice(i+1,a),s=a-i-1;i=a,n=0}else o===46&&n!==-1?++n:n=-1}return e}const Ke={toPosix(r){return Bl(r,"\\","/")},isUrl(r){return/^https?:/.test(this.toPosix(r))},isDataUrl(r){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},isBlobUrl(r){return r.startsWith("blob:")},hasProtocol(r){return/^[^/:]+:/.test(this.toPosix(r))},getProtocol(r){Gt(r),r=this.toPosix(r);const t=/^file:\/\/\//.exec(r);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(r);return e?e[0]:""},toAbsolute(r,t,e){if(Gt(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;const s=Ee(this.toPosix(t??ne.get().getBaseUrl())),i=Ee(this.toPosix(e??this.rootname(s)));return r=this.toPosix(r),r.startsWith("/")?Ke.join(i,r.slice(1)):this.isAbsolute(r)?r:this.join(s,r)},normalize(r){if(Gt(r),r.length===0)return".";if(this.isDataUrl(r)||this.isBlobUrl(r))return r;r=this.toPosix(r);let t="";const e=r.startsWith("/");this.hasProtocol(r)&&(t=this.rootname(r),r=r.slice(t.length));const s=r.endsWith("/");return r=$l(r),r.length>0&&s&&(r+="/"),e?`/${r}`:t+r},isAbsolute(r){return Gt(r),r=this.toPosix(r),this.hasProtocol(r)?!0:r.startsWith("/")},join(...r){if(r.length===0)return".";let t;for(let e=0;e0)if(t===void 0)t=s;else{const i=r[e-1]??"";this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${s}`:t+=`/${s}`}}return t===void 0?".":this.normalize(t)},dirname(r){if(Gt(r),r.length===0)return".";r=this.toPosix(r);let t=r.charCodeAt(0);const e=t===47;let s=-1,i=!0;const n=this.getProtocol(r),o=r;r=r.slice(n.length);for(let a=r.length-1;a>=1;--a)if(t=r.charCodeAt(a),t===47){if(!i){s=a;break}}else i=!1;return s===-1?e?"/":this.isUrl(o)?n+r:n:e&&s===1?"//":n+r.slice(0,s)},rootname(r){Gt(r),r=this.toPosix(r);let t="";if(r.startsWith("/")?t="/":t=this.getProtocol(r),this.isUrl(r)){const e=r.indexOf("/",t.length);e!==-1?t=r.slice(0,e):t=r,t.endsWith("/")||(t+="/")}return t},basename(r,t){Gt(r),t&&Gt(t),r=Ee(this.toPosix(r));let e=0,s=-1,i=!0,n;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t.length===r.length&&t===r)return"";let o=t.length-1,a=-1;for(n=r.length-1;n>=0;--n){const l=r.charCodeAt(n);if(l===47){if(!i){e=n+1;break}}else a===-1&&(i=!1,a=n+1),o>=0&&(l===t.charCodeAt(o)?--o===-1&&(s=n):(o=-1,s=a))}return e===s?s=a:s===-1&&(s=r.length),r.slice(e,s)}for(n=r.length-1;n>=0;--n)if(r.charCodeAt(n)===47){if(!i){e=n+1;break}}else s===-1&&(i=!1,s=n+1);return s===-1?"":r.slice(e,s)},extname(r){Gt(r),r=Ee(this.toPosix(r));let t=-1,e=0,s=-1,i=!0,n=0;for(let o=r.length-1;o>=0;--o){const a=r.charCodeAt(o);if(a===47){if(!i){e=o+1;break}continue}s===-1&&(i=!1,s=o+1),a===46?t===-1?t=o:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||s===-1||n===0||n===1&&t===s-1&&t===e+1?"":r.slice(t,s)},parse(r){Gt(r);const t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;r=Ee(this.toPosix(r));let e=r.charCodeAt(0);const s=this.isAbsolute(r);let i;t.root=this.rootname(r),s||this.hasProtocol(r)?i=1:i=0;let n=-1,o=0,a=-1,l=!0,u=r.length-1,h=0;for(;u>=i;--u){if(e=r.charCodeAt(u),e===47){if(!l){o=u+1;break}continue}a===-1&&(l=!1,a=u+1),e===46?n===-1?n=u:h!==1&&(h=1):n!==-1&&(h=-1)}return n===-1||a===-1||h===0||h===1&&n===a-1&&n===o+1?a!==-1&&(o===0&&s?t.base=t.name=r.slice(1,a):t.base=t.name=r.slice(o,a)):(o===0&&s?(t.name=r.slice(1,n),t.base=r.slice(1,a)):(t.name=r.slice(o,n),t.base=r.slice(o,a)),t.ext=r.slice(n,a)),t.dir=this.dirname(r),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function $n(r,t,e,s,i){const n=t[e];for(let o=0;o{const o=n.substring(1,n.length-1).split(",");i.push(o)}),$n(r,i,0,e,s)}else s.push(r);return s}const fi=r=>!Array.isArray(r);class Gn{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(e[s])}`).join("&")}}getAlias(t){const{alias:e,src:s}=t;return Ce(e||s,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>o?.src??o):n?.src?n.src:n,!0)}addManifest(t){this._manifest&&Yt("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const s=[];let i=e;Array.isArray(e)||(i=Object.entries(e).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),i.forEach(n=>{const o=n.src,a=n.alias;let l;if(typeof a=="string"){const u=this._createBundleAssetId(t,a);s.push(u),l=[a,u]}else{const u=a.map(h=>this._createBundleAssetId(t,h));s.push(...u),l=[...a,...u]}this.add({...n,alias:l,src:o})}),this._bundles[t]=s}add(t){const e=[];Array.isArray(t)?e.push(...t):e.push(t);let s;s=n=>{this.hasKey(n)&&Yt(`[Resolver] already has key: ${n} overwriting`)},Ce(e).forEach(n=>{const{src:o}=n;let{data:a,format:l,loadParser:u}=n;const h=Ce(o).map(d=>typeof d=="string"?Gl(d):Array.isArray(d)?d:[d]),c=this.getAlias(n);Array.isArray(c)?c.forEach(s):s(c);const g=[];h.forEach(d=>{d.forEach(m=>{let _={};if(typeof m!="object"){_.src=m;for(let p=0;p{this._assetMap[d]=g})})}resolveBundle(t){const e=fi(t);t=Ce(t);const s={};return t.forEach(i=>{const n=this._bundles[i];if(n){const o=this.resolve(n),a={};for(const l in o){const u=o[l];a[this._extractAssetIdFromBundle(i,l)]=u}s[i]=a}}),e?s[t[0]]:s}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const s={};for(const i in e)s[i]=e[i].src;return s}return e.src}resolve(t){const e=fi(t);t=Ce(t);const s={};return t.forEach(i=>{if(!this._resolverHash[i])if(this._assetMap[i]){let n=this._assetMap[i];const o=this._getPreferredOrder(n);o?.priority.forEach(a=>{o.params[a].forEach(l=>{const u=n.filter(h=>h[a]?h[a]===l:!1);u.length&&(n=u)})}),this._resolverHash[i]=n[0]}else this._resolverHash[i]=this._buildResolvedAsset({alias:[i],src:i},{});s[i]=this._resolverHash[i]}),e?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;en.params.format.includes(s.format));if(i)return i}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){const{aliases:s,data:i,loadParser:n,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=Ke.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...i||{},...t.data},t.loadParser=n??t.loadParser,t.format=o??t.format??Nl(t.src),t}}Gn.RETINA_PREFIX=/@([0-9\.]+)x/;function Nl(r){return r.split(".").pop().split("?").shift().split("#").shift()}const pi=(r,t)=>{const e=t.split("?")[1];return e&&(r+=`?${e}`),r},Nn=class Ge{constructor(t,e){this.linkedSheets=[],this._texture=t instanceof ut?t:null,this.textureSource=t.source,this.textures={},this.animations={},this.data=e;const s=parseFloat(e.meta.scale);s?(this.resolution=s,t.source.resolution=this.resolution):this.resolution=t.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=Ge.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const s=Ge.BATCH_SIZE;for(;e-t{this._batchIndex*Ge.BATCH_SIZE{s[i]=t}),Object.keys(t.textures).forEach(i=>{s[i]=t.textures[i]}),!e){const i=Ke.dirname(r[0]);t.linkedSheets.forEach((n,o)=>{const a=Vn([`${i}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(s,a)})}return s}const Ol={extension:lt.Asset,cache:{test:r=>r instanceof mi,getCacheableAssets:(r,t)=>Vn(r,t,!1)},resolver:{extension:{type:lt.ResolveParser,name:"resolveSpritesheet"},test:r=>{const e=r.split("?")[0].split("."),s=e.pop(),i=e.pop();return s==="json"&&Vl.includes(i)},parse:r=>{const t=r.split(".");return{resolution:parseFloat(Gn.RETINA_PREFIX.exec(r)?.[1]??"1"),format:t[t.length-2],src:r}}},loader:{name:"spritesheetLoader",extension:{type:lt.LoadParser,priority:Bn.Normal,name:"spritesheetLoader"},async testParse(r,t){return Ke.extname(t.src).toLowerCase()===".json"&&!!r.frames},async parse(r,t,e){const{texture:s,imageFilename:i}=t?.data??{};let n=Ke.dirname(t.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");let o;if(s instanceof ut)o=s;else{const u=pi(n+(i??r.meta.image),t.src);o=(await e.load([u]))[u]}const a=new mi(o.source,r);await a.parse();const l=r?.meta?.related_multi_packs;if(Array.isArray(l)){const u=[];for(const c of l){if(typeof c!="string")continue;let g=n+c;t.data?.ignoreMultiPack||(g=pi(g,t.src),u.push(e.load({src:g,data:{ignoreMultiPack:!0}})))}const h=await Promise.all(u);a.linkedSheets=h,h.forEach(c=>{c.linkedSheets=[a].concat(a.linkedSheets.filter(g=>g!==c))})}return a},async unload(r,t,e){await e.unload(r.textureSource._sourceOrigin),r.destroy(!1)}}};jt.add(Ol);const Ys=Object.create(null),gi=Object.create(null);Mr=function(r,t){let e=gi[r];return e===void 0&&(Ys[t]===void 0&&(Ys[t]=1),gi[r]=e=Ys[t]++),e};let os;function On(){return(!os||os?.isContextLost())&&(os=ne.get().createCanvas().getContext("webgl",{})),os}let as;function zl(){if(!as){as="mediump";const r=On();r&&r.getShaderPrecisionFormat&&(as=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision?"highp":"mediump")}return as}function Ll(r,t,e){return t?r:e?(r=r.replace("out vec4 finalColor;",""),` #ifdef GL_ES // This checks if it is WebGL1 #define in varying #define finalColor gl_FragColor #define texture texture2D #endif ${r} `):` #ifdef GL_ES // This checks if it is WebGL1 #define in attribute #define out varying #endif ${r} `}function Ul(r,t,e){const s=e?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(r.substring(0,9)!=="precision"){let i=e?t.requestedFragmentPrecision:t.requestedVertexPrecision;return i==="highp"&&s!=="highp"&&(i="mediump"),`precision ${i} float; ${r}`}else if(s!=="highp"&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}function Hl(r,t){return t?`#version 300 es ${r}`:r}const Yl={},Xl={};function Wl(r,{name:t="pixi-program"},e=!0){t=t.replace(/\s+/g,"-"),t+=e?"-fragment":"-vertex";const s=e?Yl:Xl;return s[t]?(s[t]++,t+=`-${s[t]}`):s[t]=1,r.indexOf("#define SHADER_NAME")!==-1?r:`${`#define SHADER_NAME ${t}`} ${r}`}function jl(r,t){return t?r.replace("#version 300 es",""):r}const Xs={stripVersion:jl,ensurePrecision:Ul,addProgramDefines:Ll,setProgramName:Wl,insertVersion:Hl},Ws=Object.create(null),zn=class pr{constructor(t){t={...pr.defaultOptions,...t};const e=t.fragment.indexOf("#version 300 es")!==-1,s={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:zl()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e};let i=t.fragment,n=t.vertex;Object.keys(Xs).forEach(o=>{const a=s[o];i=Xs[o](i,a,!0),n=Xs[o](n,a,!1)}),this.fragment=i,this.vertex=n,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Mr(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null}static from(t){const e=`${t.vertex}:${t.fragment}`;return Ws[e]||(Ws[e]=new pr(t)),Ws[e]}};zn.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};Ln=zn;const _i={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};ql=function(r){return _i[r]??_i.float32};const Kl={f32:"float32","vec2":"float32x2","vec3":"float32x3","vec4":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2":"sint32x2","vec3":"sint32x3","vec4":"sint32x4",u32:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4",bool:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4"};function Zl({source:r,entryPoint:t}){const e={},s=r.indexOf(`fn ${t}`);if(s!==-1){const i=r.indexOf("->",s);if(i!==-1){const n=r.substring(s,i),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let a;for(;(a=o.exec(n))!==null;){const l=Kl[a[3]]??"float32";e[a[2]]={location:parseInt(a[1],10),format:l,stride:ql(l).stride,offset:0,instance:!1,start:0}}}}return e}function js(r){const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,l=/struct\s+(\w+)/,u=r.match(t)?.map(c=>({group:parseInt(c.match(e)[1],10),binding:parseInt(c.match(s)[1],10),name:c.match(i)[2],isUniform:c.match(i)[1]==="",type:c.match(n)[1]}));if(!u)return{groups:[],structs:[]};const h=r.match(o)?.map(c=>{const g=c.match(l)[1],d=c.match(a).reduce((m,_)=>{const[p,b]=_.split(":");return m[p.trim()]=b.trim(),m},{});return d?{name:g,members:d}:null}).filter(({name:c})=>u.some(g=>g.type===c))??[];return{groups:u,structs:h}}var Ne=(r=>(r[r.VERTEX=1]="VERTEX",r[r.FRAGMENT=2]="FRAGMENT",r[r.COMPUTE=4]="COMPUTE",r))(Ne||{});function Ql({groups:r}){const t=[];for(let e=0;ee.has(o.name)?!1:(e.add(o.name),!0)),n=[...r.groups,...t.groups].filter(o=>{const a=`${o.name}-${o.binding}`;return s.has(a)?!1:(s.add(a),!0)});return{structs:i,groups:n}}const qs=Object.create(null);Ps=class{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:s,layout:i,gpuLayout:n,name:o}=t;if(this.name=o,this.fragment=e,this.vertex=s,e.source===s.source){const a=js(e.source);this.structsAndGroups=a}else{const a=js(s.source),l=js(e.source);this.structsAndGroups=th(a,l)}this.layout=i??Jl(this.structsAndGroups),this.gpuLayout=n??Ql(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,s=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=Mr(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=Zl(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return qs[e]||(qs[e]=new Ps(t)),qs[e]}};const Un=["f32","i32","vec2","vec3","vec4","mat2x2","mat3x3","mat4x4","mat3x2","mat4x2","mat2x3","mat4x3","mat2x4","mat3x4","vec2","vec3","vec4"],eh=Un.reduce((r,t)=>(r[t]=!0,r),{});function sh(r,t){switch(r){case"f32":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"mat2x2":return new Float32Array([1,0,0,1]);case"mat3x3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Hn=class Yn{constructor(t,e){this._touched=0,this.uid=_t("uniform"),this._resourceType="uniformGroup",this._resourceId=_t("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...Yn.defaultOptions,...e},this.uniformStructures=t;const s={};for(const i in t){const n=t[i];if(n.name=i,n.size=n.size??1,!eh[n.type])throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${Un.join(", ")}`);n.value??(n.value=sh(n.type,n.size)),s[i]=n.value}this.uniforms=s,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=Mr(Object.keys(s).map(i=>`${i}-${t[i].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};Hn.defaultOptions={ubo:!1,isStatic:!1};Xn=Hn;ps=class{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const s in t){const i=t[s];this.setResource(i,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const s in this.resources)t[e++]=this.resources[s]._resourceId;this._key=t.join("|")}setResource(t,e){const s=this.resources[e];t!==s&&(s&&t.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){const e=this.resources;for(const s in e)e[s]._touched=t}destroy(){const t=this.resources;for(const e in t)t[e].off?.("change",this.onResourceChange,this);this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const e=this.resources;for(const s in e)e[s]===t&&(e[s]=null)}else this._updateKey()}};mr=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.BOTH=3]="BOTH",r))(mr||{});Ir=class extends re{constructor(t){super(),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:e,glProgram:s,groups:i,resources:n,compatibleRenderers:o,groupMap:a}=t;this.gpuProgram=e,this.glProgram=s,o===void 0&&(o=0,e&&(o|=mr.WEBGPU),s&&(o|=mr.WEBGL)),this.compatibleRenderers=o;const l={};if(!n&&!i&&(n={}),n&&i)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&i&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&i&&a)for(const u in a)for(const h in a[u]){const c=a[u][h];l[c]={group:u,binding:h,name:c}}else if(e&&i&&!a){const u=e.structsAndGroups.groups;a={},u.forEach(h=>{a[h.group]=a[h.group]||{},a[h.group][h.binding]=h.name,l[h.name]=h})}else if(n){i={},a={},e&&e.structsAndGroups.groups.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,l[c.name]=c});let u=0;for(const h in n)l[h]||(i[99]||(i[99]=new ps,this._ownedBindGroups.push(i[99])),l[h]={group:99,binding:u,name:h},a[99]=a[99]||{},a[99][u]=h,u++);for(const h in n){const c=h;let g=n[h];!g.source&&!g._resourceType&&(g=new Xn(g));const d=l[c];d&&(i[d.group]||(i[d.group]=new ps,this._ownedBindGroups.push(i[d.group])),i[d.group].setResource(g,d.binding))}}this.groups=i,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(i,l)}addResource(t,e,s){var i,n;(i=this._uniformBindMap)[e]||(i[e]={}),(n=this._uniformBindMap[e])[s]||(n[s]=t),this.groups[e]||(this.groups[e]=new ps,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const s={};for(const i in e){const n=e[i];Object.defineProperty(s,n.name,{get(){return t[n.group].getResource(n.binding)},set(o){t[n.group].setResource(o,n.binding)}})}return s}destroy(t=!1){this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:e,gl:s,...i}=t;let n,o;return e&&(n=Ps.from(e)),s&&(o=Ln.from(s)),new Ir({gpuProgram:n,glProgram:o,...i})}};const gr=[];jt.handleByNamedList(lt.Environment,gr);async function rh(r){if(!r)for(let t=0;t80*w){V=H=f[0],z=nt=f[1];for(var et=w;etH&&(H=ot),Q>nt&&(nt=Q);mt=Math.max(H-V,nt-z),mt=mt!==0?32767/mt:0}return s(k,I,w,V,z,mt,0),I}function t(f,y,w,P,S){var k,I;if(S===tt(f,y,w,P)>0)for(k=y;k=y;k-=P)I=$(k,f[k],f[k+1],I);return I&&F(I,I.next)&&(U(I),I=I.next),I}function e(f,y){if(!f)return f;y||(y=f);var w=f,P;do if(P=!1,!w.steiner&&(F(w,w.next)||T(w.prev,w,w.next)===0)){if(U(w),w=y=w.prev,w===w.next)break;P=!0}else w=w.next;while(P||w!==y);return y}function s(f,y,w,P,S,k,I){if(f){!I&&k&&d(f,P,S,k);for(var V=f,z,H;f.prev!==f.next;){if(z=f.prev,H=f.next,k?n(f,P,S,k):i(f)){y.push(z.i/w|0),y.push(f.i/w|0),y.push(H.i/w|0),U(f),f=H.next,V=H.next;continue}if(f=H,f===V){I?I===1?(f=o(e(f),y,w),s(f,y,w,P,S,k,2)):I===2&&a(f,y,w,P,S,k):s(e(f),y,w,P,S,k,1);break}}}}function i(f){var y=f.prev,w=f,P=f.next;if(T(y,w,P)>=0)return!1;for(var S=y.x,k=w.x,I=P.x,V=y.y,z=w.y,H=P.y,nt=Sk?S>I?S:I:k>I?k:I,mt=V>z?V>H?V:H:z>H?z:H,et=P.next;et!==y;){if(et.x>=nt&&et.x<=Q&&et.y>=ot&&et.y<=mt&&b(S,V,k,z,I,H,et.x,et.y)&&T(et.prev,et,et.next)>=0)return!1;et=et.next}return!0}function n(f,y,w,P){var S=f.prev,k=f,I=f.next;if(T(S,k,I)>=0)return!1;for(var V=S.x,z=k.x,H=I.x,nt=S.y,ot=k.y,Q=I.y,mt=Vz?V>H?V:H:z>H?z:H,It=nt>ot?nt>Q?nt:Q:ot>Q?ot:Q,Ot=_(mt,et,y,w,P),zt=_(Kt,It,y,w,P),K=f.prevZ,J=f.nextZ;K&&K.z>=Ot&&J&&J.z<=zt;){if(K.x>=mt&&K.x<=Kt&&K.y>=et&&K.y<=It&&K!==S&&K!==I&&b(V,nt,z,ot,H,Q,K.x,K.y)&&T(K.prev,K,K.next)>=0||(K=K.prevZ,J.x>=mt&&J.x<=Kt&&J.y>=et&&J.y<=It&&J!==S&&J!==I&&b(V,nt,z,ot,H,Q,J.x,J.y)&&T(J.prev,J,J.next)>=0))return!1;J=J.nextZ}for(;K&&K.z>=Ot;){if(K.x>=mt&&K.x<=Kt&&K.y>=et&&K.y<=It&&K!==S&&K!==I&&b(V,nt,z,ot,H,Q,K.x,K.y)&&T(K.prev,K,K.next)>=0)return!1;K=K.prevZ}for(;J&&J.z<=zt;){if(J.x>=mt&&J.x<=Kt&&J.y>=et&&J.y<=It&&J!==S&&J!==I&&b(V,nt,z,ot,H,Q,J.x,J.y)&&T(J.prev,J,J.next)>=0)return!1;J=J.nextZ}return!0}function o(f,y,w){var P=f;do{var S=P.prev,k=P.next.next;!F(S,k)&&B(S,P,P.next,k)&&L(S,k)&&L(k,S)&&(y.push(S.i/w|0),y.push(P.i/w|0),y.push(k.i/w|0),U(P),U(P.next),P=f=k),P=P.next}while(P!==f);return e(P)}function a(f,y,w,P,S,k){var I=f;do{for(var V=I.next.next;V!==I.prev;){if(I.i!==V.i&&C(I,V)){var z=A(I,V);I=e(I,I.next),z=e(z,z.next),s(I,y,w,P,S,k,0),s(z,y,w,P,S,k,0);return}V=V.next}I=I.next}while(I!==f)}function l(f,y,w,P){var S=[],k,I,V,z,H;for(k=0,I=y.length;k=w.next.y&&w.next.y!==w.y){var V=w.x+(S-w.y)*(w.next.x-w.x)/(w.next.y-w.y);if(V<=P&&V>k&&(k=V,I=w.x=w.x&&w.x>=H&&P!==w.x&&b(SI.x||w.x===I.x&&g(I,w)))&&(I=w,ot=Q)),w=w.next;while(w!==z);return I}function g(f,y){return T(f.prev,f,y.prev)<0&&T(y.next,f,f.next)<0}function d(f,y,w,P){var S=f;do S.z===0&&(S.z=_(S.x,S.y,y,w,P)),S.prevZ=S.prev,S.nextZ=S.next,S=S.next;while(S!==f);S.prevZ.nextZ=null,S.prevZ=null,m(S)}function m(f){var y,w,P,S,k,I,V,z,H=1;do{for(w=f,f=null,k=null,I=0;w;){for(I++,P=w,V=0,y=0;y0||z>0&&P;)V!==0&&(z===0||!P||w.z<=P.z)?(S=w,w=w.nextZ,V--):(S=P,P=P.nextZ,z--),k?k.nextZ=S:f=S,S.prevZ=k,k=S;w=P}k.nextZ=null,H*=2}while(I>1);return f}function _(f,y,w,P,S){return f=(f-w)*S|0,y=(y-P)*S|0,f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,y=(y|y<<8)&16711935,y=(y|y<<4)&252645135,y=(y|y<<2)&858993459,y=(y|y<<1)&1431655765,f|y<<1}function p(f){var y=f,w=f;do(y.x=(f-I)*(k-V)&&(f-I)*(P-V)>=(w-I)*(y-V)&&(w-I)*(k-V)>=(S-I)*(P-V)}function C(f,y){return f.next.i!==y.i&&f.prev.i!==y.i&&!O(f,y)&&(L(f,y)&&L(y,f)&&R(f,y)&&(T(f.prev,f,y.prev)||T(f,y.prev,y))||F(f,y)&&T(f.prev,f,f.next)>0&&T(y.prev,y,y.next)>0)}function T(f,y,w){return(y.y-f.y)*(w.x-y.x)-(y.x-f.x)*(w.y-y.y)}function F(f,y){return f.x===y.x&&f.y===y.y}function B(f,y,w,P){var S=E(T(f,y,w)),k=E(T(f,y,P)),I=E(T(w,P,f)),V=E(T(w,P,y));return!!(S!==k&&I!==V||S===0&&M(f,w,y)||k===0&&M(f,P,y)||I===0&&M(w,f,P)||V===0&&M(w,y,P))}function M(f,y,w){return y.x<=Math.max(f.x,w.x)&&y.x>=Math.min(f.x,w.x)&&y.y<=Math.max(f.y,w.y)&&y.y>=Math.min(f.y,w.y)}function E(f){return f>0?1:f<0?-1:0}function O(f,y){var w=f;do{if(w.i!==f.i&&w.next.i!==f.i&&w.i!==y.i&&w.next.i!==y.i&&B(w,w.next,f,y))return!0;w=w.next}while(w!==f);return!1}function L(f,y){return T(f.prev,f,f.next)<0?T(f,y,f.next)>=0&&T(f,f.prev,y)>=0:T(f,y,f.prev)<0||T(f,f.next,y)<0}function R(f,y){var w=f,P=!1,S=(f.x+y.x)/2,k=(f.y+y.y)/2;do w.y>k!=w.next.y>k&&w.next.y!==w.y&&S<(w.next.x-w.x)*(k-w.y)/(w.next.y-w.y)+w.x&&(P=!P),w=w.next;while(w!==f);return P}function A(f,y){var w=new X(f.i,f.x,f.y),P=new X(y.i,y.x,y.y),S=f.next,k=y.prev;return f.next=y,y.prev=f,w.next=S,S.prev=w,P.next=w,w.prev=P,k.next=P,P.prev=k,P}function $(f,y,w,P){var S=new X(f,y,w);return P?(S.next=P.next,S.prev=P,P.next.prev=S,P.next=S):(S.prev=S,S.next=S),S}function U(f){f.next.prev=f.prev,f.prev.next=f.next,f.prevZ&&(f.prevZ.nextZ=f.nextZ),f.nextZ&&(f.nextZ.prevZ=f.prevZ)}function X(f,y,w){this.i=f,this.x=y,this.y=w,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}r.deviation=function(f,y,w,P){var S=y&&y.length,k=S?y[0]*w:f.length,I=Math.abs(tt(f,0,k,w));if(S)for(var V=0,z=y.length;V0&&(P+=f[S-1].length,w.holes.push(P))}return w},ls.exports}var oh=nh();const ah=Cr(oh);Wn=(r=>(r[r.NONE=0]="NONE",r[r.COLOR=16384]="COLOR",r[r.STENCIL=1024]="STENCIL",r[r.DEPTH=256]="DEPTH",r[r.COLOR_DEPTH=16640]="COLOR_DEPTH",r[r.COLOR_STENCIL=17408]="COLOR_STENCIL",r[r.DEPTH_STENCIL=1280]="DEPTH_STENCIL",r[r.ALL=17664]="ALL",r))(Wn||{});lh=class{constructor(t){this.items=[],this._name=t}emit(t,e,s,i,n,o,a,l){const{name:u,items:h}=this;for(let c=0,g=h.length;c{this.runners[e]=new lh(e)})}_addSystems(t){let e;for(e in t){const s=t[e];this._addSystem(s.value,s.name)}}_addSystem(t,e){const s=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=s,this._systemsHash[e]=s;for(const i in this.runners)this.runners[i].add(s);return this}_addPipes(t,e){const s=e.reduce((i,n)=>(i[n.name]=n.value,i),{});t.forEach(i=>{const n=i.value,o=i.name,a=s[o];this.renderPipes[o]=new n(this,a?new a:null)})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!ih())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}};jn.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let hs;Kn=jn;function uh(r){return hs!==void 0||(hs=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:r??Kn.defaultOptions.failIfMajorPerformanceCaveat};try{if(!ne.get().getWebGLRenderingContext())return!1;let s=ne.get().createCanvas().getContext("webgl",t);const i=!!s?.getContextAttributes()?.stencil;if(s){const n=s.getExtension("WEBGL_lose_context");n&&n.loseContext()}return s=null,i}catch{return!1}})()),hs}let us;async function ch(r={}){return us!==void 0||(us=await (async()=>{const t=ne.get().getNavigator().gpu;if(!t)return!1;try{return await (await t.requestAdapter(r)).requestDevice(),!0}catch{return!1}})()),us}const xi=["webgl","webgpu","canvas"];async function dh(r){let t=[];r.preference?(t.push(r.preference),xi.forEach(n=>{n!==r.preference&&t.push(n)})):t=xi.slice();let e,s={};for(let n=0;n{const{WebGPURenderer:l}=await import("./WebGPURenderer-WqxaCEVy.js");return{WebGPURenderer:l}},__vite__mapDeps([12,10,13,11,1,2,3,4,5]),import.meta.url);e=a,s={...r,...r.webgpu};break}else if(o==="webgl"&&uh(r.failIfMajorPerformanceCaveat??Kn.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await Te(async()=>{const{WebGLRenderer:l}=await import("./WebGLRenderer-DlZELJmP.js");return{WebGLRenderer:l}},__vite__mapDeps([14,10,13,1,2,3,4,5]),import.meta.url);e=a,s={...r,...r.webgl};break}else if(o==="canvas")throw s={...r},new Error("CanvasRenderer is not yet implemented")}if(delete s.webgpu,delete s.webgl,!e)throw new Error("No available renderer for the current environment");const i=new e;return await i.init(s),i}Zn="8.6.3";class Qn{static init(){globalThis.__PIXI_APP_INIT__?.(this,Zn)}static destroy(){}}Qn.extension=lt.Application;fh=class{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,Zn)}destroy(){this._renderer=null}};fh.extension={type:[lt.WebGLSystem,lt.WebGPUSystem],name:"initHook",priority:-10};const Jn=class _r{constructor(...t){this.stage=new Tt,t[0]!==void 0&&ft(gt,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.renderer=await dh(t),_r._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return ft(gt,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,e=!1){const s=_r._plugins.slice(0);s.reverse(),s.forEach(i=>{i.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};Jn._plugins=[];let to=Jn;jt.handleByList(lt.Application,to._plugins);jt.add(Qn);const eo=class yr{constructor(t,e,s,i){this.uid=_t("fillGradient"),this.type="linear",this.gradientStops=[],this._styleKey=null,this.x0=t,this.y0=e,this.x1=s,this.y1=i}addColorStop(t,e){return this.gradientStops.push({offset:t,color:Ft.shared.setValue(e).toHexa()}),this._styleKey=null,this}buildLinearGradient(){if(this.texture)return;const t=yr.defaultTextureSize,{gradientStops:e}=this,s=ne.get().createCanvas();s.width=t,s.height=t;const i=s.getContext("2d"),n=i.createLinearGradient(0,0,yr.defaultTextureSize,1);for(let _=0;_`${i.offset}-${i.color}`).join("-"),e=this.texture.uid,s=this.transform.toArray().join("-");return`fill-gradient-${this.uid}-${t}-${e}-${s}-${this.x0}-${this.y0}-${this.x1}-${this.y1}`}};eo.defaultTextureSize=256;ph=eo;const bi={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};mh=class{constructor(t,e){this.uid=_t("fillPattern"),this.transform=new it,this._styleKey=null,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),e&&(t.source.style.addressModeU=bi[e].addressModeU,t.source.style.addressModeV=bi[e].addressModeV)}setTransform(t){const e=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/e.frame.width,1/e.frame.height),this._styleKey=null}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}};var Ks,vi;function gh(){if(vi)return Ks;vi=1,Ks=e;var r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function e(n){var o=[];return n.replace(t,function(a,l,u){var h=l.toLowerCase();for(u=i(u),h=="m"&&u.length>2&&(o.push([l].concat(u.splice(0,2))),h="l",l=l=="m"?"l":"L");;){if(u.length==r[h])return u.unshift(l),o.push(u);if(u.length0&&(i=s.pop(),i?(n=i.startX,o=i.startY):(n=0,o=0)),i=null;break;default:Yt(`Unknown SVG path command: ${u}`)}u!=="Z"&&u!=="z"&&i===null&&(i={startX:n,startY:o},s.push(i))}return t}class Er{constructor(t=0,e=0,s=0){this.type="circle",this.x=t,this.y=e,this.radius=s}clone(){return new Er(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const s=this.radius*this.radius;let i=this.x-t,n=this.y-e;return i*=i,n*=n,i+n<=s}strokeContains(t,e,s){if(this.radius===0)return!1;const i=this.x-t,n=this.y-e,o=this.radius,a=s/2,l=Math.sqrt(i*i+n*n);return lo-a}getBounds(t){return t||(t=new Ct),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Dr{constructor(t=0,e=0,s=0,i=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=s,this.halfHeight=i}clone(){return new Dr(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(t-this.x)/this.halfWidth,i=(e-this.y)/this.halfHeight;return s*=s,i*=i,s+i<=1}strokeContains(t,e,s){const{halfWidth:i,halfHeight:n}=this;if(i<=0||n<=0)return!1;const o=s/2,a=i-o,l=n-o,u=i+o,h=n+o,c=t-this.x,g=e-this.y,d=c*c/(a*a)+g*g/(l*l),m=c*c/(u*u)+g*g/(h*h);return d>1&&m<=1}getBounds(t){return t||(t=new Ct),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function bh(r,t,e,s,i,n){const o=r-e,a=t-s,l=i-e,u=n-s,h=o*l+a*u,c=l*l+u*u;let g=-1;c!==0&&(g=h/c);let d,m;g<0?(d=e,m=s):g>1?(d=i,m=n):(d=e+g*l,m=s+g*u);const _=r-d,p=t-m;return _*_+p*p}class ze{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const s=[];for(let i=0,n=e.length;ie!=h>e&&t<(u-a)*((e-l)/(h-l))+a&&(s=!s)}return s}strokeContains(t,e,s){const i=s/2,n=i*i,{points:o}=this,a=o.length-(this.closePath?0:2);for(let l=0;li?u:i,n=ho?h:o}return t.x=s,t.width=i-s,t.y=n,t.height=o-n,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}}const cs=(r,t,e,s,i,n)=>{const o=r-e,a=t-s,l=Math.sqrt(o*o+a*a);return l>=i-n&&l<=i+n};class Rr{constructor(t=0,e=0,s=0,i=0,n=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=s,this.height=i,this.radius=n}getBounds(t){return t||(t=new Ct),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Rr(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let i=t-(this.x+s),n=e-(this.y+s);const o=s*s;if(i*i+n*n<=o||(i=t-(this.x+this.width-s),i*i+n*n<=o)||(n=e-(this.y+this.height-s),i*i+n*n<=o)||(i=t-(this.x+s),i*i+n*n<=o))return!0}return!1}strokeContains(t,e,s){const{x:i,y:n,width:o,height:a,radius:l}=this,u=s/2,h=i+l,c=n+l,g=o-l*2,d=a-l*2,m=i+o,_=n+a;return(t>=i-u&&t<=i+u||t>=m-u&&t<=m+u)&&e>=c&&e<=c+d||(e>=n-u&&e<=n+u||e>=_-u&&e<=_+u)&&t>=h&&t<=h+g?!0:tm-l&&em-l&&e>_-l&&cs(t,e,m-l,_-l,l,u)||t_-l&&cs(t,e,h,_-l,l,u)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const vh=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` `);function wh(r){let t="";for(let e=0;e0&&(t+=` else `),e>>=0;return ro[e]||Sh(r,t,e)};let Zs=0;function Sh(r,t,e){const s={};let i=0;Zs||(Zs=so());for(let o=0;o0){const o=new Uint8Array(r,e*8,n);new Uint8Array(t,e*8,n).set(o)}};const Th={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};kh=(r=>(r[r.DISABLED=0]="DISABLED",r[r.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",r[r.MASK_ACTIVE=2]="MASK_ACTIVE",r[r.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",r[r.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",r[r.NONE=5]="NONE",r))(kh||{});Ai=function(r,t){return t.alphaMode==="no-premultiply-alpha"&&Th[r]||r};class Ph{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t0?io[--xr]:new Mh}function Ti(r){io[xr++]=r}let Re=0;const no=class ms{constructor(t={}){this.uid=_t("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],ms.defaultOptions.maxTextures=ms.defaultOptions.maxTextures??so(),t={...ms.defaultOptions,...t};const{maxTextures:e,attributesInitialSize:s,indicesInitialSize:i}=t;this.attributeBuffer=new wi(s*4),this.indexBuffer=new Uint16Array(i),this.maxTextures=e}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;tthis.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const l=this.attributeBuffer.float32View,u=this.attributeBuffer.uint32View,h=this.indexBuffer;let c=this._batchIndexSize,g=this._batchIndexStart,d="startBatch";const m=this.maxTextures;for(let _=this.elementStart;_=m||F)&&(this._finishBatch(s,g,c-g,i,o,a,t,d),d="renderBatch",g=c,o=T,a=p.topology,s=Si(),i=s.textures,i.clear(),++Re),p._textureId=C._textureBindLocation=i.count,i.ids[C.uid]=i.count,i.textures[i.count++]=C,p._batch=s,c+=p.indexSize,p.packAsQuad?(this.packQuadAttributes(p,l,u,p._attributeStart,p._textureId),this.packQuadIndex(h,p._indexStart,p._attributeStart/this.vertexSize)):(this.packAttributes(p,l,u,p._attributeStart,p._textureId),this.packIndex(p,h,p._indexStart,p._attributeStart/this.vertexSize))}i.count>0&&(this._finishBatch(s,g,c-g,i,o,a,t,d),g=c,++Re),this.elementStart=this.elementSize,this._batchIndexStart=g,this._batchIndexSize=c}_finishBatch(t,e,s,i,n,o,a,l){t.gpuBindGroup=null,t.bindGroup=null,t.action=l,t.batcher=this,t.textures=i,t.blendMode=n,t.topology=o,t.start=e,t.size=s,++Re,this.batches[this.batchIndex++]=t,a.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,this.attributeBuffer.size*2),s=new wi(e);Ci(this.attributeBuffer.rawBinaryData,s.rawBinaryData),this.attributeBuffer=s}_resizeIndexBuffer(t){const e=this.indexBuffer;let s=Math.max(t,e.length*1.5);s+=s%2;const i=s>65535?new Uint32Array(s):new Uint16Array(s);if(i.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let n=0;n(r[r.MAP_READ=1]="MAP_READ",r[r.MAP_WRITE=2]="MAP_WRITE",r[r.COPY_SRC=4]="COPY_SRC",r[r.COPY_DST=8]="COPY_DST",r[r.INDEX=16]="INDEX",r[r.VERTEX=32]="VERTEX",r[r.UNIFORM=64]="UNIFORM",r[r.STORAGE=128]="STORAGE",r[r.INDIRECT=256]="INDIRECT",r[r.QUERY_RESOLVE=512]="QUERY_RESOLVE",r[r.STATIC=1024]="STATIC",r))(Mt||{});Ze=class extends re{constructor(t){let{data:e,size:s}=t;const{usage:i,label:n,shrinkToFit:o}=t;super(),this.uid=_t("buffer"),this._resourceType="buffer",this._resourceId=_t("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,s??(s=e?.byteLength);const a=!!e;this.descriptor={size:s,usage:i,mappedAtCreation:a,label:n},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&Mt.STATIC)}set static(t){t?this.descriptor.usage|=Mt.STATIC:this.descriptor.usage&=~Mt.STATIC}setDataWithSize(t,e,s){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t){s&&this.emit("update",this);return}const i=this._data;if(this._data=t,this._dataInt32=null,!i||i.length!==t.length){!this.shrinkToFit&&i&&t.byteLengtha&&(a=d),m>l&&(l=m),de.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}};const Fh=new Float32Array(1),Bh=new Uint32Array(1);class $h extends Rh{constructor(){const e=new Ze({data:Fh,label:"attribute-batch-buffer",usage:Mt.VERTEX|Mt.COPY_DST,shrinkToFit:!1}),s=new Ze({data:Bh,label:"index-batch-buffer",usage:Mt.INDEX|Mt.COPY_DST,shrinkToFit:!1}),i=6*4;super({attributes:{aPosition:{buffer:e,format:"float32x2",stride:i,offset:0},aUV:{buffer:e,format:"float32x2",stride:i,offset:2*4},aColor:{buffer:e,format:"unorm8x4",stride:i,offset:4*4},aTextureIdAndRound:{buffer:e,format:"uint16x2",stride:i,offset:5*4}},indexBuffer:s})}}function ki(r,t,e){if(r)for(const s in r){const i=s.toLocaleLowerCase(),n=t[i];if(n){let o=r[s];s==="header"&&(o=o.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),e&&n.push(`//----${e}----//`),n.push(o)}else Yt(`${s} placement hook does not exist in shader`)}}const Gh=/\{\{(.*?)\}\}/g;function Pi(r){const t={};return(r.match(Gh)?.map(s=>s.replace(/[{()}]/g,""))??[]).forEach(s=>{t[s]=[]}),t}function Mi(r,t){let e;const s=/@in\s+([^;]+);/g;for(;(e=s.exec(r))!==null;)t.push(e[1])}function Ii(r,t,e=!1){const s=[];Mi(t,s),r.forEach(a=>{a.header&&Mi(a.header,s)});const i=s;e&&i.sort();const n=i.map((a,l)=>` @location(${l}) ${a},`).join(` `);let o=t.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",` ${n} `),o}function Ei(r,t){let e;const s=/@out\s+([^;]+);/g;for(;(e=s.exec(r))!==null;)t.push(e[1])}function Nh(r){const e=/\b(\w+)\s*:/g.exec(r);return e?e[1]:""}function Vh(r){const t=/@.*?\s+/g;return r.replace(t,"")}function Oh(r,t){const e=[];Ei(t,e),r.forEach(l=>{l.header&&Ei(l.header,e)});let s=0;const i=e.sort().map(l=>l.indexOf("builtin")>-1?l:`@location(${s++}) ${l}`).join(`, `),n=e.sort().map(l=>` var ${Vh(l)};`).join(` `),o=`return VSOutput( ${e.sort().map(l=>` ${Nh(l)}`).join(`, `)});`;let a=t.replace(/@out\s+[^;]+;\s*/g,"");return a=a.replace("{{struct}}",` ${i} `),a=a.replace("{{start}}",` ${n} `),a=a.replace("{{return}}",` ${o} `),a}function Di(r,t){let e=r;for(const s in t){const i=t[s];i.join(` `).length?e=e.replace(`{{${s}}}`,`//-----${s} START-----// ${i.join(` `)} //----${s} FINISH----//`):e=e.replace(`{{${s}}}`,"")}return e}const ie=Object.create(null),Qs=new Map;let zh=0;function Lh({template:r,bits:t}){const e=ao(r,t);if(ie[e])return ie[e];const{vertex:s,fragment:i}=Hh(r,t);return ie[e]=lo(s,i,t),ie[e]}function Uh({template:r,bits:t}){const e=ao(r,t);return ie[e]||(ie[e]=lo(r.vertex,r.fragment,t)),ie[e]}function Hh(r,t){const e=t.map(o=>o.vertex).filter(o=>!!o),s=t.map(o=>o.fragment).filter(o=>!!o);let i=Ii(e,r.vertex,!0);i=Oh(e,i);const n=Ii(s,r.fragment,!0);return{vertex:i,fragment:n}}function ao(r,t){return t.map(e=>(Qs.has(e)||Qs.set(e,zh++),Qs.get(e))).sort((e,s)=>e-s).join("-")+r.vertex+r.fragment}function lo(r,t,e){const s=Pi(r),i=Pi(t);return e.forEach(n=>{ki(n.vertex,s,n.name),ki(n.fragment,i,n.name)}),{vertex:Di(r,s),fragment:Di(t,i)}}const Yh=` @in aPosition: vec2; @in aUV: vec2; @out @builtin(position) vPosition: vec4; @out vUV : vec2; @out vColor : vec4; {{header}} struct VSOutput { {{struct}} }; @vertex fn main( {{in}} ) -> VSOutput { var worldTransformMatrix = globalUniforms.uWorldTransformMatrix; var modelMatrix = mat3x3( 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 ); var position = aPosition; var uv = aUV; {{start}} vColor = vec4(1., 1., 1., 1.); {{main}} vUV = uv; var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix; vPosition = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); vColor *= globalUniforms.uWorldColorAlpha; {{end}} {{return}} }; `,Xh=` @in vUV : vec2; @in vColor : vec4; {{header}} @fragment fn main( {{in}} ) -> @location(0) vec4 { {{start}} var outColor:vec4; {{main}} var finalColor:vec4 = outColor * vColor; {{end}} return finalColor; }; `,Wh=` in vec2 aPosition; in vec2 aUV; out vec4 vColor; out vec2 vUV; {{header}} void main(void){ mat3 worldTransformMatrix = uWorldTransformMatrix; mat3 modelMatrix = mat3( 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 ); vec2 position = aPosition; vec2 uv = aUV; {{start}} vColor = vec4(1.); {{main}} vUV = uv; mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix; gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); vColor *= uWorldColorAlpha; {{end}} } `,jh=` in vec4 vColor; in vec2 vUV; out vec4 finalColor; {{header}} void main(void) { {{start}} vec4 outColor; {{main}} finalColor = outColor * vColor; {{end}} } `,qh={name:"global-uniforms-bit",vertex:{header:` struct GlobalUniforms { uProjectionMatrix:mat3x3, uWorldTransformMatrix:mat3x3, uWorldColorAlpha: vec4, uResolution: vec2, } @group(0) @binding(0) var globalUniforms : GlobalUniforms; `}},Kh={name:"global-uniforms-bit",vertex:{header:` uniform mat3 uProjectionMatrix; uniform mat3 uWorldTransformMatrix; uniform vec4 uWorldColorAlpha; uniform vec2 uResolution; `}};Zh=function({bits:r,name:t}){const e=Lh({template:{fragment:Xh,vertex:Yh},bits:[qh,...r]});return Ps.from({name:t,vertex:{source:e.vertex,entryPoint:"main"},fragment:{source:e.fragment,entryPoint:"main"}})};Qh=function({bits:r,name:t}){return new Ln({name:t,...Uh({template:{vertex:Wh,fragment:jh},bits:[Kh,...r]})})};let Js;Jh={name:"color-bit",vertex:{header:` @in aColor: vec4; `,main:` vColor *= vec4(aColor.rgb * aColor.a, aColor.a); `}};tu={name:"color-bit",vertex:{header:` in vec4 aColor; `,main:` vColor *= vec4(aColor.rgb * aColor.a, aColor.a); `}};Js={};function eu(r){const t=[];if(r===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let e=0;for(let s=0;s;`),t.push(`@group(1) @binding(${e++}) var textureSampler${s+1}: sampler;`)}return t.join(` `)}function su(r){const t=[];if(r===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let e=0;e; @out @interpolate(flat) vTextureId : u32; `,main:` vTextureId = aTextureIdAndRound.y; `,end:` if(aTextureIdAndRound.x == 1) { vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw); } `},fragment:{header:` @in @interpolate(flat) vTextureId: u32; ${eu(r)} `,main:` var uvDx = dpdx(vUV); var uvDy = dpdy(vUV); ${su(r)} `}}),Js[r]};const tr={};function iu(r){const t=[];for(let e=0;e0&&t.push("else"),e, targetSize: vec2) -> vec2 { return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; } `}};au={name:"round-pixels-bit",vertex:{header:` vec2 roundPixels(vec2 position, vec2 targetSize) { return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; } `}};Ri={};lu=function(r){let t=Ri[r];if(t)return t;const e=new Int32Array(r);for(let s=0;s>16|t&65280|(t&255)<<16,s=this.renderable;return s?xn(e,s.groupColor)+(this.alpha*s.groupAlpha*255<<24):e+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||fu}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}};const Qe={extension:{type:lt.ShapeBuilder,name:"circle"},build(r,t){let e,s,i,n,o,a;if(r.type==="circle"){const F=r;e=F.x,s=F.y,o=a=F.radius,i=n=0}else if(r.type==="ellipse"){const F=r;e=F.x,s=F.y,o=F.halfWidth,a=F.halfHeight,i=n=0}else{const F=r,B=F.width/2,M=F.height/2;e=F.x+B,s=F.y+M,o=a=Math.max(0,Math.min(F.radius,Math.min(B,M))),i=B-o,n=M-a}if(!(o>=0&&a>=0&&i>=0&&n>=0))return t;const l=Math.ceil(2.3*Math.sqrt(o+a)),u=l*8+(i?4:0)+(n?4:0);if(u===0)return t;if(l===0)return t[0]=t[6]=e+i,t[1]=t[3]=s+n,t[2]=t[4]=e-i,t[5]=t[7]=s-n,t;let h=0,c=l*4+(i?2:0)+2,g=c,d=u,m=i+o,_=n,p=e+m,b=e-m,C=s+_;if(t[h++]=p,t[h++]=C,t[--c]=C,t[--c]=b,n){const F=s-_;t[g++]=b,t[g++]=F,t[--d]=F,t[--d]=p}for(let F=1;F0&&(i[n++]=l,i[n++]=u,i[n++]=l-1),l++;i[n++]=u+1,i[n++]=u,i[n++]=l-1}},pu={...Qe,extension:{...Qe.extension,name:"ellipse"}},mu={...Qe,extension:{...Qe.extension,name:"roundedRectangle"}},po=1e-4,Bi=1e-4;function gu(r){const t=r.length;if(t<6)return 1;let e=0;for(let s=0,i=r[t-2],n=r[t-1];sc&&(c+=Math.PI*2);let g=h;const d=c-h,m=Math.abs(d),_=Math.sqrt(l*l+u*u),p=(15*m*Math.sqrt(_)/Math.PI>>0)+1,b=d/p;if(g+=b,a){o.push(r,t),o.push(e,s);for(let C=1,T=g;C=0&&(a.join==="round"?_+=ae(M,E,M-R*f,E-A*f,M-$*f,E-U*f,d,!1)+4:_+=2,d.push(M-$*y,E-U*y),d.push(M+$*f,E+U*f));continue}const ot=(-R+F)*(-A+E)-(-R+M)*(-A+B),Q=(-$+O)*(-U+E)-(-$+M)*(-U+L),mt=(S*Q-I*ot)/H,et=(V*ot-k*Q)/H,Kt=(mt-M)*(mt-M)+(et-E)*(et-E),It=M+(mt-M)*f,Ot=E+(et-E)*f,zt=M-(mt-M)*y,K=E-(et-E)*y,J=Math.min(S*S+k*k,I*I+V*V),$r=nt?f:y,bo=J+$r*$r*C;Kt<=bo?a.join==="bevel"||Kt/C>T?(nt?(d.push(It,Ot),d.push(M+R*y,E+A*y),d.push(It,Ot),d.push(M+$*y,E+U*y)):(d.push(M-R*f,E-A*f),d.push(zt,K),d.push(M-$*f,E-U*f),d.push(zt,K)),_+=2):a.join==="round"?nt?(d.push(It,Ot),d.push(M+R*y,E+A*y),_+=ae(M,E,M+R*y,E+A*y,M+$*y,E+U*y,d,!0)+4,d.push(It,Ot),d.push(M+$*y,E+U*y)):(d.push(M-R*f,E-A*f),d.push(zt,K),_+=ae(M,E,M-R*f,E-A*f,M-$*f,E-U*f,d,!1)+4,d.push(M-$*f,E-U*f),d.push(zt,K)):(d.push(It,Ot),d.push(zt,K)):(d.push(M-R*f,E-A*f),d.push(M+R*y,E+A*y),a.join==="round"?nt?_+=ae(M,E,M+R*y,E+A*y,M+$*y,E+U*y,d,!0)+2:_+=ae(M,E,M-R*f,E-A*f,M-$*f,E-U*f,d,!1)+2:a.join==="miter"&&Kt/C<=T&&(nt?(d.push(zt,K),d.push(zt,K)):(d.push(It,Ot),d.push(It,Ot)),_+=2),d.push(M-$*f,E-U*f),d.push(M+$*y,E+U*y),_+=2)}F=r[(m-2)*2],B=r[(m-2)*2+1],M=r[(m-1)*2],E=r[(m-1)*2+1],R=-(B-E),A=F-M,X=Math.sqrt(R*R+A*A),R/=X,A/=X,R*=b,A*=b,d.push(M-R*f,E-A*f),d.push(M+R*y,E+A*y),c||(a.cap==="round"?_+=ae(M-R*(f-y)*.5,E-A*(f-y)*.5,M-R*f,E-A*f,M+R*y,E+A*y,d,!1)+2:a.cap==="square"&&(_+=$i(M,E,R,A,f,y,!1,d)));const w=Bi*Bi;for(let P=p;P<_+p-2;++P)F=d[P*2],B=d[P*2+1],M=d[(P+1)*2],E=d[(P+1)*2+1],O=d[(P+2)*2],L=d[(P+2)*2+1],!(Math.abs(F*(E-L)+M*(L-B)+O*(B-E))=0&&o>=0&&(t[0]=s,t[1]=i,t[2]=s+n,t[3]=i,t[4]=s+n,t[5]=i+o,t[6]=s,t[7]=i+o),t},triangulate(r,t,e,s,i,n){let o=0;s*=e,t[s+o]=r[0],t[s+o+1]=r[1],o+=e,t[s+o]=r[2],t[s+o+1]=r[3],o+=e,t[s+o]=r[6],t[s+o+1]=r[7],o+=e,t[s+o]=r[4],t[s+o+1]=r[5],o+=e;const a=s/e;i[n++]=a,i[n++]=a+1,i[n++]=a+2,i[n++]=a+1,i[n++]=a+3,i[n++]=a+2}},wu={extension:{type:lt.ShapeBuilder,name:"triangle"},build(r,t){return t[0]=r.x,t[1]=r.y,t[2]=r.x2,t[3]=r.y2,t[4]=r.x3,t[5]=r.y3,t},triangulate(r,t,e,s,i,n){let o=0;s*=e,t[s+o]=r[0],t[s+o+1]=r[1],o+=e,t[s+o]=r[2],t[s+o+1]=r[3],o+=e,t[s+o]=r[4],t[s+o+1]=r[5];const a=s/e;i[n++]=a,i[n++]=a+1,i[n++]=a+2}},Ms={};jt.handleByMap(lt.ShapeBuilder,Ms);jt.add(vu,bu,wu,Qe,pu,mu);const Cu=new Ct;function Au(r,t){const{geometryData:e,batches:s}=t;s.length=0,e.indices.length=0,e.vertices.length=0,e.uvs.length=0;for(let i=0;i{const d=l.length,m=o.length/2,_=[],p=Ms[h.type];let b="triangle-list";if(p.build(h,_),c&&co(_,c),s){const B=h.closePath??!0,M=t;M.pixelLine?(yu(_,B,o,l),b="line-list"):_u(_,M,!1,B,o,l)}else if(e&&u===g){u!==0&&console.warn("[Pixi Graphics] only the last shape have be cut out");const B=[],M=_.slice();Tu(e.shapePath).forEach(O=>{B.push(M.length/2),M.push(...O)}),mo(M,B,o,2,m,l,d)}else p.triangulate(_,o,2,m,l,d);const C=a.length/2,T=t.texture;if(T!==ut.WHITE){const B=t.matrix;B&&(c&&B.append(c.clone().invert()),cu(o,2,m,a,C,2,o.length/2-m,B))}else du(a,C,2,o.length/2-m);const F=te.get(fo);F.indexOffset=d,F.indexSize=l.length-d,F.attributeOffset=m,F.attributeSize=o.length/2-m,F.baseColor=t.color,F.alpha=t.alpha,F.texture=T,F.geometryData=n,F.topology=b,i.push(F)})}function Tu(r){if(!r)return[];const t=r.shapePrimitives,e=[];for(let s=0;s{te.return(s)})}destroy(){for(const t in this._gpuContextHash)this._gpuContextHash[t]&&this.onGraphicsContextDestroy(this._gpuContextHash[t].context)}};Fr.extension={type:[lt.WebGLSystem,lt.WebGPUSystem,lt.CanvasSystem],name:"graphicsContext"};Fr.defaultOptions={bezierSmoothness:.5};go=Fr;const Mu=8,ds=11920929e-14,Iu=1;function _o(r,t,e,s,i,n,o,a,l,u){const c=Math.min(.99,Math.max(0,u??go.defaultOptions.bezierSmoothness));let g=(Iu-c)/1;return g*=g,Eu(t,e,s,i,n,o,a,l,r,g),r}function Eu(r,t,e,s,i,n,o,a,l,u){vr(r,t,e,s,i,n,o,a,l,u,0),l.push(o,a)}function vr(r,t,e,s,i,n,o,a,l,u,h){if(h>Mu)return;const c=(r+e)/2,g=(t+s)/2,d=(e+i)/2,m=(s+n)/2,_=(i+o)/2,p=(n+a)/2,b=(c+d)/2,C=(g+m)/2,T=(d+_)/2,F=(m+p)/2,B=(b+T)/2,M=(C+F)/2;if(h>0){let E=o-r,O=a-t;const L=Math.abs((e-o)*O-(s-a)*E),R=Math.abs((i-o)*O-(n-a)*E);if(L>ds&&R>ds){if((L+R)*(L+R)<=u*(E*E+O*O)){l.push(B,M);return}}else if(L>ds){if(L*L<=u*(E*E+O*O)){l.push(B,M);return}}else if(R>ds){if(R*R<=u*(E*E+O*O)){l.push(B,M);return}}else if(E=B-(r+o)/2,O=M-(t+a)/2,E*E+O*O<=u){l.push(B,M);return}}vr(r,t,c,g,b,C,B,M,l,u,h+1),vr(B,M,T,F,_,p,o,a,l,u,h+1)}const Du=8,Ru=11920929e-14,Fu=1;function Bu(r,t,e,s,i,n,o,a){const u=Math.min(.99,Math.max(0,a??go.defaultOptions.bezierSmoothness));let h=(Fu-u)/1;return h*=h,$u(t,e,s,i,n,o,r,h),r}function $u(r,t,e,s,i,n,o,a){wr(o,r,t,e,s,i,n,a,0),o.push(i,n)}function wr(r,t,e,s,i,n,o,a,l){if(l>Du)return;const u=(t+s)/2,h=(e+i)/2,c=(s+n)/2,g=(i+o)/2,d=(u+c)/2,m=(h+g)/2;let _=n-t,p=o-e;const b=Math.abs((s-n)*p-(i-o)*_);if(b>Ru){if(b*b<=a*(_*_+p*p)){r.push(d,m);return}}else if(_=d-(t+n)/2,p=m-(e+o)/2,_*_+p*p<=a){r.push(d,m);return}wr(r,t,e,u,h,d,m,a,l+1),wr(r,d,m,c,g,n,o,a,l+1)}function yo(r,t,e,s,i,n,o,a){let l=Math.abs(i-n);(!o&&i>n||o&&n>i)&&(l=2*Math.PI-l),a||(a=Math.max(6,Math.floor(6*Math.pow(s,1/3)*(l/Math.PI)))),a=Math.max(a,3);let u=l/a,h=i;u*=o?-1:1;for(let c=0;cc*l)}const Le=Math.PI*2,er={centerX:0,centerY:0,ang1:0,ang2:0},sr=({x:r,y:t},e,s,i,n,o,a,l)=>{r*=e,t*=s;const u=i*r-n*t,h=n*r+i*t;return l.x=u+o,l.y=h+a,l};function Nu(r,t){const e=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),s=t===1.5707963267948966?.551915024494:e,i=Math.cos(r),n=Math.sin(r),o=Math.cos(r+t),a=Math.sin(r+t);return[{x:i-n*s,y:n+i*s},{x:o+a*s,y:a-o*s},{x:o,y:a}]}const Ni=(r,t,e,s)=>{const i=r*s-t*e<0?-1:1;let n=r*e+t*s;return n>1&&(n=1),n<-1&&(n=-1),i*Math.acos(n)},Vu=(r,t,e,s,i,n,o,a,l,u,h,c,g)=>{const d=Math.pow(i,2),m=Math.pow(n,2),_=Math.pow(h,2),p=Math.pow(c,2);let b=d*m-d*p-m*_;b<0&&(b=0),b/=d*p+m*_,b=Math.sqrt(b)*(o===a?-1:1);const C=b*i/n*c,T=b*-n/i*h,F=u*C-l*T+(r+e)/2,B=l*C+u*T+(t+s)/2,M=(h-C)/i,E=(c-T)/n,O=(-h-C)/i,L=(-c-T)/n,R=Ni(1,0,M,E);let A=Ni(M,E,O,L);a===0&&A>0&&(A-=Le),a===1&&A<0&&(A+=Le),g.centerX=F,g.centerY=B,g.ang1=R,g.ang2=A};function Ou(r,t,e,s,i,n,o,a=0,l=0,u=0){if(n===0||o===0)return;const h=Math.sin(a*Le/360),c=Math.cos(a*Le/360),g=c*(t-s)/2+h*(e-i)/2,d=-h*(t-s)/2+c*(e-i)/2;if(g===0&&d===0)return;n=Math.abs(n),o=Math.abs(o);const m=Math.pow(g,2)/Math.pow(n,2)+Math.pow(d,2)/Math.pow(o,2);m>1&&(n*=Math.sqrt(m),o*=Math.sqrt(m)),Vu(t,e,s,i,n,o,l,u,h,c,g,d,er);let{ang1:_,ang2:p}=er;const{centerX:b,centerY:C}=er;let T=Math.abs(p)/(Le/4);Math.abs(1-T)<1e-7&&(T=1);const F=Math.max(Math.ceil(T),1);p/=F;let B=r[r.length-2],M=r[r.length-1];const E={x:0,y:0};for(let O=0;O{const l=a.x-o.x,u=a.y-o.y,h=Math.sqrt(l*l+u*u),c=l/h,g=u/h;return{len:h,nx:c,ny:g}},i=(o,a)=>{o===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y)};let n=t[t.length-1];for(let o=0;o0&&(d=-1,m=!0);const _=g/2;let p,b=Math.abs(Math.cos(_)*l/Math.sin(_));b>Math.min(h.len/2,c.len/2)?(b=Math.min(h.len/2,c.len/2),p=Math.abs(b*Math.sin(_)/Math.cos(_))):p=l;const C=a.x+c.nx*b+-c.ny*p*d,T=a.y+c.ny*b+c.nx*p*d,F=Math.atan2(h.ny,h.nx)+Math.PI/2*d,B=Math.atan2(c.ny,c.nx)-Math.PI/2*d;o===0&&r.moveTo(C+Math.cos(F)*p,T+Math.sin(F)*p),r.arc(C,T,p,F,B,m),n=a}}function Lu(r,t,e,s){const i=(a,l)=>Math.sqrt((a.x-l.x)**2+(a.y-l.y)**2),n=(a,l,u)=>({x:a.x+(l.x-a.x)*u,y:a.y+(l.y-a.y)*u}),o=t.length;for(let a=0;a=2;c-=2)h[c]===h[c-2]&&h[c-1]===h[c-3]&&h.splice(c-1,2);return this.poly(h,!0,o)}ellipse(t,e,s,i,n){return this.drawShape(new Dr(t,e,s,i),n),this}roundRect(t,e,s,i,n,o){return this.drawShape(new Rr(t,e,s,i,n),o),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let s=this._currentPoly;return s&&this.endPoly(),s=new ze,s.points.push(t,e),this._currentPoly=s,this}endPoly(t=!1){const e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new ze,t)){const e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let s=e.shape.x,i=e.shape.y;if(e.transform&&!e.transform.isIdentity()){const n=e.transform,o=s;s=n.a*s+n.c*i+n.tx,i=n.b*o+n.d*i+n.ty}this._currentPoly.points.push(s,i)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;eparseInt(O,10)),t.context.poly(C,!0),e&&t.context.fill(),s&&t.context.stroke();break;case"polyline":T=r.getAttribute("points"),C=T.match(/\d+/g).map(O=>parseInt(O,10)),t.context.poly(C,!1),s&&t.context.stroke();break;case"g":case"svg":break;default:{console.info(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}for(let O=0;OT.priority!==rt.DO_NOT_DOWNLOAD).forEach(T=>_.insert(T.piece_range,T.name));const p=new xs;let b="",C=1;for(let T=0;T{})}const{pause:g,resume:d}=Cs(c,n,{immediate:!1,immediateCallback:!0});return Je(()=>t.isActive,m=>{m?d():g()}),ts(()=>{if(!o.value)return;const m=new to;m.init({antialias:!0,width:o.value?.width,height:o.value?.height,canvas:o.value}).then(()=>l.value=m).then(()=>t.isActive&&d())}),vs(()=>{l.value?.destroy({removeView:!1},{children:!0})}),(m,_)=>(N(),j("canvas",{ref_key:"canvas",ref:o,width:"4096",height:"20"},null,512))}});Qu=Ss(Zu,[["__scopeId","data-v-c3384aa7"]]);Ju=["href"];tc={key:1};ec={class:"my-1"};sc={class:"mr-2"};rc={key:0};ic={key:2};nc={key:0};oc={key:1};ac={key:2};lc={key:0};hc={key:0,class:"d-flex flex-wrap flex-gap-row-small flex-gap-column"};uc=vt({__name:"Overview",props:{torrent:{},isActive:{type:Boolean}},setup(r){const t=r,{t:e,getTorrentStateString:s}=ee(),i=_e(),{cachedFiles:n}=yt(i),o=ws(),{properties:a}=yt(se()),l=Wt(),u=Z(()=>window.isSecureContext),h=Z(()=>n.value.filter(A=>A.priority!==rt.DO_NOT_DOWNLOAD)),c=Z(()=>n.value.length),g=Z(()=>h.value.length===1?h.value[0].name:""),d=Z(()=>a.value?.comment??""),m=Z(()=>a.value?.dl_speed_avg??0),_=Z(()=>a.value?.piece_size??0),p=Z(()=>a.value?.pieces_have??0),b=Z(()=>a.value?.pieces_num??0),C=Z(()=>a.value?.up_speed_avg??0),T=Z(()=>Vo(t.torrent.state)),F=Z(()=>`${parseInt(Oo(_.value,!0))} ${zo(_.value,!0)}`),B=Z(()=>[Ur.META_DOWNLOAD,Ur.FORCED_META_DOWNLOAD].includes(t.torrent.state)),M=Z(()=>l.enableRatioColors?Lo(t.torrent.ratio):"");async function E(){try{await navigator.clipboard.writeText(t.torrent.hash)}catch{Vr.error(e("toast.copy.error"));return}Vr.success(e("toast.copy.success"))}function O(A){o.createDialog(vo,{hashes:[t.torrent.hash],mode:A})}function L(){o.createDialog(la,{hash:t.torrent.hash,isFolder:!1,oldName:g.value},i.updateFileTreeTask.perform)}function R(A){if(o.hasActiveDialog||!t.isActive)return!1;if(A.key==="d")return A.preventDefault(),O("dl"),!0;if(A.key==="s")return A.preventDefault(),O("save"),!0;if(A.key==="f"&&h.value.length===1)return A.preventDefault(),L(),!0;if(A.key==="Delete")return A.preventDefault(),o.createDialog(Xo,{hashes:[t.torrent.hash]}),!0}return ts(()=>{document.addEventListener("keydown",R)}),To(async()=>{document.removeEventListener("keydown",R)}),(A,$)=>A.torrent?(N(),q(Ht,{key:0},{default:v(()=>[x(As,{class:"text-wrap"},{default:v(()=>[W(G(A.torrent.name),1)]),_:1}),x(Ho,null,{default:v(()=>[Y("div",null,[(N(!0),j(Pt,null,$t(D(Uo)(d.value),U=>(N(),j("span",null,[D(Wo)(U)?(N(),j("a",{key:0,target:"_blank",href:U},G(U),9,Ju)):(N(),j("span",tc,G(U),1))]))),256))]),Y("div",ec,[Y("span",sc,G(A.torrent.hash),1),u.value?(N(),q(ht,{key:0,variant:"outlined",rounded:"",onClick:E},{default:v(()=>[W(G(A.$t("torrentDetail.overview.copy_hash")),1)]),_:1})):Rt("",!0)])]),_:1}),x(pe,null,{default:v(()=>[x(dt,null,{default:v(()=>[x(st,{cols:"12",md:"6"},{default:v(()=>[x(dt,null,{default:v(()=>[x(st,{cols:"4"},{default:v(()=>[x(Yo,{color:T.value,indeterminate:B.value,size:100,"model-value":A.torrent?.progress*100||0,width:15},{default:v(()=>[B.value?(N(),j("span",rc,G(A.$t("torrentDetail.overview.fetchingMetadata")),1)):A.torrent.progress===1?(N(),q(At,{key:1,icon:"mdi-check",size:"x-large"})):(N(),j("span",ic,G(D(ir)(A.torrent.progress)),1))]),_:1},8,["color","indeterminate","model-value"])]),_:1}),x(st,{cols:"8",class:"d-flex flex-column align-center justify-center"},{default:v(()=>[B.value?(N(),j("div",nc,[Y("span",null,G(A.$t("torrentDetail.overview.waitingForMetadata")),1)])):(N(),j("div",oc,[x(Qu,{torrent:A.torrent,isActive:A.isActive},null,8,["torrent","isActive"])])),b.value>0?(N(),j("div",ac,[Y("span",null,G(D(e)("torrentDetail.overview.pieceCount",{owned:p.value,total:b.value,pieceSize:F.value})),1)])):Rt("",!0),Y("div",null,[x(At,{icon:"mdi-arrow-down"}),W(" "+G(D(fe)(A.torrent.dlspeed,D(l).useBitSpeed))+" ",1),x(At,{icon:"mdi-arrow-up"}),W(" "+G(D(fe)(A.torrent.upspeed,D(l).useBitSpeed)),1)])]),_:1})]),_:1}),x(dt,null,{default:v(()=>[x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrent.properties.download_path"))+":",1),Y("div",null,G(A.torrent.download_path),1),x(ht,{icon:"mdi-pencil",color:"accent",size:"x-small",onClick:$[0]||($[0]=U=>O("dl"))})]),_:1}),x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrentDetail.overview.fileCount"))+":",1),Y("div",null,G(h.value.length)+" / "+G(c.value),1),h.value.length===1?(N(),j("div",lc,G(g.value),1)):Rt("",!0),h.value.length===1?(N(),q(ht,{key:1,icon:"mdi-pencil",color:"accent",size:"x-small",onClick:L})):Rt("",!0)]),_:1})]),_:1}),x(dt,null,{default:v(()=>[x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrent.properties.save_path"))+":",1),Y("div",null,G(A.torrent.savePath),1),x(ht,{icon:"mdi-pencil",color:"accent",size:"x-small",onClick:$[1]||($[1]=U=>O("save"))})]),_:1}),x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrent.properties.content_path"))+":",1),Y("div",null,G(A.torrent.content_path),1)]),_:1})]),_:1})]),_:1}),x(st,{cols:"12",md:"6"},{default:v(()=>[x(dt,null,{default:v(()=>[x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrent.properties.state"))+":",1),x(ve,{disabled:!0,"default-color":T.value,value:D(s)(A.torrent.state)},null,8,["default-color","value"])]),_:1}),x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrent.properties.category"))+":",1),x(ve,{"default-color":"category",disabled:!A.torrent.category.length,"disabled-value":A.$t("navbar.side.filters.category.empty"),value:A.torrent.category},null,8,["disabled","disabled-value","value"])]),_:1})]),_:1}),x(dt,null,{default:v(()=>[x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrent.properties.tracker"))+":",1),x(ve,{disabled:!A.torrent.trackerDomain.length,"default-color":"tracker","disabled-value":A.$t("navbar.side.filters.tracker.empty"),value:A.torrent.trackerDomain},null,8,["disabled","disabled-value","value"])]),_:1}),x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrent.properties.tags"))+":",1),A.torrent.tags.length?(N(),j("div",hc,[(N(!0),j(Pt,null,$t(A.torrent.tags,U=>(N(),q(ve,{"default-color":"tag",value:U},null,8,["value"]))),256))])):(N(),q(ve,{key:1,disabled:!0,"default-color":"tag",value:A.$t("navbar.side.filters.tag.empty")},null,8,["value"]))]),_:1})]),_:1}),x(dt,null,{default:v(()=>[x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrentDetail.overview.selectedFileSize"))+":",1),Y("div",null,G(D(Vt)(A.torrent.size,D(l).useBinarySize))+" / "+G(D(Vt)(A.torrent.total_size,D(l).useBinarySize)),1)]),_:1}),x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrentDetail.overview.ratio"))+":",1),Y("div",{class:gs(M.value)},G(A.torrent.ratio),3)]),_:1})]),_:1}),x(dt,null,{default:v(()=>[x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrentDetail.overview.downloaded"))+":",1),Y("div",null,G(D(Vt)(A.torrent.downloaded,D(l).useBinarySize)),1)]),_:1}),x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrentDetail.overview.uploaded"))+":",1),Y("div",null,G(D(Vt)(A.torrent.uploaded,D(l).useBinarySize)),1)]),_:1})]),_:1}),x(dt,null,{default:v(()=>[x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrentDetail.overview.dlSpeedAverage"))+":",1),Y("div",null,G(D(fe)(m.value,D(l).useBitSpeed)),1)]),_:1}),x(st,{cols:"6"},{default:v(()=>[Y("div",null,G(A.$t("torrentDetail.overview.upSpeedAverage"))+":",1),Y("div",null,G(D(fe)(C.value,D(l).useBitSpeed)),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):Rt("",!0)}});cc={class:"mt-2 mx-3 d-flex flex-gap align-center"};dc={class:"text-grey"};fc={key:0};pc={key:1};mc={key:0};gc={key:2,class:"text-grey"};_c=["title"];yc={key:0};xc=["alt","src","title"];bc=["title"];vc=["title"];wc={key:1};Cc={class:"text-download"};Ac={class:"text-upload"};Sc={class:"d-flex my-3 flex-gap align-center justify-center"};Tc=vt({__name:"Peers",props:{torrent:{},isActive:{type:Boolean}},setup(r){const t=r,{t:e}=ee(),s=jo(),i=qo(),n=Wt();function o(R,A){const $=R.ip.split(".").map(Number),U=A.ip.split(".").map(Number);for(let X=0;X<4;X++)if($[X]!==U[X])return $[X]-U[X];return R.port-A.port}function a(R,A){return R.country&&!A.country?-1:!R.country&&A.country?1:R.country===A.country?o(R,A):R.country.localeCompare(A.country)}const l=ko([{nowrap:!0,key:"actions",sortable:!1},{nowrap:!0,title:e("torrentDetail.peers.fields.country"),key:"country",sortRaw:a},{nowrap:!0,title:e("torrentDetail.peers.fields.host"),key:"host",sortRaw:o},{nowrap:!0,title:e("torrentDetail.peers.fields.progress"),key:"progress"},{nowrap:!0,title:e("torrentDetail.peers.fields.download"),key:"dl_speed"},{nowrap:!0,title:e("torrentDetail.peers.fields.upload"),key:"up_speed"},{nowrap:!0,title:e("torrentDetail.peers.fields.flags"),key:"flags"},{nowrap:!0,title:e("torrentDetail.peers.fields.client"),key:"client"},{nowrap:!0,title:e("torrentDetail.peers.fields.relevance"),key:"relevance"},{nowrap:!0,title:e("torrentDetail.peers.fields.files"),key:"files"}]),u=Ki([{key:"dl_speed",order:"desc"},{key:"up_speed",order:"desc"}]),h=pt(),c=pt(new Map),g=pt(!1),d=pt(""),m=pt(!1),_=pt(""),p=Z(()=>Array.from(c.value.entries()).map(([R,A])=>({...A,host:R})));function b(R){Object.entries(R).forEach(([A,$])=>{const U=c.value.get(A);c.value.set(A,{...U,...$})})}function C(R){R.forEach(A=>c.value.delete(A))}async function T(){const R=await s.syncTorrentPeers(t.torrent.hash,h.value);h.value=R.rid,g.value=R.show_flags??g.value,R.full_update?c.value=new Map(Object.entries(R.peers)):(R.peers_removed&&C(R.peers_removed),R.peers&&b(R.peers))}async function F(){_.value.length&&(await s.addTorrentPeers(t.torrent.hash,_.value.split(` `)),L(),B())}function B(){m.value=!1,_.value=""}async function M(R){await s.banPeers([R.host]),await i.fetchPreferences(),L()}const{isActive:E,pause:O,resume:L}=Cs(T,2e3,{immediate:!0,immediateCallback:!0});return Je(()=>t.isActive,R=>{R?L():O()}),Zi(()=>!m.value),(R,A)=>(N(),q(Ht,null,{default:v(()=>[c.value.size?(N(),q(rn,{key:1,headers:D(l),items:p.value,"multi-sort":"","sort-by":D(u),search:d.value,"filter-keys":["host","client","files"],mobile:null},{top:v(()=>[Y("div",cc,[x(Jt,{modelValue:d.value,"onUpdate:modelValue":A[0]||(A[0]=$=>d.value=$),density:"compact",label:R.$t("common.search"),"prepend-inner-icon":"mdi-magnify",flat:"","hide-details":"","single-line":"",clearable:""},null,8,["modelValue","label"]),x(_s,{text:D(E)?R.$t("common.pause"):R.$t("common.resume"),location:"bottom"},{activator:v(({props:$})=>[x(ht,Se($,{icon:D(E)?"mdi-timer-pause":"mdi-timer-play",color:"primary",onClick:A[1]||(A[1]=U=>D(E)?D(O)():D(L)())}),null,16,["icon"])]),_:1},8,["text"])])]),"item.host":v(({item:$})=>[W(G($.ip),1),Y("span",dc,":"+G($.port),1)]),"item.client":v(({item:$})=>[$.connection?(N(),j("span",fc,"["+G($.connection)+"]\xa0",1)):Rt("",!0),$.client?(N(),j("span",pc,[W(G($.client)+" ",1),$.peer_id_client?(N(),j("span",mc,"("+G($.peer_id_client)+")",1)):Rt("",!0)])):(N(),j("span",gc,"?????"))]),"item.actions":v(({item:$})=>[x(ht,{color:"red",icon:"mdi-cancel",variant:"text",onClick:U=>M($)},null,8,["onClick"])]),"item.country":v(({item:$})=>[g.value?(N(),j("div",{key:0,class:"cursor-help",title:$.country},[$.country_code?D(Ko)?(N(),j("img",{key:1,alt:D(Es)($.country_code).char,src:D(Es)($.country_code).url,title:$.country,style:{"max-width":"32px"}},null,8,xc)):(N(),j("span",{key:2,title:$.country},G(D(Es)($.country_code).char),9,bc)):(N(),j("span",yc))],8,_c)):Rt("",!0)]),"item.flags":v(({item:$})=>[$.flags?(N(),j("div",{key:0,class:"cursor-help",title:$.flags_desc},G($.flags),9,vc)):(N(),j("div",wc,G(R.$t("common.none")),1))]),"item.dl_speed":v(({item:$})=>[Y("span",Cc,G(D(fe)($.dl_speed,D(n).useBitSpeed))+" ("+G(D(Vt)($.downloaded,D(n).useBinarySize))+") ",1)]),"item.up_speed":v(({item:$})=>[Y("span",Ac,G(D(fe)($.up_speed,D(n).useBitSpeed))+" ("+G(D(Vt)($.uploaded,D(n).useBinarySize))+") ",1)]),"item.progress":v(({item:$})=>[x(sn,{"model-value":$.progress,max:1,height:20,rounded:"sm",style:{width:"8em"},color:$.progress===1?"torrent-ul_stalled":"torrent-downloading"},{default:v(()=>[W(G(D(ir)($.progress)),1)]),_:2},1032,["model-value","color"])]),"item.relevance":v(({item:$})=>[W(G(D(ir)($.relevance)),1)]),_:2},1032,["headers","items","sort-by","search"])):(N(),q(nr,{key:0,title:R.$t("torrentDetail.peers.empty"),icon:"mdi-account-sync",color:"accent"},null,8,["title"])),Y("div",Sc,[x(We,{modelValue:m.value,"onUpdate:modelValue":A[3]||(A[3]=$=>m.value=$),"max-width":"750px"},{activator:v(({props:$})=>[x(ht,Se($,{variant:"flat",text:D(e)("torrentDetail.peers.addPeers.title"),color:"accent"}),null,16,["text"])]),default:v(()=>[x(Ht,{title:R.$t("torrentDetail.peers.addPeers.title")},{default:v(()=>[x(pe,null,{default:v(()=>[x(nn,{modelValue:_.value,"onUpdate:modelValue":A[2]||(A[2]=$=>_.value=$),label:D(e)("torrentDetail.peers.addPeers.newPeers"),placeholder:D(e)("torrentDetail.peers.addPeers.newPeersPlaceholder"),hint:D(e)("torrentDetail.peers.addPeers.newPeersHint")},null,8,["modelValue","label","placeholder","hint"])]),_:1}),x(Xe,null,{default:v(()=>[x(ke),x(ht,{color:"error",onClick:B},{default:v(()=>[W(G(D(e)("common.cancel")),1)]),_:1}),x(ht,{color:"accent",onClick:F},{default:v(()=>[W(G(D(e)("common.ok")),1)]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"])])]),_:1}))}});kc=vt({__name:"TagsAndCategories",props:{torrent:{},isActive:{type:Boolean}},setup(r){const t=r,e=Zo(),s=Qo(),i=Ts();async function n(a){t.torrent.category===a?await i.setTorrentCategory([t.torrent.hash],""):await i.setTorrentCategory([t.torrent.hash],a)}async function o(a){t.torrent.tags?.includes(a)?await i.removeTorrentTags([t.torrent.hash],[a]):await i.addTorrentTags([t.torrent.hash],[a])}return(a,l)=>(N(),q(Ht,null,{default:v(()=>[x(pe,null,{default:v(()=>[x(dt,null,{default:v(()=>[x(st,{cols:"12",md:"6"},{default:v(()=>[x(ys,null,{default:v(()=>[x(Hr,null,{default:v(()=>[W(G(a.$t("torrentDetail.tagsAndCategories.tags")),1)]),_:1}),(N(!0),j(Pt,null,$t(D(s).tags,u=>(N(),q(je,{variant:"text",color:"accent",title:u,active:a.torrent.tags?.includes(u),onClick:h=>o(u)},null,8,["title","active","onClick"]))),256))]),_:1})]),_:1}),x(st,{cols:"12",md:"6"},{default:v(()=>[x(ys,null,{default:v(()=>[x(Hr,null,{default:v(()=>[W(G(a.$t("torrentDetail.tagsAndCategories.categories")),1)]),_:1}),(N(!0),j(Pt,null,$t(D(e).categories,u=>(N(),q(je,{variant:"text",color:"accent",title:u.name,active:u.name===t.torrent.category,onClick:h=>n(u.name)},null,8,["title","active","onClick"]))),256))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))}});Pc={class:"mt-2 mx-3 d-flex flex-gap align-center"};Mc={key:0};Ic={key:0};Ec={key:1};Dc={class:"d-flex my-3 flex-gap align-center justify-center"};Rc={class:"text-h5"};Fc=vt({__name:"Trackers",props:{torrent:{},isActive:{type:Boolean}},setup(r){const t=r,{t:e}=ee(),s=Ts(),i=Jo(),n=[{nowrap:!0,title:e("torrentDetail.trackers.fields.tier"),key:"tier"},{nowrap:!0,title:e("torrentDetail.trackers.fields.url"),key:"url"},{nowrap:!0,title:e("torrentDetail.trackers.fields.status"),key:"status"},{nowrap:!0,title:e("torrentDetail.trackers.fields.num_seeds"),key:"num_seeds"},{nowrap:!0,title:e("torrentDetail.trackers.fields.num_peers"),key:"num_peers"},{nowrap:!0,title:e("torrentDetail.trackers.fields.num_downloaded"),key:"num_downloaded"},{nowrap:!0,title:e("torrentDetail.trackers.fields.num_leeches"),key:"num_leeches"},{nowrap:!0,title:e("torrentDetail.trackers.fields.msg"),key:"msg"},{nowrap:!0,key:"actions",sortable:!1}],o=Ki([{key:"tier",order:"asc"},{key:"url",order:"asc"}]),a=pt("");function l(X){switch(X){case le.DISABLED:return e("constants.trackerStatus.disabled");case le.NOT_YET_CONTACTED:return e("constants.trackerStatus.not_yet_contacted");case le.WORKING:return e("constants.trackerStatus.working");case le.UPDATING:return e("constants.trackerStatus.updating");case le.NOT_WORKING:return e("constants.trackerStatus.not_working");default:return""}}const u=pt(!1),h=pt(!1),c=pt([]),g=pt(""),d=pt(!1),m=[X=>!!X||e("torrentDetail.trackers.editTracker.newUrlRequired")],_=bs({isVisible:!1,isFormValid:!1,oldUrl:"",newUrl:""});function p(X){_.isVisible=!0,_.oldUrl=X.url,_.newUrl=X.url,Ue(()=>{document.getElementById("input")?.select()})}async function b(){u.value=!0,h.value=!1;try{c.value=await i.getTorrentTrackers(t.torrent.hash)}catch{h.value=!0}finally{u.value=!1}}const C=Ji(function*(){yield b()}).drop();async function T(){g.value.length&&(await i.addTorrentTrackers(t.torrent.hash,g.value),U(),F())}function F(){d.value=!1,g.value=""}async function B(){_.isFormValid&&(await i.editTorrentTracker(t.torrent.hash,_.oldUrl,_.newUrl),_.isVisible=!1,U())}async function M(X){await i.removeTorrentTrackers(t.torrent.hash,[X.url]),U()}async function E(){await s.reannounceTorrents([t.torrent.hash])}const O=pt(!1),{isActive:L,resume:R,pause:A}=Cs(C.perform,5e3,{immediate:!0,immediateCallback:!0});function $(){O.value=!0,A()}function U(){O.value=!1,R()}return Je(()=>t.isActive,X=>{X&&!O.value?U():$()}),ts(()=>{t.isActive&&U()}),vs(()=>{$()}),Zi(()=>!d.value&&!_.isVisible),(X,tt)=>(N(),j(Pt,null,[x(Ht,null,{default:v(()=>[!c.value.length&&u.value?(N(),q(nr,{key:0,title:X.$t("torrentDetail.trackers.loading"),icon:"mdi-web-sync",color:"accent"},null,8,["title"])):!c.value.length&&h.value?(N(),q(nr,{key:1,title:X.$t("torrentDetail.trackers.error"),icon:"mdi-web-remove",color:"error"},null,8,["title"])):(N(),q(rn,{key:2,headers:n,items:c.value,"multi-sort":"","sort-by":D(o),search:a.value,"filter-keys":["url","msg"],mobile:null},{top:v(()=>[Y("div",Pc,[x(Jt,{modelValue:a.value,"onUpdate:modelValue":tt[0]||(tt[0]=f=>a.value=f),density:"compact",label:X.$t("common.search"),"prepend-inner-icon":"mdi-magnify",flat:"","hide-details":"","single-line":"",clearable:""},null,8,["modelValue","label"]),x(_s,{text:D(L)?X.$t("common.pause"):X.$t("common.resume"),location:"bottom"},{activator:v(({props:f})=>[x(ht,Se(f,{icon:D(L)?"mdi-timer-pause":"mdi-timer-play",color:"primary",onClick:tt[1]||(tt[1]=y=>D(L)?$():U())}),null,16,["icon"])]),_:1},8,["text"])])]),"item.tier":v(({value:f})=>[f>=0?(N(),j("span",Mc,G(f),1)):Rt("",!0)]),"item.status":v(({value:f})=>[Y("span",{class:gs(`tracker-${D(le)[f].toLowerCase()}`)},G(l(f)),3)]),"item.msg":v(({value:f})=>[f?(N(),j("span",Ec,G(f),1)):(N(),j("span",Ic,G(X.$t("common.NA")),1))]),"item.actions":v(({item:f})=>[f.tier!==-1?(N(),j(Pt,{key:0},[x(ht,{icon:"mdi-pencil",variant:"text",onClick:y=>p(f)},null,8,["onClick"]),x(ht,{color:"red",icon:"mdi-delete",variant:"text",onClick:y=>M(f)},null,8,["onClick"])],64)):Rt("",!0)]),_:2},1032,["items","sort-by","search"])),Y("div",Dc,[x(We,{modelValue:d.value,"onUpdate:modelValue":tt[3]||(tt[3]=f=>d.value=f),"max-width":"750px"},{activator:v(({props:f})=>[x(ht,Se(f,{variant:"flat",text:D(e)("torrentDetail.trackers.addTrackers.title"),color:"accent"}),null,16,["text"])]),default:v(()=>[x(Ht,{title:X.$t("torrentDetail.trackers.addTrackers.title")},{default:v(()=>[x(pe,null,{default:v(()=>[x(nn,{modelValue:g.value,"onUpdate:modelValue":tt[2]||(tt[2]=f=>g.value=f),label:D(e)("torrentDetail.trackers.addTrackers.newTrackers"),hint:D(e)("torrentDetail.trackers.addTrackers.newTrackersHint")},null,8,["modelValue","label","hint"])]),_:1}),x(Xe,null,{default:v(()=>[x(ke),x(ht,{color:"error",onClick:F},{default:v(()=>[W(G(D(e)("common.cancel")),1)]),_:1}),x(ht,{color:"accent",onClick:T},{default:v(()=>[W(G(D(e)("common.ok")),1)]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]),x(ht,{variant:"flat",disabled:c.value.length===3,text:D(e)("torrentDetail.trackers.reannounce"),color:"primary",onClick:E},null,8,["disabled","text"])])]),_:1}),x(We,{modelValue:_.isVisible,"onUpdate:modelValue":tt[8]||(tt[8]=f=>_.isVisible=f),"max-width":"750px"},{default:v(()=>[x(Ht,null,{default:v(()=>[x(As,null,{default:v(()=>[Y("span",Rc,G(D(e)("torrentDetail.trackers.editTracker.title")),1)]),_:1}),x(pe,null,{default:v(()=>[x(en,{modelValue:_.isFormValid,"onUpdate:modelValue":tt[5]||(tt[5]=f=>_.isFormValid=f),onSubmit:tt[6]||(tt[6]=He(()=>{},["prevent"]))},{default:v(()=>[x(Jt,{"model-value":_.oldUrl,disabled:"",label:X.$t("torrentDetail.trackers.editTracker.oldUrl")},null,8,["model-value","label"]),x(Jt,{modelValue:_.newUrl,"onUpdate:modelValue":tt[4]||(tt[4]=f=>_.newUrl=f),id:"input",rules:m,label:X.$t("torrentDetail.trackers.editTracker.newUrl"),autofocus:"",onKeydown:Wi(B,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),x(Xe,null,{default:v(()=>[x(ke),x(ht,{color:"error",disabled:!_.isFormValid,onClick:tt[7]||(tt[7]=f=>_.isVisible=!1)},{default:v(()=>[W(G(D(e)("common.cancel")),1)]),_:1},8,["disabled"]),x(ht,{color:"accent",onClick:B},{default:v(()=>[W(G(D(e)("common.ok")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}});Bc=Ss(Fc,[["__scopeId","data-v-c5792b64"]]);$c={class:"pa-3 text-select"};Gc={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"};Nc={class:"d-flex justify-end"};Vc=vt({__name:"TorrentDetail",setup(r){const t=Po(),{t:e}=ee(),s=_e(),i=ws(),n=Ts(),o=se(),{tab:a}=yt(o),l=[{text:e("torrentDetail.tabs.overview"),value:"overview"},{text:e("torrentDetail.tabs.info"),value:"info"},{text:e("torrentDetail.tabs.trackers"),value:"trackers"},{text:e("torrentDetail.tabs.peers"),value:"peers"},{text:e("torrentDetail.tabs.content"),value:"content"},{text:e("torrentDetail.tabs.tagsAndCategories"),value:"tagsAndCategories"}],u=Z(()=>t.currentRoute.value.params.hash),h=Z(()=>n.getTorrentByHash(u.value)),c=()=>{t.push({name:"dashboard"})};function g(m){if(i.hasActiveDialog)return!1;m.key==="Escape"&&c()}function d(){const m=t.currentRoute.value.params.tab;m&&(a.value=m)}return Yi(()=>{d()}),Je(h,()=>{o.fetchProperties(u.value)}),ts(()=>{document.addEventListener("keydown",g),d(),o.fetchProperties(u.value),s.updateFileTreeTask.perform().then(()=>s.expandAll())}),vs(()=>{document.removeEventListener("keydown",g),o.$reset()}),(m,_)=>(N(),j(Pt,null,[Y("div",$c,[x(dt,{"no-gutters":"",align:"center",justify:"center"},{default:v(()=>[x(st,null,{default:v(()=>[Y("h1",Gc,G(D(e)("torrentDetail.title")),1)]),_:1}),x(st,null,{default:v(()=>[Y("div",Nc,[x(ht,{icon:"mdi-close",variant:"plain",onClick:c})])]),_:1})]),_:1}),x(dt,{class:"ma-0 pa-0"},{default:v(()=>[x(ea,{modelValue:D(a),"onUpdate:modelValue":_[0]||(_[0]=p=>Ye(a)?a.value=p:null),"bg-color":"primary",grow:"","show-arrows":""},{default:v(()=>[(N(),j(Pt,null,$t(l,({text:p,value:b})=>x(sa,{value:b,text:p,replace:"",to:{name:"torrentDetail",params:{hash:u.value,tab:b}}},null,8,["value","text","to"])),64))]),_:1},8,["modelValue"])]),_:1}),h.value?(N(),q(ta,{key:0,modelValue:D(a),"onUpdate:modelValue":_[1]||(_[1]=p=>Ye(a)?a.value=p:null),touch:!1},{default:v(()=>[x(xe,{value:"overview"},{default:v(()=>[x(uc,{torrent:h.value,"is-active":D(a)==="overview"},null,8,["torrent","is-active"])]),_:1}),x(xe,{value:"info"},{default:v(()=>[x(Da,{torrent:h.value,"is-active":D(a)==="info"},null,8,["torrent","is-active"])]),_:1}),x(xe,{value:"trackers"},{default:v(()=>[x(Bc,{torrent:h.value,"is-active":D(a)==="trackers"},null,8,["torrent","is-active"])]),_:1}),x(xe,{value:"peers"},{default:v(()=>[x(Tc,{torrent:h.value,"is-active":D(a)==="peers"},null,8,["torrent","is-active"])]),_:1}),x(xe,{value:"content"},{default:v(()=>[x(D(xa),{torrent:h.value,"is-active":D(a)==="content"},null,8,["torrent","is-active"])]),_:1}),x(xe,{value:"tagsAndCategories"},{default:v(()=>[x(kc,{torrent:h.value,"is-active":D(a)==="tagsAndCategories"},null,8,["torrent","is-active"])]),_:1})]),_:1},8,["modelValue"])):Rt("",!0)]),Y("div",{style:ji(`position: absolute; left: ${D(s).rightClickProperties.offset[0]}px; top: ${D(s).rightClickProperties.offset[1]}px;`)},[x(D(wo),{modelValue:D(s).rightClickProperties.isVisible,"onUpdate:modelValue":_[2]||(_[2]=p=>D(s).rightClickProperties.isVisible=p),"menu-data":D(s).menuData},null,8,["modelValue","menu-data"])],4)],64))}});Yc=Object.freeze(Object.defineProperty({__proto__:null,default:Vc},Symbol.toStringTag,{value:"Module"}))});export{Ls as $,Kn as A,Mt as B,Tt as C,ne as D,lt as E,te as F,Ps as G,_n as H,Cl as I,Xt as J,ai as K,qe as L,it as M,ql as N,ih as O,St as P,_t as Q,mr as R,kh as S,ns as T,dr as U,Ct as V,lh as W,hi as X,ci as Y,Tl as Z,la as _,re as a,Ft as a0,bn as a1,Zn as a2,ft as a3,gt as a4,fh as a5,Rh as a6,Qh as a7,tu as a8,nu as a9,au as aa,lu as ab,Be as ac,Ve as ad,Ui as ae,ph as af,mh as ag,Pr as ah,Ae as ai,Me as aj,fo as ak,Ai as al,wi as am,Wa as an,xs as ao,qa as ap,go as aq,Yc as ar,Ah as b,Ze as c,ps as d,jt as e,Ci as f,aa as g,Mr as h,Wn as i,En as j,qt as k,Xn as l,Zh as m,qr as n,Jh as o,ru as p,so as q,ll as r,ou as s,Ir as t,_e as u,ut as v,Yt as w,Ln as x,ja as y,uu as z,__tla};