const __vite__fileDeps=["./browserAll-Bx8dkzl9.js","./webworkerAll-BwUJZEVj.js","./colorToUniform-pFJ8sYB5.js","./CanvasPool-DIOMPpzz.js","./getBatchSamplersUniformGroup-PJByx64R.js","./MoveTorrentDialog.vue_vue_type_script_setup_true_lang-G1lEzMcG.js","./index-DF2-l4SD.js","./vue-BQgCUbk_.js","./vuetify-DWkLi8Ew.js","./index-HjzIuaZ3.css","./MixedButton.vue_vue_type_script_setup_true_lang-QFpliKgB.js","./FileIcon-DH65fwz5.js","./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-DEnRCAW6.js","./WebGPURenderer-ByZp18Ac.js","./SharedSystems-xfG8Wu9d.js","./WebGLRenderer-1-eFgxul.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); import{_ as xn,a as bn,__tla as __tla_0}from"./MoveTorrentDialog.vue_vue_type_script_setup_true_lang-G1lEzMcG.js";import{_ as vn,__tla as __tla_1}from"./MixedButton.vue_vue_type_script_setup_true_lang-QFpliKgB.js";import{b as Ne,m as te,k as ht,g as ue,b6 as At,aZ as lr,b4 as wn,X as Vt,ac as ls,e as rs,b7 as Cn,i as Kt,ad as An,r as q,Z as Ge,$ as ri,b8 as Dt,p as Q,a6 as ne,B as ee,z as se,aX as Sn,C as Mn,aU as kn,aT as Ds,q as Te,s as Qt,a2 as Bs,b2 as Zt,y as Pn,b9 as ns,ba as ps,E as hr,aV as Tn,aW as In,bb as Ci,bc as En,V as Fs,bd as Rn,be as Dn,h as et,H as Bn,a3 as Fn,aY as Vs,c as Ie,aS as Vn,a9 as $n,o as Nn,a5 as Gn,S as Ln,bf as On,bg as ms,ao as cr,f as $s,j as Ns,ab as Ai,w as Si,a1 as Un,d as zn,G as Hn,aI as Yn,U as Xn,W as Wn,aJ as oe,__tla as __tla_2}from"./index-DF2-l4SD.js";import{h as lt,E as ie,c as Y,H as T,Q as N,U as B,M as Gs,I as $,J as y,K as L,L as k,N as _t,u as S,_ as Ee,n as g,W as ur,$ as dt,f as ct,w as Le,Y as hs,v as dr,P as qn,x as fr,a3 as Mi,V as bt,F as ft,R as pr,B as ni,s as ki,T as oi,Z as Pi,d as jn,aa as Zn,ab as Kn,q as Ls,G as mr,r as Qn,O as Jn,S as to,a as eo}from"./vue-BQgCUbk_.js";import{g as so}from"./FileIcon-DH65fwz5.js";import{u as _r,a as io}from"./vuetify-DWkLi8Ew.js";import{_ as ro,__tla as __tla_3}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-DEnRCAW6.js";let Ur,Jr,mt,pt,$t,st,Oi,da,Ss,xt,Tr,tt,J,H,cl,fe,ut,ae,ot,gl,qe,Ws,Ce,Jl,th,ci,he,hn,Nt,De,Wi,as,Oo,un,ec,$e,Ta,Zr,re,Qi,pl,Gr,Gt,W,Pa,Lo,rn,tc,yl,fl,Tt,Qo,kr,Rt,at,Re,Et,Ea,ja,Hi;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})()]).then(async()=>{var Ft=(i=>(i[i.DISABLED=0]="DISABLED",i[i.NOT_YET_CONTACTED=1]="NOT_YET_CONTACTED",i[i.WORKING=2]="WORKING",i[i.UPDATING=3]="UPDATING",i[i.NOT_WORKING=4]="NOT_WORKING",i))(Ft||{});const no={class:"d-flex"},oo={class:"d-flex flex-column overflow-hidden text-no-wrap mr-3"},ao={class:"text-grey"},lo={class:"d-flex align-center"},Ti="#ffe476",ho=lt({__name:"ContentNode",props:{node:{},openedItems:{}},emits:["setFilePrio","onRightClick"],setup(i,{emit:t}){const e=i,s=t,{t:r}=ie(),{mobile:n}=_r(),o=Ne(),a=te(),l=Y(()=>{if(e.node.fullName==="")return 0;const _=e.node.fullName.split("/").length,f=n.value?12:24;return _*f});function c(_,f){if(f.type==="file")return;_.stopPropagation();const v=e.openedItems.indexOf(f.fullName);v===-1?e.openedItems.push(f.fullName):e.openedItems.splice(v,1)}async function h(_){_.priority===At.DO_NOT_DOWNLOAD?s("setFilePrio",_.childrenIds,At.NORMAL):s("setFilePrio",_.childrenIds,At.DO_NOT_DOWNLOAD)}function u(_,f){wn(_)?o.internalSelection.has(f.fullName)?o.internalSelection.delete(f.fullName):o.internalSelection.add(f.fullName):o.internalSelection=new Set([f.fullName])}function d(_){return _.priority===At.DO_NOT_DOWNLOAD?"grey":_.progress===1?"green":""}function p(_){const[f,v]=_.deepCount,x=[];return f>1&&x.push(r("torrentDetail.content.folderInfo",f-1)),v>0&&x.push(r("torrentDetail.content.fileInfo",v)),x.join(", ")}function m(_){const f=[Vt(_.size,a.useBinarySize)];return _.type==="folder"&&f.push(p(_)),f.join(" | ")}return(_,f)=>(T(),N("div",{class:Ee(["d-flex flex-column py-2 pr-3",_.node.isSelected(S(o).internalSelection)?"selected":""]),style:ur(`padding-left: ${l.value}px`),onClick:f[2]||(f[2]=Gs(v=>u(v,_.node),["stop"])),onContextmenu:f[3]||(f[3]=v=>_.$emit("onRightClick",v,_.node))},[B("div",no,[B("div",{class:"d-flex align-center",onClick:f[0]||(f[0]=Gs(v=>h(_.node),["stop"]))},[_.node.wanted===null?(T(),$(ht,{key:0,color:d(_.node),icon:"mdi-checkbox-intermediate-variant"},null,8,["color"])):_.node.wanted?(T(),$(ht,{key:1,color:d(_.node),icon:"mdi-checkbox-marked"},null,8,["color"])):(T(),$(ht,{key:2,color:d(_.node),icon:"mdi-checkbox-blank-outline"},null,8,["color"]))]),B("div",{class:"d-flex align-center spacer",onClick:f[1]||(f[1]=v=>c(v,_.node))},[_.node.type==="folder"?(T(),$(ht,{key:0},{default:y(()=>[L(k(_.openedItems.includes(_.node.fullName)?"mdi-chevron-up":"mdi-chevron-down"),1)]),_:1})):_t("",!0),_.node.fullName===""?(T(),$(ht,{key:1,icon:"mdi-file-tree"})):_.node.type==="file"?(T(),$(ht,{key:2,icon:S(so)(_.node.name)},null,8,["icon"])):_.openedItems.includes(_.node.fullName)?(T(),$(ht,{key:3,icon:"mdi-folder-open",color:Ti})):(T(),$(ht,{key:4,icon:"mdi-folder",color:Ti}))]),B("div",oo,[B("div",{class:Ee(`text-${d(_.node)}`)},k(_.node.name),3),B("div",ao,k(m(_.node)),1)]),g(ue),B("div",lo,[_.node.priority===S(At).MAXIMAL?(T(),$(ht,{key:0,color:"error"},{default:y(()=>[L("mdi-arrow-up")]),_:1})):_.node.priority===S(At).HIGH?(T(),$(ht,{key:1,color:"warning"},{default:y(()=>[L("mdi-arrow-top-right")]),_:1})):_.node.priority===S(At).NORMAL?(T(),$(ht,{key:2},{default:y(()=>[L("mdi-minus")]),_:1})):_.node.priority===S(At).MIXED?(T(),$(ht,{key:3},{default:y(()=>[L("mdi-tilde")]),_:1})):_.node.priority===S(At).DO_NOT_DOWNLOAD?(T(),$(ht,{key:4,color:"grey"},{default:y(()=>[L("mdi-cancel")]),_:1})):_t("",!0)])]),g(lr,{"model-value":_.node.progress,max:1,color:d(_.node),rounded:"sm"},null,8,["model-value","color"])],38))}}),co=ls(ho,[["__scopeId","data-v-47f1c669"]]),uo={class:"mt-2 mx-3 d-flex flex-gap align-center"},fo=lt({__name:"Content",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{height:e}=_r(),s=Ne(),{rightClickProperties:r,filenameFilter:n,openedItems:o,flatTree:a,internalSelection:l,timerForcedPause:c,isTimerActive:h}=dt(s),u=Y(()=>e.value-48*2-64-12*2-56-8);async function d(x,w){r.value.isVisible&&(r.value.isVisible=!1,await fr()),Object.assign(r.value,{isVisible:!0,offset:[x.pageX,x.pageY],hash:t.torrent.hash}),l.value.size<=1&&(l.value=new Set([w.fullName]))}const p=ct();function m(x,w){p.value=setTimeout(()=>{d(x,w)},500)}function _(){clearTimeout(p.value)}Le(()=>t.isActive,x=>{x&&!c.value?s.resumeTimer():s.pauseTimer()}),hs(()=>{t.isActive&&s.resumeTimer()}),dr(()=>{s.$reset()});function f(){c.value=!0,s.pauseTimer()}function v(){c.value=!1,s.resumeTimer()}return(x,w)=>(T(),$(Kt,null,{default:y(()=>[B("div",uo,[g(rs,{modelValue:S(n),"onUpdate:modelValue":w[0]||(w[0]=C=>qn(n)?n.value=C:null),"hide-details":"",clearable:"",placeholder:x.$t("torrentDetail.content.filter_placeholder")},null,8,["modelValue","placeholder"]),g(vn,{icon:S(h)?"mdi-timer-pause":"mdi-timer-play",position:"left",color:"primary",text:S(h)?x.$t("common.pause"):x.$t("common.resume"),onClick:w[1]||(w[1]=C=>S(h)?f():v())},null,8,["icon","text"])]),g(Cn,{id:"tree-root",items:S(a),height:u.value,"item-height":"68",class:"pa-2"},{default:y(({item:C})=>[g(co,{"opened-items":S(o),node:C,onSetFilePrio:w[2]||(w[2]=(M,E)=>S(s).setFilePriority(M,E)),onTouchcancel:_,onTouchend:_,onTouchmove:_,onTouchstart:M=>m(M.touches.item(0),C),onOnRightClick:w[3]||(w[3]=(M,E)=>d(M,E))},null,8,["opened-items","node","onTouchstart"])]),_:1},8,["items","height"])]),_:1}))}}),po={},mo={class:"pl-4"},_o={class:"pr-4"};function go(i,t){return T(),$(q,{cols:"12",sm:"6",lg:"3"},{default:y(()=>[g(An,{rounded:"xl",class:"d-flex align-center py-2 border"},{default:y(()=>[B("div",mo,[Mi(i.$slots,"title")]),g(ue),B("div",_o,[Mi(i.$slots,"text")])]),_:3})]),_:3})}const St=ls(po,[["render",go]]),yo=lt({__name:"PanelBoolean",props:{torrent:{}},setup(i){const t=i,e=Ge(),s=ri(),{properties:r}=dt(Dt()),n=Y({get:()=>t.torrent.auto_tmm,set:h=>e.toggleAutoTmm([t.torrent.hash],h)}),o=Y({get:()=>t.torrent.f_l_piece_prio,set:()=>e.toggleFLPiecePrio([t.torrent.hash])}),a=Y({get:()=>t.torrent.forced,set:h=>{h?s.forceResumeTorrents([t.torrent.hash]):s.resumeTorrents([t.torrent.hash])}}),l=Y({get:()=>t.torrent.seq_dl,set:()=>e.toggleSeqDl([t.torrent.hash])}),c=Y({get:()=>t.torrent.super_seeding,set:h=>e.setSuperSeeding([t.torrent.hash],h)});return(h,u)=>(T(),$(se,{title:h.$t("torrentDetail.info.boolean_values")},{default:y(()=>[g(ee,null,{default:y(()=>[g(Q,null,{default:y(()=>[g(St,null,{title:y(()=>[g(ne,{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=d=>n.value=d),"hide-details":"",density:"compact",label:h.$t("torrent.properties.auto_tmm")},null,8,["modelValue","label"])]),_:1}),g(St,null,{title:y(()=>[g(ne,{modelValue:o.value,"onUpdate:modelValue":u[1]||(u[1]=d=>o.value=d),"hide-details":"",density:"compact",label:h.$t("torrent.properties.f_l_piece_prio")},null,8,["modelValue","label"])]),_:1}),g(St,null,{title:y(()=>[g(ne,{modelValue:a.value,"onUpdate:modelValue":u[2]||(u[2]=d=>a.value=d),"hide-details":"",density:"compact",label:h.$t("torrent.properties.forced")},null,8,["modelValue","label"])]),_:1}),g(St,null,{title:y(()=>[g(ne,{modelValue:l.value,"onUpdate:modelValue":u[3]||(u[3]=d=>l.value=d),"hide-details":"",density:"compact",label:h.$t("torrent.properties.seq_dl")},null,8,["modelValue","label"])]),_:1}),g(St,null,{title:y(()=>[g(ne,{modelValue:c.value,"onUpdate:modelValue":u[4]||(u[4]=d=>c.value=d),"hide-details":"",density:"compact",label:h.$t("torrent.properties.super_seeding")},null,8,["modelValue","label"])]),_:1}),g(St,null,{title:y(()=>[g(ne,{disabled:"","model-value":S(r)?.is_private,"hide-details":"",density:"compact",label:h.$t("torrent.properties.is_private")},null,8,["model-value","label"])]),_:1})]),_:1})]),_:1})]),_:1},8,["title"]))}}),xo=lt({__name:"PanelData",props:{torrent:{}},setup(i){const t=i,{properties:e}=dt(Dt()),{useBinarySize:s}=dt(te()),r=[{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)=>(T(),$(se,{title:n.$t("torrentDetail.info.data_values")},{default:y(()=>[g(ee,null,{default:y(()=>[g(Q,null,{default:y(()=>[(T(),N(ft,null,bt(r,a=>g(St,null,{title:y(()=>[L(k(n.$t(`torrent.properties.${a.title}`)),1)]),text:y(()=>[L(k(S(Vt)(a.getter(),S(s))),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),bo=lt({__name:"PanelDatetime",props:{torrent:{}},setup(i){const t=i,{properties:e}=dt(Dt()),{dateFormat:s}=dt(te()),r=[{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)=>(T(),$(se,{title:n.$t("torrentDetail.info.datetime_values")},{default:y(()=>[g(ee,null,{default:y(()=>[g(Q,null,{default:y(()=>[(T(),N(ft,null,bt(r,a=>g(St,null,pr({title:y(()=>[L(k(n.$t(`torrent.properties.${a.title}`)),1)]),_:2},[a.getter()>0?{name:"text",fn:y(()=>[L(k(S(Sn)(a.getter(),S(s))),1)]),key:"0"}:{name:"text",fn:y(()=>[L(k(n.$t("common.NA")),1)]),key:"1"}]),1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),vo=lt({__name:"PanelDuration",props:{torrent:{}},setup(i){const t=i,{properties:e}=dt(Dt()),s=[{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(r,n)=>(T(),$(se,{title:r.$t("torrentDetail.info.duration_values")},{default:y(()=>[g(ee,null,{default:y(()=>[g(Q,null,{default:y(()=>[(T(),N(ft,null,bt(s,o=>g(St,null,pr({title:y(()=>[L(k(r.$t(`torrent.properties.${o.title}`)),1)]),_:2},[o.getter()>0?{name:"text",fn:y(()=>[L(k(S(Mn).duration(o.getter(),o.unit).humanize()),1)]),key:"0"}:{name:"text",fn:y(()=>[L(k(r.$t("common.NA")),1)]),key:"1"}]),1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),is=lt({__name:"ColoredChip",props:{defaultColor:{},disabled:{type:Boolean,default:!1},disabledValue:{},value:{}},setup(i){const t=i,{t:e}=ie(),{enableHashColors:s,hideColoredChip:r}=dt(te()),n=Y(()=>t.disabled||!s.value?t.defaultColor:kn(t.value)),o=Y(()=>t.disabled?t.disabledValue||e("common.none"):t.value),a=Y(()=>!r.value);return(l,c)=>(T(),$(Ds,{color:n.value,variant:a.value?"flat":"text"},{default:y(()=>[L(k(o.value),1)]),_:1},8,["color","variant"]))}}),wo={key:0,class:"d-flex flex-gap-row-small flex-gap-column"},Co=lt({__name:"PanelLongText",props:{torrent:{}},setup(i){const t=i,{properties:e}=dt(Dt()),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(r,n)=>(T(),$(se,{title:r.$t("torrentDetail.info.long_text_values")},{default:y(()=>[g(ee,null,{default:y(()=>[g(Te,null,{default:y(()=>[(T(),N(ft,null,bt(s,o=>g(Qt,{title:r.$t(`torrent.properties.${o.title}`)},{default:y(()=>[g(Bs,null,{default:y(()=>[L(k(o.getter()||r.$t("common.none")),1)]),_:2},1024)]),_:2},1032,["title"])),64)),g(Qt,{title:r.$t("torrent.properties.tags")},{default:y(()=>[r.torrent.tags?.length?(T(),N("div",wo,[(T(!0),N(ft,null,bt(r.torrent.tags,o=>(T(),$(is,{defaultColor:"tag",value:o},null,8,["value"]))),256))])):(T(),$(Bs,{key:1},{default:y(()=>[L(k(r.$t("torrent.properties.empty_tags")),1)]),_:1}))]),_:1},8,["title"])]),_:1})]),_:1})]),_:1},8,["title"]))}}),Ao=lt({__name:"PanelSpeed",props:{torrent:{}},setup(i){const t=i,{properties:e}=dt(Dt()),{useBitSpeed:s}=dt(te()),r=[{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)=>(T(),$(se,{title:n.$t("torrentDetail.info.speed_values")},{default:y(()=>[g(ee,null,{default:y(()=>[g(Q,null,{default:y(()=>[(T(),N(ft,null,bt(r,a=>g(St,null,{title:y(()=>[L(k(n.$t(`torrent.properties.${a.title}`)),1)]),text:y(()=>[L(k(S(Zt)(a.getter(),S(s))),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),So=lt({__name:"PanelText",props:{torrent:{}},setup(i){const t=i,{t:e}=ie(),{properties:s}=dt(Dt()),r=[{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:()=>t.torrent.stateString},{title:"trackers_count",getter:()=>t.torrent.trackers_count},{title:"priority",getter:()=>t.torrent.priority},{title:"nb_connections",getter:()=>s.value?.nb_connections??0},{title:"nb_connections_limit",getter:()=>s.value?.nb_connections_limit??0}];return(n,o)=>(T(),$(se,{title:n.$t("torrentDetail.info.text_values")},{default:y(()=>[g(ee,null,{default:y(()=>[g(Q,null,{default:y(()=>[(T(),N(ft,null,bt(r,a=>g(St,null,{title:y(()=>[L(k(n.$t(`torrent.properties.${a.title}`)),1)]),text:y(()=>[L(k(a.getter()),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),Mo=lt({__name:"Info",props:{torrent:{},isActive:{type:Boolean}},setup(i){return(t,e)=>(T(),$(Te,null,{default:y(()=>[g(Qt,null,{default:y(()=>[g(Pn,null,{default:y(()=>[g(bo,{torrent:t.torrent},null,8,["torrent"]),g(vo,{torrent:t.torrent},null,8,["torrent"]),g(yo,{torrent:t.torrent},null,8,["torrent"]),g(xo,{torrent:t.torrent},null,8,["torrent"]),g(Ao,{torrent:t.torrent},null,8,["torrent"]),g(So,{torrent:t.torrent},null,8,["torrent"]),g(Co,{torrent:t.torrent},null,8,["torrent"])]),_:1})]),_:1})]),_:1}))}}),ko=class Os{constructor(t,e){this.low=t,this.high=e}clone(){return new Os(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 ko(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===z}_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 Ht(t,e,this.nil_node,this.nil_node,null,nt);return this.tree_insert(s),this.recalc_max(s),s}exist(t,e=t){let s=new Ht(t,e);return!!this.tree_search(this.root,s)}remove(t,e=t){let s=new Ht(t,e),r=this.tree_search(this.root,s);return r&&this.tree_delete(r),r}search(t,e=(s,r)=>s===r?r.output():s){let s=new Ht(t),r=[];return this.tree_search_interval(this.root,s,r),r.map(n=>e(n.item.value,n.item.key))}intersect_any(t){let e=new Ht(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 ai;return this.tree_walk(this.root,s=>e.insert(s.item.key,t(s.item.value,s.item.key))),e}*iterate(t,e=(s,r)=>s===r?r.output():s){let s;for(t?s=this.tree_search_nearest_forward(this.root,new Ht(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===nt;)e.parent===e.parent.parent.left?(s=e.parent.parent.right,s.color===nt?(e.parent.color=z,s.color=z,e.parent.parent.color=nt,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,this.rotate_left(e)),e.parent.color=z,e.parent.parent.color=nt,this.rotate_right(e.parent.parent))):(s=e.parent.parent.left,s.color===nt?(e.parent.color=z,s.color=z,e.parent.parent.color=nt,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,this.rotate_right(e)),e.parent.color=z,e.parent.parent.color=nt,this.rotate_left(e.parent.parent)));this.root.color=z}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===z&&this.delete_fixup(s)}delete_fixup(t){let e=t,s;for(;e!==this.root&&e.parent!=null&&e.color===z;)e===e.parent.left?(s=e.parent.right,s.color===nt&&(s.color=z,e.parent.color=nt,this.rotate_left(e.parent),s=e.parent.right),s.left.color===z&&s.right.color===z?(s.color=nt,e=e.parent):(s.right.color===z&&(s.color=nt,s.left.color=z,this.rotate_right(s),s=e.parent.right),s.color=e.parent.color,e.parent.color=z,s.right.color=z,this.rotate_left(e.parent),e=this.root)):(s=e.parent.left,s.color===nt&&(s.color=z,e.parent.color=nt,this.rotate_right(e.parent),s=e.parent.left),s.left.color===z&&s.right.color===z?(s.color=nt,e=e.parent):(s.left.color===z&&(s.color=nt,s.right.color=z,this.rotate_left(s),s=e.parent.left),s.color=e.parent.color,e.parent.color=z,s.left.color=z,this.rotate_right(e.parent),e=this.root));e.color=z}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,r=t;for(;r&&r!==this.nil_node;)r.less_than(e)?r.intersect(e)?(s=r,r=r.left):r=r.right:((!s||r.less_than(s))&&(s=r),r=r.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,r;if(t.right!==this.nil_node)e=this.local_minimum(t.right);else{for(s=t,r=t.parent;r!=null&&r.right===s;)s=r,r=r.parent;e=r}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===nt&&(e.left.color===z&&e.right.color===z||(t=!1))}),t}testBlackHeightProperty(t){let e=0,s=0,r=0;if(t.color===z&&e++,t.left!==this.nil_node?s=this.testBlackHeightProperty(t.left):s=1,t.right!==this.nil_node?r=this.testBlackHeightProperty(t.right):r=1,s!==r)throw new Error("Red-black height property violated");return e+=s,e}}st=(i=>(i.Application="application",i.WebGLPipes="webgl-pipes",i.WebGLPipesAdaptor="webgl-pipes-adaptor",i.WebGLSystem="webgl-system",i.WebGPUPipes="webgpu-pipes",i.WebGPUPipesAdaptor="webgpu-pipes-adaptor",i.WebGPUSystem="webgpu-system",i.CanvasSystem="canvas-system",i.CanvasPipesAdaptor="canvas-pipes-adaptor",i.CanvasPipes="canvas-pipes",i.Asset="asset",i.LoadParser="load-parser",i.ResolveParser="resolve-parser",i.CacheParser="cache-parser",i.DetectionParser="detection-parser",i.MaskEffect="mask-effect",i.BlendMode="blend-mode",i.TextureSource="texture-source",i.Environment="environment",i))(st||{});let Us,He,Po,To;Us=i=>{if(typeof i=="function"||typeof i=="object"&&i.extension){if(!i.extension)throw new Error("Extension class must have an extension object");i={...typeof i.extension!="object"?{type:i.extension}:i.extension,ref:i}}if(typeof i=="object")i={...i};else throw new Error("Invalid extension type");return typeof i.type=="string"&&(i.type=[i.type]),i};He=(i,t)=>Us(i).priority??t;re={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(Us).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...i){return i.map(Us).forEach(t=>{t.type.forEach(e=>{const s=this._addHandlers,r=this._queue;s[e]?s[e]?.(t):(r[e]=r[e]||[],r[e]?.push(t))})}),this},handle(i,t,e){const s=this._addHandlers,r=this._removeHandlers;if(s[i]||r[i])throw new Error(`Extension type ${i} already has a handler`);s[i]=t,r[i]=e;const n=this._queue;return n[i]&&(n[i]?.forEach(o=>t(o)),delete n[i]),this},handleByMap(i,t){return this.handle(i,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(i,t,e=-1){return this.handle(i,s=>{t.findIndex(n=>n.name===s.name)>=0||(t.push({name:s.name,value:s.ref}),t.sort((n,o)=>He(o.value,e)-He(n.value,e)))},s=>{const r=t.findIndex(n=>n.name===s.name);r!==-1&&t.splice(r,1)})},handleByList(i,t,e=-1){return this.handle(i,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((r,n)=>He(n,e)-He(r,e)))},s=>{const r=t.indexOf(s.ref);r!==-1&&t.splice(r,1)})}};Po={extension:{type:st.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await ns(()=>import("./browserAll-Bx8dkzl9.js").then(async m=>{await m.__tla;return m}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)}};To={extension:{type:st.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await ns(()=>import("./webworkerAll-BwUJZEVj.js").then(async m=>{await m.__tla;return m}),__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)}};class yt{constructor(t,e,s){this._x=e||0,this._y=s||0,this._observer=t}clone(t){return new yt(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 gr={exports:{}};(function(i){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function r(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function n(l,c,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var p=new r(h,u||l,d),m=e?e+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],p]:l._events[m].push(p):(l._events[m]=p,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new s:delete l._events[c]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],h,u;if(this._eventsCount===0)return c;for(u in h=this._events)t.call(h,u)&&c.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},a.prototype.listeners=function(c){var h=e?e+c:c,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,p=u.length,m=new Array(p);dXt[i],uY:i=>Wt[i],vX:i=>qt[i],vY:i=>jt[i],inv:i=>i&8?i&15:-i&7,add:(i,t)=>zs[i][t],sub:(i,t)=>zs[i][j.inv(t)],rotate180:i=>i^4,isVertical:i=>(i&3)===2,byDirection:(i,t)=>Math.abs(i)*2<=Math.abs(t)?t>=0?j.S:j.N:Math.abs(t)*2<=Math.abs(i)?i>0?j.E:j.W:t>0?i>0?j.SE:j.SW:i>0?j.NE:j.NW,matrixAppendRotationInv:(i,t,e=0,s=0)=>{const r=yr[j.inv(t)];r.tx=e,r.ty=s,i.append(r)}},Xe=[new ut,new ut,new ut,new ut];ot=class{constructor(t=0,e=0,s=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(r)}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 ot(0,0,0,0)}clone(){return new ot(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<=c&&e>=h&&e<=u&&!(t>d&&tm&&e<_)}intersects(t,e){if(!e){const D=this.xt.right?t.right:this.right)<=D)return!1;const P=this.yt.bottom?t.bottom:this.bottom)>P}const s=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=s||o<=n)return!1;const a=Xe[0].set(t.left,t.top),l=Xe[1].set(t.left,t.bottom),c=Xe[2].set(t.right,t.top),h=Xe[3].set(t.right,t.bottom);if(c.x<=a.x||l.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(a,a),e.apply(l,l),e.apply(c,c),e.apply(h,h),Math.max(a.x,l.x,c.x,h.x)<=s||Math.min(a.x,l.x,c.x,h.x)>=r||Math.max(a.y,l.y,c.y,h.y)<=n||Math.min(a.y,l.y,c.y,h.y)>=o))return!1;const d=u*(l.y-a.y),p=u*(a.x-l.x),m=d*s+p*n,_=d*r+p*n,f=d*s+p*o,v=d*r+p*o;if(Math.max(m,_,f,v)<=d*a.x+p*a.y||Math.min(m,_,f,v)>=d*h.x+p*h.y)return!1;const x=u*(a.y-c.y),w=u*(c.x-a.x),C=x*s+w*n,M=x*r+w*n,E=x*s+w*o,I=x*r+w*o;return!(Math.max(C,M,E,I)<=x*a.x+w*a.y||Math.min(C,M,E,I)>=x*h.x+w*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),r=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=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const s=Math.ceil((this.x+this.width-e)*t)/t,r=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=r-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),r=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=r,this.height=n-r,this}getBounds(t){return t=t||new ot,t.copyFrom(this),t}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};const gs={default:-1};at=function(i="default"){return gs[i]===void 0&&(gs[i]=-1),++gs[i]};let Ii;Ii={};J="8.0.0";tt=function(i,t,e=3){if(Ii[t])return;let s=new Error().stack;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${i}`):(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${i}`),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${i}`),console.warn(s))),Ii[t]=!0};const xr=()=>{};tc=function(i){return i+=i===0?1:0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1};function Ei(i){return!(i&i-1)&&!!i}function $o(i){const t={};for(const e in i)i[e]!==void 0&&(t[e]=i[e]);return t}const Ri=Object.create(null);function No(i){const t=Ri[i];return t===void 0&&(Ri[i]=at("resource")),t}const br=class vr extends Nt{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...vr.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){tt(J,"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=No(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};br.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Go=br;const wr=class Cr extends Nt{constructor(t={}){super(),this.options=t,this.uid=at("textureSource"),this._resourceType="textureSource",this._resourceId=at("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={...Cr.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 Go($o(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=at("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 r=Math.round(t*s),n=Math.round(e*s);return this.width=r/s,this.height=n/s,this._resolution=s,this.pixelWidth===r&&this.pixelHeight===n?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=n,this.emit("resize",this),this._resourceId=at("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=Ei(this.pixelWidth)&&Ei(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};wr.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};Gt=wr;class li extends Gt{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}}li.extension=st.TextureSource;const Di=new H;Lo=class{constructor(t,e){this.mapCoord=new H,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 r=0;r0:typeof i=="number"},rt=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*i)/e+0},vt=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),i>e?e:i>t?i:t},Ar=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},Bi=function(i){return{r:vt(i.r,0,255),g:vt(i.g,0,255),b:vt(i.b,0,255),a:vt(i.a)}},ys=function(i){return{r:rt(i.r),g:rt(i.g),b:rt(i.b),a:rt(i.a,3)}},zo=/^#([0-9a-f]{3,8})$/i,We=function(i){var t=i.toString(16);return t.length<2?"0"+t:t},Sr=function(i){var t=i.r,e=i.g,s=i.b,r=i.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:r}},Mr=function(i){var t=i.h,e=i.s,s=i.v,r=i.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),c=n%6;return{r:255*[s,a,o,o,l,s][c],g:255*[l,s,s,a,o,o][c],b:255*[o,o,l,s,s,a][c],a:r}},Fi=function(i){return{h:Ar(i.h),s:vt(i.s,0,100),l:vt(i.l,0,100),a:vt(i.a)}},Vi=function(i){return{h:rt(i.h),s:rt(i.s),l:rt(i.l),a:rt(i.a,3)}},$i=function(i){return Mr((e=(t=i).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},Me=function(i){return{h:(t=Sr(i)).h,s:(r=(200-(e=t.s))*(s=t.v)/100)>0&&r<200?e*s/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,e,s,r},Ho=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Yo=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xo=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Wo=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Hs={string:[[function(i){var t=zo.exec(i);return t?(i=t[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?rt(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?rt(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var t=Xo.exec(i)||Wo.exec(i);return t?t[2]!==t[4]||t[4]!==t[6]?null:Bi({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(i){var t=Ho.exec(i)||Yo.exec(i);if(!t)return null;var e,s,r=Fi({h:(e=t[1],s=t[2],s===void 0&&(s="deg"),Number(e)*(Uo[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return $i(r)},"hsl"]],object:[[function(i){var t=i.r,e=i.g,s=i.b,r=i.a,n=r===void 0?1:r;return Pt(t)&&Pt(e)&&Pt(s)?Bi({r:Number(t),g:Number(e),b:Number(s),a:Number(n)}):null},"rgb"],[function(i){var t=i.h,e=i.s,s=i.l,r=i.a,n=r===void 0?1:r;if(!Pt(t)||!Pt(e)||!Pt(s))return null;var o=Fi({h:Number(t),s:Number(e),l:Number(s),a:Number(n)});return $i(o)},"hsl"],[function(i){var t=i.h,e=i.s,s=i.v,r=i.a,n=r===void 0?1:r;if(!Pt(t)||!Pt(e)||!Pt(s))return null;var o=function(a){return{h:Ar(a.h),s:vt(a.s,0,100),v:vt(a.v,0,100),a:vt(a.a)}}({h:Number(t),s:Number(e),v:Number(s),a:Number(n)});return Mr(o)},"hsv"]]},Ni=function(i,t){for(var e=0;e=.5},i.prototype.toHex=function(){return t=ys(this.rgba),e=t.r,s=t.g,r=t.b,o=(n=t.a)<1?We(rt(255*n)):"","#"+We(e)+We(s)+We(r)+o;var t,e,s,r,n,o},i.prototype.toRgb=function(){return ys(this.rgba)},i.prototype.toRgbString=function(){return t=ys(this.rgba),e=t.r,s=t.g,r=t.b,(n=t.a)<1?"rgba("+e+", "+s+", "+r+", "+n+")":"rgb("+e+", "+s+", "+r+")";var t,e,s,r,n},i.prototype.toHsl=function(){return Vi(Me(this.rgba))},i.prototype.toHslString=function(){return t=Vi(Me(this.rgba)),e=t.h,s=t.s,r=t.l,(n=t.a)<1?"hsla("+e+", "+s+"%, "+r+"%, "+n+")":"hsl("+e+", "+s+"%, "+r+"%)";var t,e,s,r,n},i.prototype.toHsv=function(){return t=Sr(this.rgba),{h:rt(t.h),s:rt(t.s),v:rt(t.v),a:rt(t.a,3)};var t},i.prototype.invert=function(){return Mt({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},i.prototype.saturate=function(t){return t===void 0&&(t=.1),Mt(xs(this.rgba,t))},i.prototype.desaturate=function(t){return t===void 0&&(t=.1),Mt(xs(this.rgba,-t))},i.prototype.grayscale=function(){return Mt(xs(this.rgba,-1))},i.prototype.lighten=function(t){return t===void 0&&(t=.1),Mt(Gi(this.rgba,t))},i.prototype.darken=function(t){return t===void 0&&(t=.1),Mt(Gi(this.rgba,-t))},i.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},i.prototype.alpha=function(t){return typeof t=="number"?Mt({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):rt(this.rgba.a,3);var e},i.prototype.hue=function(t){var e=Me(this.rgba);return typeof t=="number"?Mt({h:t,s:e.s,l:e.l,a:e.a}):rt(e.h)},i.prototype.isEqual=function(t){return this.toHex()===Mt(t).toHex()},i}(),Mt=function(i){return i instanceof Ys?i:new Ys(i)},Li=[],jo=function(i){i.forEach(function(t){Li.indexOf(t)<0&&(t(Ys,Hs),Li.push(t))})};function Zo(i,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 r in e)s[e[r]]=r;var n={};i.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,c=s[this.toHex()];if(c)return c;if(o?.closest){var h=this.toRgb(),u=1/0,d="black";if(!n.length)for(var p in e)n[p]=new i(e[p]).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,r]=this._components;return{r:t,g:e,b:s,a:r}}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,r]=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(r*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t=t||this._arrayRgba;const[e,s,r,n]=this._components;return t[0]=e,t[1]=s,t[2]=r,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t=t||this._arrayRgb;const[e,s,r]=this._components;return t[0]=e,t[1]=s,t[2]=r,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,r,n]=Ae._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=s,this._components[2]*=r,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,r=this._int>>8&255,n=this._int&255;return e&&(s=s*t+.5|0,r=r*t+.5|0,n=n*t+.5|0),(t*255<<24)+(s<<16)+(r<<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,r,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,r=(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,r,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,r,n=255]=t,e/=255,s/=255,r/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const a=Ae.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}const o=Mt(t);o.isValid()&&({r:e,g:s,b:r,a:n}=o.rgba,e/=255,s/=255,r/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=s,this._components[2]=r,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((r,n)=>{t[n]=Math.min(Math.max(r,e),s)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof Ae||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}};de.shared=new de;de._temp=new de;de.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;xt=de;const Ko={cullArea:null,cullable:!1,cullableChildren:!0};Qo=function(i,t,e){const s=i.length;let r;if(t>=s||e===0)return;e=t+e>s?s-t:e;const n=s-e;for(r=t;r0&&s<=e){for(let o=e-1;o>=i;o--){const a=this.children[o];a&&(r.push(a),a.parent=null)}Qo(this.children,i,e);const n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(r);for(let o=0;o=this.children.length)throw new Error(`getChildAt: Index (${i}) does not exist.`);return this.children[i]},setChildIndex(i,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(i),this.addChildAt(i,t)},getChildIndex(i){const t=this.children.indexOf(i);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(i,t){this.allowChildren||tt(J,"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(`${i}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);if(i.parent){const r=i.parent.children.indexOf(i);if(i.parent===this&&r===t)return i;r!==-1&&i.parent.children.splice(r,1)}t===e.length?e.push(i):e.splice(t,0,i),i.parent=this,i.didChange=!0,i.didViewUpdate=!1,i._updateFlags=15;const s=this.renderGroup||this.parentRenderGroup;return s&&s.addChild(i),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",i,this,t),i.emit("added",this),i},swapChildren(i,t){if(i===t)return;const e=this.getChildIndex(i),s=this.getChildIndex(t);this.children[e]=t,this.children[s]=i},removeFromParent(){this.parent?.removeChild(this)}};Oi=class{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t0?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}}class ta{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 hi(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}}Tt=new ta;class ea{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;es.priority-r.priority);const e=this.renderGroup||this.parentRenderGroup;e&&(e.structureDidChange=!0),this._updateIsSimple()},removeEffect(i){const t=this.effects.indexOf(i);t!==-1&&(this.effects.splice(t,1),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateIsSimple())},set mask(i){const t=this._maskEffect;t?.mask!==i&&(t&&(this.removeEffect(t),Xs.returnMaskEffect(t),this._maskEffect=null),i!=null&&(this._maskEffect=Xs.getMaskEffect(i),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},set filters(i){!Array.isArray(i)&&i&&(i=[i]);const t=this._filterEffect||(this._filterEffect=new Oi);i=i;const e=i?.length>0,s=t.filters?.length>0,r=e!==s;i=Array.isArray(i)?i.slice(0):i,t.filters=Object.freeze(i),r&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=i??null))},get filters(){return this._filterEffect?.filters},set filterArea(i){this._filterEffect||(this._filterEffect=new Oi),this._filterEffect.filterArea=i},get filterArea(){return this._filterEffect?.filterArea}},ia={label:null,get name(){return tt(J,"Container.name property has been removed, use Container.label instead"),this.label},set name(i){tt(J,"Container.name property has been removed, use Container.label instead"),this.label=i},getChildByName(i,t=!1){return this.getChildByLabel(i,t)},getChildByLabel(i,t=!1){const e=this.children;for(let s=0;sthis.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new ot);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=Ui,this}set(t,e,s,r){this.minX=t,this.minY=e,this.maxX=s,this.maxY=r}addFrame(t,e,s,r,n){n||(n=this.matrix);const o=n.a,a=n.b,l=n.c,c=n.d,h=n.tx,u=n.ty;let d=this.minX,p=this.minY,m=this.maxX,_=this.maxY,f=o*t+l*e+h,v=a*t+c*e+u;fm&&(m=f),v>_&&(_=v),f=o*s+l*e+h,v=a*s+c*e+u,fm&&(m=f),v>_&&(_=v),f=o*t+l*r+h,v=a*t+c*r+u,fm&&(m=f),v>_&&(_=v),f=o*s+l*r+h,v=a*s+c*r+u,fm&&(m=f),v>_&&(_=v),this.minX=d,this.minY=p,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?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*e+l*n+h,p=a*e+c*n+u,this.minX=dthis.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*r+l*n+h,p=a*r+c*n+u,this.minX=dthis.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY}fit(t){return this.minXt.right&&(this.maxX=t.right),this.minYt.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,s,r){return this.minXe&&(this.maxX=e),this.minYr&&(this.maxY=r),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 Rt(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,r){let n=this.minX,o=this.minY,a=this.maxX,l=this.maxY;r||(r=this.matrix);const c=r.a,h=r.b,u=r.c,d=r.d,p=r.tx,m=r.ty;for(let _=e;_a?x:a,l=w>l?w: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}]`}};let It;It=new hi(H);fe=new hi(Rt);kr=function(i,t,e){e.clear();let s,r;return i.parent?t?s=i.parent.worldTransform:(r=It.get().identity(),s=os(i,r)):s=H.IDENTITY,Pr(i,e,s,t),r&&It.return(r),e.isValid||e.set(0,0,0,0),e};function Pr(i,t,e,s){if(!i.visible||!i.measurable)return;let r;s?r=i.worldTransform:(i.updateLocalTransform(),r=It.get(),r.appendFrom(i.localTransform,e));const n=t,o=!!i.effects.length;if(o&&(t=fe.get().clear()),i.boundsArea)t.addRect(i.boundsArea,r);else{i.addBounds&&(t.matrix=r,i.addBounds(t));for(let a=0;a>12&&(i.didChange=!0,i.data[0]=this._didChangeId>>12),Er(this,i),i.didChange&&Tr(this,i.localBounds,ra),i.localBounds},getBounds(i,t){return kr(this,i,t||new Rt)}},oa={_onRender:null,set onRender(i){const t=this.renderGroup||this.parentRenderGroup;if(!i){this._onRender&&t?.removeOnRender(this),this._onRender=null;return}this._onRender||t?.addOnRender(this),this._onRender=i},get onRender(){return this._onRender}},aa={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(i){this._zIndex!==i&&(this._zIndex=i,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(la))}};function la(i,t){return i._zIndex-t._zIndex}const ha={getGlobalPosition(i=new ut,t=!1){return this.parent?this.parent.toGlobal(this._position,i,t):(i.x=this._position.x,i.y=this._position.y),i},toGlobal(i,t,e=!1){if(!e){this.updateLocalTransform();const s=os(this,new H);return s.append(this.localTransform),s.apply(i,t)}return this.worldTransform.apply(i,t)},toLocal(i,t,e,s){if(t&&(i=t.toGlobal(i,e,s)),!s){this.updateLocalTransform();const r=os(this,new H);return r.append(this.localTransform),r.applyInverse(i,e)}return this.worldTransform.applyInverse(i,e)}};class Rr{constructor(){this.uid=at("instructionSet"),this.instructions=[],this.instructionSize=0}reset(){this.instructionSize=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}class ca{constructor(t){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new H,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new Rr,this._onRenderContainers=[],this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const e=t.children;for(let s=0;s-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)),this.effects=[],t.parent?.addChild(this)}static mixin(t){Object.defineProperties(pt.prototype,Object.getOwnPropertyDescriptors(t))}addChild(...t){if(this.allowChildren||tt(J,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let r=0;r1){for(let r=0;r-1&&(this._didChangeId+=4096,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._didChangeId++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){if(this.renderGroup&&t===!1)throw new Error("[Pixi] cannot undo a render group just yet");t&&this.enableRenderGroup()}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t&&t.removeChild(this),this.renderGroup=new ca(this),t&&t.addChild(this),this._updateIsSimple(),this.groupTransform=H.IDENTITY}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new H),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*Ro}set angle(t){this.rotation=t*Do}get pivot(){return this._pivot===Cs&&(this._pivot=new yt(this,0,0)),this._pivot}set pivot(t){this._pivot===Cs&&(this._pivot=new yt(this,0,0)),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===ws&&(this._skew=new yt(this,0,0)),this._skew}set skew(t){this._skew===ws&&(this._skew=new yt(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===As&&(this._scale=new yt(this,1,1)),this._scale}set scale(t){this._scale===As&&(this._scale=new yt(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();let r,n;typeof t!="object"?(r=t,n=e??t):(r=t.width,n=t.height??t.width),r!==void 0&&this._setWidth(r,s.width),n!==void 0&&this._setHeight(n,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(){if((this._didLocalTransformChangeId&15)===this._didChangeId)return;this._didLocalTransformChangeId=this._didChangeId;const t=this.localTransform,e=this._scale,s=this._pivot,r=this._position,n=e._x,o=e._y,a=s._x,l=s._y;t.a=this._cx*n,t.b=this._sx*n,t.c=this._cy*o,t.d=this._sy*o,t.tx=r._x-(a*t.a+l*t.c),t.ty=r._y-(a*t.b+l*t.d)}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=Hi,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const s=xt.shared.setValue(t??16777215).toBgrNumber();s!==this.localColor&&(this.localColor=s,this._updateFlags|=Hi,this._onUpdate())}get tint(){const t=this.localColor;return((t&255)<<16)+(t&65280)+(t>>16&255)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=da,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const e=t?1:0;(this.localDisplayStatus&2)>>1!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ss,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const e=t?1:0;(this.localDisplayStatus&4)>>2!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ss,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|=Ss,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;const e=this.removeChildren(0,this.children.length);if(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)for(let r=0;r{this.onViewUpdate()}}),s?this.anchor=s:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=r??!1,n&&(this.width=n),o&&(this.height=o)}static from(t,e=!1){return t instanceof W?new Re(t):new Re(W.from(t,e))}set texture(t){t||(t=W.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.onViewUpdate())}get texture(){return this._texture}get bounds(){return this._boundsDirty&&(this._updateBounds(),this._boundsDirty=!1),this._bounds}get sourceBounds(){return this._sourceBoundsDirty&&(this._updateSourceBounds(),this._sourceBoundsDirty=!1),this._sourceBounds}containsPoint(t){const e=this.sourceBounds;return t.x>=e.maxX&&t.x<=e.minX&&t.y>=e.maxY&&t.y<=e.minY}addBounds(t){const e=this._texture.trim?this.sourceBounds:this.bounds;t.addFrame(e.minX,e.minY,e.maxX,e.maxY)}onViewUpdate(){if(this._didChangeId+=4096,this._didSpriteUpdate=!0,this._sourceBoundsDirty=this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}_updateBounds(){Oo(this._bounds,this._anchor,this._texture,0)}_updateSourceBounds(){const t=this._anchor,e=this._texture,s=this._sourceBounds,{width:r,height:n}=e.orig;s.maxX=-t._x*r,s.minX=s.maxX+r,s.maxY=-t._y*n,s.minY=s.maxY+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._bounds=null,this._sourceBounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width)}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height)}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){let s,r;typeof t!="object"?(s=t,r=e??t):(s=t.width,r=t.height??t.width),s!==void 0&&this._setWidth(s,this._texture.orig.width),r!==void 0&&this._setHeight(r,this._texture.orig.height)}};const fa=new Rt;function Dr(i,t,e){const s=fa;i.measurable=!0,kr(i,e,s),t.addBoundsMask(s),i.measurable=!1}function Br(i,t,e){const s=fe.get();i.measurable=!0;const r=It.get().identity(),n=Fr(i,e,r);Tr(i,s,n),i.measurable=!1,t.addBoundsMask(s),It.return(r),fe.return(s)}function Fr(i,t,e){return i?(i!==t&&(Fr(i.parent,t,e),i.updateLocalTransform(),e.append(i.localTransform)),e):(Et("Mask bounds, renderable is not inside the root container"),e)}class Vr{constructor(t){this.priority=0,this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof Re),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){Dr(this.mask,t,e)}addLocalBounds(t,e){Br(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof Re}}Vr.extension=st.MaskEffect;class $r{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"}}$r.extension=st.MaskEffect;class Nr{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){Dr(this.mask,t,e)}addLocalBounds(t,e){Br(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof pt}}Nr.extension=st.MaskEffect;const pa={createCanvas:(i,t)=>{const e=document.createElement("canvas");return e.width=i,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(i,t)=>fetch(i,t),parseXML:i=>new DOMParser().parseFromString(i,"text/xml")};let Yi=pa;$t={get(){return Yi},set(i){Yi=i}};Gr=class extends Gt{constructor(t){t.resource||(t.resource=$t.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;const e=t.resource;(this.pixelWidth!==e.width||this.pixelWidth!==e.height)&&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 r=super.resize(t,e,s);return r&&this.resizeCanvas(),r}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}};Gr.extension=st.TextureSource;ci=class extends Gt{constructor(t){if(t.resource&&globalThis.HTMLImageElement&&t.resource instanceof HTMLImageElement){const e=$t.get().createCanvas(t.resource.width,t.resource.height);e.getContext("2d").drawImage(t.resource,0,0),t.resource=e,Et("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}};ci.extension=st.TextureSource;Ws=(i=>(i[i.INTERACTION=50]="INTERACTION",i[i.HIGH=25]="HIGH",i[i.NORMAL=0]="NORMAL",i[i.LOW=-25]="LOW",i[i.UTILITY=-50]="UTILITY",i))(Ws||{});class Ms{constructor(t,e=null,s=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=s,this._once=r}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 Lr=class gt{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 Ms(null,null,1/0),this.deltaMS=1/gt.targetFPMS,this.elapsedMS=1/gt.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=Ws.NORMAL){return this._addListener(new Ms(t,e,s))}addOnce(t,e,s=Ws.NORMAL){return this._addListener(new Ms(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 r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),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(r),t.deleteTexture(s),t.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),ks}const cs=class Or extends Gt{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...Or.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=qe.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 ma(),this._load=new Promise((s,r)=>{this.isValid?s(this):(this._resolve=s,this._reject=r,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&&(qe.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||(qe.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(qe.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||globalThis.VideoFrame&&t instanceof VideoFrame}};cs.extension=st.TextureSource;cs.defaultOptions={...Gt.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};cs.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let _a=cs;const le=(i,t,e=!1)=>(Array.isArray(i)||(i=[i]),t?i.map(s=>typeof s=="string"||e?t(s):s):i);class ga{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||Et(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const s=le(t);let r;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 c=r?r[l]:e;this._cache.has(l)&&this._cache.get(l)!==c&&Et("[Cache] already has key:",l),this._cache.set(l,n.get(l))})}remove(t){if(!this._cacheMap.has(t)){Et(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(r=>{this._cache.delete(r)}),e.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}let qs;he=new ga;qs=[];re.handleByList(st.TextureSource,qs);function ya(i={}){const t=i&&i.resource,e=t?i.resource:i,s=t?i:{resource:i};for(let r=0;r{he.has(s)&&he.remove(s)}),t||he.set(s,n),n}function ba(i,t=!1){return typeof i=="string"?he.get(i):i instanceof Gt?new W({source:i}):xa(i,t)}W.from=ba;re.add(Vr,$r,Nr,_a,ci,Gr,li);Ur=(i=>(i[i.Low=0]="Low",i[i.Normal=1]="Normal",i[i.High=2]="High",i))(Ur||{});function Ct(i){if(typeof i!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(i)}`)}function xe(i){return i.split("?")[0].split("#")[0]}function va(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wa(i,t,e){return i.replace(new RegExp(va(t),"g"),e)}function Ca(i,t){let e="",s=0,r=-1,n=0,o=-1;for(let a=0;a<=i.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("/")),r=a,n=0;continue}}else if(e.length===2||e.length===1){e="",s=0,r=a,n=0;continue}}}else e.length>0?e+=`/${i.slice(r+1,a)}`:e=i.slice(r+1,a),s=a-r-1;r=a,n=0}else o===46&&n!==-1?++n:n=-1}return e}De={toPosix(i){return wa(i,"\\","/")},isUrl(i){return/^https?:/.test(this.toPosix(i))},isDataUrl(i){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(i)},isBlobUrl(i){return i.startsWith("blob:")},hasProtocol(i){return/^[^/:]+:/.test(this.toPosix(i))},getProtocol(i){Ct(i),i=this.toPosix(i);const t=/^file:\/\/\//.exec(i);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(i);return e?e[0]:""},toAbsolute(i,t,e){if(Ct(i),this.isDataUrl(i)||this.isBlobUrl(i))return i;const s=xe(this.toPosix(t??$t.get().getBaseUrl())),r=xe(this.toPosix(e??this.rootname(s)));return i=this.toPosix(i),i.startsWith("/")?De.join(r,i.slice(1)):this.isAbsolute(i)?i:this.join(s,i)},normalize(i){if(Ct(i),i.length===0)return".";if(this.isDataUrl(i)||this.isBlobUrl(i))return i;i=this.toPosix(i);let t="";const e=i.startsWith("/");this.hasProtocol(i)&&(t=this.rootname(i),i=i.slice(t.length));const s=i.endsWith("/");return i=Ca(i),i.length>0&&s&&(i+="/"),e?`/${i}`:t+i},isAbsolute(i){return Ct(i),i=this.toPosix(i),this.hasProtocol(i)?!0:i.startsWith("/")},join(...i){if(i.length===0)return".";let t;for(let e=0;e0)if(t===void 0)t=s;else{const r=i[e-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${s}`:t+=`/${s}`}}return t===void 0?".":this.normalize(t)},dirname(i){if(Ct(i),i.length===0)return".";i=this.toPosix(i);let t=i.charCodeAt(0);const e=t===47;let s=-1,r=!0;const n=this.getProtocol(i),o=i;i=i.slice(n.length);for(let a=i.length-1;a>=1;--a)if(t=i.charCodeAt(a),t===47){if(!r){s=a;break}}else r=!1;return s===-1?e?"/":this.isUrl(o)?n+i:n:e&&s===1?"//":n+i.slice(0,s)},rootname(i){Ct(i),i=this.toPosix(i);let t="";if(i.startsWith("/")?t="/":t=this.getProtocol(i),this.isUrl(i)){const e=i.indexOf("/",t.length);e!==-1?t=i.slice(0,e):t=i,t.endsWith("/")||(t+="/")}return t},basename(i,t){Ct(i),t&&Ct(t),i=xe(this.toPosix(i));let e=0,s=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=i.length){if(t.length===i.length&&t===i)return"";let o=t.length-1,a=-1;for(n=i.length-1;n>=0;--n){const l=i.charCodeAt(n);if(l===47){if(!r){e=n+1;break}}else a===-1&&(r=!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=i.length),i.slice(e,s)}for(n=i.length-1;n>=0;--n)if(i.charCodeAt(n)===47){if(!r){e=n+1;break}}else s===-1&&(r=!1,s=n+1);return s===-1?"":i.slice(e,s)},extname(i){Ct(i),i=xe(this.toPosix(i));let t=-1,e=0,s=-1,r=!0,n=0;for(let o=i.length-1;o>=0;--o){const a=i.charCodeAt(o);if(a===47){if(!r){e=o+1;break}continue}s===-1&&(r=!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?"":i.slice(t,s)},parse(i){Ct(i);const t={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return t;i=xe(this.toPosix(i));let e=i.charCodeAt(0);const s=this.isAbsolute(i);let r;t.root=this.rootname(i),s||this.hasProtocol(i)?r=1:r=0;let n=-1,o=0,a=-1,l=!0,c=i.length-1,h=0;for(;c>=r;--c){if(e=i.charCodeAt(c),e===47){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),e===46?n===-1?n=c: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=i.slice(1,a):t.base=t.name=i.slice(o,a)):(o===0&&s?(t.name=i.slice(1,n),t.base=i.slice(1,a)):(t.name=i.slice(o,n),t.base=i.slice(o,a)),t.ext=i.slice(n,a)),t.dir=this.dirname(i),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function zr(i,t,e,s,r){const n=t[e];for(let o=0;o{const o=n.substring(1,n.length-1).split(",");r.push(o)}),zr(i,r,0,e,s)}else s.push(i);return s}const Xi=i=>!Array.isArray(i);class Hr{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 le(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&&Et("[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 r=e;Array.isArray(e)||(r=Object.entries(e).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),r.forEach(n=>{const o=n.src,a=n.alias;let l;if(typeof a=="string"){const c=this._createBundleAssetId(t,a);s.push(c),l=[a,c]}else{const c=a.map(h=>this._createBundleAssetId(t,h));s.push(...c),l=[...a,...c]}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)&&Et(`[Resolver] already has key: ${n} overwriting`)},le(e).forEach(n=>{const{src:o}=n;let{data:a,format:l,loadParser:c}=n;const h=le(o).map(p=>typeof p=="string"?Aa(p):Array.isArray(p)?p:[p]),u=this.getAlias(n);Array.isArray(u)?u.forEach(s):s(u);const d=[];h.forEach(p=>{p.forEach(m=>{let _={};if(typeof m!="object"){_.src=m;for(let f=0;f{this._assetMap[p]=d})})}resolveBundle(t){const e=Xi(t);t=le(t);const s={};return t.forEach(r=>{const n=this._bundles[r];if(n){const o=this.resolve(n),a={};for(const l in o){const c=o[l];a[this._extractAssetIdFromBundle(r,l)]=c}s[r]=a}}),e?s[t[0]]:s}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const s={};for(const r in e)s[r]=e[r].src;return s}return e.src}resolve(t){const e=Xi(t);t=le(t);const s={};return t.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let n=this._assetMap[r];const o=this._getPreferredOrder(n);o?.priority.forEach(a=>{o.params[a].forEach(l=>{const c=n.filter(h=>h[a]?h[a]===l:!1);c.length&&(n=c)})}),this._resolverHash[r]=n[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});s[r]=this._resolverHash[r]}),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(r)return r}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:r,loadParser:n,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=De.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=n??t.loadParser,t.format=o??t.format??Sa(t.src),t}}Hr.RETINA_PREFIX=/@([0-9\.]+)x/;function Sa(i){return i.split(".").pop().split("?").shift().split("#").shift()}let Yr;Wi=(i,t)=>{const e=t.split("?")[1];return e&&(i+=`?${e}`),i};Yr=class Se{constructor(t,e){this.linkedSheets=[],this._texture=t instanceof W?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<=Se.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const s=Se.BATCH_SIZE;for(;e-t{this._batchIndex*Se.BATCH_SIZE{s[r]=t}),Object.keys(t.textures).forEach(r=>{s[r]=t.textures[r]}),!e){const r=De.dirname(i[0]);t.linkedSheets.forEach((n,o)=>{const a=Xr([`${r}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(s,a)})}return s}const ka={extension:st.Asset,cache:{test:i=>i instanceof qi,getCacheableAssets:(i,t)=>Xr(i,t,!1)},resolver:{test:i=>{const e=i.split("?")[0].split("."),s=e.pop(),r=e.pop();return s==="json"&&Ma.includes(r)},parse:i=>{const t=i.split(".");return{resolution:parseFloat(Hr.RETINA_PREFIX.exec(i)?.[1]??"1"),format:t[t.length-2],src:i}}},loader:{name:"spritesheetLoader",extension:{type:st.LoadParser,priority:Ur.Normal},async testParse(i,t){return De.extname(t.src).toLowerCase()===".json"&&!!i.frames},async parse(i,t,e){const{texture:s,imageFilename:r}=t?.data??{};let n=De.dirname(t.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");let o;if(s instanceof W)o=s;else{const c=Wi(n+(r??i.meta.image),t.src);o=(await e.load([c]))[c]}const a=new qi(o.source,i);await a.parse();const l=i?.meta?.related_multi_packs;if(Array.isArray(l)){const c=[];for(const u of l){if(typeof u!="string")continue;let d=n+u;t.data?.ignoreMultiPack||(d=Wi(d,t.src),c.push(e.load({src:d,data:{ignoreMultiPack:!0}})))}const h=await Promise.all(c);a.linkedSheets=h,h.forEach(u=>{u.linkedSheets=[a].concat(a.linkedSheets.filter(d=>d!==u))})}return a},async unload(i,t,e){await e.unload(i.textureSource._sourceOrigin),i.destroy(!1)}}};re.add(ka);let je;Pa=function(){return(!je||je?.isContextLost())&&(je=$t.get().createCanvas().getContext("webgl",{})),je};Ta=class{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const s in t){const r=t[s];this.setResource(r,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()}};const js=[];re.handleByNamedList(st.Environment,js);async function Ia(i){if(i)for(let t=0;t80*e){a=c=i[0],l=h=i[1];for(var m=e;mc&&(c=u),d>h&&(h=d);p=Math.max(c-a,h-l),p=p!==0?32767/p:0}return Be(n,o,e,a,l,p,0),o}function Wr(i,t,e,s,r){var n,o;if(r===Qs(i,t,e,s)>0)for(n=t;n=t;n-=s)o=ji(n,i[n],i[n+1],o);return o&&ds(o,o.next)&&(Ve(o),o=o.next),o}function Jt(i,t){if(!i)return i;t||(t=i);var e=i,s;do if(s=!1,!e.steiner&&(ds(e,e.next)||Z(e.prev,e,e.next)===0)){if(Ve(e),e=t=e.prev,e===e.next)break;s=!0}else e=e.next;while(s||e!==t);return t}function Be(i,t,e,s,r,n,o){if(i){!o&&n&&Oa(i,s,r,n);for(var a=i,l,c;i.prev!==i.next;){if(l=i.prev,c=i.next,n?Da(i,s,r,n):Ra(i)){t.push(l.i/e|0),t.push(i.i/e|0),t.push(c.i/e|0),Ve(i),i=c.next,a=c.next;continue}if(i=c,i===a){o?o===1?(i=Ba(Jt(i),t,e),Be(i,t,e,s,r,n,2)):o===2&&Fa(i,t,e,s,r,n):Be(Jt(i),t,e,s,r,n,1);break}}}}function Ra(i){var t=i.prev,e=i,s=i.next;if(Z(t,e,s)>=0)return!1;for(var r=t.x,n=e.x,o=s.x,a=t.y,l=e.y,c=s.y,h=rn?r>o?r:o:n>o?n:o,p=a>l?a>c?a:c:l>c?l:c,m=s.next;m!==t;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=p&&ce(r,a,n,l,o,c,m.x,m.y)&&Z(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Da(i,t,e,s){var r=i.prev,n=i,o=i.next;if(Z(r,n,o)>=0)return!1;for(var a=r.x,l=n.x,c=o.x,h=r.y,u=n.y,d=o.y,p=al?a>c?a:c:l>c?l:c,f=h>u?h>d?h:d:u>d?u:d,v=Zs(p,m,t,e,s),x=Zs(_,f,t,e,s),w=i.prevZ,C=i.nextZ;w&&w.z>=v&&C&&C.z<=x;){if(w.x>=p&&w.x<=_&&w.y>=m&&w.y<=f&&w!==r&&w!==o&&ce(a,h,l,u,c,d,w.x,w.y)&&Z(w.prev,w,w.next)>=0||(w=w.prevZ,C.x>=p&&C.x<=_&&C.y>=m&&C.y<=f&&C!==r&&C!==o&&ce(a,h,l,u,c,d,C.x,C.y)&&Z(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;w&&w.z>=v;){if(w.x>=p&&w.x<=_&&w.y>=m&&w.y<=f&&w!==r&&w!==o&&ce(a,h,l,u,c,d,w.x,w.y)&&Z(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;C&&C.z<=x;){if(C.x>=p&&C.x<=_&&C.y>=m&&C.y<=f&&C!==r&&C!==o&&ce(a,h,l,u,c,d,C.x,C.y)&&Z(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Ba(i,t,e){var s=i;do{var r=s.prev,n=s.next.next;!ds(r,n)&&qr(r,s,s.next,n)&&Fe(r,n)&&Fe(n,r)&&(t.push(r.i/e|0),t.push(s.i/e|0),t.push(n.i/e|0),Ve(s),Ve(s.next),s=i=n),s=s.next}while(s!==i);return Jt(s)}function Fa(i,t,e,s,r,n){var o=i;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Ha(o,a)){var l=jr(o,a);o=Jt(o,o.next),l=Jt(l,l.next),Be(o,t,e,s,r,n,0),Be(l,t,e,s,r,n,0);return}a=a.next}o=o.next}while(o!==i)}function Va(i,t,e,s){var r=[],n,o,a,l,c;for(n=0,o=t.length;n=e.next.y&&e.next.y!==e.y){var a=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(a<=s&&a>n&&(n=a,o=e.x=e.x&&e.x>=c&&s!==e.x&&ce(ro.x||e.x===o.x&&La(o,e)))&&(o=e,u=d)),e=e.next;while(e!==l);return o}function La(i,t){return Z(i.prev,i,t.prev)<0&&Z(t.next,i,i.next)<0}function Oa(i,t,e,s){var r=i;do r.z===0&&(r.z=Zs(r.x,r.y,t,e,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==i);r.prevZ.nextZ=null,r.prevZ=null,Ua(r)}function Ua(i){var t,e,s,r,n,o,a,l,c=1;do{for(e=i,i=null,n=null,o=0;e;){for(o++,s=e,a=0,t=0;t0||l>0&&s;)a!==0&&(l===0||!s||e.z<=s.z)?(r=e,e=e.nextZ,a--):(r=s,s=s.nextZ,l--),n?n.nextZ=r:i=r,r.prevZ=n,n=r;e=s}n.nextZ=null,c*=2}while(o>1);return i}function Zs(i,t,e,s,r){return i=(i-e)*r|0,t=(t-s)*r|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,i|t<<1}function za(i){var t=i,e=i;do(t.x=(i-o)*(n-a)&&(i-o)*(s-a)>=(e-o)*(t-a)&&(e-o)*(n-a)>=(r-o)*(s-a)}function Ha(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!Ya(i,t)&&(Fe(i,t)&&Fe(t,i)&&Xa(i,t)&&(Z(i.prev,i,t.prev)||Z(i,t.prev,t))||ds(i,t)&&Z(i.prev,i,i.next)>0&&Z(t.prev,t,t.next)>0)}function Z(i,t,e){return(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y)}function ds(i,t){return i.x===t.x&&i.y===t.y}function qr(i,t,e,s){var r=Ke(Z(i,t,e)),n=Ke(Z(i,t,s)),o=Ke(Z(e,s,i)),a=Ke(Z(e,s,t));return!!(r!==n&&o!==a||r===0&&Ze(i,e,t)||n===0&&Ze(i,s,t)||o===0&&Ze(e,i,s)||a===0&&Ze(e,t,s))}function Ze(i,t,e){return t.x<=Math.max(i.x,e.x)&&t.x>=Math.min(i.x,e.x)&&t.y<=Math.max(i.y,e.y)&&t.y>=Math.min(i.y,e.y)}function Ke(i){return i>0?1:i<0?-1:0}function Ya(i,t){var e=i;do{if(e.i!==i.i&&e.next.i!==i.i&&e.i!==t.i&&e.next.i!==t.i&&qr(e,e.next,i,t))return!0;e=e.next}while(e!==i);return!1}function Fe(i,t){return Z(i.prev,i,i.next)<0?Z(i,t,i.next)>=0&&Z(i,i.prev,t)>=0:Z(i,t,i.prev)<0||Z(i,i.next,t)<0}function Xa(i,t){var e=i,s=!1,r=(i.x+t.x)/2,n=(i.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&r<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(s=!s),e=e.next;while(e!==i);return s}function jr(i,t){var e=new Ks(i.i,i.x,i.y),s=new Ks(t.i,t.x,t.y),r=i.next,n=t.prev;return i.next=t,t.prev=i,e.next=r,r.prev=e,s.next=e,e.prev=s,n.next=s,s.prev=n,s}function ji(i,t,e,s){var r=new Ks(i,t,e);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function Ve(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Ks(i,t,e){this.i=i,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}us.deviation=function(i,t,e,s){var r=t&&t.length,n=r?t[0]*e:i.length,o=Math.abs(Qs(i,0,n,e));if(r)for(var a=0,l=t.length;a0&&(s+=i[r-1].length,e.holes.push(s))}return e};var Wa=ui.exports;const qa=ni(Wa);Zr=(i=>(i[i.NONE=0]="NONE",i[i.COLOR=16384]="COLOR",i[i.STENCIL=1024]="STENCIL",i[i.DEPTH=256]="DEPTH",i[i.COLOR_DEPTH=16640]="COLOR_DEPTH",i[i.COLOR_STENCIL=17408]="COLOR_STENCIL",i[i.DEPTH_STENCIL=1280]="DEPTH_STENCIL",i[i.ALL=17664]="ALL",i))(Zr||{});ja=class{constructor(t){this.items=[],this._name=t}emit(t,e,s,r,n,o,a,l){const{name:c,items:h}=this;for(let u=0,d=h.length;u{this.runners[e]=new ja(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 r in this.runners)this.runners[r].add(s);return this}_addPipes(t,e){const s=e.reduce((r,n)=>(r[n.name]=n.value,r),{});t.forEach(r=>{const n=r.value,o=r.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(!Ea())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}};Kr.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Qe;Jr=Kr;function Ka(i){return Qe!==void 0||(Qe=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:i??Jr.defaultOptions.failIfMajorPerformanceCaveat};try{if(!$t.get().getWebGLRenderingContext())return!1;let s=$t.get().createCanvas().getContext("webgl",t);const r=!!s?.getContextAttributes()?.stencil;if(s){const n=s.getExtension("WEBGL_lose_context");n&&n.loseContext()}return s=null,r}catch{return!1}})()),Qe}let Je;async function Qa(i={}){return Je!==void 0||(Je=await (async()=>{if(!$t.get().getNavigator().gpu)return!1;try{return await (await navigator.gpu.requestAdapter(i)).requestDevice(),!0}catch{return!1}})()),Je}const Zi=["webgl","webgpu","canvas"];async function Ja(i){let t=[];i.preference?(t.push(i.preference),Zi.forEach(n=>{n!==i.preference&&t.push(n)})):t=Zi.slice();let e;await Ia(i.manageImports??!0);let s={};for(let n=0;nimport("./WebGPURenderer-ByZp18Ac.js").then(async m=>{await m.__tla;return m}),__vite__mapDeps([13,2,14,3,5,6,7,8,9,10,11,12]),import.meta.url);e=a,s={...i,...i.webgpu};break}else if(o==="webgl"&&Ka(i.failIfMajorPerformanceCaveat??Jr.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await ns(()=>import("./WebGLRenderer-1-eFgxul.js").then(async m=>{await m.__tla;return m}),__vite__mapDeps([15,2,4,14,5,6,7,8,9,10,11,12]),import.meta.url);e=a,s={...i,...i.webgl};break}else if(o==="canvas")throw s={...i},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 r=new e;return await r.init(s),r}const tn=class Js{constructor(...t){this.stage=new pt,t[0]!==void 0&&tt(J,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.renderer=await Ja(t),Js._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return tt(J,"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=Js._plugins.slice(0);s.reverse(),s.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};tn._plugins=[];let en=tn;re.handleByList(st.Application,en._plugins);var tl=sl,Ps={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},el=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function sl(i){var t=[];return i.replace(el,function(e,s,r){var n=s.toLowerCase();for(r=rl(r),n=="m"&&r.length>2&&(t.push([s].concat(r.splice(0,2))),n="l",s=s=="m"?"l":"L");;){if(r.length==Ps[n])return r.unshift(s),t.push(r);if(r.length0&&(r=s.pop(),r?(n=r.startX,o=r.startY):(n=0,o=0)),r=null;break;default:Et(`Unknown SVG path command: ${c}`)}c!=="Z"&&c!=="z"&&r===null&&(r={startX:n,startY:o},s.push(r))}return t}class di{constructor(t=0,e=0,s=0){this.type="circle",this.x=t,this.y=e,this.radius=s}clone(){return new di(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const s=this.radius*this.radius;let r=this.x-t,n=this.y-e;return r*=r,n*=n,r+n<=s}strokeContains(t,e,s){if(this.radius===0)return!1;const r=this.x-t,n=this.y-e,o=this.radius,a=s/2,l=Math.sqrt(r*r+n*n);return lo-a}getBounds(t){return t=t||new ot,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 fi{constructor(t=0,e=0,s=0,r=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=s,this.halfHeight=r}clone(){return new fi(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,r=(e-this.y)/this.halfHeight;return s*=s,r*=r,s+r<=1}strokeContains(t,e,s){const{halfWidth:r,halfHeight:n}=this;if(r<=0||n<=0)return!1;const o=s/2,a=r-o,l=n-o,c=r+o,h=n+o,u=t-this.x,d=e-this.y,p=u*u/(a*a)+d*d/(l*l),m=u*u/(c*c)+d*d/(h*h);return p>1&&m<=1}getBounds(){return new ot(this.x-this.halfWidth,this.y-this.halfHeight,this.halfWidth*2,this.halfHeight*2)}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 al(i,t,e,s,r,n){const o=i-e,a=t-s,l=r-e,c=n-s,h=o*l+a*c,u=l*l+c*c;let d=-1;u!==0&&(d=h/u);let p,m;d<0?(p=e,m=s):d>1?(p=r,m=n):(p=e+d*l,m=s+d*c);const _=i-p,f=t-m;return _*_+f*f}class ke{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const s=[];for(let r=0,n=e.length;re!=h>e&&t<(c-a)*((e-l)/(h-l))+a&&(s=!s)}return s}strokeContains(t,e,s){const r=s/2,n=r*r,{points:o}=this,a=o.length-(this.closePath?0:2);for(let l=0;lr?c:r,n=ho?h:o}return t.x=s,t.width=r-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 ts=(i,t,e,s,r,n)=>{const o=i-e,a=t-s,l=Math.sqrt(o*o+a*a);return l>=r-n&&l<=r+n};class pi{constructor(t=0,e=0,s=0,r=0,n=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=s,this.height=r,this.radius=n}getBounds(t){return t=t||new ot,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new pi(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 r=t-(this.x+s),n=e-(this.y+s);const o=s*s;if(r*r+n*n<=o||(r=t-(this.x+this.width-s),r*r+n*n<=o)||(n=e-(this.y+this.height-s),r*r+n*n<=o)||(r=t-(this.x+s),r*r+n*n<=o))return!0}return!1}strokeContains(t,e,s){const{x:r,y:n,width:o,height:a,radius:l}=this,c=s/2,h=r+l,u=n+l,d=o-l*2,p=a-l*2,m=r+o,_=n+a;return(t>=r-c&&t<=r+c||t>=m-c&&t<=m+c)&&e>=u&&e<=u+p||(e>=n-c&&e<=n+c||e>=_-c&&e<=_+c)&&t>=h&&t<=h+d?!0:tm-l&&em-l&&e>_-l&&ts(t,e,m-l,_-l,l,c)||t_-l&&ts(t,e,h,_-l,l,c)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}mt=(i=>(i[i.MAP_READ=1]="MAP_READ",i[i.MAP_WRITE=2]="MAP_WRITE",i[i.COPY_SRC=4]="COPY_SRC",i[i.COPY_DST=8]="COPY_DST",i[i.INDEX=16]="INDEX",i[i.VERTEX=32]="VERTEX",i[i.UNIFORM=64]="UNIFORM",i[i.STORAGE=128]="STORAGE",i[i.INDIRECT=256]="INDIRECT",i[i.QUERY_RESOLVE=512]="QUERY_RESOLVE",i[i.STATIC=1024]="STATIC",i))(mt||{});$e=class extends Nt{constructor(t){let{data:e,size:s}=t;const{usage:r,label:n,shrinkToFit:o}=t;super(),this.uid=at("buffer"),this._resourceType="buffer",this._resourceId=at("resource"),this._touched=0,this._updateID=1,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:r,mappedAtCreation:a,label:n},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}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 r=this._data;if(this._data=t,r.length!==t.length){!this.shrinkToFit&&t.byteLengtha&&(a=p),m>l&&(l=m),pe.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}};const ul=new Float32Array(1),dl=new Uint32Array(1);fl=class extends cl{constructor(){const e=new $e({data:ul,label:"attribute-batch-buffer",usage:mt.VERTEX|mt.COPY_DST,shrinkToFit:!1}),s=new $e({data:dl,label:"index-batch-buffer",usage:mt.INDEX|mt.COPY_DST,shrinkToFit:!1}),r=6*4;super({attributes:{aPosition:{buffer:e,format:"float32x2",stride:r,offset:0,location:1},aUV:{buffer:e,format:"float32x2",stride:r,offset:2*4,location:3},aColor:{buffer:e,format:"unorm8x4",stride:r,offset:4*4,location:0},aTextureIdAndRound:{buffer:e,format:"uint16x2",stride:r,offset:5*4,location:2}},indexBuffer:s})}};let es=null;rn=function(){if(es)return es;const i=Pa();return es=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),es};const nn={};pl=function(i,t){let e=0;for(let s=0;s>>0;return nn[e]||ml(i,e)};let Ts=0;function ml(i,t){const e={};let s=0;Ts||(Ts=rn());for(let n=0;n0){const o=new Uint8Array(i,e*8,n);new Uint8Array(t,e*8,n).set(o)}};const _l={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};gl=(i=>(i[i.DISABLED=0]="DISABLED",i[i.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",i[i.MASK_ACTIVE=2]="MASK_ACTIVE",i[i.RENDERING_MASK_REMOVE=3]="RENDERING_MASK_REMOVE",i[i.NONE=4]="NONE",i))(gl||{});function Ji(i,t){return t.alphaMode==="no-premultiply-alpha"&&_l[i]||i}class tr{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;tthis.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const o=this.attributeBuffer.float32View,a=this.attributeBuffer.uint32View,l=this.indexBuffer;let c=this._batchIndexSize,h=this._batchIndexStart,u="startBatch",d=this._batchPool[this._batchPoolIndex++]||new er;const p=this._maxTextures;for(let m=this.elementStart;m=p||w)&&(this._finishBatch(d,h,c-h,s,n,t,u),u="renderBatch",h=c,n=x,s=this._textureBatchPool[this._textureBatchPoolIndex++]||new tr,s.clear(),d=this._batchPool[this._batchPoolIndex++]||new er,++ve),_.textureId=v._textureBindLocation=s.count,s.ids[v.uid]=s.count,s.textures[s.count++]=v,_.batch=d,c+=_.indexSize,_.packAttributes(o,a,_.location,_.textureId),_.packIndex(l,_.indexStart,_.location/this._vertexSize)}s.count>0&&(this._finishBatch(d,h,c-h,s,n,t,u),h=c,++ve),this.elementStart=this.elementSize,this._batchIndexStart=h,this._batchIndexSize=c}_finishBatch(t,e,s,r,n,o,a){t.gpuBindGroup=null,t.action=a,t.batcher=this,t.textures=r,t.blendMode=n,t.start=e,t.size=s,++ve,o.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 Ki(e);Qi(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 r=s>65535?new Uint32Array(s):new Uint16Array(s);if(r.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let n=0;n>16&255,s=i>>8&255,r=i&255,n=t>>16&255,o=t>>8&255,a=t&255,l=e*n/255,c=s*o/255,h=r*a/255;return(l<<16)+(c<<8)+h}hn=class{constructor(){this.batcher=null,this.batch=null,this.applyTransform=!0,this.roundPixels=0}get blendMode(){return this.applyTransform?this.renderable.groupBlendMode:"normal"}packIndex(t,e,s){const r=this.geometryData.indices;for(let n=0;n>16|u&65280|(u&255)<<16;if(this.applyTransform){const p=vl(d,o.groupColor)+(this.alpha*o.groupAlpha*255<<24),m=o.groupTransform,_=r<<16|this.roundPixels&65535,f=m.a,v=m.b,x=m.c,w=m.d,C=m.tx,M=m.ty;for(let E=c;E=0&&a>=0&&r>=0&&n>=0))return t;const l=Math.ceil(2.3*Math.sqrt(o+a)),c=l*8+(r?4:0)+(n?4:0);if(c===0)return t;if(l===0)return t[0]=t[6]=e+r,t[1]=t[3]=s+n,t[2]=t[4]=e-r,t[5]=t[7]=s-n,t;let h=0,u=l*4+(r?2:0)+2,d=u,p=c,m=r+o,_=n,f=e+m,v=e-m,x=s+_;if(t[h++]=f,t[h++]=x,t[--u]=x,t[--u]=v,n){const C=s-_;t[d++]=v,t[d++]=C,t[--p]=C,t[--p]=f}for(let C=1;C0&&(r[n++]=l,r[n++]=c,r[n++]=l-1),l++;r[n++]=c+1,r[n++]=c,r[n++]=l-1}},wl=1e-4,sr=1e-4;function Cl(i){const t=i.length;if(t<6)return 1;let e=0;for(let s=0,r=i[t-2],n=i[t-1];su&&(u+=Math.PI*2);let d=h;const p=u-h,m=Math.abs(p),_=Math.sqrt(l*l+c*c),f=(15*m*Math.sqrt(_)/Math.PI>>0)+1,v=p/f;if(d+=v,a){o.push(i,t),o.push(e,s);for(let x=1,w=d;x=0&&(h.join==="round"?x+=Yt(b,P,b-A*V,P-F*V,b-U*V,P-K*V,f,!1)+4:x+=2,f.push(b-U*G,P-K*G),f.push(b+U*V,P+K*V));continue}const bi=(-A+I)*(-F+P)-(-A+b)*(-F+D),vi=(-U+R)*(-K+P)-(-U+b)*(-K+O),Ue=(Bt*vi-_e*bi)/Oe,ze=(ge*bi-me*vi)/Oe,fs=(Ue-b)*(Ue-b)+(ze-P)*(ze-P),Lt=b+(Ue-b)*V,Ot=P+(ze-P)*V,Ut=b-(Ue-b)*G,zt=P-(ze-P)*G,gn=Math.min(Bt*Bt+me*me,_e*_e+ge*ge),wi=ye?V:G,yn=gn+wi*wi*M;fs<=yn?h.join==="bevel"||fs/M>E?(ye?(f.push(Lt,Ot),f.push(b+A*G,P+F*G),f.push(Lt,Ot),f.push(b+U*G,P+K*G)):(f.push(b-A*V,P-F*V),f.push(Ut,zt),f.push(b-U*V,P-K*V),f.push(Ut,zt)),x+=2):h.join==="round"?ye?(f.push(Lt,Ot),f.push(b+A*G,P+F*G),x+=Yt(b,P,b+A*G,P+F*G,b+U*G,P+K*G,f,!0)+4,f.push(Lt,Ot),f.push(b+U*G,P+K*G)):(f.push(b-A*V,P-F*V),f.push(Ut,zt),x+=Yt(b,P,b-A*V,P-F*V,b-U*V,P-K*V,f,!1)+4,f.push(b-U*V,P-K*V),f.push(Ut,zt)):(f.push(Lt,Ot),f.push(Ut,zt)):(f.push(b-A*V,P-F*V),f.push(b+A*G,P+F*G),h.join==="round"?ye?x+=Yt(b,P,b+A*G,P+F*G,b+U*G,P+K*G,f,!0)+2:x+=Yt(b,P,b-A*V,P-F*V,b-U*V,P-K*V,f,!1)+2:h.join==="miter"&&fs/M<=E&&(ye?(f.push(Ut,zt),f.push(Ut,zt)):(f.push(Lt,Ot),f.push(Lt,Ot)),x+=2),f.push(b-U*V,P-K*V),f.push(b+U*G,P+K*G),x+=2)}I=i[(v-2)*2],D=i[(v-2)*2+1],b=i[(v-1)*2],P=i[(v-1)*2+1],A=-(D-P),F=I-b,wt=Math.sqrt(A*A+F*F),A/=wt,F/=wt,A*=C,F*=C,f.push(b-A*V,P-F*V),f.push(b+A*G,P+F*G),m||(h.cap==="round"?x+=Yt(b-A*(V-G)*.5,P-F*(V-G)*.5,b-A*V,P-F*V,b+A*G,P+F*G,f,!1)+2:h.cap==="square"&&(x+=ir(b,P,A,F,V,G,!1,f)));const _n=sr*sr;for(let X=w;X=0&&o>=0&&(t[0]=s,t[1]=r,t[2]=s+n,t[3]=r,t[4]=s+n,t[5]=r+o,t[6]=s,t[7]=r+o),t},triangulate(i,t,e,s,r,n){let o=0;s*=e,t[s+o]=i[0],t[s+o+1]=i[1],o+=e,t[s+o]=i[2],t[s+o+1]=i[3],o+=e,t[s+o]=i[6],t[s+o+1]=i[7],o+=e,t[s+o]=i[4],t[s+o+1]=i[5],o+=e;const a=s/e;r[n++]=a,r[n++]=a+1,r[n++]=a+2,r[n++]=a+1,r[n++]=a+3,r[n++]=a+2}},Pl={build(i,t){return t[0]=i.x,t[1]=i.y,t[2]=i.x2,t[3]=i.y2,t[4]=i.x3,t[5]=i.y3,t},triangulate(i,t,e,s,r,n){let o=0;s*=e,t[s+o]=i[0],t[s+o+1]=i[1],o+=e,t[s+o]=i[2],t[s+o+1]=i[3],o+=e,t[s+o]=i[4],t[s+o+1]=i[5];const a=s/e;r[n++]=a,r[n++]=a+1,r[n++]=a+2}},mi={rectangle:kl,polygon:Ml,triangle:Pl,circle:Is,ellipse:Is,roundedRectangle:Is},Tl=new ot;function Il(i,t){const{geometryData:e,batches:s}=t;s.length=0,e.indices.length=0,e.vertices.length=0,e.uvs.length=0;for(let r=0;r{const p=l.length,m=o.length/2,_=[],f=mi[h.type];if(f.build(h,_),u&&ln(_,u),s){const C=h.closePath??!0;Al(_,t,!1,C,o,2,m,l)}else if(e&&c===d){c!==0&&console.warn("[Pixi Graphics] only the last shape have be cut out");const C=[],M=_.slice();Rl(e.shapePath).forEach(I=>{C.push(M.length/2),M.push(...I)}),cn(M,C,o,2,m,l,p)}else f.triangulate(_,o,2,m,l,p);const v=a.length/2,x=t.texture;if(x!==W.WHITE){const C=t.matrix;u&&C.append(u.clone().invert()),xl(o,2,m,a,v,2,o.length/2-m,C)}else bl(a,v,2,o.length/2-m);const w=Tt.get(hn);w.indexOffset=p,w.indexSize=l.length-p,w.vertexOffset=m,w.vertexSize=o.length/2-m,w.color=t.color,w.alpha=t.alpha,w.texture=x,w.geometryData=n,r.push(w)})}function Rl(i){if(!i)return[];const t=i.shapePrimitives,e=[];for(let s=0;s{Tt.return(s)})}destroy(){for(const t in this._gpuContextHash)this._gpuContextHash[t]&&this.onGraphicsContextDestroy(this._gpuContextHash[t].context)}};_i.extension={type:[st.WebGLSystem,st.WebGPUSystem,st.CanvasSystem],name:"graphicsContext"};_i.defaultOptions={bezierSmoothness:.5};un=_i;const Fl=8,ss=11920929e-14,Vl=1;function dn(i,t,e,s,r,n,o,a,l,c){const u=Math.min(.99,Math.max(0,c??un.defaultOptions.bezierSmoothness));let d=(Vl-u)/1;return d*=d,$l(t,e,s,r,n,o,a,l,i,d),i}function $l(i,t,e,s,r,n,o,a,l,c){ei(i,t,e,s,r,n,o,a,l,c,0),l.push(o,a)}function ei(i,t,e,s,r,n,o,a,l,c,h){if(h>Fl)return;const u=(i+e)/2,d=(t+s)/2,p=(e+r)/2,m=(s+n)/2,_=(r+o)/2,f=(n+a)/2,v=(u+p)/2,x=(d+m)/2,w=(p+_)/2,C=(m+f)/2,M=(v+w)/2,E=(x+C)/2;if(h>0){let I=o-i,D=a-t;const b=Math.abs((e-o)*D-(s-a)*I),P=Math.abs((r-o)*D-(n-a)*I);if(b>ss&&P>ss){if((b+P)*(b+P)<=c*(I*I+D*D)){l.push(M,E);return}}else if(b>ss){if(b*b<=c*(I*I+D*D)){l.push(M,E);return}}else if(P>ss){if(P*P<=c*(I*I+D*D)){l.push(M,E);return}}else if(I=M-(i+o)/2,D=E-(t+a)/2,I*I+D*D<=c){l.push(M,E);return}}ei(i,t,u,d,v,x,M,E,l,c,h+1),ei(M,E,w,C,_,f,o,a,l,c,h+1)}const Nl=8,Gl=11920929e-14,Ll=1;function Ol(i,t,e,s,r,n,o,a){const c=Math.min(.99,Math.max(0,a??un.defaultOptions.bezierSmoothness));let h=(Ll-c)/1;return h*=h,Ul(t,e,s,r,n,o,i,h),i}function Ul(i,t,e,s,r,n,o,a){si(o,i,t,e,s,r,n,a,0),o.push(r,n)}function si(i,t,e,s,r,n,o,a,l){if(l>Nl)return;const c=(t+s)/2,h=(e+r)/2,u=(s+n)/2,d=(r+o)/2,p=(c+u)/2,m=(h+d)/2;let _=n-t,f=o-e;const v=Math.abs((s-n)*f-(r-o)*_);if(v>Gl){if(v*v<=a*(_*_+f*f)){i.push(p,m);return}}else if(_=p-(t+n)/2,f=m-(e+o)/2,_*_+f*f<=a){i.push(p,m);return}si(i,t,e,c,h,p,m,a,l+1),si(i,p,m,u,d,n,o,a,l+1)}function fn(i,t,e,s,r,n,o,a){let l=Math.abs(r-n);(!o&&r>n||o&&n>r)&&(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 c=l/a,h=r;c*=o?-1:1;for(let u=0;uu*l)}const Pe=Math.PI*2,Es={centerX:0,centerY:0,ang1:0,ang2:0},Rs=({x:i,y:t},e,s,r,n,o,a,l)=>{i*=e,t*=s;const c=r*i-n*t,h=n*i+r*t;return l.x=c+o,l.y=h+a,l};function Hl(i,t){const e=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),s=t===1.5707963267948966?.551915024494:e,r=Math.cos(i),n=Math.sin(i),o=Math.cos(i+t),a=Math.sin(i+t);return[{x:r-n*s,y:n+r*s},{x:o+a*s,y:a-o*s},{x:o,y:a}]}const nr=(i,t,e,s)=>{const r=i*s-t*e<0?-1:1;let n=i*e+t*s;return n>1&&(n=1),n<-1&&(n=-1),r*Math.acos(n)},Yl=(i,t,e,s,r,n,o,a,l,c,h,u,d)=>{const p=Math.pow(r,2),m=Math.pow(n,2),_=Math.pow(h,2),f=Math.pow(u,2);let v=p*m-p*f-m*_;v<0&&(v=0),v/=p*f+m*_,v=Math.sqrt(v)*(o===a?-1:1);const x=v*r/n*u,w=v*-n/r*h,C=c*x-l*w+(i+e)/2,M=l*x+c*w+(t+s)/2,E=(h-x)/r,I=(u-w)/n,D=(-h-x)/r,b=(-u-w)/n,P=nr(1,0,E,I);let R=nr(E,I,D,b);a===0&&R>0&&(R-=Pe),a===1&&R<0&&(R+=Pe),d.centerX=C,d.centerY=M,d.ang1=P,d.ang2=R};function Xl(i,t,e,s,r,n,o,a=0,l=0,c=0){if(n===0||o===0)return;const h=Math.sin(a*Pe/360),u=Math.cos(a*Pe/360),d=u*(t-s)/2+h*(e-r)/2,p=-h*(t-s)/2+u*(e-r)/2;if(d===0&&p===0)return;n=Math.abs(n),o=Math.abs(o);const m=Math.pow(d,2)/Math.pow(n,2)+Math.pow(p,2)/Math.pow(o,2);m>1&&(n*=Math.sqrt(m),o*=Math.sqrt(m)),Yl(t,e,s,r,n,o,l,c,h,u,d,p,Es);let{ang1:_,ang2:f}=Es;const{centerX:v,centerY:x}=Es;let w=Math.abs(f)/(Pe/4);Math.abs(1-w)<1e-7&&(w=1);const C=Math.max(Math.ceil(w),1);f/=C;let M=i[i.length-2],E=i[i.length-1];const I={x:0,y:0};for(let D=0;D{const l=a.x-o.x,c=a.y-o.y,h=Math.sqrt(l*l+c*c),u=l/h,d=c/h;return{len:h,nx:u,ny:d}},r=(o,a)=>{o===0?i.moveTo(a.x,a.y):i.lineTo(a.x,a.y)};let n=t[t.length-1];for(let o=0;o0&&(p=-1,m=!0);const _=d/2;let f,v=Math.abs(Math.cos(_)*l/Math.sin(_));v>Math.min(h.len/2,u.len/2)?(v=Math.min(h.len/2,u.len/2),f=Math.abs(v*Math.sin(_)/Math.cos(_))):f=l;const x=a.x+u.nx*v+-u.ny*f*p,w=a.y+u.ny*v+u.nx*f*p,C=Math.atan2(h.ny,h.nx)+Math.PI/2*p,M=Math.atan2(u.ny,u.nx)-Math.PI/2*p;o===0&&i.moveTo(x+Math.cos(C)*f,w+Math.sin(C)*f),i.arc(x,w,f,C,M,m),n=a}}function ql(i,t,e,s){const r=(a,l)=>Math.sqrt((a.x-l.x)**2+(a.y-l.y)**2),n=(a,l,c)=>({x:a.x+(l.x-a.x)*c,y:a.y+(l.y-a.y)*c}),o=t.length;for(let a=0;a=2;u-=2)h[u]===h[u-2]&&h[u-1]===h[u-3]&&h.splice(u-1,2);return this.poly(h,!0,o)}ellipse(t,e,s,r,n){return this.drawShape(new fi(t,e,s,r),n),this}roundRect(t,e,s,r,n,o){return this.drawShape(new pi(t,e,s,r,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 ke,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 ke,t)){const e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let s=e.shape.x,r=e.shape.y;if(!e.transform.isIdentity()){const n=e.transform,o=s;s=n.a*s+n.c*r+n.tx,r=n.b*o+n.d*r+n.ty}this._currentPoly.points.push(s,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;eparseInt(D,10)),t.context.poly(x,!0),e&&t.context.fill(),s&&t.context.stroke();break;case"polyline":w=i.getAttribute("points"),x=w.match(/\d+/g).map(D=>parseInt(D,10)),t.context.poly(x,!1),s&&t.context.stroke();break;case"g":case"svg":break;default:{console.info(`[SVG parser] <${i.nodeName}> elements unsupported`);break}}for(let D=0;Df.priority!==At.DO_NOT_DOWNLOAD).forEach(f=>d.insert(f.piece_range,f.name));const p=new as;let m="",_=1;for(let f=0;f{t.isActive&&c()}),hs(()=>{n.value&&(o.value=new Promise(async h=>{const u=new en;await u.init({antialias:!0,width:n.value?.width,height:n.value?.height,canvas:n.value}),h(u)}),s.value&&c())}),oi(async()=>{if(!o.value)return;(await o.value).destroy({removeView:!1},{children:!0})}),(h,u)=>(T(),N("canvas",{ref_key:"canvas",ref:n,width:"4096",height:"20"},null,512))}});ih=ls(sh,[["__scopeId","data-v-212dd1f4"]]);rh=["href"];nh={key:1};oh={class:"my-1"};ah={class:"mr-2"};lh={key:0};hh={key:2};ch={key:0};uh={key:1};dh={key:2};fh={key:0};ph={key:0,class:"d-flex flex-wrap flex-gap-row-small flex-gap-column"};mh=lt({__name:"Overview",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{t:e}=ie(),{cachedFiles:s}=dt(Ne()),r=hr(),{properties:n}=dt(Dt()),o=te(),a=Y(()=>s.value.filter(b=>b.priority!==At.DO_NOT_DOWNLOAD)),l=Y(()=>s.value.length),c=Y(()=>a.value.length===1?a.value[0].name:""),h=Y(()=>n.value?.comment??""),u=Y(()=>n.value?.dl_speed_avg??0),d=Y(()=>n.value?.piece_size??0),p=Y(()=>n.value?.pieces_have??0),m=Y(()=>n.value?.pieces_num??0),_=Y(()=>n.value?.up_speed_avg??0),f=Y(()=>`torrent-${t.torrent.state}`),v=Y(()=>`${parseInt(Tn(d.value,!0))} ${In(d.value,!0)}`),x=Y(()=>[Ci.META_DL,Ci.FORCED_META_DL].includes(t.torrent.state)),w=Y(()=>o.enableRatioColors?En(t.torrent.ratio):""),C=Y(()=>!o.hideColoredChip);async function M(){try{await navigator.clipboard.writeText(t.torrent.hash)}catch{Pi.error(e("toast.copy.error"));return}Pi.success(e("toast.copy.success"))}function E(b){r.createDialog(xn,{hashes:[t.torrent.hash],mode:b})}function I(){r.createDialog(ro,{hash:t.torrent.hash,isFolder:!1,oldName:c.value})}function D(b){if(r.hasActiveDialog||!t.isActive)return!1;if(b.key==="d")return b.preventDefault(),E("dl"),!0;if(b.key==="s")return b.preventDefault(),E("save"),!0;if(b.key==="f"&&a.value.length===1)return b.preventDefault(),I(),!0;if(b.key==="Delete")return b.preventDefault(),r.createDialog(Vn,{hashes:[t.torrent.hash]}),!0}return hs(()=>{document.addEventListener("keydown",D)}),oi(async()=>{document.removeEventListener("keydown",D)}),(b,P)=>b.torrent?(T(),$(Kt,{key:0},{default:y(()=>[g(Fs,{class:"text-wrap"},{default:y(()=>[L(k(b.torrent.name),1)]),_:1}),g(Bn,null,{default:y(()=>[B("div",null,[(T(!0),N(ft,null,bt(S(Dn)(h.value),R=>(T(),N("span",null,[S(Rn)(R)?(T(),N("a",{key:0,target:"_blank",href:R},k(R),9,rh)):(T(),N("span",nh,k(R),1))]))),256))]),B("div",oh,[B("span",ah,k(b.torrent.hash),1),g(et,{variant:"outlined",rounded:"",onClick:M},{default:y(()=>[L(k(b.$t("torrentDetail.overview.copy_hash")),1)]),_:1})])]),_:1}),g(Ie,null,{default:y(()=>[g(Q,null,{default:y(()=>[g(q,{cols:"12",md:"6"},{default:y(()=>[g(Q,null,{default:y(()=>[g(q,{cols:"4"},{default:y(()=>[g(Fn,{color:f.value,indeterminate:x.value,size:100,"model-value":b.torrent?.progress*100||0,width:15},{default:y(()=>[x.value?(T(),N("span",lh,k(b.$t("torrentDetail.overview.fetchingMetadata")),1)):b.torrent.progress===1?(T(),$(ht,{key:1,icon:"mdi-check",size:"x-large"})):(T(),N("span",hh,k(S(Vs)(b.torrent.progress)),1))]),_:1},8,["color","indeterminate","model-value"])]),_:1}),g(q,{cols:"8",class:"d-flex flex-column align-center justify-center"},{default:y(()=>[x.value?(T(),N("div",ch,[B("span",null,k(b.$t("torrentDetail.overview.waitingForMetadata")),1)])):(T(),N("div",uh,[g(ih,{torrent:b.torrent,isActive:b.isActive},null,8,["torrent","isActive"])])),m.value>0?(T(),N("div",dh,[B("span",null,k(S(e)("torrentDetail.overview.pieceCount",{owned:p.value,total:m.value,pieceSize:v.value})),1)])):_t("",!0),B("div",null,[g(ht,{icon:"mdi-arrow-down"}),L(" "+k(S(Zt)(b.torrent.dlspeed,S(o).useBitSpeed))+" ",1),g(ht,{icon:"mdi-arrow-up"}),L(" "+k(S(Zt)(b.torrent.upspeed,S(o).useBitSpeed)),1)])]),_:1})]),_:1}),g(Q,null,{default:y(()=>[g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrent.properties.download_path"))+":",1),B("div",null,k(b.torrent.download_path),1),g(et,{icon:"mdi-pencil",color:"accent",size:"x-small",onClick:P[0]||(P[0]=R=>E("dl"))})]),_:1}),g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrentDetail.overview.fileCount"))+":",1),B("div",null,k(a.value.length)+" / "+k(l.value),1),a.value.length===1?(T(),N("div",fh,k(c.value),1)):_t("",!0),a.value.length===1?(T(),$(et,{key:1,icon:"mdi-pencil",color:"accent",size:"x-small",onClick:I})):_t("",!0)]),_:1})]),_:1}),g(Q,null,{default:y(()=>[g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrent.properties.save_path"))+":",1),B("div",null,k(b.torrent.savePath),1),g(et,{icon:"mdi-pencil",color:"accent",size:"x-small",onClick:P[1]||(P[1]=R=>E("save"))})]),_:1}),g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrent.properties.content_path"))+":",1),B("div",null,k(b.torrent.content_path),1)]),_:1})]),_:1})]),_:1}),g(q,{cols:"12",md:"6"},{default:y(()=>[g(Q,null,{default:y(()=>[g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrent.properties.state"))+":",1),g(Ds,{variant:C.value?"flat":"text",color:f.value},{default:y(()=>[L(k(b.$t(`torrent.state.${b.torrent.state}`)),1)]),_:1},8,["variant","color"])]),_:1}),g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrent.properties.category"))+":",1),g(is,{"default-color":"category",disabled:!b.torrent.category.length,"disabled-value":b.$t("navbar.side.filters.uncategorized"),value:b.torrent.category},null,8,["disabled","disabled-value","value"])]),_:1})]),_:1}),g(Q,null,{default:y(()=>[g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrent.properties.tracker"))+":",1),g(is,{"default-color":"tracker","disabled-value":b.$t("navbar.side.filters.untracked"),value:b.torrent.tracker_domain},null,8,["disabled-value","value"])]),_:1}),g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrent.properties.tags"))+":",1),b.torrent.tags.length?(T(),N("div",ph,[(T(!0),N(ft,null,bt(b.torrent.tags,R=>(T(),$(is,{"default-color":"tag",value:R},null,8,["value"]))),256))])):(T(),$(Ds,{key:1,variant:C.value?"flat":"text",color:"tag"},{default:y(()=>[L(k(b.$t("navbar.side.filters.untagged")),1)]),_:1},8,["variant"]))]),_:1})]),_:1}),g(Q,null,{default:y(()=>[g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrentDetail.overview.selectedFileSize"))+":",1),B("div",null,k(S(Vt)(b.torrent.size,S(o).useBinarySize))+" / "+k(S(Vt)(b.torrent.total_size,S(o).useBinarySize)),1)]),_:1}),g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrentDetail.overview.ratio"))+":",1),B("div",{class:Ee(w.value)},k(b.torrent.ratio),3)]),_:1})]),_:1}),g(Q,null,{default:y(()=>[g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrentDetail.overview.downloaded"))+":",1),B("div",null,k(S(Vt)(b.torrent.downloaded,S(o).useBinarySize)),1)]),_:1}),g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrentDetail.overview.uploaded"))+":",1),B("div",null,k(S(Vt)(b.torrent.uploaded,S(o).useBinarySize)),1)]),_:1})]),_:1}),g(Q,null,{default:y(()=>[g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrentDetail.overview.dlSpeedAverage"))+":",1),B("div",null,k(S(Zt)(u.value,S(o).useBitSpeed)),1)]),_:1}),g(q,{cols:"6"},{default:y(()=>[B("div",null,k(b.$t("torrentDetail.overview.upSpeedAverage"))+":",1),B("div",null,k(S(Zt)(_.value,S(o).useBitSpeed)),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):_t("",!0)}});_h={class:"text-grey"};gh={key:0};yh={key:1};xh={key:0};bh={key:2,class:"text-grey"};vh=["title"];wh=["alt","src","title"];Ch=["title"];Ah=["title"];Sh={key:1};Mh={class:"text-download"};kh={class:"text-upload"};Ph={class:"d-flex my-3 flex-gap align-center justify-center"};Th=lt({__name:"Peers",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{t:e}=ie(),s=Ge(),r=$n(),n=te();function o(R,O){const A=R.ip.split(".").map(Number),F=O.ip.split(".").map(Number);for(let U=0;U<4;U++)if(A[U]!==F[U])return A[U]-F[U];return R.port-O.port}function a(R,O){return R.country&&!O.country?-1:!R.country&&O.country?1:R.country===O.country?o(R,O):R.country.localeCompare(O.country)}const l=jn([{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"}]),c=Zn([{key:"dl_speed",order:"desc"},{key:"up_speed",order:"desc"}]),h=ct(!1),u=ct(),d=ct(new Map),p=ct(!1),m=ct(""),_=ct(!1),f=ct(""),v=Y(()=>Array.from(d.value.entries()).map(([R,O])=>({...O,host:R})));function x(R){Object.entries(R).forEach(([O,A])=>{const F=d.value.get(O);d.value.set(O,{...F,...A})})}function w(R){R.forEach(O=>d.value.delete(O))}async function C(){h.value=!0;const R=await s.syncTorrentPeers(t.torrent.hash,u.value);u.value=R.rid,p.value=R.show_flags??p.value,R.full_update?d.value=new Map(Object.entries(R.peers)):(R.peers_removed&&w(R.peers_removed),R.peers&&x(R.peers)),h.value=!1}async function M(){f.value.length&&(await s.addTorrentPeers(t.torrent.hash,f.value.split(` `)),P(),E())}function E(){_.value=!1,f.value=""}async function I(R){await s.banPeers([R.host]),await r.fetchPreferences(),P()}const{isActive:D,pause:b,resume:P}=Nn(C,2e3,{immediate:!0,immediateCallback:!0});return Le(()=>t.isActive,R=>{R?P():b()}),Kn(()=>!_.value),(R,O)=>(T(),$(Kt,null,{default:y(()=>[d.value.size?(T(),$(Ln,{key:1,headers:S(l),items:v.value,"multi-sort":"","sort-by":S(c),search:m.value,"filter-keys":["host","client","files"],mobile:null},{top:y(()=>[g(rs,{modelValue:m.value,"onUpdate:modelValue":O[0]||(O[0]=A=>m.value=A),class:"ma-3",density:"compact",label:R.$t("common.search"),"prepend-inner-icon":"mdi-magnify",flat:"","hide-details":"","single-line":"",clearable:""},null,8,["modelValue","label"])]),"item.host":y(({item:A})=>[L(k(A.ip),1),B("span",_h,":"+k(A.port),1)]),"item.client":y(({item:A})=>[A.connection?(T(),N("span",gh,"["+k(A.connection)+"]\xa0",1)):_t("",!0),A.client?(T(),N("span",yh,[L(k(A.client)+" ",1),A.peer_id_client?(T(),N("span",xh,"("+k(A.peer_id_client)+")",1)):_t("",!0)])):(T(),N("span",bh,"?????"))]),"item.actions":y(({item:A})=>[g(et,{color:"red",icon:"mdi-cancel",variant:"text",onClick:F=>I(A)},null,8,["onClick"])]),"item.country":y(({item:A})=>[p.value?(T(),N("div",{key:0,class:"cursor-help",title:A.country},[S(On)?(T(),N("img",{key:0,alt:S(ms)(A.country_code).char,src:S(ms)(A.country_code).url,title:A.country,style:{"max-width":"32px"}},null,8,wh)):(T(),N("span",{key:1,title:A.country},k(S(ms)(A.country_code).char),9,Ch))],8,vh)):_t("",!0)]),"item.flags":y(({item:A})=>[A.flags?(T(),N("div",{key:0,class:"cursor-help",title:A.flags_desc},k(A.flags),9,Ah)):(T(),N("div",Sh,k(R.$t("common.none")),1))]),"item.dl_speed":y(({item:A})=>[B("span",Mh,k(S(Zt)(A.dl_speed,S(n).useBitSpeed))+" ("+k(S(Vt)(A.downloaded,S(n).useBinarySize))+") ",1)]),"item.up_speed":y(({item:A})=>[B("span",kh,k(S(Zt)(A.up_speed,S(n).useBitSpeed))+" ("+k(S(Vt)(A.uploaded,S(n).useBinarySize))+") ",1)]),"item.progress":y(({item:A})=>[g(lr,{"model-value":A.progress,max:1,height:20,rounded:"sm",style:{width:"8em"},color:A.progress===1?"torrent-stalledUP":"torrent-downloading"},{default:y(()=>[L(k(S(Vs)(A.progress)),1)]),_:2},1032,["model-value","color"])]),"item.relevance":y(({item:A})=>[L(k(S(Vs)(A.relevance)),1)]),_:2},1032,["headers","items","sort-by","search"])):(T(),$(Gn,{key:0,title:R.$t("torrentDetail.peers.empty"),icon:"mdi-account-sync",color:"accent"},null,8,["title"])),B("div",Ph,[S(D)?(T(),$(et,{key:0,"prepend-icon":"mdi-pause",color:"primary",text:R.$t("common.pause"),onClick:O[1]||(O[1]=A=>S(b)())},null,8,["text"])):(T(),$(et,{key:1,"prepend-icon":"mdi-play",color:"primary",text:R.$t("common.resume"),onClick:O[2]||(O[2]=A=>S(P)())},null,8,["text"])),g(Ns,{modelValue:_.value,"onUpdate:modelValue":O[4]||(O[4]=A=>_.value=A),"max-width":"750px"},{activator:y(({props:A})=>[g(et,Ls(A,{variant:"flat",text:S(e)("torrentDetail.peers.addPeers.title"),color:"accent"}),null,16,["text"])]),default:y(()=>[g(Kt,{title:R.$t("torrentDetail.peers.addPeers.title")},{default:y(()=>[g(Ie,null,{default:y(()=>[g(cr,{modelValue:f.value,"onUpdate:modelValue":O[3]||(O[3]=A=>f.value=A),label:S(e)("torrentDetail.peers.addPeers.newPeers"),placeholder:S(e)("torrentDetail.peers.addPeers.newPeersPlaceholder"),hint:S(e)("torrentDetail.peers.addPeers.newPeersHint")},null,8,["modelValue","label","placeholder","hint"])]),_:1}),g($s,null,{default:y(()=>[g(ue),g(et,{color:"error",onClick:E},{default:y(()=>[L(k(S(e)("common.cancel")),1)]),_:1}),g(et,{color:"accent",onClick:M},{default:y(()=>[L(k(S(e)("common.ok")),1)]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"])])]),_:1}))}});Ih=lt({__name:"TagsAndCategories",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,e=Ge(),s=ri();async function r(o){t.torrent.category===o?await s.setTorrentCategory([t.torrent.hash],""):await s.setTorrentCategory([t.torrent.hash],o)}async function n(o){t.torrent.tags?.includes(o)?await s.removeTorrentTags([t.torrent.hash],[o]):await s.addTorrentTags([t.torrent.hash],[o])}return mr(async()=>{await e.fetchCategories(),await e.fetchTags()}),(o,a)=>(T(),$(Kt,null,{default:y(()=>[g(Ie,null,{default:y(()=>[g(Q,null,{default:y(()=>[g(q,{cols:"12",md:"6"},{default:y(()=>[g(Te,null,{default:y(()=>[g(Ai,null,{default:y(()=>[L(k(o.$t("torrentDetail.tagsAndCategories.tags")),1)]),_:1}),(T(!0),N(ft,null,bt(S(e).tags,l=>(T(),$(Qt,{variant:"text",color:"accent",title:l,active:o.torrent.tags?.includes(l),onClick:c=>n(l)},null,8,["title","active","onClick"]))),256))]),_:1})]),_:1}),g(q,{cols:"12",md:"6"},{default:y(()=>[g(Te,null,{default:y(()=>[g(Ai,null,{default:y(()=>[L(k(o.$t("torrentDetail.tagsAndCategories.categories")),1)]),_:1}),(T(!0),N(ft,null,bt(S(e).categories,l=>(T(),$(Qt,{variant:"text",color:"accent",title:l.name,active:l.name===t.torrent.category,onClick:c=>r(l.name)},null,8,["title","active","onClick"]))),256))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))}});Eh={class:"d-flex"};Rh={key:0};Dh={key:1};Bh={key:2};Fh={key:3};Vh={key:0,class:"d-flex flex-column"};$h={class:"text-h5"};Nh={class:"text-h5"};Gh=lt({__name:"Trackers",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{t:e}=ie(),s=Ge();function r(M){switch(M){case Ft.DISABLED:return e("constants.trackerStatus.disabled");case Ft.NOT_YET_CONTACTED:return e("constants.trackerStatus.not_yet_contacted");case Ft.WORKING:return e("constants.trackerStatus.working");case Ft.UPDATING:return e("constants.trackerStatus.updating");case Ft.NOT_WORKING:return e("constants.trackerStatus.not_working");default:return""}}function n(M){return typeof M=="number"?M===-1?"N/A":M.valueOf():!M||M.num_peers===-1||M?.num_seeds===-1||M?.num_leeches===-1?"N/A":e("torrentDetail.trackers.peersValue",{peers:M.num_peers,seeds:M.num_seeds,leeches:M.num_leeches})}const o=ct(!1),a=ct([]),l=ct(""),c=ct(null),h=ct(!1),u=[M=>!!M||e("torrentDetail.trackers.editTracker.newUrlRequired")],d=Qn({isVisible:!1,isFormValid:!1,oldUrl:"",newUrl:""});function p(M){d.isVisible=!0,d.oldUrl=M.url,d.newUrl=M.url,fr(()=>{document.getElementById("input")?.select()})}async function m(){o.value=!0,a.value=(await s.getTorrentTrackers(t.torrent.hash)).map(M=>({...M,isSelectable:M.tier!==-1})),o.value=!1}async function _(){l.value.length&&(await s.addTorrentTrackers(t.torrent.hash,l.value),await m(),f())}function f(){h.value=!1,l.value=""}async function v(){d.isFormValid&&(await s.editTorrentTracker(t.torrent.hash,d.oldUrl,d.newUrl),d.isVisible=!1,await m())}async function x(M){await s.removeTorrentTrackers(t.torrent.hash,[M.url]),await m()}async function w(){await s.reannounceTorrents([t.torrent.hash])}async function C(M){M??t.isActive?(await m(),c.value=setInterval(m,5e3)):(clearInterval(c.value),c.value=null)}return mr(C),oi(()=>C(!1)),Le(()=>t.isActive,C),(M,E)=>(T(),$(Te,null,{default:y(()=>[(T(!0),N(ft,null,bt(a.value,(I,D)=>(T(),N(ft,null,[D===3?(T(),$(Si,{key:0,color:"white",thickness:"5"})):D>0?(T(),$(Si,{key:1,class:"mx-5",color:"white"})):_t("",!0),g(Qt,null,{default:y(()=>[B("div",Eh,[B("div",{class:Ee(`tracker-${S(Ft)[I.status].toLowerCase()}`)},[g(Un,{class:"text-break text-wrap"},{default:y(()=>[L(k(I.url),1)]),_:2},1024),g(Bs,{class:"d-block"},{default:y(()=>[I.msg?(T(),N("div",Rh,k(I.msg),1)):(T(),N("div",Dh,k(r(I.status)),1)),I.tier>=0?(T(),N("div",Bh,k(S(e)("torrentDetail.trackers.tier",I.tier)),1)):_t("",!0),I.status!==S(Ft).NOT_WORKING?(T(),N("div",Fh,[B("div",null,k(n(I)),1),B("div",null,"Downloads: "+k(n(I.num_downloaded)),1)])):_t("",!0)]),_:2},1024)],2),g(ue),I.tier>=0?(T(),N("div",Vh,[g(Ns,{modelValue:d.isVisible,"onUpdate:modelValue":E[4]||(E[4]=b=>d.isVisible=b),"max-width":"750px"},{activator:y(({props:b})=>[g(et,Ls({ref_for:!0},b,{icon:"mdi-pencil",variant:"text",onClick:P=>p(I)}),null,16,["onClick"])]),default:y(()=>[g(Kt,null,{default:y(()=>[g(Fs,null,{default:y(()=>[B("span",$h,k(S(e)("torrentDetail.trackers.editTracker.title")),1)]),_:1}),g(Ie,null,{default:y(()=>[g(S(zn),{modelValue:d.isFormValid,"onUpdate:modelValue":E[1]||(E[1]=b=>d.isFormValid=b),onSubmit:E[2]||(E[2]=Gs(()=>{},["prevent"]))},{default:y(()=>[g(S(rs),{"model-value":d.oldUrl,disabled:"",label:M.$t("torrentDetail.trackers.editTracker.oldUrl")},null,8,["model-value","label"]),g(S(rs),{modelValue:d.newUrl,"onUpdate:modelValue":E[0]||(E[0]=b=>d.newUrl=b),id:"input",rules:u,label:M.$t("torrentDetail.trackers.editTracker.newUrl"),autofocus:"",onKeydown:Jn(v,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),g($s,null,{default:y(()=>[g(ue),g(et,{color:"error",disabled:!d.isFormValid,onClick:E[3]||(E[3]=b=>d.isVisible=!1)},{default:y(()=>[L(k(S(e)("common.cancel")),1)]),_:1},8,["disabled"]),g(et,{color:"accent",onClick:v},{default:y(()=>[L(k(S(e)("common.ok")),1)]),_:1})]),_:1})]),_:1})]),_:2},1032,["modelValue"]),g(et,{color:"red",icon:"mdi-delete",variant:"text",onClick:b=>x(I)},null,8,["onClick"])])):_t("",!0)])]),_:2},1024)],64))),256)),g(Qt,null,{default:y(()=>[B("div",{class:Ee(["d-flex py-5",M.$vuetify.display.mobile?"flex-column flex-gap-row":"justify-space-evenly"])},[g(Ns,{modelValue:h.value,"onUpdate:modelValue":E[6]||(E[6]=I=>h.value=I),"max-width":"750px"},{activator:y(({props:I})=>[g(et,Ls(I,{variant:"flat",text:S(e)("torrentDetail.trackers.addTrackers.title"),color:"accent"}),null,16,["text"])]),default:y(()=>[g(Kt,null,{default:y(()=>[g(Fs,null,{default:y(()=>[B("span",Nh,k(S(e)("torrentDetail.trackers.addTrackers.title")),1)]),_:1}),g(Ie,null,{default:y(()=>[g(Hn,null,{default:y(()=>[g(Q,null,{default:y(()=>[g(q,{cols:"12"},{default:y(()=>[g(cr,{modelValue:l.value,"onUpdate:modelValue":E[5]||(E[5]=I=>l.value=I),label:S(e)("torrentDetail.trackers.addTrackers.newTrackers"),hint:S(e)("torrentDetail.trackers.addTrackers.newTrackersHint")},null,8,["modelValue","label","hint"])]),_:1})]),_:1})]),_:1})]),_:1}),g($s,null,{default:y(()=>[g(ue),g(et,{color:"error",onClick:f},{default:y(()=>[L(k(S(e)("common.cancel")),1)]),_:1}),g(et,{color:"accent",onClick:_},{default:y(()=>[L(k(S(e)("common.ok")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(et,{variant:"flat",disabled:a.value.length===3,text:S(e)("torrentDetail.trackers.reannounce"),color:"primary",onClick:w},null,8,["disabled","text"])],2)]),_:1})]),_:1}))}});Lh=ls(Gh,[["__scopeId","data-v-12f0128d"]]);Oh={class:"pa-3 text-select"};Uh={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"};zh={class:"d-flex justify-end"};Hh=lt({__name:"TorrentDetail",setup(i){const t=to(),{t:e}=ie(),s=Ne(),r=hr(),n=ri(),o=Dt(),a=[{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"}],l=ct("overview"),c=Y(()=>t.currentRoute.value.params.hash),h=Y(()=>n.getTorrentByHash(c.value)),u=()=>{t.push({name:"dashboard"})};function d(m){if(r.hasActiveDialog)return!1;m.key==="Escape"&&u()}function p(){const m=t.currentRoute.value.params.tab;m&&(l.value=m)}return eo(()=>{p()}),Le(h,()=>{o.fetchProperties(c.value)}),hs(()=>{document.addEventListener("keydown",d),p(),o.fetchProperties(c.value),s.updateFileTree()}),dr(()=>{document.removeEventListener("keydown",d),o.$reset()}),(m,_)=>(T(),N(ft,null,[B("div",Oh,[g(Q,{"no-gutters":"",align:"center",justify:"center"},{default:y(()=>[g(q,null,{default:y(()=>[B("h1",Uh,k(S(e)("torrentDetail.title")),1)]),_:1}),g(q,null,{default:y(()=>[B("div",zh,[g(et,{icon:"mdi-close",variant:"plain",onClick:u})])]),_:1})]),_:1}),g(Q,{class:"ma-0 pa-0"},{default:y(()=>[g(Xn,{modelValue:l.value,"onUpdate:modelValue":_[0]||(_[0]=f=>l.value=f),"bg-color":"primary",grow:"","show-arrows":""},{default:y(()=>[(T(),N(ft,null,bt(a,({text:f,value:v})=>g(Wn,{value:v,href:`#/torrent/${c.value}/${v}`,text:f},null,8,["value","href","text"])),64))]),_:1},8,["modelValue"])]),_:1}),h.value?(T(),$(Yn,{key:0,modelValue:l.value,"onUpdate:modelValue":_[1]||(_[1]=f=>l.value=f),touch:!1},{default:y(()=>[g(oe,{value:"overview"},{default:y(()=>[g(mh,{torrent:h.value,"is-active":l.value==="overview"},null,8,["torrent","is-active"])]),_:1}),g(oe,{value:"info"},{default:y(()=>[g(Mo,{torrent:h.value,"is-active":l.value==="info"},null,8,["torrent","is-active"])]),_:1}),g(oe,{value:"trackers"},{default:y(()=>[g(Lh,{torrent:h.value,"is-active":l.value==="trackers"},null,8,["torrent","is-active"])]),_:1}),g(oe,{value:"peers"},{default:y(()=>[g(Th,{torrent:h.value,"is-active":l.value==="peers"},null,8,["torrent","is-active"])]),_:1}),g(oe,{value:"content"},{default:y(()=>[g(S(fo),{torrent:h.value,"is-active":l.value==="content"},null,8,["torrent","is-active"])]),_:1}),g(oe,{value:"tagsAndCategories"},{default:y(()=>[g(Ih,{torrent:h.value,"is-active":l.value==="tagsAndCategories"},null,8,["torrent","is-active"])]),_:1})]),_:1},8,["modelValue"])):_t("",!0)]),B("div",{style:ur(`position: absolute; left: ${S(s).rightClickProperties.offset[0]}px; top: ${S(s).rightClickProperties.offset[1]}px;`)},[g(S(bn),{modelValue:S(s).rightClickProperties.isVisible,"onUpdate:modelValue":_[2]||(_[2]=f=>S(s).rightClickProperties.isVisible=f),"menu-data":S(s).menuData},null,8,["modelValue","menu-data"])],4)],64))}});ec=Object.freeze(Object.defineProperty({__proto__:null,default:Hh},Symbol.toStringTag,{value:"Module"}))});export{Ur as $,Jr as A,mt as B,pt as C,$t as D,st as E,Oi as F,da as G,Ss as H,xt as I,Tr as J,tt as K,J as L,H as M,cl as N,fe as O,ut as P,ae as Q,ot as R,gl as S,qe as T,Ws as U,Ce as V,Jl as W,th as X,ci as Y,he as Z,hn as _,Nt as a,De as a0,Wi as a1,as as a2,Oo as a3,un as a4,ec as a5,$e as b,Ta as c,Zr as d,re as e,Qi as f,pl as g,Gr as h,Gt as i,W as j,Pa as k,Lo as l,rn as m,tc as n,yl as o,fl as p,Tt as q,Qo as r,kr as s,Rt as t,at as u,Re as v,Et as w,Ea as x,ja as y,Hi as z,__tla};