mirror of
https://github.com/SoPat712/dotfiles.git
synced 2025-08-21 18:38:46 -04:00
13 lines
213 KiB
JavaScript
13 lines
213 KiB
JavaScript
function __vite__mapDeps(indexes) {
|
|
if (!__vite__mapDeps.viteFileDeps) {
|
|
__vite__mapDeps.viteFileDeps = ["./browserAll-BT1z9cKE.js","./webworkerAll-DPPv9Ibl.js","./colorToUniform-Bf80N278.js","./CanvasPool-E3p4G6BL.js","./batchSamplersUniformGroup-CKEGmRNN.js","./MoveTorrentDialog.vue_vue_type_script_setup_true_lang-Cz5dpnUF.js","./index-CfNDsQKB.js","./vue--7UcA1iU.js","./vuetify-GhifFkZ7.js","./index-DG91Wfig.css","./FileIcon-DH65fwz5.js","./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-BvP4_KF0.js","./WebGPURenderer-Du7v9tBH.js","./SharedSystems-DuYq6R0P.js","./WebGLRenderer-BJRUYaxc.js"]
|
|
}
|
|
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
}
|
|
import{a as _n,_ as gn,__tla as __tla_0}from"./MoveTorrentDialog.vue_vue_type_script_setup_true_lang-Cz5dpnUF.js";import{b as Le,E as _e,k as st,h as Kt,aY as At,aP as yn,aW as xn,X as Nt,C as te,f as Ds,aZ as bn,V as ce,am as vn,t as z,Z as Oe,$ as si,a_ as Bt,s as K,a1 as re,Q as ee,O as se,aN as wn,R as An,I as de,J as kt,a3 as is,aK as ae,aU as Zt,N as Cn,a$ as rs,m as or,c as ns,b0 as Sn,b1 as Mn,i as nt,p as Pn,b2 as kn,aO as Rs,b3 as Tn,d as De,aL as In,aM as En,b4 as wi,aJ as Dn,a4 as Rn,K as Bs,a2 as ar,b5 as Bn,b6 as ps,j as Fs,o as lr,ag as hr,g as Vs,b7 as Ai,ac as Ci,e as Fn,az as Vn,U as Nn,W as $n,aA as ne,__tla as __tla_1}from"./index-CfNDsQKB.js";import{g as ct,G as ge,c as W,I as k,W as G,X as I,N as Ns,J as $,K as x,L as V,M as S,O as ht,u as M,V as Re,m as g,Y as ur,a1 as mt,d as pt,Q as Gn,A as cr,a7 as Si,a0 as _t,F as lt,R as dr,D as ii,s as Mi,w as ls,x as ri,$ as hs,U as Pi,H as ni,n as $s,r as Ln,P as On,a as Un,q as zn,T as Yn}from"./vue--7UcA1iU.js";import{g as Hn}from"./FileIcon-DH65fwz5.js";import{u as fr,a as Xn}from"./vuetify-GhifFkZ7.js";import{_ as Wn,__tla as __tla_2}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-BvP4_KF0.js";let Gr,Zr,ft,dt,Qt,tt,zo,sa,Cs,xt,Mr,J,Q,tn,Ja,pe,ut,oe,ot,ol,je,Hs,Me,zl,Yl,hi,he,on,$t,Fe,Hi,as,Io,ln,Lh,Ge,ya,Wr,ie,Zi,il,Vr,Gt,O,Y,To,al,Gh,sl,St,Cr,Oo,Rt,Be,at,ba,Dt,$a,cl,Ui;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})()]).then(async()=>{var ss=(i=>(i[i.MISSING=0]="MISSING",i[i.DOWNLOADING=1]="DOWNLOADING",i[i.DOWNLOADED=2]="DOWNLOADED",i))(ss||{}),Vt=(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))(Vt||{});const qn={class:"d-flex"},jn={class:"d-flex flex-column overflow-hidden text-no-wrap mr-3"},Zn={class:"text-grey"},Kn={class:"d-flex align-center"},ki="#ffe476",Qn=ct({__name:"ContentNode",props:{node:{},openedItems:{}},emits:["setFilePrio","onRightClick"],setup(i,{emit:t}){const e=i,s=t,{t:r}=ge(),{mobile:n}=fr(),o=Le(),a=_e(),l=W(()=>{if(e.node.fullName==="")return 0;const _=e.node.fullName.split("/").length,d=n.value?12:24;return _*d});function u(_,d){if(d.type==="file")return;_.stopPropagation();const b=e.openedItems.indexOf(d.fullName);b===-1?e.openedItems.push(d.fullName):e.openedItems.splice(b,1)}async function h(_){_.getPriority()===At.DO_NOT_DOWNLOAD?s("setFilePrio",_.getChildrenIds(),At.NORMAL):s("setFilePrio",_.getChildrenIds(),At.DO_NOT_DOWNLOAD)}function c(_,d){xn(_)?o.internalSelection.has(d.fullName)?o.internalSelection.delete(d.fullName):o.internalSelection.add(d.fullName):o.internalSelection=new Set([d.fullName])}function f(_){return _.getPriority()===At.DO_NOT_DOWNLOAD?"grey":_.getProgress()===1?"green":""}function m(_){const[d,b]=_.getDeepCount(),y=[];return d>1&&y.push(r("torrentDetail.content.folderInfo",d-1)),b>0&&y.push(r("torrentDetail.content.fileInfo",b)),y.join(", ")}function p(_){const d=[Nt(_.getSize(),a.useBinarySize)];return _.type==="folder"&&d.push(m(_)),d.join(" | ")}return(_,d)=>(k(),G("div",{class:Re(["d-flex flex-column py-2 pr-3",_.node.isSelected(M(o).internalSelection)?"selected":""]),style:ur(`padding-left: ${l.value}px`),onClick:d[2]||(d[2]=Ns(b=>c(b,_.node),["stop"])),onContextmenu:d[3]||(d[3]=b=>_.$emit("onRightClick",b,_.node))},[I("div",qn,[I("div",{class:"d-flex align-center",onClick:d[0]||(d[0]=Ns(b=>h(_.node),["stop"]))},[_.node.isWanted()===null?(k(),$(st,{key:0,color:f(_.node),icon:"mdi-checkbox-intermediate-variant"},null,8,["color"])):_.node.isWanted()?(k(),$(st,{key:1,color:f(_.node),icon:"mdi-checkbox-marked"},null,8,["color"])):(k(),$(st,{key:2,color:f(_.node),icon:"mdi-checkbox-blank-outline"},null,8,["color"]))]),I("div",{class:"d-flex align-center spacer",onClick:d[1]||(d[1]=b=>u(b,_.node))},[_.node.type==="folder"?(k(),$(st,{key:0},{default:x(()=>[V(S(_.openedItems.includes(_.node.fullName)?"mdi-chevron-up":"mdi-chevron-down"),1)]),_:1})):ht("",!0),_.node.fullName===""?(k(),$(st,{key:1,icon:"mdi-file-tree"})):_.node.type==="file"?(k(),$(st,{key:2,icon:M(Hn)(_.node.name)},null,8,["icon"])):_.openedItems.includes(_.node.fullName)?(k(),$(st,{key:3,icon:"mdi-folder-open",color:ki})):(k(),$(st,{key:4,icon:"mdi-folder",color:ki}))]),I("div",jn,[I("div",{class:Re(`text-${f(_.node)}`)},S(_.node.name),3),I("div",Zn,S(p(_.node)),1)]),g(Kt),I("div",Kn,[_.node.getPriority()===M(At).MAXIMAL?(k(),$(st,{key:0,color:"error"},{default:x(()=>[V("mdi-arrow-up")]),_:1})):_.node.getPriority()===M(At).HIGH?(k(),$(st,{key:1,color:"warning"},{default:x(()=>[V("mdi-arrow-top-right")]),_:1})):_.node.getPriority()===M(At).NORMAL?(k(),$(st,{key:2},{default:x(()=>[V("mdi-minus")]),_:1})):_.node.getPriority()===M(At).MIXED?(k(),$(st,{key:3},{default:x(()=>[V("mdi-tilde")]),_:1})):_.node.getPriority()===M(At).DO_NOT_DOWNLOAD?(k(),$(st,{key:4,color:"grey"},{default:x(()=>[V("mdi-cancel")]),_:1})):ht("",!0)])]),g(yn,{"model-value":_.node.getProgress(),max:1,color:f(_.node),rounded:"sm"},null,8,["model-value","color"])],38))}}),Jn=te(Qn,[["__scopeId","data-v-68d0ffb7"]]),to=ct({__name:"Content",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{height:e}=fr(),s=Le(),{rightClickProperties:r,filenameFilter:n,openedItems:o,flatTree:a,internalSelection:l}=mt(s),u=W(()=>e.value-48*2-64-12*2-56-8);async function h(p,_){r.value.isVisible&&(r.value.isVisible=!1,await cr()),Object.assign(r.value,{isVisible:!0,offset:[p.pageX,p.pageY],hash:t.torrent.hash}),l.value.size<=1&&(l.value=new Set([_.fullName]))}const c=pt();function f(p,_){c.value=setTimeout(()=>{h(p,_)},500)}function m(){clearTimeout(c.value)}return(p,_)=>(k(),$(ce,null,{default:x(()=>[g(Ds,{modelValue:M(n),"onUpdate:modelValue":_[0]||(_[0]=d=>Gn(n)?n.value=d:null),class:"mt-2 mx-3","hide-details":"",clearable:"",placeholder:p.$t("torrentDetail.content.filter_placeholder")},null,8,["modelValue","placeholder"]),g(bn,{id:"tree-root",items:M(a),height:u.value,"item-height":"68",class:"pa-2"},{default:x(({item:d})=>[g(Jn,{"opened-items":M(o),node:d,onSetFilePrio:_[1]||(_[1]=(b,y)=>M(s).setFilePriority(b,y)),onTouchcancel:m,onTouchend:m,onTouchmove:m,onTouchstart:b=>f(b.touches.item(0),d),onOnRightClick:_[2]||(_[2]=(b,y)=>h(b,y))},null,8,["opened-items","node","onTouchstart"])]),_:1},8,["items","height"])]),_:1}))}}),eo={},so={class:"pl-4"},io={class:"pr-4"};function ro(i,t){return k(),$(z,{cols:"12",sm:"6",lg:"3"},{default:x(()=>[g(vn,{rounded:"xl",class:"d-flex align-center py-2 border"},{default:x(()=>[I("div",so,[Si(i.$slots,"title")]),g(Kt),I("div",io,[Si(i.$slots,"text")])]),_:3})]),_:3})}const Ct=te(eo,[["render",ro]]),no=ct({__name:"PanelBoolean",props:{torrent:{}},setup(i){const t=i,e=Oe(),s=si(),{properties:r}=mt(Bt()),n=W({get:()=>t.torrent.auto_tmm,set:h=>e.toggleAutoTmm([t.torrent.hash],h)}),o=W({get:()=>t.torrent.f_l_piece_prio,set:()=>e.toggleFLPiecePrio([t.torrent.hash])}),a=W({get:()=>t.torrent.forced,set:h=>{h?s.forceResumeTorrents([t.torrent.hash]):s.resumeTorrents([t.torrent.hash])}}),l=W({get:()=>t.torrent.seq_dl,set:()=>e.toggleSeqDl([t.torrent.hash])}),u=W({get:()=>t.torrent.super_seeding,set:h=>e.setSuperSeeding([t.torrent.hash],h)});return(h,c)=>(k(),$(se,{title:h.$t("torrentDetail.info.boolean_values")},{default:x(()=>[g(ee,null,{default:x(()=>[g(K,null,{default:x(()=>[g(Ct,null,{title:x(()=>[g(re,{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=f=>n.value=f),"hide-details":"",density:"compact",label:h.$t("torrent.properties.auto_tmm")},null,8,["modelValue","label"])]),_:1}),g(Ct,null,{title:x(()=>[g(re,{modelValue:o.value,"onUpdate:modelValue":c[1]||(c[1]=f=>o.value=f),"hide-details":"",density:"compact",label:h.$t("torrent.properties.f_l_piece_prio")},null,8,["modelValue","label"])]),_:1}),g(Ct,null,{title:x(()=>[g(re,{modelValue:a.value,"onUpdate:modelValue":c[2]||(c[2]=f=>a.value=f),"hide-details":"",density:"compact",label:h.$t("torrent.properties.forced")},null,8,["modelValue","label"])]),_:1}),g(Ct,null,{title:x(()=>[g(re,{modelValue:l.value,"onUpdate:modelValue":c[3]||(c[3]=f=>l.value=f),"hide-details":"",density:"compact",label:h.$t("torrent.properties.seq_dl")},null,8,["modelValue","label"])]),_:1}),g(Ct,null,{title:x(()=>[g(re,{modelValue:u.value,"onUpdate:modelValue":c[4]||(c[4]=f=>u.value=f),"hide-details":"",density:"compact",label:h.$t("torrent.properties.super_seeding")},null,8,["modelValue","label"])]),_:1}),g(Ct,null,{title:x(()=>[g(re,{disabled:"","model-value":M(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"]))}}),oo=ct({__name:"PanelData",props:{torrent:{}},setup(i){const t=i,{properties:e}=mt(Bt()),{useBinarySize:s}=mt(_e()),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)=>(k(),$(se,{title:n.$t("torrentDetail.info.data_values")},{default:x(()=>[g(ee,null,{default:x(()=>[g(K,null,{default:x(()=>[(k(),G(lt,null,_t(r,a=>g(Ct,null,{title:x(()=>[V(S(n.$t(`torrent.properties.${a.title}`)),1)]),text:x(()=>[V(S(M(Nt)(a.getter(),M(s))),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),ao=ct({__name:"PanelDatetime",props:{torrent:{}},setup(i){const t=i,{properties:e}=mt(Bt()),{dateFormat:s}=mt(_e()),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)=>(k(),$(se,{title:n.$t("torrentDetail.info.datetime_values")},{default:x(()=>[g(ee,null,{default:x(()=>[g(K,null,{default:x(()=>[(k(),G(lt,null,_t(r,a=>g(Ct,null,dr({title:x(()=>[V(S(n.$t(`torrent.properties.${a.title}`)),1)]),_:2},[a.getter()>0?{name:"text",fn:x(()=>[V(S(M(wn)(a.getter(),M(s))),1)]),key:"0"}:{name:"text",fn:x(()=>[V(S(n.$t("common.NA")),1)]),key:"1"}]),1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),lo=ct({__name:"PanelDuration",props:{torrent:{}},setup(i){const t=i,{properties:e}=mt(Bt()),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)=>(k(),$(se,{title:r.$t("torrentDetail.info.duration_values")},{default:x(()=>[g(ee,null,{default:x(()=>[g(K,null,{default:x(()=>[(k(),G(lt,null,_t(s,o=>g(Ct,null,dr({title:x(()=>[V(S(r.$t(`torrent.properties.${o.title}`)),1)]),_:2},[o.getter()>0?{name:"text",fn:x(()=>[V(S(M(An).duration(o.getter(),o.unit).humanize()),1)]),key:"0"}:{name:"text",fn:x(()=>[V(S(r.$t("common.NA")),1)]),key:"1"}]),1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),ho={key:0,class:"d-flex gap"},uo=ct({__name:"PanelLongText",props:{torrent:{}},setup(i){const t=i,{properties:e}=mt(Bt()),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)=>(k(),$(se,{title:r.$t("torrentDetail.info.long_text_values")},{default:x(()=>[g(ee,null,{default:x(()=>[g(de,null,{default:x(()=>[(k(),G(lt,null,_t(s,o=>g(kt,{title:r.$t(`torrent.properties.${o.title}`)},{default:x(()=>[g(is,null,{default:x(()=>[V(S(o.getter()),1)]),_:2},1024)]),_:2},1032,["title"])),64)),g(kt,{title:r.$t("torrent.properties.tags")},{default:x(()=>[r.torrent.tags?.length?(k(),G("div",ho,[(k(!0),G(lt,null,_t(r.torrent.tags,o=>(k(),$(ae,{variant:"flat",color:"tag"},{default:x(()=>[V(S(o),1)]),_:2},1024))),256))])):(k(),$(is,{key:1},{default:x(()=>[V(S(r.$t("torrent.properties.empty_tags")),1)]),_:1}))]),_:1},8,["title"])]),_:1})]),_:1})]),_:1},8,["title"]))}}),co=te(uo,[["__scopeId","data-v-074ad8b6"]]),fo=ct({__name:"PanelSpeed",props:{torrent:{}},setup(i){const t=i,{properties:e}=mt(Bt()),{useBitSpeed:s}=mt(_e()),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)=>(k(),$(se,{title:n.$t("torrentDetail.info.speed_values")},{default:x(()=>[g(ee,null,{default:x(()=>[g(K,null,{default:x(()=>[(k(),G(lt,null,_t(r,a=>g(Ct,null,{title:x(()=>[V(S(n.$t(`torrent.properties.${a.title}`)),1)]),text:x(()=>[V(S(M(Zt)(a.getter(),M(s))),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),po=ct({__name:"PanelText",props:{torrent:{}},setup(i){const t=i,{t:e}=ge(),{properties:s}=mt(Bt()),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)=>(k(),$(se,{title:n.$t("torrentDetail.info.text_values")},{default:x(()=>[g(ee,null,{default:x(()=>[g(K,null,{default:x(()=>[(k(),G(lt,null,_t(r,a=>g(Ct,null,{title:x(()=>[V(S(n.$t(`torrent.properties.${a.title}`)),1)]),text:x(()=>[V(S(a.getter()),1)]),_:2},1024)),64))]),_:1})]),_:1})]),_:1},8,["title"]))}}),mo=ct({__name:"Info",props:{torrent:{},isActive:{type:Boolean}},setup(i){return(t,e)=>(k(),$(de,null,{default:x(()=>[g(kt,null,{default:x(()=>[g(Cn,null,{default:x(()=>[g(ao,{torrent:t.torrent},null,8,["torrent"]),g(lo,{torrent:t.torrent},null,8,["torrent"]),g(no,{torrent:t.torrent},null,8,["torrent"]),g(oo,{torrent:t.torrent},null,8,["torrent"]),g(fo,{torrent:t.torrent},null,8,["torrent"]),g(po,{torrent:t.torrent},null,8,["torrent"]),g(co,{torrent:t.torrent},null,8,["torrent"])]),_:1})]),_:1})]),_:1}))}}),_o=class Gs{constructor(t,e){this.low=t,this.high=e}clone(){return new Gs(this.low,this.high)}get max(){return this.clone()}less_than(t){return this.low<t.low||this.low===t.low&&this.high<t.high}equal_to(t){return this.low===t.low&&this.high===t.high}intersect(t){return!this.not_intersect(t)}not_intersect(t){return this.high<t.low||t.high<this.low}merge(t){return new Gs(this.low===void 0?t.low:this.low<t.low?this.low:t.low,this.high===void 0?t.high:this.high>t.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 t<e}},rt=0,L=1;let Yt=class{constructor(t=void 0,e=void 0,s=null,r=null,n=null,o=L){if(this.left=s,this.right=r,this.parent=n,this.color=o,this.item={key:t,value:e},t&&t instanceof Array&&t.length===2&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])){let[a,l]=t;a>l&&([a,l]=[l,a]),this.item.key=new _o(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===L}_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.value<t.item.value}less_than(t){return this.item.value===this.item.key&&t.item.value===t.item.key?this.item.key.less_than(t.item.key):this.item.key.less_than(t.item.key)||this.item.key.equal_to(t.item.key)&&this._value_less_than(t)}_value_equal(t){return this.item.value&&t.item.value&&this.item.value.equal_to?this.item.value.equal_to(t.item.value):this.item.value===t.item.value}equal_to(t){return this.item.value===this.item.key&&t.item.value===t.item.key?this.item.key.equal_to(t.item.key):this.item.key.equal_to(t.item.key)&&this._value_equal(t)}intersect(t){return this.item.key.intersect(t.item.key)}copy_data(t){this.item.key=t.item.key,this.item.value=t.item.value}update_max(){if(this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max){const t=this.item.key.constructor.comparable_max;this.max=t(this.max,this.right.max)}if(this.left&&this.left.max){const t=this.item.key.constructor.comparable_max;this.max=t(this.max,this.left.max)}}not_intersect_left_subtree(t){const e=this.item.key.constructor.comparable_less_than;let s=this.left.max.high!==void 0?this.left.max.high:this.left.max;return e(s,t.item.key.low)}not_intersect_right_subtree(t){const e=this.item.key.constructor.comparable_less_than;let s=this.right.max.low!==void 0?this.right.max.low:this.right.item.key.low;return e(t.item.key.high,s)}};class oi{constructor(){this.root=null,this.nil_node=new Yt}get size(){let t=0;return this.tree_walk(this.root,()=>t++),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 Yt(t,e,this.nil_node,this.nil_node,null,rt);return this.tree_insert(s),this.recalc_max(s),s}exist(t,e=t){let s=new Yt(t,e);return!!this.tree_search(this.root,s)}remove(t,e=t){let s=new Yt(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 Yt(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 Yt(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 oi;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 Yt(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===rt;)e.parent===e.parent.parent.left?(s=e.parent.parent.right,s.color===rt?(e.parent.color=L,s.color=L,e.parent.parent.color=rt,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,this.rotate_left(e)),e.parent.color=L,e.parent.parent.color=rt,this.rotate_right(e.parent.parent))):(s=e.parent.parent.left,s.color===rt?(e.parent.color=L,s.color=L,e.parent.parent.color=rt,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,this.rotate_right(e)),e.parent.color=L,e.parent.parent.color=rt,this.rotate_left(e.parent.parent)));this.root.color=L}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===L&&this.delete_fixup(s)}delete_fixup(t){let e=t,s;for(;e!==this.root&&e.parent!=null&&e.color===L;)e===e.parent.left?(s=e.parent.right,s.color===rt&&(s.color=L,e.parent.color=rt,this.rotate_left(e.parent),s=e.parent.right),s.left.color===L&&s.right.color===L?(s.color=rt,e=e.parent):(s.right.color===L&&(s.color=rt,s.left.color=L,this.rotate_right(s),s=e.parent.right),s.color=e.parent.color,e.parent.color=L,s.right.color=L,this.rotate_left(e.parent),e=this.root)):(s=e.parent.left,s.color===rt&&(s.color=L,e.parent.color=rt,this.rotate_right(e.parent),s=e.parent.left),s.left.color===L&&s.right.color===L?(s.color=rt,e=e.parent):(s.left.color===L&&(s.color=rt,s.right.color=L,this.rotate_left(s),s=e.parent.left),s.color=e.parent.color,e.parent.color=L,s.left.color=L,this.rotate_right(e.parent),e=this.root));e.color=L}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===rt&&(e.left.color===L&&e.right.color===L||(t=!1))}),t}testBlackHeightProperty(t){let e=0,s=0,r=0;if(t.color===L&&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}}tt=(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))(tt||{});let Ls,He,go,yo;Ls=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)=>Ls(i).priority??t;ie={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(Ls).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...i){return i.map(Ls).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)})}};go={extension:{type:tt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await rs(()=>import("./browserAll-BT1z9cKE.js").then(async m=>{await m.__tla;return m}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)}};yo={extension:{type:tt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await rs(()=>import("./webworkerAll-DPPv9Ibl.js").then(async m=>{await m.__tla;return m}),__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11]),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 pr={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,u,h){this.fn=l,this.context=u,this.once=h||!1}function n(l,u,h,c,f){if(typeof h!="function")throw new TypeError("The listener must be a function");var m=new r(h,c||l,f),p=e?e+u:u;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],m]:l._events[p].push(m):(l._events[p]=m,l._eventsCount++),l}function o(l,u){--l._eventsCount===0?l._events=new s:delete l._events[u]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],h,c;if(this._eventsCount===0)return u;for(c in h=this._events)t.call(h,c)&&u.push(e?c.slice(1):c);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},a.prototype.listeners=function(u){var h=e?e+u:u,c=this._events[h];if(!c)return[];if(c.fn)return[c.fn];for(var f=0,m=c.length,p=new Array(m);f<m;f++)p[f]=c[f].fn;return p},a.prototype.listenerCount=function(u){var h=e?e+u:u,c=this._events[h];return c?c.fn?1:c.length:0},a.prototype.emit=function(u,h,c,f,m,p){var _=e?e+u:u;if(!this._events[_])return!1;var d=this._events[_],b=arguments.length,y,w;if(d.fn){switch(d.once&&this.removeListener(u,d.fn,void 0,!0),b){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,h),!0;case 3:return d.fn.call(d.context,h,c),!0;case 4:return d.fn.call(d.context,h,c,f),!0;case 5:return d.fn.call(d.context,h,c,f,m),!0;case 6:return d.fn.call(d.context,h,c,f,m,p),!0}for(w=1,y=new Array(b-1);w<b;w++)y[w-1]=arguments[w];d.fn.apply(d.context,y)}else{var A=d.length,P;for(w=0;w<A;w++)switch(d[w].once&&this.removeListener(u,d[w].fn,void 0,!0),b){case 1:d[w].fn.call(d[w].context);break;case 2:d[w].fn.call(d[w].context,h);break;case 3:d[w].fn.call(d[w].context,h,c);break;case 4:d[w].fn.call(d[w].context,h,c,f);break;default:if(!y)for(P=1,y=new Array(b-1);P<b;P++)y[P-1]=arguments[P];d[w].fn.apply(d[w].context,y)}}return!0},a.prototype.on=function(u,h,c){return n(this,u,h,c,!1)},a.prototype.once=function(u,h,c){return n(this,u,h,c,!0)},a.prototype.removeListener=function(u,h,c,f){var m=e?e+u:u;if(!this._events[m])return this;if(!h)return o(this,m),this;var p=this._events[m];if(p.fn)p.fn===h&&(!f||p.once)&&(!c||p.context===c)&&o(this,m);else{for(var _=0,d=[],b=p.length;_<b;_++)(p[_].fn!==h||f&&!p[_].once||c&&p[_].context!==c)&&d.push(p[_]);d.length?this._events[m]=d.length===1?d[0]:d:o(this,m)}return this},a.prototype.removeAllListeners=function(u){var h;return u?(h=e?e+u:u,this._events[h]&&o(this,h)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,i.exports=a})(pr);var xo=pr.exports;let bo,vo,wo;$t=ii(xo);bo=Math.PI*2;vo=180/Math.PI;wo=Math.PI/180;ut=class{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new ut(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return ms.x=0,ms.y=0,ms}};const ms=new ut;O=class{constructor(t=1,e=0,s=0,r=1,n=0,o=0){this.array=null,this.a=t,this.b=e,this.c=s,this.d=r,this.tx=n,this.ty=o}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,s,r,n,o){return this.a=t,this.b=e,this.c=s,this.d=r,this.tx=n,this.ty=o,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const s=e||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,e){e=e||new ut;const s=t.x,r=t.y;return e.x=this.a*s+this.c*r+this.tx,e.y=this.b*s+this.d*r+this.ty,e}applyInverse(t,e){e=e||new ut;const s=this.a,r=this.b,n=this.c,o=this.d,a=this.tx,l=this.ty,u=1/(s*o+n*-r),h=t.x,c=t.y;return e.x=o*u*h+-n*u*c+(l*n-a*o)*u,e.y=s*u*c+-r*u*h+(-l*s+a*r)*u,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),s=Math.sin(t),r=this.a,n=this.c,o=this.tx;return this.a=r*e-this.b*s,this.b=r*s+this.b*e,this.c=n*e-this.d*s,this.d=n*s+this.d*e,this.tx=o*e-this.ty*s,this.ty=o*s+this.ty*e,this}append(t){const e=this.a,s=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*s+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*s+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*s+t.ty*n+this.ty,this}appendFrom(t,e){const s=t.a,r=t.b,n=t.c,o=t.d,a=t.tx,l=t.ty,u=e.a,h=e.b,c=e.c,f=e.d;return this.a=s*u+r*c,this.b=s*h+r*f,this.c=n*u+o*c,this.d=n*h+o*f,this.tx=a*u+l*c+e.tx,this.ty=a*h+l*f+e.ty,this}setTransform(t,e,s,r,n,o,a,l,u){return this.a=Math.cos(a+u)*n,this.b=Math.sin(a+u)*n,this.c=-Math.sin(a-l)*o,this.d=Math.cos(a-l)*o,this.tx=t-(s*this.a+r*this.c),this.ty=e-(s*this.b+r*this.d),this}prepend(t){const e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const s=this.a,r=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,s=this.b,r=this.c,n=this.d,o=t.pivot,a=-Math.atan2(-r,n),l=Math.atan2(s,e),u=Math.abs(a+l);return u<1e-5||Math.abs(bo-u)<1e-5?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=l),t.scale.x=Math.sqrt(e*e+s*s),t.scale.y=Math.sqrt(r*r+n*n),t.position.x=this.tx+(o.x*e+o.y*r),t.position.y=this.ty+(o.x*s+o.y*n),t}invert(){const t=this.a,e=this.b,s=this.c,r=this.d,n=this.tx,o=t*r-e*s;return this.a=r/o,this.b=-e/o,this.c=-s/o,this.d=t/o,this.tx=(s*this.ty-r*n)/o,this.ty=-(t*this.ty-e*n)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new O;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return Co.identity()}static get shared(){return Ao.identity()}};const Ao=new O,Co=new O,Xt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Wt=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],qt=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],jt=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Os=[],mr=[],Xe=Math.sign;function So(){for(let i=0;i<16;i++){const t=[];Os.push(t);for(let e=0;e<16;e++){const s=Xe(Xt[i]*Xt[e]+qt[i]*Wt[e]),r=Xe(Wt[i]*Xt[e]+jt[i]*Wt[e]),n=Xe(Xt[i]*qt[e]+qt[i]*jt[e]),o=Xe(Wt[i]*qt[e]+jt[i]*jt[e]);for(let a=0;a<16;a++)if(Xt[a]===s&&Wt[a]===r&&qt[a]===n&&jt[a]===o){t.push(a);break}}}for(let i=0;i<16;i++){const t=new O;t.set(Xt[i],Wt[i],qt[i],jt[i],0,0),mr.push(t)}}So();const X={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:i=>Xt[i],uY:i=>Wt[i],vX:i=>qt[i],vY:i=>jt[i],inv:i=>i&8?i&15:-i&7,add:(i,t)=>Os[i][t],sub:(i,t)=>Os[i][X.inv(t)],rotate180:i=>i^4,isVertical:i=>(i&3)===2,byDirection:(i,t)=>Math.abs(i)*2<=Math.abs(t)?t>=0?X.S:X.N:Math.abs(t)*2<=Math.abs(i)?i>0?X.E:X.W:t>0?i>0?X.SE:X.SW:i>0?X.NE:X.NW,matrixAppendRotationInv:(i,t,e=0,s=0)=>{const r=mr[X.inv(t)];r.tx=e,r.ty=s,i.append(r)}},We=[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.x+this.width&&e>=this.y&&e<this.y+this.height}strokeContains(t,e,s){const{width:r,height:n}=this;if(r<=0||n<=0)return!1;const o=this.x,a=this.y,l=o-s/2,u=o+r+s/2,h=a-s/2,c=a+n+s/2,f=o+s/2,m=o+r-s/2,p=a+s/2,_=a+n-s/2;return t>=l&&t<=u&&e>=h&&e<=c&&!(t>f&&t<m&&e>p&&e<_)}intersects(t,e){if(!e){const D=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=D)return!1;const T=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>T}const s=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=s||o<=n)return!1;const a=We[0].set(t.left,t.top),l=We[1].set(t.left,t.bottom),u=We[2].set(t.right,t.top),h=We[3].set(t.right,t.bottom);if(u.x<=a.x||l.y<=a.y)return!1;const c=Math.sign(e.a*e.d-e.b*e.c);if(c===0||(e.apply(a,a),e.apply(l,l),e.apply(u,u),e.apply(h,h),Math.max(a.x,l.x,u.x,h.x)<=s||Math.min(a.x,l.x,u.x,h.x)>=r||Math.max(a.y,l.y,u.y,h.y)<=n||Math.min(a.y,l.y,u.y,h.y)>=o))return!1;const f=c*(l.y-a.y),m=c*(a.x-l.x),p=f*s+m*n,_=f*r+m*n,d=f*s+m*o,b=f*r+m*o;if(Math.max(p,_,d,b)<=f*a.x+m*a.y||Math.min(p,_,d,b)>=f*h.x+m*h.y)return!1;const y=c*(a.y-u.y),w=c*(u.x-a.x),A=y*s+w*n,P=y*r+w*n,E=y*s+w*o,v=y*r+w*o;return!(Math.max(A,P,E,v)<=y*a.x+w*a.y||Math.min(A,P,E,v)>=y*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 _s={default:-1};at=function(i="default"){return _s[i]===void 0&&(_s[i]=-1),++_s[i]};let Ti;Ti={};Q="8.0.0";J=function(i,t,e=3){if(Ti[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))),Ti[t]=!0};const _r=()=>{};Gh=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 Ii(i){return!(i&i-1)&&!!i}function Mo(i){const t={};for(const e in i)i[e]!==void 0&&(t[e]=i[e]);return t}const Ei=Object.create(null);function Po(i){const t=Ei[i];return t===void 0&&(Ei[i]=at("resource")),t}const gr=class yr extends $t{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...yr.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){J(Q,"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=Po(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};gr.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let ko=gr;const xr=class br extends $t{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={...br.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 ko(Mo(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=Ii(this.pixelWidth)&&Ii(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};xr.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};Gt=xr;class ai 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}}ai.extension=tt.TextureSource;const Di=new O;To=class{constructor(t,e){this.mapCoord=new O,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;r<t.length;r+=2){const n=t[r],o=t[r+1];e[r]=n*s.a+o*s.c+s.tx,e[r+1]=n*s.b+o*s.d+s.ty}return e}update(){const t=this._texture;this._updateID++;const e=t.uvs;this.mapCoord.set(e.x1-e.x0,e.y1-e.y0,e.x3-e.x0,e.y3-e.y0,e.x0,e.y0);const s=t.orig,r=t.trim;r&&(Di.set(s.width/r.width,0,0,s.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(Di));const n=t.source,o=this.uClampFrame,a=this.clampMargin/n._resolution,l=this.clampOffset;return o[0]=(t.frame.x+a+l)/n.width,o[1]=(t.frame.y+a+l)/n.height,o[2]=(t.frame.x+t.frame.width-a+l)/n.width,o[3]=(t.frame.y+t.frame.height-a+l)/n.height,this.uClampOffset[0]=l/n.pixelWidth,this.uClampOffset[1]=l/n.pixelHeight,this.isSimple=t.frame.width===n.width&&t.frame.height===n.height&&t.rotate===0,!0}};Y=class extends $t{constructor({source:t,label:e,frame:s,orig:r,trim:n,defaultAnchor:o,defaultBorders:a,rotate:l,dynamic:u}={}){if(super(),this.uid=at("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new ot,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new Gt,this.noFrame=!s,s)this.frame.copyFrom(s);else{const{width:h,height:c}=this._source;this.frame.width=h,this.frame.height=c}this.orig=r||this.frame,this.trim=n,this.rotate=l??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=!1,this.dynamic=u||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new To(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:e}=this,{width:s,height:r}=this._source,n=e.x/s,o=e.y/r,a=e.width/s,l=e.height/r;let u=this.rotate;if(u){const h=a/2,c=l/2,f=n+h,m=o+c;u=X.add(u,X.NW),t.x0=f+h*X.uX(u),t.y0=m+c*X.uY(u),u=X.add(u,2),t.x1=f+h*X.uX(u),t.y1=m+c*X.uY(u),u=X.add(u,2),t.x2=f+h*X.uX(u),t.y2=m+c*X.uY(u),u=X.add(u,2),t.x3=f+h*X.uX(u),t.y3=m+c*X.uY(u)}else t.x0=n,t.y0=o,t.x1=n+a,t.y1=o,t.x2=n+a,t.y2=o+l,t.x3=n,t.y3=o+l}destroy(t=!1){this._source&&t&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return J(Q,"Texture.baseTexture is now Texture.source"),this._source}};Y.EMPTY=new Y({label:"EMPTY",source:new Gt({label:"EMPTY"})});Y.EMPTY.destroy=_r;Y.WHITE=new Y({source:new ai({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});Y.WHITE.destroy=_r;Io=function(i,t,e,s){const{width:r,height:n}=e.orig,o=e.trim;if(o){const a=o.width,l=o.height;i.minX=o.x-t._x*r-s,i.maxX=i.minX+a,i.minY=o.y-t._y*n-s,i.maxY=i.minY+l}else i.minX=-t._x*r-s,i.maxX=i.minX+r,i.minY=-t._y*n-s,i.maxY=i.minY+n};var Eo={grad:.9,turn:360,rad:360/(2*Math.PI)},It=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},it=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*i)/e+0},bt=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),i>e?e:i>t?i:t},vr=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},Ri=function(i){return{r:bt(i.r,0,255),g:bt(i.g,0,255),b:bt(i.b,0,255),a:bt(i.a)}},gs=function(i){return{r:it(i.r),g:it(i.g),b:it(i.b),a:it(i.a,3)}},Do=/^#([0-9a-f]{3,8})$/i,qe=function(i){var t=i.toString(16);return t.length<2?"0"+t:t},wr=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}},Ar=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),u=n%6;return{r:255*[s,a,o,o,l,s][u],g:255*[l,s,s,a,o,o][u],b:255*[o,o,l,s,s,a][u],a:r}},Bi=function(i){return{h:vr(i.h),s:bt(i.s,0,100),l:bt(i.l,0,100),a:bt(i.a)}},Fi=function(i){return{h:it(i.h),s:it(i.s),l:it(i.l),a:it(i.a,3)}},Vi=function(i){return Ar((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},Te=function(i){return{h:(t=wr(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},Ro=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bo=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Fo=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Vo=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Us={string:[[function(i){var t=Do.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?it(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?it(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var t=Fo.exec(i)||Vo.exec(i);return t?t[2]!==t[4]||t[4]!==t[6]?null:Ri({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=Ro.exec(i)||Bo.exec(i);if(!t)return null;var e,s,r=Bi({h:(e=t[1],s=t[2],s===void 0&&(s="deg"),Number(e)*(Eo[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Vi(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 It(t)&&It(e)&&It(s)?Ri({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(!It(t)||!It(e)||!It(s))return null;var o=Bi({h:Number(t),s:Number(e),l:Number(s),a:Number(n)});return Vi(o)},"hsl"],[function(i){var t=i.h,e=i.s,s=i.v,r=i.a,n=r===void 0?1:r;if(!It(t)||!It(e)||!It(s))return null;var o=function(a){return{h:vr(a.h),s:bt(a.s,0,100),v:bt(a.v,0,100),a:bt(a.a)}}({h:Number(t),s:Number(e),v:Number(s),a:Number(n)});return Ar(o)},"hsv"]]},Ni=function(i,t){for(var e=0;e<t.length;e++){var s=t[e][0](i);if(s)return[s,t[e][1]]}return[null,void 0]},No=function(i){return typeof i=="string"?Ni(i.trim(),Us.string):typeof i=="object"&&i!==null?Ni(i,Us.object):[null,void 0]},ys=function(i,t){var e=Te(i);return{h:e.h,s:bt(e.s+100*t,0,100),l:e.l,a:e.a}},xs=function(i){return(299*i.r+587*i.g+114*i.b)/1e3/255},$i=function(i,t){var e=Te(i);return{h:e.h,s:e.s,l:bt(e.l+100*t,0,100),a:e.a}},zs=function(){function i(t){this.parsed=No(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return i.prototype.isValid=function(){return this.parsed!==null},i.prototype.brightness=function(){return it(xs(this.rgba),2)},i.prototype.isDark=function(){return xs(this.rgba)<.5},i.prototype.isLight=function(){return xs(this.rgba)>=.5},i.prototype.toHex=function(){return t=gs(this.rgba),e=t.r,s=t.g,r=t.b,o=(n=t.a)<1?qe(it(255*n)):"","#"+qe(e)+qe(s)+qe(r)+o;var t,e,s,r,n,o},i.prototype.toRgb=function(){return gs(this.rgba)},i.prototype.toRgbString=function(){return t=gs(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 Fi(Te(this.rgba))},i.prototype.toHslString=function(){return t=Fi(Te(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=wr(this.rgba),{h:it(t.h),s:it(t.s),v:it(t.v),a:it(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(ys(this.rgba,t))},i.prototype.desaturate=function(t){return t===void 0&&(t=.1),Mt(ys(this.rgba,-t))},i.prototype.grayscale=function(){return Mt(ys(this.rgba,-1))},i.prototype.lighten=function(t){return t===void 0&&(t=.1),Mt($i(this.rgba,t))},i.prototype.darken=function(t){return t===void 0&&(t=.1),Mt($i(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}):it(this.rgba.a,3);var e},i.prototype.hue=function(t){var e=Te(this.rgba);return typeof t=="number"?Mt({h:t,s:e.s,l:e.l,a:e.a}):it(e.h)},i.prototype.isEqual=function(t){return this.toHex()===Mt(t).toHex()},i}(),Mt=function(i){return i instanceof zs?i:new zs(i)},Gi=[],$o=function(i){i.forEach(function(t){Gi.indexOf(t)<0&&(t(zs,Us),Gi.push(t))})};function Go(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,u=s[this.toHex()];if(u)return u;if(o?.closest){var h=this.toRgb(),c=1/0,f="black";if(!n.length)for(var m in e)n[m]=new i(e[m]).toRgb();for(var p in e){var _=(a=h,l=n[p],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));_<c&&(c=_,f=p)}return f}},t.string.push([function(o){var a=o.toLowerCase(),l=a==="transparent"?"#0000":e[a];return l?new i(l).toRgb():null},"name"])}$o([Go]);const fe=class Pe{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof Pe)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,t))&&(this._normalize(t),this._value=this._cloneSource(t))}}get value(){return this._value}_cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}_isSourceEqual(t,e){const s=typeof t;if(s!==typeof e)return!1;if(s==="number"||s==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((n,o)=>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]=Pe._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=Pe.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 Pe||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}};fe.shared=new fe;fe._temp=new fe;fe.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;xt=fe;const Lo={cullArea:null,cullable:!1,cullableChildren:!0};Oo=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;r<n;++r)i[r]=i[r+e];i.length=n};const Uo={allowChildren:!0,removeChildren(i=0,t){const e=t??this.children.length,s=e-i,r=[];if(s>0&&s<=e){for(let n=e-1;n>=i;n--){const o=this.children[n];o&&(this.renderGroup&&this.renderGroup.removeChild(o),r.push(o),o.parent=null)}Oo(this.children,i,e);for(let n=0;n<r.length;++n)this.emit("childRemoved",r[n],this,n),r[n].emit("removed",this);return r}else if(s===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(i){const t=this.getChildAt(i);return this.removeChild(t)},getChildAt(i){if(i<0||i>=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||J(Q,"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 s=i.parent.children.indexOf(i);if(i.parent===this&&s===t)return i;s!==-1&&i.parent.children.splice(s,1)}return t===e.length?e.push(i):e.splice(t,0,i),i.parent=this,i.didChange=!0,i.didViewUpdate=!1,i._updateFlags=15,this.renderGroup&&this.renderGroup.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)}};zo=class{constructor(t){this.pipe="filter",this.priority=1,this.filters=t?.filters,this.filterArea=t?.filterArea}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}};class li{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e<t;e++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){let e;return this._index>0?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 Yo{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 li(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}}St=new Yo;class Ho{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;e<this._tests.length;e++){const s=this._tests[e];if(s.test(t))return St.get(s.maskClass,t)}return t}returnMaskEffect(t){St.return(t)}}const Ys=new Ho;ie.handleByList(tt.MaskEffect,Ys._effectClasses);const Xo={_mask:null,_filters:null,effects:[],addEffect(i){this.effects.indexOf(i)===-1&&(this.effects.push(i),this.effects.sort((e,s)=>e.priority-s.priority),this.renderGroup&&(this.renderGroup.structureDidChange=!0),this._updateIsSimple())},removeEffect(i){const t=this.effects.indexOf(i);t!==-1&&(this.effects.splice(t,1),!this.isRenderGroupRoot&&this.renderGroup&&(this.renderGroup.structureDidChange=!0),this._updateIsSimple())},set mask(i){if(this._mask||(this._mask={mask:null,effect:null}),this._mask.mask===i||(this._mask.effect&&(this.removeEffect(this._mask.effect),Ys.returnMaskEffect(this._mask.effect),this._mask.effect=null),this._mask.mask=i,i==null))return;const t=Ys.getMaskEffect(i);this._mask.effect=t,this.addEffect(t)},get mask(){return this._mask?.mask},set filters(i){!Array.isArray(i)&&i&&(i=[i]),i=i,this._filters||(this._filters={filters:null,effect:null,filterArea:null});const t=i?.length>0,e=this._filters.effect&&!t||!this._filters.effect&&t;if(i=Array.isArray(i)?i.slice(0):i,this._filters.filters=Object.freeze(i),e)if(t){const s=St.get(zo);this._filters.effect=s,this.addEffect(s)}else{const s=this._filters.effect;this.removeEffect(s),s.filterArea=null,s.filters=null,this._filters.effect=null,St.return(s)}t&&(this._filters.effect.filters=i,this._filters.effect.filterArea=this.filterArea)},get filters(){return this._filters?.filters},set filterArea(i){this._filters||(this._filters={filters:null,effect:null,filterArea:null}),this._filters.filterArea=i},get filterArea(){return this._filters?.filterArea}},Wo={label:null,get name(){return J(Q,"Container.name property has been removed, use Container.label instead"),this.label},set name(i){J(Q,"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;s<e.length;s++){const r=e[s];if(r.label===i||i instanceof RegExp&&i.test(r.label))return r}if(t)for(let s=0;s<e.length;s++){const n=e[s].getChildByLabel(i,!0);if(n)return n}return null},getChildrenByLabel(i,t=!1,e=[]){const s=this.children;for(let r=0;r<s.length;r++){const n=s[r];(n.label===i||i instanceof RegExp&&i.test(n.label))&&e.push(n)}if(t)for(let r=0;r<s.length;r++)s[r].getChildrenByLabel(i,!0,e);return e}},Li=new O;Rt=class{constructor(t=1/0,e=1/0,s=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Li,this.minX=t,this.minY=e,this.maxX=s,this.maxY=r}isEmpty(){return this.minX>this.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=Li,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,u=n.d,h=n.tx,c=n.ty;let f=this.minX,m=this.minY,p=this.maxX,_=this.maxY,d=o*t+l*e+h,b=a*t+u*e+c;d<f&&(f=d),b<m&&(m=b),d>p&&(p=d),b>_&&(_=b),d=o*s+l*e+h,b=a*s+u*e+c,d<f&&(f=d),b<m&&(m=b),d>p&&(p=d),b>_&&(_=b),d=o*t+l*r+h,b=a*t+u*r+c,d<f&&(f=d),b<m&&(m=b),d>p&&(p=d),b>_&&(_=b),d=o*s+l*r+h,b=a*s+u*r+c,d<f&&(f=d),b<m&&(m=b),d>p&&(p=d),b>_&&(_=b),this.minX=f,this.minY=m,this.maxX=p,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.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const e=this.minX,s=this.minY,r=this.maxX,n=this.maxY,{a:o,b:a,c:l,d:u,tx:h,ty:c}=t;let f=o*e+l*s+h,m=a*e+u*s+c;this.minX=f,this.minY=m,this.maxX=f,this.maxY=m,f=o*r+l*s+h,m=a*r+u*s+c,this.minX=f<this.minX?f:this.minX,this.minY=m<this.minY?m:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=m>this.maxY?m:this.maxY,f=o*e+l*n+h,m=a*e+u*n+c,this.minX=f<this.minX?f:this.minX,this.minY=m<this.minY?m:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=m>this.maxY?m:this.maxY,f=o*r+l*n+h,m=a*r+u*n+c,this.minX=f<this.minX?f:this.minX,this.minY=m<this.minY?m:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=m>this.maxY?m:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,s,r){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<s&&(this.minY=s),this.maxY>r&&(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 u=r.a,h=r.b,c=r.c,f=r.d,m=r.tx,p=r.ty;for(let _=e;_<s;_+=2){const d=t[_],b=t[_+1],y=u*d+c*b+m,w=h*d+f*b+p;n=y<n?y:n,o=w<o?w:o,a=y>a?y: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 Et;Et=new li(O);pe=new li(Rt);Cr=function(i,t,e){e.clear();let s,r;return i.parent?t?s=i.parent.worldTransform:(r=Et.get().identity(),s=os(i,r)):s=O.IDENTITY,Sr(i,e,s,t),r&&Et.return(r),e.isValid||e.set(0,0,0,0),e};function Sr(i,t,e,s){if(!i.visible||!i.measurable)return;let r;s?r=i.worldTransform:(i.updateLocalTransform(),r=Et.get(),r.appendFrom(i.localTransform,e));const n=t,o=!!i.effects.length;if(o&&(t=pe.get().clear()),i.boundsArea)t.addRect(i.boundsArea,r);else{i.addBounds&&(t.matrix=r,i.addBounds(t));for(let a=0;a<i.children.length;a++)Sr(i.children[a],t,r,s)}if(o){for(let a=0;a<i.effects.length;a++)i.effects[a].addBounds?.(t);n.addBounds(t,O.IDENTITY),pe.return(t)}s||Et.return(r)}function os(i,t){const e=i.parent;return e&&(os(e,t),e.updateLocalTransform(),t.append(e.localTransform)),t}let bs=0;const Oi=500;Dt=function(...i){bs!==Oi&&(bs++,bs===Oi?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...i))};Mr=function(i,t,e){return t.clear(),e||(e=O.IDENTITY),Pr(i,t,e,i,!0),t.isValid||t.set(0,0,0,0),t};function Pr(i,t,e,s,r){let n;if(r)n=Et.get(),n=e.copyTo(n);else{if(!i.visible||!i.measurable)return;i.updateLocalTransform();const l=i.localTransform;n=Et.get(),n.appendFrom(l,e)}const o=t,a=!!i.effects.length;if(a&&(t=pe.get().clear()),i.boundsArea)t.addRect(i.boundsArea,n);else{i.renderPipeId&&(t.matrix=n,i.addBounds(t));const l=i.children;for(let u=0;u<l.length;u++)Pr(l[u],t,n,s,!1)}if(a){for(let l=0;l<i.effects.length;l++)i.effects[l].addLocalBounds?.(t,s);o.addBounds(t,O.IDENTITY),pe.return(t)}Et.return(n)}function kr(i,t){const e=i.children;for(let s=0;s<e.length;s++){const r=e[s],n=(r.uid&255)<<24|r._didChangeId&16777215;t.data[t.index]!==n&&(t.data[t.index]=n,t.didChange=!0),t.index++,r.children.length&&kr(r,t)}return t.didChange}const qo=new O,jo={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(i,t){const e=Math.sign(this.scale.x)||1;t!==0?this.scale.x=i/t*e:this.scale.x=e},_setHeight(i,t){const e=Math.sign(this.scale.y)||1;t!==0?this.scale.y=i/t*e:this.scale.y=e},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new Rt});const i=this._localBoundsCacheData;return i.index=1,i.didChange=!1,i.data[0]!==this._didChangeId>>12&&(i.didChange=!0,i.data[0]=this._didChangeId>>12),kr(this,i),i.didChange&&Mr(this,i.localBounds,qo),i.localBounds},getBounds(i,t){return Cr(this,i,t||new Rt)}},Zo={_onRender:null,set onRender(i){const t=this.renderGroup;if(!i){this._onRender&&t?.removeOnRender(this),this._onRender=null;return}this._onRender||t?.addOnRender(this),this._onRender=i},get onRender(){return this._onRender}},Ko={_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.renderGroup&&!this.isRenderGroupRoot&&(this.renderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(Qo))}};function Qo(i,t){return i._zIndex-t._zIndex}const Jo={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 O);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 O);return r.append(this.localTransform),r.applyInverse(i,e)}return this.worldTransform.applyInverse(i,e)}};class Tr{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 ta{constructor(t){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this._children=[],this.worldTransform=new O,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 Tr,this._onRenderContainers=[],this.root=t,this.addChild(t)}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.onChildUpdate(t.root),this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){t.root.didChange&&this._removeChildFromUpdate(t.root);const e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t!==this.root&&(this._children.push(t),t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t._onRender&&this.addOnRender(t)),t.renderGroup){if(t.renderGroup.root===t){this.addRenderGroupChild(t.renderGroup);return}}else t.renderGroup=this,t.didChange=!0;const e=t.children;t.isRenderGroupRoot||this.onChildUpdate(t);for(let s=0;s<e.length;s++)this.addChild(e[s])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&this.removeOnRender(t),t.renderGroup.root!==t){const s=t.children;for(let r=0;r<s.length;r++)this.removeChild(s[r]);t.didChange&&t.renderGroup._removeChildFromUpdate(t),t.renderGroup=null}else this._removeRenderGroupChild(t.renderGroup);const e=this._children.indexOf(t);e>-1&&this._children.splice(e,1)}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(t.didViewUpdate=!1,this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t))}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}_removeChildFromUpdate(t){const e=this.childrenToUpdate[t.relativeRenderGroupDepth];if(!e)return;const s=e.list.indexOf(t);s>-1&&e.list.splice(s,1),e.index--}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender()}}function ea(i,t,e={}){for(const s in t)!e[s]&&t[s]!==void 0&&(i[s]=t[s])}let vs,ws,As;vs=new yt(null);ws=new yt(null);As=new yt(null,1,1);Ui=1;sa=2;Cs=4;dt=class extends $t{constructor(t={}){super(),this.uid=at("renderable"),this._updateFlags=15,this.isRenderGroupRoot=!1,this.renderGroup=null,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.updateTick=-1,this.localTransform=new O,this.relativeGroupTransform=new O,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new yt(this,0,0),this._scale=As,this._pivot=ws,this._skew=vs,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didChangeId=0,this._didLocalTransformChangeId=-1,ea(this,t,{children:!0,parent:!0,effects:!0}),t.children?.forEach(e=>this.addChild(e)),this.effects=[],t.parent?.addChild(this)}static mixin(t){Object.defineProperties(dt.prototype,Object.getOwnPropertyDescriptors(t))}addChild(...t){if(this.allowChildren||J(Q,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let s=0;s<t.length;s++)this.addChild(t[s]);return t[0]}const e=t[0];return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),this.renderGroup&&!this.isRenderGroupRoot&&(this.renderGroup.structureDidChange=!0),e):(e.parent&&e.parent.removeChild(e),this.children.push(e),this.sortableChildren&&(this.sortDirty=!0),e.parent=this,e.didChange=!0,e.didViewUpdate=!1,e._updateFlags=15,this.renderGroup&&this.renderGroup.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),e._zIndex!==0&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let r=0;r<t.length;r++)this.removeChild(t[r]);return t[0]}const e=t[0],s=this.children.indexOf(e);return s>-1&&(this.children.splice(s,1),this.renderGroup&&this.renderGroup.removeChild(e),e.parent=null,this.emit("childRemoved",e,this,s),e.emit("removed",this)),e}_onUpdate(t){if(t&&t===this._skew&&this._updateSkew(),this._didChangeId++,!this.didChange)if(this.didChange=!0,this.isRenderGroupRoot){const e=this.renderGroup.renderGroupParent;e&&e.onChildUpdate(this)}else this.renderGroup&&this.renderGroup.onChildUpdate(this)}set isRenderGroup(t){if(this.isRenderGroupRoot&&t===!1)throw new Error("[Pixi] cannot undo a render group just yet");t&&this.enableRenderGroup()}get isRenderGroup(){return this.isRenderGroupRoot}enableRenderGroup(){if(this.renderGroup&&this.renderGroup.root===this)return;this.isRenderGroupRoot=!0;const t=this.renderGroup;if(t&&t.removeChild(this),this.renderGroup=new ta(this),t){for(let e=0;e<t.renderGroupChildren.length;e++){const s=t.renderGroupChildren[e];let r=s.root;for(;r;){if(r===this){this.renderGroup.addRenderGroupChild(s);break}r=r.parent}}t.addRenderGroupChild(this.renderGroup)}this._updateIsSimple(),this.groupTransform=O.IDENTITY}_updateIsSimple(){this.isSimple=!this.isRenderGroupRoot&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new O),this.renderGroup&&(this.isRenderGroupRoot?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this._worldTransform.appendFrom(this.relativeGroupTransform,this.renderGroup.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*vo}set angle(t){this.rotation=t*wo}get pivot(){return this._pivot===ws&&(this._pivot=new yt(this,0,0)),this._pivot}set pivot(t){this._pivot===ws&&(this._pivot=new yt(this,0,0)),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===vs&&(this._skew=new yt(this,0,0)),this._skew}set skew(t){this._skew===vs&&(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|=Ui,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|=Ui,this._onUpdate())}get tint(){const t=this.localColor;return((t&255)<<16)+(t&65280)+(t>>16&255)}set blendMode(t){this.localBlendMode!==t&&(this.renderGroup&&!this.isRenderGroupRoot&&(this.renderGroup.structureDidChange=!0),this._updateFlags|=sa,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.renderGroup&&!this.isRenderGroupRoot&&(this.renderGroup.structureDidChange=!0),this._updateFlags|=Cs,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.renderGroup&&!this.isRenderGroupRoot&&(this.renderGroup.structureDidChange=!0),this._updateFlags|=Cs,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|=Cs,this.localDisplayStatus^=1,this.renderGroup&&!this.isRenderGroupRoot&&(this.renderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0,this.removeFromParent(),this.parent=null,this._mask=null,this._filters=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners();const e=typeof t=="boolean"?t:t?.children,s=this.removeChildren(0,this.children.length);if(e)for(let r=0;r<s.length;++r)s[r].destroy(t)}};dt.mixin(Uo);dt.mixin(Jo);dt.mixin(Zo);dt.mixin(jo);dt.mixin(Xo);dt.mixin(Wo);dt.mixin(Ko);dt.mixin(Lo);Be=class extends dt{constructor(t=Y.EMPTY){t instanceof Y&&(t={texture:t});const{texture:e,anchor:s,roundPixels:r,width:n,height:o,...a}=t;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=!0,this._didSpriteUpdate=!1,this._bounds={minX:0,maxX:1,minY:0,maxY:0},this._sourceBounds={minX:0,maxX:1,minY:0,maxY:0},this._boundsDirty=!0,this._sourceBoundsDirty=!0,this._roundPixels=0,this._anchor=new yt({_onUpdate:()=>{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 Y?new Be(t):new Be(Y.from(t,e))}set texture(t){t||(t=Y.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(){this._didChangeId+=4096,this._didSpriteUpdate=!0,this._sourceBoundsDirty=this._boundsDirty=!0,!this.didViewUpdate&&(this.didViewUpdate=!0,this.renderGroup&&this.renderGroup.onChildViewUpdate(this))}_updateBounds(){Io(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 ia=new Rt;function Ir(i,t,e){const s=ia;i.measurable=!0,Cr(i,e,s),t.addBoundsMask(s),i.measurable=!1}function Er(i,t,e){const s=pe.get();i.measurable=!0;const r=Et.get().identity(),n=Dr(i,e,r);Mr(i,s,n),i.measurable=!1,t.addBoundsMask(s),Et.return(r),pe.return(s)}function Dr(i,t,e){return i?(i!==t&&(Dr(i.parent,t,e),i.updateLocalTransform(),e.append(i.localTransform)),e):(Dt("Mask bounds, renderable is not inside the root container"),e)}class Rr{constructor(t){this.priority=0,this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof Be),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){Ir(this.mask,t,e)}addLocalBounds(t,e){Er(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof Be}}Rr.extension=tt.MaskEffect;class Br{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"}}Br.extension=tt.MaskEffect;class Fr{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){Ir(this.mask,t,e)}addLocalBounds(t,e){Er(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof dt}}Fr.extension=tt.MaskEffect;const ra={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 zi=ra;Qt={get(){return zi},set(i){zi=i}};Vr=class extends Gt{constructor(t){t.resource||(t.resource=Qt.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}};Vr.extension=tt.TextureSource;hi=class extends Gt{constructor(t){if(t.resource&&globalThis.HTMLImageElement&&t.resource instanceof HTMLImageElement){const e=Qt.get().createCanvas(t.resource.width,t.resource.height);e.getContext("2d").drawImage(t.resource,0,0),t.resource=e,Dt("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}};hi.extension=tt.TextureSource;Hs=(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))(Hs||{});class Ss{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 Nr=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 Ss(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=Hs.NORMAL){return this._addListener(new Ss(t,e,s))}addOnce(t,e,s=Hs.NORMAL){return this._addListener(new Ss(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<this._minElapsedMS)return;this._lastFrame=t-n%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*gt.targetFPMS;const s=this._head;let r=s.next;for(;r;)r=r.emit(this);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const e=Math.min(this.maxFPS,t),s=Math.min(Math.max(0,e)/1e3,gt.targetFPMS);this._maxElapsedMS=1/s}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(t===0)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!gt._shared){const t=gt._shared=new gt;t.autoStart=!0,t._protected=!0}return gt._shared}static get system(){if(!gt._system){const t=gt._system=new gt;t.autoStart=!0,t._protected=!0}return gt._system}};Nr.targetFPMS=.06;let Ms;je=Nr;async function na(){return Ms??(Ms=(async()=>{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"})()),Ms}const us=class $r extends Gt{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...$r.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=je.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 na(),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&&(je.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||(je.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(je.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}};us.extension=tt.TextureSource;us.defaultOptions={...Gt.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};us.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let oa=us;const le=(i,t,e=!1)=>(Array.isArray(i)||(i=[i]),t?i.map(s=>typeof s=="string"||e?t(s):s):i);class aa{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||Dt(`[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<this.parsers.length;l++){const u=this.parsers[l];if(u.test(e)){r=u.getCacheableAssets(s,e);break}}const n=new Map(Object.entries(r||{}));r||s.forEach(l=>{n.set(l,e)});const o=[...n.keys()],a={cacheKeys:o,keys:s};s.forEach(l=>{this._cacheMap.set(l,a)}),o.forEach(l=>{const u=r?r[l]:e;this._cache.has(l)&&this._cache.get(l)!==u&&Dt("[Cache] already has key:",l),this._cache.set(l,n.get(l))})}remove(t){if(!this._cacheMap.has(t)){Dt(`[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 Xs;he=new aa;Xs=[];ie.handleByList(tt.TextureSource,Xs);function la(i={}){const t=i&&i.resource,e=t?i.resource:i,s=t?i:{resource:i};for(let r=0;r<Xs.length;r++){const n=Xs[r];if(n.test(e))return new n(s)}throw new Error(`Could not find a source type for resource: ${s.resource}`)}function ha(i={},t=!1){const e=i&&i.resource,s=e?i.resource:i,r=e?i:{resource:i};if(!t&&he.has(s))return he.get(s);const n=new Y({source:la(r)});return n.on("destroy",()=>{he.has(s)&&he.remove(s)}),t||he.set(s,n),n}function ua(i,t=!1){return typeof i=="string"?he.get(i):i instanceof Gt?new Y({source:i}):ha(i,t)}Y.from=ua;ie.add(Rr,Br,Fr,oa,hi,Vr,ai);Gr=(i=>(i[i.Low=0]="Low",i[i.Normal=1]="Normal",i[i.High=2]="High",i))(Gr||{});function wt(i){if(typeof i!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(i)}`)}function we(i){return i.split("?")[0].split("#")[0]}function ca(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function da(i,t,e){return i.replace(new RegExp(ca(t),"g"),e)}function fa(i,t){let e="",s=0,r=-1,n=0,o=-1;for(let a=0;a<=i.length;++a){if(a<i.length)o=i.charCodeAt(a);else{if(o===47)break;o=47}if(o===47){if(!(r===a-1||n===1))if(r!==a-1&&n===2){if(e.length<2||s!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){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}}t&&(e.length>0?e+="/..":e="..",s=2)}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}Fe={toPosix(i){return da(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){wt(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(wt(i),this.isDataUrl(i)||this.isBlobUrl(i))return i;const s=we(this.toPosix(t??Qt.get().getBaseUrl())),r=we(this.toPosix(e??this.rootname(s)));return i=this.toPosix(i),i.startsWith("/")?Fe.join(r,i.slice(1)):this.isAbsolute(i)?i:this.join(s,i)},normalize(i){if(wt(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=fa(i,!1),i.length>0&&s&&(i+="/"),e?`/${i}`:t+i},isAbsolute(i){return wt(i),i=this.toPosix(i),this.hasProtocol(i)?!0:i.startsWith("/")},join(...i){if(i.length===0)return".";let t;for(let e=0;e<i.length;++e){const s=i[e];if(wt(s),s.length>0)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(wt(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){wt(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){wt(i),t&&wt(t),i=we(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){wt(i),i=we(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){wt(i);const t={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return t;i=we(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,u=i.length-1,h=0;for(;u>=r;--u){if(e=i.charCodeAt(u),e===47){if(!l){o=u+1;break}continue}a===-1&&(l=!1,a=u+1),e===46?n===-1?n=u:h!==1&&(h=1):n!==-1&&(h=-1)}return n===-1||a===-1||h===0||h===1&&n===a-1&&n===o+1?a!==-1&&(o===0&&s?t.base=t.name=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 Lr(i,t,e,s,r){const n=t[e];for(let o=0;o<n.length;o++){const a=n[o];e<t.length-1?Lr(i.replace(s[e],a),t,e+1,s,r):r.push(i.replace(s[e],a))}}function pa(i){const t=/\{(.*?)\}/g,e=i.match(t),s=[];if(e){const r=[];e.forEach(n=>{const o=n.substring(1,n.length-1).split(",");r.push(o)}),Lr(i,r,0,e,s)}else s.push(i);return s}const Yi=i=>!Array.isArray(i);class Or{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&&Dt("[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 u=this._createBundleAssetId(t,a);s.push(u),l=[a,u]}else{const u=a.map(h=>this._createBundleAssetId(t,h));s.push(...u),l=[...a,...u]}this.add({...n,alias:l,src:o})}),this._bundles[t]=s}add(t){const e=[];Array.isArray(t)?e.push(...t):e.push(t);let s;s=n=>{this.hasKey(n)&&Dt(`[Resolver] already has key: ${n} overwriting`)},le(e).forEach(n=>{const{src:o}=n;let{data:a,format:l,loadParser:u}=n;const h=le(o).map(m=>typeof m=="string"?pa(m):Array.isArray(m)?m:[m]),c=this.getAlias(n);Array.isArray(c)?c.forEach(s):s(c);const f=[];h.forEach(m=>{m.forEach(p=>{let _={};if(typeof p!="object"){_.src=p;for(let d=0;d<this._parsers.length;d++){const b=this._parsers[d];if(b.test(p)){_=b.parse(p);break}}}else a=p.data??a,l=p.format??l,u=p.loadParser??u,_={..._,...p};if(!c)throw new Error(`[Resolver] alias is undefined for this asset: ${_.src}`);_=this._buildResolvedAsset(_,{aliases:c,data:a,format:l,loadParser:u}),f.push(_)})}),c.forEach(m=>{this._assetMap[m]=f})})}resolveBundle(t){const e=Yi(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 u=o[l];a[this._extractAssetIdFromBundle(r,l)]=u}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=Yi(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 u=n.filter(h=>h[a]?h[a]===l:!1);u.length&&(n=u)})}),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;e<t.length;e++){const s=t[0],r=this._preferredOrder.find(n=>n.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=Fe.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??ma(t.src),t}}Or.RETINA_PREFIX=/@([0-9\.]+)x/;function ma(i){return i.split(".").pop().split("?").shift().split("#").shift()}let Ur;Hi=(i,t)=>{const e=t.split("?")[1];return e&&(i+=`?${e}`),i};Ur=class ke{constructor(t,e){this.linkedSheets=[],this._texture=t instanceof Y?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<=ke.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const s=ke.BATCH_SIZE;for(;e-t<s&&e<this._frameKeys.length;){const r=this._frameKeys[e],n=this._frames[r],o=n.frame;if(o){let a=null,l=null;const u=n.trimmed!==!1&&n.sourceSize?n.sourceSize:n.frame,h=new ot(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);n.rotated?a=new ot(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):a=new ot(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),n.trimmed!==!1&&n.spriteSourceSize&&(l=new ot(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[r]=new Y({source:this.textureSource,frame:a,orig:h,trim:l,rotate:n.rotated?2:0,defaultAnchor:n.anchor,defaultBorders:n.borders,label:r.toString()})}e++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let s=0;s<t[e].length;s++){const r=t[e][s];this.animations[e].push(this.textures[r])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*ke.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*ke.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){for(const e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};Ur.BATCH_SIZE=1e3;let Xi=Ur;const _a=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function zr(i,t,e){const s={};if(i.forEach(r=>{s[r]=t}),Object.keys(t.textures).forEach(r=>{s[r]=t.textures[r]}),!e){const r=Fe.dirname(i[0]);t.linkedSheets.forEach((n,o)=>{const a=zr([`${r}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(s,a)})}return s}const ga={extension:tt.Asset,cache:{test:i=>i instanceof Xi,getCacheableAssets:(i,t)=>zr(i,t,!1)},resolver:{test:i=>{const e=i.split("?")[0].split("."),s=e.pop(),r=e.pop();return s==="json"&&_a.includes(r)},parse:i=>{const t=i.split(".");return{resolution:parseFloat(Or.RETINA_PREFIX.exec(i)?.[1]??"1"),format:t[t.length-2],src:i}}},loader:{name:"spritesheetLoader",extension:{type:tt.LoadParser,priority:Gr.Normal},async testParse(i,t){return Fe.extname(t.src).toLowerCase()===".json"&&!!i.frames},async parse(i,t,e){const{texture:s,imageFilename:r}=t?.data??{};let n=Fe.dirname(t.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");let o;if(s instanceof Y)o=s;else{const u=Hi(n+(r??i.meta.image),t.src);o=(await e.load([u]))[u]}const a=new Xi(o.source,i);await a.parse();const l=i?.meta?.related_multi_packs;if(Array.isArray(l)){const u=[];for(const c of l){if(typeof c!="string")continue;let f=n+c;t.data?.ignoreMultiPack||(f=Hi(f,t.src),u.push(e.load({src:f,data:{ignoreMultiPack:!0}})))}const h=await Promise.all(u);a.linkedSheets=h,h.forEach(c=>{c.linkedSheets=[a].concat(a.linkedSheets.filter(f=>f!==c))})}return a},async unload(i,t,e){await e.unload(i.textureSource._sourceOrigin),i.destroy(!1)}}};ie.add(ga);ya=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 Ws=[];ie.handleByNamedList(tt.Environment,Ws);async function xa(i){if(i)for(let t=0;t<Ws.length;t++){const e=Ws[t];if(e.value.test()){await e.value.load();return}}}let Ae;ba=function(){if(typeof Ae=="boolean")return Ae;try{Ae=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Ae=!1}return Ae};var ui={exports:{}};ui.exports=cs;ui.exports.default=cs;function cs(i,t,e){e=e||2;var s=t&&t.length,r=s?t[0]*e:i.length,n=Yr(i,0,r,e,!0),o=[];if(!n||n.next===n.prev)return o;var a,l,u,h,c,f,m;if(s&&(n=Sa(i,t,n,e)),i.length>80*e){a=u=i[0],l=h=i[1];for(var p=e;p<r;p+=e)c=i[p],f=i[p+1],c<a&&(a=c),f<l&&(l=f),c>u&&(u=c),f>h&&(h=f);m=Math.max(u-a,h-l),m=m!==0?32767/m:0}return Ve(n,o,e,a,l,m,0),o}function Yr(i,t,e,s,r){var n,o;if(r===Zs(i,t,e,s)>0)for(n=t;n<e;n+=s)o=Wi(n,i[n],i[n+1],o);else for(n=e-s;n>=t;n-=s)o=Wi(n,i[n],i[n+1],o);return o&&ds(o,o.next)&&($e(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)||q(e.prev,e,e.next)===0)){if($e(e),e=t=e.prev,e===e.next)break;s=!0}else e=e.next;while(s||e!==t);return t}function Ve(i,t,e,s,r,n,o){if(i){!o&&n&&Ia(i,s,r,n);for(var a=i,l,u;i.prev!==i.next;){if(l=i.prev,u=i.next,n?wa(i,s,r,n):va(i)){t.push(l.i/e|0),t.push(i.i/e|0),t.push(u.i/e|0),$e(i),i=u.next,a=u.next;continue}if(i=u,i===a){o?o===1?(i=Aa(Jt(i),t,e),Ve(i,t,e,s,r,n,2)):o===2&&Ca(i,t,e,s,r,n):Ve(Jt(i),t,e,s,r,n,1);break}}}}function va(i){var t=i.prev,e=i,s=i.next;if(q(t,e,s)>=0)return!1;for(var r=t.x,n=e.x,o=s.x,a=t.y,l=e.y,u=s.y,h=r<n?r<o?r:o:n<o?n:o,c=a<l?a<u?a:u:l<u?l:u,f=r>n?r>o?r:o:n>o?n:o,m=a>l?a>u?a:u:l>u?l:u,p=s.next;p!==t;){if(p.x>=h&&p.x<=f&&p.y>=c&&p.y<=m&&ue(r,a,n,l,o,u,p.x,p.y)&&q(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function wa(i,t,e,s){var r=i.prev,n=i,o=i.next;if(q(r,n,o)>=0)return!1;for(var a=r.x,l=n.x,u=o.x,h=r.y,c=n.y,f=o.y,m=a<l?a<u?a:u:l<u?l:u,p=h<c?h<f?h:f:c<f?c:f,_=a>l?a>u?a:u:l>u?l:u,d=h>c?h>f?h:f:c>f?c:f,b=qs(m,p,t,e,s),y=qs(_,d,t,e,s),w=i.prevZ,A=i.nextZ;w&&w.z>=b&&A&&A.z<=y;){if(w.x>=m&&w.x<=_&&w.y>=p&&w.y<=d&&w!==r&&w!==o&&ue(a,h,l,c,u,f,w.x,w.y)&&q(w.prev,w,w.next)>=0||(w=w.prevZ,A.x>=m&&A.x<=_&&A.y>=p&&A.y<=d&&A!==r&&A!==o&&ue(a,h,l,c,u,f,A.x,A.y)&&q(A.prev,A,A.next)>=0))return!1;A=A.nextZ}for(;w&&w.z>=b;){if(w.x>=m&&w.x<=_&&w.y>=p&&w.y<=d&&w!==r&&w!==o&&ue(a,h,l,c,u,f,w.x,w.y)&&q(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;A&&A.z<=y;){if(A.x>=m&&A.x<=_&&A.y>=p&&A.y<=d&&A!==r&&A!==o&&ue(a,h,l,c,u,f,A.x,A.y)&&q(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function Aa(i,t,e){var s=i;do{var r=s.prev,n=s.next.next;!ds(r,n)&&Hr(r,s,s.next,n)&&Ne(r,n)&&Ne(n,r)&&(t.push(r.i/e|0),t.push(s.i/e|0),t.push(n.i/e|0),$e(s),$e(s.next),s=i=n),s=s.next}while(s!==i);return Jt(s)}function Ca(i,t,e,s,r,n){var o=i;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Ra(o,a)){var l=Xr(o,a);o=Jt(o,o.next),l=Jt(l,l.next),Ve(o,t,e,s,r,n,0),Ve(l,t,e,s,r,n,0);return}a=a.next}o=o.next}while(o!==i)}function Sa(i,t,e,s){var r=[],n,o,a,l,u;for(n=0,o=t.length;n<o;n++)a=t[n]*s,l=n<o-1?t[n+1]*s:i.length,u=Yr(i,a,l,s,!1),u===u.next&&(u.steiner=!0),r.push(Da(u));for(r.sort(Ma),n=0;n<r.length;n++)e=Pa(r[n],e);return e}function Ma(i,t){return i.x-t.x}function Pa(i,t){var e=ka(i,t);if(!e)return t;var s=Xr(e,i);return Jt(s,s.next),Jt(e,e.next)}function ka(i,t){var e=t,s=i.x,r=i.y,n=-1/0,o;do{if(r<=e.y&&r>=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.next.x?e:e.next,a===s))return o}e=e.next}while(e!==t);if(!o)return null;var l=o,u=o.x,h=o.y,c=1/0,f;e=o;do s>=e.x&&e.x>=u&&s!==e.x&&ue(r<h?s:n,r,u,h,r<h?n:s,r,e.x,e.y)&&(f=Math.abs(r-e.y)/(s-e.x),Ne(e,i)&&(f<c||f===c&&(e.x>o.x||e.x===o.x&&Ta(o,e)))&&(o=e,c=f)),e=e.next;while(e!==l);return o}function Ta(i,t){return q(i.prev,i,t.prev)<0&&q(t.next,i,i.next)<0}function Ia(i,t,e,s){var r=i;do r.z===0&&(r.z=qs(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,Ea(r)}function Ea(i){var t,e,s,r,n,o,a,l,u=1;do{for(e=i,i=null,n=null,o=0;e;){for(o++,s=e,a=0,t=0;t<u&&(a++,s=s.nextZ,!!s);t++);for(l=u;a>0||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,u*=2}while(o>1);return i}function qs(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 Da(i){var t=i,e=i;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==i);return e}function ue(i,t,e,s,r,n,o,a){return(r-o)*(t-a)>=(i-o)*(n-a)&&(i-o)*(s-a)>=(e-o)*(t-a)&&(e-o)*(n-a)>=(r-o)*(s-a)}function Ra(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!Ba(i,t)&&(Ne(i,t)&&Ne(t,i)&&Fa(i,t)&&(q(i.prev,i,t.prev)||q(i,t.prev,t))||ds(i,t)&&q(i.prev,i,i.next)>0&&q(t.prev,t,t.next)>0)}function q(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 Hr(i,t,e,s){var r=Ke(q(i,t,e)),n=Ke(q(i,t,s)),o=Ke(q(e,s,i)),a=Ke(q(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 Ba(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&&Hr(e,e.next,i,t))return!0;e=e.next}while(e!==i);return!1}function Ne(i,t){return q(i.prev,i,i.next)<0?q(i,t,i.next)>=0&&q(i,i.prev,t)>=0:q(i,t,i.prev)<0||q(i,i.next,t)<0}function Fa(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 Xr(i,t){var e=new js(i.i,i.x,i.y),s=new js(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 Wi(i,t,e,s){var r=new js(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 $e(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 js(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}cs.deviation=function(i,t,e,s){var r=t&&t.length,n=r?t[0]*e:i.length,o=Math.abs(Zs(i,0,n,e));if(r)for(var a=0,l=t.length;a<l;a++){var u=t[a]*e,h=a<l-1?t[a+1]*e:i.length;o-=Math.abs(Zs(i,u,h,e))}var c=0;for(a=0;a<s.length;a+=3){var f=s[a]*e,m=s[a+1]*e,p=s[a+2]*e;c+=Math.abs((i[f]-i[p])*(i[m+1]-i[f+1])-(i[f]-i[m])*(i[p+1]-i[f+1]))}return o===0&&c===0?0:Math.abs((c-o)/o)};function Zs(i,t,e,s){for(var r=0,n=t,o=e-s;n<e;n+=s)r+=(i[o]-i[n])*(i[n+1]+i[o+1]),o=n;return r}cs.flatten=function(i){for(var t=i[0][0].length,e={vertices:[],holes:[],dimensions:t},s=0,r=0;r<i.length;r++){for(var n=0;n<i[r].length;n++)for(var o=0;o<t;o++)e.vertices.push(i[r][n][o]);r>0&&(s+=i[r-1].length,e.holes.push(s))}return e};var Va=ui.exports;const Na=ii(Va);Wr=(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))(Wr||{});$a=class{constructor(t){this.items=[],this._name=t}emit(t,e,s,r,n,o,a,l){const{name:u,items:h}=this;for(let c=0,f=h.length;c<f;c++)h[c][u](t,e,s,r,n,o,a,l);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&this.items.splice(e,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}};const Ga=["init","destroy","contextChange","resolutionChange","reset","renderEnd","renderStart","render","update","postrender","prerender"],qr=class jr extends $t{constructor(t){super(),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name;const e=[...Ga,...t.runners??[]];this._addRunners(...e),this._addSystems(t.systems),this._addPipes(t.renderPipes,t.renderPipeAdaptors),this._unsafeEvalCheck()}async init(t={}){for(const e in this._systemsHash)t={...this._systemsHash[e].constructor.defaultOptions,...t};t={...jr.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let e=0;e<this.runners.init.items.length;e++)await this.runners.init.items[e].init(t);this._initOptions=t}render(t,e){let s=t;if(s instanceof dt&&(s={container:s},e&&(J(Q,"passing a second argument is deprecated, please use render options instead"),s.target=e.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor=this.background.colorRgba),s.clearColor){const r=Array.isArray(s.clearColor)&&s.clearColor.length===4;s.clearColor=r?s.clearColor:xt.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s)}resize(t,e,s){this.view.resize(t,e,s),this.emit("resize",this.view.screen.width,this.view.screen.height)}clear(t={}){const e=this;t.target||(t.target=e.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=Wr.ALL);const{clear:s,clearColor:r,target:n}=t;xt.shared.setValue(r??this.background.colorRgba),e.renderTarget.clear(n,s,xt.shared.toArray())}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(e=>{this.runners[e]=new $a(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(!ba())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}};qr.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Qe;Zr=qr;function La(i){return Qe!==void 0||(Qe=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:i??Zr.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Qt.get().getWebGLRenderingContext())return!1;let s=Qt.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 Oa(i={}){return Je!==void 0||(Je=await (async()=>{if(!Qt.get().getNavigator().gpu)return!1;try{return await (await navigator.gpu.requestAdapter(i)).requestDevice(),!0}catch{return!1}})()),Je}const qi=["webgl","webgpu","canvas"];async function Ua(i){let t=[];i.preference?(t.push(i.preference),qi.forEach(n=>{n!==i.preference&&t.push(n)})):t=qi.slice();let e;await xa(i.manageImports??!0);let s={};for(let n=0;n<t.length;n++){const o=t[n];if(o==="webgpu"&&await Oa()){const{WebGPURenderer:a}=await rs(()=>import("./WebGPURenderer-Du7v9tBH.js").then(async m=>{await m.__tla;return m}),__vite__mapDeps([12,2,13,3,5,6,7,8,9,10,11]),import.meta.url);e=a,s={...i,...i.webgpu};break}else if(o==="webgl"&&La(i.failIfMajorPerformanceCaveat??Zr.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await rs(()=>import("./WebGLRenderer-BJRUYaxc.js").then(async m=>{await m.__tla;return m}),__vite__mapDeps([14,2,4,13,5,6,7,8,9,10,11]),import.meta.url);e=a,s={...i,...i.webgl};break}else if(o==="canvas"){s={...i};break}}delete s.webgpu,delete s.webgl;const r=new e;return await r.init(s),r}const Kr=class Ks{constructor(...t){this.stage=new dt,t[0]!==void 0&&J(Q,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.renderer=await Ua(t),Ks._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return J(Q,"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=Ks._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}};Kr._plugins=[];let Qr=Kr;ie.handleByList(tt.Application,Qr._plugins);var za=Ha,Ps={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Ya=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function Ha(i){var t=[];return i.replace(Ya,function(e,s,r){var n=s.toLowerCase();for(r=Wa(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.length<Ps[n])throw new Error("malformed path data");t.push([s].concat(r.splice(0,Ps[n])))}}),t}var Xa=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function Wa(i){var t=i.match(Xa);return t?t.map(Number):[]}const qa=ii(za);function ja(i,t){const e=qa(i),s=[];let r=null,n=0,o=0;for(let a=0;a<e.length;a++){const l=e[a],u=l[0],h=l;switch(u){case"M":n=h[1],o=h[2],t.moveTo(n,o);break;case"m":n+=h[1],o+=h[2],t.moveTo(n,o);break;case"H":n=h[1],t.lineTo(n,o);break;case"h":n+=h[1],t.lineTo(n,o);break;case"V":o=h[1],t.lineTo(n,o);break;case"v":o+=h[1],t.lineTo(n,o);break;case"L":n=h[1],o=h[2],t.lineTo(n,o);break;case"l":n+=h[1],o+=h[2],t.lineTo(n,o);break;case"C":n=h[5],o=h[6],t.bezierCurveTo(h[1],h[2],h[3],h[4],n,o);break;case"c":t.bezierCurveTo(n+h[1],o+h[2],n+h[3],o+h[4],n+h[5],o+h[6]),n+=h[5],o+=h[6];break;case"S":n=h[3],o=h[4],t.bezierCurveToShort(h[1],h[2],n,o);break;case"s":t.bezierCurveToShort(n+h[1],o+h[2],n+h[3],o+h[4]),n+=h[3],o+=h[4];break;case"Q":n=h[3],o=h[4],t.quadraticCurveTo(h[1],h[2],n,o);break;case"q":t.quadraticCurveTo(n+h[1],o+h[2],n+h[3],o+h[4]),n+=h[3],o+=h[4];break;case"T":n=h[1],o=h[2],t.quadraticCurveToShort(n,o);break;case"t":n+=h[1],o+=h[2],t.quadraticCurveToShort(n,o);break;case"A":n=h[6],o=h[7],t.arcToSvg(h[1],h[2],h[3],h[4],h[5],n,o);break;case"a":n+=h[6],o+=h[7],t.arcToSvg(h[1],h[2],h[3],h[4],h[5],n,o);break;case"Z":case"z":t.closePath(),s.length>0&&(r=s.pop(),r?(n=r.startX,o=r.startY):(n=0,o=0)),r=null;break;default:Dt(`Unknown SVG path command: ${u}`)}u!=="Z"&&u!=="z"&&r===null&&(r={startX:n,startY:o},s.push(r))}return t}class ci{constructor(t=0,e=0,s=0){this.type="circle",this.x=t,this.y=e,this.radius=s}clone(){return new ci(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 l<o+a&&l>o-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 di{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 di(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,u=r+o,h=n+o,c=t-this.x,f=e-this.y,m=c*c/(a*a)+f*f/(l*l),p=c*c/(u*u)+f*f/(h*h);return m>1&&p<=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 Za(i,t,e,s,r,n){const o=i-e,a=t-s,l=r-e,u=n-s,h=o*l+a*u,c=l*l+u*u;let f=-1;c!==0&&(f=h/c);let m,p;f<0?(m=e,p=s):f>1?(m=r,p=n):(m=e+f*l,p=s+f*u);const _=i-m,d=t-p;return _*_+d*d}class Ie{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;r<n;r++)s.push(e[r].x,e[r].y);e=s}this.points=e,this.closePath=!0}clone(){const t=this.points.slice(),e=new Ie(t);return e.closePath=this.closePath,e}contains(t,e){let s=!1;const r=this.points.length/2;for(let n=0,o=r-1;n<r;o=n++){const a=this.points[n*2],l=this.points[n*2+1],u=this.points[o*2],h=this.points[o*2+1];l>e!=h>e&&t<(u-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;l<a;l+=2){const u=o[l],h=o[l+1],c=o[(l+2)%o.length],f=o[(l+3)%o.length];if(Za(t,e,u,h,c,f)<=n)return!0}return!1}getBounds(t){t=t||new ot;const e=this.points;let s=1/0,r=-1/0,n=1/0,o=-1/0;for(let a=0,l=e.length;a<l;a+=2){const u=e[a],h=e[a+1];s=u<s?u:s,r=u>r?u:r,n=h<n?h:n,o=h>o?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 fi{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 fi(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,u=s/2,h=r+l,c=n+l,f=o-l*2,m=a-l*2,p=r+o,_=n+a;return(t>=r-u&&t<=r+u||t>=p-u&&t<=p+u)&&e>=c&&e<=c+m||(e>=n-u&&e<=n+u||e>=_-u&&e<=_+u)&&t>=h&&t<=h+f?!0:t<h&&e<c&&ts(t,e,h,c,l,u)||t>p-l&&e<c&&ts(t,e,p-l,c,l,u)||t>p-l&&e>_-l&&ts(t,e,p-l,_-l,l,u)||t<h&&e>_-l&&ts(t,e,h,_-l,l,u)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}ft=(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))(ft||{});Ge=class extends $t{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&ft.STATIC)}set static(t){t?this.descriptor.usage|=ft.STATIC:this.descriptor.usage&=~ft.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.byteLength<r.byteLength?s&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=at("resource"),this.emit("change",this));return}s&&this.emit("update",this)}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}};function Jr(i,t){if(!(i instanceof Ge)){let e=t?ft.INDEX:ft.VERTEX;i instanceof Array&&(t?(i=new Uint32Array(i),e=ft.INDEX|ft.COPY_DST):(i=new Float32Array(i),e=ft.VERTEX|ft.COPY_DST)),i=new Ge({data:i,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:e})}return i}function Ka(i,t,e){const s=i.getAttribute(t);if(!s)return e.minX=0,e.minY=0,e.maxX=0,e.maxY=0,e;const r=s.buffer.data;let n=1/0,o=1/0,a=-1/0,l=-1/0;const u=r.BYTES_PER_ELEMENT,h=(s.offset||0)/u,c=(s.stride||2*4)/u;for(let f=h;f<r.length;f+=c){const m=r[f],p=r[f+1];m>a&&(a=m),p>l&&(l=p),m<n&&(n=m),p<o&&(o=p)}return e.minX=n,e.minY=o,e.maxX=a,e.maxY=l,e}function Qa(i){return(i instanceof Ge||Array.isArray(i)||i.BYTES_PER_ELEMENT)&&(i={buffer:i}),i.buffer=Jr(i.buffer,!1),i}Ja=class extends $t{constructor(t){const{attributes:e,indexBuffer:s,topology:r}=t;super(),this.uid=at("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new Rt,this._boundsDirty=!0,this.attributes=e,this.buffers=[],this.instanceCount=t.instanceCount||1;for(const n in e){const o=e[n]=Qa(e[n]);this.buffers.indexOf(o.buffer)===-1&&(this.buffers.push(o.buffer),o.buffer.on("update",this.onBufferUpdate,this),o.buffer.on("change",this.onBufferUpdate,this))}s&&(this.indexBuffer=Jr(s,!0),this.buffers.push(this.indexBuffer)),this.topology=r||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const e=this.attributes[t];return e.buffer.data.length/(e.stride/4||e.size)}return 0}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,Ka(this,"aPosition",this._bounds)):this._bounds}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(e=>e.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}};const tl=new Float32Array(1),el=new Uint32Array(1);sl=class extends Ja{constructor(){const e=new Ge({data:tl,label:"attribute-batch-buffer",usage:ft.VERTEX|ft.COPY_DST,shrinkToFit:!1}),s=new Ge({data:el,label:"index-batch-buffer",usage:ft.INDEX|ft.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 en;tn=16;en={};il=function(i,t){let e=0;for(let s=0;s<t;s++)e=e*31+i[s].uid>>>0;return en[e]||rl(i,e)};function rl(i,t){const e={};let s=0;for(let n=0;n<tn;n++){const o=n<i.length?i[n]:Y.EMPTY.source;e[s++]=o.source,e[s++]=o.style}const r=new ya(e);return en[t]=r,r}class ji{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this.uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}Zi=function(i,t){const e=i.byteLength/8|0,s=new Float64Array(i,0,e);new Float64Array(t,0,e).set(s);const n=i.byteLength-e*8;if(n>0){const o=new Uint8Array(i,e*8,n);new Uint8Array(t,e*8,n).set(o)}};const nl={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};ol=(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))(ol||{});function Ki(i,t){return t.alphaMode==="no-premultiply-alpha"&&nl[i]||i}class Qi{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const e=this.textures[t];this.textures[t]=null,this.ids[e.uid]=null}this.count=0}}class Ji{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.blendMode="normal",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null}}let Ce=0;const sn=class rn{constructor(t={}){this.uid=at("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._vertexSize=6,this._elements=[],this._batchPool=[],this._batchPoolIndex=0,this._textureBatchPool=[],this._textureBatchPoolIndex=0,t={...rn.defaultOptions,...t};const{vertexSize:e,indexSize:s}=t;this.attributeBuffer=new ji(e*this._vertexSize*4),this.indexBuffer=new Uint16Array(s)}begin(){this.batchIndex=0,this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0,this._batchPoolIndex=0,this._textureBatchPoolIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t.indexStart=this.indexSize,t.location=this.attributeSize,t.batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.vertexSize*this._vertexSize}checkAndUpdateTexture(t,e){const s=t.batch.textures.ids[e._source.uid];return!s&&s!==0?!1:(t.textureId=s,t.texture=e,!0)}updateElement(t){this.dirty=!0,t.packAttributes(this.attributeBuffer.float32View,this.attributeBuffer.uint32View,t.location,t.textureId)}break(t){const e=this._elements;let s=this._textureBatchPool[this._textureBatchPoolIndex++]||new Qi;if(s.clear(),!e[this.elementStart])return;const r=e[this.elementStart];let n=Ki(r.blendMode,r.texture._source);this.attributeSize*4>this.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 u=this._batchIndexSize,h=this._batchIndexStart,c="startBatch",f=this._batchPool[this._batchPoolIndex++]||new Ji;for(let m=this.elementStart;m<this.elementSize;++m){const p=e[m];e[m]=null;const d=p.texture._source,b=Ki(p.blendMode,d),y=n!==b;if(d._batchTick===Ce&&!y){p.textureId=d._textureBindLocation,u+=p.indexSize,p.packAttributes(o,a,p.location,p.textureId),p.packIndex(l,p.indexStart,p.location/this._vertexSize),p.batch=f;continue}d._batchTick=Ce,(s.count>=tn||y)&&(this._finishBatch(f,h,u-h,s,n,t,c),c="renderBatch",h=u,n=b,s=this._textureBatchPool[this._textureBatchPoolIndex++]||new Qi,s.clear(),f=this._batchPool[this._batchPoolIndex++]||new Ji,++Ce),p.textureId=d._textureBindLocation=s.count,s.ids[d.uid]=s.count,s.textures[s.count++]=d,p.batch=f,u+=p.indexSize,p.packAttributes(o,a,p.location,p.textureId),p.packIndex(l,p.indexStart,p.location/this._vertexSize)}s.count>0&&(this._finishBatch(f,h,u-h,s,n,t,c),h=u,++Ce),this.elementStart=this.elementSize,this._batchIndexStart=h,this._batchIndexSize=u}_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,++Ce,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 ji(e);Zi(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<e.length;n++)r[n]=e[n];else Zi(e.buffer,r.buffer);this.indexBuffer=r}destroy(){for(let t=0;t<this.batches.length;t++)this.batches[t].destroy();this.batches=null;for(let t=0;t<this._elements.length;t++)this._elements[t].batch=null;this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}};sn.defaultOptions={vertexSize:4,indexSize:6};al=sn;function ll(i,t,e,s,r,n,o,a=null){let l=0;e*=t,r*=n;const u=a.a,h=a.b,c=a.c,f=a.d,m=a.tx,p=a.ty;for(;l<o;){const _=i[e],d=i[e+1];s[r]=u*_+c*d+m,s[r+1]=h*_+f*d+p,r+=n,e+=t,l++}}function hl(i,t,e,s){let r=0;for(t*=e;r<s;)i[t]=0,i[t+1]=0,t+=e,r++}function nn(i,t,e,s,r){const n=t.a,o=t.b,a=t.c,l=t.d,u=t.tx,h=t.ty;e=e||0,s=s||2,r=r||i.length/s-e;let c=e*s;for(let f=0;f<r;f++){const m=i[c],p=i[c+1];i[c]=n*m+a*p+u,i[c+1]=o*m+l*p+h,c+=s}}function ul(i,t,e){const s=i>>16&255,r=i>>8&255,n=i&255,o=t>>16&255,a=t>>8&255,l=t&255,u=s+(o-s)*e,h=r+(a-r)*e,c=n+(l-n)*e;return(u<<16)+(h<<8)+c}const ks=16777215;cl=function(i,t){return i===ks||t===ks?i+t-ks:ul(i,t,.5)};on=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<this.indexSize;n++)t[e++]=r[n+this.indexOffset]+s-this.vertexOffset}packAttributes(t,e,s,r){const n=this.geometryData,o=this.renderable,a=n.vertices,l=n.uvs,u=this.vertexOffset*2,h=(this.vertexOffset+this.vertexSize)*2,c=this.color,f=c>>16|c&65280|(c&255)<<16;if(this.applyTransform){const m=cl(f,o.groupColor)+(this.alpha*o.groupAlpha*255<<24),p=o.groupTransform,_=r<<16|this.roundPixels&65535,d=p.a,b=p.b,y=p.c,w=p.d,A=p.tx,P=p.ty;for(let E=u;E<h;E+=2){const v=a[E],D=a[E+1];t[s]=d*v+y*D+A,t[s+1]=b*v+w*D+P,t[s+2]=l[E],t[s+3]=l[E+1],e[s+4]=m,e[s+5]=_,s+=6}}else{const m=f+(this.alpha*255<<24);for(let p=u;p<h;p+=2)t[s]=a[p],t[s+1]=a[p+1],t[s+2]=l[p],t[s+3]=l[p+1],e[s+4]=m,e[s+5]=r<<16,s+=6}}get vertSize(){return this.vertexSize}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.vertexOffset=this.vertexOffset,t.vertexSize=this.vertexSize,t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData}reset(){this.applyTransform=!0}};const Ts={build(i,t){let e,s,r,n,o,a;if(i.type==="circle"){const A=i;e=A.x,s=A.y,o=a=A.radius,r=n=0}else if(i.type==="ellipse"){const A=i;e=A.x,s=A.y,o=A.halfWidth,a=A.halfHeight,r=n=0}else{const A=i,P=A.width/2,E=A.height/2;e=A.x+P,s=A.y+E,o=a=Math.max(0,Math.min(A.radius,Math.min(P,E))),r=P-o,n=E-a}if(!(o>=0&&a>=0&&r>=0&&n>=0))return t;const l=Math.ceil(2.3*Math.sqrt(o+a)),u=l*8+(r?4:0)+(n?4:0);if(u===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,c=l*4+(r?2:0)+2,f=c,m=u,p=r+o,_=n,d=e+p,b=e-p,y=s+_;if(t[h++]=d,t[h++]=y,t[--c]=y,t[--c]=b,n){const A=s-_;t[f++]=b,t[f++]=A,t[--m]=A,t[--m]=d}for(let A=1;A<l;A++){const P=Math.PI/2*(A/l),E=r+Math.cos(P)*o,v=n+Math.sin(P)*a,D=e+E,C=e-E,T=s+v,j=s-v;t[h++]=D,t[h++]=T,t[--c]=T,t[--c]=C,t[f++]=C,t[f++]=j,t[--m]=j,t[--m]=D}p=r,_=n+a,d=e+p,b=e-p,y=s+_;const w=s-_;return t[h++]=d,t[h++]=y,t[--m]=w,t[--m]=d,r&&(t[h++]=b,t[h++]=y,t[--m]=w,t[--m]=b),t},triangulate(i,t,e,s,r,n){if(i.length===0)return;let o=0,a=0;for(let h=0;h<i.length;h+=2)o+=i[h],a+=i[h+1];o/=i.length/2,a/=i.length/2;let l=s;t[l*e]=o,t[l*e+1]=a;const u=l++;for(let h=0;h<i.length;h+=2)t[l*e]=i[h],t[l*e+1]=i[h+1],h>0&&(r[n++]=l,r[n++]=u,r[n++]=l-1),l++;r[n++]=u+1,r[n++]=u,r[n++]=l-1}},dl=1e-4,tr=1e-4;function fl(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];s<t;s+=2){const o=i[s],a=i[s+1];e+=(o-r)*(a+n),r=o,n=a}return e<0?-1:1}function er(i,t,e,s,r,n,o,a){const l=i-e*r,u=t-s*r,h=i+e*n,c=t+s*n;let f,m;o?(f=s,m=-e):(f=-s,m=e);const p=l+f,_=u+m,d=h+f,b=c+m;return a.push(p,_),a.push(d,b),2}function Ht(i,t,e,s,r,n,o,a){const l=e-i,u=s-t;let h=Math.atan2(l,u),c=Math.atan2(r-i,n-t);a&&h<c?h+=Math.PI*2:!a&&h>c&&(c+=Math.PI*2);let f=h;const m=c-h,p=Math.abs(m),_=Math.sqrt(l*l+u*u),d=(15*p*Math.sqrt(_)/Math.PI>>0)+1,b=m/d;if(f+=b,a){o.push(i,t),o.push(e,s);for(let y=1,w=f;y<d;y++,w+=b)o.push(i,t),o.push(i+Math.sin(w)*_,t+Math.cos(w)*_);o.push(i,t),o.push(r,n)}else{o.push(e,s),o.push(i,t);for(let y=1,w=f;y<d;y++,w+=b)o.push(i+Math.sin(w)*_,t+Math.cos(w)*_),o.push(i,t);o.push(r,n),o.push(i,t)}return d*2}function pl(i,t,e,s,r,n,o,a,l){const u=dl;if(i.length===0)return;const h=t;let c=h.alignment;if(t.alignment!==.5){let U=fl(i);e&&(U*=-1),c=(c-.5)*U+.5}const f=new ut(i[0],i[1]),m=new ut(i[i.length-2],i[i.length-1]),p=s,_=Math.abs(f.x-m.x)<u&&Math.abs(f.y-m.y)<u;if(p){i=i.slice(),_&&(i.pop(),i.pop(),m.set(i[i.length-2],i[i.length-1]));const U=(f.x+m.x)*.5,Ft=(m.y+f.y)*.5;i.unshift(U,Ft),i.push(U,Ft)}const d=r,b=i.length/2;let y=i.length;const w=d.length/2,A=h.width/2,P=A*A,E=h.miterLimit*h.miterLimit;let v=i[0],D=i[1],C=i[2],T=i[3],j=0,Tt=0,F=-(D-T),B=v-C,H=0,Z=0,vt=Math.sqrt(F*F+B*B);F/=vt,B/=vt,F*=A,B*=A;const gi=c,R=(1-gi)*2,N=gi*2;p||(h.cap==="round"?y+=Ht(v-F*(R-N)*.5,D-B*(R-N)*.5,v-F*R,D-B*R,v+F*N,D+B*N,d,!0)+2:h.cap==="square"&&(y+=er(v,D,F,B,R,N,!0,d))),d.push(v-F*R,D-B*R),d.push(v+F*N,D+B*N);for(let U=1;U<b-1;++U){v=i[(U-1)*2],D=i[(U-1)*2+1],C=i[U*2],T=i[U*2+1],j=i[(U+1)*2],Tt=i[(U+1)*2+1],F=-(D-T),B=v-C,vt=Math.sqrt(F*F+B*B),F/=vt,B/=vt,F*=A,B*=A,H=-(T-Tt),Z=C-j,vt=Math.sqrt(H*H+Z*Z),H/=vt,Z/=vt,H*=A,Z*=A;const Ft=C-v,ye=D-T,xe=C-j,be=Tt-T,yi=Ft*xe+ye*be,Ue=ye*xe-be*Ft,ve=Ue<0;if(Math.abs(Ue)<.001*Math.abs(yi)){d.push(C-F*R,T-B*R),d.push(C+F*N,T+B*N),yi>=0&&(h.join==="round"?y+=Ht(C,T,C-F*R,T-B*R,C-H*R,T-Z*R,d,!1)+4:y+=2,d.push(C-H*N,T-Z*N),d.push(C+H*R,T+Z*R));continue}const xi=(-F+v)*(-B+T)-(-F+C)*(-B+D),bi=(-H+j)*(-Z+T)-(-H+C)*(-Z+Tt),ze=(Ft*bi-xe*xi)/Ue,Ye=(be*xi-ye*bi)/Ue,fs=(ze-C)*(ze-C)+(Ye-T)*(Ye-T),Lt=C+(ze-C)*R,Ot=T+(Ye-T)*R,Ut=C-(ze-C)*N,zt=T-(Ye-T)*N,pn=Math.min(Ft*Ft+ye*ye,xe*xe+be*be),vi=ve?R:N,mn=pn+vi*vi*P;fs<=mn?h.join==="bevel"||fs/P>E?(ve?(d.push(Lt,Ot),d.push(C+F*N,T+B*N),d.push(Lt,Ot),d.push(C+H*N,T+Z*N)):(d.push(C-F*R,T-B*R),d.push(Ut,zt),d.push(C-H*R,T-Z*R),d.push(Ut,zt)),y+=2):h.join==="round"?ve?(d.push(Lt,Ot),d.push(C+F*N,T+B*N),y+=Ht(C,T,C+F*N,T+B*N,C+H*N,T+Z*N,d,!0)+4,d.push(Lt,Ot),d.push(C+H*N,T+Z*N)):(d.push(C-F*R,T-B*R),d.push(Ut,zt),y+=Ht(C,T,C-F*R,T-B*R,C-H*R,T-Z*R,d,!1)+4,d.push(C-H*R,T-Z*R),d.push(Ut,zt)):(d.push(Lt,Ot),d.push(Ut,zt)):(d.push(C-F*R,T-B*R),d.push(C+F*N,T+B*N),h.join==="round"?ve?y+=Ht(C,T,C+F*N,T+B*N,C+H*N,T+Z*N,d,!0)+2:y+=Ht(C,T,C-F*R,T-B*R,C-H*R,T-Z*R,d,!1)+2:h.join==="miter"&&fs/P<=E&&(ve?(d.push(Ut,zt),d.push(Ut,zt)):(d.push(Lt,Ot),d.push(Lt,Ot)),y+=2),d.push(C-H*R,T-Z*R),d.push(C+H*N,T+Z*N),y+=2)}v=i[(b-2)*2],D=i[(b-2)*2+1],C=i[(b-1)*2],T=i[(b-1)*2+1],F=-(D-T),B=v-C,vt=Math.sqrt(F*F+B*B),F/=vt,B/=vt,F*=A,B*=A,d.push(C-F*R,T-B*R),d.push(C+F*N,T+B*N),p||(h.cap==="round"?y+=Ht(C-F*(R-N)*.5,T-B*(R-N)*.5,C-F*R,T-B*R,C+F*N,T+B*N,d,!1)+2:h.cap==="square"&&(y+=er(C,T,F,B,R,N,!1,d)));const fn=tr*tr;for(let U=w;U<y+w-2;++U)v=d[U*2],D=d[U*2+1],C=d[(U+1)*2],T=d[(U+1)*2+1],j=d[(U+2)*2],Tt=d[(U+2)*2+1],!(Math.abs(v*(T-Tt)+C*(Tt-D)+j*(D-T))<fn)&&a.push(U,U+1,U+2)}function an(i,t,e,s,r,n,o){const a=Na(i,t,2);if(!a)return;for(let u=0;u<a.length;u+=3)n[o++]=a[u]+r,n[o++]=a[u+1]+r,n[o++]=a[u+2]+r;let l=r*s;for(let u=0;u<i.length;u+=2)e[l]=i[u],e[l+1]=i[u+1],l+=s}const ml=[],_l={build(i,t){for(let e=0;e<i.points.length;e++)t[e]=i.points[e];return t},triangulate(i,t,e,s,r,n){an(i,ml,t,e,s,r,n)}},gl={build(i,t){const e=i,s=e.x,r=e.y,n=e.width,o=e.height;return n>=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}},yl={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}},pi={rectangle:gl,polygon:_l,triangle:yl,circle:Ts,ellipse:Ts,roundedRectangle:Ts},xl=new ot;function bl(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<i.instructions.length;r++){const n=i.instructions[r];if(n.action==="texture")vl(n.data,s,e);else if(n.action==="fill"||n.action==="stroke"){const o=n.action==="stroke",a=n.data.path.shapePath,l=n.data.style,u=n.data.hole;o&&u&&sr(u.shapePath,l,null,!0,s,e),sr(a,l,u,o,s,e)}}}function vl(i,t,e){const{vertices:s,uvs:r,indices:n}=e,o=n.length,a=s.length/2,l=[],u=pi.rectangle,h=xl,c=i.image;h.x=i.dx,h.y=i.dy,h.width=i.dw,h.height=i.dh;const f=i.transform;u.build(h,l),f&&nn(l,f),u.triangulate(l,s,2,a,n,o);const m=c.uvs;r.push(m.x0,m.y0,m.x1,m.y1,m.x3,m.y3,m.x2,m.y2);const p=St.get(on);p.indexOffset=o,p.indexSize=n.length-o,p.vertexOffset=a,p.vertexSize=s.length/2-a,p.color=i.style,p.alpha=i.alpha,p.texture=c,p.geometryData=e,t.push(p)}function sr(i,t,e,s,r,n){const{vertices:o,uvs:a,indices:l}=n,u=i.shapePrimitives.length-1;i.shapePrimitives.forEach(({shape:h,transform:c},f)=>{const m=l.length,p=o.length/2,_=[],d=pi[h.type];if(d.build(h,_),c&&nn(_,c),s){const A=h.closePath??!0;pl(_,t,!1,A,o,2,p,l)}else if(e&&u===f){u!==0&&console.warn("[Pixi Graphics] only the last shape have be cut out");const A=[],P=_.slice();wl(e.shapePath).forEach(v=>{A.push(P.length/2),P.push(...v)}),an(P,A,o,2,p,l,m)}else d.triangulate(_,o,2,p,l,m);const b=a.length/2,y=t.texture;if(y!==Y.WHITE){const A=t.matrix;c&&A.append(c.clone().invert()),ll(o,2,p,a,b,2,o.length/2-p,A)}else hl(a,b,2,o.length/2-p);const w=St.get(on);w.indexOffset=m,w.indexSize=l.length-m,w.vertexOffset=p,w.vertexSize=o.length/2-p,w.color=t.color,w.alpha=t.alpha,w.texture=y,w.geometryData=n,r.push(w)})}function wl(i){if(!i)return[];const t=i.shapePrimitives,e=[];for(let s=0;s<t.length;s++){const r=t[s].shape,n=[];pi[r.type].build(r,n),e.push(n)}return e}class Al{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}}class Cl{constructor(){this.geometry=new sl,this.instructions=new Tr}init(){this.instructions.reset()}}const mi=class Qs{constructor(){this._activeBatchers=[],this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),this._needsContextNeedsRebuild=[]}init(t){Qs.defaultOptions.bezierSmoothness=t?.bezierSmoothness??Qs.defaultOptions.bezierSmoothness}prerender(){this._returnActiveBatchers()}getContextRenderData(t){return this._graphicsDataContextHash[t.uid]||this._initContextRenderData(t)}updateGpuContext(t){let e=this._gpuContextHash[t.uid]||this._initContext(t);if(t.dirty){e?this._cleanGraphicsContextData(t):e=this._initContext(t),bl(t,e);const s=t.batchMode;t.customShader||s==="no-batch"?e.isBatchable=!1:s==="auto"&&(e.isBatchable=e.geometryData.vertices.length<400),t.dirty=!1}return e}getGpuContext(t){return this._gpuContextHash[t.uid]||this._initContext(t)}_returnActiveBatchers(){for(let t=0;t<this._activeBatchers.length;t++)St.return(this._activeBatchers[t]);this._activeBatchers.length=0}_initContextRenderData(t){const e=St.get(Cl),{batches:s,geometryData:r}=this._gpuContextHash[t.uid],n=r.vertices.length,o=r.indices.length;for(let h=0;h<s.length;h++)s[h].applyTransform=!1;const a=St.get(al);this._activeBatchers.push(a),a.ensureAttributeBuffer(n),a.ensureIndexBuffer(o),a.begin();for(let h=0;h<s.length;h++){const c=s[h];a.add(c)}a.finish(e.instructions);const l=e.geometry;l.indexBuffer.setDataWithSize(a.indexBuffer,a.indexSize,!0),l.buffers[0].setDataWithSize(a.attributeBuffer.float32View,a.attributeSize,!0);const u=a.batches;for(let h=0;h<u.length;h++){const c=u[h];c.bindGroup=il(c.textures.textures,c.textures.count)}return this._graphicsDataContextHash[t.uid]=e,e}_initContext(t){const e=new Al;return this._gpuContextHash[t.uid]=e,t.on("update",this.onGraphicsContextUpdate,this),t.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[t.uid]}onGraphicsContextUpdate(t){this._needsContextNeedsRebuild.push(t)}onGraphicsContextDestroy(t){this._cleanGraphicsContextData(t),t.off("update",this.onGraphicsContextUpdate,this),t.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[t.uid]=null}_cleanGraphicsContextData(t){const e=this._gpuContextHash[t.uid];e.isBatchable||this._graphicsDataContextHash[t.uid]&&(St.return(this.getContextRenderData(t)),this._graphicsDataContextHash[t.uid]=null),e.batches&&e.batches.forEach(s=>{St.return(s)})}destroy(){for(const t of this._needsContextNeedsRebuild)this._gpuContextHash[t.uid]&&this.onGraphicsContextDestroy(t);this._needsContextNeedsRebuild.length=0}};mi.extension={type:[tt.WebGLSystem,tt.WebGPUSystem,tt.CanvasSystem],name:"graphicsContext"};mi.defaultOptions={bezierSmoothness:.5};ln=mi;const Sl=8,es=11920929e-14,Ml=1;function hn(i,t,e,s,r,n,o,a,l,u){const c=Math.min(.99,Math.max(0,u??ln.defaultOptions.bezierSmoothness));let f=(Ml-c)/1;return f*=f,Pl(t,e,s,r,n,o,a,l,i,f),i}function Pl(i,t,e,s,r,n,o,a,l,u){Js(i,t,e,s,r,n,o,a,l,u,0),l.push(o,a)}function Js(i,t,e,s,r,n,o,a,l,u,h){if(h>Sl)return;const c=(i+e)/2,f=(t+s)/2,m=(e+r)/2,p=(s+n)/2,_=(r+o)/2,d=(n+a)/2,b=(c+m)/2,y=(f+p)/2,w=(m+_)/2,A=(p+d)/2,P=(b+w)/2,E=(y+A)/2;if(h>0){let v=o-i,D=a-t;const C=Math.abs((e-o)*D-(s-a)*v),T=Math.abs((r-o)*D-(n-a)*v);if(C>es&&T>es){if((C+T)*(C+T)<=u*(v*v+D*D)){l.push(P,E);return}}else if(C>es){if(C*C<=u*(v*v+D*D)){l.push(P,E);return}}else if(T>es){if(T*T<=u*(v*v+D*D)){l.push(P,E);return}}else if(v=P-(i+o)/2,D=E-(t+a)/2,v*v+D*D<=u){l.push(P,E);return}}Js(i,t,c,f,b,y,P,E,l,u,h+1),Js(P,E,w,A,_,d,o,a,l,u,h+1)}const kl=8,Tl=11920929e-14,Il=1;function El(i,t,e,s,r,n,o,a){const u=Math.min(.99,Math.max(0,a??ln.defaultOptions.bezierSmoothness));let h=(Il-u)/1;return h*=h,Dl(t,e,s,r,n,o,i,h),i}function Dl(i,t,e,s,r,n,o,a){ti(o,i,t,e,s,r,n,a,0),o.push(r,n)}function ti(i,t,e,s,r,n,o,a,l){if(l>kl)return;const u=(t+s)/2,h=(e+r)/2,c=(s+n)/2,f=(r+o)/2,m=(u+c)/2,p=(h+f)/2;let _=n-t,d=o-e;const b=Math.abs((s-n)*d-(r-o)*_);if(b>Tl){if(b*b<=a*(_*_+d*d)){i.push(m,p);return}}else if(_=m-(t+n)/2,d=p-(e+o)/2,_*_+d*d<=a){i.push(m,p);return}ti(i,t,e,u,h,m,p,a,l+1),ti(i,m,p,c,f,n,o,a,l+1)}function un(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 u=l/a,h=r;u*=o?-1:1;for(let c=0;c<a+1;c++){const f=Math.cos(h),m=Math.sin(h),p=t+f*s,_=e+m*s;i.push(p,_),h+=u}}function Rl(i,t,e,s,r,n){const o=i[i.length-2],l=i[i.length-1]-e,u=o-t,h=r-e,c=s-t,f=Math.abs(l*c-u*h);if(f<1e-8||n===0){(i[i.length-2]!==t||i[i.length-1]!==e)&&i.push(t,e);return}const m=l*l+u*u,p=h*h+c*c,_=l*h+u*c,d=n*Math.sqrt(m)/f,b=n*Math.sqrt(p)/f,y=d*_/m,w=b*_/p,A=d*c+b*u,P=d*h+b*l,E=u*(b+y),v=l*(b+y),D=c*(d+w),C=h*(d+w),T=Math.atan2(v-P,E-A),j=Math.atan2(C-P,D-A);un(i,A+t,P+e,n,T,j,u*h>c*l)}const Ee=Math.PI*2,Is={centerX:0,centerY:0,ang1:0,ang2:0},Es=({x:i,y:t},e,s,r,n,o,a,l)=>{i*=e,t*=s;const u=r*i-n*t,h=n*i+r*t;return l.x=u+o,l.y=h+a,l};function Bl(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 ir=(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)},Fl=(i,t,e,s,r,n,o,a,l,u,h,c,f)=>{const m=Math.pow(r,2),p=Math.pow(n,2),_=Math.pow(h,2),d=Math.pow(c,2);let b=m*p-m*d-p*_;b<0&&(b=0),b/=m*d+p*_,b=Math.sqrt(b)*(o===a?-1:1);const y=b*r/n*c,w=b*-n/r*h,A=u*y-l*w+(i+e)/2,P=l*y+u*w+(t+s)/2,E=(h-y)/r,v=(c-w)/n,D=(-h-y)/r,C=(-c-w)/n,T=ir(1,0,E,v);let j=ir(E,v,D,C);a===0&&j>0&&(j-=Ee),a===1&&j<0&&(j+=Ee),f.centerX=A,f.centerY=P,f.ang1=T,f.ang2=j};function Vl(i,t,e,s,r,n,o,a=0,l=0,u=0){if(n===0||o===0)return;const h=Math.sin(a*Ee/360),c=Math.cos(a*Ee/360),f=c*(t-s)/2+h*(e-r)/2,m=-h*(t-s)/2+c*(e-r)/2;if(f===0&&m===0)return;n=Math.abs(n),o=Math.abs(o);const p=Math.pow(f,2)/Math.pow(n,2)+Math.pow(m,2)/Math.pow(o,2);p>1&&(n*=Math.sqrt(p),o*=Math.sqrt(p)),Fl(t,e,s,r,n,o,l,u,h,c,f,m,Is);let{ang1:_,ang2:d}=Is;const{centerX:b,centerY:y}=Is;let w=Math.abs(d)/(Ee/4);Math.abs(1-w)<1e-7&&(w=1);const A=Math.max(Math.ceil(w),1);d/=A;let P=i[i.length-2],E=i[i.length-1];const v={x:0,y:0};for(let D=0;D<A;D++){const C=Bl(_,d),{x:T,y:j}=Es(C[0],n,o,c,h,b,y,v),{x:Tt,y:F}=Es(C[1],n,o,c,h,b,y,v),{x:B,y:H}=Es(C[2],n,o,c,h,b,y,v);hn(i,P,E,T,j,Tt,F,B,H),P=B,E=H,_+=d}}function Nl(i,t,e){const s=(o,a)=>{const l=a.x-o.x,u=a.y-o.y,h=Math.sqrt(l*l+u*u),c=l/h,f=u/h;return{len:h,nx:c,ny:f}},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;o<t.length;o++){const a=t[o%t.length],l=a.radius??e;if(l<=0){r(o,a),n=a;continue}const u=t[(o+1)%t.length],h=s(a,n),c=s(a,u);if(h.len<1e-4||c.len<1e-4){r(o,a),n=a;continue}let f=Math.asin(h.nx*c.ny-h.ny*c.nx),m=1,p=!1;h.nx*c.nx-h.ny*-c.ny<0?f<0?f=Math.PI+f:(f=Math.PI-f,m=-1,p=!0):f>0&&(m=-1,p=!0);const _=f/2;let d,b=Math.abs(Math.cos(_)*l/Math.sin(_));b>Math.min(h.len/2,c.len/2)?(b=Math.min(h.len/2,c.len/2),d=Math.abs(b*Math.sin(_)/Math.cos(_))):d=l;const y=a.x+c.nx*b+-c.ny*d*m,w=a.y+c.ny*b+c.nx*d*m,A=Math.atan2(h.ny,h.nx)+Math.PI/2*m,P=Math.atan2(c.ny,c.nx)-Math.PI/2*m;o===0&&i.moveTo(y+Math.cos(A)*d,w+Math.sin(A)*d),i.arc(y,w,d,A,P,p),n=a}}function $l(i,t,e,s){const r=(a,l)=>Math.sqrt((a.x-l.x)**2+(a.y-l.y)**2),n=(a,l,u)=>({x:a.x+(l.x-a.x)*u,y:a.y+(l.y-a.y)*u}),o=t.length;for(let a=0;a<o;a++){const l=t[(a+1)%o],u=l.radius??e;if(u<=0){a===0?i.moveTo(l.x,l.y):i.lineTo(l.x,l.y);continue}const h=t[a],c=t[(a+2)%o],f=r(h,l);let m;if(f<1e-4)m=l;else{const d=Math.min(f/2,u);m=n(l,h,d/f)}const p=r(c,l);let _;if(p<1e-4)_=l;else{const d=Math.min(p/2,u);_=n(l,c,d/p)}a===0?i.moveTo(m.x,m.y):i.lineTo(m.x,m.y),i.quadraticCurveTo(l.x,l.y,_.x,_.y,s)}}const Gl=new ot;class Ll{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new Rt,this._graphicsPath2D=t}moveTo(t,e){return this.startPoly(t,e),this}lineTo(t,e){this._ensurePoly();const s=this._currentPoly.points,r=s[s.length-2],n=s[s.length-1];return(r!==t||n!==e)&&s.push(t,e),this}arc(t,e,s,r,n,o){this._ensurePoly(!1);const a=this._currentPoly.points;return un(a,t,e,s,r,n,o),this}arcTo(t,e,s,r,n){this._ensurePoly();const o=this._currentPoly.points;return Rl(o,t,e,s,r,n),this}arcToSvg(t,e,s,r,n,o,a){const l=this._currentPoly.points;return Vl(l,this._currentPoly.lastX,this._currentPoly.lastY,o,a,t,e,s,r,n),this}bezierCurveTo(t,e,s,r,n,o,a){this._ensurePoly();const l=this._currentPoly;return hn(this._currentPoly.points,l.lastX,l.lastY,t,e,s,r,n,o,a),this}quadraticCurveTo(t,e,s,r,n){this._ensurePoly();const o=this._currentPoly;return El(this._currentPoly.points,o.lastX,o.lastY,t,e,s,r,n),this}closePath(){return this.endPoly(!0),this}addPath(t,e){this.endPoly(),e&&!e.isIdentity()&&(t=t.clone(!0),t.transform(e));for(let s=0;s<t.instructions.length;s++){const r=t.instructions[s];this[r.action](...r.data)}return this}finish(t=!1){this.endPoly(t)}rect(t,e,s,r,n){return this.drawShape(new ot(t,e,s,r),n),this}circle(t,e,s,r){return this.drawShape(new ci(t,e,s),r),this}poly(t,e,s){const r=new Ie(t);return r.closePath=e,this.drawShape(r,s),this}regularPoly(t,e,s,r,n=0,o){r=Math.max(r|0,3);const a=-1*Math.PI/2+n,l=Math.PI*2/r,u=[];for(let h=0;h<r;h++){const c=h*l+a;u.push(t+s*Math.cos(c),e+s*Math.sin(c))}return this.poly(u,!0,o),this}roundPoly(t,e,s,r,n,o=0,a){if(r=Math.max(r|0,3),n<=0)return this.regularPoly(t,e,s,r,o);const l=s*Math.sin(Math.PI/r)-.001;n=Math.min(n,l);const u=-1*Math.PI/2+o,h=Math.PI*2/r,c=(r-2)*Math.PI/r/2;for(let f=0;f<r;f++){const m=f*h+u,p=t+s*Math.cos(m),_=e+s*Math.sin(m),d=m+Math.PI+c,b=m-Math.PI-c,y=p+n*Math.cos(d),w=_+n*Math.sin(d),A=p+n*Math.cos(b),P=_+n*Math.sin(b);f===0?this.moveTo(y,w):this.lineTo(y,w),this.quadraticCurveTo(p,_,A,P,a)}return this.closePath()}roundShape(t,e,s=!1,r){return t.length<3?this:(s?$l(this,t,e,r):Nl(this,t,e),this.closePath())}filletRect(t,e,s,r,n){if(n===0)return this.rect(t,e,s,r);const o=Math.min(s,r)/2,a=Math.min(o,Math.max(-o,n)),l=t+s,u=e+r,h=a<0?-a:0,c=Math.abs(a);return this.moveTo(t,e+c).arcTo(t+h,e+h,t+c,e,c).lineTo(l-c,e).arcTo(l-h,e+h,l,e+c,c).lineTo(l,u-c).arcTo(l-h,u-h,t+s-c,u,c).lineTo(t+c,u).arcTo(t+h,u-h,t,u-c,c).closePath()}chamferRect(t,e,s,r,n,o){if(n<=0)return this.rect(t,e,s,r);const a=Math.min(n,Math.min(s,r)/2),l=t+s,u=e+r,h=[t+a,e,l-a,e,l,e+a,l,u-a,l-a,u,t+a,u,t,u-a,t,e+a];for(let c=h.length-1;c>=2;c-=2)h[c]===h[c-2]&&h[c-1]===h[c-3]&&h.splice(c-1,2);return this.poly(h,!0,o)}ellipse(t,e,s,r,n){return this.drawShape(new di(t,e,s,r),n),this}roundRect(t,e,s,r,n,o){return this.drawShape(new fi(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 Ie,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 Ie,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;e<t.instructions.length;e++){const s=t.instructions[e];this[s.action](...s.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const e=this.shapePrimitives;for(let s=0;s<e.length;s++){const r=e[s],n=r.shape.getBounds(Gl);r.transform?t.addRect(n,r.transform):t.addRect(n)}return t}}class me{constructor(t){this.instructions=[],this.uid=at("graphicsPath"),this._dirty=!0,typeof t=="string"?ja(t,this):this.instructions=t?.slice()??[]}get shapePath(){return this._shapePath||(this._shapePath=new Ll(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,e){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,e]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,e,s,r,n){const o=this.instructions[this.instructions.length-1],a=this.getLastPoint(ut.shared);let l=0,u=0;if(!o||o.action!=="bezierCurveTo")l=a.x,u=a.y;else{l=o.data[2],u=o.data[3];const h=a.x,c=a.y;l=h+(h-l),u=c+(c-u)}return this.instructions.push({action:"bezierCurveTo",data:[l,u,t,e,s,r,n]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,e,s){const r=this.instructions[this.instructions.length-1],n=this.getLastPoint(ut.shared);let o=0,a=0;if(!r||r.action!=="quadraticCurveTo")o=n.x,a=n.y;else{o=r.data[0],a=r.data[1];const l=n.x,u=n.y;o=l+(l-o),a=u+(u-a)}return this.instructions.push({action:"quadraticCurveTo",data:[o,a,t,e,s]}),this._dirty=!0,this}rect(t,e,s,r,n){return this.instructions.push({action:"rect",data:[t,e,s,r,n]}),this._dirty=!0,this}circle(t,e,s,r){return this.instructions.push({action:"circle",data:[t,e,s,r]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,e,s,r,n,o,a){n=n||r/2;const l=-1*Math.PI/2+o,u=s*2,h=Math.PI*2/u,c=[];for(let f=0;f<u;f++){const m=f%2?n:r,p=f*h+l;c.push(t+m*Math.cos(p),e+m*Math.sin(p))}return this.poly(c,!0,a),this}clone(t=!1){const e=new me;if(!t)e.instructions=this.instructions.slice();else for(let s=0;s<this.instructions.length;s++){const r=this.instructions[s];e.instructions.push({action:r.action,data:r.data.slice()})}return e}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const e=t.a,s=t.b,r=t.c,n=t.d,o=t.tx,a=t.ty;let l=0,u=0,h=0,c=0,f=0,m=0,p=0,_=0;for(let d=0;d<this.instructions.length;d++){const b=this.instructions[d],y=b.data;switch(b.action){case"moveTo":case"lineTo":l=y[0],u=y[1],y[0]=e*l+r*u+o,y[1]=s*l+n*u+a;break;case"bezierCurveTo":h=y[0],c=y[1],f=y[2],m=y[3],l=y[4],u=y[5],y[0]=e*h+r*c+o,y[1]=s*h+n*c+a,y[2]=e*f+r*m+o,y[3]=s*f+n*m+a,y[4]=e*l+r*u+o,y[5]=s*l+n*u+a;break;case"quadraticCurveTo":h=y[0],c=y[1],l=y[2],u=y[3],y[0]=e*h+r*c+o,y[1]=s*h+n*c+a,y[2]=e*l+r*u+o,y[3]=s*l+n*u+a;break;case"arcToSvg":l=y[5],u=y[6],p=y[0],_=y[1],y[0]=e*p+r*_,y[1]=s*p+n*_,y[5]=e*l+r*u+o,y[6]=s*l+n*u+a;break;case"circle":y[4]=Se(y[3],t);break;case"rect":y[4]=Se(y[4],t);break;case"ellipse":y[8]=Se(y[8],t);break;case"roundRect":y[5]=Se(y[5],t);break;case"addPath":y[0].transform(t);break;case"poly":y[2]=Se(y[2],t);break;default:Dt("unknown transform action",b.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let e=this.instructions.length-1,s=this.instructions[e];if(!s)return t.x=0,t.y=0,t;for(;s.action==="closePath";){if(e--,e<0)return t.x=0,t.y=0,t;s=this.instructions[e]}switch(s.action){case"moveTo":case"lineTo":t.x=s.data[0],t.y=s.data[1];break;case"quadraticCurveTo":t.x=s.data[2],t.y=s.data[3];break;case"bezierCurveTo":t.x=s.data[4],t.y=s.data[5];break;case"arc":case"arcToSvg":t.x=s.data[5],t.y=s.data[6];break;case"addPath":s.data[0].getLastPoint(t);break}return t}}function Se(i,t){return i?i.prepend(t):t.clone()}function Ol(i,t){if(typeof i=="string"){const s=document.createElement("div");s.innerHTML=i.trim(),i=s.querySelector("svg")}const e={context:t,path:new me};return cn(i,e,null,null),t}function cn(i,t,e,s){const r=i.children,{fillStyle:n,strokeStyle:o}=Ul(i);n&&e?e={...e,...n}:n&&(e=n),o&&s?s={...s,...o}:o&&(s=o),t.context.fillStyle=e,t.context.strokeStyle=s;let a,l,u,h,c,f,m,p,_,d,b,y,w,A,P,E,v;switch(i.nodeName.toLowerCase()){case"path":A=i.getAttribute("d"),P=new me(A),t.context.path(P),e&&t.context.fill(),s&&t.context.stroke();break;case"circle":m=et(i,"cx",0),p=et(i,"cy",0),_=et(i,"r",0),t.context.ellipse(m,p,_,_),e&&t.context.fill(),s&&t.context.stroke();break;case"rect":a=et(i,"x",0),l=et(i,"y",0),E=et(i,"width",0),v=et(i,"height",0),d=et(i,"rx",0),b=et(i,"ry",0),d||b?t.context.roundRect(a,l,E,v,d||b):t.context.rect(a,l,E,v),e&&t.context.fill(),s&&t.context.stroke();break;case"ellipse":m=et(i,"cx",0),p=et(i,"cy",0),d=et(i,"rx",0),b=et(i,"ry",0),t.context.beginPath(),t.context.ellipse(m,p,d,b),e&&t.context.fill(),s&&t.context.stroke();break;case"line":u=et(i,"x1",0),h=et(i,"y1",0),c=et(i,"x2",0),f=et(i,"y2",0),t.context.beginPath(),t.context.moveTo(u,h),t.context.lineTo(c,f),s&&t.context.stroke();break;case"polygon":w=i.getAttribute("points"),y=w.match(/\d+/g).map(D=>parseInt(D,10)),t.context.poly(y,!0),e&&t.context.fill(),s&&t.context.stroke();break;case"polyline":w=i.getAttribute("points"),y=w.match(/\d+/g).map(D=>parseInt(D,10)),t.context.poly(y,!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;D<r.length;D++)cn(r[D],t,e,s)}function et(i,t,e){const s=i.getAttribute(t);return s?Number(s):e}function Ul(i){const t=i.getAttribute("style"),e={},s={};let r=!1,n=!1;if(t){const o=t.split(";");for(let a=0;a<o.length;a++){const l=o[a],[u,h]=l.split(":");switch(u){case"stroke":h!=="none"&&(e.color=xt.shared.setValue(h).toNumber(),n=!0);break;case"stroke-width":e.width=Number(h);break;case"fill":h!=="none"&&(r=!0,s.color=xt.shared.setValue(h).toNumber());break;case"fill-opacity":s.alpha=Number(h);break;case"stroke-opacity":e.alpha=Number(h);break;case"opacity":s.alpha=Number(h),e.alpha=Number(h);break}}}else{const o=i.getAttribute("stroke");o&&o!=="none"&&(n=!0,e.color=xt.shared.setValue(o).toNumber(),e.width=et(i,"stroke-width",1));const a=i.getAttribute("fill");a&&a!=="none"&&(r=!0,s.color=xt.shared.setValue(a).toNumber())}return{strokeStyle:n?e:null,fillStyle:r?s:null}}const dn=class ei{constructor(t,e,s,r){this.uid=at("fillGradient"),this.type="linear",this.gradientStops=[],this.x0=t,this.y0=e,this.x1=s,this.y1=r}addColorStop(t,e){return this.gradientStops.push({offset:t,color:xt.shared.setValue(e).toHex()}),this}buildLinearGradient(){const t=ei.defaultTextureSize,{gradientStops:e}=this,s=Qt.get().createCanvas();s.width=t,s.height=t;const r=s.getContext("2d"),n=r.createLinearGradient(0,0,ei.defaultTextureSize,1);for(let _=0;_<e.length;_++){const d=e[_];n.addColorStop(d.offset,d.color)}r.fillStyle=n,r.fillRect(0,0,t,t),this.texture=new Y({source:new hi({resource:s,addressModeU:"clamp-to-edge",addressModeV:"repeat"})});const{x0:o,y0:a,x1:l,y1:u}=this,h=new O,c=l-o,f=u-a,m=Math.sqrt(c*c+f*f),p=Math.atan2(f,c);h.translate(-o,-a),h.scale(1/t,1/t),h.rotate(-p),h.scale(256/m,1),this.transform=h}};dn.defaultTextureSize=256;zl=dn;const rr={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};Yl=class{constructor(t,e){this.uid=at("fillPattern"),this.transform=new O,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),e&&(t.source.style.addressModeU=rr[e].addressModeU,t.source.style.addressModeV=rr[e].addressModeV)}setTransform(t){const e=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/e.frame.width,1/e.frame.height)}};oe=function(i,t){if(i==null)return null;let e,s;if(i?.fill?(s=i.fill,e={...t,...i}):(s=i,e=t),xt.isColorLike(s)){const o=xt.shared.setValue(s??0);return{...e,color:o.toNumber(),alpha:o.alpha===1?e.alpha:o.alpha,texture:Y.WHITE}}else if(s instanceof Yl){const o=s;return{...e,color:16777215,texture:o.texture,matrix:o.transform,fill:e.fill??null}}else if(s instanceof zl){const o=s;return o.buildLinearGradient(),{...e,color:16777215,texture:o.texture,matrix:o.transform}}const r={...t,...i};if(r.texture){if(r.texture!==Y.WHITE){const a=r.matrix?.invert()||new O;a.scale(1/r.texture.frame.width,1/r.texture.frame.height),r.matrix=a}const o=r.texture.source.style;o.addressMode==="clamp-to-edge"&&(o.addressMode="repeat")}const n=xt.shared.setValue(r.color);return r.alpha*=n.alpha,r.color=n.toNumber(),r.matrix=r.matrix?r.matrix.clone():null,r};const Hl=new ut,nr=new O,_i=class Pt extends $t{constructor(){super(...arguments),this.uid=at("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this._activePath=new me,this._transform=new O,this._fillStyle={...Pt.defaultFillStyle},this._strokeStyle={...Pt.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new Rt,this._boundsDirty=!0}clone(){const t=new Pt;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=oe(t,Pt.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=oe(t,Pt.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=oe(t,Pt.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=oe(t,Pt.defaultStrokeStyle),this}texture(t,e,s,r,n,o){return this.instructions.push({action:"texture",data:{image:t,dx:s||0,dy:r||0,dw:n||t.frame.width,dh:o||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:e?xt.shared.setValue(e).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new me,this}fill(t,e){let s;const r=this.instructions[this.instructions.length-1];return this._tick===0&&r&&r.action==="stroke"?s=r.data.path:s=this._activePath.clone(),s?(t!=null&&(e!==void 0&&typeof t=="number"&&(J(Q,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:e}),this._fillStyle=oe(t,Pt.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:s}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:e}=this._activePath.getLastPoint(ut.shared);this._activePath.clear(),this._activePath.moveTo(t,e)}stroke(t){let e;const s=this.instructions[this.instructions.length-1];return this._tick===0&&s&&s.action==="fill"?e=s.data.path:e=this._activePath.clone(),e?(t!=null&&(this._strokeStyle=oe(t,Pt.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:e}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const e=this.instructions[this.instructions.length-1-t],s=this._activePath.clone();if(e&&(e.action==="stroke"||e.action==="fill"))if(e.data.hole)e.data.hole.addPath(s);else{e.data.hole=s;break}}return this._initNextPathLocation(),this}arc(t,e,s,r,n,o){this._tick++;const a=this._transform;return this._activePath.arc(a.a*t+a.c*e+a.tx,a.b*t+a.d*e+a.ty,s,r,n,o),this}arcTo(t,e,s,r,n){this._tick++;const o=this._transform;return this._activePath.arcTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*s+o.c*r+o.tx,o.b*s+o.d*r+o.ty,n),this}arcToSvg(t,e,s,r,n,o,a){this._tick++;const l=this._transform;return this._activePath.arcToSvg(t,e,s,r,n,l.a*o+l.c*a+l.tx,l.b*o+l.d*a+l.ty),this}bezierCurveTo(t,e,s,r,n,o,a){this._tick++;const l=this._transform;return this._activePath.bezierCurveTo(l.a*t+l.c*e+l.tx,l.b*t+l.d*e+l.ty,l.a*s+l.c*r+l.tx,l.b*s+l.d*r+l.ty,l.a*n+l.c*o+l.tx,l.b*n+l.d*o+l.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(t,e,s,r){return this._tick++,this._activePath.ellipse(t,e,s,r,this._transform.clone()),this}circle(t,e,s){return this._tick++,this._activePath.circle(t,e,s,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,e){this._tick++;const s=this._transform;return this._activePath.lineTo(s.a*t+s.c*e+s.tx,s.b*t+s.d*e+s.ty),this}moveTo(t,e){this._tick++;const s=this._transform,r=this._activePath.instructions,n=s.a*t+s.c*e+s.tx,o=s.b*t+s.d*e+s.ty;return r.length===1&&r[0].action==="moveTo"?(r[0].data[0]=n,r[0].data[1]=o,this):(this._activePath.moveTo(n,o),this)}quadraticCurveTo(t,e,s,r,n){this._tick++;const o=this._transform;return this._activePath.quadraticCurveTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*s+o.c*r+o.tx,o.b*s+o.d*r+o.ty,n),this}rect(t,e,s,r){return this._tick++,this._activePath.rect(t,e,s,r,this._transform.clone()),this}roundRect(t,e,s,r,n){return this._tick++,this._activePath.roundRect(t,e,s,r,n,this._transform.clone()),this}poly(t,e){return this._tick++,this._activePath.poly(t,e,this._transform.clone()),this}regularPoly(t,e,s,r,n=0,o){return this._tick++,this._activePath.regularPoly(t,e,s,r,n,o),this}roundPoly(t,e,s,r,n,o){return this._tick++,this._activePath.roundPoly(t,e,s,r,n,o),this}roundShape(t,e,s,r){return this._tick++,this._activePath.roundShape(t,e,s,r),this}filletRect(t,e,s,r,n){return this._tick++,this._activePath.filletRect(t,e,s,r,n),this}chamferRect(t,e,s,r,n,o){return this._tick++,this._activePath.chamferRect(t,e,s,r,n,o),this}star(t,e,s,r,n=0,o=0){return this._tick++,this._activePath.star(t,e,s,r,n,o,this._transform.clone()),this}svg(t){return this._tick++,Ol(t,this),this}restore(){const t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(t){return this._transform.rotate(t),this}scale(t,e=t){return this._transform.scale(t,e),this}setTransform(t,e,s,r,n,o){return t instanceof O?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,e,s,r,n,o),this)}transform(t,e,s,r,n,o){return t instanceof O?(this._transform.append(t),this):(nr.set(t,e,s,r,n,o),this._transform.append(nr),this)}translate(t,e=t){return this._transform.translate(t,e),this}clear(){return this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this.dirty||(this.emit("update",this,16),this.dirty=!0,this._boundsDirty=!0)}get bounds(){if(!this._boundsDirty)return this._bounds;const t=this._bounds;t.clear();for(let e=0;e<this.instructions.length;e++){const s=this.instructions[e],r=s.action;if(r==="fill"){const n=s.data;t.addBounds(n.path.bounds)}else if(r==="texture"){const n=s.data;t.addFrame(n.dx,n.dy,n.dx+n.dw,n.dy+n.dh,n.transform)}if(r==="stroke"){const n=s.data,o=n.style.width/2,a=n.path.bounds;t.addFrame(a.minX-o,a.minY-o,a.maxX+o,a.maxY+o)}}return t}containsPoint(t){if(!this.bounds.containsPoint(t.x,t.y))return!1;const e=this.instructions;let s=!1;for(let r=0;r<e.length;r++){const n=e[r],o=n.data,a=o.path;if(!n.action||!a)continue;const l=o.style,u=a.shapePath.shapePrimitives;for(let h=0;h<u.length;h++){const c=u[h].shape;if(!l||!c)continue;const f=u[h].transform,m=f?f.applyInverse(t,Hl):t;n.action==="fill"?s=c.contains(m.x,m.y):s=c.strokeContains(m.x,m.y,l.width);const p=o.hole;if(p){const _=p.shapePath?.shapePrimitives;if(_)for(let d=0;d<_.length;d++)_[d].shape.contains(m.x,m.y)&&(s=!1)}if(s)return!0}}return s}destroy(t=!1){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),typeof t=="boolean"?t:t?.texture){const s=typeof t=="boolean"?t:t?.textureSource;this._fillStyle.texture&&this._fillStyle.texture.destroy(s),this._strokeStyle.texture&&this._strokeStyle.texture.destroy(s)}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};_i.defaultFillStyle={color:16777215,alpha:1,texture:Y.WHITE,matrix:null,fill:null};_i.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:Y.WHITE,matrix:null,fill:null};Me=_i;as=class extends dt{constructor(t){t instanceof Me&&(t={context:t});const{context:e,roundPixels:s,...r}=t||{};super({label:"Graphics",...r}),this.canBundle=!0,this.renderPipeId="graphics",this._roundPixels=0,e?this._context=e:this._context=this._ownedContext=new Me,this._context.on("update",this.onViewUpdate,this),this.allowChildren=!1,this.roundPixels=s??!1}set context(t){t!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=t,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}addBounds(t){t.addBounds(this._context.bounds)}containsPoint(t){return this._context.containsPoint(t)}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}onViewUpdate(){this._didChangeId+=4096,this._didGraphicsUpdate=!0,!this.didViewUpdate&&(this.didViewUpdate=!0,this.renderGroup&&this.renderGroup.onChildViewUpdate(this))}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):(t===!0||t?.context===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_callContextMethod(t,e){return this.context[t](...e),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new as(this._context.clone()):(this._ownedContext=null,new as(this._context))}lineStyle(t,e,s){J(Q,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return t&&(r.width=t),e&&(r.color=e),s&&(r.alpha=s),this.context.strokeStyle=r,this}beginFill(t,e){J(Q,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const s={};return t&&(s.color=t),e&&(s.alpha=e),this.context.fillStyle=s,this}endFill(){J(Q,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return(t.width!==Me.defaultStrokeStyle.width||t.color!==Me.defaultStrokeStyle.color||t.alpha!==Me.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return J(Q,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return J(Q,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return J(Q,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return J(Q,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return J(Q,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return J(Q,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}};ie.add(go,yo);let Xl,Wl,ql,jl,Zl,Kl,Ql,Jl,th,eh,sh,ih,rh,nh,oh,ah,lh,hh,uh,ch,dh,fh,ph,mh,_h,gh,yh,xh,bh,vh,wh,Ah,Ch,Sh,Mh,Ph,kh,Th,Ih;Xl=ct({__name:"PieceCanvas",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,e=Xn(),{cachedFiles:s}=mt(Le()),r=Oe(),n=pt(),o=Mi(),a=Mi(),l=pt(!1);async function u(){if(l.value||!n.value||!o.value)return;l.value=!0;const h=await o.value,c=await r.fetchPieceState(t.torrent.hash),f=new oi;s.value.filter(d=>d.priority!==At.DO_NOT_DOWNLOAD).forEach(d=>f.insert(d.piece_range,d.name));const m=new as;let p="",_=1;for(let d=0;d<c.length;++d){const b=c[d];let y="";if(b===ss.DOWNLOADING?y=e.current.value.colors["torrent-downloading"]:b===ss.DOWNLOADED?y=e.current.value.colors["torrent-pausedUP"]:b===ss.MISSING&&f.intersect_any([d,d])&&(y=e.current.value.colors["torrent-pausedDL"]),y===p){++_;continue}p!==""&&(m.rect((d-_)/c.length*n.value.width,0,_/c.length*n.value.width,n.value.height),m.fill(p)),_=1,p=y}p!==""&&(m.rect((c.length-_)/c.length*n.value.width,0,_/c.length*n.value.width,n.value.height),m.fill(p)),h.stage.addChild(m),a.value&&a.value.destroy(),a.value=m,l.value=!1}return ls(s,()=>{t.isActive&&u()}),ri(()=>{n.value&&(o.value=new Promise(async h=>{const c=new Qr;await c.init({antialias:!0,width:n.value?.width,height:n.value?.height,canvas:n.value}),h(c)}),s.value&&u())}),hs(async()=>{if(!o.value)return;(await o.value).destroy({removeView:!1},{children:!0})}),(h,c)=>(k(),G("canvas",{ref_key:"canvas",ref:n,width:"4096",height:"20"},null,512))}});Wl=te(Xl,[["__scopeId","data-v-212dd1f4"]]);ql=["href"];jl={key:1};Zl={class:"my-1"};Kl={class:"mr-2"};Ql={key:0};Jl={key:2};th={key:0};eh={key:1};sh={key:2};ih={key:0};rh=ct({__name:"Overview",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{t:e}=ge(),{cachedFiles:s}=mt(Le()),r=or(),{properties:n}=mt(Bt()),o=_e(),a=W(()=>s.value.filter(v=>v.priority!==At.DO_NOT_DOWNLOAD)),l=W(()=>s.value.length),u=W(()=>a.value.length===1?a.value[0].name:""),h=W(()=>n.value?.comment??""),c=W(()=>n.value?.dl_speed_avg??0),f=W(()=>n.value?.piece_size??0),m=W(()=>n.value?.pieces_have??0),p=W(()=>n.value?.pieces_num??0),_=W(()=>n.value?.up_speed_avg??0),d=W(()=>`torrent-${t.torrent.state}`),b=W(()=>`${parseInt(In(f.value,!0))} ${En(f.value,!0)}`),y=W(()=>[wi.META_DL,wi.FORCED_META_DL].includes(t.torrent.state));async function w(){try{await navigator.clipboard.writeText(t.torrent.hash)}catch{Pi.error(e("toast.copy.error"));return}Pi.success(e("toast.copy.success"))}function A(v){r.createDialog(_n,{hashes:[t.torrent.hash],mode:v})}function P(){r.createDialog(Wn,{hash:t.torrent.hash,isFolder:!1,oldName:u.value})}function E(v){if(r.hasActiveDialog||!t.isActive)return!1;if(v.key==="d")return v.preventDefault(),A("dl"),!0;if(v.key==="s")return v.preventDefault(),A("save"),!0;if(v.key==="f"&&a.value.length===1)return v.preventDefault(),P(),!0;if(v.key==="Delete")return v.preventDefault(),r.createDialog(Dn,{hashes:[t.torrent.hash]}),!0}return ri(()=>{document.addEventListener("keydown",E)}),hs(async()=>{document.removeEventListener("keydown",E)}),(v,D)=>v.torrent?(k(),$(ce,{key:0},{default:x(()=>[g(ns,{class:"text-wrap"},{default:x(()=>[V(S(v.torrent.name),1)]),_:1}),g(Pn,null,{default:x(()=>[I("div",null,[(k(!0),G(lt,null,_t(M(Mn)(h.value),C=>(k(),G("span",null,[M(Sn)(C)?(k(),G("a",{key:0,target:"_blank",href:C},S(C),9,ql)):(k(),G("span",jl,S(C),1))]))),256))]),I("div",Zl,[I("span",Kl,S(v.torrent.hash),1),g(nt,{variant:"outlined",rounded:"",onClick:w},{default:x(()=>[V(S(v.$t("torrentDetail.overview.copy_hash")),1)]),_:1})])]),_:1}),g(De,null,{default:x(()=>[g(K,null,{default:x(()=>[g(z,{cols:"12",md:"6"},{default:x(()=>[g(K,null,{default:x(()=>[g(z,{cols:"4"},{default:x(()=>[g(kn,{color:d.value,indeterminate:y.value,size:100,"model-value":v.torrent?.progress*100||0,width:15},{default:x(()=>[y.value?(k(),G("span",Ql,S(v.$t("torrentDetail.overview.fetchingMetadata")),1)):v.torrent.progress===1?(k(),$(st,{key:1,icon:"mdi-check",size:"x-large"})):(k(),G("span",Jl,S(M(Rs)(v.torrent.progress)),1))]),_:1},8,["color","indeterminate","model-value"])]),_:1}),g(z,{cols:"8",class:"d-flex flex-column align-center justify-center"},{default:x(()=>[y.value?(k(),G("div",th,[I("span",null,S(v.$t("torrentDetail.overview.waitingForMetadata")),1)])):(k(),G("div",eh,[g(Wl,{torrent:v.torrent,isActive:v.isActive},null,8,["torrent","isActive"])])),p.value>0?(k(),G("div",sh,[I("span",null,S(M(e)("torrentDetail.overview.pieceCount",{owned:m.value,total:p.value,pieceSize:b.value})),1)])):ht("",!0),I("div",null,[g(st,{icon:"mdi-arrow-down"}),V(" "+S(M(Zt)(v.torrent.dlspeed,M(o).useBitSpeed))+" ",1),g(st,{icon:"mdi-arrow-up"}),V(" "+S(M(Zt)(v.torrent.upspeed,M(o).useBitSpeed)),1)])]),_:1})]),_:1}),g(K,null,{default:x(()=>[g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrent.properties.download_path"))+":",1),I("div",null,S(v.torrent.download_path),1),g(nt,{icon:"mdi-pencil",color:"accent",size:"x-small",onClick:D[0]||(D[0]=C=>A("dl"))})]),_:1}),g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrentDetail.overview.fileCount"))+":",1),I("div",null,S(a.value.length)+" / "+S(l.value),1),a.value.length===1?(k(),G("div",ih,S(u.value),1)):ht("",!0),a.value.length===1?(k(),$(nt,{key:1,icon:"mdi-pencil",color:"accent",size:"x-small",onClick:P})):ht("",!0)]),_:1})]),_:1}),g(K,null,{default:x(()=>[g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrent.properties.save_path"))+":",1),I("div",null,S(v.torrent.savePath),1),g(nt,{icon:"mdi-pencil",color:"accent",size:"x-small",onClick:D[1]||(D[1]=C=>A("save"))})]),_:1}),g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrent.properties.content_path"))+":",1),I("div",null,S(v.torrent.content_path),1)]),_:1})]),_:1})]),_:1}),g(z,{cols:"12",md:"6"},{default:x(()=>[g(K,null,{default:x(()=>[g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrent.properties.state"))+":",1),g(ae,{variant:"flat",color:d.value},{default:x(()=>[V(S(v.$t(`torrent.state.${v.torrent.state}`)),1)]),_:1},8,["color"])]),_:1}),g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrent.properties.category"))+":",1),g(ae,{variant:"flat",color:"category"},{default:x(()=>[V(S(v.torrent.category.length?v.torrent.category:v.$t("navbar.side.filters.uncategorized")),1)]),_:1})]),_:1})]),_:1}),g(K,null,{default:x(()=>[g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrent.properties.tracker"))+":",1),g(ae,{variant:"flat",color:"tracker"},{default:x(()=>[V(S(v.torrent.tracker?M(Tn)(v.torrent.tracker):v.$t("navbar.side.filters.untracked")),1)]),_:1})]),_:1}),g(z,{cols:"6",class:"d-flex flex-wrap chipgap"},{default:x(()=>[I("div",null,S(v.$t("torrent.properties.tags"))+":",1),v.torrent.tags?(k(!0),G(lt,{key:0},_t(v.torrent.tags,C=>(k(),$(ae,{key:C,variant:"flat",color:"tag"},{default:x(()=>[V(S(C),1)]),_:2},1024))),128)):ht("",!0),!v.torrent.tags||v.torrent.tags.length===0?(k(),$(ae,{key:1,variant:"flat",color:"tag"},{default:x(()=>[V(S(v.$t("navbar.side.filters.untagged")),1)]),_:1})):ht("",!0)]),_:1})]),_:1}),g(K,null,{default:x(()=>[g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrentDetail.overview.selectedFileSize"))+":",1),I("div",null,S(M(Nt)(v.torrent.size,M(o).useBinarySize))+" / "+S(M(Nt)(v.torrent.total_size,M(o).useBinarySize)),1)]),_:1}),g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrentDetail.overview.ratio"))+":",1),I("div",null,S(v.torrent.ratio),1)]),_:1})]),_:1}),g(K,null,{default:x(()=>[g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrentDetail.overview.downloaded"))+":",1),I("div",null,S(M(Nt)(v.torrent.downloaded,M(o).useBinarySize)),1)]),_:1}),g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrentDetail.overview.uploaded"))+":",1),I("div",null,S(M(Nt)(v.torrent.uploaded,M(o).useBinarySize)),1)]),_:1})]),_:1}),g(K,null,{default:x(()=>[g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrentDetail.overview.dlSpeedAverage"))+":",1),I("div",null,S(M(Zt)(c.value,M(o).useBitSpeed)),1)]),_:1}),g(z,{cols:"6"},{default:x(()=>[I("div",null,S(v.$t("torrentDetail.overview.upSpeedAverage"))+":",1),I("div",null,S(M(Zt)(_.value,M(o).useBitSpeed)),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):ht("",!0)}});nh=te(rh,[["__scopeId","data-v-e0346fb1"]]);oh={class:"d-flex"};ah={key:0};lh=["alt","src","title"];hh=["title"];uh={class:"text-subtitle-2 text-grey"};ch=["title"];dh={class:"d-flex flex-column"};fh={class:"text-h5"};ph=ct({__name:"Peers",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{t:e}=ge(),s=Oe(),r=Rn(),n=_e(),o=pt(!1),a=pt([]),l=pt(""),u=pt(null),h=pt(!1);async function c(){o.value=!0,a.value=Object.entries((await s.getTorrentPeers(t.torrent.hash)).peers).map(([d,b])=>({...b,host:d})),o.value=!1}async function f(){l.value.length&&(await s.addTorrentPeers(t.torrent.hash,l.value.split(`
|
|
`)),await c(),m())}function m(){h.value=!1,l.value=""}async function p(d){await s.banPeers([d.host]),await r.fetchPreferences(),await c()}async function _(d){d??t.isActive?(await c(),u.value=setInterval(c,5e3)):(clearInterval(u.value),u.value=null)}return ni(_),hs(()=>_(!1)),ls(()=>t.isActive,_),(d,b)=>(k(),$(de,null,{default:x(()=>[(k(!0),G(lt,null,_t(a.value,(y,w)=>(k(),G(lt,null,[w>0?(k(),$(Bs,{key:0,color:"white"})):ht("",!0),g(kt,null,{default:x(()=>[I("div",oh,[I("div",null,[g(ar,{class:"wrap-anywhere",style:{"white-space":"unset"}},{default:x(()=>[y.country_code?(k(),G("span",ah,[M(Bn)?(k(),G("img",{key:0,alt:M(ps)(y.country_code).char,src:M(ps)(y.country_code).url,title:y.country,style:{"max-width":"32px"}},null,8,lh)):(k(),G("span",{key:1,title:y.country},S(M(ps)(y.country_code).char),9,hh))])):ht("",!0),I("span",null,S(y.ip),1),I("span",uh," :"+S(y.port),1)]),_:2},1024),g(is,{class:"d-block"},{default:x(()=>[I("div",null,[V(" Flags: "),I("span",{class:"cursor-help",title:y.flags_desc},S(y.flags),9,ch)]),I("div",null,"Progress: "+S(M(Rs)(y.progress)),1),I("div",null,[g(st,{icon:"mdi-arrow-down",color:"download"}),V(" "+S(M(Zt)(y.dl_speed,M(n).useBitSpeed))+" ",1),g(st,{icon:"mdi-arrow-up",color:"upload"}),V(" "+S(M(Zt)(y.up_speed,M(n).useBitSpeed)),1)]),I("div",null,S(M(Nt)(y.downloaded,M(n).useBinarySize))+" | "+S(M(Nt)(y.uploaded,M(n).useBinarySize)),1),I("div",null,"Relevance: "+S(M(Rs)(y.relevance)),1)]),_:2},1024)]),g(Kt),I("div",dh,[g(nt,{color:"red",icon:"mdi-cancel",variant:"text",onClick:A=>p(y)},null,8,["onClick"])])])]),_:2},1024)],64))),256)),a.value.length===0?(k(),$(kt,{key:0},{default:x(()=>[V(S(d.$t("torrentDetail.peers.emptyList")),1)]),_:1})):ht("",!0),g(kt,null,{default:x(()=>[I("div",{class:Re(["d-flex gap py-5",d.$vuetify.display.mobile?"flex-column":"justify-space-evenly"])},[g(Fs,{modelValue:h.value,"onUpdate:modelValue":b[1]||(b[1]=y=>h.value=y),"max-width":"750px"},{activator:x(({props:y})=>[g(nt,$s(y,{variant:"flat",text:M(e)("torrentDetail.peers.addPeers.title"),color:"accent"}),null,16,["text"])]),default:x(()=>[g(ce,null,{default:x(()=>[g(ns,null,{default:x(()=>[I("span",fh,S(M(e)("torrentDetail.peers.addPeers.title")),1)]),_:1}),g(De,null,{default:x(()=>[g(lr,null,{default:x(()=>[g(K,null,{default:x(()=>[g(z,{cols:"12"},{default:x(()=>[g(hr,{modelValue:l.value,"onUpdate:modelValue":b[0]||(b[0]=y=>l.value=y),label:M(e)("torrentDetail.peers.addPeers.newPeers"),placeholder:M(e)("torrentDetail.peers.addPeers.newPeersPlaceholder"),hint:M(e)("torrentDetail.peers.addPeers.newPeersHint")},null,8,["modelValue","label","placeholder","hint"])]),_:1})]),_:1})]),_:1})]),_:1}),g(Vs,null,{default:x(()=>[g(Kt),g(nt,{color:"error",onClick:m},{default:x(()=>[V(S(M(e)("common.cancel")),1)]),_:1}),g(nt,{color:"accent",onClick:f},{default:x(()=>[V(S(M(e)("common.ok")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])],2)]),_:1})]),_:1}))}});mh=te(ph,[["__scopeId","data-v-ceb5c391"]]);_h=ct({__name:"TagsAndCategories",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,e=Oe(),s=si(),r=W(()=>e.categories.map(l=>l.name).indexOf(t.torrent.category)),n=W(()=>e.tags.filter(l=>t.torrent.tags?.includes(l)));async function o(l){t.torrent.category===l?await s.setTorrentCategory([t.torrent.hash],""):await s.setTorrentCategory([t.torrent.hash],l)}async function a(l){t.torrent.tags?.includes(l)?await s.removeTorrentTags([t.torrent.hash],[l]):await s.addTorrentTags([t.torrent.hash],[l])}return ni(async()=>{await e.fetchCategories(),await e.fetchTags()}),(l,u)=>(k(),$(ce,null,{default:x(()=>[g(De,null,{default:x(()=>[g(K,null,{default:x(()=>[g(z,{cols:"12",md:"6"},{default:x(()=>[g(Ai,{"model-value":n.value,multiple:""},{default:x(()=>[g(de,null,{default:x(()=>[g(Ci,null,{default:x(()=>[V(S(l.$t("torrentDetail.tagsAndCategories.tags")),1)]),_:1}),(k(!0),G(lt,null,_t(M(e).tags,h=>(k(),$(kt,{title:h,variant:l.torrent.tags?.includes(h)?"tonal":void 0,"base-color":l.torrent.tags?.includes(h)?"accent":void 0,onClick:c=>a(h)},null,8,["title","variant","base-color","onClick"]))),256))]),_:1})]),_:1},8,["model-value"])]),_:1}),g(z,{cols:"12",md:"6"},{default:x(()=>[g(Ai,{"model-value":r.value},{default:x(()=>[g(de,null,{default:x(()=>[g(Ci,null,{default:x(()=>[V(S(l.$t("torrentDetail.tagsAndCategories.categories")),1)]),_:1}),(k(!0),G(lt,null,_t(M(e).categories,h=>(k(),$(kt,{title:h.name,variant:h.name===t.torrent.category?"tonal":void 0,"base-color":h.name===t.torrent.category?"accent":void 0,onClick:c=>o(h.name)},null,8,["title","variant","base-color","onClick"]))),256))]),_:1})]),_:1},8,["model-value"])]),_:1})]),_:1})]),_:1})]),_:1}))}});gh={class:"d-flex"};yh={key:0};xh={key:1};bh={key:2};vh={key:3};wh={key:0,class:"d-flex flex-column"};Ah={class:"text-h5"};Ch={class:"text-h5"};Sh=ct({__name:"Trackers",props:{torrent:{},isActive:{type:Boolean}},setup(i){const t=i,{t:e}=ge(),s=Oe();function r(P){switch(P){case Vt.DISABLED:return e("constants.trackerStatus.disabled");case Vt.NOT_YET_CONTACTED:return e("constants.trackerStatus.not_yet_contacted");case Vt.WORKING:return e("constants.trackerStatus.working");case Vt.UPDATING:return e("constants.trackerStatus.updating");case Vt.NOT_WORKING:return e("constants.trackerStatus.not_working");default:return""}}function n(P){return typeof P=="number"?P===-1?"N/A":P.valueOf():!P||P.num_peers===-1||P?.num_seeds===-1||P?.num_leeches===-1?"N/A":e("torrentDetail.trackers.peersValue",{peers:P.num_peers,seeds:P.num_seeds,leeches:P.num_leeches})}const o=pt(!1),a=pt([]),l=pt(""),u=pt(null),h=pt(!1),c=[P=>!!P||e("torrentDetail.trackers.editTracker.newUrlRequired")],f=Ln({isVisible:!1,isFormValid:!1,oldUrl:"",newUrl:""});function m(P){f.isVisible=!0,f.oldUrl=P.url,f.newUrl=P.url,cr(()=>{document.getElementById("input")?.select()})}async function p(){o.value=!0,a.value=(await s.getTorrentTrackers(t.torrent.hash)).map(P=>({...P,isSelectable:P.tier!==-1})),o.value=!1}async function _(){l.value.length&&(await s.addTorrentTrackers(t.torrent.hash,l.value),await p(),d())}function d(){h.value=!1,l.value=""}async function b(){f.isFormValid&&(await s.editTorrentTracker(t.torrent.hash,f.oldUrl,f.newUrl),f.isVisible=!1,await p())}async function y(P){await s.removeTorrentTrackers(t.torrent.hash,[P.url]),await p()}async function w(){await s.reannounceTorrents([t.torrent.hash])}async function A(P){P??t.isActive?(await p(),u.value=setInterval(p,5e3)):(clearInterval(u.value),u.value=null)}return ni(A),hs(()=>A(!1)),ls(()=>t.isActive,A),(P,E)=>(k(),$(de,null,{default:x(()=>[(k(!0),G(lt,null,_t(a.value,(v,D)=>(k(),G(lt,null,[D===3?(k(),$(Bs,{key:0,color:"white",thickness:"5"})):D>0?(k(),$(Bs,{key:1,class:"mx-5",color:"white"})):ht("",!0),g(kt,null,{default:x(()=>[I("div",gh,[I("div",{class:Re(`tracker-${M(Vt)[v.status].toLowerCase()}`)},[g(ar,{class:"text-break text-wrap"},{default:x(()=>[V(S(v.url),1)]),_:2},1024),g(is,{class:"d-block"},{default:x(()=>[v.msg?(k(),G("div",yh,S(v.msg),1)):(k(),G("div",xh,S(r(v.status)),1)),v.tier>=0?(k(),G("div",bh,S(M(e)("torrentDetail.trackers.tier",v.tier)),1)):ht("",!0),v.status!==M(Vt).NOT_WORKING?(k(),G("div",vh,[I("div",null,S(n(v)),1),I("div",null,"Downloads: "+S(n(v.num_downloaded)),1)])):ht("",!0)]),_:2},1024)],2),g(Kt),v.tier>=0?(k(),G("div",wh,[g(Fs,{modelValue:f.isVisible,"onUpdate:modelValue":E[4]||(E[4]=C=>f.isVisible=C),"max-width":"750px"},{activator:x(({props:C})=>[g(nt,$s(C,{icon:"mdi-pencil",variant:"text",onClick:T=>m(v)}),null,16,["onClick"])]),default:x(()=>[g(ce,null,{default:x(()=>[g(ns,null,{default:x(()=>[I("span",Ah,S(M(e)("torrentDetail.trackers.editTracker.title")),1)]),_:1}),g(De,null,{default:x(()=>[g(M(Fn),{modelValue:f.isFormValid,"onUpdate:modelValue":E[1]||(E[1]=C=>f.isFormValid=C),onSubmit:E[2]||(E[2]=Ns(()=>{},["prevent"]))},{default:x(()=>[g(M(Ds),{"model-value":f.oldUrl,disabled:"",label:P.$t("torrentDetail.trackers.editTracker.oldUrl")},null,8,["model-value","label"]),g(M(Ds),{modelValue:f.newUrl,"onUpdate:modelValue":E[0]||(E[0]=C=>f.newUrl=C),id:"input",rules:c,label:P.$t("torrentDetail.trackers.editTracker.newUrl"),autofocus:"",onKeydown:On(b,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),g(Vs,null,{default:x(()=>[g(Kt),g(nt,{color:"error",disabled:!f.isFormValid,onClick:E[3]||(E[3]=C=>f.isVisible=!1)},{default:x(()=>[V(S(M(e)("common.cancel")),1)]),_:1},8,["disabled"]),g(nt,{color:"accent",onClick:b},{default:x(()=>[V(S(M(e)("common.ok")),1)]),_:1})]),_:1})]),_:1})]),_:2},1032,["modelValue"]),g(nt,{color:"red",icon:"mdi-delete",variant:"text",onClick:C=>y(v)},null,8,["onClick"])])):ht("",!0)])]),_:2},1024)],64))),256)),g(kt,null,{default:x(()=>[I("div",{class:Re(["d-flex gap py-5",P.$vuetify.display.mobile?"flex-column":"justify-space-evenly"])},[g(Fs,{modelValue:h.value,"onUpdate:modelValue":E[6]||(E[6]=v=>h.value=v),"max-width":"750px"},{activator:x(({props:v})=>[g(nt,$s(v,{variant:"flat",text:M(e)("torrentDetail.trackers.addTrackers.title"),color:"accent"}),null,16,["text"])]),default:x(()=>[g(ce,null,{default:x(()=>[g(ns,null,{default:x(()=>[I("span",Ch,S(M(e)("torrentDetail.trackers.addTrackers.title")),1)]),_:1}),g(De,null,{default:x(()=>[g(lr,null,{default:x(()=>[g(K,null,{default:x(()=>[g(z,{cols:"12"},{default:x(()=>[g(hr,{modelValue:l.value,"onUpdate:modelValue":E[5]||(E[5]=v=>l.value=v),label:M(e)("torrentDetail.trackers.addTrackers.newTrackers"),hint:M(e)("torrentDetail.trackers.addTrackers.newTrackersHint")},null,8,["modelValue","label","hint"])]),_:1})]),_:1})]),_:1})]),_:1}),g(Vs,null,{default:x(()=>[g(Kt),g(nt,{color:"error",onClick:d},{default:x(()=>[V(S(M(e)("common.cancel")),1)]),_:1}),g(nt,{color:"accent",onClick:_},{default:x(()=>[V(S(M(e)("common.ok")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(nt,{variant:"flat",disabled:a.value.length===3,text:M(e)("torrentDetail.trackers.reannounce"),color:"primary",onClick:w},null,8,["disabled","text"])],2)]),_:1})]),_:1}))}});Mh=te(Sh,[["__scopeId","data-v-ed947913"]]);Ph={class:"pa-3 text-select"};kh={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"};Th={class:"d-flex justify-end"};Ih=ct({__name:"TorrentDetail",setup(i){const t=Yn(),{t:e}=ge(),s=Le(),r=or(),n=si(),o=Bt(),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=pt("overview"),u=W(()=>t.currentRoute.value.params.hash),h=W(()=>n.getTorrentByHash(u.value)),c=()=>{t.push({name:"dashboard"})};function f(p){if(r.hasActiveDialog)return!1;p.key==="Escape"&&c()}function m(){const p=t.currentRoute.value.params.tab;p&&(l.value=p)}return Un(()=>{m()}),ls(h,()=>{o.fetchProperties(u.value)}),ri(()=>{document.addEventListener("keydown",f),m(),o.fetchProperties(u.value),s.resumeTimer()}),zn(()=>{document.removeEventListener("keydown",f),o.$reset(),s.$reset()}),(p,_)=>(k(),G(lt,null,[I("div",Ph,[g(K,{"no-gutters":"",align:"center",justify:"center"},{default:x(()=>[g(z,null,{default:x(()=>[I("h1",kh,S(M(e)("torrentDetail.title")),1)]),_:1}),g(z,null,{default:x(()=>[I("div",Th,[g(nt,{icon:"mdi-close",variant:"plain",onClick:c})])]),_:1})]),_:1}),g(K,{class:"ma-0 pa-0"},{default:x(()=>[g(Nn,{modelValue:l.value,"onUpdate:modelValue":_[0]||(_[0]=d=>l.value=d),"bg-color":"primary",grow:"","show-arrows":""},{default:x(()=>[(k(),G(lt,null,_t(a,({text:d,value:b})=>g($n,{value:b,href:`#/torrent/${u.value}/${b}`,text:d},null,8,["value","href","text"])),64))]),_:1},8,["modelValue"])]),_:1}),h.value?(k(),$(Vn,{key:0,modelValue:l.value,"onUpdate:modelValue":_[1]||(_[1]=d=>l.value=d),touch:!1},{default:x(()=>[g(ne,{value:"overview"},{default:x(()=>[g(nh,{torrent:h.value,"is-active":l.value==="overview"},null,8,["torrent","is-active"])]),_:1}),g(ne,{value:"info"},{default:x(()=>[g(mo,{torrent:h.value,"is-active":l.value==="info"},null,8,["torrent","is-active"])]),_:1}),g(ne,{value:"trackers"},{default:x(()=>[g(Mh,{torrent:h.value,"is-active":l.value==="trackers"},null,8,["torrent","is-active"])]),_:1}),g(ne,{value:"peers"},{default:x(()=>[g(mh,{torrent:h.value,"is-active":l.value==="peers"},null,8,["torrent","is-active"])]),_:1}),g(ne,{value:"content"},{default:x(()=>[g(M(to),{torrent:h.value,"is-active":l.value==="content"},null,8,["torrent","is-active"])]),_:1}),g(ne,{value:"tagsAndCategories"},{default:x(()=>[g(_h,{torrent:h.value,"is-active":l.value==="tagsAndCategories"},null,8,["torrent","is-active"])]),_:1})]),_:1},8,["modelValue"])):ht("",!0)]),I("div",{style:ur(`position: absolute; left: ${M(s).rightClickProperties.offset[0]}px; top: ${M(s).rightClickProperties.offset[1]}px;`)},[g(M(gn),{modelValue:M(s).rightClickProperties.isVisible,"onUpdate:modelValue":_[2]||(_[2]=d=>M(s).rightClickProperties.isVisible=d),"menu-data":M(s).menuData},null,8,["modelValue","menu-data"])],4)],64))}});Lh=Object.freeze(Object.defineProperty({__proto__:null,default:Ih},Symbol.toStringTag,{value:"Module"}))});export{Gr as $,Zr as A,ft as B,dt as C,Qt as D,tt as E,zo as F,sa as G,Cs as H,xt as I,Mr as J,J as K,Q as L,tn as M,Ja as N,pe as O,ut as P,oe as Q,ot as R,ol as S,je as T,Hs as U,Me as V,zl as W,Yl as X,hi as Y,he as Z,on as _,$t as a,Fe as a0,Hi as a1,as as a2,Io as a3,ln as a4,Lh as a5,Ge as b,ya as c,Wr as d,ie as e,Zi as f,il as g,Vr as h,Gt as i,O as j,Y as k,To as l,al as m,Gh as n,sl as o,St as p,Cr as q,Oo as r,Rt as s,Be as t,at as u,ba as v,Dt as w,$a as x,cl as y,Ui as z,__tla}; |