mirror of
https://github.com/SoPat712/dotfiles.git
synced 2026-02-10 00:45:09 -05:00
vuetorrent and theme updates
This commit is contained in:
BIN
qbit/catppuccin-mocha.qbtheme
Normal file
BIN
qbit/catppuccin-mocha.qbtheme
Normal file
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
import{u as f,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{c as d,D as t}from"./vue-CfSjRv-x.js";let h;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{h=function(e,a,o=1){const{currentPage:n,currentPageSize:r,pageCount:u,isFirstPage:c,isLastPage:i,next:g,prev:l}=f({total:()=>t(e).length,page:o,pageSize:()=>t(a)===-1?t(e).length:t(a)}),p=d(()=>{const s=(n.value-1)*t(a),P=s+r.value;return t(e).slice(s,P)});return{currentPage:n,currentPageSize:r,pageCount:u,isFirstPage:c,isLastPage:i,next:g,prev:l,paginatedResults:p}}});export{h as u,__tla};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{a as le,b as ae,V as te,I as oe,J as ne,h as q,c as se,d as de,p as re,r as h,K as z,M as G,t as ue,k as u,N as ie,O as ce,P as fe,v as J,Q as I,q as pe,s as ge,w as ye,i as me,j as he,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{g as O}from"./FileIcon-DH65fwz5.js";import{j as ke,E as ve,f as p,d as Ve,r as be,c as Ne,w as Fe,Y as _e,H as n,I as r,J as o,n as s,K as y,L as i,u as c,_ as R,U as k,N as v,W as Q,Q as V,V as Ce,F as W,P as Re,Z as B}from"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";let Ke;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{let $e,we,Ee,Te;$e=["onClick"];we={key:1};Ee={key:1};Te={class:"d-flex flex-column pl-3"};Ke=ke({__name:"BulkRenameFilesDialog",props:{guid:{},node:{},hash:{}},setup(X){const m=X,{isOpened:b}=le(m.guid),{t:g}=ve(),K=ae(),L=p(),N=p(!1),$=p(!1),F=p(""),D=p(),_=p([]),C=p(""),S=p(),w=p(!1),M=[a=>!!a],Y=Ve([{fixed:!0,sortable:!1,key:"selected",width:"50px"},{title:g("dialogs.bulkRenameFiles.col_origin_name"),sortable:!1,key:"name"},{title:g("dialogs.bulkRenameFiles.col_result_name"),sortable:!1,key:"targetName"}]),f=be([]),E=Ne(()=>f.filter(a=>a.type==="file"&&a.selected&&a.targetName&&a.name!==a.targetName)),j=(a,t,l=0)=>{const e={indent:l,name:a.name,fullName:a.fullName,parentItem:t,show:!0,folded:!1,selected:!1,type:a.type,node:a};if(f.push(e),a.type==="folder")for(const d of a.children)j(d,e,l+1)},T=(a,t)=>{a.folded=t,a.node.children.forEach(l=>{const e=f.find(d=>d.node.id===l.id);e.show=!t,e.type==="folder"&&t&&T(e,t)})},x=a=>{const t=f.find(l=>l.node.id===a.id);if(a.type==="folder"){let l=0,e=0;return a.children.forEach(d=>{switch(x(d)){case 1:l++;break;case 0:e++;break}}),l===0&&e===0?(t.selected=!1,t.indeterminate=!1,-1):l===a.children.length?(t.selected=!0,t.indeterminate=!1,1):(t.indeterminate=!0,0)}else return t.indeterminate=!1,t.selected?1:-1},H=a=>{const t=l=>{l.node.children.forEach(e=>{const d=f.find(ee=>ee.node.id===e.id);d&&(d.selected=l.selected,d.selected&&(d.show=!0,d.folded=!1),d.type==="folder"&&t(d))}),l.selected&&(l.show=!0,l.folded=!1)};t(a),x(m.node),U()},P=a=>{x(m.node),U([a])},U=async a=>{if(await L.value?.validate(),!N.value)return;let t;try{t=new RegExp(F.value,_.value.join(""))}catch{return}(a||f).forEach(e=>{e.type==="file"&&(e.selected&&t.test(e.name)?(e.targetName=e.name.replace(t,C.value),e.targetFullName=(e.parentItem.fullName===""?"":e.parentItem.fullName+"/")+e.targetName):(e.targetName=void 0,e.targetFullName=void 0),e.notChanged=e.name===e.targetName)}),$.value=!1;const l=new Map;f.filter(e=>!!e.targetFullName).forEach(e=>{l.set(e.targetFullName,(l.get(e.targetFullName)||0)+1)}),f.forEach(e=>{e.duplicated=l.get(e.targetFullName)>1,e.duplicated&&($.value=!0)})},Z=async()=>{if(!E.value.length)return B.warn(g("dialogs.bulkRenameFiles.nothing_to_do"));const a=[];for(const t of E.value)a.push(K.renameTorrentFile(m.hash,t.fullName,t.targetFullName));w.value=!0,Promise.all(a).then(()=>{B.success(g("dialogs.bulkRenameFiles.success")),D.value?.saveValueToHistory(),S.value?.saveValueToHistory()}).catch(t=>{B.error(t.toString())}).finally(()=>{w.value=!1,K.updateFileTree(),A()})},A=()=>{b.value=!1};return Fe([F,_,C],()=>{U()}),_e(()=>{j(m.node)}),(a,t)=>(n(),r(he,{modelValue:c(b),"onUpdate:modelValue":t[6]||(t[6]=l=>Re(b)?b.value=l:null),persistent:"",fullscreen:""},{default:o(()=>[s(me,{density:"compact"},{default:o(()=>[s(te,null,{default:o(()=>[s(oe,{density:"compact",color:"transparent"},{default:o(()=>[s(ne,null,{default:o(()=>[y(i(a.$t("dialogs.bulkRenameFiles.title")),1)]),_:1}),s(q,{icon:"mdi-close",onClick:t[0]||(t[0]=l=>A())})]),_:1})]),_:1}),s(se,{class:"d-flex flex-column"},{default:o(()=>[s(c(de),{modelValue:N.value,"onUpdate:modelValue":t[5]||(t[5]=l=>N.value=l),ref_key:"form",ref:L},{default:o(()=>[s(re,{"no-gutters":"",align:"center",justify:"center"},{default:o(()=>[s(h,{cols:a.$vuetify.display.mobile?9:void 0},{default:o(()=>[s(z,{historyKey:c(G).BULK_RENAME_REGEXP,ref_key:"regexpEl",ref:D,"hide-details":"",density:"compact",modelValue:F.value,"onUpdate:modelValue":t[1]||(t[1]=l=>F.value=l),rules:M,label:a.$t("dialogs.bulkRenameFiles.regexp")},null,8,["historyKey","modelValue","label"])]),_:1},8,["cols"]),s(h,{cols:a.$vuetify.display.mobile?3:"auto"},{default:o(()=>[s(ue,{class:"ml-2",modelValue:_.value,"onUpdate:modelValue":t[2]||(t[2]=l=>_.value=l),items:["d","g","i","m","s","u","v","y"],placeholder:c(g)("dialogs.bulkRenameFiles.select_regex_flags"),label:a.$t("dialogs.bulkRenameFiles.flags"),density:"compact",multiple:"","hide-details":""},null,8,["modelValue","placeholder","label"])]),_:1},8,["cols"]),s(h,{cols:"auto"},{default:o(()=>[s(u,{class:"mx-2",icon:`mdi-arrow-${a.$vuetify.display.mobile?"down":"right"}`},null,8,["icon"])]),_:1}),s(h,{cols:a.$vuetify.display.mobile?12:void 0},{default:o(()=>[s(z,{historyKey:c(G).BULK_RENAME_TARGET,ref_key:"targetEl",ref:S,"hide-details":"",density:"compact",modelValue:C.value,"onUpdate:modelValue":t[3]||(t[3]=l=>C.value=l),rules:M,label:a.$t("dialogs.bulkRenameFiles.target")},null,8,["historyKey","modelValue","label"])]),_:1},8,["cols"]),s(h,{cols:"auto"},{default:o(()=>[s(ie,{class:R(a.$vuetify.display.mobile?"mt-2":"ml-5"),color:"success",location:"top left",content:E.value.length},{default:o(()=>[s(q,{loading:w.value,disabled:!N.value||$.value,color:"primary",onClick:t[4]||(t[4]=l=>Z())},{default:o(()=>[y(i(a.$t("dialogs.bulkRenameFiles.run")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["class","content"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),a.$vuetify.display.mobile?(n(),r(pe,{key:1},{default:o(()=>[(n(!0),V(W,null,Ce(f,(l,e)=>(n(),V(W,null,[l.show?(n(),r(ge,{key:0},{default:o(()=>[e>0?(n(),r(ye,{key:0,class:"my-2"})):v("",!0),k("div",{class:"d-flex align-center",style:Q({"padding-left":`${l.indent*16}px`})},[s(J,{modelValue:l.selected,"onUpdate:modelValue":d=>l.selected=d,inline:"",color:l.targetName&&"accent",indeterminate:l.type==="folder"&&l.indeterminate,onChange:d=>l.type==="file"?P(l):H(l)},null,8,["modelValue","onUpdate:modelValue","color","indeterminate","onChange"]),l.type==="folder"?(n(),r(u,{key:0,onClick:d=>l.type==="folder"&&T(l,!l.folded)},{default:o(()=>[y(i(`mdi-chevron-${l.folded?"down":"up"}`),1)]),_:2},1032,["onClick"])):v("",!0),l.fullName===""?(n(),r(u,{key:1,icon:"mdi-file-tree"})):l.type==="file"?(n(),r(u,{key:2,icon:c(O)(l.name)},null,8,["icon"])):l.folded?(n(),r(u,{key:4,icon:"mdi-folder",color:"#ffe476"})):(n(),r(u,{key:3,icon:"mdi-folder-open",color:"#ffe476"})),k("div",Te,[k("span",{class:R({"text-grey strikethrough":l.targetName})},i(l.name),3),k("span",null,i(l.targetName),1)])],4)]),_:2},1024)):v("",!0)],64))),256))]),_:1})):(n(),r(ce,{key:0,headers:c(Y),items:f,density:"compact","fixed-header":""},{item:o(({internalItem:l})=>[l.raw.show?(n(),r(fe,{key:0,item:l},{"item.selected":o(({item:e})=>[s(J,{modelValue:e.selected,"onUpdate:modelValue":d=>e.selected=d,color:e.targetName&&"accent",indeterminate:e.type==="folder"&&e.indeterminate,onChange:d=>e.type==="file"?P(e):H(e)},null,8,["modelValue","onUpdate:modelValue","color","indeterminate","onChange"])]),"item.name":o(({item:e})=>[k("span",{class:R(["fold-toggle",{"cursor-pointer":e.type==="folder"}]),style:Q({"padding-left":`${e.indent*16}px`}),onClick:d=>e.type==="folder"&&T(e,!e.folded)},[e.type==="folder"?(n(),r(I,{key:0,location:"top",activator:"parent"},{default:o(()=>[y(i(c(g)(`dialogs.bulkRenameFiles.${e.folded?"unfold":"fold"}`)),1)]),_:2},1024)):v("",!0),e.type==="folder"?(n(),r(u,{key:1},{default:o(()=>[y(i(`mdi-chevron-${e.folded?"down":"up"}`),1)]),_:2},1024)):(n(),r(u,{key:2})),e.fullName===""?(n(),r(u,{key:3,icon:"mdi-file-tree"})):e.type==="file"?(n(),r(u,{key:4,icon:c(O)(e.name)},null,8,["icon"])):e.folded?(n(),r(u,{key:6,icon:"mdi-folder",color:"#ffe476"})):(n(),r(u,{key:5,icon:"mdi-folder-open",color:"#ffe476"})),y(" "+i(e.name),1)],14,$e)]),"item.targetName":o(({item:e})=>[e.type==="file"?(n(),V("span",{key:0,class:R(["target-name",{duplicated:e.duplicated,"not-changed":e.notChanged}])},[e.duplicated||e.notChanged?(n(),r(I,{key:0,activator:"parent"},{default:o(()=>[y(i(c(g)(`dialogs.bulkRenameFiles.${e.duplicated?"duplicated":"not_changed"}`)),1)]),_:2},1024)):(n(),V("span",we,i(e.targetName),1))],2)):(n(),V("span",Ee,[s(u,{icon:"mdi-cancel",color:"grey-lighten-1"}),s(I,{activator:"parent"},{default:o(()=>[y(i(c(g)("dialogs.bulkRenameFiles.notForFolder")),1)]),_:1})]))]),_:2},1032,["item"])):v("",!0)]),_:1},8,["headers","items"]))]),_:1})]),_:1})]),_:1},8,["modelValue"]))}})});export{Ke as default,__tla};
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{c as le,u as ae,e as te,J as oe,K as se,k as O,f as ne,g as de,q as re,s as h,M as P,N as j,v as ue,V as u,O as ie,P as ce,Q as fe,w as q,R as B,r as pe,d as ge,l as ye,t as me,x as he}from"./index-BhWmfNB5.js";import{u as ke,g as J}from"./TorrentDetail-CoyYqyCA.js";import{h as ve,d as p,v as Ve,r as be,c as Ne,w as Fe,z as _e,B as s,D as r,G as o,m as n,I as y,J as i,u as c,X as R,S as k,M as v,U as X,N as V,T as Ce,F as Q,O as Re,W as I}from"./vue-DFryKk-1.js";import"./vuetify-XtA0Y0Oj.js";import"./ColoredChip.vue_vue_type_script_setup_true_lang-DosC_URk.js";const $e=["onClick"],we={key:1},Ee={key:1},Te={class:"d-flex flex-column pl-3"},Ke=ve({__name:"BulkRenameFilesDialog",props:{guid:{},node:{},hash:{}},setup(W){const m=W,{isOpened:b}=le(m.guid),{t:g}=ae(),D=ke(),K=p(),N=p(!1),$=p(!1),F=p(""),L=p(),_=p([]),C=p(""),S=p(),w=p(!1),M=[a=>!!a],Y=Ve([{fixed:!0,sortable:!1,key:"selected",width:"50px"},{title:g("dialogs.bulkRenameFiles.col_origin_name"),sortable:!1,key:"name"},{title:g("dialogs.bulkRenameFiles.col_result_name"),sortable:!1,key:"targetName"}]),f=be([]),E=Ne(()=>f.filter(a=>a.type==="file"&&a.selected&&a.targetName&&a.name!==a.targetName)),z=(a,t,l=0)=>{const e={indent:l,name:a.name,fullName:a.fullName,parentItem:t,show:!0,folded:!1,selected:!1,type:a.type,node:a};if(f.push(e),a.type==="folder")for(const d of a.children)z(d,e,l+1)},T=(a,t)=>{a.folded=t,a.node.children.forEach(l=>{const e=f.find(d=>d.node.id===l.id);e.show=!t,e.type==="folder"&&t&&T(e,t)})},x=a=>{const t=f.find(l=>l.node.id===a.id);if(a.type==="folder"){let l=0,e=0;return a.children.forEach(d=>{switch(x(d)){case 1:l++;break;case 0:e++;break}}),l===0&&e===0?(t.selected=!1,t.indeterminate=!1,-1):l===a.children.length?(t.selected=!0,t.indeterminate=!1,1):(t.indeterminate=!0,0)}else return t.indeterminate=!1,t.selected?1:-1},A=a=>{const t=l=>{l.node.children.forEach(e=>{const d=f.find(ee=>ee.node.id===e.id);d&&(d.selected=l.selected,d.selected&&(d.show=!0,d.folded=!1),d.type==="folder"&&t(d))}),l.selected&&(l.show=!0,l.folded=!1)};t(a),x(m.node),U()},G=a=>{x(m.node),U([a])},U=async a=>{if(await K.value?.validate(),!N.value)return;let t;try{t=new RegExp(F.value,_.value.join(""))}catch{return}(a||f).forEach(e=>{e.type==="file"&&(e.selected&&t.test(e.name)?(e.targetName=e.name.replace(t,C.value),e.targetFullName=(e.parentItem.fullName===""?"":e.parentItem.fullName+"/")+e.targetName):(e.targetName=void 0,e.targetFullName=void 0),e.notChanged=e.name===e.targetName)}),$.value=!1;const l=new Map;f.filter(e=>!!e.targetFullName).forEach(e=>{l.set(e.targetFullName,(l.get(e.targetFullName)||0)+1)}),f.forEach(e=>{e.duplicated=l.get(e.targetFullName)>1,e.duplicated&&($.value=!0)})},Z=async()=>{if(!E.value.length)return I.warn(g("dialogs.bulkRenameFiles.nothing_to_do"));const a=[];for(const t of E.value)a.push(D.renameTorrentFile(m.hash,t.fullName,t.targetFullName));w.value=!0,Promise.all(a).then(()=>{I.success(g("dialogs.bulkRenameFiles.success")),L.value?.saveValueToHistory(),S.value?.saveValueToHistory()}).catch(t=>{I.error(t.toString())}).finally(()=>{w.value=!1,D.updateFileTreeTask.perform(),H()})},H=()=>{b.value=!1};return Fe([F,_,C],()=>{U()}),_e(()=>{z(m.node)}),(a,t)=>(s(),r(ye,{modelValue:c(b),"onUpdate:modelValue":t[6]||(t[6]=l=>Re(b)?b.value=l:null),persistent:"",fullscreen:""},{default:o(()=>[n(ge,{density:"compact"},{default:o(()=>[n(te,null,{default:o(()=>[n(oe,{density:"compact",color:"transparent"},{default:o(()=>[n(se,null,{default:o(()=>[y(i(a.$t("dialogs.bulkRenameFiles.title")),1)]),_:1}),n(O,{icon:"mdi-close",onClick:t[0]||(t[0]=l=>H())})]),_:1})]),_:1}),n(ne,{class:"d-flex flex-column"},{default:o(()=>[n(c(de),{modelValue:N.value,"onUpdate:modelValue":t[5]||(t[5]=l=>N.value=l),ref_key:"form",ref:K},{default:o(()=>[n(re,{"no-gutters":"",align:"center",justify:"center"},{default:o(()=>[n(h,{cols:a.$vuetify.display.mobile?9:void 0},{default:o(()=>[n(P,{historyKey:c(j).BULK_RENAME_REGEXP,ref_key:"regexpEl",ref:L,"hide-details":"",density:"compact",modelValue:F.value,"onUpdate:modelValue":t[1]||(t[1]=l=>F.value=l),rules:M,label:a.$t("dialogs.bulkRenameFiles.regexp")},null,8,["historyKey","modelValue","label"])]),_:1},8,["cols"]),n(h,{cols:a.$vuetify.display.mobile?3:"auto"},{default:o(()=>[n(ue,{class:"ml-2",modelValue:_.value,"onUpdate:modelValue":t[2]||(t[2]=l=>_.value=l),items:["d","g","i","m","s","u","v","y"],placeholder:c(g)("dialogs.bulkRenameFiles.select_regex_flags"),label:a.$t("dialogs.bulkRenameFiles.flags"),density:"compact",multiple:"","hide-details":""},null,8,["modelValue","placeholder","label"])]),_:1},8,["cols"]),n(h,{cols:"auto"},{default:o(()=>[n(u,{class:"mx-2",icon:`mdi-arrow-${a.$vuetify.display.mobile?"down":"right"}`},null,8,["icon"])]),_:1}),n(h,{cols:a.$vuetify.display.mobile?12:void 0},{default:o(()=>[n(P,{historyKey:c(j).BULK_RENAME_TARGET,ref_key:"targetEl",ref:S,"hide-details":"",density:"compact",modelValue:C.value,"onUpdate:modelValue":t[3]||(t[3]=l=>C.value=l),rules:M,label:a.$t("dialogs.bulkRenameFiles.target")},null,8,["historyKey","modelValue","label"])]),_:1},8,["cols"]),n(h,{cols:"auto"},{default:o(()=>[n(ie,{class:R(a.$vuetify.display.mobile?"mt-2":"ml-5"),color:"success",location:"top left",content:E.value.length},{default:o(()=>[n(O,{loading:w.value,disabled:!N.value||$.value,color:"primary",onClick:t[4]||(t[4]=l=>Z())},{default:o(()=>[y(i(a.$t("dialogs.bulkRenameFiles.run")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["class","content"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),a.$vuetify.display.mobile?(s(),r(pe,{key:1},{default:o(()=>[(s(!0),V(Q,null,Ce(f,(l,e)=>(s(),V(Q,null,[l.show?(s(),r(me,{key:0},{default:o(()=>[e>0?(s(),r(he,{key:0,class:"my-2"})):v("",!0),k("div",{class:"d-flex align-center",style:X({"padding-left":`${l.indent*16}px`})},[n(q,{modelValue:l.selected,"onUpdate:modelValue":d=>l.selected=d,inline:"",color:l.targetName&&"accent",indeterminate:l.type==="folder"&&l.indeterminate,onChange:d=>l.type==="file"?G(l):A(l)},null,8,["modelValue","onUpdate:modelValue","color","indeterminate","onChange"]),l.type==="folder"?(s(),r(u,{key:0,onClick:d=>l.type==="folder"&&T(l,!l.folded)},{default:o(()=>[y(i(`mdi-chevron-${l.folded?"down":"up"}`),1)]),_:2},1032,["onClick"])):v("",!0),l.fullName===""?(s(),r(u,{key:1,icon:"mdi-file-tree"})):l.type==="file"?(s(),r(u,{key:2,icon:c(J)(l.name)},null,8,["icon"])):l.folded?(s(),r(u,{key:4,icon:"mdi-folder",color:"#ffe476"})):(s(),r(u,{key:3,icon:"mdi-folder-open",color:"#ffe476"})),k("div",Te,[k("span",{class:R({"text-grey strikethrough":l.targetName})},i(l.name),3),k("span",null,i(l.targetName),1)])],4)]),_:2},1024)):v("",!0)],64))),256))]),_:1})):(s(),r(ce,{key:0,headers:c(Y),items:f,density:"compact","fixed-header":""},{item:o(({internalItem:l})=>[l.raw.show?(s(),r(fe,{key:0,item:l},{"item.selected":o(({item:e})=>[n(q,{modelValue:e.selected,"onUpdate:modelValue":d=>e.selected=d,color:e.targetName&&"accent",indeterminate:e.type==="folder"&&e.indeterminate,onChange:d=>e.type==="file"?G(e):A(e)},null,8,["modelValue","onUpdate:modelValue","color","indeterminate","onChange"])]),"item.name":o(({item:e})=>[k("span",{class:R(["fold-toggle",{"cursor-pointer":e.type==="folder"}]),style:X({"padding-left":`${e.indent*16}px`}),onClick:d=>e.type==="folder"&&T(e,!e.folded)},[e.type==="folder"?(s(),r(B,{key:0,location:"top",activator:"parent"},{default:o(()=>[y(i(c(g)(`dialogs.bulkRenameFiles.${e.folded?"unfold":"fold"}`)),1)]),_:2},1024)):v("",!0),e.type==="folder"?(s(),r(u,{key:1},{default:o(()=>[y(i(`mdi-chevron-${e.folded?"down":"up"}`),1)]),_:2},1024)):(s(),r(u,{key:2})),e.fullName===""?(s(),r(u,{key:3,icon:"mdi-file-tree"})):e.type==="file"?(s(),r(u,{key:4,icon:c(J)(e.name)},null,8,["icon"])):e.folded?(s(),r(u,{key:6,icon:"mdi-folder",color:"#ffe476"})):(s(),r(u,{key:5,icon:"mdi-folder-open",color:"#ffe476"})),y(" "+i(e.name),1)],14,$e)]),"item.targetName":o(({item:e})=>[e.type==="file"?(s(),V("span",{key:0,class:R(["target-name",{duplicated:e.duplicated,"not-changed":e.notChanged}])},[e.duplicated||e.notChanged?(s(),r(B,{key:0,activator:"parent"},{default:o(()=>[y(i(c(g)(`dialogs.bulkRenameFiles.${e.duplicated?"duplicated":"not_changed"}`)),1)]),_:2},1024)):(s(),V("span",we,i(e.targetName),1))],2)):(s(),V("span",Ee,[n(u,{icon:"mdi-cancel",color:"grey-lighten-1"}),n(B,{activator:"parent"},{default:o(()=>[y(i(c(g)("dialogs.bulkRenameFiles.notForFolder")),1)]),_:1})]))]),_:2},1032,["item"])):v("",!0)]),_:1},8,["headers","items"]))]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});export{Ke as default};
|
||||||
1
qbit/vuetorrent/public/assets/CanvasPool-BAToQajg.js
Normal file
1
qbit/vuetorrent/public/assets/CanvasPool-BAToQajg.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{D as n,n as c}from"./TorrentDetail-CoyYqyCA.js";class l{constructor(a){this._canvasPool=Object.create(null),this.canvasOptions=a||{},this.enableFullScreen=!1}_createCanvasAndContext(a,t){const s=n.get().createCanvas();s.width=a,s.height=t;const e=s.getContext("2d");return{canvas:s,context:e}}getOptimalCanvasAndContext(a,t,s=1){a=Math.ceil(a*s-1e-6),t=Math.ceil(t*s-1e-6),a=c(a),t=c(t);const e=(a<<17)+(t<<1);this._canvasPool[e]||(this._canvasPool[e]=[]);let o=this._canvasPool[e].pop();return o||(o=this._createCanvasAndContext(a,t)),o}returnCanvasAndContext(a){const t=a.canvas,{width:s,height:e}=t,o=(s<<17)+(e<<1);a.context.clearRect(0,0,s,e),this._canvasPool[o].push(a)}clear(){this._canvasPool={}}}const C=new l;export{C};
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{D as c,n,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";let C;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{class l{constructor(a){this._canvasPool=Object.create(null),this.canvasOptions=a||{},this.enableFullScreen=!1}_createCanvasAndContext(a,s){const t=c.get().createCanvas();t.width=a,t.height=s;const o=t.getContext("2d");return{canvas:t,context:o}}getOptimalCanvasAndContext(a,s,t=1){a=Math.ceil(a*t-1e-6),s=Math.ceil(s*t-1e-6),a=n(a),s=n(s);const o=(a<<17)+(s<<1);this._canvasPool[o]||(this._canvasPool[o]=[]);let e=this._canvasPool[o].pop();return e||(e=this._createCanvasAndContext(a,s)),e}returnCanvasAndContext(a){const s=a.canvas,{width:t,height:o}=s,e=(t<<17)+(o<<1);this._canvasPool[e].push(a)}clear(){this._canvasPool={}}}C=new l});export{C,__tla};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{k as M,g as F,Y as I,q as K,s as q,a as L,Z as A,$ as O,V as j,c as z,d as G,e as J,K as Q,M as W,f as Y,h as R,i as Z,j as X,m as x,a0 as D,a1 as ee,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{j as T,a0 as ae,H as l,I as n,J as o,U as oe,K as f,L as d,N as y,Q as g,n as t,V as N,q as E,F as H,a1 as le,a2 as te,a3 as se,E as U,f as $,r as ne,c as C,G as re,u as P,M as de,O as ue,P as ie,$ as ce,W as me}from"./vue-CfSjRv-x.js";import{a as fe}from"./vuetify-PctCzU6r.js";let ke,ge,_e;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{let pe,ve,he,Ve;pe={class:"d-flex"};ve={key:2};he={key:3};Ve=T({__name:"RightClickMenuEntry",props:{text:{},icon:{},action:{type:Function},hidden:{type:Boolean},disabled:{type:Boolean},disabledText:{},disabledIcon:{},children:{}},setup(c){const e=c,s=()=>{e.action&&e.action()};return(a,r)=>{const p=ae("RightClickMenuEntry",!0);return a.hidden?y("",!0):(l(),n(q,{key:0,class:"px-3",disabled:a.disabled,onClick:s},{default:o(()=>[oe("div",pe,[a.disabled&&a.disabledIcon?(l(),n(M,{key:0,class:"mr-2"},{default:o(()=>[f(d(a.disabledIcon),1)]),_:1})):a.icon?(l(),n(M,{key:1,class:"mr-2"},{default:o(()=>[f(d(a.icon),1)]),_:1})):y("",!0),a.disabled&&a.disabledText?(l(),g("span",ve,d(a.disabledText),1)):(l(),g("span",he,d(a.text),1)),t(F),!a.disabled&&a.children?(l(),n(M,{key:4},{default:o(()=>[f("mdi-chevron-right")]),_:1})):y("",!0)]),a.children?(l(),n(I,{key:0,activator:"parent","open-on-hover":"","open-on-click":"","close-delay":"10","open-delay":"0",location:"right"},{default:o(()=>[t(K,null,{default:o(()=>[(l(!0),g(H,null,N(a.children,v=>(l(),n(p,E({ref_for:!0},v),null,16))),256))]),_:1})]),_:1})):y("",!0)]),_:1},8,["disabled"]))}}});ge=T({__name:"RightClickMenu",props:le({menuData:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(c){const e=te(c,"modelValue");return(s,a)=>e.value?(l(),n(I,{key:0,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=r=>e.value=r),activator:"parent","close-on-content-click":!0,transition:"slide-y-transition","scroll-strategy":"none"},{default:o(()=>[t(K,null,{default:o(()=>[se(s.$slots,"top"),(l(!0),g(H,null,N(s.menuData,r=>(l(),n(Ve,E({ref_for:!0},r),null,16))),256))]),_:3})]),_:3},8,["modelValue"])):y("",!0)}});ke=T({__name:"MoveTorrentDialog",props:{guid:{},hashes:{},mode:{}},setup(c){const e=c,{isOpened:s}=L(e.guid),{t:a}=U(),r=A(),p=O(),v=$(),k=$(),h=$(!1),m=ne({newPath:""}),w=[u=>!!u||a("dialogs.moveTorrent.required")],V=C(()=>e.hashes.map(p.getTorrentByHash)),_=C(()=>{switch(e.mode){case"dl":return V.value[0]?.download_path;case"save":return V.value[0]?.savePath}});async function B(){await v.value?.validate(),h.value&&(await r.toggleAutoTmm(e.hashes,!1),await p.moveTorrents(e.mode,e.hashes,m.newPath),k.value?.saveValueToHistory(),S())}const S=()=>{s.value=!1};return re(()=>{m.newPath=_.value||""}),(u,i)=>(l(),n(X,{modelValue:P(s),"onUpdate:modelValue":i[3]||(i[3]=b=>ie(s)?s.value=b:null)},{default:o(()=>[t(Z,null,{default:o(()=>[t(j,null,{default:o(()=>[f(d(u.$t(`dialogs.moveTorrent.${u.mode}.title`)),1)]),_:1}),t(z,null,{default:o(()=>[t(P(G),{modelValue:h.value,"onUpdate:modelValue":i[1]||(i[1]=b=>h.value=b),ref_key:"form",ref:v,onSubmit:i[2]||(i[2]=de(()=>{},["prevent"]))},{default:o(()=>[_.value?(l(),n(J,{key:0,"model-value":_.value,disabled:"",label:u.$t("dialogs.moveTorrent.oldPath")},null,8,["model-value","label"])):y("",!0),t(Q,{modelValue:m.newPath,"onUpdate:modelValue":i[0]||(i[0]=b=>m.newPath=b),historyKey:P(W).TORRENT_PATH,ref_key:"field",ref:k,rules:w,autofocus:"",label:u.$t("dialogs.moveTorrent.newPath"),onKeydown:ue(B,["enter"])},null,8,["modelValue","historyKey","label"])]),_:1},8,["modelValue"])]),_:1}),t(Y,null,{default:o(()=>[t(F),t(R,{color:"error",onClick:S},{default:o(()=>[f(d(u.$t("common.cancel")),1)]),_:1}),t(R,{color:"accent",disabled:!h.value,onClick:B},{default:o(()=>[f(d(u.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});_e=T({__name:"ColoredChip",props:{defaultColor:{},disabled:{type:Boolean,default:!1},disabledValue:{},value:{}},setup(c){const e=c,{t:s}=U(),{current:a}=fe(),{enableHashColors:r,hideColoredChip:p}=ce(x());function v(V){return a.value.colors[V]??V}const k=C(()=>e.disabled||!r.value?e.defaultColor:D(e.value)),h=C(()=>e.disabled||!r.value?v(e.defaultColor):D(e.value)),m=C(()=>e.disabled?e.disabledValue||e.value||s("common.none"):e.value),w=C(()=>!p.value);return(V,_)=>w.value?(l(),n(ee,{key:0,color:k.value,variant:"flat"},{default:o(()=>[f(d(m.value),1)]),_:1},8,["color"])):(l(),g("div",{key:1,class:"text-no-wrap",style:me(`color: ${h.value}`)},d(m.value),5))}})});export{ke as _,ge as a,_e as b,__tla};
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{V as M,j as H,S as I,x as w,U as K,r as E,t as A,c as O,u as L,W as q,d as Y,e as j,f as z,g as G,a as J,M as Q,N as W,i as X,k as N,l as Z,o as x,X as R,Y as ee}from"./index-BhWmfNB5.js";import{h as _,Y as ae,B as t,D as r,G as o,S as te,I as v,J as i,M as d,N as h,m as l,F as T,T as U,Z as oe,_ as le,$ as F,d as S,r as se,c as k,H as ne,u as B,K as re,L as ue,O as de,Q as ie,U as me}from"./vue-DFryKk-1.js";import{u as ce}from"./vuetify-XtA0Y0Oj.js";const ye={class:"d-flex"},fe={key:2},pe={key:3},he=_({__name:"RightClickMenuEntry",props:{entryData:{}},setup(f){const a=f,s=()=>{a.entryData.action&&a.entryData.action()};return(e,n)=>{const m=ae("RightClickMenuEntry",!0);return e.entryData.hidden?d("",!0):(t(),r(A,{key:0,class:"px-3",disabled:e.entryData.disabled,onClick:s},{default:o(()=>[te("div",ye,[e.entryData.disabled&&e.entryData.disabledIcon?(t(),r(M,{key:0,class:"mr-2"},{default:o(()=>[v(i(e.entryData.disabledIcon),1)]),_:1})):e.entryData.icon?(t(),r(M,{key:1,class:"mr-2"},{default:o(()=>[v(i(e.entryData.icon),1)]),_:1})):d("",!0),e.entryData.disabled&&e.entryData.disabledText?(t(),h("span",fe,i(e.entryData.disabledText),1)):(t(),h("span",pe,i(e.entryData.text),1)),l(H),!e.entryData.disabled&&e.entryData.children?(t(),r(M,{key:4},{default:o(()=>n[0]||(n[0]=[v("mdi-chevron-right")])),_:1})):d("",!0)]),e.entryData.children?(t(),r(I,{key:0,activator:"parent","open-on-hover":"","open-on-click":"","close-delay":"10","open-delay":"0",location:"right"},{default:o(()=>[l(E,null,{default:o(()=>[e.entryData.slots?.top?(t(),h(T,{key:0},[(t(!0),h(T,null,U(e.entryData.slots.top,u=>(t(),r(m,{entryData:u},null,8,["entryData"]))),256)),l(w,{thickness:"3"})],64)):d("",!0),l(K,{items:e.entryData.children,"item-height":"48",renderless:""},{default:o(({item:u})=>[l(m,{entryData:u},null,8,["entryData"])]),_:1},8,["items"]),e.entryData.slots?.bottom?(t(),h(T,{key:1},[l(w,{thickness:"3"}),(t(!0),h(T,null,U(e.entryData.slots.bottom,u=>(t(),r(m,{entryData:u},null,8,["entryData"]))),256))],64)):d("",!0)]),_:1})]),_:1})):d("",!0)]),_:1},8,["disabled"]))}}}),ke=_({__name:"RightClickMenu",props:oe({menuData:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(f){const a=le(f,"modelValue");return(s,e)=>a.value?(t(),r(I,{key:0,modelValue:a.value,"onUpdate:modelValue":e[0]||(e[0]=n=>a.value=n),activator:"parent","close-on-content-click":"",transition:"slide-y-transition","scroll-strategy":"none"},{default:o(()=>[l(E,null,{default:o(()=>[F(s.$slots,"top"),s.$slots.top?(t(),r(w,{key:0,thickness:"3"})):d("",!0),l(K,{items:s.menuData,"item-height":"48",renderless:""},{default:o(({item:n})=>[l(he,{entryData:n},null,8,["entryData"])]),_:1},8,["items"]),s.$slots.bottom?(t(),r(w,{key:1,thickness:"3"})):d("",!0),F(s.$slots,"bottom")]),_:3})]),_:3},8,["modelValue"])):d("",!0)}}),be=_({__name:"MoveTorrentDialog",props:{guid:{},hashes:{},mode:{}},setup(f){const a=f,{isOpened:s}=O(a.guid),{t:e}=L(),n=q(),m=S(),u=S(),V=S(!1),D=se({newPath:""}),C=[c=>!!c||e("dialogs.moveTorrent.required")],g=k(()=>a.hashes.map(n.getTorrentByHash)),p=k(()=>{switch(a.mode){case"dl":return g.value[0]?.download_path;case"save":return g.value[0]?.savePath}});async function $(){await m.value?.validate(),V.value&&(await n.toggleAutoTmm(a.hashes,!1),await n.moveTorrents(a.mode,a.hashes,D.newPath),u.value?.saveValueToHistory(),P())}const P=()=>{s.value=!1};return ne(()=>{D.newPath=p.value||""}),(c,y)=>(t(),r(Z,{modelValue:B(s),"onUpdate:modelValue":y[3]||(y[3]=b=>de(s)?s.value=b:null)},{default:o(()=>[l(Y,null,{default:o(()=>[l(j,null,{default:o(()=>[v(i(c.$t(`dialogs.moveTorrent.${c.mode}.title`)),1)]),_:1}),l(z,null,{default:o(()=>[l(B(G),{modelValue:V.value,"onUpdate:modelValue":y[1]||(y[1]=b=>V.value=b),ref_key:"form",ref:m,onSubmit:y[2]||(y[2]=re(()=>{},["prevent"]))},{default:o(()=>[p.value?(t(),r(J,{key:0,"model-value":p.value,disabled:"",label:c.$t("dialogs.moveTorrent.oldPath")},null,8,["model-value","label"])):d("",!0),l(Q,{modelValue:D.newPath,"onUpdate:modelValue":y[0]||(y[0]=b=>D.newPath=b),historyKey:B(W).TORRENT_PATH,ref_key:"field",ref:u,rules:C,autofocus:"",label:c.$t("dialogs.moveTorrent.newPath"),onKeydown:ue($,["enter"])},null,8,["modelValue","historyKey","label"])]),_:1},8,["modelValue"])]),_:1}),l(X,null,{default:o(()=>[l(H),l(N,{color:"error",onClick:P},{default:o(()=>[v(i(c.$t("common.cancel")),1)]),_:1}),l(N,{color:"accent",disabled:!V.value,onClick:$},{default:o(()=>[v(i(c.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}}),Ce=_({__name:"ColoredChip",props:{defaultColor:{},disabled:{type:Boolean,default:!1},disabledValue:{},value:{}},setup(f){const a=f,{t:s}=L(),{current:e}=ce(),{enableHashColors:n,hideColoredChip:m}=ie(x());function u(p){return e.value.colors[p]??p}const V=k(()=>a.disabled||!n.value?a.defaultColor:R(a.value)),D=k(()=>a.disabled||!n.value?u(a.defaultColor):R(a.value)),C=k(()=>a.disabled?a.disabledValue||a.value||s("common.none"):a.value),g=k(()=>!m.value);return(p,$)=>g.value?(t(),r(ee,{key:0,color:V.value,variant:"flat"},{default:o(()=>[v(i(C.value),1)]),_:1},8,["color"])):(t(),h("div",{key:1,class:"text-no-wrap",style:me(`color: ${D.value}`)},i(C.value),5))}});export{ke as _,be as a,Ce as b};
|
||||||
@@ -1 +0,0 @@
|
|||||||
#torrentList[data-v-d4d10d01],#torrentList[data-v-8828dd56],#torrentList[data-v-403c3005]{background-color:unset}#torrentList tbody tr[data-v-403c3005]:nth-child(odd){background-color:rgb(var(--v-theme-surface))}#torrentList tbody tr.selected[data-v-403c3005]{position:relative}#torrentList tbody tr.selected[data-v-403c3005]:nth-child(odd):after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}
|
|
||||||
1
qbit/vuetorrent/public/assets/Dashboard-DWcdJnp6.css
Normal file
1
qbit/vuetorrent/public/assets/Dashboard-DWcdJnp6.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#torrentList[data-v-e7b305f7],#torrentList[data-v-67d3b70f],#torrentList{background-color:unset}#torrentList tbody tr:nth-child(odd){background-color:rgb(var(--v-theme-surface))}#torrentList tbody tr.selected{position:relative}#torrentList tbody tr.selected:nth-child(odd):after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}#torrentList .torrent-name{max-width:40vw;overflow:hidden;text-overflow:ellipsis}
|
||||||
6
qbit/vuetorrent/public/assets/Dashboard-DYOhHL9P.js
Normal file
6
qbit/vuetorrent/public/assets/Dashboard-DYOhHL9P.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
|||||||
import{j as w,E as Te,$ as F,c as _,H as l,Q as m,U as k,n,u as i,J as c,W as $e,L as v,F as M,q as O,I,N as x,f as R,r as je,G as Ce,Y as qe,K,M as J,O as ge,P as pe,S as Xe,Z as Oe,V as q,_ as ne,a5 as Ee,a6 as Ye,a7 as vt,a8 as ht,w as ft,v as bt,x as De,a9 as _t}from"./vue-CfSjRv-x.js";import{aN as Q,aO as yt,$ as se,aP as gt,e as W,Q as Y,Y as kt,aQ as Tt,g as we,h as L,aR as j,k as Ie,q as Qe,s as me,a as Le,V as Ae,c as ve,d as Ke,f as Re,i as re,j as Me,Z as Ve,aS as $t,aT as Pe,p as Fe,r as _e,v as ye,E as Ze,ab as Ct,aU as Je,m as U,aV as wt,aW as Vt,aX as We,C as Se,aY as et,aZ as tt,a_ as St,a$ as xt,b0 as ee,b1 as D,b2 as at,ae as Ue,X as Dt,b3 as It,aJ as Pt,b4 as Ne,b5 as Bt,x as ze,b6 as Be,b7 as Et,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{d as Lt}from"./index-BwjGcC1B.js";import{_ as He,a as At,b as ke,__tla as __tla_1}from"./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js";import{a as ot,u as lt}from"./vuetify-PctCzU6r.js";import{u as Kt,__tla as __tla_2}from"./ArrayPagination-C54Dd5Tu.js";let ho;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})()]).then(async()=>{let Rt,Mt,Ft,Ut,Ot,le,G,Nt,Ge,zt,Ht,Gt,jt,qt,nt,Xt,Yt,Qt,st,Zt,Jt,Wt,rt,ea,ta,aa,oa,it,la,na,sa,ra,dt,ia,da,ut,ua,ca,ct,ma,pa,va,mt,ha,fa,pt,ba,_a,ya,ga,ka,Ta,$a,Ca,wa,Va,Sa,xa,Da,Ia,Pa,Ba,Ea,La,Aa,Ka,Ra,Ma,Fa,Ua,Oa,Na,za,Ha,Ga,ja,qa,Xa,Ya,Qa,Za,Ja,Wa,eo,to,ao,oo,lo,no,so,ro;Rt={class:"d-flex my-3"};Mt={class:"pa-0"};Ft={class:"d-flex align-center text-uppercase text-select",style:{"font-size":"0.8em"}};Ut=w({__name:"Toolbar",setup(h){const{t:e}=Te(),r=Q(),{torrentCountString:t,isSelectionMultiple:a,displayMode:d}=F(r),{isDrawerOpen:o}=F(yt()),u=se(),{sortCriterias:p}=F(u),s=[{value:"added_on",title:e("dashboard.sortBy.added_on")},{value:"amount_left",title:e("dashboard.sortBy.amount_left")},{value:"availability",title:e("dashboard.sortBy.availability")},{value:"available_peers",title:e("dashboard.sortBy.available_peers")},{value:"available_seeds",title:e("dashboard.sortBy.available_seeds")},{value:"avgDownloadSpeed",title:e("dashboard.sortBy.avg_download_speed")},{value:"avgUploadSpeed",title:e("dashboard.sortBy.avg_upload_speed")},{value:"basename_content_path",title:e("dashboard.sortBy.basename_content_path")},{value:"basename_download_path",title:e("dashboard.sortBy.basename_download_path")},{value:"basename_save_path",title:e("dashboard.sortBy.basename_save_path")},{value:"category",title:e("dashboard.sortBy.category")},{value:"completed_on",title:e("dashboard.sortBy.completion_on")},{value:"content_path",title:e("dashboard.sortBy.content_path")},{value:"dl_limit",title:e("dashboard.sortBy.dl_limit")},{value:"dlspeed",title:e("dashboard.sortBy.dlspeed")},{value:"download_path",title:e("dashboard.sortBy.download_path")},{value:"downloaded",title:e("dashboard.sortBy.downloaded")},{value:"downloaded_session",title:e("dashboard.sortBy.downloaded_session")},{value:"eta",title:e("dashboard.sortBy.eta")},{value:"globalSpeed",title:e("dashboard.sortBy.globalSpeed")},{value:"globalVolume",title:e("dashboard.sortBy.globalVolume")},{value:"hash",title:e("dashboard.sortBy.hash")},{value:"inactive_seeding_time_limit",title:e("dashboard.sortBy.inactive_seeding_time_limit")},{value:"infohash_v1",title:e("dashboard.sortBy.infohash_v1")},{value:"infohash_v2",title:e("dashboard.sortBy.infohash_v2")},{value:"last_activity",title:e("dashboard.sortBy.last_activity")},{value:"name",title:e("dashboard.sortBy.name")},{value:"num_leechs",title:e("dashboard.sortBy.num_leechs")},{value:"num_seeds",title:e("dashboard.sortBy.num_seeds")},{value:"priority",title:e("dashboard.sortBy.priority")},{value:"progress",title:e("dashboard.sortBy.progress")},{value:"ratio",title:e("dashboard.sortBy.ratio")},{value:"ratio_limit",title:e("dashboard.sortBy.ratio_limit")},{value:"savePath",title:e("dashboard.sortBy.save_path")},{value:"seeding_time",title:e("dashboard.sortBy.seeding_time")},{value:"seeding_time_limit",title:e("dashboard.sortBy.seeding_time_limit")},{value:"seen_complete",title:e("dashboard.sortBy.seen_complete")},{value:"size",title:e("dashboard.sortBy.size")},{value:"state",title:e("dashboard.sortBy.state")},{value:"tags",title:e("dashboard.sortBy.tags")},{value:"time_active",title:e("dashboard.sortBy.time_active")},{value:"total_size",title:e("dashboard.sortBy.total_size")},{value:"trackerDomain",title:e("dashboard.sortBy.tracker")},{value:"trackers_count",title:e("dashboard.sortBy.trackers_count")},{value:"up_limit",title:e("dashboard.sortBy.up_limit")},{value:"uploaded",title:e("dashboard.sortBy.uploaded")},{value:"uploaded_session",title:e("dashboard.sortBy.uploaded_session")},{value:"upspeed",title:e("dashboard.sortBy.upspeed")}].sort((C,$)=>gt.text.asc(C.title,$.title)),b=_({get:()=>p.value[0],set:C=>{p.value=[{value:C.value,reverse:C.reverse}]}});function f(){u.textFilter=""}const P=_({get:()=>u.textFilter,set:Lt(C=>{u.textFilter=C??""},300)});function A(){a.value&&r.unselectAllTorrents(),a.value=!a.value}return(C,$)=>(l(),m(M,null,[k("div",null,[n(W,{id:"searchInput",modelValue:P.value,"onUpdate:modelValue":$[0]||($[0]=y=>P.value=y),label:i(e)("dashboard.searchInputLabel"),clearable:"",density:"compact","single-line":"","hide-details":"","prepend-inner-icon":"mdi-magnify",variant:"solo","onClick:clear":$[1]||($[1]=y=>f())},null,8,["modelValue","label"])]),k("div",Rt,[n(Y,{text:i(e)("dashboard.toggleSelectMode"),location:"top"},{activator:c(({props:y})=>[n(L,O({icon:i(a)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline"},y,{variant:"plain",onClick:A}),null,16,["icon"])]),_:1},8,["text"]),n(kt,null,{activator:c(({props:y})=>[n(Y,{text:C.$t("dashboard.displayMode.title"),location:"top"},{activator:c(({props:g})=>[n(L,O({icon:""},O(y,g),{variant:"plain"}),{default:c(()=>[i(d)===i(j).LIST?(l(),I(Ie,{key:0,icon:"mdi-view-list"})):x("",!0),i(d)===i(j).GRID?(l(),I(Ie,{key:1,icon:"mdi-view-grid"})):x("",!0),i(d)===i(j).TABLE?(l(),I(Ie,{key:2,icon:"mdi-table"})):x("",!0)]),_:2},1040)]),_:2},1032,["text"])]),default:c(()=>[n(Qe,null,{default:c(()=>[n(me,{title:C.$t("dashboard.displayMode.list"),"prepend-icon":"mdi-view-list",onClick:$[2]||($[2]=y=>d.value=i(j).LIST)},null,8,["title"]),n(me,{title:C.$t("dashboard.displayMode.grid"),"prepend-icon":"mdi-view-grid",onClick:$[3]||($[3]=y=>d.value=i(j).GRID)},null,8,["title"]),n(me,{title:C.$t("dashboard.displayMode.table"),"prepend-icon":"mdi-table",onClick:$[4]||($[4]=y=>d.value=i(j).TABLE)},null,8,["title"])]),_:1})]),_:1}),n(Y,{text:i(e)("dashboard.toggleSortOrder"),location:"top"},{activator:c(({props:y})=>[n(L,O({icon:b.value.reverse?"mdi-sort-descending":"mdi-sort-ascending"},y,{variant:"plain",onClick:$[5]||($[5]=g=>b.value.reverse=!b.value.reverse)}),null,16,["icon"])]),_:1},8,["text"]),k("div",Mt,[n(Tt,{modelValue:b.value.value,"onUpdate:modelValue":$[6]||($[6]=y=>b.value.value=y),items:i(s),label:i(e)("dashboard.sortLabel"),"auto-select-first":"",density:"compact","hide-details":"",variant:"solo-filled",style:$e(`width: ${C.$vuetify.display.xs||C.$vuetify.display.sm&&i(o)?140:260}px`)},null,8,["modelValue","items","label","style"])]),n(we),k("div",Ft,v(i(t)),1)])],64))}});Ot=w({__name:"RenameTorrentDialog",props:{guid:{},hash:{}},setup(h){const e=h,{isOpened:r}=Le(e.guid),{t}=Te(),a=se(),d=R(),o=R(),u=R(!1),p=je({newName:""}),s=[C=>!!C||t("dialogs.renameTorrent.required"),C=>C!==f.value||t("dialogs.renameTorrent.sameName")],b=_(()=>a.getTorrentByHash(e.hash)),f=_(()=>b.value?.name);async function P(){await o.value?.validate(),u.value&&(await a.renameTorrent(e.hash,p.newName),A())}const A=()=>{r.value=!1};return Ce(()=>{p.newName=b.value?.name||""}),qe(()=>{d.value?.select()}),(C,$)=>(l(),I(Me,{modelValue:i(r),"onUpdate:modelValue":$[3]||($[3]=y=>pe(r)?r.value=y:null)},{default:c(()=>[n(re,null,{default:c(()=>[n(Ae,null,{default:c(()=>[K(v(C.$t("dialogs.renameTorrent.title")),1)]),_:1}),n(ve,null,{default:c(()=>[n(i(Ke),{modelValue:u.value,"onUpdate:modelValue":$[1]||($[1]=y=>u.value=y),ref_key:"form",ref:o,onSubmit:$[2]||($[2]=J(()=>{},["prevent"]))},{default:c(()=>[f.value?(l(),I(W,{key:0,"model-value":f.value,disabled:"",label:C.$t("dialogs.renameTorrent.oldName")},null,8,["model-value","label"])):x("",!0),n(W,{modelValue:p.newName,"onUpdate:modelValue":$[0]||($[0]=y=>p.newName=y),ref_key:"field",ref:d,rules:s,autofocus:"",label:C.$t("dialogs.renameTorrent.newName"),onKeydown:ge(P,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),n(Re,null,{default:c(()=>[n(we),n(L,{color:"error",onClick:A},{default:c(()=>[K(v(C.$t("common.cancel")),1)]),_:1}),n(L,{color:"accent",disabled:!u.value,onClick:P},{default:c(()=>[K(v(C.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});le=-2;G=-1;Nt=w({__name:"ShareLimitDialog",props:{guid:{},hashes:{}},setup(h){const e=h,{isOpened:r}=Le(e.guid),t=Ve(),a=se(),d=R(!1),o=R("global"),u=R(!1),p=R(0),s=R(!1),b=R(0),f=R(!1),P=R(0),A=_(()=>o.value!=="enabled");function C(){r.value=!1}async function $(){switch(o.value){case"global":await t.setShareLimit(e.hashes,le,le,le);break;case"disabled":await t.setShareLimit(e.hashes,G,G,G);break;case"enabled":await t.setShareLimit(e.hashes,u.value?p.value:G,s.value?b.value:G,f.value?P.value:G);break}C()}return Ce(async()=>{const y=a.getTorrentByHash(e.hashes[0]);if(!y)return C();const g=y.ratio_limit,V=y.seeding_time_limit,z=y.inactive_seeding_time_limit;g===le&&V===le&&z===le?o.value="global":g===G&&V===G&&z===G?o.value="disabled":(o.value="enabled",u.value=g>=0,p.value=u.value?g:0,s.value=V>=0,b.value=s.value?V:0,f.value=z>=0,P.value=f.value?z:0)}),(y,g)=>(l(),I(Me,{modelValue:i(r),"onUpdate:modelValue":g[9]||(g[9]=V=>pe(r)?r.value=V:null),"max-width":"500"},{default:c(()=>[n(re,{title:y.$t("dialogs.share_limit.title")},{default:c(()=>[n(ve,null,{default:c(()=>[n(Ke,{modelValue:d.value,"onUpdate:modelValue":g[7]||(g[7]=V=>d.value=V),onSubmit:g[8]||(g[8]=J(()=>{},["prevent"])),onKeydown:ge(J($,["prevent"]),["enter"])},{default:c(()=>[n($t,{modelValue:o.value,"onUpdate:modelValue":g[0]||(g[0]=V=>o.value=V)},{default:c(()=>[n(Pe,{label:y.$t("dialogs.share_limit.global"),value:"global"},null,8,["label"]),n(Pe,{label:y.$t("dialogs.share_limit.disabled"),value:"disabled"},null,8,["label"]),n(Pe,{label:y.$t("dialogs.share_limit.enabled"),value:"enabled"},null,8,["label"])]),_:1},8,["modelValue"]),n(Fe,null,{default:c(()=>[n(_e,{cols:"12",class:"d-flex align-center"},{default:c(()=>[k("span",null,[n(ye,{modelValue:u.value,"onUpdate:modelValue":g[1]||(g[1]=V=>u.value=V),disabled:A.value},null,8,["modelValue","disabled"])]),n(W,{modelValue:p.value,"onUpdate:modelValue":g[2]||(g[2]=V=>p.value=V),disabled:A.value||!u.value,density:"compact","hide-details":"",label:y.$t("dialogs.share_limit.ratio_limit")},null,8,["modelValue","disabled","label"])]),_:1}),n(_e,{cols:"12",class:"d-flex align-center"},{default:c(()=>[k("span",null,[n(ye,{modelValue:s.value,"onUpdate:modelValue":g[3]||(g[3]=V=>s.value=V),disabled:A.value},null,8,["modelValue","disabled"])]),n(W,{modelValue:b.value,"onUpdate:modelValue":g[4]||(g[4]=V=>b.value=V),disabled:A.value||!s.value,density:"compact","hide-details":"",label:y.$t("dialogs.share_limit.seeding_time_limit")},null,8,["modelValue","disabled","label"])]),_:1}),n(_e,{cols:"12",class:"d-flex align-center"},{default:c(()=>[k("span",null,[n(ye,{modelValue:f.value,"onUpdate:modelValue":g[5]||(g[5]=V=>f.value=V),disabled:A.value},null,8,["modelValue","disabled"])]),n(W,{modelValue:P.value,"onUpdate:modelValue":g[6]||(g[6]=V=>P.value=V),disabled:A.value||!f.value,density:"compact","hide-details":"",label:y.$t("dialogs.share_limit.inactive_seeding_time_limit")},null,8,["modelValue","disabled","label"])]),_:1})]),_:1})]),_:1},8,["modelValue","onKeydown"])]),_:1}),n(Re,null,{default:c(()=>[n(we),n(L,{color:"error",onClick:C},{default:c(()=>[K(v(y.$t("common.cancel")),1)]),_:1}),n(L,{color:"accent",disabled:!d.value,onClick:$},{default:c(()=>[K(v(y.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}});Ge=w({__name:"SpeedLimitDialog",props:{guid:{},hashes:{},mode:{}},setup(h){const e=h,{isOpened:r}=Le(e.guid),t=Ve(),a=se(),d=R(!1),o=R(0);function u(){r.value=!1}async function p(){const s=Math.max(0,o.value)*1e3;switch(e.mode){case"download":await t.setDownloadLimit(s,e.hashes);break;case"upload":await t.setUploadLimit(s,e.hashes);break}u()}return Ce(async()=>{const s=a.getTorrentByHash(e.hashes[0]);if(!s)return u();switch(e.mode){case"download":o.value=Math.max(0,Math.round(s.dl_limit/1e3));break;case"upload":o.value=Math.max(0,Math.round(s.up_limit/1e3));break}}),(s,b)=>(l(),I(Me,{modelValue:i(r),"onUpdate:modelValue":b[3]||(b[3]=f=>pe(r)?r.value=f:null)},{default:c(()=>[n(re,{title:s.$t(`dialogs.speed_limit.${s.mode}`)},{default:c(()=>[n(ve,null,{default:c(()=>[n(Ke,{modelValue:d.value,"onUpdate:modelValue":b[1]||(b[1]=f=>d.value=f),onSubmit:b[2]||(b[2]=J(()=>{},["prevent"])),onKeydown:ge(J(p,["prevent"]),["enter"])},{default:c(()=>[n(W,{modelValue:o.value,"onUpdate:modelValue":b[0]||(b[0]=f=>o.value=f),modelModifiers:{number:!0},type:"number",autofocus:"",clearable:"",label:s.$t("dialogs.speed_limit.label"),"prepend-inner-icon":"mdi-speedometer",suffix:"kB/s",onKeydown:ge(J(p,["prevent"]),["enter"])},null,8,["modelValue","label","onKeydown"])]),_:1},8,["modelValue","onKeydown"])]),_:1}),n(Re,null,{default:c(()=>[n(we),n(L,{color:"error",onClick:u},{default:c(()=>[K(v(s.$t("common.cancel")),1)]),_:1}),n(L,{color:"accent",disabled:!d.value,onClick:p},{default:c(()=>[K(v(s.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}});zt={class:"d-flex justify-space-around"};Ht=w({__name:"RightClick",props:{rightClickProperties:{}},setup(h){const{t:e}=Te(),r=Xe(),t=Q(),a=Ze(),d=Ve(),o=Ct(),u=se(),p=_(()=>t.selectedTorrents.length>1),s=_(()=>t.selectedTorrents),b=_(()=>s.value[0]),f=_(()=>u.getTorrentByHash(b.value)),P=_(()=>t.selectedTorrents.map(u.getTorrentByHash).filter(S=>!!S)),A=_(()=>[{name:""},...d.categories]);async function C(){await u.resumeTorrents(s)}async function $(){await u.forceResumeTorrents(s)}async function y(){await u.pauseTorrents(s)}function g(){a.createDialog(Je,{hashes:[...t.selectedTorrents]})}function V(){a.createDialog(He,{hashes:[...t.selectedTorrents],mode:"dl"})}function z(){a.createDialog(He,{hashes:[...t.selectedTorrents],mode:"save"})}function X(){a.createDialog(Ot,{hash:t.selectedTorrents[0]})}async function ie(){await u.recheckTorrents(s)}async function he(){await d.reannounceTorrents(s)}async function xe(){await d.toggleSeqDl(s)}async function de(){await d.toggleFLPiecePrio(s)}async function ue(){await d.toggleAutoTmm(s,!f.value?.auto_tmm)}function te(S){return P.value.every(H=>H&&H.tags&&H.tags.includes(S))}async function ae(){await u.removeTorrentTags(s.value)}async function fe(S){te(S)?await u.removeTorrentTags(s.value,[S]):await u.addTorrentTags(s.value,[S])}async function Z(S){try{await navigator.clipboard.writeText(S)}catch{Oe.error(e("toast.copy.error"));return}Oe.success(e("toast.copy.success"))}function ce(){a.createDialog(Ge,{hashes:s.value,mode:"download"})}function be(){a.createDialog(Ge,{hashes:s.value,mode:"upload"})}function T(){a.createDialog(Nt,{hashes:s.value})}async function B(){s.value.forEach(S=>{u.exportTorrent(S).then(H=>{const N=window.URL.createObjectURL(H),oe=document.createElement("a");oe.href=N,oe.style.opacity="0",oe.setAttribute("download",`${S}.torrent`),document.body.appendChild(oe),oe.click(),document.body.removeChild(oe)})})}const E=_(()=>[{text:e("dashboard.right_click.advanced.title"),icon:"mdi-head-cog",children:[{text:e("dashboard.right_click.advanced.download_path"),icon:"mdi-tray-arrow-down",action:V},{text:e("dashboard.right_click.advanced.save_path"),icon:"mdi-content-save",action:z},{text:e("dashboard.right_click.advanced.rename"),icon:"mdi-rename-box",hidden:p.value,action:X},{text:e("dashboard.right_click.advanced.recheck"),icon:"mdi-playlist-check",action:ie},{text:e("dashboard.right_click.advanced.reannounce"),icon:"mdi-bullhorn",action:he},{text:e("dashboard.right_click.advanced.seq_dl"),icon:f.value?.seq_dl?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:xe},{text:e("dashboard.right_click.advanced.f_l_prio"),icon:f.value?.f_l_piece_prio?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:de},{text:e("dashboard.right_click.advanced.auto_tmm"),icon:f.value?.auto_tmm?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:ue}]},{text:e("dashboard.right_click.priority.title"),icon:"mdi-priority-high",hidden:!o.preferences?.queueing_enabled,children:[{text:e("dashboard.right_click.priority.top"),icon:"mdi-priority-high",action:async()=>await u.setTorrentPriority(s.value,"topPrio")},{text:e("dashboard.right_click.priority.increase"),icon:"mdi-arrow-up",action:async()=>await u.setTorrentPriority(s.value,"increasePrio")},{text:e("dashboard.right_click.priority.decrease"),icon:"mdi-arrow-down",action:async()=>await u.setTorrentPriority(s.value,"decreasePrio")},{text:e("dashboard.right_click.priority.bottom"),icon:"mdi-priority-low",action:async()=>await u.setTorrentPriority(s.value,"bottomPrio")}]},{text:e("dashboard.right_click.tags.title"),icon:"mdi-tag",disabled:d.tags.length===0,disabledText:e("dashboard.right_click.tags.disabled_title"),disabledIcon:"mdi-tag-off",children:[...f.value?.tags.length?[{text:e("dashboard.right_click.tags.remove_all"),action:ae,icon:"mdi-playlist-remove"}]:[],...d.tags.map(S=>({text:S,icon:te(S)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:async()=>await fe(S)}))]},{text:e("dashboard.right_click.category.title"),icon:"mdi-label",disabled:d.categories.length===0,disabledText:e("dashboard.right_click.category.disabled_title"),disabledIcon:"mdi-label-off",children:A.value.map(S=>({text:S.name===""?e("dashboard.right_click.category.clear"):S.name,action:async()=>await u.setTorrentCategory(s.value,S.name)}))},{text:e("dashboard.right_click.speed_limit.title"),icon:"mdi-speedometer-slow",children:[{text:e("dashboard.right_click.speed_limit.download"),icon:"mdi-download",action:ce},{text:e("dashboard.right_click.speed_limit.upload"),icon:"mdi-upload",action:be},{text:e("dashboard.right_click.speed_limit.share"),icon:"mdi-account-group",action:T}]},{text:e("dashboard.right_click.copy.title"),icon:"mdi-content-copy",hidden:p.value,children:[{text:e("dashboard.right_click.copy.name"),icon:"mdi-alphabetical-variant",action:async()=>f.value&&await Z(f.value.name)},{text:e("dashboard.right_click.copy.hash"),icon:"mdi-pound",action:async()=>await Z(b.value)},{text:e("dashboard.right_click.copy.magnet"),icon:"mdi-magnet",action:async()=>f.value&&await Z(f.value.magnet)}]},{text:e("dashboard.right_click.export",t.selectedTorrents.length),icon:p.value?"mdi-download-multiple":"mdi-download",action:B},{text:e("dashboard.right_click.info"),icon:"mdi-information",hidden:p.value,action:()=>r.push({name:"torrentDetail",params:{hash:b.value}})}]);return(S,H)=>(l(),m("div",{style:$e(`position: absolute; left: ${S.rightClickProperties.offset[0]}px; top: ${S.rightClickProperties.offset[1]}px;`)},[n(i(At),{modelValue:S.rightClickProperties.isVisible,"onUpdate:modelValue":H[0]||(H[0]=N=>S.rightClickProperties.isVisible=N),"menu-data":E.value},{top:c(()=>[n(me,null,{default:c(()=>[k("div",zt,[n(Y,{location:"top"},{activator:c(({props:N})=>[n(L,O({density:"compact",variant:"plain",icon:"mdi-play"},N,{onClick:C}),null,16)]),default:c(()=>[k("span",null,v(S.$t("dashboard.right_click.top.resume")),1)]),_:1}),n(Y,{location:"top"},{activator:c(({props:N})=>[n(L,O({density:"compact",variant:"plain",icon:"mdi-fast-forward"},N,{onClick:$}),null,16)]),default:c(()=>[k("span",null,v(S.$t("dashboard.right_click.top.force_resume")),1)]),_:1}),n(Y,{location:"top"},{activator:c(({props:N})=>[n(L,O({density:"compact",variant:"plain",icon:"mdi-pause"},N,{onClick:y}),null,16)]),default:c(()=>[k("span",null,v(S.$t("dashboard.right_click.top.pause")),1)]),_:1}),n(Y,{location:"top"},{activator:c(({props:N})=>[n(L,O({color:"red",density:"compact",variant:"plain",icon:"mdi-delete-forever"},N,{onClick:g}),null,16)]),default:c(()=>[k("span",null,v(S.$t("dashboard.right_click.top.delete")),1)]),_:1})])]),_:1})]),_:1},8,["modelValue","menu-data"])],4))}});Gt={class:"d-flex flex-column"};jt={key:0,class:"text-caption text-grey"};qt={key:0,class:"text-caption text-grey"};nt=w({__name:"ItemAmount",props:{torrent:{},titleKey:{},value:{type:Function},total:{type:Function}},setup(h){return(e,r)=>(l(),m("div",Gt,[e.titleKey?(l(),m("div",jt,v(e.$t(e.titleKey)),1)):x("",!0),k("div",null,[K(v(e.value(e.torrent))+" ",1),e.total?(l(),m("span",qt," / "+v(e.total(e.torrent)),1)):x("",!0)])]))}});Xt={key:0,class:"d-flex flex-column"};Yt={key:0,class:"text-caption text-grey"};Qt={class:"d-flex flex-row flex-gap-column-small"};st=w({__name:"ItemChip",props:{torrent:{},titleKey:{},value:{},emptyValueKey:{},color:{},enableHashColor:{type:Boolean,default:!1}},setup(h){const e=h,{hideChipIfUnset:r}=F(U()),t=_(()=>e.value(e.torrent)),a=_(()=>t.value.length<1||t.value[0]===""),d=_(()=>!(r.value&&a.value));return(o,u)=>d.value?(l(),m("div",Xt,[o.titleKey?(l(),m("div",Yt,v(o.$t(o.titleKey)),1)):x("",!0),k("div",Qt,[a.value?(l(),I(ke,{key:0,disabled:!0,"default-color":o.color(o.torrent),value:o.$t(o.emptyValueKey),size:"small"},null,8,["default-color","value"])):(l(!0),m(M,{key:1},q(t.value,p=>(l(),I(ke,{disabled:!o.enableHashColor,"default-color":o.color(o.torrent),value:p,size:"small"},null,8,["disabled","default-color","value"]))),256))])])):x("",!0)}});Zt={class:"d-flex flex-column"};Jt={key:0,class:"text-caption text-grey"};Wt={class:"text-caption text-grey"};rt=w({__name:"ItemData",props:{torrent:{},titleKey:{},value:{type:Function}},setup(h){const e=h,{useBinarySize:r}=F(U()),t=_(()=>e.value(e.torrent));return(a,d)=>(l(),m("div",Zt,[a.titleKey?(l(),m("div",Jt,v(a.$t(a.titleKey)),1)):x("",!0),k("div",null,[K(v(i(wt)(t.value,i(r)))+" ",1),k("span",Wt,v(i(Vt)(t.value,i(r))),1)])]))}});ea={class:"d-flex flex-column"};ta={key:0,class:"text-caption text-grey"};aa={key:0};oa={key:1};it=w({__name:"ItemDateTime",props:{torrent:{},titleKey:{},value:{type:Function}},setup(h){const e=h,{dateFormat:r}=F(U()),t=_(()=>e.value(e.torrent));return(a,d)=>(l(),m("div",ea,[a.titleKey?(l(),m("div",ta,v(a.$t(a.titleKey)),1)):x("",!0),k("div",null,[t.value>0?(l(),m("span",aa,v(i(We)(t.value,i(r))),1)):(l(),m("span",oa,v(a.$t("dashboard.not_complete")),1))])]))}});la={class:"d-flex flex-column"};na={key:0,class:"text-caption text-grey"};sa={key:0};ra={key:1};dt=w({__name:"ItemDuration",props:{torrent:{},titleKey:{},unit:{},value:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent)),t=_(()=>{const a=Se.duration(r.value,e.unit),d=[a.years(),a.months(),a.days(),a.hours(),a.minutes(),a.seconds()],o=["Y","M","d","h","m","s"];let u=!1;return d.map((p,s)=>{if(u||p)return u=!0,`${p}${o[s]}`}).filter(p=>p).join(" ")});return(a,d)=>(l(),m("div",la,[a.titleKey?(l(),m("div",na,v(a.$t(a.titleKey)),1)):x("",!0),k("div",null,[r.value>0?(l(),m("span",sa,v(t.value),1)):(l(),m("span",ra,v(a.$t("common.NA")),1))])]))}});ia={class:"d-flex flex-column"};da={key:0,class:"text-caption text-grey"};ut=w({__name:"ItemPercent",props:{torrent:{},titleKey:{},value:{type:Function},color:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent));return(t,a)=>(l(),m("div",ia,[t.titleKey?(l(),m("div",da,v(t.$t(t.titleKey)),1)):x("",!0),n(tt,{"model-value":r.value,max:1,height:20,color:t.color(t.torrent),rounded:"sm",style:{width:"10em"}},{default:c(()=>[K(v(i(et)(r.value)),1)]),_:1},8,["model-value","color"])]))}});ua={class:"d-flex flex-column"};ca={key:0,class:"text-caption text-grey"};ct=w({__name:"ItemRelativeTime",props:{torrent:{},titleKey:{},value:{type:Function}},setup(h){return(e,r)=>(l(),m("div",ua,[e.titleKey?(l(),m("div",ca,v(e.$t(e.titleKey)),1)):x("",!0),k("div",null,[k("span",null,v(i(Se)(e.value(e.torrent)*1e3).fromNow()),1)])]))}});ma={class:"d-flex flex-column"};pa={key:0,class:"text-caption text-grey"};va={class:"text-caption text-grey"};mt=w({__name:"ItemSpeed",props:{torrent:{},titleKey:{},value:{type:Function}},setup(h){const e=h,{useBitSpeed:r}=F(U()),t=_(()=>e.value(e.torrent));return(a,d)=>(l(),m("div",ma,[a.titleKey?(l(),m("div",pa,v(a.$t(a.titleKey)),1)):x("",!0),k("div",null,[K(v(i(St)(t.value,i(r)))+" ",1),k("span",va,v(i(xt)(t.value,i(r))),1)])]))}});ha={class:"d-flex flex-column"};fa={key:0,class:"text-caption text-grey"};pt=w({__name:"ItemText",props:{torrent:{},titleKey:{},value:{type:Function},color:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent));return(t,a)=>(l(),m("div",ha,[t.titleKey?(l(),m("div",fa,v(t.$t(t.titleKey)),1)):x("",!0),k("div",{class:ne(t.color?t.color(r.value):"")},v(r.value),3)]))}});ba={class:"d-flex flex-gap flex-wrap"};_a=w({__name:"GridTorrent",props:{torrent:{}},emits:["onTorrentClick"],setup(h){const e=h,{current:r}=ot(),t=Q(),a=U(),d=_(()=>(e.torrent.progress===1?a.doneGridProperties:a.busyGridProperties).filter(b=>b.active).sort((b,f)=>b.order-f.order)),o=s=>{switch(s){case D.AMOUNT:return nt;case D.CHIP:return st;case D.DATA:return rt;case D.DATETIME:return it;case D.DURATION:return dt;case D.PERCENT:return ut;case D.RELATIVE:return ct;case D.SPEED:return mt;case D.TEXT:default:return pt}},u=_(()=>t.isTorrentInSelection(e.torrent.hash)),p=_(()=>r.value.colors[ee(e.torrent.state)]);return(s,b)=>(l(),I(re,{class:"cursor-pointer",style:$e(`border-left: 6px solid ${p.value}`),height:"100%",color:u.value?`${i(ee)(s.torrent.state)}-darken-3`:void 0,onClick:b[0]||(b[0]=f=>s.$emit("onTorrentClick",f,s.torrent))},{default:c(()=>[n(Ae,{class:"text-wrap text-subtitle-1 pt-1 pb-0"},{default:c(()=>[K(v(s.torrent.name),1)]),_:1}),n(ve,null,{default:c(()=>[k("div",ba,[(l(!0),m(M,null,q(d.value,f=>(l(),m(M,null,[f.props?(l(),I(Ee(o(f.type)),O({key:0,torrent:s.torrent,ref_for:!0},f.props),null,16,["torrent"])):x("",!0)],64))),256))])]),_:1})]),_:1},8,["style","color"]))}});ya={class:"d-flex align-center",style:{height:"100%",width:"100%"}};ga=w({__name:"GridView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(h){const e=lt(),r=Q();return(t,a)=>(l(),I(Fe,{id:"torrentList"},{default:c(()=>[(l(!0),m(M,null,q(t.paginatedTorrents,d=>(l(),I(_e,{cols:"12",lg:"3",md:"4",sm:"6",xl:"2",class:ne([i(e).mobile?"pb-2":"pb-4","pt-0"]),onContextmenu:o=>t.$emit("onTorrentRightClick",o,d),onTouchcancel:a[1]||(a[1]=o=>t.$emit("endPress")),onTouchend:a[2]||(a[2]=o=>t.$emit("endPress")),onTouchmove:a[3]||(a[3]=o=>t.$emit("endPress")),onTouchstart:o=>t.$emit("startPress",o.touches.item(0),d),onDblclick:o=>t.$emit("onTorrentDblClick",d)},{default:c(()=>[k("div",ya,[n(at,null,{default:c(()=>[i(r).isSelectionMultiple?(l(),I(L,{key:0,color:i(ee)(d.state),icon:i(r).isTorrentInSelection(d.hash)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"mr-2",variant:"text",onClick:o=>t.$emit("onCheckboxClick",d)},null,8,["color","icon","onClick"])):x("",!0)]),_:2},1024),n(_a,{torrent:d,onOnTorrentClick:a[0]||(a[0]=(o,u)=>t.$emit("onTorrentClick",o,u))},null,8,["torrent"])])]),_:2},1032,["class","onContextmenu","onTouchstart","onDblclick"]))),256))]),_:1}))}});ka=Ue(ga,[["__scopeId","data-v-d4d10d01"]]);Ta={class:"d-flex flex-gap flex-wrap"};$a=w({__name:"ListTorrent",props:{torrent:{}},emits:["onTorrentClick"],setup(h){const e=h,{current:r}=ot(),t=Q(),a=U(),d=_(()=>(e.torrent.progress===1?a.doneTorrentProperties:a.busyTorrentProperties).filter(b=>b.active).sort((b,f)=>b.order-f.order)),o=s=>{switch(s){case D.AMOUNT:return nt;case D.CHIP:return st;case D.DATA:return rt;case D.DATETIME:return it;case D.DURATION:return dt;case D.PERCENT:return ut;case D.RELATIVE:return ct;case D.SPEED:return mt;case D.TEXT:default:return pt}},u=_(()=>t.isTorrentInSelection(e.torrent.hash)),p=_(()=>r.value.colors[ee(e.torrent.state)]);return(s,b)=>(l(),I(re,{class:"cursor-pointer",style:$e(`border-left: 6px solid ${p.value}`),width:"100%",color:u.value?`${i(ee)(s.torrent.state)}-darken-3`:void 0,onClick:b[0]||(b[0]=f=>s.$emit("onTorrentClick",f,s.torrent))},{default:c(()=>[n(Ae,{class:"text-wrap pt-1 pb-0 px-2 text-truncate",style:{"font-size":"0.97em"}},{default:c(()=>[K(v(s.torrent.name),1)]),_:1}),n(ve,{class:"pa-2 pt-0"},{default:c(()=>[k("div",Ta,[(l(!0),m(M,null,q(d.value,f=>(l(),m(M,null,[f.props?(l(),I(Ee(o(f.type)),O({key:0,torrent:s.torrent,ref_for:!0},f.props),null,16,["torrent"])):x("",!0)],64))),256))])]),_:1})]),_:1},8,["style","color"]))}});Ca={class:"d-flex align-center"};wa=w({__name:"ListView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(h){const e=lt(),r=Q();return(t,a)=>(l(),I(Qe,{id:"torrentList",class:"pa-0"},{default:c(()=>[(l(!0),m(M,null,q(t.paginatedTorrents,d=>(l(),I(me,{id:`torrent-${d.hash}`,class:ne([i(e).mobile?"mb-2":"mb-4","pa-0"]),onContextmenu:o=>t.$emit("onTorrentRightClick",o,d),onTouchcancel:a[1]||(a[1]=o=>t.$emit("endPress")),onTouchend:a[2]||(a[2]=o=>t.$emit("endPress")),onTouchmove:a[3]||(a[3]=o=>t.$emit("endPress")),onTouchstart:o=>t.$emit("startPress",o.touches.item(0),d),onDblclick:o=>t.$emit("onTorrentDblClick",d)},{default:c(()=>[k("div",Ca,[n(at,null,{default:c(()=>[i(r).isSelectionMultiple?(l(),I(L,{key:0,color:i(ee)(d.state),icon:i(r).isTorrentInSelection(d.hash)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"mr-2",variant:"text",onClick:o=>t.$emit("onCheckboxClick",d)},null,8,["color","icon","onClick"])):x("",!0)]),_:2},1024),n($a,{torrent:d,onOnTorrentClick:a[0]||(a[0]=(o,u)=>t.$emit("onTorrentClick",o,u))},null,8,["torrent"])])]),_:2},1032,["id","class","onContextmenu","onTouchstart","onDblclick"]))),256))]),_:1}))}});Va=Ue(wa,[["__scopeId","data-v-8828dd56"]]);Sa={class:"text-no-wrap"};xa={key:0};Da=w({__name:"ItemAmount",props:{torrent:{},value:{type:Function},total:{type:Function}},setup(h){return(e,r)=>(l(),m("td",Sa,[K(v(e.value(e.torrent))+" ",1),e.total?(l(),m("span",xa," / "+v(e.total(e.torrent)),1)):x("",!0)]))}});Ia={key:0,class:"d-flex flex-row flex-gap-column-small"};Pa=w({__name:"ItemChip",props:{torrent:{},value:{},emptyValueKey:{},color:{},enableHashColor:{type:Boolean,default:!1}},setup(h){const e=h,{hideChipIfUnset:r}=F(U()),t=_(()=>e.value(e.torrent)),a=_(()=>t.value.length<1||t.value[0]===""),d=_(()=>!(r.value&&a.value));return(o,u)=>(l(),m("td",null,[d.value?(l(),m("div",Ia,[a.value?(l(),I(ke,{key:0,disabled:!0,"default-color":o.color(o.torrent),value:o.$t(o.emptyValueKey),size:"small"},null,8,["default-color","value"])):(l(!0),m(M,{key:1},q(t.value,p=>(l(),I(ke,{disabled:!o.enableHashColor,"default-color":o.color(o.torrent),value:p,size:"small"},null,8,["disabled","default-color","value"]))),256))])):x("",!0)]))}});Ba={class:"text-no-wrap"};Ea=w({__name:"ItemData",props:{torrent:{},value:{type:Function}},setup(h){const{useBinarySize:e}=F(U());return(r,t)=>(l(),m("td",Ba,v(i(Dt)(r.value(r.torrent),i(e))),1))}});La={key:0,class:"text-no-wrap"};Aa={key:1,class:"text-no-wrap"};Ka=w({__name:"ItemDateTime",props:{torrent:{},value:{type:Function}},setup(h){const e=h,{dateFormat:r}=F(U()),t=_(()=>e.value(e.torrent));return(a,d)=>t.value>0?(l(),m("td",La,v(i(We)(t.value,i(r))),1)):(l(),m("td",Aa,v(a.$t("dashboard.not_complete")),1))}});Ra={key:0,class:"text-no-wrap"};Ma={key:1,class:"text-no-wrap"};Fa=w({__name:"ItemDuration",props:{torrent:{},unit:{},value:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent)),t=_(()=>{const a=Se.duration(r.value,e.unit),d=[a.years(),a.months(),a.days(),a.hours(),a.minutes(),a.seconds()],o=["Y","M","d","h","m","s"];let u=!1;return d.map((p,s)=>{if(u||p)return u=!0,`${p}${o[s]}`}).filter(p=>p).join(" ")});return(a,d)=>r.value>0?(l(),m("td",Ra,v(t.value),1)):(l(),m("td",Ma,v(a.$t("common.NA")),1))}});Ua=w({__name:"ItemPercent",props:{torrent:{},value:{type:Function},color:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent));return(t,a)=>(l(),m("td",null,[n(tt,{"model-value":r.value,max:1,height:20,color:t.color(t.torrent),rounded:"sm",style:{width:"10em"}},{default:c(()=>[K(v(i(et)(r.value)),1)]),_:1},8,["model-value","color"])]))}});Oa={class:"text-no-wrap"};Na=w({__name:"ItemRelativeTime",props:{torrent:{},value:{type:Function}},setup(h){return(e,r)=>(l(),m("td",Oa,v(i(Se)(e.value(e.torrent)*1e3).fromNow()),1))}});za={class:"text-no-wrap"};Ha=w({__name:"ItemSpeed",props:{torrent:{},value:{type:Function}},setup(h){const{useBitSpeed:e}=F(U());return(r,t)=>(l(),m("td",za,v(i(It)(r.value(r.torrent),i(e))),1))}});Ga=w({__name:"ItemText",props:{torrent:{},value:{type:Function},color:{type:Function}},setup(h){const e=h,r=_(()=>e.value(e.torrent));return(t,a)=>(l(),m("td",{class:ne([t.color?t.color(r.value):"","text-no-wrap"])},v(r.value),3))}});ja=w({__name:"TableTorrent",props:{torrent:{}},setup(h){const e=U(),r=_(()=>e.tableProperties.filter(a=>a.active).sort((a,d)=>a.order-d.order)),t=a=>{switch(a){case D.AMOUNT:return Da;case D.CHIP:return Pa;case D.DATA:return Ea;case D.DATETIME:return Ka;case D.DURATION:return Fa;case D.PERCENT:return Ua;case D.RELATIVE:return Na;case D.SPEED:return Ha;case D.TEXT:default:return Ga}};return(a,d)=>(l(!0),m(M,null,q(r.value,o=>(l(),m(M,null,[o.props?(l(),I(Ee(t(o.type)),O({key:0,torrent:a.torrent,ref_for:!0},o.props),null,16,["torrent"])):x("",!0)],64))),256))}});qa=h=>(vt("data-v-403c3005"),h=h(),ht(),h);Xa=qa(()=>k("th",{class:"px-1"},null,-1));Ya={key:0};Qa={class:"text-left"};Za={class:"text-left"};Ja=["onContextmenu","onTouchstart","onClick","onDblclick"];Wa={key:0};eo=w({__name:"TableView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(h){const e=Q(),r=U(),t=_(()=>r.tableProperties.filter(o=>o.active).sort((o,u)=>o.order-u.order));function a(o){return e.isTorrentInSelection(o.hash)}const d=o=>["cursor-pointer",a(o)?`bg-${ee(o.state)}-darken-3 selected`:""];return(o,u)=>(l(),I(Pt,{id:"torrentList",class:"pa-0",density:"compact"},{default:c(()=>[k("thead",null,[k("tr",null,[Xa,i(e).isSelectionMultiple?(l(),m("th",Ya)):x("",!0),k("th",Qa,v(o.$t("torrent.properties.name")),1),(l(!0),m(M,null,q(t.value,p=>(l(),m("th",Za,v(o.$t(p.props.titleKey)),1))),256))])]),k("tbody",null,[(l(!0),m(M,null,q(o.paginatedTorrents,p=>Ye((l(),m("tr",{class:ne(d(p)),onContextmenu:s=>o.$emit("onTorrentRightClick",s,p),onTouchcancel:u[0]||(u[0]=s=>o.$emit("endPress")),onTouchend:u[1]||(u[1]=s=>o.$emit("endPress")),onTouchmove:u[2]||(u[2]=s=>o.$emit("endPress")),onTouchstart:s=>o.$emit("startPress",s.touches.item(0),p),onClick:s=>o.$emit("onTorrentClick",s,p),onDblclick:s=>o.$emit("onTorrentDblClick",p)},[k("td",{class:ne(`pa-0 bg-torrent-${i(Ne)[p.state].toLowerCase()}`)},null,2),i(e).isSelectionMultiple?(l(),m("td",Wa,[n(ye,{"model-value":a(p),color:`torrent-${i(Ne)[p.state].toLowerCase()}`,variant:"text",onClick:J(s=>o.$emit("onCheckboxClick",p),["stop"])},null,8,["model-value","color","onClick"])])):x("",!0),k("td",null,v(p.name),1),n(ja,{torrent:p},null,8,["torrent"])],42,Ja)),[[Bt]])),256))])]),_:1}))}});to=Ue(eo,[["__scopeId","data-v-403c3005"]]);ao={class:"pt-4 px-1 px-sm-5"};oo={class:"text-grey"};lo={key:0,class:"mt-5 text-xs-center"};no={class:"text-grey"};so={key:1};ro={key:5};ho=w({__name:"Dashboard",setup(h){const{t:e}=Te(),r=Xe(),t=Q(),{currentPage:a,isSelectionMultiple:d,selectedTorrents:o,displayMode:u}=F(t),p=Ze(),s=Ve(),b=se(),{processedTorrents:f}=F(b),P=U(),A=_(()=>u.value===j.LIST),C=_(()=>u.value===j.GRID),$=_(()=>u.value===j.TABLE),{paginatedResults:y,currentPage:g,pageCount:V}=Kt(f,P.paginationSize,a),z=_(()=>f.value.length<=o.value.length),X=je({isVisible:!1,offset:[0,0]});function ie(){window.scrollTo({top:0,behavior:"smooth"})}function he(T){if(T)return De(()=>{document.getElementById("searchInput")?.focus()});De(()=>{document.getElementById("searchInput")?.blur()})}function xe(){z.value?t.unselectAllTorrents():t.selectTorrents(...f.value.map(T=>T.hash))}function de(T){d.value||r.push({name:"torrentDetail",params:{hash:T.hash}})}function ue(T){t.toggleSelect(T.hash)}function te(T,B){T.shiftKey?t.spanTorrentSelection(B.hash):(Be(T)||t.isSelectionMultiple)&&(t.isSelectionMultiple=!0,t.toggleSelect(B.hash))}async function ae(T,B){X.isVisible&&(X.isVisible=!1,await De()),X.isVisible=!0,X.offset=[T.pageX,T.pageY],d.value?o.value.length===0&&t.selectTorrent(B.hash):(t.unselectAllTorrents(),t.selectTorrent(B.hash))}const fe=R();function Z(T,B){fe.value=setTimeout(()=>{ae(T,B)},500)}function ce(){clearTimeout(fe.value)}function be(T){if(p.hasActiveDialog)return!1;const B=T.target;if(Be(T)&&T.key==="a"&&B.tagName!=="INPUT")return t.unselectAllTorrents(),t.selectTorrents(...f.value.map(E=>E.hash)),T.preventDefault(),!0;if(Be(T)&&T.key==="f"){const E=document.getElementById("searchInput");if(document.activeElement!==E)return he(!0),T.preventDefault(),!0}if(T.key==="Escape"){const E=document.getElementById("searchInput");return document.activeElement===E?he(!1):(d.value=!1,t.unselectAllTorrents()),T.preventDefault(),!0}if(T.key==="Delete"){if(o.value.length===0)return;const E=document.getElementById("searchInput");return document.activeElement!==E&&(p.createDialog(Je,{hashes:o.value}),T.preventDefault()),!0}if(T.key==="/"){const E=document.getElementById("searchInput");return document.activeElement!==E&&(r.push({name:"searchEngine"}),T.preventDefault()),!0}}return ft(()=>X.isVisible,T=>{!T&&!d.value&&t.unselectAllTorrents()}),Ce(async()=>{await s.fetchCategories(),await s.fetchTags()}),qe(()=>{document.addEventListener("keydown",be),d.value=!1,ie()}),bt(()=>{document.removeEventListener("keydown",be)}),(T,B)=>(l(),m(M,null,[k("div",ao,[n(Ut),n(Fe,{class:"ma-0 pa-0"},{default:c(()=>[n(Et,null,{default:c(()=>[Ye(n(re,{color:"transparent"},{default:c(()=>[n(Y,{text:i(e)("common.selectAll"),location:"bottom"},{activator:c(({props:E})=>[n(L,O({icon:z.value?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"text-grey",color:"transparent",style:{left:"-8px"}},E,{onClick:xe}),null,16,["icon"])]),_:1},8,["text"]),k("span",oo,v(i(e)("dashboard.selectAll")),1)]),_:1},512),[[_t,i(d)]])]),_:1})]),_:1}),i(f).length===0?(l(),m("div",lo,[k("p",no,v(i(e)("common.emptyList")),1)])):x("",!0),i(P).isPaginationOnTop&&!i(P).isInfiniteScrollActive&&i(V)>1?(l(),m("div",so,[n(ze,{modelValue:i(g),"onUpdate:modelValue":B[0]||(B[0]=E=>pe(g)?g.value=E:null),length:i(V),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left",onInput:ie},null,8,["modelValue","length"])])):x("",!0),A.value?(l(),I(Va,{key:2,"paginated-torrents":i(y),onOnTorrentClick:te,onOnTorrentDblClick:de,onOnCheckboxClick:ue,onOnTorrentRightClick:ae,onStartPress:Z,onEndPress:ce},null,8,["paginated-torrents"])):C.value?(l(),I(ka,{key:3,class:"mb-2","paginated-torrents":i(y),onOnTorrentClick:te,onOnTorrentDblClick:de,onOnCheckboxClick:ue,onOnTorrentRightClick:ae,onStartPress:Z,onEndPress:ce},null,8,["paginated-torrents"])):$.value?(l(),I(to,{key:4,"paginated-torrents":i(y),onOnTorrentClick:te,onOnTorrentDblClick:de,onOnCheckboxClick:ue,onOnTorrentRightClick:ae,onStartPress:Z,onEndPress:ce},null,8,["paginated-torrents"])):x("",!0),!i(P).isPaginationOnTop&&!i(P).isInfiniteScrollActive&&i(V)>1?(l(),m("div",ro,[n(ze,{modelValue:i(g),"onUpdate:modelValue":B[1]||(B[1]=E=>pe(g)?g.value=E:null),length:i(V),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left",onInput:ie},null,8,["modelValue","length"])])):x("",!0)]),n(Ht,{"right-click-properties":X},null,8,["right-click-properties"])],64))}})});export{ho as default,__tla};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
const e={pdf:"mdi-file-pdf-box",png:"mdi-file-image",jpg:"mdi-file-image",jpeg:"mdi-file-image",tiff:"mdi-file-image",doc:"mdi-file-document",docx:"mdi-file-document",txt:"mdi-file-document",nfo:"mdi-information-variant-box",mp3:"mdi-music",wav:"mdi-music",flac:"mdi-music",avi:"mdi-movie",mp4:"mdi-movie",mkv:"mdi-movie",mov:"mdi-movie",wmv:"mdi-movie",srt:"mdi-subtitles",idx:"mdi-subtitles",sub:"mdi-subtitles",rar:"mdi-zip-box-outline",zip:"mdi-zip-box-outline",gz:"mdi-zip-box-outline","7z":"mdi-zip-box-outline",iso:"mdi-zip-box-outline",exe:"mdi-application-brackets",msi:"mdi-application-brackets",dmg:"mdi-application-brackets",deb:"mdi-application-brackets",jar:"mdi-application-brackets"};function d(i){const m=i.split(".").pop()?.toLowerCase()||"";return e[m]||"mdi-file"}export{d as g};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{j as v,E as b,S as h,X as C,r as q,f as k,Y as x,a as S,H as K,I as A,J as s,n as e,K as m,L as p,u as l,M as f,O as _,Z as y}from"./vue-CfSjRv-x.js";import{_ as F,__tla as __tla_0}from"./PasswordField.vue_vue_type_script_setup_true_lang-D82vCg5_.js";import{F as T,G as B,V as I,H as M,c as O,d as U,e as E,k as H,f as L,h as N,i as R,__tla as __tla_1}from"./index-C0tfT_Qc.js";import"./vuetify-PctCzU6r.js";let Y;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{Y=v({__name:"Login",setup(j){const{t:a}=b(),w=h(),o=C(),u=T(),r=q({username:"",password:""}),c=k(!1),V={username:[d=>!!d||a("login.rules.username_required")],password:[d=>!!d||a("login.rules.password_required")]},i=async()=>{c.value&&(await u.login(r.username,r.password),u.isAuthenticated?(y.success(a("login.success")),g()):y.error(a("login.error")))},g=()=>{o.query.redirect?w.push(o.query.redirect):w.push({name:"dashboard"})};return x(async()=>{o.query.username&&o.query.password&&await u.login(o.query.username,o.query.password)}),S(()=>{u.isAuthenticated&&g()}),(d,n)=>(K(),A(B,{class:"fill-height"},{default:s(()=>[e(R,{class:"mx-auto",rounded:"lg","min-width":"250"},{default:s(()=>[e(I,null,{default:s(()=>[m(p(l(a)("login.title")),1)]),_:1}),e(M,null,{default:s(()=>[m(p(l(a)("login.subtitle")),1)]),_:1}),e(O,null,{default:s(()=>[e(U,{modelValue:c.value,"onUpdate:modelValue":n[2]||(n[2]=t=>c.value=t),onSubmit:f(i,["prevent"])},{default:s(()=>[e(E,{modelValue:r.username,"onUpdate:modelValue":n[0]||(n[0]=t=>r.username=t),id:"username",name:"username",label:l(a)("login.username"),autofocus:"",rules:V.username,onKeydown:_(f(i,["prevent"]),["enter"]),variant:"outlined"},{prepend:s(()=>[e(H,{color:"accent",icon:"mdi-account"})]),_:1},8,["modelValue","label","rules","onKeydown"]),e(F,{modelValue:r.password,"onUpdate:modelValue":n[1]||(n[1]=t=>r.password=t),id:"password",label:l(a)("login.password"),rules:V.password,"prepend-icon":"mdi-lock",onKeydown:_(f(i,["prevent"]),["enter"]),variant:"outlined"},null,8,["modelValue","label","rules","onKeydown"])]),_:1},8,["modelValue"])]),_:1}),e(L,null,{default:s(()=>[e(N,{variant:"elevated",block:"",color:"accent",onClick:i},{default:s(()=>[m(p(l(a)("login.submit")),1)]),_:1})]),_:1})]),_:1})]),_:1}))}})});export{Y as default,__tla};
|
|
||||||
2
qbit/vuetorrent/public/assets/Login-rKlF0sBc.js
Normal file
2
qbit/vuetorrent/public/assets/Login-rKlF0sBc.js
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import{h as v,P as b,V as C,r as h,d as q,z as k,a as x,B as K,D as S,G as o,m as e,I as m,J as p,u,K as f,L as _,W as y}from"./vue-DFryKk-1.js";import{_ as A}from"./PasswordField.vue_vue_type_script_setup_true_lang-WzCPFRKj.js";import{u as B,G as I,H as T,e as U,I as F,f as $,g as D,a as E,V as G,i as L,k as M,d as N}from"./index-BhWmfNB5.js";import"./vuetify-XtA0Y0Oj.js";const P=v({__name:"Login",setup(O){const{t:s}=B(),V=b(),t=C(),i=I(),n=h({username:"",password:""}),c=q(!1),w={username:[r=>!!r||s("login.rules.username_required")],password:[r=>!!r||s("login.rules.password_required")]},d=async()=>{if(!c.value)return;const r=await i.login(n.username,n.password);if(i.isAuthenticated)y.success(s("login.success")),g();else{let a=s("login.error");r.status!==200&&(a+=`
|
||||||
|
Error code: ${r.status} (${r.data})`),y.error(a)}},g=()=>{t.query.redirect?V.push(t.query.redirect):V.push({name:"dashboard"})};return k(async()=>{t.query.username&&t.query.password&&await i.login(t.query.username,t.query.password)}),x(()=>{i.isAuthenticated&&g()}),(r,a)=>(K(),S(T,{class:"fill-height"},{default:o(()=>[e(N,{class:"mx-auto",rounded:"lg","min-width":"250"},{default:o(()=>[e(U,null,{default:o(()=>[m(p(u(s)("login.title")),1)]),_:1}),e(F,null,{default:o(()=>[m(p(u(s)("login.subtitle")),1)]),_:1}),e($,null,{default:o(()=>[e(D,{modelValue:c.value,"onUpdate:modelValue":a[2]||(a[2]=l=>c.value=l),onSubmit:f(d,["prevent"])},{default:o(()=>[e(E,{modelValue:n.username,"onUpdate:modelValue":a[0]||(a[0]=l=>n.username=l),id:"username",name:"username",label:u(s)("login.username"),autofocus:"",rules:w.username,onKeydown:_(f(d,["prevent"]),["enter"]),variant:"outlined"},{prepend:o(()=>[e(G,{color:"accent",icon:"mdi-account"})]),_:1},8,["modelValue","label","rules","onKeydown"]),e(A,{modelValue:n.password,"onUpdate:modelValue":a[1]||(a[1]=l=>n.password=l),id:"password",label:u(s)("login.password"),rules:w.password,"prepend-icon":"mdi-lock",onKeydown:_(f(d,["prevent"]),["enter"]),variant:"outlined"},null,8,["modelValue","label","rules","onKeydown"])]),_:1},8,["modelValue"])]),_:1}),e(L,null,{default:o(()=>[e(M,{variant:"elevated",block:"",color:"accent",onClick:d},{default:o(()=>[m(p(u(s)("login.submit")),1)]),_:1})]),_:1})]),_:1})]),_:1}))}});export{P as default};
|
||||||
1
qbit/vuetorrent/public/assets/Logs-DrMT2Xmb.js
Normal file
1
qbit/vuetorrent/public/assets/Logs-DrMT2Xmb.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{u as W,n as J,o as K,L as s,p as Q,q as I,r as X,T as Y,s as g,k as R,t as m,v as Z,w as ee,x as c,a as te,y as A,z as le,A as ae,B as se,j as ne,C as oe,D as re}from"./index-BhWmfNB5.js";import{h as ue,P as ie,Q as de,c as T,d as me,H as ce,R as pe,B as u,N as C,m as e,G as t,S as f,J as i,u as n,O as v,D as y,M as V,F,T as ge,I as B,U as E}from"./vue-DFryKk-1.js";import{u as fe}from"./vuetify-XtA0Y0Oj.js";const ve={class:"pa-3"},ye={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"},Ve={class:"d-flex justify-end"},he={class:"d-flex mr-8 overflow-hidden"},ke={class:"d-flex"},we=ue({__name:"Logs",setup(Le){const P=ie(),{t:U}=W(),{current:O}=fe(),h=J(),{filteredLogs:$,logTypeFilter:r,logMessageFilter:k,paginatedResults:M,currentPage:d,pageCount:p,reverseSort:L}=de(h),j=K(),D=T(()=>({light:{normal:"black",info:"blue",warning:"orange",critical:"red"},dark:{normal:"white",info:"deepskyblue",warning:"darkorange",critical:new Y("darkred").lighten(12).toString()}})),_=me([{title:s[s.NORMAL],value:s.NORMAL},{title:s[s.INFO],value:s.INFO},{title:s[s.WARNING],value:s.WARNING},{title:s[s.CRITICAL],value:s.CRITICAL}]),w=T(()=>r.value.length>0),x=T(()=>r.value.length===_.value.length),S=()=>{P.push({name:"dashboard"})},N=a=>`color: ${D.value[O.value.dark?"dark":"light"][s[a.type].toLowerCase()]}`,z=a=>s[a.type],G=a=>re(a.timestamp*1e3).format(j.dateFormat),q=()=>{x.value?r.value=[]:r.value=_.value.map(a=>a.value)},b=a=>{a.key==="Escape"&&S()};return ce(async()=>{document.addEventListener("keydown",b),await h.cleanAndFetchLogs(),Q(h.updateLogs,15e3)}),pe(()=>{document.removeEventListener("keydown",b)}),(a,o)=>(u(),C("div",ve,[e(I,{"no-gutters":"",align:"center",justify:"center"},{default:t(()=>[e(g,null,{default:t(()=>[f("h1",ye,i(n(U)("logs.title")),1)]),_:1}),e(g,null,{default:t(()=>[f("div",Ve,[e(R,{icon:n(L)?"mdi-sort-descending":"mdi-sort-ascending",variant:"plain",onClick:o[0]||(o[0]=l=>L.value=!n(L))},null,8,["icon"]),e(R,{icon:"mdi-close",variant:"plain",onClick:S})])]),_:1})]),_:1}),e(X,null,{default:t(()=>[e(m,null,{default:t(()=>[e(I,null,{default:t(()=>[e(g,{cols:"6"},{default:t(()=>[e(Z,{modelValue:n(r),"onUpdate:modelValue":o[1]||(o[1]=l=>v(r)?r.value=l:null),items:_.value,label:a.$t("logs.filters.type"),"hide-details":"",multiple:"",chips:""},{"prepend-item":t(()=>[e(m,{title:a.$t("common.selectAll"),onClick:q},{prepend:t(()=>[e(ee,{indeterminate:w.value&&!x.value,"model-value":w.value},null,8,["indeterminate","model-value"])]),_:1},8,["title"]),e(c)]),_:1},8,["modelValue","items","label"])]),_:1}),e(g,{cols:"6"},{default:t(()=>[e(te,{modelValue:n(k),"onUpdate:modelValue":o[2]||(o[2]=l=>v(k)?k.value=l:null),label:a.$t("logs.filters.query"),"hide-details":"",clearable:""},null,8,["modelValue","label"])]),_:1})]),_:1})]),_:1}),e(c,{class:"my-3",thickness:"5"}),n(p)>1?(u(),y(m,{key:0},{default:t(()=>[e(A,{modelValue:n(d),"onUpdate:modelValue":o[3]||(o[3]=l=>v(d)?d.value=l:null),length:n(p),"prev-icon":"mdi-menu-left","next-icon":"mdi-menu-right"},null,8,["modelValue","length"])]),_:1})):V("",!0),e(c),(u(!0),C(F,null,ge(n(M),(l,H)=>(u(),C(F,null,[H>0?(u(),y(c,{key:0})):V("",!0),e(m,{class:"pa-0"},{default:t(()=>[e(le,{class:"p-0"},{default:t(()=>[e(ae,{class:"pa-0"},{default:t(()=>[e(se,{class:"text-no-wrap",style:E(N(l))},{default:t(()=>[f("div",he,"["+i(l.id)+"] "+i(l.message),1),e(ne),f("div",ke,i(G(l)),1)]),_:2},1032,["style"]),e(oe,{class:"wrap-word text-select",style:E(N(l))},{default:t(()=>[B(" ["+i(z(l))+"] "+i(l.message),1)]),_:2},1032,["style"])]),_:2},1024)]),_:2},1024)]),_:2},1024)],64))),256)),n($).length===0?(u(),y(m,{key:1},{default:t(()=>[B(i(a.$t("logs.emptyLogList")),1)]),_:1})):V("",!0),e(c),n(p)>1?(u(),y(m,{key:2},{default:t(()=>[e(A,{modelValue:n(d),"onUpdate:modelValue":o[4]||(o[4]=l=>v(d)?d.value=l:null),length:n(p),"prev-icon":"mdi-menu-left","next-icon":"mdi-menu-right"},null,8,["modelValue","length"])]),_:1})):V("",!0)]),_:1})]))}});export{we as default};
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{u as K,__tla as __tla_0}from"./ArrayPagination-C54Dd5Tu.js";import{l as Q,m as J,T as X,L as l,n as Y,o as Z,p as A,q as ee,r as f,h as te,s as m,t as le,v as ae,w as c,e as se,x as R,y as ne,z as oe,A as ue,g as re,B as ie,C as de,__tla as __tla_1}from"./index-C0tfT_Qc.js";import{j as me,S as ce,E as pe,c as p,f as T,G as ge,T as fe,H as r,Q as k,n as e,J as a,U as v,L as i,u as n,I as y,P as b,N as V,F,V as ve,W as B,K as E}from"./vue-CfSjRv-x.js";import{a as ye}from"./vuetify-PctCzU6r.js";let xe;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{let Ve,he,Le,_e,Te;Ve={class:"pa-3"};he={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"};Le={class:"d-flex justify-end"};_e={class:"d-flex mr-8 overflow-hidden"};Te={class:"d-flex"};xe=me({__name:"Logs",setup(ke){const P=ce(),{t:O}=pe(),{current:U}=ye(),h=Q(),$=J(),j=p(()=>({light:{normal:"black",info:"blue",warning:"orange",critical:"red"},dark:{normal:"white",info:"deepskyblue",warning:"darkorange",critical:new X("darkred").lighten(12).toString()}})),L=T([{title:l[l.NORMAL],value:l.NORMAL},{title:l[l.INFO],value:l.INFO},{title:l[l.WARNING],value:l.WARNING},{title:l[l.CRITICAL],value:l.CRITICAL}]),u=T([l.NORMAL,l.INFO,l.WARNING,l.CRITICAL]),_=T(""),G=p(()=>h.logs),M=p(()=>G.value.filter(t=>u.value.includes(t.type))),C=p(()=>u.value.length>0),N=p(()=>u.value.length===L.value.length),{results:I}=Y(M,_,t=>t.message),{paginatedResults:W,currentPage:d,pageCount:g}=K(I,30),w=()=>{P.push({name:"dashboard"})},x=t=>`color: ${j.value[U.value.dark?"dark":"light"][l[t.type].toLowerCase()]}`,q=t=>l[t.type],z=t=>de(t.timestamp*1e3).format($.dateFormat),D=()=>{N.value?u.value=[]:u.value=L.value.map(t=>t.value)},S=t=>{t.key==="Escape"&&w()};return ge(async()=>{document.addEventListener("keydown",S),await h.cleanAndFetchLogs(),Z(h.fetchLogs,15e3)}),fe(()=>{document.removeEventListener("keydown",S)}),(t,o)=>(r(),k("div",Ve,[e(A,{"no-gutters":"",align:"center",justify:"center"},{default:a(()=>[e(f,null,{default:a(()=>[v("h1",he,i(n(O)("logs.title")),1)]),_:1}),e(f,null,{default:a(()=>[v("div",Le,[e(te,{icon:"mdi-close",variant:"plain",onClick:w})])]),_:1})]),_:1}),e(ee,null,{default:a(()=>[e(m,null,{default:a(()=>[e(A,null,{default:a(()=>[e(f,{cols:"6"},{default:a(()=>[e(le,{modelValue:u.value,"onUpdate:modelValue":o[0]||(o[0]=s=>u.value=s),items:L.value,label:t.$t("logs.filters.type"),"hide-details":"",multiple:"",chips:""},{"prepend-item":a(()=>[e(m,{title:t.$t("common.selectAll"),onClick:D},{prepend:a(()=>[e(ae,{indeterminate:C.value&&!N.value,"model-value":C.value},null,8,["indeterminate","model-value"])]),_:1},8,["title"]),e(c)]),_:1},8,["modelValue","items","label"])]),_:1}),e(f,{cols:"6"},{default:a(()=>[e(se,{modelValue:_.value,"onUpdate:modelValue":o[1]||(o[1]=s=>_.value=s),label:t.$t("logs.filters.query"),"hide-details":"",clearable:""},null,8,["modelValue","label"])]),_:1})]),_:1})]),_:1}),e(c,{class:"my-3",thickness:"5"}),n(g)>1?(r(),y(m,{key:0},{default:a(()=>[e(R,{modelValue:n(d),"onUpdate:modelValue":o[2]||(o[2]=s=>b(d)?d.value=s:null),length:n(g),"prev-icon":"mdi-menu-left","next-icon":"mdi-menu-right"},null,8,["modelValue","length"])]),_:1})):V("",!0),e(c),(r(!0),k(F,null,ve(n(W),(s,H)=>(r(),k(F,null,[H>0?(r(),y(c,{key:0})):V("",!0),e(m,{class:"pa-0"},{default:a(()=>[e(ne,{class:"p-0"},{default:a(()=>[e(oe,{class:"pa-0"},{default:a(()=>[e(ue,{class:"text-no-wrap",style:B(x(s))},{default:a(()=>[v("div",_e,"["+i(s.id)+"] "+i(s.message),1),e(re),v("div",Te,i(z(s)),1)]),_:2},1032,["style"]),e(ie,{class:"wrap-word text-select",style:B(x(s))},{default:a(()=>[E(" ["+i(q(s))+"] "+i(s.message),1)]),_:2},1032,["style"])]),_:2},1024)]),_:2},1024)]),_:2},1024)],64))),256)),n(I).length===0?(r(),y(m,{key:1},{default:a(()=>[E(i(t.$t("logs.emptyLogList")),1)]),_:1})):V("",!0),e(c),n(g)>1?(r(),y(m,{key:2},{default:a(()=>[e(R,{modelValue:n(d),"onUpdate:modelValue":o[3]||(o[3]=s=>b(d)?d.value=s:null),length:n(g),"prev-icon":"mdi-menu-left","next-icon":"mdi-menu-right"},null,8,["modelValue","length"])]),_:1})):V("",!0)]),_:1})]))}})});export{xe as default,__tla};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{D as r,E as n,_ as u,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{j as i,X as m,S as d,G as p}from"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";let g;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{g=i({__name:"MagnetHandler",setup(c){const t=m(),s=d(),e=r(),a=n();return p(async()=>{const o=decodeURIComponent(t.params.url);o.startsWith("magnet:")&&(e.isFirstInit=!1,e.pushTorrentToQueue(o),a.createDialog(u)),await s.push({name:"dashboard"})}),()=>{}}})});export{g as default,__tla};
|
|
||||||
1
qbit/vuetorrent/public/assets/MagnetHandler-gU-wAwT_.js
Normal file
1
qbit/vuetorrent/public/assets/MagnetHandler-gU-wAwT_.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{E as r,F as n,_ as u}from"./index-BhWmfNB5.js";import{h as i,V as m,P as d,H as p}from"./vue-DFryKk-1.js";import"./vuetify-XtA0Y0Oj.js";const g=i({__name:"MagnetHandler",setup(c){const t=m(),s=d(),e=r(),a=n();return p(async()=>{const o=decodeURIComponent(t.params.url);o.startsWith("magnet:")&&(e.isFirstInit=!1,e.pushTorrentToQueue(o),a.createDialog(u)),await s.push({name:"dashboard"})}),()=>{}}});export{g as default};
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{k as r,h as u,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{j as p,c as f,H as o,I as a,J as i,K as m,L as n,N as s,Q as b}from"./vue-CfSjRv-x.js";import{u as k}from"./vuetify-PctCzU6r.js";let x;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{let v;v={key:1,"data-testid":"mixedbtn-text"};x=p({__name:"MixedButton",props:{mobileOverride:{type:Boolean,default:!1},mobileValue:{type:Boolean},position:{},icon:{},text:{}},setup(c){const l=c,{mobile:d}=k(),t=f(()=>l.mobileOverride?l.mobileValue:d.value);return(e,y)=>(o(),a(u,{icon:t.value},{default:i(()=>[t.value||e.position==="left"?(o(),a(r,{key:0,"data-testid":"mixedbtn-icon-left"},{default:i(()=>[m(n(e.icon),1)]),_:1})):s("",!0),t.value?s("",!0):(o(),b("span",v,n(e.text),1)),!t.value&&e.position==="right"?(o(),a(r,{key:2,"data-testid":"mixedbtn-icon-right"},{default:i(()=>[m(n(e.icon),1)]),_:1})):s("",!0)]),_:1},8,["icon"]))}})});export{x as _,__tla};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{_ as o,__tla as __tla_0}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js";import"./vue-CfSjRv-x.js";import{__tla as __tla_1}from"./index-C0tfT_Qc.js";import"./vuetify-PctCzU6r.js";let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{});export{o as default,__tla};
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{_ as o}from"./TorrentDetail-CoyYqyCA.js";import"./ColoredChip.vue_vue_type_script_setup_true_lang-DosC_URk.js";import"./index-BhWmfNB5.js";import"./vue-DFryKk-1.js";import"./vuetify-XtA0Y0Oj.js";export{o as default};
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{j as I,E as S,f as u,r as h,G as x,x as g,H as F,I as T,J as t,n as l,K as m,L as f,u as V,M as B,N as D,O as M,P as O}from"./vue-CfSjRv-x.js";import{a as $,b as K,V as U,c as j,d as P,e as b,f as R,g as _,h as C,i as q,j as A,__tla as __tla_0}from"./index-C0tfT_Qc.js";let H;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{H=I({__name:"MoveTorrentFileDialog",props:{guid:{},hash:{},isFolder:{type:Boolean},oldName:{}},setup(k){const o=k,{isOpened:r}=$(o.guid),{t:c}=S(),N=K(),p=u(),i=u(),d=u(!1),n=h({newName:""}),y=[e=>!!e||c("dialogs.moveTorrent.required")];async function v(){await p.value?.validate(),d.value&&(o.isFolder?await N.renameTorrentFolder(o.hash,o.oldName,n.newName):await N.renameTorrentFile(o.hash,o.oldName,n.newName),w())}const w=()=>{r.value=!1};return x(()=>{if(n.newName=o.oldName,o.isFolder)g(()=>i.value?.select());else{const e=n.newName.lastIndexOf("/"),a=n.newName.lastIndexOf(".");g(()=>{i.value?.setSelectionRange(e+1,a==-1?n.newName.length:a)})}}),(e,a)=>(F(),T(A,{modelValue:V(r),"onUpdate:modelValue":a[3]||(a[3]=s=>O(r)?r.value=s:null)},{default:t(()=>[l(q,null,{default:t(()=>[l(U,null,{default:t(()=>[m(f(V(c)("dialogs.moveTorrentFile.title",1+Number(e.isFolder))),1)]),_:1}),l(j,null,{default:t(()=>[l(V(P),{modelValue:d.value,"onUpdate:modelValue":a[1]||(a[1]=s=>d.value=s),ref_key:"form",ref:p,onSubmit:a[2]||(a[2]=B(()=>{},["prevent"]))},{default:t(()=>[e.oldName?(F(),T(b,{key:0,"model-value":e.oldName,disabled:"",label:e.$t("dialogs.moveTorrentFile.oldName")},null,8,["model-value","label"])):D("",!0),l(b,{modelValue:n.newName,"onUpdate:modelValue":a[0]||(a[0]=s=>n.newName=s),ref_key:"input",ref:i,rules:y,autofocus:"",label:e.$t("dialogs.moveTorrent.newPath"),onKeydown:M(v,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),l(R,null,{default:t(()=>[l(_),l(C,{color:"error",onClick:w},{default:t(()=>[m(f(e.$t("common.cancel")),1)]),_:1}),l(C,{color:"accent",disabled:!d.value,onClick:v},{default:t(()=>[m(f(e.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}})});export{H as _,__tla};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{k as c,e as r,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{j as t,f as d,c as o,H as i,I as l,R as m,J as u,n as f}from"./vue-CfSjRv-x.js";let _;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{_=t({__name:"PasswordField",props:{hideIcon:{type:Boolean},prependIcon:{}},setup(I){const e=d(!1);function a(){e.value=!e.value}const p=o(()=>e.value?"text":"password"),s=o(()=>e.value?"mdi-eye":"mdi-eye-off");return(n,v)=>(i(),l(r,{name:"password",type:p.value,"append-inner-icon":n.hideIcon?"":s.value,"onClick:appendInner":a},m({_:2},[n.prependIcon?{name:"prepend",fn:u(()=>[f(c,{color:"accent",icon:n.prependIcon},null,8,["icon"])]),key:"0"}:void 0]),1032,["type","append-inner-icon"]))}})});export{_,__tla};
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{V as c,a as r}from"./index-BhWmfNB5.js";import{h as t,d,c as o,B as i,D as l,E as m,G as u,m as f}from"./vue-DFryKk-1.js";const I=t({__name:"PasswordField",props:{hideIcon:{type:Boolean},prependIcon:{}},setup(h){const e=d(!1);function a(){e.value=!e.value}const p=o(()=>e.value?"text":"password"),s=o(()=>e.value?"mdi-eye":"mdi-eye-off");return(n,v)=>(i(),l(r,{name:"password",type:p.value,"append-inner-icon":n.hideIcon?"":s.value,"onClick:appendInner":a},m({_:2},[n.prependIcon?{name:"prepend",fn:u(()=>[f(c,{color:"accent",icon:n.prependIcon},null,8,["icon"])]),key:"0"}:void 0]),1032,["type","append-inner-icon"]))}});export{I as _};
|
||||||
@@ -1 +1 @@
|
|||||||
.scrollable-col[data-v-d359259e]{@media (min-width: 600px){max-height:calc(100vh - 200px)}@media (max-width: 599px){max-height:calc(60vh - 200px)}overflow-y:auto}.fab{position:fixed;right:24px;bottom:24px}#rss-articles .rss-read[class*=v-theme--dark-]{color:#b6b6b6!important}#rss-articles .rss-read[class*=v-theme--light-]{color:gray!important}.description-container{border:solid red 5px}.description-container img{max-width:100%;height:auto}
|
.scrollable-col[data-v-f0e89cbe]{@media (min-width: 600px){max-height:calc(100vh - 200px)}@media (max-width: 599px){max-height:calc(60vh - 200px)}overflow-y:auto}.fab{position:fixed;right:24px;bottom:24px}#rss-articles .rss-read[class*=v-theme--dark-]{color:#b6b6b6!important}#rss-articles .rss-read[class*=v-theme--light-]{color:gray!important}.description-container{border:solid red 5px}.description-container img{max-width:100%;height:auto}
|
||||||
1
qbit/vuetorrent/public/assets/RssArticles-Bv0tR-A-.js
Normal file
1
qbit/vuetorrent/public/assets/RssArticles-Bv0tR-A-.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{h as _,d as B,r as le,H as ae,B as o,D as F,G as t,m as e,I as D,J as C,u as A,K as j,L as ce,O as W,S as U,N as S,M as T,X as ne,V as ye,c as M,T as Q,F as L,n as N,P as ke,z as be,R as se,_ as fe}from"./vue-DFryKk-1.js";import{u as oe,c as Fe,al as q,d as z,e as Z,f as x,g as Re,a as P,i as ie,j as H,k as R,l as ee,am as re,Y as Ue,an as Se,t as G,E as Te,o as _e,ao as Ee,y as pe,r as ue,x as K,a6 as Ne,ap as Le,V as ve,R as O,aq as Me,F as de,ar as Oe,ag as Ae,ac as Y,as as Ie,q as J,s as I,J as me,K as he,at as Pe,au as Be,av as je,aw as ge,a8 as qe,ax as Ge}from"./index-BhWmfNB5.js";import{a as He}from"./vuetify-XtA0Y0Oj.js";var E=(v=>(v[v.LOADING=0]="LOADING",v[v.ERROR=1]="ERROR",v[v.UNREAD=2]="UNREAD",v[v.READ=3]="READ",v))(E||{});const Ke=_({__name:"RssFeedDialog",props:{guid:{},initialFeed:{}},setup(v){const d=v,{t:s}=oe(),{isOpened:a}=Fe(d.guid),l=q(),m=B(),c=B(!1),p=le({name:"",url:""}),h=[i=>!!i||s("dialogs.rss.feed.rules.name_required")],r=[i=>!!i||s("dialogs.rss.feed.rules.url_required")];async function g(){await m.value?.validate(),c.value&&(d.initialFeed?(p.url!==d.initialFeed.url&&await l.setFeedUrl(d.initialFeed.name,p.url),p.name!==d.initialFeed.name&&await l.renameFeed(d.initialFeed.name,p.name)):await l.createFeed(p.name,p.url),await l.fetchFeeds(),u())}const u=()=>{a.value=!1};return ae(()=>{d.initialFeed&&(p.name=d.initialFeed.name,p.url=d.initialFeed.url)}),(i,y)=>(o(),F(ee,{modelValue:A(a),"onUpdate:modelValue":y[4]||(y[4]=n=>W(a)?a.value=n:null)},{default:t(()=>[e(z,null,{default:t(()=>[e(Z,null,{default:t(()=>[D(C(i.$t(`dialogs.rss.feed.title.${i.initialFeed?"edit":"create"}`)),1)]),_:1}),e(x,null,{default:t(()=>[e(A(Re),{modelValue:c.value,"onUpdate:modelValue":y[2]||(y[2]=n=>c.value=n),ref_key:"form",ref:m,onSubmit:y[3]||(y[3]=j(()=>{},["prevent"]))},{default:t(()=>[e(P,{modelValue:p.name,"onUpdate:modelValue":y[0]||(y[0]=n=>p.name=n),rules:h,label:i.$t("dialogs.rss.feed.name"),onKeydown:ce(g,["enter"])},null,8,["modelValue","label"]),e(P,{modelValue:p.url,"onUpdate:modelValue":y[1]||(y[1]=n=>p.url=n),rules:r,label:i.$t("dialogs.rss.feed.url"),onKeydown:ce(g,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),e(ie,null,{default:t(()=>[e(H),e(R,{color:"error",onClick:u},{default:t(()=>[D(C(i.$t("common.cancel")),1)]),_:1}),e(R,{color:"accent",disabled:!c.value,onClick:g},{default:t(()=>[D(C(i.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}}),ze={class:"d-flex"},Je={key:0},Qe={key:0},Xe={key:1},Ye={class:"d-flex flex-column"},We=_({__name:"Article",props:{value:{}},emits:["click","markAsRead","open","download"],setup(v){const d=q();return(s,a)=>(o(),F(G,{class:ne({"rss-read":s.value.isRead}),onClick:a[3]||(a[3]=l=>s.$emit("click")),onContextmenu:a[4]||(a[4]=l=>s.$emit("markAsRead"))},{default:t(()=>[U("div",ze,[U("div",null,[e(re,{class:"d-flex align-center ga-3 wrap-anywhere",style:{"white-space":"unset"}},{default:t(()=>[s.value.isRead?T("",!0):(o(),S("div",Je,[e(Ue,{color:"accent",variant:"outlined"},{default:t(()=>[D(C(s.$t("rssArticles.feeds.item.new")),1)]),_:1})])),U("div",null,C(s.value.title),1)]),_:1}),e(Se,{class:"d-block mt-3"},{default:t(()=>[U("div",null,C(s.value.parsedDate.toLocaleString()),1),U("div",null,C(s.$t("rssArticles.feeds.item.feedName",{name:A(d).getFeedNames(s.value.id).join(" | ")})),1),s.value.author?(o(),S("div",Qe,C(s.$t("rssArticles.feeds.item.author",{author:s.value.author})),1)):T("",!0),s.value.category?(o(),S("div",Xe,C(s.$t("rssArticles.feeds.item.category",{category:s.value.category})),1)):T("",!0)]),_:1})]),e(H),U("div",Ye,[e(R,{icon:"mdi-open-in-new",variant:"text",onClick:a[0]||(a[0]=j(l=>s.$emit("open"),["stop"]))}),e(R,{color:"accent",icon:"mdi-check",variant:"text",onClick:a[1]||(a[1]=j(l=>s.$emit("markAsRead"),["stop"]))}),e(R,{icon:"mdi-download",variant:"text",onClick:a[2]||(a[2]=j(l=>s.$emit("download"),["stop"]))})])])]),_:1},8,["class"]))}}),$e=_({__name:"ArticleList",props:{height:{}},emits:["articleClicked"],setup(v){const d=ye(),s=Te(),a=q(),l=_e(),m=M(()=>d.params.feedId),c=M(()=>a.filteredArticles.filter(y=>!m.value||m.value===y.feedId).sort((y,n)=>Number(n.parsedDate)-Number(y.parsedDate))),{paginatedResults:p,currentPage:h,pageCount:r}=Ee(c,15);function g(y){const n=l.useIdForRssLinks?y.id:y.link;Ne(n)}function u(y){s.pushTorrentToQueue(y.torrentURL)}async function i(y){await a.markArticleAsRead(y.id)}return(y,n)=>(o(),F(ue,{height:y.height},{default:t(()=>[c.value.length?(o(),F(G,{key:0},{default:t(()=>[e(pe,{modelValue:A(h),"onUpdate:modelValue":n[0]||(n[0]=f=>W(h)?h.value=f:null),length:A(r),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left"},null,8,["modelValue","length"])]),_:1})):T("",!0),(o(!0),S(L,null,Q(A(p),(f,$)=>(o(),S(L,null,[$>0?(o(),F(K,{key:0})):T("",!0),e(We,{value:f,onClick:w=>y.$emit("articleClicked",f),onMarkAsRead:w=>i(f),onOpen:w=>g(f),onDownload:w=>u(f)},null,8,["value","onClick","onMarkAsRead","onOpen","onDownload"])],64))),256)),c.value.length===0?(o(),F(G,{key:1},{default:t(()=>[D(C(y.$t("common.emptyList")),1)]),_:1})):T("",!0),c.value.length?(o(),F(G,{key:2},{default:t(()=>[e(pe,{modelValue:A(h),"onUpdate:modelValue":n[1]||(n[1]=f=>W(h)?h.value=f:null),length:A(r),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left"},null,8,["modelValue","length"])]),_:1})):T("",!0)]),_:1},8,["height"]))}}),Ze={class:"mr-2"},Ce=_({__name:"FeedIcon",props:{state:{}},setup(v){return(d,s)=>(o(),S("span",Ze,[d.state===A(E).LOADING?(o(),F(Le,{key:0,size:"24",width:"3",indeterminate:""})):d.state===A(E).ERROR?(o(),F(ve,{key:1,icon:"mdi-alert-circle-outline",color:"error"})):d.state===A(E).UNREAD?(o(),F(ve,{key:2,icon:"mdi-email"})):T("",!0)]))}}),xe={class:"d-flex align-center"},et=_({__name:"Feed",props:{title:{},state:{},unreadCount:{}},emits:["readFeed","refreshFeed","editFeed","deleteFeed"],setup(v){const d=v,s=M(()=>d.state===E.LOADING);return(a,l)=>(o(),S("div",xe,[e(Ce,{state:a.state},null,8,["state"]),e(re,null,{default:t(()=>[D(C(a.title),1)]),_:1}),e(H),e(O,{text:a.$t("rssArticles.feeds.markAsRead"),location:"top"},{activator:t(({props:m})=>[a.unreadCount>0?(o(),F(R,N({key:0},m,{icon:"mdi-email-open",density:"comfortable",variant:"plain",onClick:l[0]||(l[0]=j(c=>a.$emit("readFeed"),["stop"]))}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:a.$t("common.refresh"),location:"top"},{activator:t(({props:m})=>[s.value?T("",!0):(o(),F(R,N({key:0},m,{icon:"mdi-sync",density:"comfortable",variant:"plain",onClick:l[1]||(l[1]=j(c=>a.$emit("refreshFeed"),["stop"]))}),null,16))]),_:1},8,["text"]),e(O,{text:a.$t("common.edit"),location:"top"},{activator:t(({props:m})=>[e(R,N(m,{icon:"mdi-pencil",density:"comfortable",variant:"plain",onClick:l[2]||(l[2]=j(c=>a.$emit("editFeed"),["stop"]))}),null,16)]),_:1},8,["text"]),e(O,{text:a.$t("common.delete"),location:"top"},{activator:t(({props:m})=>[e(R,N(m,{icon:"mdi-delete",color:"red",density:"comfortable",variant:"plain",onClick:l[3]||(l[3]=j(c=>a.$emit("deleteFeed"),["stop"]))}),null,16)]),_:1},8,["text"])]))}}),tt={class:"d-flex align-center"},Ve=_({__name:"FeedList",props:{height:{}},emits:["update","createFeed","editFeed","deleteFeed","refreshFeed"],setup(v,{emit:d}){const s=d,a=ke(),l=q(),m=M({get(){return a.currentRoute.value.params.feedId},set(n){a.replace({name:"rssArticles",params:{tab:"feeds",feedId:n}}),s("update",n)}}),c=Me(()=>l.filteredArticles.map(n=>n.feedId));function p(n){return n?(n.articles??[]).reduce((f,$)=>f+ +!$.isRead,0):l.unreadArticles.length}function h(n){m.value=m.value!==n.uid?n.uid:void 0}async function r(n){await l.markFeedAsRead(n)}async function g(){await l.refreshAllFeeds(),l.resumeFeedTimer()}function u(n){const f=p(n);return(f?`${f} | `:"")+`${n?n.name:"All"}`}const i=M(()=>l.feeds.reduce((n,f)=>Math.min(n,y(f)),E.READ));function y(n){return n.isLoading?E.LOADING:n.hasError?E.ERROR:n.articles?.some(f=>!f.isRead)?E.UNREAD:E.READ}return(n,f)=>(o(),F(ue,{height:n.height},{default:t(()=>[e(G,{active:!m.value,color:"accent",variant:"text",onClick:f[3]||(f[3]=$=>m.value=void 0)},{default:t(()=>[U("div",tt,[e(Ce,{state:i.value},null,8,["state"]),e(re,null,{default:t(()=>[D(C(u()),1)]),_:1}),e(H),e(O,{text:n.$t("rssArticles.feeds.markAllAsRead"),location:"top"},{activator:t(({props:$})=>[p()>0?(o(),F(R,N({key:0},$,{icon:"mdi-email-open",density:"comfortable",variant:"plain",onClick:f[0]||(f[0]=w=>A(l).markAllAsRead())}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:n.$t("rssArticles.feeds.refreshAllFeeds"),location:"top"},{activator:t(({props:$})=>[i.value!==A(E).LOADING?(o(),F(R,N({key:0},$,{icon:"mdi-sync",density:"comfortable",variant:"plain",onClick:f[1]||(f[1]=w=>g())}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:n.$t("rssArticles.feeds.empty.action"),location:"top"},{activator:t(({props:$})=>[e(R,N($,{icon:"mdi-plus",density:"comfortable",variant:"plain",onClick:f[2]||(f[2]=w=>n.$emit("createFeed"))}),null,16)]),_:1},8,["text"])])]),_:1},8,["active"]),e(K,{thickness:"3"}),(o(!0),S(L,null,Q(A(l).feeds,$=>(o(),S(L,null,[(!A(l).filters.unread||p($)>0)&&(!A(c).length||A(c).includes($.uid))?(o(),F(G,{key:0,active:m.value===$.uid,class:ne(p($)>0?"text-accent":""),color:"accent",variant:"text",onClick:w=>h($)},{default:t(()=>[e(et,{title:u($),state:y($),"unread-count":p($),onReadFeed:w=>r($),onRefreshFeed:w=>n.$emit("refreshFeed",$),onEditFeed:w=>n.$emit("editFeed",$),onDeleteFeed:w=>n.$emit("deleteFeed",$)},null,8,["title","state","unread-count","onReadFeed","onRefreshFeed","onEditFeed","onDeleteFeed"])]),_:2},1032,["active","class","onClick"])):T("",!0)],64))),256))]),_:1},8,["height"]))}}),lt=_({__name:"Feeds",props:{height:{},mobile:{type:Boolean}},emits:["openArticle"],setup(v){const d=v,s=de(),a=q(),l=B(!1),m=M(()=>d.height-56-16-56-12*2),c=M({get:()=>a.filters.title,set:Oe(g=>{a.filters.title=g??""},300)});function p(g){s.createDialog(Ke,{initialFeed:g},a.resumeFeedTimer)}async function h(g){await a.refreshFeed(g.name),a.resumeFeedTimer()}async function r(g){await a.deleteFeed(g.name),a.resumeFeedTimer()}return be(()=>{a.resumeFeedTimer()}),se(()=>{a.pauseFeedTimer()}),(g,u)=>A(a).feeds.length?(o(),F(z,{key:1,id:"rss-articles",class:"pa-3",height:g.height},{default:t(()=>[e(P,{modelValue:c.value,"onUpdate:modelValue":u[1]||(u[1]=i=>c.value=i),label:g.$t("rssArticles.feeds.filters.title"),clearable:"","hide-details":""},null,8,["modelValue","label"]),e(Y,{modelValue:A(a).filters.unread,"onUpdate:modelValue":u[2]||(u[2]=i=>A(a).filters.unread=i),label:g.$t("rssArticles.feeds.filters.unread"),"hide-details":""},null,8,["modelValue","label"]),g.mobile?(o(),S(L,{key:0},[e($e,{height:m.value,onArticleClicked:u[3]||(u[3]=i=>g.$emit("openArticle",i))},null,8,["height"]),e(Ie,{modelValue:l.value,"onUpdate:modelValue":u[9]||(u[9]=i=>l.value=i),"max-height":"550"},{activator:t(({props:i})=>[e(R,N({class:"fab"},i,{color:"accent",icon:"mdi-format-list-bulleted",size:"large"}),null,16)]),default:t(()=>[e(Ve,{onUpdate:u[4]||(u[4]=i=>l.value=!1),onCreateFeed:u[5]||(u[5]=()=>p()),onEditFeed:u[6]||(u[6]=i=>p(i)),onDeleteFeed:u[7]||(u[7]=i=>r(i)),onRefreshFeed:u[8]||(u[8]=i=>h(i))})]),_:1},8,["modelValue"])],64)):(o(),F(J,{key:1},{default:t(()=>[e(I,{cols:"4"},{default:t(()=>[e(Ve,{height:m.value,onCreateFeed:u[10]||(u[10]=()=>p()),onEditFeed:u[11]||(u[11]=i=>p(i)),onDeleteFeed:u[12]||(u[12]=i=>r(i)),onRefreshFeed:u[13]||(u[13]=i=>h(i))},null,8,["height"])]),_:1}),e(I,{cols:"8"},{default:t(()=>[e($e,{height:m.value,onArticleClicked:u[14]||(u[14]=i=>g.$emit("openArticle",i))},null,8,["height"])]),_:1})]),_:1}))]),_:1},8,["height"])):(o(),F(z,{key:0,height:g.height},{default:t(()=>[e(Ae,{title:g.$t("rssArticles.feeds.empty.value"),icon:"mdi-rss-off"},{actions:t(()=>[e(R,{text:g.$t("rssArticles.feeds.empty.action"),color:"accent",onClick:u[0]||(u[0]=i=>p())},null,8,["text"])]),_:1},8,["title"])]),_:1},8,["height"]))}}),at=_({__name:"AddTorrentParamsDialog",props:{modelValue:{required:!0},modelModifiers:{},isOpened:{type:Boolean},isOpenedModifiers:{}},emits:["update:modelValue","update:isOpened"],setup(v){const d=fe(v,"modelValue"),s=fe(v,"isOpened"),{t:a}=oe(),l=B();function m(){l.value?.saveFields(),s.value=!1}return(c,p)=>(o(),F(ee,{modelValue:s.value,"onUpdate:modelValue":p[1]||(p[1]=h=>s.value=h),class:ne(c.$vuetify.display.mobile?"":"w-75"),fullscreen:c.$vuetify.display.mobile,scrollable:""},{default:t(()=>[e(z,null,{default:t(()=>[e(Z,{class:"ios-margin"},{default:t(()=>[e(me,{color:"transparent"},{default:t(()=>[e(he,null,{default:t(()=>[D(C(A(a)("dialogs.add.params.title")),1)]),_:1}),e(R,{icon:"mdi-close",onClick:m})]),_:1})]),_:1}),e(x,null,{default:t(()=>[e(Pe,{modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=h=>d.value=h)},null,8,["modelValue"])]),_:1}),e(ie,{class:"mb-2"},{default:t(()=>[e(H),e(R,{text:c.$t("common.close"),color:"",variant:"flat",onClick:m},null,8,["text"])]),_:1})]),_:1})]),_:1},8,["modelValue","class","fullscreen"]))}});function nt(v){return{save_path:v?.save_path??"",skip_checking:!1,add_to_top_of_queue:v?.add_to_top_of_queue??!1,content_layout:v?.torrent_content_layout,stop_condition:v?.torrent_stop_condition,download_limit:v?.dl_limit,upload_limit:v?.up_limit,use_download_path:!!v?.temp_path,download_path:v?.temp_path?v?.temp_path:"",stopped:v?.add_stopped_enabled??v?.start_paused_enabled,use_auto_tmm:v?.auto_tmm_enabled,ratio_limit:-2,seeding_time_limit:-2,inactive_seeding_time_limit:-2}}const st={class:"d-flex"},ot={class:"d-flex align-center"},it={class:"v-card-title pa-0"},rt=_({__name:"RssRuleDialog",props:{guid:{},initialRule:{}},setup(v){const d=v,s=M(()=>!!(d.initialRule&&d.initialRule.name)),{isOpened:a}=Fe(d.guid),{t:l}=oe(),m=Be(),c=q(),p=B(),h=B(!1),r=le(y()),g=B(""),u=B([]),i=M(()=>{if(r.lastMatch==="")return l("dialogs.rss.rule.lastMatch.unknownValue").toString();const k=new Date().getTime()-new Date(r.lastMatch).getTime();return l("dialogs.rss.rule.lastMatch.knownValue",Math.floor(k/(1e3*60*60*24)))});function y(){return{affectedFeeds:[],enabled:!0,episodeFilter:"",ignoreDays:0,lastMatch:"",mustContain:"",mustNotContain:"",name:"",priority:0,smartFilter:!1,useRegex:!1,previouslyMatchedEpisodes:s.value?d.initialRule.previouslyMatchedEpisodes:[],torrentParams:nt(m.preferences)}}async function n(){if(g.value==="")return;const k=[],b=await c.fetchMatchingArticles(g.value);for(const V in b){const X=b[V];k.length>0&&k.push({type:"divider"}),k.push({type:"subheader",value:V});for(const we in X){const De=X[we];k.push({type:"item",value:De})}}u.value=k}async function f(){h.value&&((s.value||g.value!=="")&&g.value!==r.name&&await c.renameRule(g.value,r.name),await c.setRule(r.name,r),g.value=r.name,await c.fetchRules(),await n())}async function $(){r.affectedFeeds=[]}async function w(){r.affectedFeeds=c.feeds.map(k=>k.url)}const te=()=>{a.value=!1};return ae(async()=>{await c.fetchFeeds(),s.value&&(g.value=d.initialRule.name,Object.assign(r,d.initialRule)),await n()}),(k,b)=>(o(),F(ee,{modelValue:A(a),"onUpdate:modelValue":b[13]||(b[13]=V=>W(a)?a.value=V:null)},{default:t(()=>[e(z,null,{default:t(()=>[e(Z,null,{default:t(()=>[e(me,{color:"transparent",title:k.$t(`dialogs.rss.rule.title.${k.initialRule?"edit":"create"}`)},{default:t(()=>[e(R,{icon:"mdi-close",onClick:te})]),_:1},8,["title"])]),_:1}),e(x,null,{default:t(()=>[e(A(Re),{modelValue:h.value,"onUpdate:modelValue":b[11]||(b[11]=V=>h.value=V),ref_key:"form",ref:p,onSubmit:b[12]||(b[12]=j(()=>{},["prevent"]))},{default:t(()=>[e(J,null,{default:t(()=>[e(I,{cols:"12",sm:"6",class:"scrollable-col"},{default:t(()=>[e(P,{modelValue:r.name,"onUpdate:modelValue":b[0]||(b[0]=V=>r.name=V),autofocus:"",required:"",label:k.$t("dialogs.rss.rule.name")},null,8,["modelValue","label"]),U("div",st,[e(je,{modelValue:r.enabled,"onUpdate:modelValue":b[1]||(b[1]=V=>r.enabled=V),color:"accent",inset:"","hide-details":"",label:k.$t("dialogs.rss.rule.enabled")},null,8,["modelValue","label"]),e(H),U("div",ot,[e(R,{class:"d-flex align-center justify-center",color:"accent"},{default:t(()=>[D(C(k.$t("dialogs.add.params.title"))+" ",1),e(at,{modelValue:r.torrentParams,"onUpdate:modelValue":b[2]||(b[2]=V=>r.torrentParams=V),activator:"parent"},null,8,["modelValue"])]),_:1})])]),e(K),e(Y,{modelValue:r.useRegex,"onUpdate:modelValue":b[3]||(b[3]=V=>r.useRegex=V),"hide-details":"",label:k.$t("dialogs.rss.rule.useRegex")},null,8,["modelValue","label"]),e(P,{modelValue:r.mustContain,"onUpdate:modelValue":b[4]||(b[4]=V=>r.mustContain=V),label:k.$t("dialogs.rss.rule.mustContain")},null,8,["modelValue","label"]),e(P,{modelValue:r.mustNotContain,"onUpdate:modelValue":b[5]||(b[5]=V=>r.mustNotContain=V),label:k.$t("dialogs.rss.rule.mustNotContain")},null,8,["modelValue","label"]),e(Y,{modelValue:r.smartFilter,"onUpdate:modelValue":b[6]||(b[6]=V=>r.smartFilter=V),"hide-details":"",label:k.$t("dialogs.rss.rule.smartFilter")},null,8,["modelValue","label"]),e(P,{modelValue:r.episodeFilter,"onUpdate:modelValue":b[7]||(b[7]=V=>r.episodeFilter=V),placeholder:k.$t("dialogs.rss.rule.episodeFilterPlaceholder"),label:k.$t("dialogs.rss.rule.episodeFilter")},null,8,["modelValue","placeholder","label"]),e(K,{class:"mb-4"}),e(P,{modelValue:r.ignoreDays,"onUpdate:modelValue":b[8]||(b[8]=V=>r.ignoreDays=V),modelModifiers:{number:!0},type:"number",hint:k.$t("dialogs.rss.rule.ignoreDaysHint"),label:k.$t("dialogs.rss.rule.ignoreDays")},null,8,["modelValue","hint","label"]),e(P,{modelValue:i.value,"onUpdate:modelValue":b[9]||(b[9]=V=>i.value=V),disabled:"",label:k.$t("dialogs.rss.rule.lastMatch.label")},null,8,["modelValue","label"]),e(K),e(ge,null,{default:t(()=>[D(C(k.$t("dialogs.rss.rule.affectedFeedsSubheader")),1)]),_:1}),e(J,null,{default:t(()=>[e(I,{cols:"6",class:"d-flex align-center justify-center"},{default:t(()=>[e(R,{color:"accent",onClick:w},{default:t(()=>[D(C(k.$t("common.selectAll")),1)]),_:1})]),_:1}),e(I,{cols:"6",class:"d-flex align-center justify-center"},{default:t(()=>[e(R,{color:"primary",onClick:$},{default:t(()=>[D(C(k.$t("common.selectNone")),1)]),_:1})]),_:1})]),_:1}),(o(!0),S(L,null,Q(A(c).feeds,V=>(o(),F(Y,{modelValue:r.affectedFeeds,"onUpdate:modelValue":b[10]||(b[10]=X=>r.affectedFeeds=X),multiple:"","hide-details":"",label:V.name,value:V.url},null,8,["modelValue","label","value"]))),256))]),_:1}),e(K,{vertical:!k.$vuetify.display.mobile},null,8,["vertical"]),e(I,{cols:"12",sm:"6",class:"scrollable-col"},{default:t(()=>[U("div",it,C(k.$t("dialogs.rss.rule.matchingArticles.title")),1),e(ue,null,{default:t(()=>[(o(!0),S(L,null,Q(u.value,V=>(o(),S(L,null,[V.type==="divider"?(o(),F(K,{key:0})):V.type==="subheader"?(o(),F(ge,{key:1,inset:""},{default:t(()=>[D(C(V.value),1)]),_:2},1024)):(o(),F(G,{key:2,class:"mb-3"},{default:t(()=>[D(C(V.value),1)]),_:2},1024))],64))),256)),u.value.length===0?(o(),F(G,{key:0,title:k.$t("dialogs.rss.rule.matchingArticles.noMatch")},null,8,["title"])):T("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(ie,null,{default:t(()=>[e(H),e(R,{color:"error",onClick:te},{default:t(()=>[D(C(k.$t("common.close")),1)]),_:1}),e(R,{color:"accent",onClick:f},{default:t(()=>[D(C(k.$t("common.save")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]))}}),ut=qe(rt,[["__scopeId","data-v-f0e89cbe"]]),dt={class:"pl-4"},mt=_({__name:"Rule",props:{value:{}},emits:["openRule"],setup(v){const d=q();async function s(l){await d.setRule(l.name,{...l,enabled:!l.enabled}),d.resumeRuleTimer()}async function a(l){await d.deleteRule(l.name),d.resumeRuleTimer()}return(l,m)=>(o(),F(Ge,{rounded:"xl",class:"d-flex align-center"},{default:t(()=>[U("div",dt,C(l.value.name),1),e(H),U("div",null,[e(R,{class:"my-2 mr-2",icon:l.value.enabled?"mdi-check":"mdi-cancel",color:l.value.enabled?"accent":"red",variant:"plain",density:"compact",onClick:m[0]||(m[0]=c=>s(l.value))},null,8,["icon","color"]),e(O,{text:l.$t("common.edit"),location:"top"},{activator:t(({props:c})=>[e(R,N(c,{class:"my-2 mr-2",icon:"mdi-pencil",variant:"plain",density:"compact",onClick:m[1]||(m[1]=p=>l.$emit("openRule",l.value))}),null,16)]),_:1},8,["text"]),e(O,{text:l.$t("common.delete"),location:"top"},{activator:t(({props:c})=>[e(R,N(c,{class:"my-2 mr-2",icon:"mdi-delete",color:"red",variant:"plain",density:"compact",onClick:m[2]||(m[2]=p=>a(l.value))}),null,16)]),_:1},8,["text"])])]),_:1}))}}),ct=_({__name:"Rules",props:{height:{}},setup(v){const d=de(),s=q();function a(l){d.createDialog(ut,{initialRule:l},s.resumeRuleTimer)}return ae(()=>{s.resumeRuleTimer()}),se(()=>{s.pauseRuleTimer()}),(l,m)=>A(s).rules.length?(o(),S(L,{key:1},[e(J,{class:"mt-2"},{default:t(()=>[(o(!0),S(L,null,Q(A(s).rules,c=>(o(),F(I,{cols:"12",sm:"6",lg:"3"},{default:t(()=>[e(mt,{value:c,onOpenRule:a},null,8,["value"])]),_:2},1024))),256))]),_:1}),e(J,null,{default:t(()=>[e(I,{cols:"12",class:"d-flex align-center justify-center"},{default:t(()=>[e(R,{color:"accent",onClick:m[1]||(m[1]=c=>a())},{default:t(()=>[D(C(l.$t("rssArticles.rules.empty.action")),1)]),_:1})]),_:1})]),_:1})],64)):(o(),F(z,{key:0,height:l.height},{default:t(()=>[e(Ae,{title:l.$t("rssArticles.rules.empty.value"),icon:"mdi-rss-off"},{actions:t(()=>[e(R,{text:l.$t("rssArticles.rules.empty.action"),color:"accent",onClick:m[0]||(m[0]=c=>a())},null,8,["text"])]),_:1},8,["title"])]),_:1},8,["height"]))}}),ft={class:"pa-3"},pt={class:"subtitle-1 ml-2",style:{"font-size":"1.6em !important"}},vt={class:"d-flex justify-end"},gt=["innerHTML"],kt=_({__name:"RssArticles",setup(v){const{height:d,mobile:s}=He({mobileBreakpoint:"md"}),a=ye(),l=ke(),m=de(),c=q(),p=B(!1),h=le({title:"",content:""}),r=M(()=>a.params.tab!=="rules"),g=M(()=>d.value-64-12*2-48);function u(f){f.description&&(h.title=f.title.trim(),h.content=f.description.trim(),p.value=!0)}function i(){const f=a.params.tab==="rules"?"feeds":"rules";l.replace({name:"rssArticles",params:{tab:f}}),c.lastView=f}function y(){l.push({name:"dashboard"})}function n(f){if(m.hasActiveDialog||p.value)return!1;f.key==="Escape"&&y()}return be(()=>{document.addEventListener("keydown",n)}),se(()=>{document.removeEventListener("keydown",n)}),(f,$)=>(o(),S(L,null,[U("div",ft,[e(J,{align:"center",justify:"center","no-gutters":""},{default:t(()=>[e(I,null,{default:t(()=>[U("h1",pt,C(r.value?f.$t("rssArticles.feeds.title"):f.$t("rssArticles.rules.title")),1)]),_:1}),e(I,null,{default:t(()=>[U("div",vt,[e(O,{text:f.$t(r.value?"rssArticles.toggle.rules":"rssArticles.toggle.feeds"),location:"top"},{activator:t(({props:w})=>[e(R,N(w,{icon:"mdi-auto-download",variant:"plain",onClick:$[0]||($[0]=te=>i())}),null,16)]),_:1},8,["text"]),e(R,{icon:"mdi-close",variant:"plain",onClick:$[1]||($[1]=w=>y())})])]),_:1})]),_:1}),r.value?(o(),F(lt,{key:0,height:g.value,mobile:A(s),onOpenArticle:u},null,8,["height","mobile"])):(o(),F(ct,{key:1,height:g.value},null,8,["height"]))]),e(ee,{modelValue:p.value,"onUpdate:modelValue":$[3]||($[3]=w=>p.value=w)},{default:t(()=>[e(z,null,{default:t(()=>[e(Z,null,{default:t(()=>[e(me,{color:"transparent"},{default:t(()=>[e(he,null,{default:t(()=>[D(C(h.title),1)]),_:1}),e(R,{icon:"mdi-close",onClick:$[2]||($[2]=w=>p.value=!1)})]),_:1})]),_:1}),e(x,null,{default:t(()=>[U("div",{class:"description-container",innerHTML:h.content},null,8,gt)]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}});export{kt as default};
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{j as _,E as te,f as j,r as le,G as ae,H as r,I as b,J as t,n as e,K as w,L as h,u as A,M as B,O as fe,P as Z,U,Q as S,N as T,_ as ne,X as ke,c as L,V as J,F as M,q as N,S as be,Y as Fe,T as se,a2 as pe}from"./vue-CfSjRv-x.js";import{a as Re,a2 as q,i as z,V as W,c as x,d as Ae,e as P,f as oe,g as H,h as F,j as ee,a3 as ie,a4 as Se,s as G,D as Te,m as _e,x as ve,w as K,q as re,a5 as Ee,k as ge,Q as O,a6 as Ne,E as ue,a7 as he,a8 as Y,a9 as Me,p as Q,r as I,I as de,J as Ce,aa as Le,Z as Oe,ab as Ie,ac as Pe,ad as $e,ae as je,af as Be,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{d as qe}from"./index-BwjGcC1B.js";import{u as Ge,__tla as __tla_1}from"./ArrayPagination-C54Dd5Tu.js";import{u as He}from"./vuetify-PctCzU6r.js";let bt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{var E=(p=>(p[p.LOADING=0]="LOADING",p[p.ERROR=1]="ERROR",p[p.UNREAD=2]="UNREAD",p[p.READ=3]="READ",p))(E||{});const Ke=_({__name:"RssFeedDialog",props:{guid:{},initialFeed:{}},setup(p){const f=p,{t:i}=te(),{isOpened:o}=Re(f.guid),l=q(),c=j(),v=j(!1),u=le({name:"",url:""}),R=[s=>!!s||i("dialogs.rss.feed.rules.name_required")],D=[s=>!!s||i("dialogs.rss.feed.rules.url_required")];async function d(){await c.value?.validate(),v.value&&(f.initialFeed?(u.url!==f.initialFeed.url&&await l.setFeedUrl(f.initialFeed.name,u.url),u.name!==f.initialFeed.name&&await l.renameFeed(f.initialFeed.name,u.name)):await l.createFeed(u.name,u.url),await l.fetchFeeds(),g())}const g=()=>{o.value=!1};return ae(()=>{f.initialFeed&&(u.name=f.initialFeed.name,u.url=f.initialFeed.url)}),(s,a)=>(r(),b(ee,{modelValue:A(o),"onUpdate:modelValue":a[4]||(a[4]=n=>Z(o)?o.value=n:null)},{default:t(()=>[e(z,null,{default:t(()=>[e(W,null,{default:t(()=>[w(h(s.$t(`dialogs.rss.feed.title.${s.initialFeed?"edit":"create"}`)),1)]),_:1}),e(x,null,{default:t(()=>[e(A(Ae),{modelValue:v.value,"onUpdate:modelValue":a[2]||(a[2]=n=>v.value=n),ref_key:"form",ref:c,onSubmit:a[3]||(a[3]=B(()=>{},["prevent"]))},{default:t(()=>[e(P,{modelValue:u.name,"onUpdate:modelValue":a[0]||(a[0]=n=>u.name=n),rules:R,label:s.$t("dialogs.rss.feed.name"),onKeydown:fe(d,["enter"])},null,8,["modelValue","label"]),e(P,{modelValue:u.url,"onUpdate:modelValue":a[1]||(a[1]=n=>u.url=n),rules:D,label:s.$t("dialogs.rss.feed.url"),onKeydown:fe(d,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),e(oe,null,{default:t(()=>[e(H),e(F,{color:"error",onClick:g},{default:t(()=>[w(h(s.$t("common.cancel")),1)]),_:1}),e(F,{color:"accent",disabled:!v.value,onClick:d},{default:t(()=>[w(h(s.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}}),ze={class:"d-flex"},Qe={key:0},Je={key:1},Xe={class:"d-flex flex-column"},Ye=_({__name:"Article",props:{value:{}},emits:["click","markAsRead","open","download"],setup(p){const f=q();return(i,o)=>(r(),b(G,{class:ne({"rss-read":i.value.isRead}),onClick:o[3]||(o[3]=l=>i.$emit("click")),onContextmenu:o[4]||(o[4]=l=>i.$emit("markAsRead"))},{default:t(()=>[U("div",ze,[U("div",null,[e(ie,{class:"wrap-anywhere",style:{"white-space":"unset"}},{default:t(()=>[w(h(i.value.title),1)]),_:1}),e(Se,{class:"d-block"},{default:t(()=>[U("div",null,h(i.value.parsedDate.toLocaleString()),1),U("div",null,h(i.$t("rssArticles.feeds.item.feedName",{name:A(f).getFeedNames(i.value.id).join(" | ")})),1),i.value.author?(r(),S("div",Qe,h(i.$t("rssArticles.feeds.item.author",{author:i.value.author})),1)):T("",!0),i.value.category?(r(),S("div",Je,h(i.$t("rssArticles.feeds.item.category",{category:i.value.category})),1)):T("",!0)]),_:1})]),e(H),U("div",Xe,[e(F,{icon:"mdi-open-in-new",variant:"text",onClick:o[0]||(o[0]=B(l=>i.$emit("open"),["stop"]))}),e(F,{color:"accent",icon:"mdi-check",variant:"text",onClick:o[1]||(o[1]=B(l=>i.$emit("markAsRead"),["stop"]))}),e(F,{icon:"mdi-download",variant:"text",onClick:o[2]||(o[2]=B(l=>i.$emit("download"),["stop"]))})])])]),_:1},8,["class"]))}}),Ve=_({__name:"ArticleList",props:{height:{}},emits:["articleClicked"],setup(p){const f=ke(),i=Te(),o=q(),l=_e(),c=L(()=>f.params.feedId),v=L(()=>o.filteredArticles.filter(a=>!c.value||c.value===a.feedId).sort((a,n)=>Number(n.parsedDate)-Number(a.parsedDate))),{paginatedResults:u,currentPage:R,pageCount:D}=Ge(v,15);function d(a){const n=l.useIdForRssLinks?a.id:a.link;window.open(n,"_blank","noreferrer")}function g(a){i.pushTorrentToQueue(a.torrentURL)}async function s(a){await o.markArticleAsRead(a.id)}return(a,n)=>(r(),b(re,{height:a.height},{default:t(()=>[v.value.length?(r(),b(G,{key:0},{default:t(()=>[e(ve,{modelValue:A(R),"onUpdate:modelValue":n[0]||(n[0]=m=>Z(R)?R.value=m:null),length:A(D),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left"},null,8,["modelValue","length"])]),_:1})):T("",!0),(r(!0),S(M,null,J(A(u),(m,$)=>(r(),S(M,null,[$>0?(r(),b(K,{key:0})):T("",!0),e(Ye,{value:m,onClick:C=>a.$emit("articleClicked",m),onMarkAsRead:C=>s(m),onOpen:C=>d(m),onDownload:C=>g(m)},null,8,["value","onClick","onMarkAsRead","onOpen","onDownload"])],64))),256)),v.value.length===0?(r(),b(G,{key:1},{default:t(()=>[w(h(a.$t("common.emptyList")),1)]),_:1})):T("",!0),v.value.length?(r(),b(G,{key:2},{default:t(()=>[e(ve,{modelValue:A(R),"onUpdate:modelValue":n[1]||(n[1]=m=>Z(R)?R.value=m:null),length:A(D),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left"},null,8,["modelValue","length"])]),_:1})):T("",!0)]),_:1},8,["height"]))}}),Ze={class:"mr-2"},we=_({__name:"FeedIcon",props:{state:{}},setup(p){return(f,i)=>(r(),S("span",Ze,[f.state===A(E).LOADING?(r(),b(Ee,{key:0,size:"24",width:"3",indeterminate:""})):f.state===A(E).ERROR?(r(),b(ge,{key:1,icon:"mdi-alert-circle-outline",color:"error"})):f.state===A(E).UNREAD?(r(),b(ge,{key:2,icon:"mdi-email"})):T("",!0)]))}}),We={class:"d-flex align-center"},xe=_({__name:"Feed",props:{title:{},state:{},unreadCount:{}},emits:["readFeed","refreshFeed","editFeed","deleteFeed"],setup(p){const f=p,i=L(()=>f.state===E.LOADING);return(o,l)=>(r(),S("div",We,[e(we,{state:o.state},null,8,["state"]),e(ie,null,{default:t(()=>[w(h(o.title),1)]),_:1}),e(H),e(O,{text:o.$t("rssArticles.feeds.markAsRead"),location:"top"},{activator:t(({props:c})=>[o.unreadCount>0?(r(),b(F,N({key:0},c,{icon:"mdi-email-open",density:"comfortable",variant:"plain",onClick:l[0]||(l[0]=B(v=>o.$emit("readFeed"),["stop"]))}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:o.$t("common.refresh"),location:"top"},{activator:t(({props:c})=>[i.value?T("",!0):(r(),b(F,N({key:0},c,{icon:"mdi-sync",density:"comfortable",variant:"plain",onClick:l[1]||(l[1]=B(v=>o.$emit("refreshFeed"),["stop"]))}),null,16))]),_:1},8,["text"]),e(O,{text:o.$t("common.edit"),location:"top"},{activator:t(({props:c})=>[e(F,N(c,{icon:"mdi-pencil",density:"comfortable",variant:"plain",onClick:l[2]||(l[2]=B(v=>o.$emit("editFeed"),["stop"]))}),null,16)]),_:1},8,["text"]),e(O,{text:o.$t("common.delete"),location:"top"},{activator:t(({props:c})=>[e(F,N(c,{icon:"mdi-delete",color:"red",density:"comfortable",variant:"plain",onClick:l[3]||(l[3]=B(v=>o.$emit("deleteFeed"),["stop"]))}),null,16)]),_:1},8,["text"])]))}}),et={class:"d-flex align-center"},ye=_({__name:"FeedList",props:{height:{}},emits:["update","createFeed","editFeed","deleteFeed","refreshFeed"],setup(p,{emit:f}){const i=f,o=be(),l=q(),c=L({get(){return o.currentRoute.value.params.feedId},set(n){o.replace({name:"rssArticles",params:{tab:"feeds",feedId:n}}),i("update",n)}}),v=Ne(()=>l.filteredArticles.map(n=>n.feedId));function u(n){return n?(n.articles??[]).reduce((m,$)=>m+ +!$.isRead,0):l.unreadArticles.length}function R(n){c.value=c.value!==n.uid?n.uid:void 0}async function D(n){await l.markFeedAsRead(n)}async function d(){await l.refreshAllFeeds(),l.resumeFeedTimer()}function g(n){const m=u(n);return(m?`${m} | `:"")+`${n?n.name:"All"}`}const s=L(()=>l.feeds.reduce((n,m)=>Math.min(n,a(m)),E.READ));function a(n){return n.isLoading?E.LOADING:n.hasError?E.ERROR:n.articles?.some(m=>!m.isRead)?E.UNREAD:E.READ}return(n,m)=>(r(),b(re,{height:n.height},{default:t(()=>[e(G,{active:!c.value,color:"accent",variant:"text",onClick:m[3]||(m[3]=$=>c.value=void 0)},{default:t(()=>[U("div",et,[e(we,{state:s.value},null,8,["state"]),e(ie,null,{default:t(()=>[w(h(g()),1)]),_:1}),e(H),e(O,{text:n.$t("rssArticles.feeds.markAllAsRead"),location:"top"},{activator:t(({props:$})=>[u()>0?(r(),b(F,N({key:0},$,{icon:"mdi-email-open",density:"comfortable",variant:"plain",onClick:m[0]||(m[0]=C=>A(l).markAllAsRead())}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:n.$t("rssArticles.feeds.refreshAllFeeds"),location:"top"},{activator:t(({props:$})=>[s.value!==A(E).LOADING?(r(),b(F,N({key:0},$,{icon:"mdi-sync",density:"comfortable",variant:"plain",onClick:m[1]||(m[1]=C=>d())}),null,16)):T("",!0)]),_:1},8,["text"]),e(O,{text:n.$t("rssArticles.feeds.empty.action"),location:"top"},{activator:t(({props:$})=>[e(F,N($,{icon:"mdi-plus",density:"comfortable",variant:"plain",onClick:m[2]||(m[2]=C=>n.$emit("createFeed"))}),null,16)]),_:1},8,["text"])])]),_:1},8,["active"]),e(K,{thickness:"3"}),(r(!0),S(M,null,J(A(l).feeds,$=>(r(),S(M,null,[(!A(l).filters.unread||A(l).filters.unread&&u($)>0)&&A(v).includes($.uid)?(r(),b(G,{key:0,active:c.value===$.uid,class:ne(u($)>0?"text-accent":""),color:"accent",variant:"text",onClick:C=>R($)},{default:t(()=>[e(xe,{title:g($),state:a($),"unread-count":u($),onReadFeed:C=>D($),onRefreshFeed:C=>n.$emit("refreshFeed",$),onEditFeed:C=>n.$emit("editFeed",$),onDeleteFeed:C=>n.$emit("deleteFeed",$)},null,8,["title","state","unread-count","onReadFeed","onRefreshFeed","onEditFeed","onDeleteFeed"])]),_:2},1032,["active","class","onClick"])):T("",!0)],64))),256))]),_:1},8,["height"]))}}),tt=_({__name:"Feeds",props:{height:{},mobile:{type:Boolean}},emits:["openArticle"],setup(p,{emit:f}){const i=p,o=ue(),l=q(),c=j(!1),v=L(()=>i.height-56-16-56-12*2),u=L({get:()=>l.filters.title,set:qe(g=>{l.filters.title=g??""},300)});function R(g){o.createDialog(Ke,{initialFeed:g},l.resumeFeedTimer)}async function D(g){await l.refreshFeed(g.name),l.resumeFeedTimer()}async function d(g){await l.deleteFeed(g.name),l.resumeFeedTimer()}return Fe(()=>{l.resumeFeedTimer()}),se(()=>{l.pauseFeedTimer()}),(g,s)=>A(l).feeds.length?(r(),b(z,{key:1,id:"rss-articles",class:"pa-3",height:g.height},{default:t(()=>[e(P,{modelValue:u.value,"onUpdate:modelValue":s[1]||(s[1]=a=>u.value=a),label:g.$t("rssArticles.feeds.filters.title"),clearable:"","hide-details":""},null,8,["modelValue","label"]),e(Y,{modelValue:A(l).filters.unread,"onUpdate:modelValue":s[2]||(s[2]=a=>A(l).filters.unread=a),label:g.$t("rssArticles.feeds.filters.unread"),"hide-details":""},null,8,["modelValue","label"]),g.mobile?(r(),S(M,{key:0},[e(Ve,{height:v.value,onArticleClicked:s[3]||(s[3]=a=>g.$emit("openArticle",a))},null,8,["height"]),e(Me,{modelValue:c.value,"onUpdate:modelValue":s[9]||(s[9]=a=>c.value=a),"max-height":"550"},{activator:t(({props:a})=>[e(F,N({class:"fab"},a,{color:"accent",icon:"mdi-format-list-bulleted",size:"large"}),null,16)]),default:t(()=>[e(ye,{onUpdate:s[4]||(s[4]=a=>c.value=!1),onCreateFeed:s[5]||(s[5]=()=>R()),onEditFeed:s[6]||(s[6]=a=>R(a)),onDeleteFeed:s[7]||(s[7]=a=>d(a)),onRefreshFeed:s[8]||(s[8]=a=>D(a))})]),_:1},8,["modelValue"])],64)):(r(),b(Q,{key:1},{default:t(()=>[e(I,{cols:"4"},{default:t(()=>[e(ye,{height:v.value,onCreateFeed:s[10]||(s[10]=()=>R()),onEditFeed:s[11]||(s[11]=a=>R(a)),onDeleteFeed:s[12]||(s[12]=a=>d(a)),onRefreshFeed:s[13]||(s[13]=a=>D(a))},null,8,["height"])]),_:1}),e(I,{cols:"8"},{default:t(()=>[e(Ve,{height:v.value,onArticleClicked:s[14]||(s[14]=a=>g.$emit("openArticle",a))},null,8,["height"])]),_:1})]),_:1}))]),_:1},8,["height"])):(r(),b(z,{key:0,height:g.height},{default:t(()=>[e(he,{title:g.$t("rssArticles.feeds.empty.value"),icon:"mdi-rss-off"},{actions:t(()=>[e(F,{text:g.$t("rssArticles.feeds.empty.action"),color:"accent",onClick:s[0]||(s[0]=a=>R())},null,8,["text"])]),_:1},8,["title"])]),_:1},8,["height"]))}}),lt=_({__name:"AddTorrentParamsDialog",props:{modelValue:{required:!0},modelModifiers:{},isOpened:{type:Boolean},isOpenedModifiers:{}},emits:["update:modelValue","update:isOpened"],setup(p){const f=pe(p,"modelValue"),i=pe(p,"isOpened"),{t:o}=te(),l=j();function c(){l.value?.saveFields(),i.value=!1}return(v,u)=>(r(),b(ee,{modelValue:i.value,"onUpdate:modelValue":u[1]||(u[1]=R=>i.value=R),class:ne(v.$vuetify.display.mobile?"":"w-75"),fullscreen:v.$vuetify.display.mobile,scrollable:""},{default:t(()=>[e(z,null,{default:t(()=>[e(W,{class:"ios-margin"},{default:t(()=>[e(de,{color:"transparent"},{default:t(()=>[e(Ce,null,{default:t(()=>[w(h(A(o)("dialogs.add.params.title")),1)]),_:1}),e(F,{icon:"mdi-close",onClick:c})]),_:1})]),_:1}),e(x,null,{default:t(()=>[e(Le,{modelValue:f.value,"onUpdate:modelValue":u[0]||(u[0]=R=>f.value=R)},null,8,["modelValue"])]),_:1}),e(oe,{class:"mb-2"},{default:t(()=>[e(H),e(F,{text:v.$t("common.close"),color:"",variant:"flat",onClick:c},null,8,["text"])]),_:1})]),_:1})]),_:1},8,["modelValue","class","fullscreen"]))}});function at(p){return{save_path:p?.save_path??"",skip_checking:!1,add_to_top_of_queue:p?.add_to_top_of_queue??!1,content_layout:p?.torrent_content_layout,stop_condition:p?.torrent_stop_condition,download_limit:p?.dl_limit,upload_limit:p?.up_limit,use_download_path:!!p?.temp_path,download_path:p?.temp_path?p?.temp_path:"",stopped:p?.start_paused_enabled,use_auto_tmm:p?.auto_tmm_enabled,ratio_limit:-2,seeding_time_limit:-2,inactive_seeding_time_limit:-2}}let nt,st,ot,it,rt,ut,dt,mt,ct,ft,pt,vt;nt={class:"d-flex"};st={class:"d-flex align-center"};ot={class:"v-card-title pa-0"};it=_({__name:"RssRuleDialog",props:{guid:{},initialRule:{}},setup(p){const f=p,i=L(()=>!!(f.initialRule&&f.initialRule.name)),{isOpened:o}=Re(f.guid),{t:l}=te(),c=Oe(),v=Ie(),u=q(),R=j(),D=j(!1),d=le(n()),g=j(""),s=j([]),a=L(()=>{if(d.lastMatch==="")return l("dialogs.rss.rule.lastMatch.unknownValue").toString();const y=new Date().getTime()-new Date(d.lastMatch).getTime();return l("dialogs.rss.rule.lastMatch.knownValue",Math.floor(y/(1e3*60*60*24)))});function n(){return{affectedFeeds:[],enabled:!0,episodeFilter:"",ignoreDays:0,lastMatch:"",mustContain:"",mustNotContain:"",name:"",priority:0,smartFilter:!1,useRegex:!1,previouslyMatchedEpisodes:i.value?f.initialRule.previouslyMatchedEpisodes:[],torrentParams:at(v.preferences)}}async function m(){if(g.value==="")return;const y=[],k=await u.fetchMatchingArticles(g.value);for(const V in k){const X=k[V];y.length>0&&y.push({type:"divider"}),y.push({type:"subheader",value:V});for(const De in X){const Ue=X[De];y.push({type:"item",value:Ue})}}s.value=y}async function $(){D.value&&((i.value||g.value!=="")&&g.value!==d.name&&await u.renameRule(g.value,d.name),await u.setRule(d.name,d),g.value=d.name,await u.fetchRules(),await m())}async function C(){d.affectedFeeds=[]}async function me(){d.affectedFeeds=u.feeds.map(y=>y.url)}const ce=()=>{o.value=!1};return ae(async()=>{await c.fetchCategories(),await u.fetchFeeds(),i.value&&(g.value=f.initialRule.name,Object.assign(d,f.initialRule)),await m()}),(y,k)=>(r(),b(ee,{modelValue:A(o),"onUpdate:modelValue":k[13]||(k[13]=V=>Z(o)?o.value=V:null)},{default:t(()=>[e(z,null,{default:t(()=>[e(W,null,{default:t(()=>[e(de,{color:"transparent",title:y.$t(`dialogs.rss.rule.title.${y.initialRule?"edit":"create"}`)},{default:t(()=>[e(F,{icon:"mdi-close",onClick:ce})]),_:1},8,["title"])]),_:1}),e(x,null,{default:t(()=>[e(A(Ae),{modelValue:D.value,"onUpdate:modelValue":k[11]||(k[11]=V=>D.value=V),ref_key:"form",ref:R,onSubmit:k[12]||(k[12]=B(()=>{},["prevent"]))},{default:t(()=>[e(Q,null,{default:t(()=>[e(I,{cols:"12",sm:"6",class:"scrollable-col"},{default:t(()=>[e(P,{modelValue:d.name,"onUpdate:modelValue":k[0]||(k[0]=V=>d.name=V),autofocus:"",required:"",label:y.$t("dialogs.rss.rule.name")},null,8,["modelValue","label"]),U("div",nt,[e(Pe,{modelValue:d.enabled,"onUpdate:modelValue":k[1]||(k[1]=V=>d.enabled=V),color:"accent",inset:"","hide-details":"",label:y.$t("dialogs.rss.rule.enabled")},null,8,["modelValue","label"]),e(H),U("div",st,[e(F,{class:"d-flex align-center justify-center",color:"accent"},{default:t(()=>[w(h(y.$t("dialogs.add.params.title"))+" ",1),e(lt,{modelValue:d.torrentParams,"onUpdate:modelValue":k[2]||(k[2]=V=>d.torrentParams=V),activator:"parent"},null,8,["modelValue"])]),_:1})])]),e(K),e(Y,{modelValue:d.useRegex,"onUpdate:modelValue":k[3]||(k[3]=V=>d.useRegex=V),"hide-details":"",label:y.$t("dialogs.rss.rule.useRegex")},null,8,["modelValue","label"]),e(P,{modelValue:d.mustContain,"onUpdate:modelValue":k[4]||(k[4]=V=>d.mustContain=V),label:y.$t("dialogs.rss.rule.mustContain")},null,8,["modelValue","label"]),e(P,{modelValue:d.mustNotContain,"onUpdate:modelValue":k[5]||(k[5]=V=>d.mustNotContain=V),label:y.$t("dialogs.rss.rule.mustNotContain")},null,8,["modelValue","label"]),e(Y,{modelValue:d.smartFilter,"onUpdate:modelValue":k[6]||(k[6]=V=>d.smartFilter=V),"hide-details":"",label:y.$t("dialogs.rss.rule.smartFilter")},null,8,["modelValue","label"]),e(P,{modelValue:d.episodeFilter,"onUpdate:modelValue":k[7]||(k[7]=V=>d.episodeFilter=V),placeholder:y.$t("dialogs.rss.rule.episodeFilterPlaceholder"),label:y.$t("dialogs.rss.rule.episodeFilter")},null,8,["modelValue","placeholder","label"]),e(K,{class:"mb-4"}),e(P,{modelValue:d.ignoreDays,"onUpdate:modelValue":k[8]||(k[8]=V=>d.ignoreDays=V),modelModifiers:{number:!0},type:"number",hint:y.$t("dialogs.rss.rule.ignoreDaysHint"),label:y.$t("dialogs.rss.rule.ignoreDays")},null,8,["modelValue","hint","label"]),e(P,{modelValue:a.value,"onUpdate:modelValue":k[9]||(k[9]=V=>a.value=V),disabled:"",label:y.$t("dialogs.rss.rule.lastMatch.label")},null,8,["modelValue","label"]),e(K),e($e,null,{default:t(()=>[w(h(y.$t("dialogs.rss.rule.affectedFeedsSubheader")),1)]),_:1}),e(Q,null,{default:t(()=>[e(I,{cols:"6",class:"d-flex align-center justify-center"},{default:t(()=>[e(F,{color:"accent",onClick:me},{default:t(()=>[w(h(y.$t("common.selectAll")),1)]),_:1})]),_:1}),e(I,{cols:"6",class:"d-flex align-center justify-center"},{default:t(()=>[e(F,{color:"primary",onClick:C},{default:t(()=>[w(h(y.$t("common.selectNone")),1)]),_:1})]),_:1})]),_:1}),(r(!0),S(M,null,J(A(u).feeds,V=>(r(),b(Y,{modelValue:d.affectedFeeds,"onUpdate:modelValue":k[10]||(k[10]=X=>d.affectedFeeds=X),multiple:"","hide-details":"",label:V.name,value:V.url},null,8,["modelValue","label","value"]))),256))]),_:1}),e(K,{vertical:!y.$vuetify.display.mobile},null,8,["vertical"]),e(I,{cols:"12",sm:"6",class:"scrollable-col"},{default:t(()=>[U("div",ot,h(y.$t("dialogs.rss.rule.matchingArticles.title")),1),e(re,null,{default:t(()=>[(r(!0),S(M,null,J(s.value,V=>(r(),S(M,null,[V.type==="divider"?(r(),b(K,{key:0})):V.type==="subheader"?(r(),b($e,{key:1,inset:""},{default:t(()=>[w(h(V.value),1)]),_:2},1024)):(r(),b(G,{key:2,class:"mb-3"},{default:t(()=>[w(h(V.value),1)]),_:2},1024))],64))),256)),s.value.length===0?(r(),b(G,{key:0,title:y.$t("dialogs.rss.rule.matchingArticles.noMatch")},null,8,["title"])):T("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(oe,null,{default:t(()=>[e(H),e(F,{color:"error",onClick:ce},{default:t(()=>[w(h(y.$t("common.close")),1)]),_:1}),e(F,{color:"accent",onClick:$},{default:t(()=>[w(h(y.$t("common.save")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});rt=je(it,[["__scopeId","data-v-d359259e"]]);ut={class:"pl-4"};dt=_({__name:"Rule",props:{value:{}},emits:["openRule"],setup(p){const f=q();async function i(l){await f.setRule(l.name,{...l,enabled:!l.enabled}),f.resumeRuleTimer()}async function o(l){await f.deleteRule(l.name),f.resumeRuleTimer()}return(l,c)=>(r(),b(Be,{rounded:"xl",class:"d-flex align-center"},{default:t(()=>[U("div",ut,h(l.value.name),1),e(H),U("div",null,[e(F,{class:"my-2 mr-2",icon:l.value.enabled?"mdi-check":"mdi-cancel",color:l.value.enabled?"accent":"red",variant:"plain",density:"compact",onClick:c[0]||(c[0]=v=>i(l.value))},null,8,["icon","color"]),e(O,{text:l.$t("common.edit"),location:"top"},{activator:t(({props:v})=>[e(F,N(v,{class:"my-2 mr-2",icon:"mdi-pencil",variant:"plain",density:"compact",onClick:c[1]||(c[1]=u=>l.$emit("openRule",l.value))}),null,16)]),_:1},8,["text"]),e(O,{text:l.$t("common.delete"),location:"top"},{activator:t(({props:v})=>[e(F,N(v,{class:"my-2 mr-2",icon:"mdi-delete",color:"red",variant:"plain",density:"compact",onClick:c[2]||(c[2]=u=>o(l.value))}),null,16)]),_:1},8,["text"])])]),_:1}))}});mt=_({__name:"Rules",props:{height:{}},setup(p){const f=ue(),i=q();function o(l){f.createDialog(rt,{initialRule:l},i.resumeRuleTimer)}return ae(()=>{i.resumeRuleTimer()}),se(()=>{i.pauseRuleTimer()}),(l,c)=>A(i).rules.length?(r(),S(M,{key:1},[e(Q,{class:"mt-2"},{default:t(()=>[(r(!0),S(M,null,J(A(i).rules,v=>(r(),b(I,{cols:"12",sm:"6",lg:"3"},{default:t(()=>[e(dt,{value:v,onOpenRule:o},null,8,["value"])]),_:2},1024))),256))]),_:1}),e(Q,null,{default:t(()=>[e(I,{cols:"12",class:"d-flex align-center justify-center"},{default:t(()=>[e(F,{color:"accent",onClick:c[1]||(c[1]=v=>o())},{default:t(()=>[w(h(l.$t("rssArticles.rules.empty.action")),1)]),_:1})]),_:1})]),_:1})],64)):(r(),b(z,{key:0,height:l.height},{default:t(()=>[e(he,{title:l.$t("rssArticles.rules.empty.value"),icon:"mdi-rss-off"},{actions:t(()=>[e(F,{text:l.$t("rssArticles.rules.empty.action"),color:"accent",onClick:c[0]||(c[0]=v=>o())},null,8,["text"])]),_:1},8,["title"])]),_:1},8,["height"]))}});ct={class:"pa-3"};ft={class:"subtitle-1 ml-2",style:{"font-size":"1.6em !important"}};pt={class:"d-flex justify-end"};vt=["innerHTML"];bt=_({__name:"RssArticles",setup(p){const{height:f,mobile:i}=He({mobileBreakpoint:"md"}),o=ke(),l=be(),c=ue(),v=q(),u=j(!1),R=le({title:"",content:""}),D=L(()=>o.params.tab!=="rules"),d=L(()=>f.value-64-12*2-48);function g(m){m.description&&(R.title=m.title.trim(),R.content=m.description.trim(),u.value=!0)}function s(){const m=o.params.tab==="rules"?"feeds":"rules";l.replace({name:"rssArticles",params:{tab:m}}),v.lastView=m}function a(){l.push({name:"dashboard"})}function n(m){if(c.hasActiveDialog||u.value)return!1;m.key==="Escape"&&a()}return Fe(()=>{document.addEventListener("keydown",n)}),se(()=>{document.removeEventListener("keydown",n)}),(m,$)=>(r(),S(M,null,[U("div",ct,[e(Q,{align:"center",justify:"center","no-gutters":""},{default:t(()=>[e(I,null,{default:t(()=>[U("h1",ft,h(D.value?m.$t("rssArticles.feeds.title"):m.$t("rssArticles.rules.title")),1)]),_:1}),e(I,null,{default:t(()=>[U("div",pt,[e(O,{text:m.$t(D.value?"rssArticles.toggle.rules":"rssArticles.toggle.feeds"),location:"top"},{activator:t(({props:C})=>[e(F,N(C,{icon:"mdi-auto-download",variant:"plain",onClick:$[0]||($[0]=me=>s())}),null,16)]),_:1},8,["text"]),e(F,{icon:"mdi-close",variant:"plain",onClick:$[1]||($[1]=C=>a())})])]),_:1})]),_:1}),D.value?(r(),b(tt,{key:0,height:d.value,mobile:A(i),onOpenArticle:g},null,8,["height","mobile"])):(r(),b(mt,{key:1,height:d.value},null,8,["height"]))]),e(ee,{modelValue:u.value,"onUpdate:modelValue":$[3]||($[3]=C=>u.value=C)},{default:t(()=>[e(z,null,{default:t(()=>[e(W,null,{default:t(()=>[e(de,{color:"transparent"},{default:t(()=>[e(Ce,null,{default:t(()=>[w(h(R.title),1)]),_:1}),e(F,{icon:"mdi-close",onClick:$[2]||($[2]=C=>u.value=!1)})]),_:1})]),_:1}),e(x,null,{default:t(()=>[U("div",{class:"description-container",innerHTML:R.content},null,8,vt)]),_:1})]),_:1})]),_:1},8,["modelValue"])],64))}})});export{bt as default,__tla};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{j as X,E as Y,f as h,H as E,I as T,J as l,n as e,U as C,L as p,q as ie,u as g,M as R,K as S,P as oe,S as re,$ as ue,c as z,G as ce,v as de,Q as H,F as fe,V as me,O as ge}from"./vue-CfSjRv-x.js";import{a as pe,R as Z,i as A,V as ve,g as M,j as F,c as O,d as he,e as ee,f as Q,h as m,S as le,v as ye,k as Ve,D as ke,E as be,m as Ee,n as Se,p as P,q as we,r as b,G as Ce,U as _e,W as $e,s as G,K as Pe,M as Te,t as J,w as Me,X as Ie,__tla as __tla_0}from"./index-C0tfT_Qc.js";import{_ as W,__tla as __tla_1}from"./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js";import"./vuetify-PctCzU6r.js";let je;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{let Ne,Ue,De,qe,Le;Ne=["href","title"];Ue=X({__name:"PluginManagerDialog",props:{guid:{}},setup(B){const I=B,{isOpened:t}=pe(I.guid),{t:y}=Y(),c=Z(),d=[{title:y("dialogs.pluginManager.headers.enabled"),key:"enabled",sortable:!1},{title:y("dialogs.pluginManager.headers.name"),key:"fullName"},{title:y("dialogs.pluginManager.headers.version"),key:"version"},{title:y("dialogs.pluginManager.headers.url"),key:"url"},{title:y("dialogs.pluginManager.headers.actions"),key:"actions"}],V=h(!1),k=h(!1),w=h(!1),v=h(!1),u=h("");async function N(r){await c.toggleSearchPlugin(r),await c.fetchSearchPlugins()}async function _(){k.value=!0,await c.updatePlugins().then(()=>new Promise(r=>setTimeout(r,2e3))),await c.fetchSearchPlugins(),k.value=!1}async function U(){$(),V.value=!0,await c.installSearchPlugin(u.value),u.value="",setTimeout(()=>{c.fetchSearchPlugins().then(()=>{V.value=!1})},1e3)}async function D(r){V.value=!0,await c.uninstallSearchPlugin(r.name),await c.fetchSearchPlugins(),V.value=!1}const i=()=>{t.value=!1};function $(){w.value=!1}return(r,f)=>(E(),T(F,{modelValue:g(t),"onUpdate:modelValue":f[4]||(f[4]=n=>oe(t)?t.value=n:null)},{default:l(()=>[e(A,null,{default:l(()=>[e(ve,{class:"d-flex"},{default:l(()=>[C("div",null,p(r.$t("dialogs.pluginManager.title")),1),e(M),e(W,{icon:"mdi-update",text:r.$t("dialogs.pluginManager.update"),color:"accent",class:"mr-2",loading:k.value,onClick:_},null,8,["text","loading"]),e(F,{modelValue:w.value,"onUpdate:modelValue":f[3]||(f[3]=n=>w.value=n)},{activator:l(({props:n})=>[e(W,ie({icon:"mdi-toy-brick-plus",text:r.$t("dialogs.pluginManager.install.activator")},n,{color:"primary"}),null,16,["text"])]),default:l(()=>[e(A,{title:r.$t("dialogs.pluginManager.install.title")},{default:l(()=>[e(O,null,{default:l(()=>[e(g(he),{modelValue:v.value,"onUpdate:modelValue":f[1]||(f[1]=n=>v.value=n),onSubmit:f[2]||(f[2]=R(()=>{},["prevent"]))},{default:l(()=>[e(ee,{modelValue:u.value,"onUpdate:modelValue":f[0]||(f[0]=n=>u.value=n),autofocus:"",label:r.$t("dialogs.pluginManager.install.label")},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),e(Q,null,{default:l(()=>[e(M),e(m,{color:"error",onClick:$},{default:l(()=>[S(p(r.$t("common.cancel")),1)]),_:1}),e(m,{color:"accent",onClick:U},{default:l(()=>[S(p(r.$t("common.ok")),1)]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1}),e(O,null,{default:l(()=>[e(le,{mobile:null,headers:d,"items-per-page":"-1",items:g(c).searchPlugins,"sort-by":[{key:"fullName",order:"asc"}],loading:V.value},{"item.enabled":l(({item:n})=>[e(ye,{"model-value":n.enabled,onClick:q=>N(n)},null,8,["model-value","onClick"])]),"item.url":l(({item:n})=>[C("a",{href:n.url,title:n.name},p(n.url),9,Ne)]),"item.actions":l(({item:n})=>[e(Ve,{color:"red",icon:"mdi-delete",onClick:q=>D(n)},null,8,["onClick"])]),_:2},1032,["items","loading"])]),_:1}),e(Q,null,{default:l(()=>[e(M),e(m,{color:"accent",onClick:i},{default:l(()=>[S(p(r.$t("common.close")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});De={class:"pa-3"};qe={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"};Le={class:"d-flex justify-end"};je=X({__name:"SearchEngine",setup(B){const I=re(),{t}=Y(),y=ke(),c=be(),d=Z(),V=Ee(),k=h(),w=h(!1),v=h(0),{searchData:u}=ue(d),N=[{title:t("searchEngine.headers.fileName"),key:"fileName"},{title:t("searchEngine.headers.fileSize"),key:"fileSize"},{title:t("searchEngine.headers.nbSeeders"),key:"nbSeeders"},{title:t("searchEngine.headers.nbLeechers"),key:"nbLeechers"},{title:t("searchEngine.headers.siteUrl"),key:"siteUrl"},{title:"",key:"actions",sortable:!1}],_=[{title:t("searchEngine.filters.category.movies"),value:"movies"},{title:t("searchEngine.filters.category.tv"),value:"tv"},{title:t("searchEngine.filters.category.music"),value:"music"},{title:t("searchEngine.filters.category.games"),value:"games"},{title:t("searchEngine.filters.category.anime"),value:"anime"},{title:t("searchEngine.filters.category.software"),value:"software"},{title:t("searchEngine.filters.category.pictures"),value:"pictures"},{title:t("searchEngine.filters.category.books"),value:"books"}];_.sort((a,o)=>a.title.localeCompare(o.title));const U=[{title:t("searchEngine.filters.category.all"),value:"all"},..._],D=z(()=>{const a=[{title:t("searchEngine.filters.plugins.all"),value:"all"},{title:t("searchEngine.filters.plugins.enabled"),value:"enabled"}];return d.searchPlugins.filter(o=>o.enabled).forEach(o=>{a.push({title:o.name,value:o.name})}),a}),i=z(()=>u.value[v.value]??{}),{results:$}=Se(()=>i.value.results,()=>i.value.filters?.title,a=>a.fileName);function r(){d.createNewTab(),v.value=u.value.length-1,k.value?.focus()}function f(){u.value.length!==1&&(d.deleteTab(i.value.uniqueId),v.value=Math.min(v.value,u.value.length-1))}function n(a){y.pushTorrentToQueue(a.fileUrl)}function q(a){window.open(a.descrLink,"_blank","noreferrer")}async function x(){await d.runNewSearch(i.value),i.value.timer=setInterval(()=>te(i.value),1e3),k.value?.saveValueToHistory()}async function L(a){await d.stopSearch(a),a.timer&&clearInterval(a.timer)}function ae(){u.value.forEach(L)}async function te(a){await d.refreshResults(a)==="Stopped"&&await L(a)}const K=()=>{I.push({name:"dashboard"})};function ne(){c.createDialog(Ue)}function j(a){if(c.hasActiveDialog||w.value)return!1;a.key==="Escape"&&K()}return ce(async()=>{document.addEventListener("keydown",j),u.value.length===0?d.createNewTab():u.value.forEach(a=>{a.id&&a.id!==0&&(a.timer=setInterval(()=>d.refreshResults(a),1e3))}),await d.fetchSearchPlugins()}),de(()=>{document.removeEventListener("keydown",j),u.value.forEach(a=>{a.timer&&clearInterval(a.timer)})}),(a,o)=>(E(),H("div",De,[e(P,{"no-gutters":"",align:"center",justify:"center"},{default:l(()=>[e(b,null,{default:l(()=>[C("h1",qe,p(g(t)("searchEngine.title")),1)]),_:1}),e(b,null,{default:l(()=>[C("div",Le,[e(m,{icon:"mdi-stop",variant:"plain",color:"error",onClick:ae}),e(m,{icon:"mdi-toy-brick",variant:"plain",color:"primary",onClick:ne}),e(m,{icon:"mdi-close",variant:"plain",onClick:K})])]),_:1})]),_:1}),e(P,{class:"ma-0 pa-0"},{default:l(()=>[e(Ce,{class:"d-flex align-center justify-center ma-0 pa-0 bg-primary",fluid:""},{default:l(()=>[e(_e,{modelValue:v.value,"onUpdate:modelValue":o[0]||(o[0]=s=>v.value=s),class:"overflow-auto","bg-color":"primary","show-arrows":""},{default:l(()=>[(E(!0),H(fe,null,me(g(u),s=>(E(),T($e,{key:s.uniqueId},{default:l(()=>[C("h4",null,p(!s.query||s.query.length===0?a.$t("searchEngine.tabHeaderEmpty"):s.query),1)]),_:2},1024))),128))]),_:1},8,["modelValue"]),e(M),e(m,{icon:"mdi-plus-circle-outline",variant:"plain",color:"accent",onClick:r}),e(m,{icon:"mdi-minus-circle-outline",variant:"plain",color:"error",disabled:g(u).length===1,onClick:f},null,8,["disabled"])]),_:1})]),_:1}),e(we,null,{default:l(()=>[e(G,null,{default:l(()=>[e(P,{class:"mt-1"},{default:l(()=>[e(b,{cols:"12",md:"6"},{default:l(()=>[e(Pe,{modelValue:i.value.query,"onUpdate:modelValue":o[1]||(o[1]=s=>i.value.query=s),"history-key":g(Te).SEARCH_ENGINE_QUERY,ref_key:"queryInput",ref:k,autofocus:"",density:"compact","hide-details":"",clearable:"",label:a.$t("searchEngine.query"),onKeydown:ge(R(x,["prevent"]),["enter"])},null,8,["modelValue","history-key","label","onKeydown"])]),_:1}),e(b,{cols:"6",sm:"5",md:"2"},{default:l(()=>[e(J,{modelValue:i.value.filters.category,"onUpdate:modelValue":o[2]||(o[2]=s=>i.value.filters.category=s),height:"1",variant:"outlined",density:"compact","hide-details":"",items:U,label:a.$t("searchEngine.filters.category.label")},null,8,["modelValue","label"])]),_:1}),e(b,{cols:"6",sm:"5",md:"2"},{default:l(()=>[e(J,{modelValue:i.value.filters.plugin,"onUpdate:modelValue":o[3]||(o[3]=s=>i.value.filters.plugin=s),flat:"",density:"compact","hide-details":"",variant:"outlined",items:D.value,label:a.$t("searchEngine.filters.plugins.label")},null,8,["modelValue","items","label"])]),_:1}),e(b,{cols:"12",sm:"2",class:"d-flex align-center justify-center"},{default:l(()=>[i.value.id===0?(E(),T(m,{key:0,color:"accent",flat:"",class:"mx-auto px-4",onClick:x},{default:l(()=>[S(p(a.$t("searchEngine.runSearch")),1)]),_:1})):(E(),T(m,{key:1,color:"warning",flat:"",class:"mx-auto px-4",onClick:o[4]||(o[4]=s=>L(i.value))},{default:l(()=>[S(p(a.$t("searchEngine.stopSearch")),1)]),_:1}))]),_:1})]),_:1})]),_:1}),e(Me,{class:"my-3"}),e(G,{class:"text-select"},{default:l(()=>[e(le,{mobile:null,headers:N,items:g($),"footer-props":{itemsPerPageOptions:[10,25,50,100,-1]},"items-per-page":i.value.itemsPerPage},{top:l(()=>[e(P,null,{default:l(()=>[e(b,{cols:"12"},{default:l(()=>[e(ee,{modelValue:i.value.filters.title,"onUpdate:modelValue":o[5]||(o[5]=s=>i.value.filters.title=s),density:"compact","hide-details":"",label:a.$t("searchEngine.filters.title.label")},null,8,["modelValue","label"])]),_:1})]),_:1})]),"item.fileSize":l(({item:s})=>[S(p(g(Ie)(s.fileSize,g(V).useBinarySize)),1)]),"item.actions":l(({item:s})=>[e(m,{icon:"mdi-open-in-new",variant:"flat",density:"compact",onClick:R(se=>q(s),["stop"])},null,8,["onClick"]),e(m,{icon:"mdi-download",variant:"flat",density:"compact",onClick:se=>n(s)},null,8,["onClick"])]),_:2},1032,["items","items-per-page"])]),_:1})]),_:1})]))}})});export{je as default,__tla};
|
|
||||||
1
qbit/vuetorrent/public/assets/SearchEngine-D9tNU7S0.css
Normal file
1
qbit/vuetorrent/public/assets/SearchEngine-D9tNU7S0.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.v-row.row-mobile>.v-col[data-v-62d82f7b]{padding:8px 0;display:flex;flex-wrap:wrap}.v-row.row-mobile .item-header-large[data-v-62d82f7b],.v-row.row-mobile .item-value-large[data-v-62d82f7b],.v-row.row-mobile .item-actions[data-v-62d82f7b]{align-content:center;justify-content:start}.v-row.row-mobile .item-container[data-v-62d82f7b]{flex-direction:column;align-items:center;justify-items:center}
|
||||||
1
qbit/vuetorrent/public/assets/SearchEngine-Dtet_VDQ.js
Normal file
1
qbit/vuetorrent/public/assets/SearchEngine-Dtet_VDQ.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{a0 as be,d as P,h as G,c as q,B as v,D as E,G as a,I as m,J as r,M as L,N as M,m as e,S,n as ke,u as s,K as R,O as Se,P as _e,Q as ee,H as Ve,q as we,F as H,T as Ee,L as Pe}from"./vue-DFryKk-1.js";import{Z as Ce,$ as T,V as O,k as h,c as Te,u as fe,d as ae,e as Ne,j as B,l as le,f as te,g as xe,a as K,i as se,a0 as j,w as De,E as $e,G as Ie,F as Me,o as Ue,a1 as ne,a2 as qe,q as $,r as Le,s as c,H as Re,a3 as Be,t as ie,M as Qe,N as ze,v as oe,x as re,a4 as ue,a5 as ce,a6 as Ae,a7 as Fe,a8 as He}from"./index-BhWmfNB5.js";import{a as me}from"./vuetify-XtA0Y0Oj.js";const ge=be("searchEngine",()=>{const _=P([]),V=P([]);function k(){_.value.push({uniqueId:Ce(),id:0,lastQuery:"",query:"",itemsPerPage:10,filters:{title:"",category:"all",plugin:"enabled"},results:[],timer:null})}function l(n){_.value=_.value.filter(y=>y.uniqueId!==n)}async function d(n){const y=await T.startSearch(n.query,n.filters.category,[n.filters.plugin]);n.id=y.id,n.results=[],n.lastQuery=n.query}async function N(n){const y=await T.getSearchResults(n.id,n.results.length);return n.results.push(...y.results),y.status}async function w(n){n.id&&n.id!==0&&await T.stopSearch(n.id),n.id=0}async function f(){V.value=await T.getSearchPlugins()}async function g(n){await T.installSearchPlugin([n])}async function x(n){await T.uninstallSearchPlugin([n])}async function C(n){await T.enableSearchPlugin([n.name],!n.enabled)}async function D(){await T.updateSearchPlugins()}async function I(n,y){await T.downloadTorrentWithSearchPlugin(n,y)}return{searchData:_,searchPlugins:V,createNewTab:k,deleteTab:l,runNewSearch:d,refreshResults:N,stopSearch:w,fetchSearchPlugins:f,installSearchPlugin:g,uninstallSearchPlugin:x,toggleSearchPlugin:C,updatePlugins:D,downloadTorrent:I,$reset:()=>{_.value=[],V.value=[],k()}}},{persistence:{enabled:!0,storageItems:[{storage:sessionStorage}]}}),Oe={key:1,"data-testid":"mixedbtn-text"},de=G({__name:"MixedButton",props:{mobileOverride:{type:Boolean,default:!1},mobileValue:{type:Boolean},position:{},icon:{},text:{}},setup(_){const V=_,{mobile:k}=me(),l=q(()=>V.mobileOverride?V.mobileValue:k.value);return(d,N)=>(v(),E(h,{icon:l.value},{default:a(()=>[l.value||d.position==="left"?(v(),E(O,{key:0,"data-testid":"mixedbtn-icon-left"},{default:a(()=>[m(r(d.icon),1)]),_:1})):L("",!0),l.value?L("",!0):(v(),M("span",Oe,r(d.text),1)),!l.value&&d.position==="right"?(v(),E(O,{key:2,"data-testid":"mixedbtn-icon-right"},{default:a(()=>[m(r(d.icon),1)]),_:1})):L("",!0)]),_:1},8,["icon"]))}}),Ke=["href","title"],je=G({__name:"PluginManagerDialog",props:{guid:{}},setup(_){const V=_,{isOpened:k}=Te(V.guid),{t:l}=fe(),d=ge(),N=[{title:l("dialogs.pluginManager.headers.enabled"),key:"enabled",sortable:!1},{title:l("dialogs.pluginManager.headers.name"),key:"fullName"},{title:l("dialogs.pluginManager.headers.version"),key:"version"},{title:l("dialogs.pluginManager.headers.url"),key:"url"},{title:l("dialogs.pluginManager.headers.actions"),key:"actions"}],w=P(!1),f=P(!1),g=P(!1),x=P(!1),C=P("");async function D(i){await d.toggleSearchPlugin(i),await d.fetchSearchPlugins()}async function I(){f.value=!0,await d.updatePlugins().then(()=>new Promise(i=>setTimeout(i,2e3))),await d.fetchSearchPlugins(),f.value=!1}async function n(){U(),w.value=!0,await d.installSearchPlugin(C.value),C.value="",setTimeout(()=>{d.fetchSearchPlugins().then(()=>{w.value=!1})},1e3)}async function y(i){w.value=!0,await d.uninstallSearchPlugin(i.name),await d.fetchSearchPlugins(),w.value=!1}const Q=()=>{k.value=!1};function U(){g.value=!1}return(i,b)=>(v(),E(le,{modelValue:s(k),"onUpdate:modelValue":b[4]||(b[4]=u=>Se(k)?k.value=u:null)},{default:a(()=>[e(ae,null,{default:a(()=>[e(Ne,{class:"d-flex"},{default:a(()=>[S("div",null,r(i.$t("dialogs.pluginManager.title")),1),e(B),e(de,{icon:"mdi-update",text:i.$t("dialogs.pluginManager.update"),color:"accent",class:"mr-2",loading:f.value,onClick:I},null,8,["text","loading"]),e(le,{modelValue:g.value,"onUpdate:modelValue":b[3]||(b[3]=u=>g.value=u)},{activator:a(({props:u})=>[e(de,ke({icon:"mdi-toy-brick-plus",text:i.$t("dialogs.pluginManager.install.activator")},u,{color:"primary"}),null,16,["text"])]),default:a(()=>[e(ae,{title:i.$t("dialogs.pluginManager.install.title")},{default:a(()=>[e(te,null,{default:a(()=>[e(s(xe),{modelValue:x.value,"onUpdate:modelValue":b[1]||(b[1]=u=>x.value=u),onSubmit:b[2]||(b[2]=R(()=>{},["prevent"]))},{default:a(()=>[e(K,{modelValue:C.value,"onUpdate:modelValue":b[0]||(b[0]=u=>C.value=u),autofocus:"",label:i.$t("dialogs.pluginManager.install.label")},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),e(se,null,{default:a(()=>[e(B),e(h,{color:"error",onClick:U},{default:a(()=>[m(r(i.$t("common.cancel")),1)]),_:1}),e(h,{color:"accent",onClick:n},{default:a(()=>[m(r(i.$t("common.ok")),1)]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1}),e(te,null,{default:a(()=>[e(j,{mobile:null,headers:N,"items-per-page":"-1",items:s(d).searchPlugins,"sort-by":[{key:"fullName",order:"asc"}],loading:w.value},{"item.enabled":a(({item:u})=>[e(De,{"model-value":u.enabled,onClick:z=>D(u)},null,8,["model-value","onClick"])]),"item.url":a(({item:u})=>[S("a",{href:u.url,title:u.name},r(u.url),9,Ke)]),"item.actions":a(({item:u})=>[e(O,{color:"red",icon:"mdi-delete",onClick:z=>y(u)},null,8,["onClick"])]),_:2},1032,["items","loading"])]),_:1}),e(se,null,{default:a(()=>[e(B),e(h,{color:"accent",onClick:Q},{default:a(()=>[m(r(i.$t("common.close")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]))}}),Ge={class:"pa-3"},Je={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"},We={class:"d-flex justify-end"},Ye={class:"item-header-small"},Ze={class:"item-value-small"},Xe={class:"item-header-small"},ea={class:"item-value-small"},aa={class:"item-header-small"},la={class:"item-value-small"},ta=G({__name:"SearchEngine",setup(_){const{mobile:V}=me(),k=_e(),{t:l}=fe(),d=$e(),N=Ie(),w=Me(),f=ge(),{searchData:g}=ee(f),{useBinarySize:x,dateFormat:C}=ee(Ue()),D=P(),I=P(!1),n=P(0),y=q(()=>[{title:l("searchEngine.headers.fileName"),key:"fileName"},{title:l("searchEngine.headers.fileSize"),key:"fileSize"},{title:l("searchEngine.headers.nbSeeders"),key:"nbSeeders"},{title:l("searchEngine.headers.nbLeechers"),key:"nbLeechers"},...N.usesQbit5?[{title:l("searchEngine.headers.engineName"),key:"engineName"},{title:l("searchEngine.headers.pubDate"),key:"pubDate"}]:[{title:l("searchEngine.headers.siteUrl"),key:"siteUrl"}],{title:"",key:"actions",sortable:!1}]),Q=[{title:l("searchEngine.filters.category.movies"),value:"movies"},{title:l("searchEngine.filters.category.tv"),value:"tv"},{title:l("searchEngine.filters.category.music"),value:"music"},{title:l("searchEngine.filters.category.games"),value:"games"},{title:l("searchEngine.filters.category.anime"),value:"anime"},{title:l("searchEngine.filters.category.software"),value:"software"},{title:l("searchEngine.filters.category.pictures"),value:"pictures"},{title:l("searchEngine.filters.category.books"),value:"books"}].sort((o,p)=>ne.text.asc(o.title,p.title)).toSpliced(0,0,{title:l("searchEngine.filters.category.all"),value:"all"}),U=q(()=>[{title:l("searchEngine.filters.plugins.all"),value:"all"},{title:l("searchEngine.filters.plugins.enabled"),value:"enabled"},...f.searchPlugins.filter(o=>o.enabled).map(o=>o.name).sort(ne.text.asc).map(o=>({title:o,value:o}))]),i=q(()=>g.value[n.value]??{}),{results:b}=qe(()=>i.value.results,()=>i.value.filters?.title,o=>o.fileName);function u(){f.createNewTab(),n.value=g.value.length-1,D.value?.focus()}function z(){g.value.length!==1&&(f.deleteTab(i.value.uniqueId),n.value=Math.min(n.value,g.value.length-1))}function J(o){N.usesQbit5?f.downloadTorrent(o.fileUrl,o.engineName):d.pushTorrentToQueue(o.fileUrl),o.downloaded=!0}function W(o){Ae(o.descrLink)}async function Y(){await f.runNewSearch(i.value),i.value.timer=setInterval(()=>he(i.value),1e3),D.value?.saveValueToHistory()}async function A(o){await f.stopSearch(o),o.timer&&clearInterval(o.timer)}function pe(){g.value.forEach(A)}async function he(o){await f.refreshResults(o)==="Stopped"&&await A(o)}const Z=()=>{k.push({name:"dashboard"})};function ve(){w.createDialog(je)}function X(o){if(w.hasActiveDialog||I.value)return!1;o.key==="Escape"&&Z()}return Ve(async()=>{document.addEventListener("keydown",X),g.value.length===0?f.createNewTab():g.value.forEach(o=>{o.id&&o.id!==0&&(o.timer=setInterval(()=>f.refreshResults(o),1e3))}),await f.fetchSearchPlugins()}),we(()=>{document.removeEventListener("keydown",X),g.value.forEach(o=>{o.timer&&clearInterval(o.timer)})}),(o,p)=>(v(),M("div",Ge,[e($,{"no-gutters":"",align:"center",justify:"center"},{default:a(()=>[e(c,null,{default:a(()=>[S("h1",Je,r(s(l)("searchEngine.title")),1)]),_:1}),e(c,null,{default:a(()=>[S("div",We,[e(h,{icon:"mdi-stop",variant:"plain",color:"error",onClick:pe}),e(h,{icon:"mdi-toy-brick",variant:"plain",color:"primary",onClick:ve}),e(h,{icon:"mdi-close",variant:"plain",onClick:Z})])]),_:1})]),_:1}),e($,{class:"ma-0 pa-0"},{default:a(()=>[e(Re,{class:"d-flex align-center justify-center ma-0 pa-0 bg-primary",fluid:""},{default:a(()=>[e(Be,{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=t=>n.value=t),class:"overflow-auto","bg-color":"primary","show-arrows":""},{default:a(()=>[(v(!0),M(H,null,Ee(s(g),t=>(v(),E(Fe,{key:t.uniqueId},{default:a(()=>[S("h4",null,r(!t.lastQuery||t.lastQuery.length===0?s(l)("searchEngine.tabHeaderEmpty"):t.lastQuery),1)]),_:2},1024))),128))]),_:1},8,["modelValue"]),e(B),e(h,{icon:"mdi-plus-circle-outline",variant:"plain",color:"accent",onClick:u}),e(h,{icon:"mdi-minus-circle-outline",variant:"plain",color:"error",disabled:s(g).length===1,onClick:z},null,8,["disabled"])]),_:1})]),_:1}),e(Le,null,{default:a(()=>[e(ie,null,{default:a(()=>[e($,{class:"mt-1"},{default:a(()=>[e(c,{cols:"12",md:"6"},{default:a(()=>[e(Qe,{modelValue:i.value.query,"onUpdate:modelValue":p[1]||(p[1]=t=>i.value.query=t),"history-key":s(ze).SEARCH_ENGINE_QUERY,ref_key:"queryInput",ref:D,autofocus:"",density:"compact","hide-details":"",clearable:"",label:s(l)("searchEngine.query"),onKeydown:Pe(R(Y,["prevent"]),["enter"])},null,8,["modelValue","history-key","label","onKeydown"])]),_:1}),e(c,{cols:"6",sm:"5",md:"2"},{default:a(()=>[e(oe,{modelValue:i.value.filters.category,"onUpdate:modelValue":p[2]||(p[2]=t=>i.value.filters.category=t),height:"1",variant:"outlined",density:"compact","hide-details":"",items:s(Q),label:s(l)("searchEngine.filters.category.label")},null,8,["modelValue","items","label"])]),_:1}),e(c,{cols:"6",sm:"5",md:"2"},{default:a(()=>[e(oe,{modelValue:i.value.filters.plugin,"onUpdate:modelValue":p[3]||(p[3]=t=>i.value.filters.plugin=t),flat:"",density:"compact","hide-details":"",variant:"outlined",items:U.value,label:s(l)("searchEngine.filters.plugins.label")},null,8,["modelValue","items","label"])]),_:1}),e(c,{cols:"12",sm:"2",class:"d-flex align-center justify-center"},{default:a(()=>[i.value.id===0?(v(),E(h,{key:0,color:"accent",flat:"",class:"mx-auto px-4",onClick:Y},{default:a(()=>[m(r(s(l)("searchEngine.runSearch")),1)]),_:1})):(v(),E(h,{key:1,color:"warning",flat:"",class:"mx-auto px-4",onClick:p[4]||(p[4]=t=>A(i.value))},{default:a(()=>[m(r(s(l)("searchEngine.stopSearch")),1)]),_:1}))]),_:1})]),_:1})]),_:1}),e(re,{class:"my-3"}),e(ie,{class:"text-select"},{default:a(()=>[s(V)?(v(),E(j,{key:0,mobile:!0,headers:y.value,items:s(b),"footer-props":{itemsPerPageOptions:[10,25,50,100,-1]},"items-per-page":i.value.itemsPerPage},{top:a(()=>[e($,null,{default:a(()=>[e(c,{cols:"12"},{default:a(()=>[e(K,{modelValue:i.value.filters.title,"onUpdate:modelValue":p[5]||(p[5]=t=>i.value.filters.title=t),density:"compact","hide-details":"",label:s(l)("searchEngine.filters.title.label")},null,8,["modelValue","label"])]),_:1})]),_:1})]),item:a(({item:t,index:F})=>[F!==0?(v(),E(re,{key:0})):L("",!0),e($,{class:"row-mobile ma-0 pa-3"},{default:a(()=>[e(c,{cols:"6",class:"item-header-large"},{default:a(()=>[m(r(s(l)("searchEngine.headers.fileName")),1)]),_:1}),e(c,{cols:"6",class:"item-value-large"},{default:a(()=>[m(r(t.fileName),1)]),_:2},1024),s(N).usesQbit5?(v(),M(H,{key:0},[e(c,{cols:"6",class:"item-header-large"},{default:a(()=>[m(r(s(l)("searchEngine.headers.engineName")),1)]),_:1}),e(c,{cols:"6",class:"item-value-large"},{default:a(()=>[m(r(t.engineName),1)]),_:2},1024),e(c,{cols:"6",class:"item-header-large"},{default:a(()=>[m(r(s(l)("searchEngine.headers.pubDate")),1)]),_:1}),e(c,{cols:"6",class:"item-value-large"},{default:a(()=>[m(r(t.pubDate===-1?s(l)("common.NA"):s(ue)(t.pubDate,s(C))),1)]),_:2},1024)],64)):(v(),M(H,{key:1},[e(c,{cols:"6",class:"item-header-large"},{default:a(()=>[m(r(s(l)("searchEngine.headers.siteUrl")),1)]),_:1}),e(c,{cols:"6",class:"item-value-large"},{default:a(()=>[m(r(t.siteUrl),1)]),_:2},1024)],64)),e(c,{cols:"3",class:"item-container"},{default:a(()=>[S("div",Ye,r(s(l)("searchEngine.headers.fileSize")),1),S("div",Ze,r(s(ce)(t.fileSize,s(x))),1)]),_:2},1024),e(c,{cols:"3",class:"item-container"},{default:a(()=>[S("div",Xe,r(s(l)("searchEngine.headers.nbSeeders")),1),S("div",ea,r(t.nbSeeders),1)]),_:2},1024),e(c,{cols:"3",class:"item-container"},{default:a(()=>[S("div",aa,r(s(l)("searchEngine.headers.nbLeechers")),1),S("div",la,r(t.nbLeechers),1)]),_:2},1024),e(c,{cols:"3",class:"item-actions"},{default:a(()=>[e(h,{icon:"mdi-open-in-new",variant:"flat",density:"compact",onClick:R(ye=>W(t),["stop"])},null,8,["onClick"]),e(h,{icon:t.downloaded?"mdi-check":"mdi-download",color:t.downloaded&&"accent",variant:"text",density:"compact",onClick:ye=>J(t)},null,8,["icon","color","onClick"])]),_:2},1024)]),_:2},1024)]),_:1},8,["headers","items","items-per-page"])):(v(),E(j,{key:1,mobile:!1,headers:y.value,items:s(b),"footer-props":{itemsPerPageOptions:[10,25,50,100,-1]},"items-per-page":i.value.itemsPerPage},{top:a(()=>[e($,null,{default:a(()=>[e(c,{cols:"12"},{default:a(()=>[e(K,{modelValue:i.value.filters.title,"onUpdate:modelValue":p[6]||(p[6]=t=>i.value.filters.title=t),density:"compact","hide-details":"",label:s(l)("searchEngine.filters.title.label")},null,8,["modelValue","label"])]),_:1})]),_:1})]),"item.fileSize":a(({item:t})=>[m(r(s(ce)(t.fileSize,s(x))),1)]),"item.pubDate":a(({value:t})=>[m(r(t===-1?s(l)("common.NA"):s(ue)(t,s(C))),1)]),"item.actions":a(({item:t})=>[e(h,{icon:"mdi-open-in-new",variant:"flat",density:"compact",onClick:R(F=>W(t),["stop"])},null,8,["onClick"]),e(h,{icon:t.downloaded?"mdi-check":"mdi-download",color:t.downloaded&&"accent",variant:"text",density:"compact",onClick:F=>J(t)},null,8,["icon","color","onClick"])]),_:2},1032,["headers","items","items-per-page"]))]),_:1})]),_:1})]))}}),oa=He(ta,[["__scopeId","data-v-62d82f7b"]]);export{oa as default};
|
||||||
1
qbit/vuetorrent/public/assets/Settings-Cr02oaBK.js
Normal file
1
qbit/vuetorrent/public/assets/Settings-Cr02oaBK.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
.gap[data-v-9e9db76d]{margin-bottom:8px}.gap[data-v-9e9db76d]:last-child{margin-bottom:unset}td .dnd-handle[data-v-ef71a863]{cursor:move}
|
.gap[data-v-aba5565d]{margin-bottom:8px}.gap[data-v-aba5565d]:last-child{margin-bottom:unset}td .dnd-handle[data-v-ef71a863]{cursor:move}
|
||||||
326
qbit/vuetorrent/public/assets/SharedSystems-B1uG7cSA.js
Normal file
326
qbit/vuetorrent/public/assets/SharedSystems-B1uG7cSA.js
Normal file
@@ -0,0 +1,326 @@
|
|||||||
|
import{t as ze,G as re,x as se,y as We,l as ae,M as v,E as d,e as O,z as ne,F as g,H as Ve,I as y,R as F,J as H,K as ie,L as Ne,v as m,S as f,i as U,w as oe,N as K,O as je,c as Y,B as C,j as I,Q as S,k as T,V as w,W as $e,a as qe,C as P,X as le,Y as de,Z as ue,$ as ce,a0 as he,a1 as Ke,P as Ye,d as Je,T as J,D as fe,a2 as X,a3 as Xe,a4 as Qe,a5 as Ze}from"./TorrentDetail-CoyYqyCA.js";import{S as pe,B as me,c as et}from"./colorToUniform-C2GHuDhf.js";const ve=class A extends ze{constructor(e){e={...A.defaultOptions,...e},super(e),this.enabled=!0,this._state=pe.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1)}apply(e,t,r,s){e.applyFilter(this,t,r,s)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:t,gl:r,...s}=e;let n,i;return t&&(n=re.from(t)),r&&(i=se.from(r)),new A({gpuProgram:n,glProgram:i,...s})}};ve.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let tt=ve;var rt=`in vec2 vMaskCoord;
|
||||||
|
in vec2 vTextureCoord;
|
||||||
|
|
||||||
|
uniform sampler2D uTexture;
|
||||||
|
uniform sampler2D uMaskTexture;
|
||||||
|
|
||||||
|
uniform float uAlpha;
|
||||||
|
uniform vec4 uMaskClamp;
|
||||||
|
uniform float uInverse;
|
||||||
|
|
||||||
|
out vec4 finalColor;
|
||||||
|
|
||||||
|
void main(void)
|
||||||
|
{
|
||||||
|
float clip = step(3.5,
|
||||||
|
step(uMaskClamp.x, vMaskCoord.x) +
|
||||||
|
step(uMaskClamp.y, vMaskCoord.y) +
|
||||||
|
step(vMaskCoord.x, uMaskClamp.z) +
|
||||||
|
step(vMaskCoord.y, uMaskClamp.w));
|
||||||
|
|
||||||
|
// TODO look into why this is needed
|
||||||
|
float npmAlpha = uAlpha;
|
||||||
|
vec4 original = texture(uTexture, vTextureCoord);
|
||||||
|
vec4 masky = texture(uMaskTexture, vMaskCoord);
|
||||||
|
float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
|
||||||
|
|
||||||
|
float a = alphaMul * masky.r * npmAlpha * clip;
|
||||||
|
|
||||||
|
if (uInverse == 1.0) {
|
||||||
|
a = 1.0 - a;
|
||||||
|
}
|
||||||
|
|
||||||
|
finalColor = original * a;
|
||||||
|
}
|
||||||
|
`,st=`in vec2 aPosition;
|
||||||
|
|
||||||
|
out vec2 vTextureCoord;
|
||||||
|
out vec2 vMaskCoord;
|
||||||
|
|
||||||
|
|
||||||
|
uniform vec4 uInputSize;
|
||||||
|
uniform vec4 uOutputFrame;
|
||||||
|
uniform vec4 uOutputTexture;
|
||||||
|
uniform mat3 uFilterMatrix;
|
||||||
|
|
||||||
|
vec4 filterVertexPosition( vec2 aPosition )
|
||||||
|
{
|
||||||
|
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
||||||
|
|
||||||
|
position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;
|
||||||
|
position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;
|
||||||
|
|
||||||
|
return vec4(position, 0.0, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec2 filterTextureCoord( vec2 aPosition )
|
||||||
|
{
|
||||||
|
return aPosition * (uOutputFrame.zw * uInputSize.zw);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec2 getFilterCoord( vec2 aPosition )
|
||||||
|
{
|
||||||
|
return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main(void)
|
||||||
|
{
|
||||||
|
gl_Position = filterVertexPosition(aPosition);
|
||||||
|
vTextureCoord = filterTextureCoord(aPosition);
|
||||||
|
vMaskCoord = getFilterCoord(aPosition);
|
||||||
|
}
|
||||||
|
`,Q=`struct GlobalFilterUniforms {
|
||||||
|
uInputSize:vec4<f32>,
|
||||||
|
uInputPixel:vec4<f32>,
|
||||||
|
uInputClamp:vec4<f32>,
|
||||||
|
uOutputFrame:vec4<f32>,
|
||||||
|
uGlobalFrame:vec4<f32>,
|
||||||
|
uOutputTexture:vec4<f32>,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct MaskUniforms {
|
||||||
|
uFilterMatrix:mat3x3<f32>,
|
||||||
|
uMaskClamp:vec4<f32>,
|
||||||
|
uAlpha:f32,
|
||||||
|
uInverse:f32,
|
||||||
|
};
|
||||||
|
|
||||||
|
@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;
|
||||||
|
@group(0) @binding(1) var uTexture: texture_2d<f32>;
|
||||||
|
@group(0) @binding(2) var uSampler : sampler;
|
||||||
|
|
||||||
|
@group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms;
|
||||||
|
@group(1) @binding(1) var uMaskTexture: texture_2d<f32>;
|
||||||
|
|
||||||
|
struct VSOutput {
|
||||||
|
@builtin(position) position: vec4<f32>,
|
||||||
|
@location(0) uv : vec2<f32>,
|
||||||
|
@location(1) filterUv : vec2<f32>,
|
||||||
|
};
|
||||||
|
|
||||||
|
fn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>
|
||||||
|
{
|
||||||
|
var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;
|
||||||
|
|
||||||
|
position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;
|
||||||
|
position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;
|
||||||
|
|
||||||
|
return vec4(position, 0.0, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
|
||||||
|
{
|
||||||
|
return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
|
||||||
|
{
|
||||||
|
return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>
|
||||||
|
{
|
||||||
|
return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn getSize() -> vec2<f32>
|
||||||
|
{
|
||||||
|
return gfu.uGlobalFrame.zw;
|
||||||
|
}
|
||||||
|
|
||||||
|
@vertex
|
||||||
|
fn mainVertex(
|
||||||
|
@location(0) aPosition : vec2<f32>,
|
||||||
|
) -> VSOutput {
|
||||||
|
return VSOutput(
|
||||||
|
filterVertexPosition(aPosition),
|
||||||
|
filterTextureCoord(aPosition),
|
||||||
|
getFilterCoord(aPosition)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@fragment
|
||||||
|
fn mainFragment(
|
||||||
|
@location(0) uv: vec2<f32>,
|
||||||
|
@location(1) filterUv: vec2<f32>,
|
||||||
|
@builtin(position) position: vec4<f32>
|
||||||
|
) -> @location(0) vec4<f32> {
|
||||||
|
|
||||||
|
var maskClamp = filterUniforms.uMaskClamp;
|
||||||
|
var uAlpha = filterUniforms.uAlpha;
|
||||||
|
|
||||||
|
var clip = step(3.5,
|
||||||
|
step(maskClamp.x, filterUv.x) +
|
||||||
|
step(maskClamp.y, filterUv.y) +
|
||||||
|
step(filterUv.x, maskClamp.z) +
|
||||||
|
step(filterUv.y, maskClamp.w));
|
||||||
|
|
||||||
|
var mask = textureSample(uMaskTexture, uSampler, filterUv);
|
||||||
|
var source = textureSample(uTexture, uSampler, uv);
|
||||||
|
var alphaMul = 1.0 - uAlpha * (1.0 - mask.a);
|
||||||
|
|
||||||
|
var a: f32 = alphaMul * mask.r * uAlpha * clip;
|
||||||
|
|
||||||
|
if (filterUniforms.uInverse == 1.0) {
|
||||||
|
a = 1.0 - a;
|
||||||
|
}
|
||||||
|
|
||||||
|
return source * a;
|
||||||
|
}
|
||||||
|
`;class at extends tt{constructor(e){const{sprite:t,...r}=e,s=new We(t.texture),n=new ae({uFilterMatrix:{value:new v,type:"mat3x3<f32>"},uMaskClamp:{value:s.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:e.inverse?1:0,type:"f32"}}),i=re.from({vertex:{source:Q,entryPoint:"mainVertex"},fragment:{source:Q,entryPoint:"mainFragment"}}),l=se.from({vertex:st,fragment:rt,name:"mask-filter"});super({...r,gpuProgram:i,glProgram:l,resources:{filterUniforms:n,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=s}set inverse(e){this.resources.filterUniforms.uniforms.uInverse=e?1:0}get inverse(){return this.resources.filterUniforms.uniforms.uInverse===1}apply(e,t,r,s){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,r,s)}}const L=class ge{constructor(e,t){this.state=pe.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init?.(this)}static getBatcher(e){return new this._availableBatchers[e]}buildStart(e){let t=this._batchersByInstructionSet[e.uid];t||(t=this._batchersByInstructionSet[e.uid]=Object.create(null),t.default||(t.default=new ne)),this._activeBatches=t,this._activeBatch=this._activeBatches.default;for(const r in this._activeBatches)this._activeBatches[r].begin()}addToBatch(e,t){if(this._activeBatch.name!==e.batcherName){this._activeBatch.break(t);let r=this._activeBatches[e.batcherName];r||(r=this._activeBatches[e.batcherName]=ge.getBatcher(e.batcherName),r.begin()),this._activeBatch=r}this._activeBatch.add(e)}break(e){this._activeBatch.break(e)}buildEnd(e){this._activeBatch.break(e);const t=this._activeBatches;for(const r in t){const s=t[r],n=s.geometry;n.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,!0),n.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,!1)}}upload(e){const t=this._batchersByInstructionSet[e.uid];for(const r in t){const s=t[r],n=s.geometry;s.dirty&&(s.dirty=!1,n.buffers[0].update(s.attributeSize*4))}}execute(e){if(e.action==="startBatch"){const t=e.batcher,r=t.geometry,s=t.shader;this._adaptor.start(this,r,s)}this._adaptor.execute(this,e)}destroy(){this.state=null,this.renderer=null,this._adaptor=null;for(const e in this._activeBatches)this._activeBatches[e].destroy();this._activeBatches=null}};L.extension={type:[d.WebGLPipes,d.WebGPUPipes,d.CanvasPipes],name:"batch"};L._availableBatchers=Object.create(null);let xe=L;O.handleByMap(d.Batcher,xe._availableBatchers);O.add(ne);const At={name:"texture-bit",vertex:{header:`
|
||||||
|
|
||||||
|
struct TextureUniforms {
|
||||||
|
uTextureMatrix:mat3x3<f32>,
|
||||||
|
}
|
||||||
|
|
||||||
|
@group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;
|
||||||
|
`,main:`
|
||||||
|
uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;
|
||||||
|
`},fragment:{header:`
|
||||||
|
@group(2) @binding(0) var uTexture: texture_2d<f32>;
|
||||||
|
@group(2) @binding(1) var uSampler: sampler;
|
||||||
|
|
||||||
|
|
||||||
|
`,main:`
|
||||||
|
outColor = textureSample(uTexture, uSampler, vUV);
|
||||||
|
`}},Gt={name:"texture-bit",vertex:{header:`
|
||||||
|
uniform mat3 uTextureMatrix;
|
||||||
|
`,main:`
|
||||||
|
uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
|
||||||
|
`},fragment:{header:`
|
||||||
|
uniform sampler2D uTexture;
|
||||||
|
|
||||||
|
|
||||||
|
`,main:`
|
||||||
|
outColor = texture(uTexture, vUV);
|
||||||
|
`}};function nt(a,e){const t=a.root,r=a.instructionSet;r.reset();const s=e.renderPipes?e:e.batch.renderer,n=s.renderPipes;n.batch.buildStart(r),n.blendMode.buildStart(),n.colorMask.buildStart(),t.sortableChildren&&t.sortChildren(),_e(t,r,s,!0),n.batch.buildEnd(r),n.blendMode.buildEnd(r)}function R(a,e,t){const r=t.renderPipes?t:t.batch.renderer;a.globalDisplayStatus<7||!a.includeInBuild||(a.sortableChildren&&a.sortChildren(),a.isSimple?it(a,e,r):_e(a,e,r,!1))}function it(a,e,t){if(a.renderPipeId){const r=a,{renderPipes:s,renderableGC:n}=t;s.blendMode.setBlendMode(r,a.groupBlendMode,e),s[r.renderPipeId].addRenderable(r,e),n.addRenderable(r,e),r.didViewUpdate=!1}if(!a.renderGroup){const r=a.children,s=r.length;for(let n=0;n<s;n++)R(r[n],e,t)}}function _e(a,e,t,r){const{renderPipes:s,renderableGC:n}=t;if(!r&&a.renderGroup)s.renderGroup.addRenderGroup(a.renderGroup,e);else{for(let u=0;u<a.effects.length;u++){const c=a.effects[u];s[c.pipe].push(c,a,e)}const i=a,l=i.renderPipeId;l&&(s.blendMode.setBlendMode(i,i.groupBlendMode,e),s[l].addRenderable(i,e),n.addRenderable(i,e),i.didViewUpdate=!1);const o=a.children;if(o.length)for(let u=0;u<o.length;u++)R(o[u],e,t);for(let u=a.effects.length-1;u>=0;u--){const c=a.effects[u];s[c.pipe].pop(c,a,e)}}}const ot=new H;class lt extends ie{constructor(){super(),this.filters=[new at({sprite:new Ne(m.EMPTY),inverse:!1,resolution:"inherit",antialias:"inherit"})]}get sprite(){return this.filters[0].sprite}set sprite(e){this.filters[0].sprite=e}get inverse(){return this.filters[0].inverse}set inverse(e){this.filters[0].inverse=e}}class be{constructor(e){this._activeMaskStage=[],this._renderer=e}push(e,t,r){const s=this._renderer;if(s.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:!1,maskedContainer:t}),e.inverse=t._maskOptions.inverse,e.renderMaskToTexture){const n=e.mask;n.includeInBuild=!0,R(n,r,s),n.includeInBuild=!1}s.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:e,maskedContainer:t,inverse:t._maskOptions.inverse,canBundle:!1})}pop(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:!1})}execute(e){const t=this._renderer,r=e.mask.renderMaskToTexture;if(e.action==="pushMaskBegin"){const s=g.get(lt);if(s.inverse=e.inverse,r){e.mask.mask.measurable=!0;const n=Ve(e.mask.mask,!0,ot);e.mask.mask.measurable=!1,n.ceil();const i=t.renderTarget.renderTarget.colorTexture.source,l=y.getOptimalTexture(n.width,n.height,i._resolution,i.antialias);t.renderTarget.push(l,!0),t.globalUniforms.push({offset:n,worldColor:4294967295});const o=s.sprite;o.texture=l,o.worldTransform.tx=n.minX,o.worldTransform.ty=n.minY,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer,filterTexture:l})}else s.sprite=e.mask.mask,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer})}else if(e.action==="pushMaskEnd"){const s=this._activeMaskStage[this._activeMaskStage.length-1];r&&(t.type===F.WEBGL&&t.renderTarget.finishRenderPass(),t.renderTarget.pop(),t.globalUniforms.pop()),t.filter.push({renderPipeId:"filter",action:"pushFilter",container:s.maskedContainer,filterEffect:s.filterEffect,canBundle:!1})}else if(e.action==="popMaskEnd"){t.filter.pop();const s=this._activeMaskStage.pop();r&&y.returnTexture(s.filterTexture),g.return(s.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}}be.extension={type:[d.WebGLPipes,d.WebGPUPipes,d.CanvasPipes],name:"alphaMask"};class ye{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(e,t,r){this._renderer.renderPipes.batch.break(r);const n=this._colorStack;n[this._colorStackIndex]=n[this._colorStackIndex-1]&e.mask;const i=this._colorStack[this._colorStackIndex];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1})),this._colorStackIndex++}pop(e,t,r){this._renderer.renderPipes.batch.break(r);const n=this._colorStack;this._colorStackIndex--;const i=n[this._colorStackIndex-1];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1}))}execute(e){this._renderer.colorMask.setMask(e.colorMask)}destroy(){this._colorStack=null}}ye.extension={type:[d.WebGLPipes,d.WebGPUPipes,d.CanvasPipes],name:"colorMask"};class Te{constructor(e){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=e}push(e,t,r){var s;const n=e,i=this._renderer;i.renderPipes.batch.break(r),i.renderPipes.blendMode.setBlendMode(n.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:!1});const l=n.mask;l.includeInBuild=!0,this._maskHash.has(n)||this._maskHash.set(n,{instructionsStart:0,instructionsLength:0});const o=this._maskHash.get(n);o.instructionsStart=r.instructionSize,R(l,r,i),l.includeInBuild=!1,i.renderPipes.batch.break(r),r.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:!1});const u=r.instructionSize-o.instructionsStart-1;o.instructionsLength=u;const c=i.renderTarget.renderTarget.uid;(s=this._maskStackHash)[c]??(s[c]=0)}pop(e,t,r){const s=e,n=this._renderer;n.renderPipes.batch.break(r),n.renderPipes.blendMode.setBlendMode(s.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:t._maskOptions.inverse,canBundle:!1});const i=this._maskHash.get(e);for(let l=0;l<i.instructionsLength;l++)r.instructions[r.instructionSize++]=r.instructions[i.instructionsStart++];r.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1})}execute(e){var t;const r=this._renderer,s=r.renderTarget.renderTarget.uid;let n=(t=this._maskStackHash)[s]??(t[s]=0);e.action==="pushMaskBegin"?(r.renderTarget.ensureDepthStencil(),r.stencil.setStencilMode(f.RENDERING_MASK_ADD,n),n++,r.colorMask.setMask(0)):e.action==="pushMaskEnd"?(e.inverse?r.stencil.setStencilMode(f.INVERSE_MASK_ACTIVE,n):r.stencil.setStencilMode(f.MASK_ACTIVE,n),r.colorMask.setMask(15)):e.action==="popMaskBegin"?(r.colorMask.setMask(0),n!==0?r.stencil.setStencilMode(f.RENDERING_MASK_REMOVE,n):(r.renderTarget.clear(null,U.STENCIL),r.stencil.setStencilMode(f.DISABLED,n)),n--):e.action==="popMaskEnd"&&(e.inverse?r.stencil.setStencilMode(f.INVERSE_MASK_ACTIVE,n):r.stencil.setStencilMode(f.MASK_ACTIVE,n),r.colorMask.setMask(15)),this._maskStackHash[s]=n}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null}}Te.extension={type:[d.WebGLPipes,d.WebGPUPipes,d.CanvasPipes],name:"stencilMask"};function Dt(a,e){for(const t in a.attributes){const r=a.attributes[t],s=e[t];s?(r.format??(r.format=s.format),r.offset??(r.offset=s.offset),r.instance??(r.instance=s.instance)):oe(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}dt(a)}function dt(a){const{buffers:e,attributes:t}=a,r={},s={};for(const n in e){const i=e[n];r[i.uid]=0,s[i.uid]=0}for(const n in t){const i=t[n];r[i.buffer.uid]+=K(i.format).stride}for(const n in t){const i=t[n];i.stride??(i.stride=r[i.buffer.uid]),i.start??(i.start=s[i.buffer.uid]),s[i.buffer.uid]+=K(i.format).stride}}const _=[];_[f.NONE]=void 0;_[f.DISABLED]={stencilWriteMask:0,stencilReadMask:0};_[f.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};_[f.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};_[f.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};_[f.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"replace"},stencilBack:{compare:"not-equal",passOp:"replace"}};class Et{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck()}_systemCheck(){if(!je())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(e){const t=this.getUniformGroupData(e);e.buffer||(e.buffer=new Y({data:new Float32Array(t.layout.size/4),usage:C.UNIFORM|C.COPY_DST}))}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){const t=e._signature;let r=this._syncFunctionHash[t];if(!r){const s=Object.keys(e.uniformStructures).map(l=>e.uniformStructures[l]),n=this._adaptor.createUboElements(s),i=this._generateUboSync(n.uboElements);r=this._syncFunctionHash[t]={layout:n,syncFunction:i}}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,r){const s=this.getUniformGroupData(e);e.buffer||(e.buffer=new Y({data:new Float32Array(s.layout.size/4),usage:C.UNIFORM|C.COPY_DST}));let n=null;return t||(t=e.buffer.data,n=e.buffer.dataInt32),r||(r=0),s.syncFunction(e.uniforms,t,n,r),!0}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return!1;e._dirtyId=0;const t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null}}const M=[{type:"mat3x3<f32>",test:a=>a.value.a!==void 0,ubo:`
|
||||||
|
var matrix = uv[name].toArray(true);
|
||||||
|
data[offset] = matrix[0];
|
||||||
|
data[offset + 1] = matrix[1];
|
||||||
|
data[offset + 2] = matrix[2];
|
||||||
|
data[offset + 4] = matrix[3];
|
||||||
|
data[offset + 5] = matrix[4];
|
||||||
|
data[offset + 6] = matrix[5];
|
||||||
|
data[offset + 8] = matrix[6];
|
||||||
|
data[offset + 9] = matrix[7];
|
||||||
|
data[offset + 10] = matrix[8];
|
||||||
|
`,uniform:`
|
||||||
|
gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));
|
||||||
|
`},{type:"vec4<f32>",test:a=>a.type==="vec4<f32>"&&a.size===1&&a.value.width!==void 0,ubo:`
|
||||||
|
v = uv[name];
|
||||||
|
data[offset] = v.x;
|
||||||
|
data[offset + 1] = v.y;
|
||||||
|
data[offset + 2] = v.width;
|
||||||
|
data[offset + 3] = v.height;
|
||||||
|
`,uniform:`
|
||||||
|
cv = ud[name].value;
|
||||||
|
v = uv[name];
|
||||||
|
if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {
|
||||||
|
cv[0] = v.x;
|
||||||
|
cv[1] = v.y;
|
||||||
|
cv[2] = v.width;
|
||||||
|
cv[3] = v.height;
|
||||||
|
gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);
|
||||||
|
}
|
||||||
|
`},{type:"vec2<f32>",test:a=>a.type==="vec2<f32>"&&a.size===1&&a.value.x!==void 0,ubo:`
|
||||||
|
v = uv[name];
|
||||||
|
data[offset] = v.x;
|
||||||
|
data[offset + 1] = v.y;
|
||||||
|
`,uniform:`
|
||||||
|
cv = ud[name].value;
|
||||||
|
v = uv[name];
|
||||||
|
if (cv[0] !== v.x || cv[1] !== v.y) {
|
||||||
|
cv[0] = v.x;
|
||||||
|
cv[1] = v.y;
|
||||||
|
gl.uniform2f(ud[name].location, v.x, v.y);
|
||||||
|
}
|
||||||
|
`},{type:"vec4<f32>",test:a=>a.type==="vec4<f32>"&&a.size===1&&a.value.red!==void 0,ubo:`
|
||||||
|
v = uv[name];
|
||||||
|
data[offset] = v.red;
|
||||||
|
data[offset + 1] = v.green;
|
||||||
|
data[offset + 2] = v.blue;
|
||||||
|
data[offset + 3] = v.alpha;
|
||||||
|
`,uniform:`
|
||||||
|
cv = ud[name].value;
|
||||||
|
v = uv[name];
|
||||||
|
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {
|
||||||
|
cv[0] = v.red;
|
||||||
|
cv[1] = v.green;
|
||||||
|
cv[2] = v.blue;
|
||||||
|
cv[3] = v.alpha;
|
||||||
|
gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);
|
||||||
|
}
|
||||||
|
`},{type:"vec3<f32>",test:a=>a.type==="vec3<f32>"&&a.size===1&&a.value.red!==void 0,ubo:`
|
||||||
|
v = uv[name];
|
||||||
|
data[offset] = v.red;
|
||||||
|
data[offset + 1] = v.green;
|
||||||
|
data[offset + 2] = v.blue;
|
||||||
|
`,uniform:`
|
||||||
|
cv = ud[name].value;
|
||||||
|
v = uv[name];
|
||||||
|
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {
|
||||||
|
cv[0] = v.red;
|
||||||
|
cv[1] = v.green;
|
||||||
|
cv[2] = v.blue;
|
||||||
|
gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
|
||||||
|
}
|
||||||
|
`}];function Ot(a,e,t,r){const s=[`
|
||||||
|
var v = null;
|
||||||
|
var v2 = null;
|
||||||
|
var t = 0;
|
||||||
|
var index = 0;
|
||||||
|
var name = null;
|
||||||
|
var arrayOffset = null;
|
||||||
|
`];let n=0;for(let l=0;l<a.length;l++){const o=a[l],u=o.data.name;let c=!1,h=0;for(let p=0;p<M.length;p++)if(M[p].test(o.data)){h=o.offset/4,s.push(`name = "${u}";`,`offset += ${h-n};`,M[p][e]||M[p].ubo),c=!0;break}if(!c)if(o.data.size>1)h=o.offset/4,s.push(t(o,h-n));else{const p=r[o.data.type];h=o.offset/4,s.push(`
|
||||||
|
v = uv.${u};
|
||||||
|
offset += ${h-n};
|
||||||
|
${p};
|
||||||
|
`)}n=h}const i=s.join(`
|
||||||
|
`);return new Function("uv","data","dataInt32","offset",i)}function x(a,e){return`
|
||||||
|
for (let i = 0; i < ${a*e}; i++) {
|
||||||
|
data[offset + (((i / ${a})|0) * 4) + (i % ${a})] = v[i];
|
||||||
|
}
|
||||||
|
`}const ut={f32:`
|
||||||
|
data[offset] = v;`,i32:`
|
||||||
|
dataInt32[offset] = v;`,"vec2<f32>":`
|
||||||
|
data[offset] = v[0];
|
||||||
|
data[offset + 1] = v[1];`,"vec3<f32>":`
|
||||||
|
data[offset] = v[0];
|
||||||
|
data[offset + 1] = v[1];
|
||||||
|
data[offset + 2] = v[2];`,"vec4<f32>":`
|
||||||
|
data[offset] = v[0];
|
||||||
|
data[offset + 1] = v[1];
|
||||||
|
data[offset + 2] = v[2];
|
||||||
|
data[offset + 3] = v[3];`,"vec2<i32>":`
|
||||||
|
dataInt32[offset] = v[0];
|
||||||
|
dataInt32[offset + 1] = v[1];`,"vec3<i32>":`
|
||||||
|
dataInt32[offset] = v[0];
|
||||||
|
dataInt32[offset + 1] = v[1];
|
||||||
|
dataInt32[offset + 2] = v[2];`,"vec4<i32>":`
|
||||||
|
dataInt32[offset] = v[0];
|
||||||
|
dataInt32[offset + 1] = v[1];
|
||||||
|
dataInt32[offset + 2] = v[2];
|
||||||
|
dataInt32[offset + 3] = v[3];`,"mat2x2<f32>":`
|
||||||
|
data[offset] = v[0];
|
||||||
|
data[offset + 1] = v[1];
|
||||||
|
data[offset + 4] = v[2];
|
||||||
|
data[offset + 5] = v[3];`,"mat3x3<f32>":`
|
||||||
|
data[offset] = v[0];
|
||||||
|
data[offset + 1] = v[1];
|
||||||
|
data[offset + 2] = v[2];
|
||||||
|
data[offset + 4] = v[3];
|
||||||
|
data[offset + 5] = v[4];
|
||||||
|
data[offset + 6] = v[5];
|
||||||
|
data[offset + 8] = v[6];
|
||||||
|
data[offset + 9] = v[7];
|
||||||
|
data[offset + 10] = v[8];`,"mat4x4<f32>":`
|
||||||
|
for (let i = 0; i < 16; i++) {
|
||||||
|
data[offset + i] = v[i];
|
||||||
|
}`,"mat3x2<f32>":x(3,2),"mat4x2<f32>":x(4,2),"mat2x3<f32>":x(2,3),"mat4x3<f32>":x(4,3),"mat2x4<f32>":x(2,4),"mat3x4<f32>":x(3,4)},Ft={...ut,"mat2x2<f32>":`
|
||||||
|
data[offset] = v[0];
|
||||||
|
data[offset + 1] = v[1];
|
||||||
|
data[offset + 2] = v[2];
|
||||||
|
data[offset + 3] = v[3];
|
||||||
|
`};function ct(a,e,t,r,s,n){const i=n?1:-1;return a.identity(),a.a=1/r*2,a.d=i*(1/s*2),a.tx=-1-e*a.a,a.ty=-i-t*a.d,a}const b=new Map;function ke(a,e){if(!b.has(a)){const t=new m({source:new I({resource:a,...e})}),r=()=>{b.get(a)===t&&b.delete(a)};t.once("destroy",r),t.source.once("destroy",r),b.set(a,t)}return b.get(a)}function ht(a){const e=a.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}const Ce=class Me{constructor(e={}){if(this.uid=S("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,e={...Me.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,typeof e.colorTextures=="number"){this._managedColorTextures=!0;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new T({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}))}else{this.colorTextures=[...e.colorTextures.map(r=>r.source)];const t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof m||e.depthStencilTexture instanceof T?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){const e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new T({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(e,t,r=this.resolution,s=!1){this.dirtyId++,this.colorTextures.forEach((n,i)=>{s&&i===0||n.source.resize(e,t,r)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,r)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(e=>{e.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};Ce.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};let G=Ce;class Ht{constructor(e){this.rootViewPort=new w,this.viewport=new w,this.onRenderTargetChange=new $e("onRenderTargetChange"),this.projectionMatrix=new v,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuRenderTargetHash")}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:e,clear:t,clearColor:r,frame:s}){this._renderTargetStack.length=0,this.push(e,t,r,s),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=ht(this.rootRenderTarget),this.adaptor.prerender?.(this.rootRenderTarget)}postrender(){this.adaptor.postrender?.(this.rootRenderTarget)}bind(e,t=!0,r,s){const n=this.getRenderTarget(e),i=this.renderTarget!==n;this.renderTarget=n,this.renderSurface=e;const l=this.getGpuRenderTarget(n);(n.pixelWidth!==l.width||n.pixelHeight!==l.height)&&(this.adaptor.resizeGpuRenderTarget(n),l.width=n.pixelWidth,l.height=n.pixelHeight);const o=n.colorTexture,u=this.viewport,c=o.pixelWidth,h=o.pixelHeight;if(!s&&e instanceof m&&(s=e.frame),s){const p=o._resolution;u.x=s.x*p+.5|0,u.y=s.y*p+.5|0,u.width=s.width*p+.5|0,u.height=s.height*p+.5|0}else u.x=0,u.y=0,u.width=c,u.height=h;return ct(this.projectionMatrix,0,0,u.width/o.resolution,u.height/o.resolution,!n.isRoot),this.adaptor.startRenderPass(n,t,r,u),i&&this.onRenderTargetChange.emit(n),n}clear(e,t=U.ALL,r){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,r,this.viewport))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(e,t=U.ALL,r,s){const n=this.bind(e,t,r,s);return this._renderTargetStack.push({renderTarget:n,frame:s}),n}pop(){this._renderTargetStack.pop();const e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,!1,null,e.frame)}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,r,s,n){r.x<0&&(s.width+=r.x,n.x-=r.x,r.x=0),r.y<0&&(s.height+=r.y,n.y-=r.y,r.y=0);const{pixelWidth:i,pixelHeight:l}=e;return s.width=Math.min(s.width,i-r.x),s.height=Math.min(s.height,l-r.y),this.adaptor.copyToTexture(e,t,r,s,n)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((e,t)=>{e!==t&&e.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(e){let t=null;return I.test(e)&&(e=ke(e).source),e instanceof G?t=e:e instanceof T&&(t=new G({colorTextures:[e]}),I.test(e.source.resource)&&(t.isRoot=!0),e.once("destroy",()=>{t.destroy(),this._renderSurfaceToRenderTargetHash.delete(e);const r=this._gpuRenderTargetHash[t.uid];r&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(r))})),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}}class Lt extends qe{constructor({buffer:e,offset:t,size:r}){super(),this.uid=S("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=S("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=e,this.offset=t|0,this.size=r,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=S("resource"),this.emit("change",this)}destroy(e=!1){this.destroyed=!0,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null}}class Se{constructor(e){this._renderer=e}updateRenderable(){}destroyRenderable(){}validateRenderable(){return!1}addRenderable(e,t){this._renderer.renderPipes.batch.break(t),t.add(e)}execute(e){e.isRenderable&&e.render(this._renderer)}destroy(){this._renderer=null}}Se.extension={type:[d.WebGLPipes,d.WebGPUPipes,d.CanvasPipes],name:"customRender"};function D(a,e){const t=a.instructionSet,r=t.instructions;for(let s=0;s<t.instructionSize;s++){const n=r[s];e[n.renderPipeId].execute(n)}}const ft=new v;class we{constructor(e){this._renderer=e}addRenderGroup(e,t){e.isCachedAsTexture?this._addRenderableCacheAsTexture(e,t):this._addRenderableDirect(e,t)}execute(e){e.isRenderable&&(e.isCachedAsTexture?this._executeCacheAsTexture(e):this._executeDirect(e))}destroy(){this._renderer=null}_addRenderableDirect(e,t){this._renderer.renderPipes.batch.break(t),e._batchableRenderGroup&&(g.return(e._batchableRenderGroup),e._batchableRenderGroup=null),t.add(e)}_addRenderableCacheAsTexture(e,t){const r=e._batchableRenderGroup??(e._batchableRenderGroup=g.get(me));r.renderable=e.root,r.transform=e.root.relativeGroupTransform,r.texture=e.texture,r.bounds=e._textureBounds,t.add(e),this._renderer.renderPipes.batch.addToBatch(r,t)}_executeCacheAsTexture(e){if(e.textureNeedsUpdate){e.textureNeedsUpdate=!1;const t=ft.identity().translate(-e._textureBounds.x,-e._textureBounds.y);this._renderer.renderTarget.push(e.texture,!0,null,e.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:t,worldColor:4294967295}),D(e,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop()}e._batchableRenderGroup._batcher.updateElement(e._batchableRenderGroup),e._batchableRenderGroup._batcher.geometry.buffers[0].update()}_executeDirect(e){this._renderer.globalUniforms.push({worldTransformMatrix:e.inverseParentTextureTransform,worldColor:e.worldColorAlpha}),D(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop()}}we.extension={type:[d.WebGLPipes,d.WebGPUPipes,d.CanvasPipes],name:"renderGroup"};function E(a,e){e||(e=0);for(let t=e;t<a.length&&a[t];t++)a[t]=null}const pt=new P,Z=ce|de|ue;function Pe(a,e=!1){mt(a);const t=a.childrenToUpdate,r=a.updateTick++;for(const s in t){const n=Number(s),i=t[s],l=i.list,o=i.index;for(let u=0;u<o;u++){const c=l[u];c.parentRenderGroup===a&&c.relativeRenderGroupDepth===n&&Re(c,r,0)}E(l,o),i.index=0}if(e)for(let s=0;s<a.renderGroupChildren.length;s++)Pe(a.renderGroupChildren[s],e)}function mt(a){const e=a.root;let t;if(a.renderGroupParent){const r=a.renderGroupParent;a.worldTransform.appendFrom(e.relativeGroupTransform,r.worldTransform),a.worldColor=le(e.groupColor,r.worldColor),t=e.groupAlpha*r.worldAlpha}else a.worldTransform.copyFrom(e.localTransform),a.worldColor=e.localColor,t=e.localAlpha;t=t<0?0:t>1?1:t,a.worldAlpha=t,a.worldColorAlpha=a.worldColor+((t*255|0)<<24)}function Re(a,e,t){if(e===a.updateTick)return;a.updateTick=e,a.didChange=!1;const r=a.localTransform;a.updateLocalTransform();const s=a.parent;if(s&&!s.renderGroup?(t|=a._updateFlags,a.relativeGroupTransform.appendFrom(r,s.relativeGroupTransform),t&Z&&ee(a,s,t)):(t=a._updateFlags,a.relativeGroupTransform.copyFrom(r),t&Z&&ee(a,pt,t)),!a.renderGroup){const n=a.children,i=n.length;for(let u=0;u<i;u++)Re(n[u],e,t);const l=a.parentRenderGroup,o=a;o.renderPipeId&&!l.structureDidChange&&l.updateRenderable(o)}}function ee(a,e,t){if(t&de){a.groupColor=le(a.localColor,e.groupColor);let r=a.localAlpha*e.groupAlpha;r=r<0?0:r>1?1:r,a.groupAlpha=r,a.groupColorAlpha=a.groupColor+((r*255|0)<<24)}t&ue&&(a.groupBlendMode=a.localBlendMode==="inherit"?e.groupBlendMode:a.localBlendMode),t&ce&&(a.globalDisplayStatus=a.localDisplayStatus&e.globalDisplayStatus),a._updateFlags=0}function vt(a,e){const{list:t,index:r}=a.childrenRenderablesToUpdate;let s=!1;for(let n=0;n<r;n++){const i=t[n];if(s=e[i.renderPipeId].validateRenderable(i),s)break}return a.structureDidChange=s,s}const gt=new v;class Be{constructor(e){this._renderer=e}render({container:e,transform:t}){const r=e.parent,s=e.renderGroup.renderGroupParent;e.parent=null,e.renderGroup.renderGroupParent=null;const n=this._renderer;let i=gt;t&&(i=i.copyFrom(e.renderGroup.localTransform),e.renderGroup.localTransform.copyFrom(t));const l=n.renderPipes;this._updateCachedRenderGroups(e.renderGroup,null),this._updateRenderGroups(e.renderGroup),n.globalUniforms.start({worldTransformMatrix:t?e.renderGroup.localTransform:e.renderGroup.worldTransform,worldColor:e.renderGroup.worldColorAlpha}),D(e.renderGroup,l),l.uniformBatch&&l.uniformBatch.renderEnd(),t&&e.renderGroup.localTransform.copyFrom(i),e.parent=r,e.renderGroup.renderGroupParent=s}destroy(){this._renderer=null}_updateCachedRenderGroups(e,t){if(e.isCachedAsTexture){if(!e.updateCacheTexture)return;t=e}e._parentCacheAsTextureRenderGroup=t;for(let r=e.renderGroupChildren.length-1;r>=0;r--)this._updateCachedRenderGroups(e.renderGroupChildren[r],t);if(e.invalidateMatrices(),e.isCachedAsTexture){if(e.textureNeedsUpdate){const r=e.root.getLocalBounds();r.ceil();const s=e.texture;e.texture&&y.returnTexture(e.texture);const n=this._renderer,i=e.textureOptions.resolution||n.view.resolution,l=e.textureOptions.antialias??n.view.antialias;e.texture=y.getOptimalTexture(r.width,r.height,i,l),e._textureBounds||(e._textureBounds=new H),e._textureBounds.copyFrom(r),s!==e.texture&&e.renderGroupParent&&(e.renderGroupParent.structureDidChange=!0)}}else e.texture&&(y.returnTexture(e.texture),e.texture=null)}_updateRenderGroups(e){const t=this._renderer,r=t.renderPipes;if(e.runOnRender(),e.instructionSet.renderPipes=r,e.structureDidChange?E(e.childrenRenderablesToUpdate.list,0):vt(e,r),Pe(e),e.structureDidChange?(e.structureDidChange=!1,nt(e,t)):this._updateRenderables(e),e.childrenRenderablesToUpdate.index=0,t.renderPipes.batch.upload(e.instructionSet),!(e.isCachedAsTexture&&!e.textureNeedsUpdate))for(let s=0;s<e.renderGroupChildren.length;s++)this._updateRenderGroups(e.renderGroupChildren[s])}_updateRenderables(e){const{list:t,index:r}=e.childrenRenderablesToUpdate;for(let s=0;s<r;s++){const n=t[s];n.didViewUpdate&&e.updateRenderable(n)}E(t,r)}}Be.extension={type:[d.WebGLSystem,d.WebGPUSystem,d.CanvasSystem],name:"renderGroup"};class Ue{constructor(e){this._gpuSpriteHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuSpriteHash")}addRenderable(e,t){const r=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,r),this._renderer.renderPipes.batch.addToBatch(r,t)}updateRenderable(e){const t=this._gpuSpriteHash[e.uid];e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t)}validateRenderable(e){const t=this._getGpuSprite(e);return!t._batcher.checkAndUpdateTexture(t,e._texture)}destroyRenderable(e){const t=this._gpuSpriteHash[e.uid];g.return(t),this._gpuSpriteHash[e.uid]=null,e.off("destroyed",this._destroyRenderableBound)}_updateBatchableSprite(e,t){t.bounds=e.visualBounds,t.texture=e._texture}_getGpuSprite(e){return this._gpuSpriteHash[e.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=g.get(me);return t.renderable=e,t.transform=e.groupTransform,t.texture=e._texture,t.bounds=e.visualBounds,t.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuSpriteHash[e.uid]=t,e.on("destroyed",this._destroyRenderableBound),t}destroy(){for(const e in this._gpuSpriteHash)g.return(this._gpuSpriteHash[e]);this._gpuSpriteHash=null,this._renderer=null}}Ue.extension={type:[d.WebGLPipes,d.WebGPUPipes,d.CanvasPipes],name:"sprite"};const z=class Ie{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new he(0),this.color=this._backgroundColor,this.alpha=1}init(e){e={...Ie.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha)}get color(){return this._backgroundColor}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};z.extension={type:[d.WebGLSystem,d.WebGPUSystem,d.CanvasSystem],name:"background",priority:0};z.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let xt=z;const k={};O.handle(d.BlendMode,a=>{if(!a.name)throw new Error("BlendMode extension must have a name property");k[a.name]=a.ref},a=>{delete k[a.name]});class Ae{constructor(e){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=e}setBlendMode(e,t,r){if(this._activeBlendMode===t){this._isAdvanced&&this._renderableList.push(e);return}this._activeBlendMode=t,this._isAdvanced&&this._endAdvancedBlendMode(r),this._isAdvanced=!!k[t],this._isAdvanced&&(this._beginAdvancedBlendMode(r),this._renderableList.push(e))}_beginAdvancedBlendMode(e){this._renderer.renderPipes.batch.break(e);const t=this._activeBlendMode;if(!k[t]){oe(`Unable to assign BlendMode: '${t}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let r=this._filterHash[t];r||(r=this._filterHash[t]=new ie,r.filters=[new k[t]]);const s={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:r,canBundle:!1};this._renderableList=s.renderables,e.add(s)}_endAdvancedBlendMode(e){this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e)}destroy(){this._renderer=null,this._renderableList=null;for(const e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null}}Ae.extension={type:[d.WebGLPipes,d.WebGPUPipes,d.CanvasPipes],name:"blendMode"};const B={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},W=class Ge{constructor(e){this._renderer=e}_normalizeOptions(e,t={}){return e instanceof P||e instanceof m?{target:e,...t}:{...t,...e}}async image(e){const t=new Image;return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,Ge.defaultImageOptions);const{format:t,quality:r}=e,s=this.canvas(e);if(s.toBlob!==void 0)return new Promise((n,i)=>{s.toBlob(l=>{if(!l){i(new Error("ICanvas.toBlob failed!"));return}const o=new FileReader;o.onload=()=>n(o.result),o.onerror=i,o.readAsDataURL(l)},B[t],r)});if(s.toDataURL!==void 0)return s.toDataURL(B[t],r);if(s.convertToBlob!==void 0){const n=await s.convertToBlob({type:B[t],quality:r});return new Promise((i,l)=>{const o=new FileReader;o.onload=()=>i(o.result),o.onerror=l,o.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){e=this._normalizeOptions(e);const t=e.target,r=this._renderer;if(t instanceof m)return r.texture.generateCanvas(t);const s=r.textureGenerator.generateTexture(e),n=r.texture.generateCanvas(s);return s.destroy(!0),n}pixels(e){e=this._normalizeOptions(e);const t=e.target,r=this._renderer,s=t instanceof m?t:r.textureGenerator.generateTexture(e),n=r.texture.getPixels(s);return t instanceof P&&s.destroy(!0),n}texture(e){return e=this._normalizeOptions(e),e.target instanceof m?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);const t=this.canvas(e),r=document.createElement("a");r.download=e.filename??"image.png",r.href=t.toDataURL("image/png"),document.body.appendChild(r),r.click(),document.body.removeChild(r)}log(e){const t=e.width??200;e=this._normalizeOptions(e);const r=this.canvas(e),s=r.toDataURL();console.log(`[Pixi Texture] ${r.width}px ${r.height}px`);const n=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${s}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n)}destroy(){this._renderer=null}};W.extension={type:[d.WebGLSystem,d.WebGPUSystem],name:"extract"};W.defaultImageOptions={format:"png",quality:1};let _t=W;class V extends m{static create(e){return new V({source:new T(e)})}resize(e,t,r){return this.source.resize(e,t,r),this}}const bt=new w,yt=new H,Tt=[0,0,0,0];class De{constructor(e){this._renderer=e}generateTexture(e){e instanceof P&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});const t=e.resolution||this._renderer.resolution,r=e.antialias||this._renderer.view.antialias,s=e.target;let n=e.clearColor;n?n=Array.isArray(n)&&n.length===4?n:he.shared.setValue(n).toArray():n=Tt;const i=e.frame?.copyTo(bt)||Ke(s,yt).rectangle;i.width=Math.max(i.width,1/t)|0,i.height=Math.max(i.height,1/t)|0;const l=V.create({...e.textureSourceOptions,width:i.width,height:i.height,resolution:t,antialias:r}),o=v.shared.translate(-i.x,-i.y);return this._renderer.render({container:s,transform:o,target:l,clearColor:n}),l.source.updateMipmaps(),l}destroy(){this._renderer=null}}De.extension={type:[d.WebGLSystem,d.WebGPUSystem],name:"textureGenerator"};class Ee{constructor(e){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=e}reset(){this._stackIndex=0;for(let e=0;e<this._activeUniforms.length;e++)this._uniformsPool.push(this._activeUniforms[e]);for(let e=0;e<this._activeBindGroups.length;e++)this._bindGroupPool.push(this._activeBindGroups[e]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(e){this.reset(),this.push(e)}bind({size:e,projectionMatrix:t,worldTransformMatrix:r,worldColor:s,offset:n}){const i=this._renderer.renderTarget.renderTarget,l=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:i,worldTransformMatrix:new v,worldColor:4294967295,offset:new Ye},o={projectionMatrix:t||this._renderer.renderTarget.projectionMatrix,resolution:e||i.size,worldTransformMatrix:r||l.worldTransformMatrix,worldColor:s||l.worldColor,offset:n||l.offset,bindGroup:null},u=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(u);const c=u.uniforms;c.uProjectionMatrix=o.projectionMatrix,c.uResolution=o.resolution,c.uWorldTransformMatrix.copyFrom(o.worldTransformMatrix),c.uWorldTransformMatrix.tx-=o.offset.x,c.uWorldTransformMatrix.ty-=o.offset.y,et(o.worldColor,c.uWorldColorAlpha,0),u.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(u,!1):(h=this._bindGroupPool.pop()||new Je,this._activeBindGroups.push(h),h.setResource(u,0)),o.bindGroup=h,this._currentGlobalUniformData=o}push(e){this.bind(e),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===F.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new ae({uProjectionMatrix:{value:new v,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new v,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}Ee.extension={type:[d.WebGLSystem,d.WebGPUSystem,d.CanvasSystem],name:"globalUniforms"};let kt=1;class Oe{constructor(){this._tasks=[],this._offset=0}init(){J.system.add(this._update,this)}repeat(e,t,r=!0){const s=kt++;let n=0;return r&&(this._offset+=1e3,n=this._offset),this._tasks.push({func:e,duration:t,start:performance.now(),offset:n,last:performance.now(),repeat:!0,id:s}),s}cancel(e){for(let t=0;t<this._tasks.length;t++)if(this._tasks[t].id===e){this._tasks.splice(t,1);return}}_update(){const e=performance.now();for(let t=0;t<this._tasks.length;t++){const r=this._tasks[t];if(e-r.offset-r.last>=r.duration){const s=e-r.start;r.func(s),r.last=e}}}destroy(){J.system.remove(this._update,this),this._tasks.length=0}}Oe.extension={type:[d.WebGLSystem,d.WebGPUSystem,d.CanvasSystem],name:"scheduler",priority:0};let te=!1;function Ct(a){if(!te){if(fe.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const e=[`%c %c %c %c %c PixiJS %c v${X} (${a}) http://www.pixijs.com/
|
||||||
|
|
||||||
|
`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e)}else globalThis.console&&globalThis.console.log(`PixiJS ${X} - ${a} - http://www.pixijs.com/`);te=!0}}class N{constructor(e){this._renderer=e}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===F.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),Ct(t)}}}N.extension={type:[d.WebGLSystem,d.WebGPUSystem,d.CanvasSystem],name:"hello",priority:-2};N.defaultOptions={hello:!1};function Mt(a){let e=!1;for(const r in a)if(a[r]==null){e=!0;break}if(!e)return a;const t=Object.create(null);for(const r in a){const s=a[r];s&&(t[r]=s)}return t}function St(a){let e=0;for(let t=0;t<a.length;t++)a[t]==null?e++:a[t-e]=a[t];return a.length-=e,a}const j=class Fe{constructor(e){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=e}init(e){e={...Fe.defaultOptions,...e},this.maxUnusedTime=e.renderableGCMaxUnusedTime,this._frequency=e.renderableGCFrequency,this.enabled=e.renderableGCActive}get enabled(){return!!this._handler}set enabled(e){this.enabled!==e&&(e?(this._handler=this._renderer.scheduler.repeat(()=>this.run(),this._frequency,!1),this._hashHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedHashes)t.context[t.hash]=Mt(t.context[t.hash])},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedArrays)St(t.context[t.hash])},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._hashHandler),this._renderer.scheduler.cancel(this._arrayHandler)))}addManagedHash(e,t){this._managedHashes.push({context:e,hash:t})}addManagedArray(e,t){this._managedArrays.push({context:e,hash:t})}prerender(){this._now=performance.now()}addRenderable(e,t){this.enabled&&(e._lastUsed=this._now,e._lastInstructionTick===-1&&(this._managedRenderables.push(e),e.once("destroyed",this._removeRenderable,this)),e._lastInstructionTick=t.tick)}run(){const e=performance.now(),t=this._managedRenderables,r=this._renderer.renderPipes;let s=0;for(let n=0;n<t.length;n++){const i=t[n];if(i===null){s++;continue}const o=(i.renderGroup??i.parentRenderGroup)?.instructionSet?.tick??-1;i._lastInstructionTick!==o&&e-i._lastUsed>this.maxUnusedTime?(i.destroyed||r[i.renderPipeId].destroyRenderable(i),i._lastInstructionTick=-1,s++,i.off("destroyed",this._removeRenderable,this)):t[n-s]=i}t.length-=s}destroy(){this.enabled=!1,this._renderer=null,this._managedRenderables.length=0,this._managedHashes.length=0,this._managedArrays.length=0}_removeRenderable(e){const t=this._managedRenderables.indexOf(e);t>=0&&(e.off("destroyed",this._removeRenderable,this),this._managedRenderables[t]=null)}};j.extension={type:[d.WebGLSystem,d.WebGPUSystem],name:"renderableGC",priority:0};j.defaultOptions={renderableGCActive:!0,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};let wt=j;const $=class He{constructor(e){this._renderer=e,this.count=0,this.checkCount=0}init(e){e={...He.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle??e.textureGCMaxIdle,this.active=e.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this._renderer.texture.managedTextures;for(let t=0;t<e.length;t++){const r=e[t];r.autoGarbageCollect&&r.resource&&r._touched>-1&&this.count-r._touched>this.maxIdle&&(r._touched=-1,r.unload())}}destroy(){this._renderer=null}};$.extension={type:[d.WebGLSystem,d.WebGPUSystem],name:"textureGC"};$.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:null,textureGCMaxIdle:60*60,textureGCCheckCountMax:600};let Pt=$;const q=class Le{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(e){this.texture.source.autoDensity=e}get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e)}init(e){e={...Le.defaultOptions,...e},e.view&&(Xe(Qe,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new w(0,0,e.width,e.height),this.canvas=e.canvas||fe.get().createCanvas(),this.antialias=!!e.antialias,this.texture=ke(this.canvas,e),this.renderTarget=new G({colorTextures:[this.texture],depth:!!e.depth,isRoot:!0}),this.texture.source.transparent=e.backgroundAlpha<1,this.resolution=e.resolution}resize(e,t,r){this.texture.source.resize(e,t,r),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height}destroy(e=!1){(typeof e=="boolean"?e:!!e?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}};q.extension={type:[d.WebGLSystem,d.WebGPUSystem,d.CanvasSystem],name:"view",priority:0};q.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};let Rt=q;const zt=[xt,Ee,N,Rt,Be,Pt,De,_t,Ze,wt,Oe],Wt=[Ae,xe,Ue,we,be,Te,ye,Se];export{Lt as B,_ as G,Ht as R,zt as S,Et as U,Wt as a,ut as b,Ot as c,M as d,Dt as e,Gt as f,At as t,Ft as u};
|
||||||
@@ -1,311 +0,0 @@
|
|||||||
import{m as Re,M as g,o as Be,p as Ue,E as u,q as b,s as Ae,t as q,F as K,v as Ie,k as m,S as p,h as B,w as Y,x as Fe,c as H,B as k,i as U,u as C,j as _,R as w,y as Ee,a as De,C as S,z as Oe,G as ze,H as He,I as J,e as X,J as Le,P as We,d as Ve,D as Q,K as je,L as $e,N as Ne,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";import{b as qe,S as Z,G as ee,f as te,U as re,T as L,h as W,B as Ke,i as Ye,R as se,__tla as __tla_1}from"./colorToUniform-rMRo2qOn.js";let Ut,T,Bt,At,Pt,It,nt,Gt,M,St,wt,Ct,Rt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})()]).then(async()=>{const ae=class A extends qe{constructor(e){e={...A.defaultOptions,...e},super(e),this.enabled=!0,this._state=Z.for2d(),this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.addResource("uTexture",0,1)}apply(e,t,r,a){e.applyFilter(this,t,r,a)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:t,gl:r,...a}=e;let n,i;return t&&(n=ee.from(t)),r&&(i=te.from(r)),new A({gpuProgram:n,glProgram:i,...a})}};ae.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1};let Je=ae;var Xe=`in vec2 vMaskCoord;
|
|
||||||
in vec2 vTextureCoord;
|
|
||||||
|
|
||||||
uniform sampler2D uTexture;
|
|
||||||
uniform sampler2D uMaskTexture;
|
|
||||||
|
|
||||||
uniform float uAlpha;
|
|
||||||
uniform vec4 uMaskClamp;
|
|
||||||
|
|
||||||
out vec4 finalColor;
|
|
||||||
|
|
||||||
void main(void)
|
|
||||||
{
|
|
||||||
float clip = step(3.5,
|
|
||||||
step(uMaskClamp.x, vMaskCoord.x) +
|
|
||||||
step(uMaskClamp.y, vMaskCoord.y) +
|
|
||||||
step(vMaskCoord.x, uMaskClamp.z) +
|
|
||||||
step(vMaskCoord.y, uMaskClamp.w));
|
|
||||||
|
|
||||||
// TODO look into why this is needed
|
|
||||||
float npmAlpha = uAlpha;
|
|
||||||
vec4 original = texture(uTexture, vTextureCoord);
|
|
||||||
vec4 masky = texture(uMaskTexture, vMaskCoord);
|
|
||||||
float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
|
|
||||||
|
|
||||||
original *= (alphaMul * masky.r * uAlpha * clip);
|
|
||||||
|
|
||||||
finalColor = original;
|
|
||||||
}
|
|
||||||
`,Qe=`in vec2 aPosition;
|
|
||||||
|
|
||||||
out vec2 vTextureCoord;
|
|
||||||
out vec2 vMaskCoord;
|
|
||||||
|
|
||||||
|
|
||||||
uniform vec4 uInputSize;
|
|
||||||
uniform vec4 uOutputFrame;
|
|
||||||
uniform vec4 uOutputTexture;
|
|
||||||
uniform mat3 uFilterMatrix;
|
|
||||||
|
|
||||||
vec4 filterVertexPosition( vec2 aPosition )
|
|
||||||
{
|
|
||||||
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
||||||
|
|
||||||
position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;
|
|
||||||
position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;
|
|
||||||
|
|
||||||
return vec4(position, 0.0, 1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec2 filterTextureCoord( vec2 aPosition )
|
|
||||||
{
|
|
||||||
return aPosition * (uOutputFrame.zw * uInputSize.zw);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec2 getFilterCoord( vec2 aPosition )
|
|
||||||
{
|
|
||||||
return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;
|
|
||||||
}
|
|
||||||
|
|
||||||
void main(void)
|
|
||||||
{
|
|
||||||
gl_Position = filterVertexPosition(aPosition);
|
|
||||||
vTextureCoord = filterTextureCoord(aPosition);
|
|
||||||
vMaskCoord = getFilterCoord(aPosition);
|
|
||||||
}
|
|
||||||
`,V=`struct GlobalFilterUniforms {
|
|
||||||
uInputSize:vec4<f32>,
|
|
||||||
uInputPixel:vec4<f32>,
|
|
||||||
uInputClamp:vec4<f32>,
|
|
||||||
uOutputFrame:vec4<f32>,
|
|
||||||
uGlobalFrame:vec4<f32>,
|
|
||||||
uOutputTexture:vec4<f32>,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct MaskUniforms {
|
|
||||||
uFilterMatrix:mat3x3<f32>,
|
|
||||||
uMaskClamp:vec4<f32>,
|
|
||||||
uAlpha:f32,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;
|
|
||||||
@group(0) @binding(1) var uTexture: texture_2d<f32>;
|
|
||||||
@group(0) @binding(2) var uSampler : sampler;
|
|
||||||
|
|
||||||
@group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms;
|
|
||||||
@group(1) @binding(1) var uMaskTexture: texture_2d<f32>;
|
|
||||||
|
|
||||||
struct VSOutput {
|
|
||||||
@builtin(position) position: vec4<f32>,
|
|
||||||
@location(0) uv : vec2<f32>,
|
|
||||||
@location(1) filterUv : vec2<f32>,
|
|
||||||
};
|
|
||||||
|
|
||||||
fn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>
|
|
||||||
{
|
|
||||||
var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;
|
|
||||||
|
|
||||||
position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;
|
|
||||||
position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;
|
|
||||||
|
|
||||||
return vec4(position, 0.0, 1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
|
|
||||||
{
|
|
||||||
return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
|
|
||||||
{
|
|
||||||
return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>
|
|
||||||
{
|
|
||||||
return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn getSize() -> vec2<f32>
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
return gfu.uGlobalFrame.zw;
|
|
||||||
}
|
|
||||||
|
|
||||||
@vertex
|
|
||||||
fn mainVertex(
|
|
||||||
@location(0) aPosition : vec2<f32>,
|
|
||||||
) -> VSOutput {
|
|
||||||
return VSOutput(
|
|
||||||
filterVertexPosition(aPosition),
|
|
||||||
filterTextureCoord(aPosition),
|
|
||||||
getFilterCoord(aPosition)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@fragment
|
|
||||||
fn mainFragment(
|
|
||||||
@location(0) uv: vec2<f32>,
|
|
||||||
@location(1) filterUv: vec2<f32>,
|
|
||||||
@builtin(position) position: vec4<f32>
|
|
||||||
) -> @location(0) vec4<f32> {
|
|
||||||
|
|
||||||
var maskClamp = filterUniforms.uMaskClamp;
|
|
||||||
|
|
||||||
var clip = step(3.5,
|
|
||||||
step(maskClamp.x, filterUv.x) +
|
|
||||||
step(maskClamp.y, filterUv.y) +
|
|
||||||
step(filterUv.x, maskClamp.z) +
|
|
||||||
step(filterUv.y, maskClamp.w));
|
|
||||||
|
|
||||||
var mask = textureSample(uMaskTexture, uSampler, filterUv);
|
|
||||||
var source = textureSample(uTexture, uSampler, uv);
|
|
||||||
|
|
||||||
var npmAlpha = 0.0;
|
|
||||||
|
|
||||||
var alphaMul = 1.0 - npmAlpha * (1.0 - mask.a);
|
|
||||||
|
|
||||||
var a = (alphaMul * mask.r) * clip;
|
|
||||||
|
|
||||||
return vec4(source.rgb, source.a) * a;
|
|
||||||
}`;class Ze extends Je{constructor(e){const{sprite:t,...r}=e,a=new Re(t.texture),n=new re({uFilterMatrix:{value:new g,type:"mat3x3<f32>"},uMaskClamp:{value:a.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"}}),i=ee.from({vertex:{source:V,entryPoint:"mainVertex"},fragment:{source:V,entryPoint:"mainFragment"}}),l=te.from({vertex:Qe,fragment:Xe,name:"mask-filter"});super({...r,gpuProgram:i,glProgram:l,resources:{filterUniforms:n,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=a}apply(e,t,r,a){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,r,a)}}class ne{constructor(e,t){this.state=Z.for2d(),this._batches=Object.create(null),this._geometries=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init(this)}buildStart(e){if(!this._batches[e.uid]){const t=new Be;this._batches[e.uid]=t,this._geometries[t.uid]=new Ue}this._activeBatch=this._batches[e.uid],this._activeGeometry=this._geometries[this._activeBatch.uid],this._activeBatch.begin()}addToBatch(e){this._activeBatch.add(e)}break(e){this._activeBatch.break(e)}buildEnd(e){const t=this._activeBatch,r=this._activeGeometry;t.finish(e),r.indexBuffer.setDataWithSize(t.indexBuffer,t.indexSize,!0),r.buffers[0].setDataWithSize(t.attributeBuffer.float32View,t.attributeSize,!1)}upload(e){const t=this._batches[e.uid],r=this._geometries[t.uid];t.dirty&&(t.dirty=!1,r.buffers[0].update(t.attributeSize*4))}execute(e){if(e.action==="startBatch"){const t=e.batcher,r=this._geometries[t.uid];this._adaptor.start(this,r)}this._adaptor.execute(this,e)}destroy(){this.state=null,this.renderer=null,this._adaptor.destroy(),this._adaptor=null;for(const e in this._batches)this._batches[e].destroy();this._batches=null;for(const e in this._geometries)this._geometries[e].destroy();this._geometries=null}}ne.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"batch"};Ct={name:"texture-bit",vertex:{header:`
|
|
||||||
|
|
||||||
struct TextureUniforms {
|
|
||||||
uTextureMatrix:mat3x3<f32>,
|
|
||||||
}
|
|
||||||
|
|
||||||
@group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;
|
|
||||||
`,main:`
|
|
||||||
uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;
|
|
||||||
`},fragment:{header:`
|
|
||||||
@group(2) @binding(0) var uTexture: texture_2d<f32>;
|
|
||||||
@group(2) @binding(1) var uSampler: sampler;
|
|
||||||
|
|
||||||
|
|
||||||
`,main:`
|
|
||||||
outColor = textureSample(uTexture, uSampler, vUV);
|
|
||||||
`}};wt={name:"texture-bit",vertex:{header:`
|
|
||||||
uniform mat3 uTextureMatrix;
|
|
||||||
`,main:`
|
|
||||||
uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
|
|
||||||
`},fragment:{header:`
|
|
||||||
uniform sampler2D uTexture;
|
|
||||||
|
|
||||||
|
|
||||||
`,main:`
|
|
||||||
outColor = texture(uTexture, vUV);
|
|
||||||
`}};function et(s,e){const t=s.root,r=s.instructionSet;r.reset(),e.batch.buildStart(r),e.blendMode.buildStart(),e.colorMask.buildStart(),t.sortableChildren&&t.sortChildren(),ie(t,r,e,!0),e.batch.buildEnd(r),e.blendMode.buildEnd(r)}function P(s,e,t){s.globalDisplayStatus<7||!s.includeInBuild||(s.sortableChildren&&s.sortChildren(),s.isSimple?tt(s,e,t):ie(s,e,t,!1))}function tt(s,e,t){if(s.renderPipeId&&(t.blendMode.setBlendMode(s,s.groupBlendMode,e),s.didViewUpdate=!1,t[s.renderPipeId].addRenderable(s,e)),!s.renderGroup){const r=s.children,a=r.length;for(let n=0;n<a;n++)P(r[n],e,t)}}function ie(s,e,t,r){if(!r&&s.renderGroup)t.renderGroup.addRenderGroup(s.renderGroup,e);else{for(let i=0;i<s.effects.length;i++){const l=s.effects[i];t[l.pipe].push(l,s,e)}const a=s.renderPipeId;a&&(t.blendMode.setBlendMode(s,s.groupBlendMode,e),s.didViewUpdate=!1,t[a].addRenderable(s,e));const n=s.children;if(n.length)for(let i=0;i<n.length;i++)P(n[i],e,t);for(let i=s.effects.length-1;i>=0;i--){const l=s.effects[i];t[l.pipe].pop(l,s,e)}}}const rt=new q;class st extends K{constructor(){super(),this.filters=[new Ze({sprite:new Ie(m.EMPTY)})]}get sprite(){return this.filters[0].sprite}set sprite(e){this.filters[0].sprite=e}}class oe{constructor(e){this._activeMaskStage=[],this._renderer=e}push(e,t,r){const a=this._renderer;if(a.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:e,canBundle:!1,maskedContainer:t}),e.renderMaskToTexture){const n=e.mask;n.includeInBuild=!0,P(n,r,a.renderPipes),n.includeInBuild=!1}a.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:e,maskedContainer:t,canBundle:!1})}pop(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:e,canBundle:!1})}execute(e){const t=this._renderer,r=e.mask.renderMaskToTexture;if(e.action==="pushMaskBegin"){const a=b.get(st);if(r){e.mask.mask.measurable=!0;const n=Ae(e.mask.mask,!0,rt);e.mask.mask.measurable=!1,n.ceil();const i=L.getOptimalTexture(n.width,n.height,1,!1);t.renderTarget.push(i,!0),t.globalUniforms.push({offset:n,worldColor:4294967295});const l=a.sprite;l.texture=i,l.worldTransform.tx=n.minX,l.worldTransform.ty=n.minY,this._activeMaskStage.push({filterEffect:a,maskedContainer:e.maskedContainer,filterTexture:i})}else a.sprite=e.mask.mask,this._activeMaskStage.push({filterEffect:a,maskedContainer:e.maskedContainer})}else if(e.action==="pushMaskEnd"){const a=this._activeMaskStage[this._activeMaskStage.length-1];r&&(t.renderTarget.pop(),t.globalUniforms.pop()),t.filter.push({renderPipeId:"filter",action:"pushFilter",container:a.maskedContainer,filterEffect:a.filterEffect,canBundle:!1})}else if(e.action==="popMaskEnd"){t.filter.pop();const a=this._activeMaskStage.pop();r&&L.returnTexture(a.filterTexture),b.return(a.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}}oe.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"alphaMask"};class le{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(e,t,r){this._renderer.renderPipes.batch.break(r);const n=this._colorStack;n[this._colorStackIndex]=n[this._colorStackIndex-1]&e.mask;const i=this._colorStack[this._colorStackIndex];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1})),this._colorStackIndex++}pop(e,t,r){this._renderer.renderPipes.batch.break(r);const n=this._colorStack;this._colorStackIndex--;const i=n[this._colorStackIndex-1];i!==this._currentColor&&(this._currentColor=i,r.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1}))}execute(e){this._renderer.colorMask.setMask(e.colorMask)}destroy(){this._colorStack=null}}le.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"colorMask"};class ue{constructor(e){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=e}push(e,t,r){var a;const n=e,i=this._renderer;i.renderPipes.batch.break(r),i.renderPipes.blendMode.setBlendMode(n.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,canBundle:!1});const l=n.mask;l.includeInBuild=!0,this._maskHash.has(n)||this._maskHash.set(n,{instructionsStart:0,instructionsLength:0});const o=this._maskHash.get(n);o.instructionsStart=r.instructionSize,P(l,r,i.renderPipes),l.includeInBuild=!1,i.renderPipes.batch.break(r),r.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:e,canBundle:!1});const d=r.instructionSize-o.instructionsStart-1;o.instructionsLength=d;const c=i.renderTarget.renderTarget.uid;(a=this._maskStackHash)[c]??(a[c]=0)}pop(e,t,r){const a=e,n=this._renderer;n.renderPipes.batch.break(r),n.renderPipes.blendMode.setBlendMode(a.mask,"none",r),r.add({renderPipeId:"stencilMask",action:"popMaskBegin",canBundle:!1});const i=this._maskHash.get(e);for(let l=0;l<i.instructionsLength;l++)r.instructions[r.instructionSize++]=r.instructions[i.instructionsStart++];r.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1})}execute(e){var t;const r=this._renderer,a=r.renderTarget.renderTarget.uid;let n=(t=this._maskStackHash)[a]??(t[a]=0);e.action==="pushMaskBegin"?(r.renderTarget.ensureDepthStencil(),r.stencil.setStencilMode(p.RENDERING_MASK_ADD,n),n++,r.colorMask.setMask(0)):e.action==="pushMaskEnd"?(r.stencil.setStencilMode(p.MASK_ACTIVE,n),r.colorMask.setMask(15)):e.action==="popMaskBegin"?(r.colorMask.setMask(0),n!==0?r.stencil.setStencilMode(p.RENDERING_MASK_REMOVE,n):(r.renderTarget.clear(null,B.STENCIL),r.stencil.setStencilMode(p.DISABLED,n)),n--):e.action==="popMaskEnd"&&(r.stencil.setStencilMode(p.MASK_ACTIVE,n),r.colorMask.setMask(15)),this._maskStackHash[a]=n}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null}}ue.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"stencilMask"};St=function(s,e){for(const t in s.attributes){const r=s.attributes[t],a=e[t];a?(r.location??(r.location=a.location),r.format??(r.format=a.format),r.offset??(r.offset=a.offset),r.instance??(r.instance=a.instance)):Y(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}at(s)};function at(s){const{buffers:e,attributes:t}=s,r={},a={};for(const n in e){const i=e[n];r[i.uid]=0,a[i.uid]=0}for(const n in t){const i=t[n];r[i.buffer.uid]+=W(i.format).stride}for(const n in t){const i=t[n];i.stride??(i.stride=r[i.buffer.uid]),i.start??(i.start=a[i.buffer.uid]),a[i.buffer.uid]+=W(i.format).stride}}T=[];T[p.NONE]=void 0;T[p.DISABLED]={stencilWriteMask:0,stencilReadMask:0};T[p.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};T[p.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};T[p.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};Pt=class{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck()}_systemCheck(){if(!Fe())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(e){const t=this.getUniformGroupData(e);e.buffer||(e.buffer=new H({data:new Float32Array(t.layout.size/4),usage:k.UNIFORM|k.COPY_DST}))}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){const t=e._signature;let r=this._syncFunctionHash[t];if(!r){const a=Object.keys(e.uniformStructures).map(l=>e.uniformStructures[l]),n=this._adaptor.createUboElements(a),i=this._generateUboSync(n.uboElements);r=this._syncFunctionHash[t]={layout:n,syncFunction:i}}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,r){const a=this.getUniformGroupData(e);return e.buffer||(e.buffer=new H({data:new Float32Array(a.layout.size/4),usage:k.UNIFORM|k.COPY_DST})),t||(t=e.buffer.data),r||(r=0),a.syncFunction(e.uniforms,t,r),!0}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return!1;e._dirtyId=0;const t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null}};M=[{type:"mat3x3<f32>",test:s=>s.value.a!==void 0,ubo:`
|
|
||||||
var matrix = uv[name].toArray(true);
|
|
||||||
data[offset] = matrix[0];
|
|
||||||
data[offset + 1] = matrix[1];
|
|
||||||
data[offset + 2] = matrix[2];
|
|
||||||
data[offset + 4] = matrix[3];
|
|
||||||
data[offset + 5] = matrix[4];
|
|
||||||
data[offset + 6] = matrix[5];
|
|
||||||
data[offset + 8] = matrix[6];
|
|
||||||
data[offset + 9] = matrix[7];
|
|
||||||
data[offset + 10] = matrix[8];
|
|
||||||
`,uniform:`
|
|
||||||
gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));
|
|
||||||
`},{type:"vec4<f32>",test:s=>s.type==="vec4<f32>"&&s.size===1&&s.value.width!==void 0,ubo:`
|
|
||||||
v = uv[name];
|
|
||||||
data[offset] = v.x;
|
|
||||||
data[offset + 1] = v.y;
|
|
||||||
data[offset + 2] = v.width;
|
|
||||||
data[offset + 3] = v.height;
|
|
||||||
`,uniform:`
|
|
||||||
cv = ud[name].value;
|
|
||||||
v = uv[name];
|
|
||||||
if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {
|
|
||||||
cv[0] = v.x;
|
|
||||||
cv[1] = v.y;
|
|
||||||
cv[2] = v.width;
|
|
||||||
cv[3] = v.height;
|
|
||||||
gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);
|
|
||||||
}
|
|
||||||
`},{type:"vec2<f32>",test:s=>s.type==="vec2<f32>"&&s.size===1&&s.value.x!==void 0,ubo:`
|
|
||||||
v = uv[name];
|
|
||||||
data[offset] = v.x;
|
|
||||||
data[offset + 1] = v.y;
|
|
||||||
`,uniform:`
|
|
||||||
cv = ud[name].value;
|
|
||||||
v = uv[name];
|
|
||||||
if (cv[0] !== v.x || cv[1] !== v.y) {
|
|
||||||
cv[0] = v.x;
|
|
||||||
cv[1] = v.y;
|
|
||||||
gl.uniform2f(ud[name].location, v.x, v.y);
|
|
||||||
}
|
|
||||||
`},{type:"vec4<f32>",test:s=>s.type==="vec4<f32>"&&s.size===1&&s.value.red!==void 0,ubo:`
|
|
||||||
v = uv[name];
|
|
||||||
data[offset] = v.red;
|
|
||||||
data[offset + 1] = v.green;
|
|
||||||
data[offset + 2] = v.blue;
|
|
||||||
data[offset + 3] = v.alpha;
|
|
||||||
`,uniform:`
|
|
||||||
cv = ud[name].value;
|
|
||||||
v = uv[name];
|
|
||||||
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {
|
|
||||||
cv[0] = v.red;
|
|
||||||
cv[1] = v.green;
|
|
||||||
cv[2] = v.blue;
|
|
||||||
cv[3] = v.alpha;
|
|
||||||
gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);
|
|
||||||
}
|
|
||||||
`},{type:"vec3<f32>",test:s=>s.type==="vec3<f32>"&&s.size===1&&s.value.red!==void 0,ubo:`
|
|
||||||
v = uv[name];
|
|
||||||
data[offset] = v.red;
|
|
||||||
data[offset + 1] = v.green;
|
|
||||||
data[offset + 2] = v.blue;
|
|
||||||
`,uniform:`
|
|
||||||
cv = ud[name].value;
|
|
||||||
v = uv[name];
|
|
||||||
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {
|
|
||||||
cv[0] = v.red;
|
|
||||||
cv[1] = v.green;
|
|
||||||
cv[2] = v.blue;
|
|
||||||
gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
|
|
||||||
}
|
|
||||||
`}];Gt=function(s,e,t,r){const a=[`
|
|
||||||
var v = null;
|
|
||||||
var v2 = null;
|
|
||||||
var t = 0;
|
|
||||||
var index = 0;
|
|
||||||
var name = null;
|
|
||||||
var arrayOffset = null;
|
|
||||||
`];let n=0;for(let l=0;l<s.length;l++){const o=s[l],d=o.data.name;let c=!1,h=0;for(let f=0;f<M.length;f++)if(M[f].test(o.data)){h=o.offset/4,a.push(`name = "${d}";`,`offset += ${h-n};`,M[f][e]||M[f].ubo),c=!0;break}if(!c)if(o.data.size>1)h=o.offset/4,a.push(t(o,h-n));else{const f=r[o.data.type];h=o.offset/4,a.push(`
|
|
||||||
v = uv.${d};
|
|
||||||
offset += ${h-n};
|
|
||||||
${f};
|
|
||||||
`)}n=h}const i=a.join(`
|
|
||||||
`);return new Function("uv","data","offset",i)};function x(s,e){return`
|
|
||||||
for (let i = 0; i < ${s*e}; i++) {
|
|
||||||
data[offset + (((i / ${s})|0) * 4) + (i % ${s})] = v[i];
|
|
||||||
}
|
|
||||||
`}nt={f32:`
|
|
||||||
data[offset] = v;`,i32:`
|
|
||||||
data[offset] = v;`,"vec2<f32>":`
|
|
||||||
data[offset] = v[0];
|
|
||||||
data[offset + 1] = v[1];`,"vec3<f32>":`
|
|
||||||
data[offset] = v[0];
|
|
||||||
data[offset + 1] = v[1];
|
|
||||||
data[offset + 2] = v[2];`,"vec4<f32>":`
|
|
||||||
data[offset] = v[0];
|
|
||||||
data[offset + 1] = v[1];
|
|
||||||
data[offset + 2] = v[2];
|
|
||||||
data[offset + 3] = v[3];`,"mat2x2<f32>":`
|
|
||||||
data[offset] = v[0];
|
|
||||||
data[offset + 1] = v[1];
|
|
||||||
data[offset + 4] = v[2];
|
|
||||||
data[offset + 5] = v[3];`,"mat3x3<f32>":`
|
|
||||||
data[offset] = v[0];
|
|
||||||
data[offset + 1] = v[1];
|
|
||||||
data[offset + 2] = v[2];
|
|
||||||
data[offset + 4] = v[3];
|
|
||||||
data[offset + 5] = v[4];
|
|
||||||
data[offset + 6] = v[5];
|
|
||||||
data[offset + 8] = v[6];
|
|
||||||
data[offset + 9] = v[7];
|
|
||||||
data[offset + 10] = v[8];`,"mat4x4<f32>":`
|
|
||||||
for (let i = 0; i < 16; i++) {
|
|
||||||
data[offset + i] = v[i];
|
|
||||||
}`,"mat3x2<f32>":x(3,2),"mat4x2<f32>":x(4,2),"mat2x3<f32>":x(2,3),"mat4x3<f32>":x(4,3),"mat2x4<f32>":x(2,4),"mat3x4<f32>":x(3,4)};Rt={...nt,"mat2x2<f32>":`
|
|
||||||
data[offset] = v[0];
|
|
||||||
data[offset + 1] = v[1];
|
|
||||||
data[offset + 2] = v[2];
|
|
||||||
data[offset + 3] = v[3];
|
|
||||||
`};function it(s,e,t,r,a,n){const i=n?1:-1;return s.identity(),s.a=1/r*2,s.d=i*(1/a*2),s.tx=-1-e*s.a,s.ty=-i-t*s.d,s}const v=new Map;function de(s,e){if(!v.has(s)){const t=new m({source:new U({resource:s,...e})}),r=()=>{v.get(s)===t&&v.delete(s)};t.once("destroy",r),t.source.once("destroy",r),v.set(s,t)}return v.get(s)}function ot(s){const e=s.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}const ce=class he{constructor(e={}){if(this.uid=C("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,e={...he.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,typeof e.colorTextures=="number"){this._managedColorTextures=!0;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new _({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}))}else{this.colorTextures=[...e.colorTextures.map(r=>r.source)];const t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof m||e.depthStencilTexture instanceof _?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){const e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new _({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(e,t,r=this.resolution,a=!1){this.dirtyId++,this.colorTextures.forEach((n,i)=>{a&&i===0||n.source.resize(e,t,r)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,r)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(e=>{e.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};ce.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};let I=ce;Bt=class{constructor(e){this.rootViewPort=new w,this.viewport=new w,this.onRenderTargetChange=new Ee("onRenderTargetChange"),this.projectionMatrix=new g,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:e,clear:t,clearColor:r,frame:a}){this._renderTargetStack.length=0,this.push(e,t,r,a),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=ot(this.rootRenderTarget)}bind(e,t=!0,r,a){const n=this.getRenderTarget(e),i=this.renderTarget!==n;this.renderTarget=n,this.renderSurface=e;const l=this.getGpuRenderTarget(n);(n.pixelWidth!==l.width||n.pixelHeight!==l.height)&&(this.adaptor.resizeGpuRenderTarget(n),l.width=n.pixelWidth,l.height=n.pixelHeight);const o=n.colorTexture,d=this.viewport,c=o.pixelWidth,h=o.pixelHeight;if(!a&&e instanceof m&&(a=e.frame),a){const f=o._resolution;d.x=a.x*f+.5|0,d.y=a.y*f+.5|0,d.width=a.width*f+.5|0,d.height=a.height*f+.5|0}else d.x=0,d.y=0,d.width=c,d.height=h;return it(this.projectionMatrix,0,0,d.width/o.resolution,d.height/o.resolution,!n.isRoot),this.adaptor.startRenderPass(n,t,r,d),i&&this.onRenderTargetChange.emit(n),n}clear(e,t=B.ALL,r){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,r,this.viewport))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(e,t=B.ALL,r,a){const n=this.bind(e,t,r,a);return this._renderTargetStack.push({renderTarget:n,frame:a}),n}pop(){this._renderTargetStack.pop();const e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,!1,null,e.frame)}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,r,a,n){r.x<0&&(a.width+=r.x,n.x-=r.x,r.x=0),r.y<0&&(a.height+=r.y,n.y-=r.y,r.y=0);const{pixelWidth:i,pixelHeight:l}=e;return a.width=Math.min(a.width,i-r.x),a.height=Math.min(a.height,l-r.y),this.adaptor.copyToTexture(e,t,r,a,n)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((e,t)=>{e!==t&&e.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(e){let t=null;return U.test(e)&&(e=de(e).source),e instanceof I?t=e:e instanceof _&&(t=new I({colorTextures:[e]}),U.test(e.source.resource)&&(t.isRoot=!0),e.once("destroy",()=>{t.destroy();const r=this._gpuRenderTargetHash[t.uid];r&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(r))})),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}};Ut=class extends De{constructor({buffer:e,offset:t,size:r}){super(),this.uid=C("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=C("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=e,this.offset=t|0,this.size=r,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=C("resource"),this.emit("change",this)}destroy(e=!1){this.destroyed=!0,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null}};class fe{constructor(e){this._renderer=e}addRenderable(e,t){this._renderer.renderPipes.batch.break(t),t.add(e)}execute(e){e.isRenderable&&e.render(this._renderer)}destroy(){this._renderer=null}}fe.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"customRender"};function pe(s,e){const t=s.instructionSet,r=t.instructions;for(let a=0;a<t.instructionSize;a++){const n=r[a];e[n.renderPipeId].execute(n)}}class me{constructor(e){this._renderer=e}addRenderGroup(e,t){this._renderer.renderPipes.batch.break(t),t.add(e)}execute(e){e.isRenderable&&(this._renderer.globalUniforms.push({worldTransformMatrix:e.worldTransform,worldColor:e.worldColorAlpha}),pe(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop())}destroy(){this._renderer=null}}me.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"renderGroup"};function ge(s,e=[]){e.push(s);for(let t=0;t<s.renderGroupChildren.length;t++)ge(s.renderGroupChildren[t],e);return e}function lt(s,e,t){const r=s>>16&255,a=s>>8&255,n=s&255,i=e>>16&255,l=e>>8&255,o=e&255,d=r+(i-r)*t,c=a+(l-a)*t,h=n+(o-n)*t;return(d<<16)+(c<<8)+h}const G=16777215;function xe(s,e){return s===G||e===G?s+e-G:lt(s,e,.5)}const ut=new S;function ve(s,e=!1){dt(s);const t=s.childrenToUpdate,r=s.updateTick++;for(const a in t){const n=t[a],i=n.list,l=n.index;for(let o=0;o<l;o++){const d=i[o];d.parentRenderGroup===s&&be(d,r,0)}n.index=0}if(e)for(let a=0;a<s.renderGroupChildren.length;a++)ve(s.renderGroupChildren[a],e)}function dt(s){const e=s.root;let t;if(s.renderGroupParent){const r=s.renderGroupParent;s.worldTransform.appendFrom(e.relativeGroupTransform,r.worldTransform),s.worldColor=xe(e.groupColor,r.worldColor),t=e.groupAlpha*r.worldAlpha}else s.worldTransform.copyFrom(e.localTransform),s.worldColor=e.localColor,t=e.localAlpha;t=t<0?0:t>1?1:t,s.worldAlpha=t,s.worldColorAlpha=s.worldColor+((t*255|0)<<24)}function be(s,e,t){if(e===s.updateTick)return;s.updateTick=e,s.didChange=!1;const r=s.localTransform;s.updateLocalTransform();const a=s.parent;if(a&&!a.renderGroup?(t=t|s._updateFlags,s.relativeGroupTransform.appendFrom(r,a.relativeGroupTransform),t&&j(s,a,t)):(t=s._updateFlags,s.relativeGroupTransform.copyFrom(r),t&&j(s,ut,t)),!s.renderGroup){const n=s.children,i=n.length;for(let o=0;o<i;o++)be(n[o],e,t);const l=s.parentRenderGroup;s.renderPipeId&&!l.structureDidChange&&l.updateRenderable(s)}}function j(s,e,t){if(t&Oe){s.groupColor=xe(s.localColor,e.groupColor);let r=s.localAlpha*e.groupAlpha;r=r<0?0:r>1?1:r,s.groupAlpha=r,s.groupColorAlpha=s.groupColor+((r*255|0)<<24)}t&ze&&(s.groupBlendMode=s.localBlendMode==="inherit"?e.groupBlendMode:s.localBlendMode),t&He&&(s.globalDisplayStatus=s.localDisplayStatus&e.globalDisplayStatus),s._updateFlags=0}function ct(s,e){const{list:t,index:r}=s.childrenRenderablesToUpdate;let a=!1;for(let n=0;n<r;n++){const i=t[n];if(a=e[i.renderPipeId].validateRenderable(i),a)break}return s.structureDidChange=a,a}const ht=new g;class _e{constructor(e){this._renderer=e}render({container:e,transform:t}){e.isRenderGroup=!0;const r=e.parent,a=e.renderGroup.renderGroupParent;e.parent=null,e.renderGroup.renderGroupParent=null;const n=this._renderer,i=ge(e.renderGroup,[]);let l=ht;t&&(l=l.copyFrom(e.renderGroup.localTransform),e.renderGroup.localTransform.copyFrom(t));const o=n.renderPipes;for(let d=0;d<i.length;d++){const c=i[d];c.runOnRender(),c.instructionSet.renderPipes=o,c.structureDidChange||ct(c,o),ve(c),c.structureDidChange?(c.structureDidChange=!1,et(c,o)):ft(c),c.childrenRenderablesToUpdate.index=0,n.renderPipes.batch.upload(c.instructionSet)}n.globalUniforms.start({worldTransformMatrix:t?e.renderGroup.localTransform:e.renderGroup.worldTransform,worldColor:e.renderGroup.worldColorAlpha}),pe(e.renderGroup,o),o.uniformBatch&&o.uniformBatch.renderEnd(),t&&e.renderGroup.localTransform.copyFrom(l),e.parent=r,e.renderGroup.renderGroupParent=a}destroy(){this._renderer=null}}_e.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"renderGroup"};function ft(s){const{list:e,index:t}=s.childrenRenderablesToUpdate;for(let r=0;r<t;r++){const a=e[r];a.didViewUpdate&&s.updateRenderable(a)}}class ye{constructor(e){this._gpuSpriteHash=Object.create(null),this._renderer=e}addRenderable(e,t){const r=this._getGpuSprite(e);e._didSpriteUpdate&&this._updateBatchableSprite(e,r),this._renderer.renderPipes.batch.addToBatch(r)}updateRenderable(e){const t=this._gpuSpriteHash[e.uid];e._didSpriteUpdate&&this._updateBatchableSprite(e,t),t.batcher.updateElement(t)}validateRenderable(e){const t=e._texture,r=this._getGpuSprite(e);return r.texture._source!==t._source?!r.batcher.checkAndUpdateTexture(r,t):!1}destroyRenderable(e){const t=this._gpuSpriteHash[e.uid];b.return(t),this._gpuSpriteHash[e.uid]=null}_updateBatchableSprite(e,t){e._didSpriteUpdate=!1,t.bounds=e.bounds,t.texture=e._texture}_getGpuSprite(e){return this._gpuSpriteHash[e.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=b.get(Ke);return t.renderable=e,t.texture=e._texture,t.bounds=e.bounds,t.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuSpriteHash[e.uid]=t,e._didSpriteUpdate=!1,e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuSpriteHash)b.return(this._gpuSpriteHash[e]);this._gpuSpriteHash=null,this._renderer=null}}ye.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"sprite"};const F=class Te{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new J(0),this.color=this._backgroundColor,this.alpha=1}init(e){e={...Te.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha)}get color(){return this._backgroundColor}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};F.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"background",priority:0};F.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let pt=F;const y={};X.handle(u.BlendMode,s=>{if(!s.name)throw new Error("BlendMode extension must have a name property");y[s.name]=s.ref},s=>{delete y[s.name]});class ke{constructor(e){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=e}setBlendMode(e,t,r){if(this._activeBlendMode===t){this._isAdvanced&&this._renderableList.push(e);return}this._activeBlendMode=t,this._isAdvanced&&this._endAdvancedBlendMode(r),this._isAdvanced=!!y[t],this._isAdvanced&&(this._beginAdvancedBlendMode(r),this._renderableList.push(e))}_beginAdvancedBlendMode(e){this._renderer.renderPipes.batch.break(e);const t=this._activeBlendMode;if(!y[t]){Y(`Unable to assign BlendMode: '${t}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let r=this._filterHash[t];r||(r=this._filterHash[t]=new K,r.filters=[new y[t]]);const a={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:r,canBundle:!1};this._renderableList=a.renderables,e.add(a)}_endAdvancedBlendMode(e){this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e)}destroy(){this._renderer=null,this._renderableList=null;for(const e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null}}ke.extension={type:[u.WebGLPipes,u.WebGPUPipes,u.CanvasPipes],name:"blendMode"};const R={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},E=class Me{constructor(e){this._renderer=e}_normalizeOptions(e,t={}){return e instanceof S||e instanceof m?{target:e,...t}:{...t,...e}}async image(e){const t=new Image;return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,Me.defaultImageOptions);const{format:t,quality:r}=e,a=this.canvas(e);if(a.toBlob!==void 0)return new Promise((n,i)=>{a.toBlob(l=>{if(!l){i(new Error("ICanvas.toBlob failed!"));return}const o=new FileReader;o.onload=()=>n(o.result),o.onerror=i,o.readAsDataURL(l)},R[t],r)});if(a.toDataURL!==void 0)return a.toDataURL(R[t],r);if(a.convertToBlob!==void 0){const n=await a.convertToBlob({type:R[t],quality:r});return new Promise((i,l)=>{const o=new FileReader;o.onload=()=>i(o.result),o.onerror=l,o.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){e=this._normalizeOptions(e);const t=e.target,r=this._renderer;if(t instanceof m)return r.texture.generateCanvas(t);const a=r.textureGenerator.generateTexture(e),n=r.texture.generateCanvas(a);return a.destroy(),n}pixels(e){e=this._normalizeOptions(e);const t=e.target,r=this._renderer,a=t instanceof m?t:r.textureGenerator.generateTexture(e),n=r.texture.getPixels(a);return t instanceof S&&a.destroy(),n}texture(e){return e=this._normalizeOptions(e),e.target instanceof m?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);const t=this.canvas(e),r=document.createElement("a");r.download=e.filename??"image.png",r.href=t.toDataURL("image/png"),document.body.appendChild(r),r.click(),document.body.removeChild(r)}log(e){const t=e.width??200;e=this._normalizeOptions(e);const r=this.canvas(e),a=r.toDataURL();console.log(`[Pixi Texture] ${r.width}px ${r.height}px`);const n=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${a}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n)}destroy(){this._renderer=null}};E.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"extract"};E.defaultImageOptions={format:"png",quality:1};let mt=E;class gt extends m{static create(e){return new m({source:new _(e)})}resize(e,t,r){return this.source.resize(e,t,r),this}}const xt=new w,vt=new q,bt=[0,0,0,0];class Ce{constructor(e){this._renderer=e}generateTexture(e){e instanceof S&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});const t=e.resolution||this._renderer.resolution,r=e.antialias||this._renderer.view.antialias,a=e.target;let n=e.clearColor;n?n=Array.isArray(n)&&n.length===4?n:J.shared.setValue(n).toArray():n=bt;const i=e.frame?.copyTo(xt)||Le(a,vt).rectangle;i.width=Math.max(i.width,1/t)|0,i.height=Math.max(i.height,1/t)|0;const l=gt.create({...e.textureSourceOptions,width:i.width,height:i.height,resolution:t,antialias:r}),o=g.shared.translate(-i.x,-i.y);return this._renderer.render({container:a,transform:o,target:l,clearColor:n}),l.source.updateMipmaps(),l}destroy(){this._renderer=null}}Ce.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"textureGenerator"};class we{constructor(e){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=e}reset(){this._stackIndex=0;for(let e=0;e<this._activeUniforms.length;e++)this._uniformsPool.push(this._activeUniforms[e]);for(let e=0;e<this._activeBindGroups.length;e++)this._bindGroupPool.push(this._activeBindGroups[e]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(e){this.reset(),this.push(e)}bind({size:e,projectionMatrix:t,worldTransformMatrix:r,worldColor:a,offset:n}){const i=this._renderer.renderTarget.renderTarget,l=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:i,worldTransformMatrix:new g,worldColor:4294967295,offset:new We},o={projectionMatrix:t||this._renderer.renderTarget.projectionMatrix,resolution:e||i.size,worldTransformMatrix:r||l.worldTransformMatrix,worldColor:a||l.worldColor,offset:n||l.offset,bindGroup:null},d=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(d);const c=d.uniforms;c.uProjectionMatrix=o.projectionMatrix,c.uResolution=o.resolution,c.uWorldTransformMatrix.copyFrom(o.worldTransformMatrix),c.uWorldTransformMatrix.tx-=o.offset.x,c.uWorldTransformMatrix.ty-=o.offset.y,Ye(o.worldColor,c.uWorldColorAlpha,0),d.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(d,!1):(h=this._bindGroupPool.pop()||new Ve,this._activeBindGroups.push(h),h.setResource(d,0)),o.bindGroup=h,this._currentGlobalUniformData=o}push(e){this.bind(e),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===se.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new re({uProjectionMatrix:{value:new g,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new g,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}we.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"globalUniforms"};let $=!1;const N="8.2.0";function _t(s){if(!$){if(Q.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const e=[`%c %c %c %c %c PixiJS %c v${N} (${s}) http://www.pixijs.com/
|
|
||||||
|
|
||||||
`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e)}else globalThis.console&&globalThis.console.log(`PixiJS ${N} - ${s} - http://www.pixijs.com/`);$=!0}}class D{constructor(e){this._renderer=e}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===se.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),_t(t)}}}D.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"hello",priority:-2};D.defaultOptions={hello:!1};const O=class Se{constructor(e){this._renderer=e,this.count=0,this.checkCount=0}init(e){e={...Se.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle,this.active=e.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this._renderer.texture.managedTextures;for(let t=0;t<e.length;t++){const r=e[t];r.autoGarbageCollect&&r.resource&&r._touched>-1&&this.count-r._touched>this.maxIdle&&(r._touched=-1,r.unload())}}destroy(){this._renderer=null}};O.extension={type:[u.WebGLSystem,u.WebGPUSystem],name:"textureGC"};O.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:60*60,textureGCCheckCountMax:600};let Pe=O;X.add(Pe);const z=class Ge{get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e)}init(e){e={...Ge.defaultOptions,...e},e.view&&(je($e,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new w(0,0,e.width,e.height),this.canvas=e.canvas||Q.get().createCanvas(),this.antialias=!!e.antialias,this.texture=de(this.canvas,e),this.renderTarget=new I({colorTextures:[this.texture],depth:!!e.depth,isRoot:!0}),this.texture.source.transparent=e.backgroundAlpha<1,this.multiView=!!e.multiView,this.autoDensity&&(this.canvas.style.width=`${this.texture.width}px`,this.canvas.style.height=`${this.texture.height}px`),this.resolution=e.resolution}resize(e,t,r){this.texture.source.resize(e,t,r),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height,this.autoDensity&&(this.canvas.style.width=`${e}px`,this.canvas.style.height=`${t}px`)}destroy(e=!1){(typeof e=="boolean"?e:!!e?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}};z.extension={type:[u.WebGLSystem,u.WebGPUSystem,u.CanvasSystem],name:"view",priority:0};z.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};let yt=z;At=[pt,we,D,yt,_e,Pe,Ce,mt,Ne];It=[ke,ne,ye,me,oe,ue,le,fe]});export{Ut as B,T as G,Bt as R,At as S,Pt as U,It as a,nt as b,Gt as c,M as d,St as e,wt as f,Ct as t,Rt as u,__tla};
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{h as N,d as g,r as L,H as B,B as f,D as C,G as t,m as l,I as s,J as r,u as b,K as c,L as F,M as T,N as K,O as P}from"./vue-DFryKk-1.js";import{u as E,b as X,c as I,d as M,e as O,f as R,g as q,a as p,h as j,V as A,i as G,j as H,k as $,l as J,m as z}from"./index-BhWmfNB5.js";const Q={key:0,class:"text-warning"},h=N({__name:"CategoryFormDialog",props:{guid:{},initialCategory:{}},emits:["submit"],setup(w,{emit:k}){const i=w,S=k,{t:m}=E(),v=X(),{isOpened:d}=I(i.guid),U=g(),u=g(!1),D=[e=>!!e||m("dialogs.category.nameRequired")],o=L({name:"",savePath:""});async function y(){u.value&&(i.initialCategory?await v.editCategory(o,i.initialCategory.name===o.name?void 0:i.initialCategory.name):await v.createCategory(o),S("submit",o),V())}const V=()=>{d.value=!1};return B(()=>{o.name=i.initialCategory?.name||"",o.savePath=i.initialCategory?.savePath||""}),(e,a)=>(f(),C(J,{modelValue:b(d),"onUpdate:modelValue":a[4]||(a[4]=n=>P(d)?d.value=n:null)},{default:t(()=>[l(M,null,{default:t(()=>[l(O,null,{default:t(()=>[s(r(e.$t(`dialogs.category.title.${e.initialCategory?"edit":"create"}`)),1)]),_:1}),l(R,null,{default:t(()=>[l(b(q),{modelValue:u.value,"onUpdate:modelValue":a[2]||(a[2]=n=>u.value=n),ref_key:"form",ref:U,onSubmit:a[3]||(a[3]=c(()=>{},["prevent"])),onKeydown:F(c(y,["prevent"]),["enter"])},{default:t(()=>[e.initialCategory?(f(),C(p,{key:0,"model-value":e.initialCategory.name,disabled:"",label:e.$t("dialogs.category.oldName")},null,8,["model-value","label"])):T("",!0),l(p,{modelValue:o.name,"onUpdate:modelValue":a[0]||(a[0]=n=>o.name=n),rules:D,autofocus:!e.initialCategory,label:e.$t("dialogs.category.name")},null,8,["modelValue","autofocus","label"]),l(p,{modelValue:o.savePath,"onUpdate:modelValue":a[1]||(a[1]=n=>o.savePath=n),autofocus:!!e.initialCategory,label:e.$t("dialogs.category.savePath")},null,8,["modelValue","autofocus","label"]),l(j,null,{default:t(()=>[e.initialCategory&&e.initialCategory.name!==o.name?(f(),K("div",Q,[l(A,null,{default:t(()=>a[5]||(a[5]=[s("mdi-alert")])),_:1}),s(" "+r(e.$t("dialogs.category.warnEdit")),1)])):T("",!0)]),_:1})]),_:1},8,["modelValue","onKeydown"])]),_:1}),l(G,null,{default:t(()=>[l(H),l($,{color:"error",onClick:V},{default:t(()=>[s(r(e.$t("common.cancel")),1)]),_:1}),l($,{color:"accent",disabled:!u.value,onClick:y},{default:t(()=>[s(r(e.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}}),W={key:0,class:"text-warning"},_=N({__name:"TagFormDialog",props:{guid:{},initialTag:{}},emits:["submit"],setup(w,{emit:k}){const i=w,S=k,{isOpened:m}=I(i.guid),{t:v}=E(),d=z(),U=g(),u=g(!1),D=g([e=>!!e||v("dialogs.tag.required"),e=>!i.initialTag||!!i.initialTag&&!e.includes(",")||v("dialogs.tag.comma")]),o=g("");async function y(){if(!u.value)return;let e;i.initialTag?(e=[o.value],await d.editTag(i.initialTag,o.value)):(e=o.value.split(","),await d.createTags(e)),S("submit",e),V()}const V=()=>{m.value=!1};return B(()=>{o.value=i.initialTag||""}),(e,a)=>(f(),C(J,{modelValue:b(m),"onUpdate:modelValue":a[3]||(a[3]=n=>P(m)?m.value=n:null)},{default:t(()=>[l(M,null,{default:t(()=>[l(O,null,{default:t(()=>[s(r(e.$t(`dialogs.tag.title.${e.initialTag?"rename":"create"}`)),1)]),_:1}),l(R,null,{default:t(()=>[l(b(q),{modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=n=>u.value=n),ref_key:"form",ref:U,onSubmit:a[2]||(a[2]=c(()=>{},["prevent"])),onKeydown:F(c(y,["prevent"]),["enter"])},{default:t(()=>[e.initialTag?(f(),C(p,{key:0,"model-value":e.initialTag,disabled:"",label:e.$t("dialogs.tag.oldName")},null,8,["model-value","label"])):T("",!0),l(p,{modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=n=>o.value=n),rules:D.value,autofocus:"",hint:e.$t("dialogs.tag.hint"),label:e.$t("dialogs.tag.name")},null,8,["modelValue","rules","hint","label"]),l(j,null,{default:t(()=>[e.initialTag&&e.initialTag!==o.value?(f(),K("div",W,[l(A,null,{default:t(()=>a[4]||(a[4]=[s("mdi-alert")])),_:1}),s(" "+r(e.$t("dialogs.tag.warnEdit")),1)])):T("",!0)]),_:1})]),_:1},8,["modelValue","onKeydown"])]),_:1}),l(G,null,{default:t(()=>[l(H),l($,{color:"error",onClick:V},{default:t(()=>[s(r(e.$t("common.cancel")),1)]),_:1}),l($,{color:"accent",disabled:!u.value,onClick:y},{default:t(()=>[s(r(e.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});export{_,h as a};
|
||||||
3
qbit/vuetorrent/public/assets/TorrentCreator-Cz_3yngv.js
Normal file
3
qbit/vuetorrent/public/assets/TorrentCreator-Cz_3yngv.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import{a0 as ye,d as R,h as te,Z as ve,_ as Se,u as a,B as d,D as c,r as _e,c as K,G as e,m as t,I as p,J as u,K as Q,M as E,N as F,F as U,O as he,P as Te,Q as Fe,H as xe,q as we,S as b,X as Le,n as se,T as ne}from"./vue-DFryKk-1.js";import{$ as I,G as ae,a9 as De,aa as ze,a as me,c as Ue,u as ce,ab as x,a5 as pe,d as M,e as J,J as W,K as X,k as v,f as Z,g as Ie,q as fe,s as V,x as B,v as ie,ac as j,ad as H,i as Ae,l as ee,F as Pe,o as He,ae as Ne,p as Ee,af as w,r as Y,ag as Me,j as q,t as N,a0 as Re,ah as de,ai as Be,V as L,D as G,aj as $e,ak as Oe}from"./index-BhWmfNB5.js";import{a as je}from"./vuetify-XtA0Y0Oj.js";var ke=(g=>(g.ALL="all",g.ONLY_FILES="files",g.ONLY_DIRECTORIES="dirs",g))(ke||{});const Ve=ye("torrentCreator",()=>{const g=R([]);async function S(){g.value=await I.getTorrentCreatorStatus()}async function C(f){return await I.addTorrentCreatorTask(f)}async function o(f){return await I.deleteTorrentCreatorTask(f)}async function _(f){return await I.getTorrentCreatorOutput(f)}return{tasks:g,fetchTasks:S,createTask:C,deleteTask:o,downloadTorrent:_}}),ue=te({__name:"ServerPathField",props:ve({title:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(g){const S=Se(g,"modelValue"),C=R([]),o=ae(),_=De(async f=>{if(!f)return;const k=await I.getDirectoryContent(f,ke.ALL);k&&(C.value=k)},500);return(f,k)=>a(o).usesQbit5?(d(),c(ze,{key:0,modelValue:S.value,"onUpdate:modelValue":k[0]||(k[0]=y=>S.value=y),items:C.value,label:f.title,"onUpdate:search":a(_)},null,8,["modelValue","items","label","onUpdate:search"])):(d(),c(me,{key:1,modelValue:S.value,"onUpdate:modelValue":k[1]||(k[1]=y=>S.value=y),label:f.title},null,8,["modelValue","label"]))}}),Ye=te({__name:"TorrentCreatorFormDialog",props:{guid:{}},setup(g){const S=g,{isOpened:C}=Ue(S.guid),{t:o}=ce(),_=ae(),f=Ve(),k=R(),y=R(!1),n=_e({sourcePath:"",format:x.HYBRID,pieceSize:0,optimizeAlignment:!1,paddedFileSizeLimit:0,private:!1,startSeeding:!1,torrentFilePath:"",trackers:"",urlSeeds:"",source:"",comment:""}),A=[{title:o("constants.torrentFormat.v1"),value:x.V1},{title:o("constants.torrentFormat.v2"),value:x.V2},{title:o("constants.torrentFormat.hybrid"),value:x.HYBRID}],D=K(()=>{const T=[{title:o("common.auto"),value:0}];for(let r=16*1024;r<5e8;r*=2)T.push({title:pe(r,!0,0),value:r});return T}),$=[T=>!T||T<-1||o("dialogs.torrentCreator.paddedFileSizeLimitRule")];async function P(){y.value&&(await f.createTask(n),z())}const z=()=>{C.value=!1};return(T,r)=>(d(),c(ee,{modelValue:a(C),"onUpdate:modelValue":r[14]||(r[14]=s=>he(C)?C.value=s:null),"max-width":"1250"},{default:e(()=>[t(M,null,{default:e(()=>[t(J,{class:"ios-margin"},{default:e(()=>[t(W,{color:"transparent"},{default:e(()=>[t(X,null,{default:e(()=>[p(u(a(o)("dialogs.torrentCreator.title")),1)]),_:1}),t(v,{icon:"mdi-close",onClick:z})]),_:1})]),_:1}),t(Z,null,{default:e(()=>[t(a(Ie),{modelValue:y.value,"onUpdate:modelValue":r[12]||(r[12]=s=>y.value=s),ref_key:"form",ref:k,onSubmit:r[13]||(r[13]=Q(()=>{},["prevent"]))},{default:e(()=>[t(fe,null,{default:e(()=>[t(V,{cols:"12"},{default:e(()=>[t(ue,{modelValue:n.sourcePath,"onUpdate:modelValue":r[0]||(r[0]=s=>n.sourcePath=s),title:a(o)("dialogs.torrentCreator.sourcePath"),rules:[s=>!!s||a(o)("dialogs.torrentCreator.rules.sourcePathRequired")]},null,8,["modelValue","title","rules"])]),_:1}),t(V,{cols:"12"},{default:e(()=>[t(ue,{modelValue:n.torrentFilePath,"onUpdate:modelValue":r[1]||(r[1]=s=>n.torrentFilePath=s),title:a(o)("dialogs.torrentCreator.torrentFilePath"),rules:[s=>!s||s.endsWith(".torrent")||a(o)("dialogs.torrentCreator.rules.outputFileExtension")]},null,8,["modelValue","title","rules"])]),_:1}),t(B),a(_).usesLibtorrent2?(d(),c(V,{key:0,cols:"12",sm:"6",class:"pb-0"},{default:e(()=>[t(ie,{modelValue:n.format,"onUpdate:modelValue":r[2]||(r[2]=s=>n.format=s),"hide-details":"",items:A,label:a(o)("dialogs.torrentCreator.format")},null,8,["modelValue","label"])]),_:1})):E("",!0),t(V,{cols:"12",sm:a(_).usesLibtorrent2?6:void 0,class:"pb-0"},{default:e(()=>[t(ie,{modelValue:n.pieceSize,"onUpdate:modelValue":r[3]||(r[3]=s=>n.pieceSize=s),"hide-details":"",items:D.value,label:a(o)("dialogs.torrentCreator.pieceSize")},null,8,["modelValue","items","label"])]),_:1},8,["sm"]),a(_).usesLibtorrent1?(d(),F(U,{key:1},[t(V,{cols:"12",sm:"6",class:"py-0"},{default:e(()=>[t(j,{modelValue:n.optimizeAlignment,"onUpdate:modelValue":r[4]||(r[4]=s=>n.optimizeAlignment=s),"hide-details":"",label:a(o)("dialogs.torrentCreator.optimizeAlignment")},null,8,["modelValue","label"])]),_:1}),t(V,{cols:"12",sm:"6",class:"py-0"},{default:e(()=>[t(me,{modelValue:n.paddedFileSizeLimit,"onUpdate:modelValue":r[5]||(r[5]=s=>n.paddedFileSizeLimit=s),modelModifiers:{number:!0},min:"-1",rules:$,label:a(o)("dialogs.torrentCreator.paddedFileSizeLimit"),hint:a(o)("dialogs.torrentCreator.paddedFileSizeLimitHint"),suffix:"kiB"},null,8,["modelValue","label","hint"])]),_:1})],64)):E("",!0),t(V,{cols:"12",sm:"6",class:"py-0"},{default:e(()=>[t(j,{modelValue:n.private,"onUpdate:modelValue":r[6]||(r[6]=s=>n.private=s),"hide-details":"",label:a(o)("dialogs.torrentCreator.private")},null,8,["modelValue","label"])]),_:1}),t(V,{cols:"12",sm:"6",class:"py-0"},{default:e(()=>[t(j,{modelValue:n.startSeeding,"onUpdate:modelValue":r[7]||(r[7]=s=>n.startSeeding=s),"hide-details":"",label:a(o)("dialogs.torrentCreator.startSeeding")},null,8,["modelValue","label"])]),_:1}),t(B),t(V,{cols:"12"},{default:e(()=>[t(H,{modelValue:n.trackers,"onUpdate:modelValue":r[8]||(r[8]=s=>n.trackers=s),label:a(o)("dialogs.torrentCreator.trackers"),hint:a(o)("dialogs.torrentCreator.trackersHint")},null,8,["modelValue","label","hint"])]),_:1}),t(V,{cols:"12"},{default:e(()=>[t(H,{modelValue:n.urlSeeds,"onUpdate:modelValue":r[9]||(r[9]=s=>n.urlSeeds=s),"hide-details":"",label:a(o)("dialogs.torrentCreator.urlSeeds")},null,8,["modelValue","label"])]),_:1}),a(_).version>="5.0.3"?(d(),c(V,{key:2,cols:"12"},{default:e(()=>[t(H,{modelValue:n.source,"onUpdate:modelValue":r[10]||(r[10]=s=>n.source=s),"hide-details":"",label:a(o)("dialogs.torrentCreator.source")},null,8,["modelValue","label"])]),_:1})):E("",!0),t(V,{cols:"12"},{default:e(()=>[t(H,{modelValue:n.comment,"onUpdate:modelValue":r[11]||(r[11]=s=>n.comment=s),"hide-details":"",label:a(o)("dialogs.torrentCreator.comment")},null,8,["modelValue","label"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),t(Ae,null,{default:e(()=>[t(v,{disabled:!y.value,color:"accent",onClick:P},{default:e(()=>[p(u(a(o)("dialogs.torrentCreator.actions.submit")),1)]),_:1},8,["disabled"]),t(v,{color:"error",onClick:z},{default:e(()=>[p(u(a(o)("common.close")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]))}}),qe={class:"pa-3"},Ge={style:{"font-size":"1.6em !important"},class:"subtitle-1 ml-2"},Ke={class:"d-flex justify-end"},Qe={class:"d-flex align-center flex-gap"},Je={class:"text-no-wrap"},We={class:"text-no-wrap"},Xe={class:"text-no-wrap"},Ze={class:"text-no-wrap"},et={key:1},tt={class:"text-no-wrap"},at={key:1},ot=["innerHTML"],lt=["innerHTML"],it=te({__name:"TorrentCreator",setup(g){const{height:S}=je(),C=Te(),{t:o}=ce(),_=ae(),f=Pe(),k=Ve(),{tasks:y}=Fe(k),n=He(),A=Ne(function*(){yield k.fetchTasks()}).drop(),{isActive:D,pause:$,resume:P}=Ee(A.perform,1e3,{immediate:!0,immediateCallback:!0}),z=P,T=K(()=>S.value-64-12*2-48),r=K(()=>[{key:"actions",sortable:!1},{title:o("torrentCreator.table.sourcePath"),key:"sourcePath"},{title:o("torrentCreator.table.status"),key:"status"},{title:o("torrentCreator.table.progress"),key:"progress"},_.usesLibtorrent2?{title:o("torrentCreator.table.format"),key:"format"}:{title:o("torrentCreator.table.optimizeAlignment"),key:"optimizeAlignment"},{title:o("torrentCreator.table.pieceSize"),key:"pieceSize"},{title:o("torrentCreator.table.private"),key:"private"},{title:o("torrentCreator.table.timeAdded"),key:"timeAdded"},{title:o("torrentCreator.table.timeStarted"),key:"timeStarted"},{title:o("torrentCreator.table.timeFinished"),key:"timeFinished"},{title:o("torrentCreator.table.trackers.header"),key:"trackers",sortable:!1},{title:o("torrentCreator.table.urlSeeds.header"),key:"urlSeeds",sortable:!1},{title:o("torrentCreator.table.source"),key:"source"},{title:o("torrentCreator.table.comment"),key:"comment"},{title:o("torrentCreator.table.errorMessage"),key:"errorMessage"}]),s={[w.FAILED]:"error",[w.RUNNING]:"torrent-ul_stalled",[w.QUEUED]:"warning",[w.FINISHED]:"success"},be={[x.V1]:"V1",[x.V2]:"V2",[x.HYBRID]:"Hybrid"};function oe(){f.createDialog(Ye,{},k.fetchTasks)}async function ge(h){const m=await k.downloadTorrent(h.taskID),l=$e(h.torrentFilePath);let i;l&&l.endsWith(".torrent")?i=l.slice(0,-8):l?i=l:i=h.taskID,Oe(`${i}.torrent`,m)}async function Ce(h){await k.deleteTask(h.taskID),z()}const le=()=>{C.push({name:"dashboard"})};function re(h){if(f.hasActiveDialog)return!1;h.key==="Escape"&&(h.preventDefault(),le())}return xe(async()=>{document.addEventListener("keydown",re),A.perform()}),we(()=>{document.removeEventListener("keydown",re)}),(h,m)=>(d(),F("div",qe,[t(fe,{"no-gutters":"",align:"center",justify:"center"},{default:e(()=>[t(V,null,{default:e(()=>[b("h1",Ge,u(a(o)("torrentCreator.title")),1)]),_:1}),t(V,null,{default:e(()=>[b("div",Ke,[t(v,{icon:"mdi-close",variant:"plain",onClick:le})])]),_:1})]),_:1}),a(y).length?(d(),c(Y,{key:1},{default:e(()=>[t(N,null,{default:e(()=>[b("div",Qe,[t(q),t(v,{color:"accent","prepend-icon":a(D)?"mdi-timer-pause":"mdi-timer-play",text:a(D)?a(o)("common.pause"):a(o)("common.resume"),onClick:m[1]||(m[1]=l=>a(D)?a($)():a(P)())},null,8,["prepend-icon","text"]),t(v,{color:"accent","prepend-icon":"mdi-plus",text:a(o)("torrentCreator.table.create"),onClick:oe},null,8,["text"])])]),_:1}),t(B,{class:"my-3"}),t(N,{class:"text-select"},{default:e(()=>[t(Re,{"header-props":{class:"text-no-wrap"},mobile:null,headers:r.value,items:a(y),"multi-sort":"","footer-props":{itemsPerPageOptions:[10,25,50,100,-1]}},{"item.status":e(({item:l,value:i})=>[b("span",{class:Le(`text-${s[l.status]}`)},u(a(o)(`constants.torrentCreatorTaskStatus.${i.toLowerCase()}`)),3)]),"item.progress":e(({item:l,value:i})=>[l.status===a(w).RUNNING?(d(),c(de,{key:0,"model-value":i,color:s[l.status],height:20,rounded:"sm",style:{width:"10em"}},{default:e(()=>[p(u(i)+" % ",1)]),_:2},1032,["model-value","color"])):(d(),c(de,{key:1,"model-value":100,color:s[l.status],height:20,rounded:"sm",style:{width:"10em"}},{default:e(()=>[p(u(a(Be)(1)),1)]),_:2},1032,["color"]))]),"item.format":e(({value:l})=>[p(u(be[l]),1)]),"item.pieceSize":e(({value:l})=>[p(u(a(pe)(l,a(n).useBinarySize,0)),1)]),"item.private":e(({value:l})=>[l?(d(),c(L,{key:0,color:"accent"},{default:e(()=>m[2]||(m[2]=[p("mdi-check-bold")])),_:1})):(d(),c(L,{key:1,color:"error"},{default:e(()=>m[3]||(m[3]=[p("mdi-close-thick")])),_:1}))]),"item.optimizeAlignment":e(({value:l})=>[l?(d(),c(L,{key:0,color:"accent"},{default:e(()=>m[4]||(m[4]=[p("mdi-check-bold")])),_:1})):(d(),c(L,{key:1,color:"error"},{default:e(()=>m[5]||(m[5]=[p("mdi-close-thick")])),_:1}))]),"item.timeAdded":e(({value:l})=>[b("div",Je,u(a(G)(l).format(a(n).dateFormat)),1)]),"item.timeFinished":e(({value:l})=>[b("div",We,u(a(G)(l).format(a(n).dateFormat)),1)]),"item.timeStarted":e(({value:l})=>[b("div",Xe,u(a(G)(l).format(a(n).dateFormat)),1)]),"item.trackers":e(({value:l})=>[l&&l.length&&!l.every(i=>!i.length)?(d(),c(ee,{key:0},{activator:e(({props:i})=>[b("div",Ze,[b("span",null,u(a(o)("torrentCreator.table.trackers.activator",l.filter(O=>O.length).length)),1),t(L,se({class:"ml-1"},i),{default:e(()=>m[6]||(m[6]=[p("mdi-information")])),_:2},1040)])]),default:e(()=>[t(M,null,{default:e(()=>[t(J,{class:"ios-margin"},{default:e(()=>[t(W,{color:"transparent"},{default:e(()=>[t(X,null,{default:e(()=>[p(u(a(o)("torrentCreator.table.trackers.title")),1)]),_:1}),t(q),t(v,{icon:"mdi-close"})]),_:1})]),_:1}),t(Z,null,{default:e(()=>[t(Y,null,{default:e(()=>[(d(!0),F(U,null,ne(l,i=>(d(),F(U,null,[i?(d(),c(N,{key:0},{default:e(()=>[p(u(i),1)]),_:2},1024)):(d(),c(B,{key:1}))],64))),256))]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)):(d(),F("span",et,u(a(o)("common.none")),1))]),"item.urlSeeds":e(({value:l})=>[l&&l.length&&!l.every(i=>!i.length)?(d(),c(ee,{key:0},{activator:e(({props:i})=>[b("div",tt,[b("span",null,u(a(o)("torrentCreator.table.urlSeeds.activator",l.filter(O=>O.length).length)),1),t(L,se({class:"ml-1"},i),{default:e(()=>m[7]||(m[7]=[p("mdi-information")])),_:2},1040)])]),default:e(()=>[t(M,null,{default:e(()=>[t(J,{class:"ios-margin"},{default:e(()=>[t(W,{color:"transparent"},{default:e(()=>[t(X,null,{default:e(()=>[p(u(a(o)("torrentCreator.table.urlSeeds.title")),1)]),_:1}),t(q),t(v,{icon:"mdi-close"})]),_:1})]),_:1}),t(Z,null,{default:e(()=>[t(Y,null,{default:e(()=>[(d(!0),F(U,null,ne(l.filter(i=>i.length),i=>(d(),F(U,null,[i?(d(),c(N,{key:0},{default:e(()=>[p(u(i),1)]),_:2},1024)):E("",!0)],64))),256))]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)):(d(),F("span",at,u(a(o)("common.none")),1))]),"item.comment":e(({value:l})=>[b("div",{class:"text-no-wrap",innerHTML:l?.length?l.replaceAll(`
|
||||||
|
`,"<br>"):""},null,8,ot)]),"item.errorMessage":e(({value:l})=>[b("div",{class:"text-no-wrap",innerHTML:l?.length?l.replaceAll(`
|
||||||
|
`,"<br>"):""},null,8,lt)]),"item.actions":e(({item:l})=>[t(v,{disabled:l.status!==a(w).FINISHED,color:"accent",icon:"mdi-download",variant:"text",density:"compact",onClick:Q(i=>ge(l),["stop"])},null,8,["disabled","onClick"]),t(v,{color:"red",icon:"mdi-delete",variant:"text",density:"compact",onClick:Q(i=>Ce(l),["stop"])},null,8,["onClick"])]),_:2},1032,["headers","items"])]),_:1})]),_:1})):(d(),c(M,{key:0,height:T.value},{default:e(()=>[t(Me,{title:a(o)("torrentCreator.empty.value"),color:"accent",icon:"mdi-cog-off"},{actions:e(()=>[t(v,{text:a(o)("torrentCreator.empty.action"),color:"accent",onClick:m[0]||(m[0]=l=>oe())},null,8,["text"])]),_:1},8,["title"])]),_:1},8,["height"]))]))}});export{it as default};
|
||||||
@@ -1 +0,0 @@
|
|||||||
.spacer[data-v-47f1c669]{margin-left:8px;margin-right:16px}[class*=v-theme--dark-] .selected[data-v-47f1c669]{background-color:rgb(var(--v-theme-surface));filter:brightness(135%)}[class*=v-theme--light-] .selected[data-v-47f1c669]{background-color:rgb(var(--v-theme-surface));filter:brightness(75%)}#_tree-root{font-size:medium;list-style-type:none}#_tree-root div.v-virtual-scroll__item{padding-top:8px}#_tree-root div.v-virtual-scroll__item:first-child{padding-top:0}#_tree-root div.v-virtual-scroll__item:last-child{padding-bottom:8px}canvas[data-v-2bc530c7]{height:100%;width:100%}[class*=v-theme--dark-] .tracker-disabled[data-v-12f0128d]{color:#c6c6c6}[class*=v-theme--dark-] .tracker-not_yet_contacted[data-v-12f0128d]{color:orange}[class*=v-theme--dark-] .tracker-working[data-v-12f0128d]{color:#90ee90}[class*=v-theme--dark-] .tracker-not_working[data-v-12f0128d]{color:#f08080}[class*=v-theme--dark-] .tracker-updating[data-v-12f0128d]{color:#add8e6}[class*=v-theme--light-] .tracker-disabled[data-v-12f0128d]{color:gray}[class*=v-theme--light-] .tracker-not_yet_contacted[data-v-12f0128d]{color:orange}[class*=v-theme--light-] .tracker-working[data-v-12f0128d]{color:green}[class*=v-theme--light-] .tracker-not_working[data-v-12f0128d]{color:red}[class*=v-theme--light-] .tracker-updating[data-v-12f0128d]{color:#1e90ff}
|
|
||||||
File diff suppressed because one or more lines are too long
242
qbit/vuetorrent/public/assets/TorrentDetail-CoyYqyCA.js
Normal file
242
qbit/vuetorrent/public/assets/TorrentDetail-CoyYqyCA.js
Normal file
File diff suppressed because one or more lines are too long
1
qbit/vuetorrent/public/assets/TorrentDetail-LhHsYTZk.css
Normal file
1
qbit/vuetorrent/public/assets/TorrentDetail-LhHsYTZk.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.spacer[data-v-276db43b]{margin-left:8px;margin-right:16px}[class*=v-theme--dark-] .selected[data-v-276db43b]{background-color:rgb(var(--v-theme-surface));filter:brightness(135%)}[class*=v-theme--light-] .selected[data-v-276db43b]{background-color:rgb(var(--v-theme-surface));filter:brightness(75%)}canvas[data-v-c3384aa7]{height:100%;width:100%}[class*=v-theme--dark-] .tracker-disabled[data-v-c5792b64]{color:#c6c6c6}[class*=v-theme--dark-] .tracker-not_yet_contacted[data-v-c5792b64]{color:orange}[class*=v-theme--dark-] .tracker-working[data-v-c5792b64]{color:#90ee90}[class*=v-theme--dark-] .tracker-not_working[data-v-c5792b64]{color:#f08080}[class*=v-theme--dark-] .tracker-updating[data-v-c5792b64]{color:#add8e6}[class*=v-theme--light-] .tracker-disabled[data-v-c5792b64]{color:gray}[class*=v-theme--light-] .tracker-not_yet_contacted[data-v-c5792b64]{color:orange}[class*=v-theme--light-] .tracker-working[data-v-c5792b64]{color:green}[class*=v-theme--light-] .tracker-not_working[data-v-c5792b64]{color:red}[class*=v-theme--light-] .tracker-updating[data-v-c5792b64]{color:#1e90ff}
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
import{g as K,E as l,B,D as G,w as m,O as Ae,k as S,j as $,S as p,R as H,h as A,M as z,e as v,A as Ne,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";import{S as U,j as O,k as Y,m as q,n as P,b as x,h as Z,f as Ie,U as F,o as Q,R as ye,__tla as __tla_1}from"./colorToUniform-rMRo2qOn.js";import{g as J,__tla as __tla_2}from"./getBatchSamplersUniformGroup-B1Z3BKU1.js";import{e as De,G as Ce,c as Ge,b as Ue,U as Oe,R as Pe,B as ee,d as N,f as Fe,S as Me,a as Le,__tla as __tla_3}from"./SharedSystems-Bg8GzrJB.js";import{__tla as __tla_4}from"./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js";import{__tla as __tla_5}from"./index-C0tfT_Qc.js";import"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";import{__tla as __tla_6}from"./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_7}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js";let kt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})()]).then(async()=>{class te{constructor(){this._didUpload=!1,this._tempState=U.for2d()}init(e){const r=K(),s=O({name:"batch",bits:[Y,q(r),P]});this._shader=new x({glProgram:s,resources:{batchSamplers:J(r)}}),e.renderer.runners.contextChange.add(this)}contextChange(){this._didUpload=!1}start(e,r){const s=e.renderer;s.shader.bind(this._shader,this._didUpload),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(r,this._shader.glProgram)}execute(e,r){const s=e.renderer;this._didUpload=!0,this._tempState.blendMode=r.blendMode,s.state.set(this._tempState);const n=r.textures.textures;for(let i=0;i<n.length;i++)s.texture.bind(n[i],i);s.geometry.draw("triangle-list",r.size,r.start)}destroy(){this._shader.destroy(!0),this._shader=null}}te.extension={type:[l.WebGLPipesAdaptor],name:"batch"};var T=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(T||{});class He{constructor(e,r){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}}class re{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._renderer=e}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){this._gpuBuffers=Object.create(null),this._gl=this._renderer.gl}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,s=this.getGlBuffer(e);r.bindBuffer(s.type,s.buffer)}bindBufferBase(e,r){const{_gl:s}=this;if(this._boundBufferBases[r]!==e){const n=this.getGlBuffer(e);this._boundBufferBases[r]=e,s.bindBufferBase(s.UNIFORM_BUFFER,r,n.buffer)}}bindBufferRange(e,r,s){const{_gl:n}=this;s=s||0;const i=this.getGlBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,r||0,i.buffer,s*256,256)}updateBuffer(e){const{_gl:r}=this,s=this.getGlBuffer(e);if(e._updateID===s.updateID)return s;s.updateID=e._updateID,r.bindBuffer(s.type,s.buffer);const n=e.data;if(s.byteLength>=e.data.byteLength)r.bufferSubData(s.type,0,n,0,e._updateSize/n.BYTES_PER_ELEMENT);else{const i=e.descriptor.usage&B.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;s.byteLength=n.byteLength,r.bufferData(s.type,n,i)}return s}destroyAll(){const e=this._gl;for(const r in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[r].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,r){const s=this._gpuBuffers[e.uid],n=this._gl;r||n.deleteBuffer(s.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){const{_gl:r}=this;let s=T.ARRAY_BUFFER;e.descriptor.usage&B.INDEX?s=T.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&B.UNIFORM&&(s=T.UNIFORM_BUFFER);const n=new He(r.createBuffer(),s);return this._gpuBuffers[e.uid]=n,e.on("destroy",this.onBufferDestroy,this),n}}re.extension={type:[l.WebGLSystem],name:"buffer"};const M=class se{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){if(e={...se.defaultOptions,...e},e.context)this.initFromContext(e.context);else{const r=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,n=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:r,premultipliedAlpha:s,antialias:n,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof G.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let s;const n=this._renderer.view.canvas;if(e===2&&(s=n.getContext("webgl2",r)),!s&&(s=n.getContext("webgl",r),!s))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=s,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const s=e.getExtension("WEBGL_provoking_vertex");s&&s.provokingVertexWEBGL(s.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&m("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=this.supports,n=this.webGLVersion===2,i=this.extensions;s.uint32Indices=n||!!i.uint32ElementIndex,s.uniformBufferObject=n,s.vertexArrayObject=n||!!i.vertexArrayObject,s.srgbTextures=n||!!i.srgb,s.nonPowOf2wrapping=n,s.nonPowOf2mipmaps=n,s.msaa=n,s.uint32Indices||m("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};M.extension={type:[l.WebGLSystem],name:"context"};M.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2};let we=M;var D=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(D||{}),ne=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(ne||{}),f=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(f||{});const w={uint8x2:f.UNSIGNED_BYTE,uint8x4:f.UNSIGNED_BYTE,sint8x2:f.BYTE,sint8x4:f.BYTE,unorm8x2:f.UNSIGNED_BYTE,unorm8x4:f.UNSIGNED_BYTE,snorm8x2:f.BYTE,snorm8x4:f.BYTE,uint16x2:f.UNSIGNED_SHORT,uint16x4:f.UNSIGNED_SHORT,sint16x2:f.SHORT,sint16x4:f.SHORT,unorm16x2:f.UNSIGNED_SHORT,unorm16x4:f.UNSIGNED_SHORT,snorm16x2:f.SHORT,snorm16x4:f.SHORT,float16x2:f.HALF_FLOAT,float16x4:f.HALF_FLOAT,float32:f.FLOAT,float32x2:f.FLOAT,float32x3:f.FLOAT,float32x4:f.FLOAT,uint32:f.UNSIGNED_INT,uint32x2:f.UNSIGNED_INT,uint32x3:f.UNSIGNED_INT,uint32x4:f.UNSIGNED_INT,sint32:f.INT,sint32x2:f.INT,sint32x3:f.INT,sint32x4:f.INT};function ke(t){return w[t]??w.float32}const Ve={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class ie{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=n=>r.bindVertexArrayOES(n),e.deleteVertexArray=n=>r.deleteVertexArrayOES(n));const s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(e.drawArraysInstanced=(n,i,a,o)=>{s.drawArraysInstancedANGLE(n,i,a,o)},e.drawElementsInstanced=(n,i,a,o,c)=>{s.drawElementsInstancedANGLE(n,i,a,o,c)},e.vertexAttribDivisor=(n,i)=>s.vertexAttribDivisorANGLE(n,i)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,r){const s=this.gl;this._activeGeometry=e;const n=this.getVao(e,r);this._activeVao!==n&&(this._activeVao=n,s.bindVertexArray(n)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let s=0;s<e.buffers.length;s++){const n=e.buffers[s];r.updateBuffer(n)}}checkCompatibility(e,r){const s=e.attributes,n=r._attributeData;for(const i in n)if(!s[i])throw new Error(`shader and geometry incompatible, geometry missing the "${i}" attribute`)}getSignature(e,r){const s=e.attributes,n=r._attributeData,i=["g",e.uid];for(const a in s)n[a]&&i.push(a,n[a].location);return i.join("-")}getVao(e,r){return this._geometryVaoHash[e.uid]?.[r._key]||this.initGeometryVao(e,r)}initGeometryVao(e,r,s=!0){const n=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(r),this.checkCompatibility(e,r);const a=this.getSignature(e,r);this._geometryVaoHash[e.uid]||(this._geometryVaoHash[e.uid]=Object.create(null),e.on("destroy",this.onGeometryDestroy,this));const o=this._geometryVaoHash[e.uid];let c=o[a];if(c)return o[r._key]=c,c;De(e,r._attributeData);const u=e.buffers;c=n.createVertexArray(),n.bindVertexArray(c);for(let _=0;_<u.length;_++){const h=u[_];i.bind(h)}return this.activateVao(e,r),o[r._key]=c,o[a]=c,n.bindVertexArray(null),c}onGeometryDestroy(e,r){const s=this._geometryVaoHash[e.uid],n=this.gl;if(s){if(r)for(const i in s)this._activeVao!==s[i]&&this.unbind(),n.deleteVertexArray(s[i]);this._geometryVaoHash[e.uid]=null}}destroyAll(e=!1){const r=this.gl;for(const s in this._geometryVaoHash){if(e)for(const n in this._geometryVaoHash[s]){const i=this._geometryVaoHash[s];this._activeVao!==i&&this.unbind(),r.deleteVertexArray(i[n])}this._geometryVaoHash[s]=null}}activateVao(e,r){const s=this._renderer.gl,n=this._renderer.buffer,i=e.attributes;e.indexBuffer&&n.bind(e.indexBuffer);let a=null;for(const o in i){const c=i[o],u=c.buffer,_=n.getGlBuffer(u),h=r._attributeData[o];if(h){a!==_&&(n.bind(u),a=_);const d=c.location;s.enableVertexAttribArray(d);const E=Z(c.format),b=ke(c.format);if(h.format?.substring(1,4)==="int"?s.vertexAttribIPointer(d,E.size,b,c.stride,c.offset):s.vertexAttribPointer(d,E.size,b,E.normalised,c.stride,c.offset),c.instance)if(this.hasInstance){const Be=c.divisor??1;s.vertexAttribDivisor(d,Be)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,s,n){const{gl:i}=this._renderer,a=this._activeGeometry,o=Ve[a.topology||e];if(n||(n=a.instanceCount),a.indexBuffer){const c=a.indexBuffer.data.BYTES_PER_ELEMENT,u=c===2?i.UNSIGNED_SHORT:i.UNSIGNED_INT;n>1?i.drawElementsInstanced(o,r||a.indexBuffer.data.length,u,(s||0)*c,n):i.drawElements(o,r||a.indexBuffer.data.length,u,(s||0)*c)}else n>1?i.drawArraysInstanced(o,s||0,r||a.getSize(),n):i.drawArrays(o,s||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}ie.extension={type:[l.WebGLSystem],name:"geometry"};const Xe=new Ae({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),L=class ae{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:s}={...ae.defaultOptions,...e};this.useBackBuffer=r,this._antialias=s,this._renderer.context.supports.msaa||(m("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=U.for2d();const n=new Ie({vertex:`
|
|
||||||
attribute vec2 aPosition;
|
|
||||||
out vec2 vUv;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
gl_Position = vec4(aPosition, 0.0, 1.0);
|
|
||||||
|
|
||||||
vUv = (aPosition + 1.0) / 2.0;
|
|
||||||
|
|
||||||
// flip dem UVs
|
|
||||||
vUv.y = 1.0 - vUv.y;
|
|
||||||
}`,fragment:`
|
|
||||||
in vec2 vUv;
|
|
||||||
out vec4 finalColor;
|
|
||||||
|
|
||||||
uniform sampler2D uTexture;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
finalColor = texture(uTexture, vUv);
|
|
||||||
}`,name:"big-triangle"});this._bigTriangleShader=new x({glProgram:n,resources:{uTexture:S.WHITE.source}})}renderStart(e){const r=this._renderer.renderTarget.getRenderTarget(e.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!r.isRoot,this._useBackBufferThisRender){const s=this._renderer.renderTarget.getRenderTarget(e.target);this._targetTexture=s.colorTexture,e.target=this._getBackBufferTexture(s.colorTexture)}}renderEnd(){this._presentBackBuffer()}_presentBackBuffer(){const e=this._renderer;e.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(e.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,e.encoder.draw({geometry:Xe,shader:this._bigTriangleShader,state:this._state}))}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new S({source:new $({width:e.width,height:e.height,resolution:e._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(e.width,e.height,e._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null)}};L.extension={type:[l.WebGLSystem],name:"backBuffer",priority:1};L.defaultOptions={useBackBuffer:!1};let We=L;class oe{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.gl.colorMask(!!(e&8),!!(e&4),!!(e&2),!!(e&1)))}}oe.extension={type:[l.WebGLSystem],name:"colorMask"};class ce{constructor(e){this.commandFinished=Promise.resolve(),this._renderer=e}setGeometry(e,r){this._renderer.geometry.bind(e,r.glProgram)}finishRenderPass(){}draw(e){const r=this._renderer,{geometry:s,shader:n,state:i,skipSync:a,topology:o,size:c,start:u,instanceCount:_}=e;r.shader.bind(n,a),r.geometry.bind(s,r.shader._activeProgram),i&&r.state.set(i),r.geometry.draw(o,c,u,_??s.instanceCount)}destroy(){this._renderer=null}}ce.extension={type:[l.WebGLSystem],name:"encoder"};class je{constructor(){this.width=-1,this.height=-1,this.msaa=!1,this.msaaRenderBuffer=[]}}class ue{constructor(e){this._stencilCache={enabled:!1,stencilReference:0,stencilMode:p.NONE},this._renderTargetStencilState=Object.create(null),e.renderTarget.onRenderTargetChange.add(this)}contextChange(e){this._gl=e,this._comparisonFuncMapping={always:e.ALWAYS,never:e.NEVER,equal:e.EQUAL,"not-equal":e.NOTEQUAL,less:e.LESS,"less-equal":e.LEQUAL,greater:e.GREATER,"greater-equal":e.GEQUAL},this._stencilOpsMapping={keep:e.KEEP,zero:e.ZERO,replace:e.REPLACE,invert:e.INVERT,"increment-clamp":e.INCR,"decrement-clamp":e.DECR,"increment-wrap":e.INCR_WRAP,"decrement-wrap":e.DECR_WRAP},this._stencilCache.enabled=!1,this._stencilCache.stencilMode=p.NONE,this._stencilCache.stencilReference=0}onRenderTargetChange(e){if(this._activeRenderTarget===e)return;this._activeRenderTarget=e;let r=this._renderTargetStencilState[e.uid];r||(r=this._renderTargetStencilState[e.uid]={stencilMode:p.DISABLED,stencilReference:0}),this.setStencilMode(r.stencilMode,r.stencilReference)}setStencilMode(e,r){const s=this._renderTargetStencilState[this._activeRenderTarget.uid],n=this._gl,i=Ce[e],a=this._stencilCache;if(s.stencilMode=e,s.stencilReference=r,e===p.DISABLED){this._stencilCache.enabled&&(this._stencilCache.enabled=!1,n.disable(n.STENCIL_TEST));return}this._stencilCache.enabled||(this._stencilCache.enabled=!0,n.enable(n.STENCIL_TEST)),(e!==a.stencilMode||a.stencilReference!==r)&&(a.stencilMode=e,a.stencilReference=r,n.stencilFunc(this._comparisonFuncMapping[i.stencilBack.compare],r,255),n.stencilOp(n.KEEP,n.KEEP,this._stencilOpsMapping[i.stencilBack.passOp]))}}ue.extension={type:[l.WebGLSystem],name:"stencil"};const _e={f32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"mat2x2<f32>":16*2,"mat3x3<f32>":16*3,"mat4x4<f32>":16*4};function Ke(t){const e=t.map(i=>({data:i,offset:0,size:0}));let r=0,s=0,n=0;for(let i=0;i<e.length;i++){const a=e[i];if(r=_e[a.data.type],!r)throw new Error(`Unknown type ${a.data.type}`);if(a.data.size>1&&(r=Math.max(r,16)*a.data.size),a.size=r,s%r!==0&&s<16){const o=s%r%16;s+=o,n+=o}s+r>16?(n=Math.ceil(n/16)*16,a.offset=n,n+=r,s=r):(a.offset=n,s+=r,n+=r)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function $e(t,e){const r=Math.max(_e[t.data.type]/16,1),s=t.data.value.length/t.data.size,n=(4-s%4)%4;return`
|
|
||||||
v = uv.${t.data.name};
|
|
||||||
offset += ${e};
|
|
||||||
|
|
||||||
arrayOffset = offset;
|
|
||||||
|
|
||||||
t = 0;
|
|
||||||
|
|
||||||
for(var i=0; i < ${t.data.size*r}; i++)
|
|
||||||
{
|
|
||||||
for(var j = 0; j < ${s}; j++)
|
|
||||||
{
|
|
||||||
data[arrayOffset++] = v[t++];
|
|
||||||
}
|
|
||||||
${n!==0?`arrayOffset += ${n};`:""}
|
|
||||||
}
|
|
||||||
`}function ze(t){return Ge(t,"uboStd40",$e,Ue)}class fe extends Oe{constructor(){super({createUboElements:Ke,generateUboSync:ze})}}fe.extension={type:[l.WebGLSystem],name:"ubo"};class Ye{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new H}init(e,r){this._renderer=e,this._renderTargetSystem=r,e.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new H}copyToTexture(e,r,s,n,i){const a=this._renderTargetSystem,o=this._renderer,c=a.getGpuRenderTarget(e),u=o.gl;return this.finishRenderPass(e),u.bindFramebuffer(u.FRAMEBUFFER,c.resolveTargetFramebuffer),o.texture.bind(r,0),u.copyTexSubImage2D(u.TEXTURE_2D,0,i.x,i.y,s.x,s.y,n.width,n.height),r}startRenderPass(e,r=!0,s,n){const i=this._renderTargetSystem,a=e.colorTexture,o=i.getGpuRenderTarget(e);let c=n.y;e.isRoot&&(c=a.pixelHeight-n.height),e.colorTextures.forEach(h=>{this._renderer.texture.unbind(h)});const u=this._renderer.gl;u.bindFramebuffer(u.FRAMEBUFFER,o.framebuffer);const _=this._viewPortCache;(_.x!==n.x||_.y!==c||_.width!==n.width||_.height!==n.height)&&(_.x=n.x,_.y=c,_.width=n.width,_.height=n.height,u.viewport(n.x,c,n.width,n.height)),!o.depthStencilRenderBuffer&&(e.stencil||e.depth)&&this._initStencil(o),this.clear(e,r,s)}finishRenderPass(e){const s=this._renderTargetSystem.getGpuRenderTarget(e);if(!s.msaa)return;const n=this._renderer.gl;n.bindFramebuffer(n.FRAMEBUFFER,s.resolveTargetFramebuffer),n.bindFramebuffer(n.READ_FRAMEBUFFER,s.framebuffer),n.blitFramebuffer(0,0,s.width,s.height,0,0,s.width,s.height,n.COLOR_BUFFER_BIT,n.NEAREST),n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)}initGpuRenderTarget(e){const r=this._renderer,s=r.gl,n=new je;return e.colorTexture.resource===r.gl.canvas?(n.framebuffer=null,n):(this._initColor(e,n),s.bindFramebuffer(s.FRAMEBUFFER,null),n)}destroyGpuRenderTarget(e){const r=this._renderer.gl;e.framebuffer&&(r.deleteFramebuffer(e.framebuffer),e.framebuffer=null),e.resolveTargetFramebuffer&&(r.deleteFramebuffer(e.resolveTargetFramebuffer),e.resolveTargetFramebuffer=null),e.depthStencilRenderBuffer&&(r.deleteRenderbuffer(e.depthStencilRenderBuffer),e.depthStencilRenderBuffer=null),e.msaaRenderBuffer.forEach(s=>{r.deleteRenderbuffer(s)}),e.msaaRenderBuffer=null}clear(e,r,s){if(!r)return;const n=this._renderTargetSystem;typeof r=="boolean"&&(r=r?A.ALL:A.NONE);const i=this._renderer.gl;if(r&A.COLOR){s??(s=n.defaultClearColor);const a=this._clearColorCache,o=s;(a[0]!==o[0]||a[1]!==o[1]||a[2]!==o[2]||a[3]!==o[3])&&(a[0]=o[0],a[1]=o[1],a[2]=o[2],a[3]=o[3],i.clearColor(o[0],o[1],o[2],o[3]))}i.clear(r)}resizeGpuRenderTarget(e){if(e.isRoot)return;const s=this._renderTargetSystem.getGpuRenderTarget(e);this._resizeColor(e,s),e.stencil&&this._resizeStencil(s)}_initColor(e,r){const s=this._renderer,n=s.gl,i=n.createFramebuffer();if(r.resolveTargetFramebuffer=i,n.bindFramebuffer(n.FRAMEBUFFER,i),r.width=e.colorTexture.source.pixelWidth,r.height=e.colorTexture.source.pixelHeight,e.colorTextures.forEach((a,o)=>{const c=a.source;c.antialias&&(s.context.supports.msaa?r.msaa=!0:m("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),s.texture.bindSource(c,0);const _=s.texture.getGlSource(c).texture;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+o,3553,_,0)}),r.msaa){const a=n.createFramebuffer();r.framebuffer=a,n.bindFramebuffer(n.FRAMEBUFFER,a),e.colorTextures.forEach((o,c)=>{const u=n.createRenderbuffer();r.msaaRenderBuffer[c]=u})}else r.framebuffer=i;this._resizeColor(e,r)}_resizeColor(e,r){const s=e.colorTexture.source;if(r.width=s.pixelWidth,r.height=s.pixelHeight,e.colorTextures.forEach((n,i)=>{i!==0&&n.source.resize(s.width,s.height,s._resolution)}),r.msaa){const n=this._renderer,i=n.gl,a=r.framebuffer;i.bindFramebuffer(i.FRAMEBUFFER,a),e.colorTextures.forEach((o,c)=>{const u=o.source;n.texture.bindSource(u,0);const h=n.texture.getGlSource(u).internalFormat,d=r.msaaRenderBuffer[c];i.bindRenderbuffer(i.RENDERBUFFER,d),i.renderbufferStorageMultisample(i.RENDERBUFFER,4,h,u.pixelWidth,u.pixelHeight),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+c,i.RENDERBUFFER,d)})}}_initStencil(e){if(e.framebuffer===null)return;const r=this._renderer.gl,s=r.createRenderbuffer();e.depthStencilRenderBuffer=s,r.bindRenderbuffer(r.RENDERBUFFER,s),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,s),this._resizeStencil(e)}_resizeStencil(e){const r=this._renderer.gl;r.bindRenderbuffer(r.RENDERBUFFER,e.depthStencilRenderBuffer),e.msaa?r.renderbufferStorageMultisample(r.RENDERBUFFER,4,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,this._renderer.context.webGLVersion===2?r.DEPTH24_STENCIL8:r.DEPTH_STENCIL,e.width,e.height)}}class he extends Pe{constructor(e){super(e),this.adaptor=new Ye,this.adaptor.init(e,this)}}he.extension={type:[l.WebGLSystem],name:"renderTarget"};function qe(t,e){const r=[],s=[`
|
|
||||||
var g = s.groups;
|
|
||||||
var sS = r.shader;
|
|
||||||
var p = s.glProgram;
|
|
||||||
var ugS = r.uniformGroup;
|
|
||||||
var resources;
|
|
||||||
`];let n=!1,i=0,a=0;const o=e._getProgramData(t.glProgram);for(const u in t.groups){const _=t.groups[u];r.push(`
|
|
||||||
resources = g[${u}].resources;
|
|
||||||
`);for(const h in _.resources){const d=_.resources[h];if(d instanceof F)d.ubo?r.push(`
|
|
||||||
sS.bindUniformBlock(
|
|
||||||
resources[${h}],
|
|
||||||
sS._uniformBindMap[${u}[${h}],
|
|
||||||
${i++}
|
|
||||||
);
|
|
||||||
`):r.push(`
|
|
||||||
ugS.updateUniformGroup(resources[${h}], p, sD);
|
|
||||||
`);else if(d instanceof ee)r.push(`
|
|
||||||
sS.bindUniformBlock(
|
|
||||||
resources[${h}],
|
|
||||||
sS._uniformBindMap[${u}[${h}],
|
|
||||||
${i++}
|
|
||||||
);
|
|
||||||
`);else if(d instanceof $){const E=t._uniformBindMap[u][h],b=o.uniformData[E];b&&(n||(n=!0,s.push(`
|
|
||||||
var tS = r.texture;
|
|
||||||
`)),e._gl.uniform1i(b.location,a),r.push(`
|
|
||||||
tS.bind(resources[${h}], ${a});
|
|
||||||
`),a++)}}}const c=[...s,...r].join(`
|
|
||||||
`);return new Function("r","s","sD",c)}class Ze{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null}}function k(t,e,r){const s=t.createShader(e);return t.shaderSource(s,r),t.compileShader(s),s}function I(t){const e=new Array(t);for(let r=0;r<e.length;r++)e[r]=!1;return e}function le(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return I(2*e);case"bvec3":return I(3*e);case"bvec4":return I(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}let g=null;const V={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"},Qe={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"};function de(t,e){if(!g){const r=Object.keys(V);g={};for(let s=0;s<r.length;++s){const n=r[s];g[t[n]]=V[n]}}return g[e]}function Je(t,e){const r=de(t,e);return Qe[r]||"float32"}function et(t,e,r=!1){const s={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let a=0;a<n;a++){const o=e.getActiveAttrib(t,a);if(o.name.startsWith("gl_"))continue;const c=Je(e,o.type);s[o.name]={location:0,format:c,stride:Z(c).stride,offset:0,instance:!1,start:0}}const i=Object.keys(s);if(r){i.sort((a,o)=>a>o?1:-1);for(let a=0;a<i.length;a++)s[i[a]].location=a,e.bindAttribLocation(t,a,i[a]);e.linkProgram(t)}else for(let a=0;a<i.length;a++)s[i[a]].location=e.getAttribLocation(t,i[a]);return s}function tt(t,e){if(!e.ACTIVE_UNIFORM_BLOCKS)return{};const r={},s=e.getProgramParameter(t,e.ACTIVE_UNIFORM_BLOCKS);for(let n=0;n<s;n++){const i=e.getActiveUniformBlockName(t,n),a=e.getUniformBlockIndex(t,i),o=e.getActiveUniformBlockParameter(t,n,e.UNIFORM_BLOCK_DATA_SIZE);r[i]={name:i,index:a,size:o}}return r}function rt(t,e){const r={},s=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<s;n++){const i=e.getActiveUniform(t,n),a=i.name.replace(/\[.*?\]$/,""),o=!!i.name.match(/\[.*?\]$/),c=de(e,i.type);r[a]={name:a,index:n,type:c,size:i.size,isArray:o,value:le(c,i.size)}}return r}function X(t,e){const r=t.getShaderSource(e).split(`
|
|
||||||
`).map((u,_)=>`${_}: ${u}`),s=t.getShaderInfoLog(e),n=s.split(`
|
|
||||||
`),i={},a=n.map(u=>parseFloat(u.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(u=>u&&!i[u]?(i[u]=!0,!0):!1),o=[""];a.forEach(u=>{r[u-1]=`%c${r[u-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const c=r.join(`
|
|
||||||
`);o[0]=c,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function st(t,e,r,s){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||X(t,r),t.getShaderParameter(s,t.COMPILE_STATUS)||X(t,s),console.error("PixiJS Error: Could not initialize shader."),t.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}function nt(t,e){const r=k(t,t.VERTEX_SHADER,e.vertex),s=k(t,t.FRAGMENT_SHADER,e.fragment),n=t.createProgram();t.attachShader(n,r),t.attachShader(n,s);const i=e.transformFeedbackVaryings;i&&(typeof t.transformFeedbackVaryings!="function"?m("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(n,i.names,i.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||st(t,n,r,s),e._attributeData=et(n,t,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=rt(n,t),e._uniformBlockData=tt(n,t),t.deleteShader(r),t.deleteShader(s);const a={};for(const c in e._uniformData){const u=e._uniformData[c];a[c]={location:t.getUniformLocation(n,c),value:le(u.type,u.size)}}return new Ze(n,a)}const R={textureCount:0,blockIndex:0};class me{constructor(e){this._activeProgram=null,this._programDataHash=Object.create(null),this._nextIndex=0,this._boundUniformsIdsToIndexHash=Object.create(null),this._boundIndexToUniformsHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=e}contextChange(e){this._gl=e,this._maxBindings=e.MAX_UNIFORM_BUFFER_BINDINGS?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0,this._programDataHash=Object.create(null),this._boundUniformsIdsToIndexHash=Object.create(null),this._boundIndexToUniformsHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null}bind(e,r){if(this._setProgram(e.glProgram),r)return;R.textureCount=0,R.blockIndex=0;let s=this._shaderSyncFunctions[e.glProgram._key];s||(s=this._shaderSyncFunctions[e.glProgram._key]=this._generateShaderSync(e,this)),s(this._renderer,e,R)}updateUniformGroup(e){this._renderer.uniformGroup.updateUniformGroup(e,this._activeProgram,R)}bindUniformBlock(e,r,s=0){const n=this._renderer.buffer,i=this._getProgramData(this._activeProgram),a=e._bufferResource;a&&this._renderer.ubo.updateUniformGroup(e),n.updateBuffer(e.buffer);let o=this._boundUniformsIdsToIndexHash[e.uid];if(o===void 0){const _=this._nextIndex++%this._maxBindings,h=this._boundIndexToUniformsHash[_];h&&(this._boundUniformsIdsToIndexHash[h.uid]=void 0),o=this._boundUniformsIdsToIndexHash[e.uid]=_,this._boundIndexToUniformsHash[_]=e,a?n.bindBufferRange(e.buffer,_,e.offset):n.bindBufferBase(e.buffer,_)}const c=this._gl,u=this._activeProgram._uniformBlockData[r].index;i.uniformBlockBindings[s]!==o&&(i.uniformBlockBindings[s]=o,c.uniformBlockBinding(i.program,u,o))}_setProgram(e){if(this._activeProgram===e)return;this._activeProgram=e;const r=this._getProgramData(e);this._gl.useProgram(r.program)}_getProgramData(e){return this._programDataHash[e._key]||this._createProgramData(e)}_createProgramData(e){const r=e._key;return this._programDataHash[r]=nt(this._gl,e),this._programDataHash[r]}destroy(){for(const e of Object.keys(this._programDataHash))this._programDataHash[e].destroy(),this._programDataHash[e]=null;this._programDataHash=null,this._boundUniformsIdsToIndexHash=null}_generateShaderSync(e,r){return qe(e,r)}}me.extension={type:[l.WebGLSystem],name:"shader"};const it={f32:`if (cv !== v) {
|
|
||||||
cu.value = v;
|
|
||||||
gl.uniform1f(location, v);
|
|
||||||
}`,"vec2<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
gl.uniform2f(location, v[0], v[1]);
|
|
||||||
}`,"vec3<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
cv[2] = v[2];
|
|
||||||
gl.uniform3f(location, v[0], v[1], v[2]);
|
|
||||||
}`,"vec4<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
cv[2] = v[2];
|
|
||||||
cv[3] = v[3];
|
|
||||||
gl.uniform4f(location, v[0], v[1], v[2], v[3]);
|
|
||||||
}`,i32:`if (cv !== v) {
|
|
||||||
cu.value = v;
|
|
||||||
gl.uniform1i(location, v);
|
|
||||||
}`,"vec2<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
gl.uniform2i(location, v[0], v[1]);
|
|
||||||
}`,"vec3<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
cv[2] = v[2];
|
|
||||||
gl.uniform3i(location, v[0], v[1], v[2]);
|
|
||||||
}`,"vec4<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
cv[2] = v[2];
|
|
||||||
cv[3] = v[3];
|
|
||||||
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
|
|
||||||
}`,u32:`if (cv !== v) {
|
|
||||||
cu.value = v;
|
|
||||||
gl.uniform1ui(location, v);
|
|
||||||
}`,"vec2<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
gl.uniform2ui(location, v[0], v[1]);
|
|
||||||
}`,"vec3<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
cv[2] = v[2];
|
|
||||||
gl.uniform3ui(location, v[0], v[1], v[2]);
|
|
||||||
}`,"vec4<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
cv[2] = v[2];
|
|
||||||
cv[3] = v[3];
|
|
||||||
gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
|
|
||||||
}`,bool:`if (cv !== v) {
|
|
||||||
cu.value = v;
|
|
||||||
gl.uniform1i(location, v);
|
|
||||||
}`,"vec2<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
gl.uniform2i(location, v[0], v[1]);
|
|
||||||
}`,"vec3<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
cv[2] = v[2];
|
|
||||||
gl.uniform3i(location, v[0], v[1], v[2]);
|
|
||||||
}`,"vec4<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
|
||||||
cv[0] = v[0];
|
|
||||||
cv[1] = v[1];
|
|
||||||
cv[2] = v[2];
|
|
||||||
cv[3] = v[3];
|
|
||||||
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
|
|
||||||
}`,"mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},at={f32:"gl.uniform1fv(location, v);","vec2<f32>":"gl.uniform2fv(location, v);","vec3<f32>":"gl.uniform3fv(location, v);","vec4<f32>":"gl.uniform4fv(location, v);","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2<i32>":"gl.uniform2iv(location, v);","vec3<i32>":"gl.uniform3iv(location, v);","vec4<i32>":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2<u32>":"gl.uniform2iv(location, v);","vec3<u32>":"gl.uniform3iv(location, v);","vec4<u32>":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2<bool>":"gl.uniform2iv(location, v);","vec3<bool>":"gl.uniform3iv(location, v);","vec4<bool>":"gl.uniform4iv(location, v);"};function ot(t,e){const r=[`
|
|
||||||
var v = null;
|
|
||||||
var cv = null;
|
|
||||||
var cu = null;
|
|
||||||
var t = 0;
|
|
||||||
var gl = renderer.gl;
|
|
||||||
var name = null;
|
|
||||||
`];for(const s in t.uniforms){if(!e[s]){t.uniforms[s]instanceof F?t.uniforms[s].ubo?r.push(`
|
|
||||||
renderer.shader.bindUniformBlock(uv.${s}, "${s}");
|
|
||||||
`):r.push(`
|
|
||||||
renderer.shader.updateUniformGroup(uv.${s});
|
|
||||||
`):t.uniforms[s]instanceof ee&&r.push(`
|
|
||||||
renderer.shader.bindBufferResource(uv.${s}, "${s}");
|
|
||||||
`);continue}const n=t.uniformStructures[s];let i=!1;for(let a=0;a<N.length;a++){const o=N[a];if(n.type===o.type&&o.test(n)){r.push(`name = "${s}";`,N[a].uniform),i=!0;break}}if(!i){const o=(n.size===1?it:at)[n.type].replace("location",`ud["${s}"].location`);r.push(`
|
|
||||||
cu = ud["${s}"];
|
|
||||||
cv = cu.value;
|
|
||||||
v = uv["${s}"];
|
|
||||||
${o};`)}}return new Function("ud","uv","renderer","syncData",r.join(`
|
|
||||||
`))}class Ee{constructor(e){this._cache={},this._uniformGroupSyncHash={},this._renderer=e,this.gl=null,this._cache={}}contextChange(e){this.gl=e}updateUniformGroup(e,r,s){const n=this._renderer.shader._getProgramData(r);(!e.isStatic||e._dirtyId!==n.uniformDirtyGroups[e.uid])&&(n.uniformDirtyGroups[e.uid]=e._dirtyId,this._getUniformSyncFunction(e,r)(n.uniformData,e.uniforms,this._renderer,s))}_getUniformSyncFunction(e,r){return this._uniformGroupSyncHash[e._signature]?.[r._key]||this._createUniformSyncFunction(e,r)}_createUniformSyncFunction(e,r){const s=this._uniformGroupSyncHash[e._signature]||(this._uniformGroupSyncHash[e._signature]={}),n=this._getSignature(e,r._uniformData,"u");return this._cache[n]||(this._cache[n]=this._generateUniformsSync(e,r._uniformData)),s[r._key]=this._cache[n],s[r._key]}_generateUniformsSync(e,r){return ot(e,r)}_getSignature(e,r,s){const n=e.uniforms,i=[`${s}-`];for(const a in n)i.push(a),r[a]&&i.push(r[a].type);return i.join("-")}destroy(){this._renderer=null,this._cache=null}}Ee.extension={type:[l.WebGLSystem],name:"uniformGroup"};function ct(t){const e={};return e.normal=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e.add=[t.ONE,t.ONE],e.multiply=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.screen=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e["screen-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.erase=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e}const ut=0,_t=1,ft=2,ht=3,lt=4,dt=5,be=class C{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[ut]=this.setBlend,this.map[_t]=this.setOffset,this.map[ft]=this.setCullFace,this.map[ht]=this.setDepthTest,this.map[lt]=this.setFrontFace,this.map[dt]=this.setDepthMask,this.checks=[],this.defaultState=U.for2d()}contextChange(e){this.gl=e,this.blendModesMap=ct(e),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let r=this.stateId^e.data,s=0;for(;r;)r&1&&this.map[s].call(this,!!(e.data&1<<s)),r=r>>1,s++;this.stateId=e.data}for(let r=0;r<this.checks.length;r++)this.checks[r](this,e)}forceState(e){e=e||this.defaultState;for(let r=0;r<this.map.length;r++)this.map[r].call(this,!!(e.data&1<<r));for(let r=0;r<this.checks.length;r++)this.checks[r](this,e);this.stateId=e.data}setBlend(e){this._updateCheck(C._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this._updateCheck(C._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])}setBlendMode(e){if(this.blendModesMap[e]||(e="normal"),e===this.blendMode)return;this.blendMode=e;const r=this.blendModesMap[e],s=this.gl;r.length===2?s.blendFunc(r[0],r[1]):s.blendFuncSeparate(r[0],r[1],r[2],r[3]),r.length===6?(this._blendEq=!0,s.blendEquationSeparate(r[4],r[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(e,r){this.gl.polygonOffset(e,r)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(e,r){const s=this.checks.indexOf(e);r&&s===-1?this.checks.push(e):!r&&s!==-1&&this.checks.splice(s,1)}static _checkBlendMode(e,r){e.setBlendMode(r.blendMode)}static _checkPolygonOffset(e,r){e.setPolygonOffset(1,r.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};be.extension={type:[l.WebGLSystem],name:"state"};let mt=be;class Et{constructor(e){this.target=ne.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=f.UNSIGNED_BYTE,this.internalFormat=D.RGBA,this.format=D.RGBA,this.samplerType=0}}const bt={id:"buffer",upload(t,e,r){e.width===t.width||e.height===t.height?r.texSubImage2D(r.TEXTURE_2D,0,0,0,t.width,t.height,e.format,e.type,t.resource):r.texImage2D(e.target,0,e.internalFormat,t.width,t.height,0,e.format,e.type,t.resource),e.width=t.width,e.height=t.height}},St={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},pt={id:"compressed",upload(t,e,r){r.pixelStorei(r.UNPACK_ALIGNMENT,4);let s=t.pixelWidth,n=t.pixelHeight;const i=!!St[t.format];for(let a=0;a<t.resource.length;a++){const o=t.resource[a];i?r.compressedTexImage2D(r.TEXTURE_2D,a,e.internalFormat,s,n,0,o):r.texImage2D(r.TEXTURE_2D,a,e.internalFormat,s,n,0,e.format,e.type,o),s=Math.max(s>>1,1),n=Math.max(n>>1,1)}}},Se={id:"image",upload(t,e,r,s){const n=t.alphaMode==="premultiply-alpha-on-upload";r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n);const i=e.width,a=e.height,o=t.pixelWidth,c=t.pixelHeight,u=t.resourceWidth,_=t.resourceHeight;u<o||_<c?((i!==o||a!==c)&&r.texImage2D(e.target,0,e.internalFormat,o,c,0,e.format,e.type,null),s===2?r.texSubImage2D(r.TEXTURE_2D,0,0,0,u,_,e.format,e.type,t.resource):r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.format,e.type,t.resource)):i===o||a===c?r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.format,e.type,t.resource):s===2?r.texImage2D(e.target,0,e.internalFormat,o,c,0,e.format,e.type,t.resource):r.texImage2D(e.target,0,e.internalFormat,e.format,e.type,t.resource),e.width=o,e.height=c}},gt={id:"video",upload(t,e,r,s){if(!t.isValid){r.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null);return}Se.upload(t,e,r,s)}},W={linear:9729,nearest:9728},Rt={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},y={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},Tt={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function j(t,e,r,s,n,i,a,o){const c=i;if(!o||t.addressModeU!=="repeat"||t.addressModeV!=="repeat"||t.addressModeW!=="repeat"){const u=y[a?"clamp-to-edge":t.addressModeU],_=y[a?"clamp-to-edge":t.addressModeV],h=y[a?"clamp-to-edge":t.addressModeW];e[n](c,e.TEXTURE_WRAP_S,u),e[n](c,e.TEXTURE_WRAP_T,_),e.TEXTURE_WRAP_R&&e[n](c,e.TEXTURE_WRAP_R,h)}if((!o||t.magFilter!=="linear")&&e[n](c,e.TEXTURE_MAG_FILTER,W[t.magFilter]),r){if(!o||t.mipmapFilter!=="linear"){const u=Rt[t.minFilter][t.mipmapFilter];e[n](c,e.TEXTURE_MIN_FILTER,u)}}else e[n](c,e.TEXTURE_MIN_FILTER,W[t.minFilter]);if(s&&t.maxAnisotropy>1){const u=Math.min(t.maxAnisotropy,e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[n](c,s.TEXTURE_MAX_ANISOTROPY_EXT,u)}t.compare&&e[n](c,e.TEXTURE_COMPARE_FUNC,Tt[t.compare])}function vt(t){return{r8unorm:t.RED,r8snorm:t.RED,r8uint:t.RED,r8sint:t.RED,r16uint:t.RED,r16sint:t.RED,r16float:t.RED,rg8unorm:t.RG,rg8snorm:t.RG,rg8uint:t.RG,rg8sint:t.RG,r32uint:t.RED,r32sint:t.RED,r32float:t.RED,rg16uint:t.RG,rg16sint:t.RG,rg16float:t.RG,rgba8unorm:t.RGBA,"rgba8unorm-srgb":t.RGBA,rgba8snorm:t.RGBA,rgba8uint:t.RGBA,rgba8sint:t.RGBA,bgra8unorm:t.RGBA,"bgra8unorm-srgb":t.RGBA,rgb9e5ufloat:t.RGB,rgb10a2unorm:t.RGBA,rg11b10ufloat:t.RGB,rg32uint:t.RG,rg32sint:t.RG,rg32float:t.RG,rgba16uint:t.RGBA,rgba16sint:t.RGBA,rgba16float:t.RGBA,rgba32uint:t.RGBA,rgba32sint:t.RGBA,rgba32float:t.RGBA,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT,depth24plus:t.DEPTH_COMPONENT,"depth24plus-stencil8":t.DEPTH_STENCIL,depth32float:t.DEPTH_COMPONENT,"depth32float-stencil8":t.DEPTH_STENCIL}}function xt(t,e){let r={},s=t.RGBA;return t instanceof G.get().getWebGLRenderingContext()?e.srgb&&(r={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(r={"rgba8unorm-srgb":t.SRGB8_ALPHA8,"bgra8unorm-srgb":t.SRGB8_ALPHA8},s=t.RGBA8),{r8unorm:t.R8,r8snorm:t.R8_SNORM,r8uint:t.R8UI,r8sint:t.R8I,r16uint:t.R16UI,r16sint:t.R16I,r16float:t.R16F,rg8unorm:t.RG8,rg8snorm:t.RG8_SNORM,rg8uint:t.RG8UI,rg8sint:t.RG8I,r32uint:t.R32UI,r32sint:t.R32I,r32float:t.R32F,rg16uint:t.RG16UI,rg16sint:t.RG16I,rg16float:t.RG16F,rgba8unorm:t.RGBA,...r,rgba8snorm:t.RGBA8_SNORM,rgba8uint:t.RGBA8UI,rgba8sint:t.RGBA8I,bgra8unorm:s,rgb9e5ufloat:t.RGB9_E5,rgb10a2unorm:t.RGB10_A2,rg11b10ufloat:t.R11F_G11F_B10F,rg32uint:t.RG32UI,rg32sint:t.RG32I,rg32float:t.RG32F,rgba16uint:t.RGBA16UI,rgba16sint:t.RGBA16I,rgba16float:t.RGBA16F,rgba32uint:t.RGBA32UI,rgba32sint:t.RGBA32I,rgba32float:t.RGBA32F,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT16,depth24plus:t.DEPTH_COMPONENT24,"depth24plus-stencil8":t.DEPTH24_STENCIL8,depth32float:t.DEPTH_COMPONENT32F,"depth32float-stencil8":t.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}function Bt(t){return{r8unorm:t.UNSIGNED_BYTE,r8snorm:t.BYTE,r8uint:t.UNSIGNED_BYTE,r8sint:t.BYTE,r16uint:t.UNSIGNED_SHORT,r16sint:t.SHORT,r16float:t.HALF_FLOAT,rg8unorm:t.UNSIGNED_BYTE,rg8snorm:t.BYTE,rg8uint:t.UNSIGNED_BYTE,rg8sint:t.BYTE,r32uint:t.UNSIGNED_INT,r32sint:t.INT,r32float:t.FLOAT,rg16uint:t.UNSIGNED_SHORT,rg16sint:t.SHORT,rg16float:t.HALF_FLOAT,rgba8unorm:t.UNSIGNED_BYTE,"rgba8unorm-srgb":t.UNSIGNED_BYTE,rgba8snorm:t.BYTE,rgba8uint:t.UNSIGNED_BYTE,rgba8sint:t.BYTE,bgra8unorm:t.UNSIGNED_BYTE,"bgra8unorm-srgb":t.UNSIGNED_BYTE,rgb9e5ufloat:t.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:t.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:t.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:t.UNSIGNED_INT,rg32sint:t.INT,rg32float:t.FLOAT,rgba16uint:t.UNSIGNED_SHORT,rgba16sint:t.SHORT,rgba16float:t.HALF_FLOAT,rgba32uint:t.UNSIGNED_INT,rgba32sint:t.INT,rgba32float:t.FLOAT,stencil8:t.UNSIGNED_BYTE,depth16unorm:t.UNSIGNED_SHORT,depth24plus:t.UNSIGNED_INT,"depth24plus-stencil8":t.UNSIGNED_INT_24_8,depth32float:t.FLOAT,"depth32float-stencil8":t.FLOAT_32_UNSIGNED_INT_24_8_REV}}const At=4;class pe{constructor(e){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:Se,buffer:bt,video:gt,compressed:pt},this._useSeparateSamplers=!1,this._renderer=e}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=xt(e,this._renderer.context.extensions),this._mapFormatToType=Bt(e),this._mapFormatToFormat=vt(e)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let r=0;r<16;r++)this.bind(S.EMPTY,r)}initSource(e){this.bind(e)}bind(e,r=0){const s=e.source;e?(this.bindSource(s,r),this._useSeparateSamplers&&this._bindSampler(s.style,r)):(this.bindSource(null,r),this._useSeparateSamplers&&this._bindSampler(null,r))}bindSource(e,r=0){const s=this._gl;if(e._touched=this._renderer.textureGC.count,this._boundTextures[r]!==e){this._boundTextures[r]=e,this._activateLocation(r),e=e||S.EMPTY.source;const n=this.getGlSource(e);s.bindTexture(n.target,n.texture)}}_bindSampler(e,r=0){const s=this._gl;if(!e){this._boundSamplers[r]=null,s.bindSampler(r,null);return}const n=this._getGlSampler(e);this._boundSamplers[r]!==n&&(this._boundSamplers[r]=n,s.bindSampler(r,n))}unbind(e){const r=e.source,s=this._boundTextures,n=this._gl;for(let i=0;i<s.length;i++)if(s[i]===r){this._activateLocation(i);const a=this.getGlSource(r);n.bindTexture(a.target,null),s[i]=null}}_activateLocation(e){this._activeTextureLocation!==e&&(this._activeTextureLocation=e,this._gl.activeTexture(this._gl.TEXTURE0+e))}_initSource(e){const r=this._gl,s=new Et(r.createTexture());if(s.type=this._mapFormatToType[e.format],s.internalFormat=this._mapFormatToInternalFormat[e.format],s.format=this._mapFormatToFormat[e.format],e.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||e.isPowerOfTwo)){const n=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(n))+1}return this._glTextures[e.uid]=s,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),this.updateStyle(e,!1),s}onStyleChange(e){this.updateStyle(e,!1)}updateStyle(e,r){const s=this._gl,n=this.getGlSource(e);s.bindTexture(s.TEXTURE_2D,n.texture),this._boundTextures[this._activeTextureLocation]=e,j(e.style,s,e.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",s.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,r)}onSourceUnload(e){const r=this._glTextures[e.uid];r&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(r.texture))}onSourceUpdate(e){const r=this._gl,s=this.getGlSource(e);r.bindTexture(r.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=e,this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,s,r,this._renderer.context.webGLVersion):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.pixelWidth,e.pixelHeight,0,r.RGBA,r.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,!1)}onUpdateMipmaps(e,r=!0){r&&this.bindSource(e,0);const s=this.getGlSource(e);this._gl.generateMipmap(s.target)}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}_initSampler(e){const r=this._gl,s=this._gl.createSampler();return this._glSamplers[e._resourceId]=s,j(e,r,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){const{pixels:r,width:s,height:n}=this.getPixels(e),i=G.get().createCanvas();i.width=s,i.height=n;const a=i.getContext("2d");if(a){const o=a.createImageData(s,n);o.data.set(r),a.putImageData(o,0,0)}return i}getPixels(e){const r=e.source.resolution,s=e.frame,n=Math.max(Math.round(s.width*r),1),i=Math.max(Math.round(s.height*r),1),a=new Uint8Array(At*n*i),o=this._renderer,c=o.renderTarget.getRenderTarget(e),u=o.renderTarget.getGpuRenderTarget(c),_=o.gl;return _.bindFramebuffer(_.FRAMEBUFFER,u.resolveTargetFramebuffer),_.readPixels(Math.round(s.x*r),Math.round(s.y*r),n,i,_.RGBA,_.UNSIGNED_BYTE,a),{pixels:new Uint8ClampedArray(a.buffer),width:n,height:i}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null,this._renderer=null}}pe.extension={type:[l.WebGLSystem],name:"texture"};class ge{init(){const e=new F({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new z,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),r=K(),s=O({name:"graphics",bits:[Y,q(r),Q,P]});this.shader=new x({glProgram:s,resources:{localUniforms:e,batchSamplers:J(r)}})}execute(e,r){const s=r.context,n=s.customShader||this.shader,i=e.renderer,a=i.graphicsContext,{geometry:o,instructions:c}=a.getContextRenderData(s);n.groups[0]=i.globalUniforms.bindGroup,i.state.set(e.state),i.shader.bind(n),i.geometry.bind(o,n.glProgram);const u=c.instructions;for(let _=0;_<c.instructionSize;_++){const h=u[_];if(h.size){for(let d=0;d<h.textures.textures.length;d++)i.texture.bind(h.textures.textures[d],d);i.geometry.draw("triangle-list",h.size,h.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}ge.extension={type:[l.WebGLPipesAdaptor],name:"graphics"};class Re{init(){const e=O({name:"mesh",bits:[Q,Fe,P]});this._shader=new x({glProgram:e,resources:{uTexture:S.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new z}}}})}execute(e,r){const s=e.renderer;let n=r._shader;if(n){if(!n.glProgram){m("Mesh shader has no glProgram",r.shader);return}}else{n=this._shader;const i=r.texture,a=i.source;n.resources.uTexture=a,n.resources.uSampler=a.style,n.resources.textureUniforms.uniforms.uTextureMatrix=i.textureMatrix.mapCoord}n.groups[100]=s.globalUniforms.bindGroup,n.groups[101]=e.localUniformsBindGroup,s.encoder.draw({geometry:r._geometry,shader:n,state:r.state})}destroy(){this._shader.destroy(!0),this._shader=null}}Re.extension={type:[l.WebGLPipesAdaptor],name:"mesh"};const Nt=[...Me,fe,We,we,re,pe,he,ie,Ee,me,ce,mt,ue,oe],It=[...Le],yt=[te,Re,ge],Te=[],ve=[],xe=[];v.handleByNamedList(l.WebGLSystem,Te);v.handleByNamedList(l.WebGLPipes,ve);v.handleByNamedList(l.WebGLPipesAdaptor,xe);v.add(...Nt,...It,...yt);kt=class extends Ne{constructor(){const e={name:"webgl",type:ye.WEBGL,systems:Te,renderPipes:ve,renderPipeAdaptors:xe};super(e)}}});export{kt as WebGLRenderer,__tla};
|
|
||||||
156
qbit/vuetorrent/public/assets/WebGLRenderer-DlZELJmP.js
Normal file
156
qbit/vuetorrent/public/assets/WebGLRenderer-DlZELJmP.js
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
import{E as d,B as T,w as m,D as b,N as j,a6 as Te,x as Be,t as C,v as S,k as K,S as p,V as M,i as B,j as L,l as G,q as $,M as z,a7 as Y,a8 as Ae,a9 as Ne,aa as q,ab as ye,e as x,A as Ie,R as De}from"./TorrentDetail-CoyYqyCA.js";import{S as U,b as Z}from"./colorToUniform-C2GHuDhf.js";import{e as Ce,G as Ge,c as Ue,b as Oe,U as Pe,R as Fe,B as Q,d as A,f as Me,S as Le,a as He}from"./SharedSystems-B1uG7cSA.js";import"./ColoredChip.vue_vue_type_script_setup_true_lang-DosC_URk.js";import"./index-BhWmfNB5.js";import"./vue-DFryKk-1.js";import"./vuetify-XtA0Y0Oj.js";class J{constructor(){this._didUpload=!1,this._tempState=U.for2d()}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUpload=!1}start(e,r,s){const n=e.renderer;n.shader.bind(s,this._didUpload),n.shader.updateUniformGroup(n.globalUniforms.uniformGroup),n.geometry.bind(r,s.glProgram)}execute(e,r){const s=e.renderer;this._didUpload=!0,this._tempState.blendMode=r.blendMode,s.state.set(this._tempState);const n=r.textures.textures;for(let i=0;i<r.textures.count;i++)s.texture.bind(n[i],i);s.geometry.draw(r.topology,r.size,r.start)}}J.extension={type:[d.WebGLPipesAdaptor],name:"batch"};var v=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(v||{});class we{constructor(e,r){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}}class ee{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers")}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){const e=this._gl=this._renderer.gl;this._gpuBuffers=Object.create(null),this._maxBindings=e.MAX_UNIFORM_BUFFER_BINDINGS?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,s=this.getGlBuffer(e);r.bindBuffer(s.type,s.buffer)}bindBufferBase(e,r){const{_gl:s}=this;this._boundBufferBases[r]!==e&&(this._boundBufferBases[r]=e,e._lastBindBaseLocation=r,s.bindBufferBase(s.UNIFORM_BUFFER,r,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let r=this.getLastBindBaseLocation(e);if(r>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,r;let s=0,n=this._nextBindBaseIndex;for(;s<2;){n>=this._maxBindings&&(n=this._minBaseLocation,s++);const i=this._boundBufferBases[n];if(i&&i._lastBindCallId===this._bindCallId){n++;continue}break}return r=n,this._nextBindBaseIndex=n+1,s>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[r]=null,r)}getLastBindBaseLocation(e){const r=e._lastBindBaseLocation;return this._boundBufferBases[r]===e?r:-1}bindBufferRange(e,r,s,n){const{_gl:i}=this;s||(s=0),r||(r=0),this._boundBufferBases[r]=null,i.bindBufferRange(i.UNIFORM_BUFFER,r||0,e.buffer,s*256,n||256)}updateBuffer(e){const{_gl:r}=this,s=this.getGlBuffer(e);if(e._updateID===s.updateID)return s;s.updateID=e._updateID,r.bindBuffer(s.type,s.buffer);const n=e.data,i=e.descriptor.usage&T.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;return n?s.byteLength>=n.byteLength?r.bufferSubData(s.type,0,n,0,e._updateSize/n.BYTES_PER_ELEMENT):(s.byteLength=n.byteLength,r.bufferData(s.type,n,i)):(s.byteLength=e.descriptor.size,r.bufferData(s.type,s.byteLength,i)),s}destroyAll(){const e=this._gl;for(const r in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[r].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,r){const s=this._gpuBuffers[e.uid],n=this._gl;r||n.deleteBuffer(s.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){const{_gl:r}=this;let s=v.ARRAY_BUFFER;e.descriptor.usage&T.INDEX?s=v.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&T.UNIFORM&&(s=v.UNIFORM_BUFFER);const n=new we(r.createBuffer(),s);return this._gpuBuffers[e.uid]=n,e.on("destroy",this.onBufferDestroy,this),n}}ee.extension={type:[d.WebGLSystem],name:"buffer"};const O=class te{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...te.defaultOptions,...e};let r=this.multiView=e.multiView;if(e.context&&r&&(m("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),r?this.canvas=b.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const s=this._renderer.background.alpha<1,n=e.premultipliedAlpha??!0,i=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:s,premultipliedAlpha:n,antialias:i,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&m("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:r}=this;(r.width<e.width||r.height<e.height)&&(r.width=Math.max(e.width,e.width),r.height=Math.max(e.height,e.height))}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof b.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const r=this._renderer.view.canvas;r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,r){let s;const n=this.canvas;if(e===2&&(s=n.getContext("webgl2",r)),!s&&(s=n.getContext("webgl",r),!s))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=s,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,r={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...r,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...r,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const s=e.getExtension("WEBGL_provoking_vertex");s&&s.provokingVertexWEBGL(s.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this._renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&m("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=this.supports,n=this.webGLVersion===2,i=this.extensions;s.uint32Indices=n||!!i.uint32ElementIndex,s.uniformBufferObject=n,s.vertexArrayObject=n||!!i.vertexArrayObject,s.srgbTextures=n||!!i.srgb,s.nonPowOf2wrapping=n,s.nonPowOf2mipmaps=n,s.msaa=n,s.uint32Indices||m("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};O.extension={type:[d.WebGLSystem],name:"context"};O.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let Ve=O;var I=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(I||{}),re=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(re||{}),f=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(f||{});const H={uint8x2:f.UNSIGNED_BYTE,uint8x4:f.UNSIGNED_BYTE,sint8x2:f.BYTE,sint8x4:f.BYTE,unorm8x2:f.UNSIGNED_BYTE,unorm8x4:f.UNSIGNED_BYTE,snorm8x2:f.BYTE,snorm8x4:f.BYTE,uint16x2:f.UNSIGNED_SHORT,uint16x4:f.UNSIGNED_SHORT,sint16x2:f.SHORT,sint16x4:f.SHORT,unorm16x2:f.UNSIGNED_SHORT,unorm16x4:f.UNSIGNED_SHORT,snorm16x2:f.SHORT,snorm16x4:f.SHORT,float16x2:f.HALF_FLOAT,float16x4:f.HALF_FLOAT,float32:f.FLOAT,float32x2:f.FLOAT,float32x3:f.FLOAT,float32x4:f.FLOAT,uint32:f.UNSIGNED_INT,uint32x2:f.UNSIGNED_INT,uint32x3:f.UNSIGNED_INT,uint32x4:f.UNSIGNED_INT,sint32:f.INT,sint32x2:f.INT,sint32x3:f.INT,sint32x4:f.INT};function ke(t){return H[t]??H.float32}const Xe={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class se{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash")}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=n=>r.bindVertexArrayOES(n),e.deleteVertexArray=n=>r.deleteVertexArrayOES(n));const s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(e.drawArraysInstanced=(n,i,a,o)=>{s.drawArraysInstancedANGLE(n,i,a,o)},e.drawElementsInstanced=(n,i,a,o,c)=>{s.drawElementsInstancedANGLE(n,i,a,o,c)},e.vertexAttribDivisor=(n,i)=>s.vertexAttribDivisorANGLE(n,i)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,r){const s=this.gl;this._activeGeometry=e;const n=this.getVao(e,r);this._activeVao!==n&&(this._activeVao=n,s.bindVertexArray(n)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let s=0;s<e.buffers.length;s++){const n=e.buffers[s];r.updateBuffer(n)}}checkCompatibility(e,r){const s=e.attributes,n=r._attributeData;for(const i in n)if(!s[i])throw new Error(`shader and geometry incompatible, geometry missing the "${i}" attribute`)}getSignature(e,r){const s=e.attributes,n=r._attributeData,i=["g",e.uid];for(const a in s)n[a]&&i.push(a,n[a].location);return i.join("-")}getVao(e,r){return this._geometryVaoHash[e.uid]?.[r._key]||this.initGeometryVao(e,r)}initGeometryVao(e,r,s=!0){const n=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(r),this.checkCompatibility(e,r);const a=this.getSignature(e,r);this._geometryVaoHash[e.uid]||(this._geometryVaoHash[e.uid]=Object.create(null),e.on("destroy",this.onGeometryDestroy,this));const o=this._geometryVaoHash[e.uid];let c=o[a];if(c)return o[r._key]=c,c;Ce(e,r._attributeData);const u=e.buffers;c=n.createVertexArray(),n.bindVertexArray(c);for(let _=0;_<u.length;_++){const h=u[_];i.bind(h)}return this.activateVao(e,r),o[r._key]=c,o[a]=c,n.bindVertexArray(null),c}onGeometryDestroy(e,r){const s=this._geometryVaoHash[e.uid],n=this.gl;if(s){if(r)for(const i in s)this._activeVao!==s[i]&&this.unbind(),n.deleteVertexArray(s[i]);this._geometryVaoHash[e.uid]=null}}destroyAll(e=!1){const r=this.gl;for(const s in this._geometryVaoHash){if(e)for(const n in this._geometryVaoHash[s]){const i=this._geometryVaoHash[s];this._activeVao!==i&&this.unbind(),r.deleteVertexArray(i[n])}this._geometryVaoHash[s]=null}}activateVao(e,r){const s=this._renderer.gl,n=this._renderer.buffer,i=e.attributes;e.indexBuffer&&n.bind(e.indexBuffer);let a=null;for(const o in i){const c=i[o],u=c.buffer,_=n.getGlBuffer(u),h=r._attributeData[o];if(h){a!==_&&(n.bind(u),a=_);const l=h.location;s.enableVertexAttribArray(l);const E=j(c.format),F=ke(c.format);if(h.format?.substring(1,4)==="int"?s.vertexAttribIPointer(l,E.size,F,c.stride,c.offset):s.vertexAttribPointer(l,E.size,F,E.normalised,c.stride,c.offset),c.instance)if(this.hasInstance){const xe=c.divisor??1;s.vertexAttribDivisor(l,xe)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,s,n){const{gl:i}=this._renderer,a=this._activeGeometry,o=Xe[e||a.topology];if(n??(n=a.instanceCount),a.indexBuffer){const c=a.indexBuffer.data.BYTES_PER_ELEMENT,u=c===2?i.UNSIGNED_SHORT:i.UNSIGNED_INT;n>1?i.drawElementsInstanced(o,r||a.indexBuffer.data.length,u,(s||0)*c,n):i.drawElements(o,r||a.indexBuffer.data.length,u,(s||0)*c)}else n>1?i.drawArraysInstanced(o,s||0,r||a.getSize(),n):i.drawArrays(o,s||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}se.extension={type:[d.WebGLSystem],name:"geometry"};const We=new Te({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),P=class ne{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:s}={...ne.defaultOptions,...e};this.useBackBuffer=r,this._antialias=s,this._renderer.context.supports.msaa||(m("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=U.for2d();const n=new Be({vertex:`
|
||||||
|
attribute vec2 aPosition;
|
||||||
|
out vec2 vUv;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
gl_Position = vec4(aPosition, 0.0, 1.0);
|
||||||
|
|
||||||
|
vUv = (aPosition + 1.0) / 2.0;
|
||||||
|
|
||||||
|
// flip dem UVs
|
||||||
|
vUv.y = 1.0 - vUv.y;
|
||||||
|
}`,fragment:`
|
||||||
|
in vec2 vUv;
|
||||||
|
out vec4 finalColor;
|
||||||
|
|
||||||
|
uniform sampler2D uTexture;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
finalColor = texture(uTexture, vUv);
|
||||||
|
}`,name:"big-triangle"});this._bigTriangleShader=new C({glProgram:n,resources:{uTexture:S.WHITE.source}})}renderStart(e){const r=this._renderer.renderTarget.getRenderTarget(e.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!r.isRoot,this._useBackBufferThisRender){const s=this._renderer.renderTarget.getRenderTarget(e.target);this._targetTexture=s.colorTexture,e.target=this._getBackBufferTexture(s.colorTexture)}}renderEnd(){this._presentBackBuffer()}_presentBackBuffer(){const e=this._renderer;e.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(e.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,e.encoder.draw({geometry:We,shader:this._bigTriangleShader,state:this._state}))}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new S({source:new K({width:e.width,height:e.height,resolution:e._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(e.width,e.height,e._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null)}};P.extension={type:[d.WebGLSystem],name:"backBuffer",priority:1};P.defaultOptions={useBackBuffer:!1};let je=P;class ie{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.gl.colorMask(!!(e&8),!!(e&4),!!(e&2),!!(e&1)))}}ie.extension={type:[d.WebGLSystem],name:"colorMask"};class ae{constructor(e){this.commandFinished=Promise.resolve(),this._renderer=e}setGeometry(e,r){this._renderer.geometry.bind(e,r.glProgram)}finishRenderPass(){}draw(e){const r=this._renderer,{geometry:s,shader:n,state:i,skipSync:a,topology:o,size:c,start:u,instanceCount:_}=e;r.shader.bind(n,a),r.geometry.bind(s,r.shader._activeProgram),i&&r.state.set(i),r.geometry.draw(o,c,u,_??s.instanceCount)}destroy(){this._renderer=null}}ae.extension={type:[d.WebGLSystem],name:"encoder"};class Ke{constructor(){this.width=-1,this.height=-1,this.msaa=!1,this.msaaRenderBuffer=[]}}class oe{constructor(e){this._stencilCache={enabled:!1,stencilReference:0,stencilMode:p.NONE},this._renderTargetStencilState=Object.create(null),e.renderTarget.onRenderTargetChange.add(this)}contextChange(e){this._gl=e,this._comparisonFuncMapping={always:e.ALWAYS,never:e.NEVER,equal:e.EQUAL,"not-equal":e.NOTEQUAL,less:e.LESS,"less-equal":e.LEQUAL,greater:e.GREATER,"greater-equal":e.GEQUAL},this._stencilOpsMapping={keep:e.KEEP,zero:e.ZERO,replace:e.REPLACE,invert:e.INVERT,"increment-clamp":e.INCR,"decrement-clamp":e.DECR,"increment-wrap":e.INCR_WRAP,"decrement-wrap":e.DECR_WRAP},this._stencilCache.enabled=!1,this._stencilCache.stencilMode=p.NONE,this._stencilCache.stencilReference=0}onRenderTargetChange(e){if(this._activeRenderTarget===e)return;this._activeRenderTarget=e;let r=this._renderTargetStencilState[e.uid];r||(r=this._renderTargetStencilState[e.uid]={stencilMode:p.DISABLED,stencilReference:0}),this.setStencilMode(r.stencilMode,r.stencilReference)}setStencilMode(e,r){const s=this._renderTargetStencilState[this._activeRenderTarget.uid],n=this._gl,i=Ge[e],a=this._stencilCache;if(s.stencilMode=e,s.stencilReference=r,e===p.DISABLED){this._stencilCache.enabled&&(this._stencilCache.enabled=!1,n.disable(n.STENCIL_TEST));return}this._stencilCache.enabled||(this._stencilCache.enabled=!0,n.enable(n.STENCIL_TEST)),(e!==a.stencilMode||a.stencilReference!==r)&&(a.stencilMode=e,a.stencilReference=r,n.stencilFunc(this._comparisonFuncMapping[i.stencilBack.compare],r,255),n.stencilOp(n.KEEP,n.KEEP,this._stencilOpsMapping[i.stencilBack.passOp]))}}oe.extension={type:[d.WebGLSystem],name:"stencil"};const ce={f32:4,i32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"vec2<i32>":8,"vec3<i32>":12,"vec4<i32>":16,"mat2x2<f32>":16*2,"mat3x3<f32>":16*3,"mat4x4<f32>":16*4};function $e(t){const e=t.map(i=>({data:i,offset:0,size:0})),r=16;let s=0,n=0;for(let i=0;i<e.length;i++){const a=e[i];if(s=ce[a.data.type],!s)throw new Error(`Unknown type ${a.data.type}`);a.data.size>1&&(s=Math.max(s,r)*a.data.size);const o=s===12?16:s;a.size=s;const c=n%r;c>0&&r-c<o?n+=(r-c)%16:n+=(s-c%s)%s,a.offset=n,n+=s}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function ze(t,e){const r=Math.max(ce[t.data.type]/16,1),s=t.data.value.length/t.data.size,n=(4-s%4)%4,i=t.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
|
||||||
|
v = uv.${t.data.name};
|
||||||
|
offset += ${e};
|
||||||
|
|
||||||
|
arrayOffset = offset;
|
||||||
|
|
||||||
|
t = 0;
|
||||||
|
|
||||||
|
for(var i=0; i < ${t.data.size*r}; i++)
|
||||||
|
{
|
||||||
|
for(var j = 0; j < ${s}; j++)
|
||||||
|
{
|
||||||
|
${i}[arrayOffset++] = v[t++];
|
||||||
|
}
|
||||||
|
${n!==0?`arrayOffset += ${n};`:""}
|
||||||
|
}
|
||||||
|
`}function Ye(t){return Ue(t,"uboStd40",ze,Oe)}class ue extends Pe{constructor(){super({createUboElements:$e,generateUboSync:Ye})}}ue.extension={type:[d.WebGLSystem],name:"ubo"};class qe{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new M}init(e,r){this._renderer=e,this._renderTargetSystem=r,e.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new M}copyToTexture(e,r,s,n,i){const a=this._renderTargetSystem,o=this._renderer,c=a.getGpuRenderTarget(e),u=o.gl;return this.finishRenderPass(e),u.bindFramebuffer(u.FRAMEBUFFER,c.resolveTargetFramebuffer),o.texture.bind(r,0),u.copyTexSubImage2D(u.TEXTURE_2D,0,i.x,i.y,s.x,s.y,n.width,n.height),r}startRenderPass(e,r=!0,s,n){const i=this._renderTargetSystem,a=e.colorTexture,o=i.getGpuRenderTarget(e);let c=n.y;e.isRoot&&(c=a.pixelHeight-n.height),e.colorTextures.forEach(h=>{this._renderer.texture.unbind(h)});const u=this._renderer.gl;u.bindFramebuffer(u.FRAMEBUFFER,o.framebuffer);const _=this._viewPortCache;(_.x!==n.x||_.y!==c||_.width!==n.width||_.height!==n.height)&&(_.x=n.x,_.y=c,_.width=n.width,_.height=n.height,u.viewport(n.x,c,n.width,n.height)),!o.depthStencilRenderBuffer&&(e.stencil||e.depth)&&this._initStencil(o),this.clear(e,r,s)}finishRenderPass(e){const s=this._renderTargetSystem.getGpuRenderTarget(e);if(!s.msaa)return;const n=this._renderer.gl;n.bindFramebuffer(n.FRAMEBUFFER,s.resolveTargetFramebuffer),n.bindFramebuffer(n.READ_FRAMEBUFFER,s.framebuffer),n.blitFramebuffer(0,0,s.width,s.height,0,0,s.width,s.height,n.COLOR_BUFFER_BIT,n.NEAREST),n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)}initGpuRenderTarget(e){const r=this._renderer,s=r.gl,n=new Ke;return e.colorTexture.resource===r.canvas?(this._renderer.context.ensureCanvasSize(e.colorTexture.resource),n.framebuffer=null,n):(this._initColor(e,n),s.bindFramebuffer(s.FRAMEBUFFER,null),n)}destroyGpuRenderTarget(e){const r=this._renderer.gl;e.framebuffer&&(r.deleteFramebuffer(e.framebuffer),e.framebuffer=null),e.resolveTargetFramebuffer&&(r.deleteFramebuffer(e.resolveTargetFramebuffer),e.resolveTargetFramebuffer=null),e.depthStencilRenderBuffer&&(r.deleteRenderbuffer(e.depthStencilRenderBuffer),e.depthStencilRenderBuffer=null),e.msaaRenderBuffer.forEach(s=>{r.deleteRenderbuffer(s)}),e.msaaRenderBuffer=null}clear(e,r,s){if(!r)return;const n=this._renderTargetSystem;typeof r=="boolean"&&(r=r?B.ALL:B.NONE);const i=this._renderer.gl;if(r&B.COLOR){s??(s=n.defaultClearColor);const a=this._clearColorCache,o=s;(a[0]!==o[0]||a[1]!==o[1]||a[2]!==o[2]||a[3]!==o[3])&&(a[0]=o[0],a[1]=o[1],a[2]=o[2],a[3]=o[3],i.clearColor(o[0],o[1],o[2],o[3]))}i.clear(r)}resizeGpuRenderTarget(e){if(e.isRoot)return;const s=this._renderTargetSystem.getGpuRenderTarget(e);this._resizeColor(e,s),(e.stencil||e.depth)&&this._resizeStencil(s)}_initColor(e,r){const s=this._renderer,n=s.gl,i=n.createFramebuffer();if(r.resolveTargetFramebuffer=i,n.bindFramebuffer(n.FRAMEBUFFER,i),r.width=e.colorTexture.source.pixelWidth,r.height=e.colorTexture.source.pixelHeight,e.colorTextures.forEach((a,o)=>{const c=a.source;c.antialias&&(s.context.supports.msaa?r.msaa=!0:m("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),s.texture.bindSource(c,0);const _=s.texture.getGlSource(c).texture;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+o,3553,_,0)}),r.msaa){const a=n.createFramebuffer();r.framebuffer=a,n.bindFramebuffer(n.FRAMEBUFFER,a),e.colorTextures.forEach((o,c)=>{const u=n.createRenderbuffer();r.msaaRenderBuffer[c]=u})}else r.framebuffer=i;this._resizeColor(e,r)}_resizeColor(e,r){const s=e.colorTexture.source;if(r.width=s.pixelWidth,r.height=s.pixelHeight,e.colorTextures.forEach((n,i)=>{i!==0&&n.source.resize(s.width,s.height,s._resolution)}),r.msaa){const n=this._renderer,i=n.gl,a=r.framebuffer;i.bindFramebuffer(i.FRAMEBUFFER,a),e.colorTextures.forEach((o,c)=>{const u=o.source;n.texture.bindSource(u,0);const h=n.texture.getGlSource(u).internalFormat,l=r.msaaRenderBuffer[c];i.bindRenderbuffer(i.RENDERBUFFER,l),i.renderbufferStorageMultisample(i.RENDERBUFFER,4,h,u.pixelWidth,u.pixelHeight),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+c,i.RENDERBUFFER,l)})}}_initStencil(e){if(e.framebuffer===null)return;const r=this._renderer.gl,s=r.createRenderbuffer();e.depthStencilRenderBuffer=s,r.bindRenderbuffer(r.RENDERBUFFER,s),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,s),this._resizeStencil(e)}_resizeStencil(e){const r=this._renderer.gl;r.bindRenderbuffer(r.RENDERBUFFER,e.depthStencilRenderBuffer),e.msaa?r.renderbufferStorageMultisample(r.RENDERBUFFER,4,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,this._renderer.context.webGLVersion===2?r.DEPTH24_STENCIL8:r.DEPTH_STENCIL,e.width,e.height)}prerender(e){const r=e.colorTexture.resource;this._renderer.context.multiView&&L.test(r)&&this._renderer.context.ensureCanvasSize(r)}postrender(e){if(this._renderer.context.multiView&&L.test(e.colorTexture.resource)){const r=this._renderer.context.canvas,s=e.colorTexture;s.context2D.drawImage(r,0,s.pixelHeight-r.height)}}}class _e extends Fe{constructor(e){super(e),this.adaptor=new qe,this.adaptor.init(e,this)}}_e.extension={type:[d.WebGLSystem],name:"renderTarget"};function Ze(t,e){const r=[],s=[`
|
||||||
|
var g = s.groups;
|
||||||
|
var sS = r.shader;
|
||||||
|
var p = s.glProgram;
|
||||||
|
var ugS = r.uniformGroup;
|
||||||
|
var resources;
|
||||||
|
`];let n=!1,i=0;const a=e._getProgramData(t.glProgram);for(const c in t.groups){const u=t.groups[c];r.push(`
|
||||||
|
resources = g[${c}].resources;
|
||||||
|
`);for(const _ in u.resources){const h=u.resources[_];if(h instanceof G)if(h.ubo){const l=t._uniformBindMap[c][Number(_)];r.push(`
|
||||||
|
sS.bindUniformBlock(
|
||||||
|
resources[${_}],
|
||||||
|
'${l}',
|
||||||
|
${t.glProgram._uniformBlockData[l].index}
|
||||||
|
);
|
||||||
|
`)}else r.push(`
|
||||||
|
ugS.updateUniformGroup(resources[${_}], p, sD);
|
||||||
|
`);else if(h instanceof Q){const l=t._uniformBindMap[c][Number(_)];r.push(`
|
||||||
|
sS.bindUniformBlock(
|
||||||
|
resources[${_}],
|
||||||
|
'${l}',
|
||||||
|
${t.glProgram._uniformBlockData[l].index}
|
||||||
|
);
|
||||||
|
`)}else if(h instanceof K){const l=t._uniformBindMap[c][_],E=a.uniformData[l];E&&(n||(n=!0,s.push(`
|
||||||
|
var tS = r.texture;
|
||||||
|
`)),e._gl.uniform1i(E.location,i),r.push(`
|
||||||
|
tS.bind(resources[${_}], ${i});
|
||||||
|
`),i++)}}}const o=[...s,...r].join(`
|
||||||
|
`);return new Function("r","s","sD",o)}class Qe{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null}}function w(t,e,r){const s=t.createShader(e);return t.shaderSource(s,r),t.compileShader(s),s}function N(t){const e=new Array(t);for(let r=0;r<e.length;r++)e[r]=!1;return e}function fe(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return N(2*e);case"bvec3":return N(3*e);case"bvec4":return N(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}let g=null;const V={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"},Je={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"};function he(t,e){if(!g){const r=Object.keys(V);g={};for(let s=0;s<r.length;++s){const n=r[s];g[t[n]]=V[n]}}return g[e]}function et(t,e){const r=he(t,e);return Je[r]||"float32"}function tt(t,e,r=!1){const s={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let a=0;a<n;a++){const o=e.getActiveAttrib(t,a);if(o.name.startsWith("gl_"))continue;const c=et(e,o.type);s[o.name]={location:0,format:c,stride:j(c).stride,offset:0,instance:!1,start:0}}const i=Object.keys(s);if(r){i.sort((a,o)=>a>o?1:-1);for(let a=0;a<i.length;a++)s[i[a]].location=a,e.bindAttribLocation(t,a,i[a]);e.linkProgram(t)}else for(let a=0;a<i.length;a++)s[i[a]].location=e.getAttribLocation(t,i[a]);return s}function rt(t,e){if(!e.ACTIVE_UNIFORM_BLOCKS)return{};const r={},s=e.getProgramParameter(t,e.ACTIVE_UNIFORM_BLOCKS);for(let n=0;n<s;n++){const i=e.getActiveUniformBlockName(t,n),a=e.getUniformBlockIndex(t,i),o=e.getActiveUniformBlockParameter(t,n,e.UNIFORM_BLOCK_DATA_SIZE);r[i]={name:i,index:a,size:o}}return r}function st(t,e){const r={},s=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<s;n++){const i=e.getActiveUniform(t,n),a=i.name.replace(/\[.*?\]$/,""),o=!!i.name.match(/\[.*?\]$/),c=he(e,i.type);r[a]={name:a,index:n,type:c,size:i.size,isArray:o,value:fe(c,i.size)}}return r}function k(t,e){const r=t.getShaderSource(e).split(`
|
||||||
|
`).map((u,_)=>`${_}: ${u}`),s=t.getShaderInfoLog(e),n=s.split(`
|
||||||
|
`),i={},a=n.map(u=>parseFloat(u.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(u=>u&&!i[u]?(i[u]=!0,!0):!1),o=[""];a.forEach(u=>{r[u-1]=`%c${r[u-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const c=r.join(`
|
||||||
|
`);o[0]=c,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function nt(t,e,r,s){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||k(t,r),t.getShaderParameter(s,t.COMPILE_STATUS)||k(t,s),console.error("PixiJS Error: Could not initialize shader."),t.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}function it(t,e){const r=w(t,t.VERTEX_SHADER,e.vertex),s=w(t,t.FRAGMENT_SHADER,e.fragment),n=t.createProgram();t.attachShader(n,r),t.attachShader(n,s);const i=e.transformFeedbackVaryings;i&&(typeof t.transformFeedbackVaryings!="function"?m("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(n,i.names,i.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||nt(t,n,r,s),e._attributeData=tt(n,t,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=st(n,t),e._uniformBlockData=rt(n,t),t.deleteShader(r),t.deleteShader(s);const a={};for(const c in e._uniformData){const u=e._uniformData[c];a[c]={location:t.getUniformLocation(n,c),value:fe(u.type,u.size)}}return new Qe(n,a)}const R={textureCount:0,blockIndex:0};class le{constructor(e){this._activeProgram=null,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_programDataHash")}contextChange(e){this._gl=e,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null,this.maxTextures=$()}bind(e,r){if(this._setProgram(e.glProgram),r)return;R.textureCount=0,R.blockIndex=0;let s=this._shaderSyncFunctions[e.glProgram._key];s||(s=this._shaderSyncFunctions[e.glProgram._key]=this._generateShaderSync(e,this)),this._renderer.buffer.nextBindBase(!!e.glProgram.transformFeedbackVaryings),s(this._renderer,e,R)}updateUniformGroup(e){this._renderer.uniformGroup.updateUniformGroup(e,this._activeProgram,R)}bindUniformBlock(e,r,s=0){const n=this._renderer.buffer,i=this._getProgramData(this._activeProgram),a=e._bufferResource;a||this._renderer.ubo.updateUniformGroup(e);const o=e.buffer,c=n.updateBuffer(o),u=n.freeLocationForBufferBase(c);if(a){const{offset:h,size:l}=e;h===0&&l===o.data.byteLength?n.bindBufferBase(c,u):n.bindBufferRange(c,u,h)}else n.getLastBindBaseLocation(c)!==u&&n.bindBufferBase(c,u);const _=this._activeProgram._uniformBlockData[r].index;i.uniformBlockBindings[s]!==u&&(i.uniformBlockBindings[s]=u,this._renderer.gl.uniformBlockBinding(i.program,_,u))}_setProgram(e){if(this._activeProgram===e)return;this._activeProgram=e;const r=this._getProgramData(e);this._gl.useProgram(r.program)}_getProgramData(e){return this._programDataHash[e._key]||this._createProgramData(e)}_createProgramData(e){const r=e._key;return this._programDataHash[r]=it(this._gl,e),this._programDataHash[r]}destroy(){for(const e of Object.keys(this._programDataHash))this._programDataHash[e].destroy(),this._programDataHash[e]=null;this._programDataHash=null}_generateShaderSync(e,r){return Ze(e,r)}}le.extension={type:[d.WebGLSystem],name:"shader"};const at={f32:`if (cv !== v) {
|
||||||
|
cu.value = v;
|
||||||
|
gl.uniform1f(location, v);
|
||||||
|
}`,"vec2<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
gl.uniform2f(location, v[0], v[1]);
|
||||||
|
}`,"vec3<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
cv[2] = v[2];
|
||||||
|
gl.uniform3f(location, v[0], v[1], v[2]);
|
||||||
|
}`,"vec4<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
cv[2] = v[2];
|
||||||
|
cv[3] = v[3];
|
||||||
|
gl.uniform4f(location, v[0], v[1], v[2], v[3]);
|
||||||
|
}`,i32:`if (cv !== v) {
|
||||||
|
cu.value = v;
|
||||||
|
gl.uniform1i(location, v);
|
||||||
|
}`,"vec2<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
gl.uniform2i(location, v[0], v[1]);
|
||||||
|
}`,"vec3<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
cv[2] = v[2];
|
||||||
|
gl.uniform3i(location, v[0], v[1], v[2]);
|
||||||
|
}`,"vec4<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
cv[2] = v[2];
|
||||||
|
cv[3] = v[3];
|
||||||
|
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
|
||||||
|
}`,u32:`if (cv !== v) {
|
||||||
|
cu.value = v;
|
||||||
|
gl.uniform1ui(location, v);
|
||||||
|
}`,"vec2<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
gl.uniform2ui(location, v[0], v[1]);
|
||||||
|
}`,"vec3<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
cv[2] = v[2];
|
||||||
|
gl.uniform3ui(location, v[0], v[1], v[2]);
|
||||||
|
}`,"vec4<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
cv[2] = v[2];
|
||||||
|
cv[3] = v[3];
|
||||||
|
gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
|
||||||
|
}`,bool:`if (cv !== v) {
|
||||||
|
cu.value = v;
|
||||||
|
gl.uniform1i(location, v);
|
||||||
|
}`,"vec2<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
gl.uniform2i(location, v[0], v[1]);
|
||||||
|
}`,"vec3<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
cv[2] = v[2];
|
||||||
|
gl.uniform3i(location, v[0], v[1], v[2]);
|
||||||
|
}`,"vec4<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
||||||
|
cv[0] = v[0];
|
||||||
|
cv[1] = v[1];
|
||||||
|
cv[2] = v[2];
|
||||||
|
cv[3] = v[3];
|
||||||
|
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
|
||||||
|
}`,"mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},ot={f32:"gl.uniform1fv(location, v);","vec2<f32>":"gl.uniform2fv(location, v);","vec3<f32>":"gl.uniform3fv(location, v);","vec4<f32>":"gl.uniform4fv(location, v);","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2<i32>":"gl.uniform2iv(location, v);","vec3<i32>":"gl.uniform3iv(location, v);","vec4<i32>":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2<u32>":"gl.uniform2iv(location, v);","vec3<u32>":"gl.uniform3iv(location, v);","vec4<u32>":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2<bool>":"gl.uniform2iv(location, v);","vec3<bool>":"gl.uniform3iv(location, v);","vec4<bool>":"gl.uniform4iv(location, v);"};function ct(t,e){const r=[`
|
||||||
|
var v = null;
|
||||||
|
var cv = null;
|
||||||
|
var cu = null;
|
||||||
|
var t = 0;
|
||||||
|
var gl = renderer.gl;
|
||||||
|
var name = null;
|
||||||
|
`];for(const s in t.uniforms){if(!e[s]){t.uniforms[s]instanceof G?t.uniforms[s].ubo?r.push(`
|
||||||
|
renderer.shader.bindUniformBlock(uv.${s}, "${s}");
|
||||||
|
`):r.push(`
|
||||||
|
renderer.shader.updateUniformGroup(uv.${s});
|
||||||
|
`):t.uniforms[s]instanceof Q&&r.push(`
|
||||||
|
renderer.shader.bindBufferResource(uv.${s}, "${s}");
|
||||||
|
`);continue}const n=t.uniformStructures[s];let i=!1;for(let a=0;a<A.length;a++){const o=A[a];if(n.type===o.type&&o.test(n)){r.push(`name = "${s}";`,A[a].uniform),i=!0;break}}if(!i){const o=(n.size===1?at:ot)[n.type].replace("location",`ud["${s}"].location`);r.push(`
|
||||||
|
cu = ud["${s}"];
|
||||||
|
cv = cu.value;
|
||||||
|
v = uv["${s}"];
|
||||||
|
${o};`)}}return new Function("ud","uv","renderer","syncData",r.join(`
|
||||||
|
`))}class de{constructor(e){this._cache={},this._uniformGroupSyncHash={},this._renderer=e,this.gl=null,this._cache={}}contextChange(e){this.gl=e}updateUniformGroup(e,r,s){const n=this._renderer.shader._getProgramData(r);(!e.isStatic||e._dirtyId!==n.uniformDirtyGroups[e.uid])&&(n.uniformDirtyGroups[e.uid]=e._dirtyId,this._getUniformSyncFunction(e,r)(n.uniformData,e.uniforms,this._renderer,s))}_getUniformSyncFunction(e,r){return this._uniformGroupSyncHash[e._signature]?.[r._key]||this._createUniformSyncFunction(e,r)}_createUniformSyncFunction(e,r){const s=this._uniformGroupSyncHash[e._signature]||(this._uniformGroupSyncHash[e._signature]={}),n=this._getSignature(e,r._uniformData,"u");return this._cache[n]||(this._cache[n]=this._generateUniformsSync(e,r._uniformData)),s[r._key]=this._cache[n],s[r._key]}_generateUniformsSync(e,r){return ct(e,r)}_getSignature(e,r,s){const n=e.uniforms,i=[`${s}-`];for(const a in n)i.push(a),r[a]&&i.push(r[a].type);return i.join("-")}destroy(){this._renderer=null,this._cache=null}}de.extension={type:[d.WebGLSystem],name:"uniformGroup"};function ut(t){const e={};if(e.normal=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e.add=[t.ONE,t.ONE],e.multiply=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.screen=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e["screen-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.erase=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],!(t instanceof b.get().getWebGLRenderingContext()))e.min=[t.ONE,t.ONE,t.ONE,t.ONE,t.MIN,t.MIN],e.max=[t.ONE,t.ONE,t.ONE,t.ONE,t.MAX,t.MAX];else{const s=t.getExtension("EXT_blend_minmax");s&&(e.min=[t.ONE,t.ONE,t.ONE,t.ONE,s.MIN_EXT,s.MIN_EXT],e.max=[t.ONE,t.ONE,t.ONE,t.ONE,s.MAX_EXT,s.MAX_EXT])}return e}const _t=0,ft=1,ht=2,lt=3,dt=4,mt=5,me=class D{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[_t]=this.setBlend,this.map[ft]=this.setOffset,this.map[ht]=this.setCullFace,this.map[lt]=this.setDepthTest,this.map[dt]=this.setFrontFace,this.map[mt]=this.setDepthMask,this.checks=[],this.defaultState=U.for2d()}contextChange(e){this.gl=e,this.blendModesMap=ut(e),this.reset()}set(e){if(e||(e=this.defaultState),this.stateId!==e.data){let r=this.stateId^e.data,s=0;for(;r;)r&1&&this.map[s].call(this,!!(e.data&1<<s)),r>>=1,s++;this.stateId=e.data}for(let r=0;r<this.checks.length;r++)this.checks[r](this,e)}forceState(e){e||(e=this.defaultState);for(let r=0;r<this.map.length;r++)this.map[r].call(this,!!(e.data&1<<r));for(let r=0;r<this.checks.length;r++)this.checks[r](this,e);this.stateId=e.data}setBlend(e){this._updateCheck(D._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this._updateCheck(D._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])}setBlendMode(e){if(this.blendModesMap[e]||(e="normal"),e===this.blendMode)return;this.blendMode=e;const r=this.blendModesMap[e],s=this.gl;r.length===2?s.blendFunc(r[0],r[1]):s.blendFuncSeparate(r[0],r[1],r[2],r[3]),r.length===6?(this._blendEq=!0,s.blendEquationSeparate(r[4],r[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(e,r){this.gl.polygonOffset(e,r)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(e,r){const s=this.checks.indexOf(e);r&&s===-1?this.checks.push(e):!r&&s!==-1&&this.checks.splice(s,1)}static _checkBlendMode(e,r){e.setBlendMode(r.blendMode)}static _checkPolygonOffset(e,r){e.setPolygonOffset(1,r.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};me.extension={type:[d.WebGLSystem],name:"state"};let Et=me;class bt{constructor(e){this.target=re.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=f.UNSIGNED_BYTE,this.internalFormat=I.RGBA,this.format=I.RGBA,this.samplerType=0}}const St={id:"buffer",upload(t,e,r){e.width===t.width||e.height===t.height?r.texSubImage2D(r.TEXTURE_2D,0,0,0,t.width,t.height,e.format,e.type,t.resource):r.texImage2D(e.target,0,e.internalFormat,t.width,t.height,0,e.format,e.type,t.resource),e.width=t.width,e.height=t.height}},pt={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},gt={id:"compressed",upload(t,e,r){r.pixelStorei(r.UNPACK_ALIGNMENT,4);let s=t.pixelWidth,n=t.pixelHeight;const i=!!pt[t.format];for(let a=0;a<t.resource.length;a++){const o=t.resource[a];i?r.compressedTexImage2D(r.TEXTURE_2D,a,e.internalFormat,s,n,0,o):r.texImage2D(r.TEXTURE_2D,a,e.internalFormat,s,n,0,e.format,e.type,o),s=Math.max(s>>1,1),n=Math.max(n>>1,1)}}},Ee={id:"image",upload(t,e,r,s){const n=t.alphaMode==="premultiply-alpha-on-upload";r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n);const i=e.width,a=e.height,o=t.pixelWidth,c=t.pixelHeight,u=t.resourceWidth,_=t.resourceHeight;u<o||_<c?((i!==o||a!==c)&&r.texImage2D(e.target,0,e.internalFormat,o,c,0,e.format,e.type,null),s===2?r.texSubImage2D(r.TEXTURE_2D,0,0,0,u,_,e.format,e.type,t.resource):r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.format,e.type,t.resource)):i===o||a===c?r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.format,e.type,t.resource):s===2?r.texImage2D(e.target,0,e.internalFormat,o,c,0,e.format,e.type,t.resource):r.texImage2D(e.target,0,e.internalFormat,e.format,e.type,t.resource),e.width=o,e.height=c}},Rt={id:"video",upload(t,e,r,s){if(!t.isValid){r.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null);return}Ee.upload(t,e,r,s)}},X={linear:9729,nearest:9728},vt={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},y={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},xt={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function W(t,e,r,s,n,i,a,o){const c=i;if(!o||t.addressModeU!=="repeat"||t.addressModeV!=="repeat"||t.addressModeW!=="repeat"){const u=y[a?"clamp-to-edge":t.addressModeU],_=y[a?"clamp-to-edge":t.addressModeV],h=y[a?"clamp-to-edge":t.addressModeW];e[n](c,e.TEXTURE_WRAP_S,u),e[n](c,e.TEXTURE_WRAP_T,_),e.TEXTURE_WRAP_R&&e[n](c,e.TEXTURE_WRAP_R,h)}if((!o||t.magFilter!=="linear")&&e[n](c,e.TEXTURE_MAG_FILTER,X[t.magFilter]),r){if(!o||t.mipmapFilter!=="linear"){const u=vt[t.minFilter][t.mipmapFilter];e[n](c,e.TEXTURE_MIN_FILTER,u)}}else e[n](c,e.TEXTURE_MIN_FILTER,X[t.minFilter]);if(s&&t.maxAnisotropy>1){const u=Math.min(t.maxAnisotropy,e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[n](c,s.TEXTURE_MAX_ANISOTROPY_EXT,u)}t.compare&&e[n](c,e.TEXTURE_COMPARE_FUNC,xt[t.compare])}function Tt(t){return{r8unorm:t.RED,r8snorm:t.RED,r8uint:t.RED,r8sint:t.RED,r16uint:t.RED,r16sint:t.RED,r16float:t.RED,rg8unorm:t.RG,rg8snorm:t.RG,rg8uint:t.RG,rg8sint:t.RG,r32uint:t.RED,r32sint:t.RED,r32float:t.RED,rg16uint:t.RG,rg16sint:t.RG,rg16float:t.RG,rgba8unorm:t.RGBA,"rgba8unorm-srgb":t.RGBA,rgba8snorm:t.RGBA,rgba8uint:t.RGBA,rgba8sint:t.RGBA,bgra8unorm:t.RGBA,"bgra8unorm-srgb":t.RGBA,rgb9e5ufloat:t.RGB,rgb10a2unorm:t.RGBA,rg11b10ufloat:t.RGB,rg32uint:t.RG,rg32sint:t.RG,rg32float:t.RG,rgba16uint:t.RGBA,rgba16sint:t.RGBA,rgba16float:t.RGBA,rgba32uint:t.RGBA,rgba32sint:t.RGBA,rgba32float:t.RGBA,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT,depth24plus:t.DEPTH_COMPONENT,"depth24plus-stencil8":t.DEPTH_STENCIL,depth32float:t.DEPTH_COMPONENT,"depth32float-stencil8":t.DEPTH_STENCIL}}function Bt(t,e){let r={},s=t.RGBA;return t instanceof b.get().getWebGLRenderingContext()?e.srgb&&(r={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(r={"rgba8unorm-srgb":t.SRGB8_ALPHA8,"bgra8unorm-srgb":t.SRGB8_ALPHA8},s=t.RGBA8),{r8unorm:t.R8,r8snorm:t.R8_SNORM,r8uint:t.R8UI,r8sint:t.R8I,r16uint:t.R16UI,r16sint:t.R16I,r16float:t.R16F,rg8unorm:t.RG8,rg8snorm:t.RG8_SNORM,rg8uint:t.RG8UI,rg8sint:t.RG8I,r32uint:t.R32UI,r32sint:t.R32I,r32float:t.R32F,rg16uint:t.RG16UI,rg16sint:t.RG16I,rg16float:t.RG16F,rgba8unorm:t.RGBA,...r,rgba8snorm:t.RGBA8_SNORM,rgba8uint:t.RGBA8UI,rgba8sint:t.RGBA8I,bgra8unorm:s,rgb9e5ufloat:t.RGB9_E5,rgb10a2unorm:t.RGB10_A2,rg11b10ufloat:t.R11F_G11F_B10F,rg32uint:t.RG32UI,rg32sint:t.RG32I,rg32float:t.RG32F,rgba16uint:t.RGBA16UI,rgba16sint:t.RGBA16I,rgba16float:t.RGBA16F,rgba32uint:t.RGBA32UI,rgba32sint:t.RGBA32I,rgba32float:t.RGBA32F,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT16,depth24plus:t.DEPTH_COMPONENT24,"depth24plus-stencil8":t.DEPTH24_STENCIL8,depth32float:t.DEPTH_COMPONENT32F,"depth32float-stencil8":t.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}function At(t){return{r8unorm:t.UNSIGNED_BYTE,r8snorm:t.BYTE,r8uint:t.UNSIGNED_BYTE,r8sint:t.BYTE,r16uint:t.UNSIGNED_SHORT,r16sint:t.SHORT,r16float:t.HALF_FLOAT,rg8unorm:t.UNSIGNED_BYTE,rg8snorm:t.BYTE,rg8uint:t.UNSIGNED_BYTE,rg8sint:t.BYTE,r32uint:t.UNSIGNED_INT,r32sint:t.INT,r32float:t.FLOAT,rg16uint:t.UNSIGNED_SHORT,rg16sint:t.SHORT,rg16float:t.HALF_FLOAT,rgba8unorm:t.UNSIGNED_BYTE,"rgba8unorm-srgb":t.UNSIGNED_BYTE,rgba8snorm:t.BYTE,rgba8uint:t.UNSIGNED_BYTE,rgba8sint:t.BYTE,bgra8unorm:t.UNSIGNED_BYTE,"bgra8unorm-srgb":t.UNSIGNED_BYTE,rgb9e5ufloat:t.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:t.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:t.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:t.UNSIGNED_INT,rg32sint:t.INT,rg32float:t.FLOAT,rgba16uint:t.UNSIGNED_SHORT,rgba16sint:t.SHORT,rgba16float:t.HALF_FLOAT,rgba32uint:t.UNSIGNED_INT,rgba32sint:t.INT,rgba32float:t.FLOAT,stencil8:t.UNSIGNED_BYTE,depth16unorm:t.UNSIGNED_SHORT,depth24plus:t.UNSIGNED_INT,"depth24plus-stencil8":t.UNSIGNED_INT_24_8,depth32float:t.FLOAT,"depth32float-stencil8":t.FLOAT_32_UNSIGNED_INT_24_8_REV}}const Nt=4;class be{constructor(e){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:Ee,buffer:St,video:Rt,compressed:gt},this._useSeparateSamplers=!1,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_glTextures"),this._renderer.renderableGC.addManagedHash(this,"_glSamplers")}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=Bt(e,this._renderer.context.extensions),this._mapFormatToType=At(e),this._mapFormatToFormat=Tt(e)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let r=0;r<16;r++)this.bind(S.EMPTY,r)}initSource(e){this.bind(e)}bind(e,r=0){const s=e.source;e?(this.bindSource(s,r),this._useSeparateSamplers&&this._bindSampler(s.style,r)):(this.bindSource(null,r),this._useSeparateSamplers&&this._bindSampler(null,r))}bindSource(e,r=0){const s=this._gl;if(e._touched=this._renderer.textureGC.count,this._boundTextures[r]!==e){this._boundTextures[r]=e,this._activateLocation(r),e||(e=S.EMPTY.source);const n=this.getGlSource(e);s.bindTexture(n.target,n.texture)}}_bindSampler(e,r=0){const s=this._gl;if(!e){this._boundSamplers[r]=null,s.bindSampler(r,null);return}const n=this._getGlSampler(e);this._boundSamplers[r]!==n&&(this._boundSamplers[r]=n,s.bindSampler(r,n))}unbind(e){const r=e.source,s=this._boundTextures,n=this._gl;for(let i=0;i<s.length;i++)if(s[i]===r){this._activateLocation(i);const a=this.getGlSource(r);n.bindTexture(a.target,null),s[i]=null}}_activateLocation(e){this._activeTextureLocation!==e&&(this._activeTextureLocation=e,this._gl.activeTexture(this._gl.TEXTURE0+e))}_initSource(e){const r=this._gl,s=new bt(r.createTexture());if(s.type=this._mapFormatToType[e.format],s.internalFormat=this._mapFormatToInternalFormat[e.format],s.format=this._mapFormatToFormat[e.format],e.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||e.isPowerOfTwo)){const n=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(n))+1}return this._glTextures[e.uid]=s,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),this.updateStyle(e,!1),s}onStyleChange(e){this.updateStyle(e,!1)}updateStyle(e,r){const s=this._gl,n=this.getGlSource(e);s.bindTexture(s.TEXTURE_2D,n.texture),this._boundTextures[this._activeTextureLocation]=e,W(e.style,s,e.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",s.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,r)}onSourceUnload(e){const r=this._glTextures[e.uid];r&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(r.texture))}onSourceUpdate(e){const r=this._gl,s=this.getGlSource(e);r.bindTexture(r.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=e,this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,s,r,this._renderer.context.webGLVersion):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.pixelWidth,e.pixelHeight,0,r.RGBA,r.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,!1)}onUpdateMipmaps(e,r=!0){r&&this.bindSource(e,0);const s=this.getGlSource(e);this._gl.generateMipmap(s.target)}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}_initSampler(e){const r=this._gl,s=this._gl.createSampler();return this._glSamplers[e._resourceId]=s,W(e,r,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){const{pixels:r,width:s,height:n}=this.getPixels(e),i=b.get().createCanvas();i.width=s,i.height=n;const a=i.getContext("2d");if(a){const o=a.createImageData(s,n);o.data.set(r),a.putImageData(o,0,0)}return i}getPixels(e){const r=e.source.resolution,s=e.frame,n=Math.max(Math.round(s.width*r),1),i=Math.max(Math.round(s.height*r),1),a=new Uint8Array(Nt*n*i),o=this._renderer,c=o.renderTarget.getRenderTarget(e),u=o.renderTarget.getGpuRenderTarget(c),_=o.gl;return _.bindFramebuffer(_.FRAMEBUFFER,u.resolveTargetFramebuffer),_.readPixels(Math.round(s.x*r),Math.round(s.y*r),n,i,_.RGBA,_.UNSIGNED_BYTE,a),{pixels:new Uint8ClampedArray(a.buffer),width:n,height:i}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null,this._renderer=null}}be.extension={type:[d.WebGLSystem],name:"texture"};class Se{init(){const e=new G({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new z,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),r=$(),s=Y({name:"graphics",bits:[Ae,Ne(r),Z,q]});this.shader=new C({glProgram:s,resources:{localUniforms:e,batchSamplers:ye(r)}})}execute(e,r){const s=r.context,n=s.customShader||this.shader,i=e.renderer,a=i.graphicsContext,{batcher:o,instructions:c}=a.getContextRenderData(s);n.groups[0]=i.globalUniforms.bindGroup,i.state.set(e.state),i.shader.bind(n),i.geometry.bind(o.geometry,n.glProgram);const u=c.instructions;for(let _=0;_<c.instructionSize;_++){const h=u[_];if(h.size){for(let l=0;l<h.textures.count;l++)i.texture.bind(h.textures.textures[l],l);i.geometry.draw(h.topology,h.size,h.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}Se.extension={type:[d.WebGLPipesAdaptor],name:"graphics"};class pe{init(){const e=Y({name:"mesh",bits:[Z,Me,q]});this._shader=new C({glProgram:e,resources:{uTexture:S.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new z}}}})}execute(e,r){const s=e.renderer;let n=r._shader;if(n){if(!n.glProgram){m("Mesh shader has no glProgram",r.shader);return}}else{n=this._shader;const i=r.texture,a=i.source;n.resources.uTexture=a,n.resources.uSampler=a.style,n.resources.textureUniforms.uniforms.uTextureMatrix=i.textureMatrix.mapCoord}n.groups[100]=s.globalUniforms.bindGroup,n.groups[101]=e.localUniformsBindGroup,s.encoder.draw({geometry:r._geometry,shader:n,state:r.state})}destroy(){this._shader.destroy(!0),this._shader=null}}pe.extension={type:[d.WebGLPipesAdaptor],name:"mesh"};const yt=[...Le,ue,je,Ve,ee,be,_e,se,de,le,ae,Et,oe,ie],It=[...He],Dt=[J,pe,Se],ge=[],Re=[],ve=[];x.handleByNamedList(d.WebGLSystem,ge);x.handleByNamedList(d.WebGLPipes,Re);x.handleByNamedList(d.WebGLPipesAdaptor,ve);x.add(...yt,...It,...Dt);class Lt extends Ie{constructor(){const e={name:"webgl",type:De.WEBGL,systems:ge,renderPipes:Re,renderPipeAdaptors:ve};super(e)}}export{Lt as WebGLRenderer};
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import{g as R,b as E,E as l,f as ne,S as P,B as S,c as oe,d as A,w as k,h as b,i as ae,j as ue,D as ce,M as D,k as M,e as G,A as de,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";import{S as z,c as T,a as L,g as O,r as v,b as C,d as he,U as pe,l as le,e as fe,R as ge,__tla as __tla_1}from"./colorToUniform-rMRo2qOn.js";import{c as me,u as _e,U as be,B as ye,G as xe,e as Ge,R as Be,t as Se,S as Pe,a as Te,__tla as __tla_2}from"./SharedSystems-Bg8GzrJB.js";import{C as w,__tla as __tla_3}from"./CanvasPool-D00IADyo.js";import{__tla as __tla_4}from"./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js";import{__tla as __tla_5}from"./index-C0tfT_Qc.js";import"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";import{__tla as __tla_6}from"./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_7}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js";let tt;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})()]).then(async()=>{const y=z.for2d();class H{init(){const e=T({name:"batch",bits:[L,O(R()),v]});this._shader=new C({gpuProgram:e,groups:{}})}start(e,t){const r=e.renderer,s=r.encoder,i=this._shader.gpuProgram;this._geometry=t,s.setGeometry(t),y.blendMode="normal",r.pipeline.getPipeline(t,i,y);const n=r.globalUniforms.bindGroup;s.resetBindGroup(1),s.setBindGroup(0,n,i)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=E(u.textures,u.count)}y.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,y);t.bindGroup._touch(s.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}destroy(){this._shader.destroy(!0),this._shader=null}}H.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class F{constructor(e){this._hash=Object.create(null),this._renderer=e}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const f in i){const h=e.resources[f]??e.resources[i[f]];let p;if(h._resourceType==="uniformGroup"){const d=h;o.ubo.updateUniformGroup(d);const g=d.buffer;p={buffer:o.buffer.getGPUBuffer(g),offset:0,size:g.descriptor.size}}else if(h._resourceType==="buffer"){const d=h;p={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(h._resourceType==="bufferResource"){const d=h;p={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(h._resourceType==="textureSampler"){const d=h;p=o.texture.getGpuSampler(d)}else if(h._resourceType==="textureSource"){const d=h;p=o.texture.getGpuSource(d).createView({})}n.push({binding:i[f],resource:p})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){for(const e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null}}F.extension={type:[l.WebGPUSystem],name:"bindGroup"};class I{constructor(){this._gpuBuffers=Object.create(null),this._managedBuffers=[]}contextChange(e){this._gpu=e}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){const t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){for(const e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={}}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this));const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(ne(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,this._managedBuffers.push(e),t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e)}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e)}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null}}I.extension={type:[l.WebGPUSystem],name:"buffer"};class ve{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r<e.length;r++)this.data[t/4+r]=e[r];return t}destroy(){this._buffer.destroy(),this._buffer=null,this.data=null}}class W{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}W.extension={type:[l.WebGPUSystem],name:"colorMask"};class U{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(e).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await navigator.gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null}}U.extension={type:[l.WebGPUSystem],name:"device"};U.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class V{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e){for(const t in e.attributes){const r=e.attributes[t];this._setVertexBuffer(r.location,r.buffer)}e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u||t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u||t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}V.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class j{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:P.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}j.extension={type:[l.WebGPUSystem],name:"stencil"};const x={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function Ce(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r<e.length;r++){const s=e[r];let i=x[s.data.type].size;const n=x[s.data.type].align;if(!x[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function Ue(a,e){const{size:t,align:r}=x[a.data.type],s=(r-t)/4;return`
|
|
||||||
v = uv.${a.data.name};
|
|
||||||
${e!==0?`offset += ${e};`:""}
|
|
||||||
|
|
||||||
arrayOffset = offset;
|
|
||||||
|
|
||||||
t = 0;
|
|
||||||
|
|
||||||
for(var i=0; i < ${a.data.size*(t/4)}; i++)
|
|
||||||
{
|
|
||||||
for(var j = 0; j < ${t/4}; j++)
|
|
||||||
{
|
|
||||||
data[arrayOffset++] = v[t++];
|
|
||||||
}
|
|
||||||
${s!==0?`arrayOffset += ${s};`:""}
|
|
||||||
}
|
|
||||||
`}function Me(a){return me(a,"uboWgsl",Ue,_e)}class N extends be{constructor(){super({createUboElements:Ce,generateUboSync:Me})}}N.extension={type:[l.WebGPUSystem],name:"ubo"};const _=128;class K{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._batchBuffer=new ve({minUniformOffsetAlignment:_});const t=256/_;for(let r=0;r<t;r++){let s=S.UNIFORM|S.COPY_DST;r===0&&(s|=S.COPY_SRC),this._buffers.push(new oe({data:this._batchBuffer.data,usage:s}))}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups()}_resetBindGroups(){for(const e in this._bindGroupHash)this._bindGroupHash[e]=null;this._batchBuffer.clear()}getUniformBindGroup(e,t){if(!t&&this._bindGroupHash[e.uid])return this._bindGroupHash[e.uid];this._renderer.ubo.ensureUniformGroup(e);const r=e.buffer.data,s=this._batchBuffer.addEmptyGroup(r.length);return this._renderer.ubo.syncUniformGroup(e,this._batchBuffer.data,s/4),this._bindGroupHash[e.uid]=this._getBindGroup(s/_),this._bindGroupHash[e.uid]}getUboResource(e){this._renderer.ubo.updateUniformGroup(e);const t=e.buffer.data,r=this._batchBuffer.addGroup(t);return this._getBufferResource(r/_)}getArrayBindGroup(e){const t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/_)}getArrayBufferResource(e){const r=this._batchBuffer.addGroup(e)/_;return this._getBufferResource(r)}_getBufferResource(e){if(!this._bufferResources[e]){const t=this._buffers[e%2];this._bufferResources[e]=new ye({buffer:t,offset:(e/2|0)*256,size:_})}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){const t=new A({0:this._getBufferResource(e)});this._bindGroups[e]=t}return this._bindGroups[e]}_uploadBindGroups(){const e=this._renderer.buffer,t=this._buffers[0];t.update(this._batchBuffer.byteIndex),e.updateBuffer(t);const r=this._renderer.gpu.device.createCommandEncoder();for(let s=1;s<this._buffers.length;s++){const i=this._buffers[s];r.copyBufferToBuffer(e.getGPUBuffer(t),_,e.getGPUBuffer(i),0,this._batchBuffer.byteIndex)}this._renderer.gpu.device.queue.submit([r.finish()])}destroy(){for(let e=0;e<this._bindGroups.length;e++)this._bindGroups[e].destroy();this._bindGroups=null,this._bindGroupHash=null;for(let e=0;e<this._buffers.length;e++)this._buffers[e].destroy();this._buffers=null;for(let e=0;e<this._bufferResources.length;e++)this._bufferResources[e].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null}}K.extension={type:[l.WebGPUPipes],name:"uniformBatch"};const we={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};function Re(a,e,t,r,s){return a<<24|e<<16|t<<10|r<<5|s}function Ee(a,e,t,r){return t<<6|a<<3|r<<1|e}class q{constructor(e){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=e}contextChange(e){this._gpu=e,this.setStencilMode(P.DISABLED),this._updatePipeHash()}setMultisampleCount(e){this._multisampleCount!==e&&(this._multisampleCount=e,this._updatePipeHash())}setRenderTarget(e){this._multisampleCount=e.msaaSamples,this._depthStencilAttachment=e.descriptor.depthStencilAttachment?1:0,this._updatePipeHash()}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash())}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=xe[e],this._updatePipeHash())}setPipeline(e,t,r,s){const i=this.getPipeline(e,t,r);s.setPipeline(i)}getPipeline(e,t,r,s){e._layoutKey||(Ge(e,t.attributeData),this._generateBufferKey(e)),s=s||e.topology;const i=Re(e._layoutKey,t._layoutKey,r.data,r._blendModeId,we[s]);return this._pipeCache[i]?this._pipeCache[i]:(this._pipeCache[i]=this._createPipeline(e,t,r,s),this._pipeCache[i])}_createPipeline(e,t,r,s){const i=this._gpu.device,n=this._createVertexBufferLayouts(e),o=this._renderer.state.getColorTargets(r);o[0].writeMask=this._stencilMode===P.RENDERING_MASK_ADD?0:this._colorMask;const u=this._renderer.shader.getProgramData(t).pipeline,c={vertex:{module:this._getModule(t.vertex.source),entryPoint:t.vertex.entryPoint,buffers:n},fragment:{module:this._getModule(t.fragment.source),entryPoint:t.fragment.entryPoint,targets:o},primitive:{topology:s,cullMode:r.cullMode},layout:u,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(c.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:r.depthTest,depthCompare:r.depthTest?"less":"always"}),i.createRenderPipeline(c)}_getModule(e){return this._moduleCache[e]||this._createModule(e)}_createModule(e){const t=this._gpu.device;return this._moduleCache[e]=t.createShaderModule({code:e}),this._moduleCache[e]}_generateBufferKey(e){const t=[];let r=0;const s=Object.keys(e.attributes).sort();for(let n=0;n<s.length;n++){const o=e.attributes[s[n]];t[r++]=o.location,t[r++]=o.offset,t[r++]=o.format,t[r++]=o.stride}const i=t.join("");return e._layoutKey=he(i,"geometry"),e._layoutKey}_createVertexBufferLayouts(e){if(this._bufferLayoutsCache[e._layoutKey])return this._bufferLayoutsCache[e._layoutKey];const t=[];return e.buffers.forEach(r=>{const s={arrayStride:0,stepMode:"vertex",attributes:[]},i=s.attributes;for(const n in e.attributes){const o=e.attributes[n];(o.divisor??1)!==1&&k(`Attribute ${n} has an invalid divisor value of '${o.divisor}'. WebGPU only supports a divisor value of 1`),o.buffer===r&&(s.arrayStride=o.stride,s.stepMode=o.instance?"instance":"vertex",i.push({shaderLocation:o.location,offset:o.offset,format:o.format}))}i.length&&t.push(s)}),this._bufferLayoutsCache[e._layoutKey]=t,t}_updatePipeHash(){const e=Ee(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}}q.extension={type:[l.WebGPUSystem],name:"pipeline"};class Ae{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}class ke{init(e,t){this._renderer=e,this._renderTargetSystem=t}copyToTexture(e,t,r,s,i){const n=this._renderer,o=this._getGpuColorTexture(e),u=n.texture.getGpuSource(t.source);return n.encoder.commandEncoder.copyTextureToTexture({texture:o,origin:r},{texture:u,origin:i},s),t}startRenderPass(e,t=!0,r,s){const n=this._renderTargetSystem.getGpuRenderTarget(e),o=this.getDescriptor(e,t,r);n.descriptor=o,this._renderer.pipeline.setRenderTarget(n),this._renderer.encoder.beginRenderPass(n),this._renderer.encoder.setViewport(s)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,r){typeof t=="boolean"&&(t=t?b.ALL:b.NONE);const s=this._renderTargetSystem,i=s.getGpuRenderTarget(e),n=e.colorTextures.map((c,f)=>{const h=i.contexts[f];let p,d;h?p=h.getCurrentTexture().createView():p=this._renderer.texture.getGpuSource(c).createView({mipLevelCount:1}),i.msaaTextures[f]&&(d=p,p=this._renderer.texture.getTextureView(i.msaaTextures[f]));const g=t&b.COLOR?"clear":"load";return r??(r=s.defaultClearColor),{view:p,resolveTarget:d,clearValue:r,storeOp:"store",loadOp:g}});let o;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=i.msaa?4:1),e.depthStencilTexture){const c=t&b.STENCIL?"clear":"load",f=t&b.DEPTH?"clear":"load";o={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:c,depthClearValue:1,depthLoadOp:f,depthStoreOp:"store"}}return{colorAttachments:n,depthStencilAttachment:o}}clear(e,t=!0,r,s){if(!t)return;const{gpu:i,encoder:n}=this._renderer,o=i.device;if(n.commandEncoder===null){const c=o.createCommandEncoder(),f=this.getDescriptor(e,t,r),h=c.beginRenderPass(f);h.setViewport(s.x,s.y,s.width,s.height,0,1),h.end();const p=c.finish();o.queue.submit([p])}else this.startRenderPass(e,t,r,s)}initGpuRenderTarget(e){e.isRoot=!0;const t=new Ae;return e.colorTextures.forEach((r,s)=>{if(ae.test(r.resource)){const i=r.resource.getContext("webgpu"),n=r.transparent?"premultiplied":"opaque";try{i.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:n})}catch(o){console.error(o)}t.contexts[s]=i}if(t.msaa=r.source.antialias,r.source.antialias){const i=new ue({width:0,height:0,sampleCount:4});t.msaaTextures[s]=i}}),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach(t=>{t.unconfigure()}),e.msaaTextures.forEach(t=>{t.destroy()}),e.msaaTextures.length=0,e.contexts.length=0}ensureDepthStencilTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach((r,s)=>{t.msaaTextures[s]?.resize(r.source.width,r.source.height,r.source._resolution)})}}class Y extends Be{constructor(e){super(e),this.adaptor=new ke,this.adaptor.init(e,this)}}Y.extension={type:[l.WebGPUSystem],name:"renderTarget"};class ${constructor(){this._gpuProgramData=Object.create(null)}contextChange(e){this._gpu=e}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){const t=this._gpu.device,r=e.gpuLayout.map(i=>t.createBindGroupLayout({entries:i})),s={bindGroupLayouts:r};return this._gpuProgramData[e._layoutKey]={bindGroups:r,pipeline:t.createPipelineLayout(s)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}}$.extension={type:[l.WebGPUSystem],name:"shader"};const m={};m.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};m.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};m.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};m.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};m.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};m.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};m["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};m["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};m["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};m.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};class X{constructor(){this.defaultState=new z,this.defaultState.blend=!0}contextChange(e){this.gpu=e}getColorTargets(e){return[{format:"bgra8unorm",writeMask:0,blend:m[e.blendMode]||m.normal}]}destroy(){this.gpu=null}}X.extension={type:[l.WebGPUSystem],name:"state"};const De={type:"image",upload(a,e,t){const r=a.resource,s=(a.pixelWidth|0)*(a.pixelHeight|0),i=r.byteLength/s;t.device.queue.writeTexture({texture:e},r,{offset:0,rowsPerImage:a.pixelHeight,bytesPerRow:a.pixelHeight*i},{width:a.pixelWidth,height:a.pixelHeight,depthOrArrayLayers:1})}},Z={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},ze={blockBytes:4,blockWidth:1,blockHeight:1},Le={type:"compressed",upload(a,e,t){let r=a.pixelWidth,s=a.pixelHeight;const i=Z[a.format]||ze;for(let n=0;n<a.resource.length;n++){const o=a.resource[n],u=Math.ceil(r/i.blockWidth)*i.blockBytes;t.device.queue.writeTexture({texture:e,mipLevel:n},o,{offset:0,bytesPerRow:u},{width:Math.ceil(r/i.blockWidth)*i.blockWidth,height:Math.ceil(s/i.blockHeight)*i.blockHeight,depthOrArrayLayers:1}),r=Math.max(r>>1,1),s=Math.max(s>>1,1)}}},J={type:"image",upload(a,e,t){const r=a.resource;if(!r)return;const s=Math.min(e.width,a.resourceWidth||a.pixelWidth),i=Math.min(e.height,a.resourceHeight||a.pixelHeight),n=a.alphaMode==="premultiply-alpha-on-upload";t.device.queue.copyExternalImageToTexture({source:r},{texture:e,premultipliedAlpha:n},{width:s,height:i})}},Oe={type:"video",upload(a,e,t){J.upload(a,e,t)}};class He{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
|
|
||||||
var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
|
||||||
vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));
|
|
||||||
|
|
||||||
struct VertexOutput {
|
|
||||||
@builtin(position) position : vec4<f32>,
|
|
||||||
@location(0) texCoord : vec2<f32>,
|
|
||||||
};
|
|
||||||
|
|
||||||
@vertex
|
|
||||||
fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {
|
|
||||||
var output : VertexOutput;
|
|
||||||
output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);
|
|
||||||
output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
@group(0) @binding(0) var imgSampler : sampler;
|
|
||||||
@group(0) @binding(1) var img : texture_2d<f32>;
|
|
||||||
|
|
||||||
@fragment
|
|
||||||
fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
|
|
||||||
return textureSample(img, imgSampler, texCoord);
|
|
||||||
}
|
|
||||||
`})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){const t=this._getMipmapPipeline(e.format);if(e.dimension==="3d"||e.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let r=e;const s=e.depthOrArrayLayers||1,i=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!i){const u={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};r=this.device.createTexture(u)}const n=this.device.createCommandEncoder({}),o=t.getBindGroupLayout(0);for(let u=0;u<s;++u){let c=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),f=i?1:0;for(let h=1;h<e.mipLevelCount;++h){const p=r.createView({baseMipLevel:f++,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),d=n.beginRenderPass({colorAttachments:[{view:p,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),g=this.device.createBindGroup({layout:o,entries:[{binding:0,resource:this.sampler},{binding:1,resource:c}]});d.setPipeline(t),d.setBindGroup(0,g),d.draw(3,1,0,0),d.end(),c=p}}if(!i){const u={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s};for(let c=1;c<e.mipLevelCount;++c)n.copyTextureToTexture({texture:r,mipLevel:c-1},{texture:e,mipLevel:c},u),u.width=Math.ceil(u.width/2),u.height=Math.ceil(u.height/2)}return this.device.queue.submit([n.finish()]),i||r.destroy(),e}}class Q{constructor(e){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:J,buffer:De,video:Oe,compressed:Le},this._renderer=e}contextChange(e){this._gpu=e}initSource(e){if(e.autoGenerateMipmaps){const u=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(u))+1}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);const r=Z[e.format]||{blockBytes:4,blockWidth:1,blockHeight:1},s=Math.ceil(e.pixelWidth/r.blockWidth)*r.blockWidth,i=Math.ceil(e.pixelHeight/r.blockHeight)*r.blockHeight,n={label:e.label,size:{width:s,height:i},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},o=this._gpu.device.createTexture(n);return this._gpuSources[e.uid]=o,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),o}onSourceUpdate(e){const t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e))}onSourceUnload(e){const t=this._gpuSources[e.uid];t&&(this._gpuSources[e.uid]=null,t.destroy())}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new He(this._gpu.device));const t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t)}onSourceDestroy(e){e.off("update",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("destroy",this.onSourceDestroy,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}onSourceResize(e){const t=this._gpuSources[e.uid];t?(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(this._textureViewHash[e.uid]=null,this._bindGroupHash[e.uid]=null,this.onSourceUnload(e),this.initSource(e)):this.initSource(e)}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return this._gpuSources[e.uid]||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]??this._createTextureBindGroup(e)}_createTextureBindGroup(e){const t=e.source,r=t.uid;return this._bindGroupHash[r]=new A({0:t,1:t.style}),this._bindGroupHash[r]}getTextureView(e){const t=e.source;return this._textureViewHash[t.uid]??this._createTextureView(t)}_createTextureView(e){return this._textureViewHash[e.uid]=this.getGpuSource(e).createView(),this._textureViewHash[e.uid]}generateCanvas(e){const t=this._renderer,r=t.gpu.device.createCommandEncoder(),s=ce.get().createCanvas();s.width=e.source.pixelWidth,s.height=e.source.pixelHeight;const i=s.getContext("webgpu");return i.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:navigator.gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),r.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:i.getCurrentTexture()},{width:s.width,height:s.height}),t.gpu.device.queue.submit([r.finish()]),s}getPixels(e){const t=this.generateCanvas(e),r=w.getOptimalCanvasAndContext(t.width,t.height),s=r.context;s.drawImage(t,0,0);const{width:i,height:n}=t,o=s.getImageData(0,0,i,n),u=new Uint8ClampedArray(o.data.buffer);return w.returnCanvasAndContext(r),{pixels:u,width:i,height:n}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null;for(const e of Object.keys(this._bindGroupHash)){const t=Number(e);this._bindGroupHash[t]?.destroy(),this._bindGroupHash[t]=null}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null}}Q.extension={type:[l.WebGPUSystem],name:"texture"};class ee{init(){const e=new pe({uTransformMatrix:{value:new D,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),t=T({name:"graphics",bits:[L,O(R()),le,v]});this.shader=new C({gpuProgram:t,resources:{localUniforms:e}})}execute(e,t){const r=t.context,s=r.customShader||this.shader,i=e.renderer,n=i.graphicsContext,{geometry:o,instructions:u}=n.getContextRenderData(r),c=i.encoder;c.setPipelineFromGeometryProgramAndState(o,s.gpuProgram,e.state),c.setGeometry(o);const f=i.globalUniforms.bindGroup;c.setBindGroup(0,f,s.gpuProgram);const h=i.renderPipes.uniformBatch.getUniformBindGroup(s.resources.localUniforms,!0);c.setBindGroup(2,h,s.gpuProgram);const p=u.instructions;for(let d=0;d<u.instructionSize;d++){const g=p[d];if(s.groups[1]=g.bindGroup,!g.gpuBindGroup){const B=g.textures;g.bindGroup=E(B.textures,B.count),g.gpuBindGroup=i.bindGroup.getBindGroup(g.bindGroup,s.gpuProgram,1)}c.setBindGroup(1,g.bindGroup,s.gpuProgram),c.renderPassEncoder.drawIndexed(g.size,1,g.start)}}destroy(){this.shader.destroy(!0),this.shader=null}}ee.extension={type:[l.WebGPUPipesAdaptor],name:"graphics"};class te{init(){const e=T({name:"mesh",bits:[fe,Se,v]});this._shader=new C({gpuProgram:e,resources:{uTexture:M.EMPTY._source,uSampler:M.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new D}}}})}execute(e,t){const r=e.renderer;let s=t._shader;if(!s)s=this._shader,s.resources.uTexture=t.texture.source,s.resources.uSampler=t.texture.source.style,s.resources.textureUniforms.uniforms.uTextureMatrix=t.texture.textureMatrix.mapCoord;else if(!s.gpuProgram){k("Mesh shader has no gpuProgram",t.shader);return}const i=s.gpuProgram;if(i.autoAssignGlobalUniforms&&(s.groups[0]=r.globalUniforms.bindGroup),i.autoAssignLocalUniforms){const n=e.localUniforms;s.groups[1]=r.renderPipes.uniformBatch.getUniformBindGroup(n,!0)}r.encoder.draw({geometry:t._geometry,shader:s,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}te.extension={type:[l.WebGPUPipesAdaptor],name:"mesh"};const Fe=[...Pe,N,V,U,I,Q,Y,$,X,q,W,j,F],Ie=[...Te,K],We=[H,te,ee],re=[],se=[],ie=[];G.handleByNamedList(l.WebGPUSystem,re);G.handleByNamedList(l.WebGPUPipes,se);G.handleByNamedList(l.WebGPUPipesAdaptor,ie);G.add(...Fe,...Ie,...We);tt=class extends de{constructor(){const e={name:"webgpu",type:ge.WEBGPU,systems:re,renderPipes:se,renderPipeAdaptors:ie};super(e)}}});export{tt as WebGPURenderer,__tla};
|
|
||||||
41
qbit/vuetorrent/public/assets/WebGPURenderer-WqxaCEVy.js
Normal file
41
qbit/vuetorrent/public/assets/WebGPURenderer-WqxaCEVy.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import{E as f,b as R,f as oe,D as T,S as C,B as P,c as ae,d as E,h as U,w as A,i as y,j as ue,k as ce,l as L,M as k,m as D,o as de,p as he,q as pe,s as H,t as z,v as M,e as B,A as le,R as fe}from"./TorrentDetail-CoyYqyCA.js";import{S as F,l as ge,a as me}from"./colorToUniform-C2GHuDhf.js";import{c as _e,u as be,U as ye,B as xe,G as Ge,e as Be,R as Se,t as Pe,S as Te,a as Ce}from"./SharedSystems-B1uG7cSA.js";import{C as w}from"./CanvasPool-BAToQajg.js";import"./ColoredChip.vue_vue_type_script_setup_true_lang-DosC_URk.js";import"./index-BhWmfNB5.js";import"./vue-DFryKk-1.js";import"./vuetify-XtA0Y0Oj.js";const x=F.for2d();class O{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),x.blendMode="normal",s.pipeline.getPipeline(t,n,x);const o=s.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,o,n)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=R(u.textures,u.count)}x.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,x,t.topology);t.bindGroup._touch(s.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}O.extension={type:[f.WebGPUPipesAdaptor],name:"batch"};class I{constructor(e){this._hash=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_hash")}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const p in i){const h=e.resources[p]??e.resources[i[p]];let l;if(h._resourceType==="uniformGroup"){const d=h;o.ubo.updateUniformGroup(d);const _=d.buffer;l={buffer:o.buffer.getGPUBuffer(_),offset:0,size:_.descriptor.size}}else if(h._resourceType==="buffer"){const d=h;l={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(h._resourceType==="bufferResource"){const d=h;l={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(h._resourceType==="textureSampler"){const d=h;l=o.texture.getGpuSampler(d)}else if(h._resourceType==="textureSource"){const d=h;l=o.texture.getGpuSource(d).createView({})}n.push({binding:i[p],resource:l})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){for(const e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null}}I.extension={type:[f.WebGPUSystem],name:"bindGroup"};class W{constructor(e){this._gpuBuffers=Object.create(null),this._managedBuffers=[],e.renderableGC.addManagedHash(this,"_gpuBuffers")}contextChange(e){this._gpu=e}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){const t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){for(const e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={}}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this),this._managedBuffers.push(e));const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(oe(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e)}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e)}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null}}W.extension={type:[f.WebGPUSystem],name:"buffer"};class ve{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r<e.length;r++)this.data[t/4+r]=e[r];return t}destroy(){this.data=null}}class V{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}V.extension={type:[f.WebGPUSystem],name:"colorMask"};class v{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(e).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await T.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null}}v.extension={type:[f.WebGPUSystem],name:"device"};v.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class N{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e,t){const r=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const s in r)this._setVertexBuffer(s,e.attributes[r[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t,r.gpuProgram),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u??t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u??t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}N.extension={type:[f.WebGPUSystem],name:"encoder",priority:1};class j{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:C.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}j.extension={type:[f.WebGPUSystem],name:"stencil"};const G={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function Ue(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r<e.length;r++){const s=e[r];let i=G[s.data.type].size;const n=G[s.data.type].align;if(!G[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function Me(a,e){const{size:t,align:r}=G[a.data.type],s=(r-t)/4,i=a.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
|
||||||
|
v = uv.${a.data.name};
|
||||||
|
${e!==0?`offset += ${e};`:""}
|
||||||
|
|
||||||
|
arrayOffset = offset;
|
||||||
|
|
||||||
|
t = 0;
|
||||||
|
|
||||||
|
for(var i=0; i < ${a.data.size*(t/4)}; i++)
|
||||||
|
{
|
||||||
|
for(var j = 0; j < ${t/4}; j++)
|
||||||
|
{
|
||||||
|
${i}[arrayOffset++] = v[t++];
|
||||||
|
}
|
||||||
|
${s!==0?`arrayOffset += ${s};`:""}
|
||||||
|
}
|
||||||
|
`}function we(a){return _e(a,"uboWgsl",Me,be)}class K extends ye{constructor(){super({createUboElements:Ue,generateUboSync:we})}}K.extension={type:[f.WebGPUSystem],name:"ubo"};const b=128;class q{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_bindGroupHash"),this._batchBuffer=new ve({minUniformOffsetAlignment:b});const t=256/b;for(let r=0;r<t;r++){let s=P.UNIFORM|P.COPY_DST;r===0&&(s|=P.COPY_SRC),this._buffers.push(new ae({data:this._batchBuffer.data,usage:s}))}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups()}_resetBindGroups(){for(const e in this._bindGroupHash)this._bindGroupHash[e]=null;this._batchBuffer.clear()}getUniformBindGroup(e,t){if(!t&&this._bindGroupHash[e.uid])return this._bindGroupHash[e.uid];this._renderer.ubo.ensureUniformGroup(e);const r=e.buffer.data,s=this._batchBuffer.addEmptyGroup(r.length);return this._renderer.ubo.syncUniformGroup(e,this._batchBuffer.data,s/4),this._bindGroupHash[e.uid]=this._getBindGroup(s/b),this._bindGroupHash[e.uid]}getUboResource(e){this._renderer.ubo.updateUniformGroup(e);const t=e.buffer.data,r=this._batchBuffer.addGroup(t);return this._getBufferResource(r/b)}getArrayBindGroup(e){const t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/b)}getArrayBufferResource(e){const r=this._batchBuffer.addGroup(e)/b;return this._getBufferResource(r)}_getBufferResource(e){if(!this._bufferResources[e]){const t=this._buffers[e%2];this._bufferResources[e]=new xe({buffer:t,offset:(e/2|0)*256,size:b})}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){const t=new E({0:this._getBufferResource(e)});this._bindGroups[e]=t}return this._bindGroups[e]}_uploadBindGroups(){const e=this._renderer.buffer,t=this._buffers[0];t.update(this._batchBuffer.byteIndex),e.updateBuffer(t);const r=this._renderer.gpu.device.createCommandEncoder();for(let s=1;s<this._buffers.length;s++){const i=this._buffers[s];r.copyBufferToBuffer(e.getGPUBuffer(t),b,e.getGPUBuffer(i),0,this._batchBuffer.byteIndex)}this._renderer.gpu.device.queue.submit([r.finish()])}destroy(){for(let e=0;e<this._bindGroups.length;e++)this._bindGroups[e].destroy();this._bindGroups=null,this._bindGroupHash=null;for(let e=0;e<this._buffers.length;e++)this._buffers[e].destroy();this._buffers=null;for(let e=0;e<this._bufferResources.length;e++)this._bufferResources[e].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null}}q.extension={type:[f.WebGPUPipes],name:"uniformBatch"};const Re={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};function Ee(a,e,t,r,s){return a<<24|e<<16|t<<10|r<<5|s}function Ae(a,e,t,r){return t<<6|a<<3|r<<1|e}class Y{constructor(e){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=e}contextChange(e){this._gpu=e,this.setStencilMode(C.DISABLED),this._updatePipeHash()}setMultisampleCount(e){this._multisampleCount!==e&&(this._multisampleCount=e,this._updatePipeHash())}setRenderTarget(e){this._multisampleCount=e.msaaSamples,this._depthStencilAttachment=e.descriptor.depthStencilAttachment?1:0,this._updatePipeHash()}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash())}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=Ge[e],this._updatePipeHash())}setPipeline(e,t,r,s){const i=this.getPipeline(e,t,r);s.setPipeline(i)}getPipeline(e,t,r,s){e._layoutKey||(Be(e,t.attributeData),this._generateBufferKey(e)),s||(s=e.topology);const i=Ee(e._layoutKey,t._layoutKey,r.data,r._blendModeId,Re[s]);return this._pipeCache[i]?this._pipeCache[i]:(this._pipeCache[i]=this._createPipeline(e,t,r,s),this._pipeCache[i])}_createPipeline(e,t,r,s){const i=this._gpu.device,n=this._createVertexBufferLayouts(e,t),o=this._renderer.state.getColorTargets(r);o[0].writeMask=this._stencilMode===C.RENDERING_MASK_ADD?0:this._colorMask;const u=this._renderer.shader.getProgramData(t).pipeline,c={vertex:{module:this._getModule(t.vertex.source),entryPoint:t.vertex.entryPoint,buffers:n},fragment:{module:this._getModule(t.fragment.source),entryPoint:t.fragment.entryPoint,targets:o},primitive:{topology:s,cullMode:r.cullMode},layout:u,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(c.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:r.depthTest,depthCompare:r.depthTest?"less":"always"}),i.createRenderPipeline(c)}_getModule(e){return this._moduleCache[e]||this._createModule(e)}_createModule(e){const t=this._gpu.device;return this._moduleCache[e]=t.createShaderModule({code:e}),this._moduleCache[e]}_generateBufferKey(e){const t=[];let r=0;const s=Object.keys(e.attributes).sort();for(let n=0;n<s.length;n++){const o=e.attributes[s[n]];t[r++]=o.offset,t[r++]=o.format,t[r++]=o.stride,t[r++]=o.instance}const i=t.join("|");return e._layoutKey=U(i,"geometry"),e._layoutKey}_generateAttributeLocationsKey(e){const t=[];let r=0;const s=Object.keys(e.attributeData).sort();for(let n=0;n<s.length;n++){const o=e.attributeData[s[n]];t[r++]=o.location}const i=t.join("|");return e._attributeLocationsKey=U(i,"programAttributes"),e._attributeLocationsKey}getBufferNamesToBind(e,t){const r=e._layoutKey<<16|t._attributeLocationsKey;if(this._bindingNamesCache[r])return this._bindingNamesCache[r];const s=this._createVertexBufferLayouts(e,t),i=Object.create(null),n=t.attributeData;for(let o=0;o<s.length;o++){const c=Object.values(s[o].attributes)[0].shaderLocation;for(const p in n)if(n[p].location===c){i[o]=p;break}}return this._bindingNamesCache[r]=i,i}_createVertexBufferLayouts(e,t){t._attributeLocationsKey||this._generateAttributeLocationsKey(t);const r=e._layoutKey<<16|t._attributeLocationsKey;if(this._bufferLayoutsCache[r])return this._bufferLayoutsCache[r];const s=[];return e.buffers.forEach(i=>{const n={arrayStride:0,stepMode:"vertex",attributes:[]},o=n.attributes;for(const u in t.attributeData){const c=e.attributes[u];(c.divisor??1)!==1&&A(`Attribute ${u} has an invalid divisor value of '${c.divisor}'. WebGPU only supports a divisor value of 1`),c.buffer===i&&(n.arrayStride=c.stride,n.stepMode=c.instance?"instance":"vertex",o.push({shaderLocation:t.attributeData[u].location,offset:c.offset,format:c.format}))}o.length&&s.push(n)}),this._bufferLayoutsCache[r]=s,s}_updatePipeHash(){const e=Ae(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}}Y.extension={type:[f.WebGPUSystem],name:"pipeline"};class Le{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}class ke{init(e,t){this._renderer=e,this._renderTargetSystem=t}copyToTexture(e,t,r,s,i){const n=this._renderer,o=this._getGpuColorTexture(e),u=n.texture.getGpuSource(t.source);return n.encoder.commandEncoder.copyTextureToTexture({texture:o,origin:r},{texture:u,origin:i},s),t}startRenderPass(e,t=!0,r,s){const n=this._renderTargetSystem.getGpuRenderTarget(e),o=this.getDescriptor(e,t,r);n.descriptor=o,this._renderer.pipeline.setRenderTarget(n),this._renderer.encoder.beginRenderPass(n),this._renderer.encoder.setViewport(s)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,r){typeof t=="boolean"&&(t=t?y.ALL:y.NONE);const s=this._renderTargetSystem,i=s.getGpuRenderTarget(e),n=e.colorTextures.map((c,p)=>{const h=i.contexts[p];let l,d;h?l=h.getCurrentTexture().createView():l=this._renderer.texture.getGpuSource(c).createView({mipLevelCount:1}),i.msaaTextures[p]&&(d=l,l=this._renderer.texture.getTextureView(i.msaaTextures[p]));const _=t&y.COLOR?"clear":"load";return r??(r=s.defaultClearColor),{view:l,resolveTarget:d,clearValue:r,storeOp:"store",loadOp:_}});let o;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=i.msaa?4:1),e.depthStencilTexture){const c=t&y.STENCIL?"clear":"load",p=t&y.DEPTH?"clear":"load";o={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:c,depthClearValue:1,depthLoadOp:p,depthStoreOp:"store"}}return{colorAttachments:n,depthStencilAttachment:o}}clear(e,t=!0,r,s){if(!t)return;const{gpu:i,encoder:n}=this._renderer,o=i.device;if(n.commandEncoder===null){const c=o.createCommandEncoder(),p=this.getDescriptor(e,t,r),h=c.beginRenderPass(p);h.setViewport(s.x,s.y,s.width,s.height,0,1),h.end();const l=c.finish();o.queue.submit([l])}else this.startRenderPass(e,t,r,s)}initGpuRenderTarget(e){e.isRoot=!0;const t=new Le;return e.colorTextures.forEach((r,s)=>{if(ue.test(r.resource)){const i=r.resource.getContext("webgpu"),n=r.transparent?"premultiplied":"opaque";try{i.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:n})}catch(o){console.error(o)}t.contexts[s]=i}if(t.msaa=r.source.antialias,r.source.antialias){const i=new ce({width:0,height:0,sampleCount:4});t.msaaTextures[s]=i}}),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach(t=>{t.unconfigure()}),e.msaaTextures.forEach(t=>{t.destroy()}),e.msaaTextures.length=0,e.contexts.length=0}ensureDepthStencilTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach((r,s)=>{t.msaaTextures[s]?.resize(r.source.width,r.source.height,r.source._resolution)})}}class $ extends Se{constructor(e){super(e),this.adaptor=new ke,this.adaptor.init(e,this)}}$.extension={type:[f.WebGPUSystem],name:"renderTarget"};class X{constructor(){this._gpuProgramData=Object.create(null)}contextChange(e){this._gpu=e,this.maxTextures=e.device.limits.maxSampledTexturesPerShaderStage}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){const t=this._gpu.device,r=e.gpuLayout.map(i=>t.createBindGroupLayout({entries:i})),s={bindGroupLayouts:r};return this._gpuProgramData[e._layoutKey]={bindGroups:r,pipeline:t.createPipelineLayout(s)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}}X.extension={type:[f.WebGPUSystem],name:"shader"};const g={};g.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};g.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};g.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};g.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};g.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};g.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};g["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};g["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};g["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};g.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};g.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}};g.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}};class Z{constructor(){this.defaultState=new F,this.defaultState.blend=!0}contextChange(e){this.gpu=e}getColorTargets(e){return[{format:"bgra8unorm",writeMask:0,blend:g[e.blendMode]||g.normal}]}destroy(){this.gpu=null}}Z.extension={type:[f.WebGPUSystem],name:"state"};const De={type:"image",upload(a,e,t){const r=a.resource,s=(a.pixelWidth|0)*(a.pixelHeight|0),i=r.byteLength/s;t.device.queue.writeTexture({texture:e},r,{offset:0,rowsPerImage:a.pixelHeight,bytesPerRow:a.pixelHeight*i},{width:a.pixelWidth,height:a.pixelHeight,depthOrArrayLayers:1})}},J={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},He={blockBytes:4,blockWidth:1,blockHeight:1},ze={type:"compressed",upload(a,e,t){let r=a.pixelWidth,s=a.pixelHeight;const i=J[a.format]||He;for(let n=0;n<a.resource.length;n++){const o=a.resource[n],u=Math.ceil(r/i.blockWidth)*i.blockBytes;t.device.queue.writeTexture({texture:e,mipLevel:n},o,{offset:0,bytesPerRow:u},{width:Math.ceil(r/i.blockWidth)*i.blockWidth,height:Math.ceil(s/i.blockHeight)*i.blockHeight,depthOrArrayLayers:1}),r=Math.max(r>>1,1),s=Math.max(s>>1,1)}}},Q={type:"image",upload(a,e,t){const r=a.resource;if(!r)return;const s=Math.min(e.width,a.resourceWidth||a.pixelWidth),i=Math.min(e.height,a.resourceHeight||a.pixelHeight),n=a.alphaMode==="premultiply-alpha-on-upload";t.device.queue.copyExternalImageToTexture({source:r},{texture:e,premultipliedAlpha:n},{width:s,height:i})}},Fe={type:"video",upload(a,e,t){Q.upload(a,e,t)}};class Oe{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
|
||||||
|
var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
||||||
|
vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));
|
||||||
|
|
||||||
|
struct VertexOutput {
|
||||||
|
@builtin(position) position : vec4<f32>,
|
||||||
|
@location(0) texCoord : vec2<f32>,
|
||||||
|
};
|
||||||
|
|
||||||
|
@vertex
|
||||||
|
fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {
|
||||||
|
var output : VertexOutput;
|
||||||
|
output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);
|
||||||
|
output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
@group(0) @binding(0) var imgSampler : sampler;
|
||||||
|
@group(0) @binding(1) var img : texture_2d<f32>;
|
||||||
|
|
||||||
|
@fragment
|
||||||
|
fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
|
||||||
|
return textureSample(img, imgSampler, texCoord);
|
||||||
|
}
|
||||||
|
`})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){const t=this._getMipmapPipeline(e.format);if(e.dimension==="3d"||e.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let r=e;const s=e.depthOrArrayLayers||1,i=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!i){const u={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};r=this.device.createTexture(u)}const n=this.device.createCommandEncoder({}),o=t.getBindGroupLayout(0);for(let u=0;u<s;++u){let c=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),p=i?1:0;for(let h=1;h<e.mipLevelCount;++h){const l=r.createView({baseMipLevel:p++,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),d=n.beginRenderPass({colorAttachments:[{view:l,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),_=this.device.createBindGroup({layout:o,entries:[{binding:0,resource:this.sampler},{binding:1,resource:c}]});d.setPipeline(t),d.setBindGroup(0,_),d.draw(3,1,0,0),d.end(),c=l}}if(!i){const u={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s};for(let c=1;c<e.mipLevelCount;++c)n.copyTextureToTexture({texture:r,mipLevel:c-1},{texture:e,mipLevel:c},u),u.width=Math.ceil(u.width/2),u.height=Math.ceil(u.height/2)}return this.device.queue.submit([n.finish()]),i||r.destroy(),e}}class ee{constructor(e){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:Q,buffer:De,video:Fe,compressed:ze},this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuSources"),e.renderableGC.addManagedHash(this,"_gpuSamplers"),e.renderableGC.addManagedHash(this,"_bindGroupHash"),e.renderableGC.addManagedHash(this,"_textureViewHash")}contextChange(e){this._gpu=e}initSource(e){if(e.autoGenerateMipmaps){const u=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(u))+1}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);const r=J[e.format]||{blockBytes:4,blockWidth:1,blockHeight:1},s=Math.ceil(e.pixelWidth/r.blockWidth)*r.blockWidth,i=Math.ceil(e.pixelHeight/r.blockHeight)*r.blockHeight,n={label:e.label,size:{width:s,height:i},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},o=this._gpu.device.createTexture(n);return this._gpuSources[e.uid]=o,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),o}onSourceUpdate(e){const t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e))}onSourceUnload(e){const t=this._gpuSources[e.uid];t&&(this._gpuSources[e.uid]=null,t.destroy())}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new Oe(this._gpu.device));const t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t)}onSourceDestroy(e){e.off("update",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("destroy",this.onSourceDestroy,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}onSourceResize(e){const t=this._gpuSources[e.uid];t?(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(this._textureViewHash[e.uid]=null,this._bindGroupHash[e.uid]=null,this.onSourceUnload(e),this.initSource(e)):this.initSource(e)}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return this._gpuSources[e.uid]||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]??this._createTextureBindGroup(e)}_createTextureBindGroup(e){const t=e.source;return this._bindGroupHash[e.uid]=new E({0:t,1:t.style,2:new L({uTextureMatrix:{type:"mat3x3<f32>",value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){const t=e.source;return this._textureViewHash[t.uid]??this._createTextureView(t)}_createTextureView(e){return this._textureViewHash[e.uid]=this.getGpuSource(e).createView(),this._textureViewHash[e.uid]}generateCanvas(e){const t=this._renderer,r=t.gpu.device.createCommandEncoder(),s=T.get().createCanvas();s.width=e.source.pixelWidth,s.height=e.source.pixelHeight;const i=s.getContext("webgpu");return i.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:T.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),r.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:i.getCurrentTexture()},{width:s.width,height:s.height}),t.gpu.device.queue.submit([r.finish()]),s}getPixels(e){const t=this.generateCanvas(e),r=w.getOptimalCanvasAndContext(t.width,t.height),s=r.context;s.drawImage(t,0,0);const{width:i,height:n}=t,o=s.getImageData(0,0,i,n),u=new Uint8ClampedArray(o.data.buffer);return w.returnCanvasAndContext(r),{pixels:u,width:i,height:n}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null;for(const e of Object.keys(this._bindGroupHash)){const t=Number(e);this._bindGroupHash[t]?.destroy(),this._bindGroupHash[t]=null}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null}}ee.extension={type:[f.WebGPUSystem],name:"texture"};class te{init(){const e=new L({uTransformMatrix:{value:new k,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),t=D({name:"graphics",bits:[de,he(pe()),ge,H]});this.shader=new z({gpuProgram:t,resources:{localUniforms:e}})}execute(e,t){const r=t.context,s=r.customShader||this.shader,i=e.renderer,n=i.graphicsContext,{batcher:o,instructions:u}=n.getContextRenderData(r),c=i.encoder;c.setGeometry(o.geometry,s.gpuProgram);const p=i.globalUniforms.bindGroup;c.setBindGroup(0,p,s.gpuProgram);const h=i.renderPipes.uniformBatch.getUniformBindGroup(s.resources.localUniforms,!0);c.setBindGroup(2,h,s.gpuProgram);const l=u.instructions;let d=null;for(let _=0;_<u.instructionSize;_++){const m=l[_];if(m.topology!==d&&(d=m.topology,c.setPipelineFromGeometryProgramAndState(o.geometry,s.gpuProgram,e.state,m.topology)),s.groups[1]=m.bindGroup,!m.gpuBindGroup){const S=m.textures;m.bindGroup=R(S.textures,S.count),m.gpuBindGroup=i.bindGroup.getBindGroup(m.bindGroup,s.gpuProgram,1)}c.setBindGroup(1,m.bindGroup,s.gpuProgram),c.renderPassEncoder.drawIndexed(m.size,1,m.start)}}destroy(){this.shader.destroy(!0),this.shader=null}}te.extension={type:[f.WebGPUPipesAdaptor],name:"graphics"};class re{init(){const e=D({name:"mesh",bits:[me,Pe,H]});this._shader=new z({gpuProgram:e,resources:{uTexture:M.EMPTY._source,uSampler:M.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new k}}}})}execute(e,t){const r=e.renderer;let s=t._shader;if(!s)s=this._shader,s.groups[2]=r.texture.getTextureBindGroup(t.texture);else if(!s.gpuProgram){A("Mesh shader has no gpuProgram",t.shader);return}const i=s.gpuProgram;if(i.autoAssignGlobalUniforms&&(s.groups[0]=r.globalUniforms.bindGroup),i.autoAssignLocalUniforms){const n=e.localUniforms;s.groups[1]=r.renderPipes.uniformBatch.getUniformBindGroup(n,!0)}r.encoder.draw({geometry:t._geometry,shader:s,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}re.extension={type:[f.WebGPUPipesAdaptor],name:"mesh"};const Ie=[...Te,K,N,v,W,ee,$,X,Z,Y,V,j,I],We=[...Ce,q],Ve=[O,re,te],se=[],ie=[],ne=[];B.handleByNamedList(f.WebGPUSystem,se);B.handleByNamedList(f.WebGPUPipes,ie);B.handleByNamedList(f.WebGPUPipesAdaptor,ne);B.add(...Ie,...We,...Ve);class Je extends le{constructor(){const e={name:"webgpu",type:fe.WEBGPU,systems:se,renderPipes:ie,renderPipeAdaptors:ne};super(e)}}export{Je as WebGPURenderer};
|
||||||
1
qbit/vuetorrent/public/assets/browserAll-C1HMKx36.js
Normal file
1
qbit/vuetorrent/public/assets/browserAll-C1HMKx36.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{P as m,r as J,E as w,T as B,U as Q,a as ee,w as y,e as z,C as Z}from"./TorrentDetail-CoyYqyCA.js";import"./webworkerAll-D3jJ_Vry.js";import"./ColoredChip.vue_vue_type_script_setup_true_lang-DosC_URk.js";import"./index-BhWmfNB5.js";import"./vue-DFryKk-1.js";import"./vuetify-XtA0Y0Oj.js";import"./colorToUniform-C2GHuDhf.js";import"./CanvasPool-BAToQajg.js";class M{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=M.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new m,this.page=new m,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var O=/iPhone/i,C=/iPod/i,S=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,A=/Silk/i,g=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,R=/BlackBerry/i,F=/BB10/i,Y=/Opera Mini/i,K=/\b(CriOS|Chrome)(?:.+)Mobile/i,$=/Mobile(?:.+)Firefox\b/i,G=function(o){return typeof o<"u"&&o.platform==="MacIntel"&&typeof o.maxTouchPoints=="number"&&o.maxTouchPoints>1&&typeof MSStream>"u"};function te(o){return function(e){return e.test(o)}}function W(o){var e={userAgent:"",platform:"",maxTouchPoints:0};!o&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof o=="string"?e.userAgent=o:o&&o.userAgent&&(e={userAgent:o.userAgent,platform:o.platform,maxTouchPoints:o.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=te(t),s={apple:{phone:n(O)&&!n(g),ipod:n(C),tablet:!n(O)&&(n(S)||G(e))&&!n(g),universal:n(U),device:(n(O)||n(C)||n(S)||n(U)||G(e))&&!n(g)},amazon:{phone:n(b),tablet:!n(b)&&n(A),device:n(b)||n(A)},android:{phone:!n(g)&&n(b)||!n(g)&&n(k),tablet:!n(g)&&!n(b)&&!n(k)&&(n(A)||n(H)),device:!n(g)&&(n(b)||n(A)||n(k)||n(H))||n(/\bokhttp\b/i)},windows:{phone:n(g),tablet:n(X),device:n(g)||n(X)},other:{blackberry:n(R),blackberry10:n(F),opera:n(Y),firefox:n($),chrome:n(K),device:n(R)||n(F)||n(Y)||n($)||n(K)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const ie=W.default??W,ne=ie(globalThis.navigator),se=9,I=100,oe=0,re=0,j=2,N=1,ae=-1e3,he=-1e3,le=2;class V{constructor(e,t=ne){this._mobileInfo=t,this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook();const i=document.createElement("div");i.style.width=`${I}px`,i.style.height=`${I}px`,i.style.position="absolute",i.style.top=`${oe}px`,i.style.left=`${re}px`,i.style.zIndex=j.toString(),this._div=i,this._renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const e=document.createElement("button");e.style.width=`${N}px`,e.style.height=`${N}px`,e.style.position="absolute",e.style.top=`${ae}px`,e.style.left=`${he}px`,e.style.zIndex=le.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.add(this),this._renderer.view.canvas.parentNode?.appendChild(this._div))}_deactivate(){!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this),this._div.parentNode?.removeChild(this._div))}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){this.debug=e?.debug??this.debug,this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas))return;this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered);const{x:t,y:i,width:n,height:s}=this._renderer.view.canvas.getBoundingClientRect(),{width:r,height:a,resolution:c}=this._renderer,p=n/r*c,h=s/a*c;let l=this._div;l.style.left=`${t}px`,l.style.top=`${i}px`,l.style.width=`${r}px`,l.style.height=`${a}px`;for(let d=0;d<this._children.length;d++){const u=this._children[d];if(u._renderId!==this._renderId)u._accessibleActive=!1,J(this._children,d,1),this._div.removeChild(u._accessibleDiv),this._pool.push(u._accessibleDiv),u._accessibleDiv=null,d--;else{l=u._accessibleDiv;let v=u.hitArea;const _=u.worldTransform;u.hitArea?(l.style.left=`${(_.tx+v.x*_.a)*p}px`,l.style.top=`${(_.ty+v.y*_.d)*h}px`,l.style.width=`${v.width*_.a*p}px`,l.style.height=`${v.height*_.d*h}px`):(v=u.getBounds().rectangle,this._capHitArea(v),l.style.left=`${v.x*p}px`,l.style.top=`${v.y*h}px`,l.style.width=`${v.width*p}px`,l.style.height=`${v.height*h}px`,l.title!==u.accessibleTitle&&u.accessibleTitle!==null&&(l.title=u.accessibleTitle||""),l.getAttribute("aria-label")!==u.accessibleHint&&u.accessibleHint!==null&&l.setAttribute("aria-label",u.accessibleHint||"")),(u.accessibleTitle!==l.title||u.tabIndex!==l.tabIndex)&&(l.title=u.accessibleTitle||"",l.tabIndex=u.tabIndex,this.debug&&this._updateDebugHTML(l))}}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let t=this._pool.pop();t||(t=document.createElement("button"),t.style.width=`${I}px`,t.style.height=`${I}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=j.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{container:i}=e.target,n=this._renderer.events.rootBoundary,s=Object.assign(new M(n),{target:i});n.rootTarget=this._renderer.lastObjectRendered,t.forEach(r=>n.dispatchEvent(s,r))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===se&&this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._destroyTouchHook(),this._div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this._pool=null,this._children=null,this._renderer=null}}V.extension={type:[w.WebGLSystem,w.WebGPUSystem],name:"accessibility"};const ue={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,_renderId:-1};class de{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(B.system.add(this._tickerUpdate,this,Q.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(B.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}}const E=new de;class D extends M{constructor(){super(...arguments),this.client=new m,this.movement=new m,this.offset=new m,this.global=new m,this.screen=new m}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,i){return e.worldTransform.applyInverse(i||this.global,t)}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,i,n,s,r,a,c,p,h,l,d,u,v,_){throw new Error("Method not implemented.")}}class f extends D{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class T extends D{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}T.DOM_DELTA_PIXEL=0;T.DOM_DELTA_LINE=1;T.DOM_DELTA_PAGE=2;const ce=2048,pe=new m,P=new m;class ve{constructor(e){this.dispatch=new ee,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((i,n)=>i.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i<n;i++)t[i].fn(e);else y(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,t){E.pauseUpdate=!0;const n=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",s=this[n](this.rootTarget,this.rootTarget.eventMode,pe.set(e,t),this.hitTestFn,this.hitPruneFn);return s&&s[0]}propagate(e,t){if(!e.target)return;const i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let n=0,s=i.length-1;n<s;n++)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let s=i.length-1;s>=0;s--)n.forEach(r=>{e.currentTarget=i[s],this.notifyTarget(e,r)})}propagationPath(e){const t=[e];for(let i=0;i<ce&&e!==this.rootTarget&&e.parent;i++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,i,n,s,r=!1){let a=!1;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const h=e.children;for(let l=h.length-1;l>=0;l--){const d=h[l],u=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,n,s,r||s(e,i));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const v=e.isInteractive();(u.length>0||v)&&(v&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),a=!0}}}const c=this._isInteractive(t),p=e.isInteractive();return p&&p&&this._allInteractiveElements.push(e),r||this._hitElements.length>0?null:a?this._hitElements:c&&!s(e,i)&&n(e,i)?p?[e]:[]:null}hitTestRecursive(e,t,i,n,s){if(this._interactivePrune(e)||s(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children,p=i;for(let h=c.length-1;h>=0;h--){const l=c[h],d=this.hitTestRecursive(l,this._isInteractive(t)?t:l.eventMode,p,n,s);if(d){if(d.length>0&&!d[d.length-1].parent)continue;const u=e.isInteractive();return(d.length>0||u)&&d.push(e),d}}}const r=this._isInteractive(t),a=e.isInteractive();return r&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,P),!e.hitArea.contains(P.x,P.y)))return!0;if(e.effects&&e.effects.length)for(let i=0;i<e.effects.length;i++){const n=e.effects[i];if(n.containsPoint&&!n.containsPoint(t,this.hitTestFn))return!0}return!1}hitTestFn(e,t){return e.hitArea?!0:e?.containsPoint?(e.worldTransform.applyInverse(t,P),e.containsPoint(P)):!1}notifyTarget(e,t){if(!e.currentTarget.isInteractive())return;t??(t=e.type);const i=`on${t}`;e.currentTarget[i]?.(e);const n=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,n),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const n=t.button===2;this.dispatchEvent(t,n?"rightdown":"mousedown")}const i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const i=t.pointerType==="mouse"||t.pointerType==="pen",n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.overTargets);if(n.overTargets?.length>0&&s!==t.target){const c=e.type==="mousemove"?"mouseout":"pointerout",p=this.createPointerEvent(e,c,s);if(this.dispatchEvent(p,"pointerout"),i&&this.dispatchEvent(p,"mouseout"),!t.composedPath().includes(s)){const h=this.createPointerEvent(e,"pointerleave",s);for(h.eventPhase=h.AT_TARGET;h.target&&!t.composedPath().includes(h.target);)h.currentTarget=h.target,this.notifyTarget(h),i&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;this.freeEvent(h)}this.freeEvent(p)}if(s!==t.target){const c=e.type==="mousemove"?"mouseover":"pointerover",p=this.clonePointerEvent(t,c);this.dispatchEvent(p,"pointerover"),i&&this.dispatchEvent(p,"mouseover");let h=s?.parent;for(;h&&h!==this.rootTarget.parent&&h!==t.target;)h=h.parent;if(!h||h===this.rootTarget.parent){const d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==s&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(p)}const r=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?r.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&r.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?r.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&r.push("globaltouchmove")),i&&(this.moveOnAll?r.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&r.push("globalmousemove"),this.cursor=t.target?.cursor),r.length>0&&this.all(t,r),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=i.target?.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),s=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const r=this.createPointerEvent(e,"pointerleave",n);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),i&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;t.overTargets=null,this.freeEvent(s),this.freeEvent(r)}this.cursor=null}mapPointerUp(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[e.button]);let r=s;if(s&&!i.composedPath().includes(s)){let a=s;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],r=a}if(r){const a=this.clonePointerEvent(i,"click");a.target=r,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=n.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const p=a.button===2;this.dispatchEvent(a,p?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof T)){y("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i<e.length&&e[i].parent===t;i++)t=e[i];return t}createPointerEvent(e,t,i){const n=this.allocateEvent(f);return this.copyPointerData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,n.target=i??this.hitTest(n.global.x,n.global.y)??this._hitElements[0],typeof t=="string"&&(n.type=t),n}createWheelEvent(e){const t=this.allocateEvent(T);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){const i=this.allocateEvent(f);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=t??i.type,i}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}copyPointerData(e,t){e instanceof f&&t instanceof f&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}copyMouseData(e,t){e instanceof D&&t instanceof D&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global))}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);const t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.defaultPrevented=!1,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}_notifyListeners(e,t){const i=e.currentTarget._events[t];if(i)if("fn"in i)i.once&&e.currentTarget.removeListener(t,i.fn,void 0,!0),i.fn.call(i.context,e);else for(let n=0,s=i.length;n<s&&!e.propagationImmediatelyStopped;n++)i[n].once&&e.currentTarget.removeListener(t,i[n].fn,void 0,!0),i[n].fn.call(i[n].context,e)}}const fe=1,ge={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},L=class x{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new ve(null),E.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new f(null),this._rootWheelEvent=new T(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...x.defaultEventFeatures},{set:(t,i,n)=>(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,x._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e||(e="default");let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i<n;i++){const s=t[i],r=this._bootstrapEvent(this._rootPointerEvent,s);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,E.pointerMoved();const t=this._normalizeToPointerData(e);for(let i=0,n=t.length;i<n;i++){const s=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this._normalizeToPointerData(e);for(let s=0,r=n.length;s<r;s++){const a=this._bootstrapEvent(this._rootPointerEvent,n[s]);a.type+=i,this.rootBoundary.mapEvent(a)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);for(let i=0,n=t.length;i<n;i++){const s=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;const t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this._removeEvents(),this.domElement=e,E.domElement=e,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;E.addTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,!0),this.domElement.addEventListener("pointerdown",this._onPointerDown,!0),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this._onPointerOverOut,!0),globalThis.addEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,!0),this.domElement.addEventListener("mousedown",this._onPointerDown,!0),this.domElement.addEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this._onPointerOverOut,!0),globalThis.addEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,!0),this.domElement.addEventListener("touchend",this._onPointerUp,!0),this.domElement.addEventListener("touchmove",this._onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;E.removeTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this._onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,!0),this.domElement.removeEventListener("mousedown",this._onPointerDown,!0),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,!0),this.domElement.removeEventListener("touchend",this._onPointerUp,!0),this.domElement.removeEventListener("touchmove",this._onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(e,t,i){const n=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},s=1/this.resolution;e.x=(t-n.left)*(this.domElement.width/n.width)*s,e.y=(i-n.top)*(this.domElement.height/n.height)*s}_normalizeToPointerData(e){const t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let i=0,n=e.changedTouches.length;i<n;i++){const s=e.changedTouches[i];typeof s.button>"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=e.type,t.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=fe),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=ge[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};L.extension={name:"events",type:[w.WebGLSystem,w.CanvasSystem,w.WebGPUSystem],priority:-1};L.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let q=L;const me={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(o){this.eventMode=o?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??q.defaultEventMode},set eventMode(o){this._internalEventMode=o},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(o,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,s=typeof t=="object"?t.once===!0:!1,r=typeof e=="function"?void 0:e;o=i?`${o}capture`:o;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(o,a,r)}),s?c.once(o,a,r):c.on(o,a,r)},removeEventListener(o,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;o=i?`${o}capture`:o,e=typeof e=="function"?e:e.handleEvent,this.off(o,e,n)},dispatchEvent(o){if(!(o instanceof M))throw new Error("Container cannot propagate events outside of the Federated Events API");return o.defaultPrevented=!1,o.path=null,o.target=this,o.manager.dispatchEvent(o),!o.defaultPrevented}};z.add(V);Z.mixin(ue);z.add(q);Z.mixin(me);
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{P as m,r as J,E as w,T as L,U as Q,a as ee,w as y,e as z,C as Z,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";import{__tla as __tla_1}from"./webworkerAll-L7cTVnAp.js";import{__tla as __tla_2}from"./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js";import{__tla as __tla_3}from"./index-C0tfT_Qc.js";import"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";import{__tla as __tla_4}from"./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_5}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js";import{__tla as __tla_6}from"./colorToUniform-rMRo2qOn.js";import{__tla as __tla_7}from"./CanvasPool-D00IADyo.js";import{__tla as __tla_8}from"./getBatchSamplersUniformGroup-B1Z3BKU1.js";Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})(),(()=>{try{return __tla_8}catch{}})()]).then(async()=>{class M{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=M.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new m,this.page=new m,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var O=/iPhone/i,C=/iPod/i,S=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,A=/Silk/i,g=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,R=/BlackBerry/i,F=/BB10/i,Y=/Opera Mini/i,K=/\b(CriOS|Chrome)(?:.+)Mobile/i,$=/Mobile(?:.+)Firefox\b/i,G=function(o){return typeof o<"u"&&o.platform==="MacIntel"&&typeof o.maxTouchPoints=="number"&&o.maxTouchPoints>1&&typeof MSStream>"u"};function te(o){return function(e){return e.test(o)}}function W(o){var e={userAgent:"",platform:"",maxTouchPoints:0};!o&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof o=="string"?e.userAgent=o:o&&o.userAgent&&(e={userAgent:o.userAgent,platform:o.platform,maxTouchPoints:o.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=te(t),s={apple:{phone:n(O)&&!n(g),ipod:n(C),tablet:!n(O)&&(n(S)||G(e))&&!n(g),universal:n(U),device:(n(O)||n(C)||n(S)||n(U)||G(e))&&!n(g)},amazon:{phone:n(b),tablet:!n(b)&&n(A),device:n(b)||n(A)},android:{phone:!n(g)&&n(b)||!n(g)&&n(k),tablet:!n(g)&&!n(b)&&!n(k)&&(n(A)||n(H)),device:!n(g)&&(n(b)||n(A)||n(k)||n(H))||n(/\bokhttp\b/i)},windows:{phone:n(g),tablet:n(X),device:n(g)||n(X)},other:{blackberry:n(R),blackberry10:n(F),opera:n(Y),firefox:n($),chrome:n(K),device:n(R)||n(F)||n(Y)||n($)||n(K)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const ie=W.default??W,ne=ie(globalThis.navigator),se=9,I=100,oe=0,re=0,j=2,N=1,ae=-1e3,he=-1e3,le=2;class V{constructor(e,t=ne){this._mobileInfo=t,this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook();const i=document.createElement("div");i.style.width=`${I}px`,i.style.height=`${I}px`,i.style.position="absolute",i.style.top=`${oe}px`,i.style.left=`${re}px`,i.style.zIndex=j.toString(),this._div=i,this._renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const e=document.createElement("button");e.style.width=`${N}px`,e.style.height=`${N}px`,e.style.position="absolute",e.style.top=`${ae}px`,e.style.left=`${he}px`,e.style.zIndex=le.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.add(this),this._renderer.view.canvas.parentNode?.appendChild(this._div))}_deactivate(){!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this),this._div.parentNode?.removeChild(this._div))}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i])}init(e){this.debug=e?.debug??this.debug,this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas))return;this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered);const{x:t,y:i,width:n,height:s}=this._renderer.view.canvas.getBoundingClientRect(),{width:r,height:a,resolution:c}=this._renderer,p=n/r*c,h=s/a*c;let l=this._div;l.style.left=`${t}px`,l.style.top=`${i}px`,l.style.width=`${r}px`,l.style.height=`${a}px`;for(let d=0;d<this._children.length;d++){const u=this._children[d];if(u._renderId!==this._renderId)u._accessibleActive=!1,J(this._children,d,1),this._div.removeChild(u._accessibleDiv),this._pool.push(u._accessibleDiv),u._accessibleDiv=null,d--;else{l=u._accessibleDiv;let v=u.hitArea;const _=u.worldTransform;u.hitArea?(l.style.left=`${(_.tx+v.x*_.a)*p}px`,l.style.top=`${(_.ty+v.y*_.d)*h}px`,l.style.width=`${v.width*_.a*p}px`,l.style.height=`${v.height*_.d*h}px`):(v=u.getBounds().rectangle,this._capHitArea(v),l.style.left=`${v.x*p}px`,l.style.top=`${v.y*h}px`,l.style.width=`${v.width*p}px`,l.style.height=`${v.height*h}px`,l.title!==u.accessibleTitle&&u.accessibleTitle!==null&&(l.title=u.accessibleTitle||""),l.getAttribute("aria-label")!==u.accessibleHint&&u.accessibleHint!==null&&l.setAttribute("aria-label",u.accessibleHint||"")),(u.accessibleTitle!==l.title||u.tabIndex!==l.tabIndex)&&(l.title=u.accessibleTitle||"",l.tabIndex=u.tabIndex,this.debug&&this._updateDebugHTML(l))}}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let t=this._pool.pop();t||(t=document.createElement("button"),t.style.width=`${I}px`,t.style.height=`${I}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=j.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{container:i}=e.target,n=this._renderer.events.rootBoundary,s=Object.assign(new M(n),{target:i});n.rootTarget=this._renderer.lastObjectRendered,t.forEach(r=>n.dispatchEvent(s,r))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===se&&this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._destroyTouchHook(),this._div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this._pool=null,this._children=null,this._renderer=null}}V.extension={type:[w.WebGLSystem,w.WebGPUSystem],name:"accessibility"};const ue={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,_renderId:-1};class de{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(L.system.add(this._tickerUpdate,this,Q.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(L.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}}const E=new de;class D extends M{constructor(){super(...arguments),this.client=new m,this.movement=new m,this.offset=new m,this.global=new m,this.screen=new m}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,i){return e.worldTransform.applyInverse(i||this.global,t)}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,i,n,s,r,a,c,p,h,l,d,u,v,_){throw new Error("Method not implemented.")}}class f extends D{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class T extends D{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}T.DOM_DELTA_PIXEL=0;T.DOM_DELTA_LINE=1;T.DOM_DELTA_PAGE=2;const ce=2048,pe=new m,P=new m;class ve{constructor(e){this.dispatch=new ee,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((i,n)=>i.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i<n;i++)t[i].fn(e);else y(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,t){E.pauseUpdate=!0;const n=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",s=this[n](this.rootTarget,this.rootTarget.eventMode,pe.set(e,t),this.hitTestFn,this.hitPruneFn);return s&&s[0]}propagate(e,t){if(!e.target)return;const i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let n=0,s=i.length-1;n<s;n++)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let s=i.length-1;s>=0;s--)n.forEach(r=>{e.currentTarget=i[s],this.notifyTarget(e,r)})}propagationPath(e){const t=[e];for(let i=0;i<ce&&e!==this.rootTarget&&e.parent;i++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,i,n,s,r=!1){let a=!1;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const h=e.children;for(let l=h.length-1;l>=0;l--){const d=h[l],u=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,n,s,r||s(e,i));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const v=e.isInteractive();(u.length>0||v)&&(v&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),a=!0}}}const c=this._isInteractive(t),p=e.isInteractive();return p&&p&&this._allInteractiveElements.push(e),r||this._hitElements.length>0?null:a?this._hitElements:c&&!s(e,i)&&n(e,i)?p?[e]:[]:null}hitTestRecursive(e,t,i,n,s){if(this._interactivePrune(e)||s(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children,p=i;for(let h=c.length-1;h>=0;h--){const l=c[h],d=this.hitTestRecursive(l,this._isInteractive(t)?t:l.eventMode,p,n,s);if(d){if(d.length>0&&!d[d.length-1].parent)continue;const u=e.isInteractive();return(d.length>0||u)&&d.push(e),d}}}const r=this._isInteractive(t),a=e.isInteractive();return r&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.includeInBuild||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,P),!e.hitArea.contains(P.x,P.y)))return!0;if(e.effects&&e.effects.length)for(let i=0;i<e.effects.length;i++){const n=e.effects[i];if(n.containsPoint&&!n.containsPoint(t,this.hitTestFn))return!0}return!1}hitTestFn(e,t){return e.hitArea?!0:e?.containsPoint?(e.worldTransform.applyInverse(t,P),e.containsPoint(P)):!1}notifyTarget(e,t){t=t??e.type;const i=`on${t}`;e.currentTarget[i]?.(e);const n=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,n),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const n=t.button===2;this.dispatchEvent(t,n?"rightdown":"mousedown")}const i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const i=t.pointerType==="mouse"||t.pointerType==="pen",n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.overTargets);if(n.overTargets?.length>0&&s!==t.target){const c=e.type==="mousemove"?"mouseout":"pointerout",p=this.createPointerEvent(e,c,s);if(this.dispatchEvent(p,"pointerout"),i&&this.dispatchEvent(p,"mouseout"),!t.composedPath().includes(s)){const h=this.createPointerEvent(e,"pointerleave",s);for(h.eventPhase=h.AT_TARGET;h.target&&!t.composedPath().includes(h.target);)h.currentTarget=h.target,this.notifyTarget(h),i&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;this.freeEvent(h)}this.freeEvent(p)}if(s!==t.target){const c=e.type==="mousemove"?"mouseover":"pointerover",p=this.clonePointerEvent(t,c);this.dispatchEvent(p,"pointerover"),i&&this.dispatchEvent(p,"mouseover");let h=s?.parent;for(;h&&h!==this.rootTarget.parent&&h!==t.target;)h=h.parent;if(!h||h===this.rootTarget.parent){const d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==s&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(p)}const r=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?r.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&r.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?r.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&r.push("globaltouchmove")),i&&(this.moveOnAll?r.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&r.push("globalmousemove"),this.cursor=t.target?.cursor),r.length>0&&this.all(t,r),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=i.target?.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),s=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const r=this.createPointerEvent(e,"pointerleave",n);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),i&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;t.overTargets=null,this.freeEvent(s),this.freeEvent(r)}this.cursor=null}mapPointerUp(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[e.button]);let r=s;if(s&&!i.composedPath().includes(s)){let a=s;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],r=a}if(r){const a=this.clonePointerEvent(i,"click");a.target=r,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=n.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const p=a.button===2;this.dispatchEvent(a,p?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof T)){y("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i<e.length&&e[i].parent===t;i++)t=e[i];return t}createPointerEvent(e,t,i){const n=this.allocateEvent(f);return this.copyPointerData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,n.target=i??this.hitTest(n.global.x,n.global.y)??this._hitElements[0],typeof t=="string"&&(n.type=t),n}createWheelEvent(e){const t=this.allocateEvent(T);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){const i=this.allocateEvent(f);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=t??i.type,i}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}copyPointerData(e,t){e instanceof f&&t instanceof f&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}copyMouseData(e,t){e instanceof D&&t instanceof D&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global))}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);const t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}_notifyListeners(e,t){const i=e.currentTarget._events[t];if(i&&e.currentTarget.isInteractive())if("fn"in i)i.once&&e.currentTarget.removeListener(t,i.fn,void 0,!0),i.fn.call(i.context,e);else for(let n=0,s=i.length;n<s&&!e.propagationImmediatelyStopped;n++)i[n].once&&e.currentTarget.removeListener(t,i[n].fn,void 0,!0),i[n].fn.call(i[n].context,e)}}const fe=1,ge={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},B=class x{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new ve(null),E.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new f(null),this._rootWheelEvent=new T(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...x.defaultEventFeatures},{set:(t,i,n)=>(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,x._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i<n;i++){const s=t[i],r=this._bootstrapEvent(this._rootPointerEvent,s);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,E.pointerMoved();const t=this._normalizeToPointerData(e);for(let i=0,n=t.length;i<n;i++){const s=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this._normalizeToPointerData(e);for(let s=0,r=n.length;s<r;s++){const a=this._bootstrapEvent(this._rootPointerEvent,n[s]);a.type+=i,this.rootBoundary.mapEvent(a)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);for(let i=0,n=t.length;i<n;i++){const s=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;const t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this._removeEvents(),this.domElement=e,E.domElement=e,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;E.addTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,!0),this.domElement.addEventListener("pointerdown",this._onPointerDown,!0),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this._onPointerOverOut,!0),globalThis.addEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,!0),this.domElement.addEventListener("mousedown",this._onPointerDown,!0),this.domElement.addEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this._onPointerOverOut,!0),globalThis.addEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,!0),this.domElement.addEventListener("touchend",this._onPointerUp,!0),this.domElement.addEventListener("touchmove",this._onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;E.removeTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this._onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,!0),this.domElement.removeEventListener("mousedown",this._onPointerDown,!0),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,!0),this.domElement.removeEventListener("touchend",this._onPointerUp,!0),this.domElement.removeEventListener("touchmove",this._onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(e,t,i){const n=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},s=1/this.resolution;e.x=(t-n.left)*(this.domElement.width/n.width)*s,e.y=(i-n.top)*(this.domElement.height/n.height)*s}_normalizeToPointerData(e){const t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let i=0,n=e.changedTouches.length;i<n;i++){const s=e.changedTouches[i];typeof s.button>"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=e.type,t.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=fe),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=ge[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};B.extension={name:"events",type:[w.WebGLSystem,w.CanvasSystem,w.WebGPUSystem],priority:-1};B.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let q=B;const me={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(o){this.eventMode=o?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??q.defaultEventMode},set eventMode(o){this._internalEventMode=o},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(o,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,s=typeof t=="object"?t.once===!0:!1,r=typeof e=="function"?void 0:e;o=i?`${o}capture`:o;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(o,a,r)}),s?c.once(o,a,r):c.on(o,a,r)},removeEventListener(o,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;o=i?`${o}capture`:o,e=typeof e=="function"?e:e.handleEvent,this.off(o,e,n)},dispatchEvent(o){if(!(o instanceof M))throw new Error("Container cannot propagate events outside of the Federated Events API");return o.defaultPrevented=!1,o.path=null,o.target=this,o.manager.dispatchEvent(o),!o.defaultPrevented}};z.add(V);Z.mixin(ue);z.add(q);Z.mixin(me)});
|
|
||||||
31
qbit/vuetorrent/public/assets/colorToUniform-C2GHuDhf.js
Normal file
31
qbit/vuetorrent/public/assets/colorToUniform-C2GHuDhf.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
const f={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},n=0,i=1,r=2,a=3,l=4,d=5,h=class u{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<n)}set blend(t){!!(this.data&1<<n)!==t&&(this.data^=1<<n)}get offsets(){return!!(this.data&1<<i)}set offsets(t){!!(this.data&1<<i)!==t&&(this.data^=1<<i)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<r)}set culling(t){!!(this.data&1<<r)!==t&&(this.data^=1<<r)}get depthTest(){return!!(this.data&1<<a)}set depthTest(t){!!(this.data&1<<a)!==t&&(this.data^=1<<a)}get depthMask(){return!!(this.data&1<<d)}set depthMask(t){!!(this.data&1<<d)!==t&&(this.data^=1<<d)}get clockwiseFrontFace(){return!!(this.data&1<<l)}set clockwiseFrontFace(t){!!(this.data&1<<l)!==t&&(this.data^=1<<l)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=f[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new u;return t.depthTest=!1,t.blend=!0,t}};h.default2d=h.for2d();let m=h;const c={name:"local-uniform-bit",vertex:{header:`
|
||||||
|
|
||||||
|
struct LocalUniforms {
|
||||||
|
uTransformMatrix:mat3x3<f32>,
|
||||||
|
uColor:vec4<f32>,
|
||||||
|
uRound:f32,
|
||||||
|
}
|
||||||
|
|
||||||
|
@group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
||||||
|
`,main:`
|
||||||
|
vColor *= localUniforms.uColor;
|
||||||
|
modelMatrix *= localUniforms.uTransformMatrix;
|
||||||
|
`,end:`
|
||||||
|
if(localUniforms.uRound == 1)
|
||||||
|
{
|
||||||
|
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
||||||
|
}
|
||||||
|
`}},g={...c,vertex:{...c.vertex,header:c.vertex.header.replace("group(1)","group(2)")}},p={name:"local-uniform-bit",vertex:{header:`
|
||||||
|
|
||||||
|
uniform mat3 uTransformMatrix;
|
||||||
|
uniform vec4 uColor;
|
||||||
|
uniform float uRound;
|
||||||
|
`,main:`
|
||||||
|
vColor *= uColor;
|
||||||
|
modelMatrix = uTransformMatrix;
|
||||||
|
`,end:`
|
||||||
|
if(uRound == 1.)
|
||||||
|
{
|
||||||
|
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
||||||
|
}
|
||||||
|
`}};class b{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}}function M(e,t,o){const s=(e>>24&255)/255;t[o++]=(e&255)/255*s,t[o++]=(e>>8&255)/255*s,t[o++]=(e>>16&255)/255*s,t[o++]=s}export{b as B,m as S,c as a,p as b,M as c,g as l};
|
||||||
@@ -1,257 +0,0 @@
|
|||||||
import{l as dt,u as K,a as mt,d as T,j as ht,k as pt,n as X,w as gt,g as N,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";let me,S,H,ee,re,Ft,se,ut,oe,W,D,nt,ae,St,he,ne,ie,fe,ue,le,de,ce;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{const C=Object.create(null),Y=Object.create(null);W=function(o,t){let e=Y[o];return e===void 0&&(C[t]===void 0&&(C[t]=1),Y[o]=e=C[t]++),e};let G;function xt(){if(!G){G="mediump";const o=dt();o&&o.getShaderPrecisionFormat&&(G=o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_FLOAT).precision?"highp":"mediump")}return G}function vt(o,t,e){return t?o:e?(o=o.replace("out vec4 finalColor;",""),`
|
|
||||||
|
|
||||||
#ifdef GL_ES // This checks if it is WebGL1
|
|
||||||
#define in varying
|
|
||||||
#define finalColor gl_FragColor
|
|
||||||
#define texture texture2D
|
|
||||||
#endif
|
|
||||||
${o}
|
|
||||||
`):`
|
|
||||||
|
|
||||||
#ifdef GL_ES // This checks if it is WebGL1
|
|
||||||
#define in attribute
|
|
||||||
#define out varying
|
|
||||||
#endif
|
|
||||||
${o}
|
|
||||||
`}function bt(o,t,e){const r=e?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(o.substring(0,9)!=="precision"){let n=e?t.requestedFragmentPrecision:t.requestedVertexPrecision;return n==="highp"&&r!=="highp"&&(n="mediump"),`precision ${n} float;
|
|
||||||
${o}`}else if(r!=="highp"&&o.substring(0,15)==="precision highp")return o.replace("precision highp","precision mediump");return o}function Pt(o,t){return t?`#version 300 es
|
|
||||||
${o}`:o}const yt={},_t={};function Mt(o,{name:t="pixi-program"},e=!0){t=t.replace(/\s+/g,"-"),t+=e?"-fragment":"-vertex";const r=e?yt:_t;return r[t]?(r[t]++,t+=`-${r[t]}`):r[t]=1,o.indexOf("#define SHADER_NAME")!==-1?o:`${`#define SHADER_NAME ${t}`}
|
|
||||||
${o}`}function Gt(o,t){return t?o.replace("#version 300 es",""):o}const $={stripVersion:Gt,ensurePrecision:bt,addProgramDefines:vt,setProgramName:Mt,insertVersion:Pt},U=Object.create(null),ot=class L{constructor(t){t={...L.defaultOptions,...t};const e=t.fragment.indexOf("#version 300 es")!==-1,r={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:xt()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e};let n=t.fragment,s=t.vertex;Object.keys($).forEach(a=>{const i=r[a];n=$[a](n,i,!0),s=$[a](s,i,!1)}),this.fragment=n,this.vertex=s,this._key=W(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null}static from(t){const e=`${t.vertex}:${t.fragment}`;return U[e]||(U[e]=new L(t)),U[e]}};ot.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};nt=ot;const q={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};St=function(o){return q[o]??q.float32};const Tt={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};function Ct({source:o,entryPoint:t}){const e={},r=o.indexOf(`fn ${t}`);if(r!==-1){const n=o.indexOf("->",r);if(n!==-1){const s=o.substring(r,n),a=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let i;for(;(i=a.exec(s))!==null;){const u=Tt[i[3]]??"float32";e[i[2]]={location:parseInt(i[1],10),format:u,stride:St(u).stride,offset:0,instance:!1,start:0}}}}return e}function A(o){const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,n=/var(<[^>]+>)? (\w+)/,s=/:\s*(\w+)/,a=/struct\s+(\w+)\s*{([^}]+)}/g,i=/(\w+)\s*:\s*([\w\<\>]+)/g,u=/struct\s+(\w+)/,f=o.match(t)?.map(l=>({group:parseInt(l.match(e)[1],10),binding:parseInt(l.match(r)[1],10),name:l.match(n)[2],isUniform:l.match(n)[1]==="<uniform>",type:l.match(s)[1]}));if(!f)return{groups:[],structs:[]};const c=o.match(a)?.map(l=>{const d=l.match(u)[1],p=l.match(i).reduce((g,x)=>{const[v,b]=x.split(":");return g[v.trim()]=b.trim(),g},{});return p?{name:d,members:p}:null}).filter(({name:l})=>f.some(d=>d.type===l))??[];return{groups:f,structs:c}}var P=(o=>(o[o.VERTEX=1]="VERTEX",o[o.FRAGMENT=2]="FRAGMENT",o[o.COMPUTE=4]="COMPUTE",o))(P||{});function $t({groups:o}){const t=[];for(let e=0;e<o.length;e++){const r=o[e];t[r.group]||(t[r.group]=[]),r.isUniform?t[r.group].push({binding:r.binding,visibility:P.VERTEX|P.FRAGMENT,buffer:{type:"uniform"}}):r.type==="sampler"?t[r.group].push({binding:r.binding,visibility:P.FRAGMENT,sampler:{type:"filtering"}}):r.type==="texture_2d"&&t[r.group].push({binding:r.binding,visibility:P.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}})}return t}function Ut({groups:o}){const t=[];for(let e=0;e<o.length;e++){const r=o[e];t[r.group]||(t[r.group]={}),t[r.group][r.name]=r.binding}return t}function At(o,t){const e=new Set,r=new Set,n=[...o.structs,...t.structs].filter(a=>e.has(a.name)?!1:(e.add(a.name),!0)),s=[...o.groups,...t.groups].filter(a=>{const i=`${a.name}-${a.binding}`;return r.has(i)?!1:(r.add(i),!0)});return{structs:n,groups:s}}const E=Object.create(null);S=class{constructor(t){this._layoutKey=0;const{fragment:e,vertex:r,layout:n,gpuLayout:s,name:a}=t;if(this.name=a,this.fragment=e,this.vertex=r,e.source===r.source){const i=A(e.source);this.structsAndGroups=i}else{const i=A(r.source),u=A(e.source);this.structsAndGroups=At(i,u)}this.layout=n??Ut(this.structsAndGroups),this.gpuLayout=s??$t(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,r=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=W(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=Ct(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return E[e]||(E[e]=new S(t)),E[e]}};const st=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>"],Et=st.reduce((o,t)=>(o[t]=!0,o),{});function wt(o,t){switch(o){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const it=class at{constructor(t,e){this._touched=0,this.uid=K("uniform"),this._resourceType="uniformGroup",this._resourceId=K("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...at.defaultOptions,...e},this.uniformStructures=t;const r={};for(const n in t){const s=t[n];if(s.name=n,s.size=s.size??1,!Et[s.type])throw new Error(`Uniform type ${s.type} is not supported. Supported uniform types are: ${st.join(", ")}`);s.value??(s.value=wt(s.type,s.size)),r[n]=s.value}this.uniforms=r,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=W(Object.keys(r).map(n=>`${n}-${t[n].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};it.defaultOptions={ubo:!1,isStatic:!1};Ft=it;H=(o=>(o[o.WEBGL=1]="WEBGL",o[o.WEBGPU=2]="WEBGPU",o[o.BOTH=3]="BOTH",o))(H||{});ut=class extends mt{constructor(t){super(),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:e,glProgram:r,groups:n,resources:s,compatibleRenderers:a,groupMap:i}=t;this.gpuProgram=e,this.glProgram=r,a===void 0&&(a=0,e&&(a|=H.WEBGPU),r&&(a|=H.WEBGL)),this.compatibleRenderers=a;const u={};if(!s&&!n&&(s={}),s&&n)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&n&&!i)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&n&&i)for(const f in i)for(const c in i[f]){const l=i[f][c];u[l]={group:f,binding:c,name:l}}else if(e&&n&&!i){const f=e.structsAndGroups.groups;i={},f.forEach(c=>{i[c.group]=i[c.group]||{},i[c.group][c.binding]=c.name,u[c.name]=c})}else if(s){if(e){const f=e.structsAndGroups.groups;i={},f.forEach(c=>{i[c.group]=i[c.group]||{},i[c.group][c.binding]=c.name,u[c.name]=c})}else{i={},n={99:new T},this._ownedBindGroups.push(n[99]);let f=0;for(const c in s)u[c]={group:99,binding:f,name:c},i[99]=i[99]||{},i[99][f]=c,f++}n={};for(const f in s){const c=f;let l=s[f];!l.source&&!l._resourceType&&(l=new Ft(l));const d=u[c];d&&(n[d.group]||(n[d.group]=new T,this._ownedBindGroups.push(n[d.group])),n[d.group].setResource(l,d.binding))}}this.groups=n,this._uniformBindMap=i,this.resources=this._buildResourceAccessor(n,u)}addResource(t,e,r){var n,s;(n=this._uniformBindMap)[e]||(n[e]={}),(s=this._uniformBindMap[e])[r]||(s[r]=t),this.groups[e]||(this.groups[e]=new T,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const r={};for(const n in e){const s=e[n];Object.defineProperty(r,s.name,{get(){return t[s.group].getResource(s.binding)},set(a){t[s.group].setResource(a,s.binding)}})}return r}destroy(t=!1){this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:e,gl:r,...n}=t;let s,a;return e&&(s=S.from(e)),r&&(a=nt.from(r)),new ut({gpuProgram:s,glProgram:a,...n})}};const zt={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8},w=0,F=1,z=2,O=3,B=4,R=5,V=class ct{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<w)}set blend(t){!!(this.data&1<<w)!==t&&(this.data^=1<<w)}get offsets(){return!!(this.data&1<<F)}set offsets(t){!!(this.data&1<<F)!==t&&(this.data^=1<<F)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<z)}set culling(t){!!(this.data&1<<z)!==t&&(this.data^=1<<z)}get depthTest(){return!!(this.data&1<<O)}set depthTest(t){!!(this.data&1<<O)!==t&&(this.data^=1<<O)}get depthMask(){return!!(this.data&1<<R)}set depthMask(t){!!(this.data&1<<R)!==t&&(this.data^=1<<R)}get clockwiseFrontFace(){return!!(this.data&1<<B)}set clockwiseFrontFace(t){!!(this.data&1<<B)!==t&&(this.data^=1<<B)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=zt[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new ct;return t.depthTest=!1,t.blend=!0,t}};V.default2d=V.for2d();let Ot;ee=V;Ot=0;class Bt{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1}createTexture(t,e,r){const n=new ht({...this.textureOptions,width:t,height:e,resolution:1,antialias:r,autoGarbageCollect:!0});return new pt({source:n,label:`texturePool_${Ot++}`})}getOptimalTexture(t,e,r=1,n){let s=Math.ceil(t*r-1e-6),a=Math.ceil(e*r-1e-6);s=X(s),a=X(a);const i=(s<<17)+(a<<1)+(n?1:0);this._texturePool[i]||(this._texturePool[i]=[]);let u=this._texturePool[i].pop();return u||(u=this.createTexture(s,a,n)),u.source._resolution=r,u.source.width=s/r,u.source.height=a/r,u.source.pixelWidth=s,u.source.pixelHeight=a,u.frame.x=0,u.frame.y=0,u.frame.width=t,u.frame.height=e,u.updateUvs(),this._poolKeyHash[u.uid]=i,u}getSameSizeTexture(t,e=!1){const r=t.source;return this.getOptimalTexture(t.width,t.height,r._resolution,e)}returnTexture(t){const e=this._poolKeyHash[t.uid];this._texturePool[e].push(t)}clear(t){if(t=t!==!1,t)for(const e in this._texturePool){const r=this._texturePool[e];if(r)for(let n=0;n<r.length;n++)r[n].destroy(!0)}this._texturePool={}}}re=new Bt;function Z(o,t,e){if(o)for(const r in o){const n=r.toLocaleLowerCase(),s=t[n];if(s){let a=o[r];r==="header"&&(a=a.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),e&&s.push(`//----${e}----//`),s.push(a)}else gt(`${r} placement hook does not exist in shader`)}}const Rt=/\{\{(.*?)\}\}/g;function J(o){const t={};return(o.match(Rt)?.map(r=>r.replace(/[{()}]/g,""))??[]).forEach(r=>{t[r]=[]}),t}function Q(o,t){let e;const r=/@in\s+([^;]+);/g;for(;(e=r.exec(o))!==null;)t.push(e[1])}function tt(o,t,e=!1){const r=[];Q(t,r),o.forEach(i=>{i.header&&Q(i.header,r)});const n=r;e&&n.sort();const s=n.map((i,u)=>` @location(${u}) ${i},`).join(`
|
|
||||||
`);let a=t.replace(/@in\s+[^;]+;\s*/g,"");return a=a.replace("{{in}}",`
|
|
||||||
${s}
|
|
||||||
`),a}function et(o,t){let e;const r=/@out\s+([^;]+);/g;for(;(e=r.exec(o))!==null;)t.push(e[1])}function jt(o){const e=/\b(\w+)\s*:/g.exec(o);return e?e[1]:""}function It(o){const t=/@.*?\s+/g;return o.replace(t,"")}function kt(o,t){const e=[];et(t,e),o.forEach(u=>{u.header&&et(u.header,e)});let r=0;const n=e.sort().map(u=>u.indexOf("builtin")>-1?u:`@location(${r++}) ${u}`).join(`,
|
|
||||||
`),s=e.sort().map(u=>` var ${It(u)};`).join(`
|
|
||||||
`),a=`return VSOutput(
|
|
||||||
${e.sort().map(u=>` ${jt(u)}`).join(`,
|
|
||||||
`)});`;let i=t.replace(/@out\s+[^;]+;\s*/g,"");return i=i.replace("{{struct}}",`
|
|
||||||
${n}
|
|
||||||
`),i=i.replace("{{start}}",`
|
|
||||||
${s}
|
|
||||||
`),i=i.replace("{{return}}",`
|
|
||||||
${a}
|
|
||||||
`),i}function rt(o,t){let e=o;for(const r in t){const n=t[r];n.join(`
|
|
||||||
`).length?e=e.replace(`{{${r}}}`,`//-----${r} START-----//
|
|
||||||
${n.join(`
|
|
||||||
`)}
|
|
||||||
//----${r} FINISH----//`):e=e.replace(`{{${r}}}`,"")}return e}const h=Object.create(null),j=new Map;let Dt=0;function Nt({template:o,bits:t}){const e=lt(o,t);if(h[e])return h[e];const{vertex:r,fragment:n}=Ht(o,t);return h[e]=ft(r,n,t),h[e]}function Lt({template:o,bits:t}){const e=lt(o,t);return h[e]||(h[e]=ft(o.vertex,o.fragment,t)),h[e]}function Ht(o,t){const e=t.map(a=>a.vertex).filter(a=>!!a),r=t.map(a=>a.fragment).filter(a=>!!a);let n=tt(e,o.vertex,!0);n=kt(e,n);const s=tt(r,o.fragment,!0);return{vertex:n,fragment:s}}function lt(o,t){return t.map(e=>(j.has(e)||j.set(e,Dt++),j.get(e))).sort((e,r)=>e-r).join("-")+o.vertex+o.fragment}function ft(o,t,e){const r=J(o),n=J(t);return e.forEach(s=>{Z(s.vertex,r,s.name),Z(s.fragment,n,s.name)}),{vertex:rt(o,r),fragment:rt(t,n)}}const Vt=`
|
|
||||||
@in aPosition: vec2<f32>;
|
|
||||||
@in aUV: vec2<f32>;
|
|
||||||
|
|
||||||
@out @builtin(position) vPosition: vec4<f32>;
|
|
||||||
@out vUV : vec2<f32>;
|
|
||||||
@out vColor : vec4<f32>;
|
|
||||||
|
|
||||||
{{header}}
|
|
||||||
|
|
||||||
struct VSOutput {
|
|
||||||
{{struct}}
|
|
||||||
};
|
|
||||||
|
|
||||||
@vertex
|
|
||||||
fn main( {{in}} ) -> VSOutput {
|
|
||||||
|
|
||||||
var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
|
|
||||||
var modelMatrix = mat3x3<f32>(
|
|
||||||
1.0, 0.0, 0.0,
|
|
||||||
0.0, 1.0, 0.0,
|
|
||||||
0.0, 0.0, 1.0
|
|
||||||
);
|
|
||||||
var position = aPosition;
|
|
||||||
var uv = aUV;
|
|
||||||
|
|
||||||
{{start}}
|
|
||||||
|
|
||||||
vColor = vec4<f32>(1., 1., 1., 1.);
|
|
||||||
|
|
||||||
{{main}}
|
|
||||||
|
|
||||||
vUV = uv;
|
|
||||||
|
|
||||||
var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
|
|
||||||
|
|
||||||
vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
|
|
||||||
|
|
||||||
vColor *= globalUniforms.uWorldColorAlpha;
|
|
||||||
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{return}}
|
|
||||||
};
|
|
||||||
`,Wt=`
|
|
||||||
@in vUV : vec2<f32>;
|
|
||||||
@in vColor : vec4<f32>;
|
|
||||||
|
|
||||||
{{header}}
|
|
||||||
|
|
||||||
@fragment
|
|
||||||
fn main(
|
|
||||||
{{in}}
|
|
||||||
) -> @location(0) vec4<f32> {
|
|
||||||
|
|
||||||
{{start}}
|
|
||||||
|
|
||||||
var outColor:vec4<f32>;
|
|
||||||
|
|
||||||
{{main}}
|
|
||||||
|
|
||||||
return outColor * vColor;
|
|
||||||
};
|
|
||||||
`,Kt=`
|
|
||||||
in vec2 aPosition;
|
|
||||||
in vec2 aUV;
|
|
||||||
|
|
||||||
out vec4 vColor;
|
|
||||||
out vec2 vUV;
|
|
||||||
|
|
||||||
{{header}}
|
|
||||||
|
|
||||||
void main(void){
|
|
||||||
|
|
||||||
mat3 worldTransformMatrix = uWorldTransformMatrix;
|
|
||||||
mat3 modelMatrix = mat3(
|
|
||||||
1.0, 0.0, 0.0,
|
|
||||||
0.0, 1.0, 0.0,
|
|
||||||
0.0, 0.0, 1.0
|
|
||||||
);
|
|
||||||
vec2 position = aPosition;
|
|
||||||
vec2 uv = aUV;
|
|
||||||
|
|
||||||
{{start}}
|
|
||||||
|
|
||||||
vColor = vec4(1.);
|
|
||||||
|
|
||||||
{{main}}
|
|
||||||
|
|
||||||
vUV = uv;
|
|
||||||
|
|
||||||
mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
|
|
||||||
|
|
||||||
gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
|
|
||||||
|
|
||||||
vColor *= uWorldColorAlpha;
|
|
||||||
|
|
||||||
{{end}}
|
|
||||||
}
|
|
||||||
`,Xt=`
|
|
||||||
|
|
||||||
in vec4 vColor;
|
|
||||||
in vec2 vUV;
|
|
||||||
|
|
||||||
out vec4 finalColor;
|
|
||||||
|
|
||||||
{{header}}
|
|
||||||
|
|
||||||
void main(void) {
|
|
||||||
|
|
||||||
{{start}}
|
|
||||||
|
|
||||||
vec4 outColor;
|
|
||||||
|
|
||||||
{{main}}
|
|
||||||
|
|
||||||
finalColor = outColor * vColor;
|
|
||||||
}
|
|
||||||
`,Yt={name:"global-uniforms-bit",vertex:{header:`
|
|
||||||
struct GlobalUniforms {
|
|
||||||
uProjectionMatrix:mat3x3<f32>,
|
|
||||||
uWorldTransformMatrix:mat3x3<f32>,
|
|
||||||
uWorldColorAlpha: vec4<f32>,
|
|
||||||
uResolution: vec2<f32>,
|
|
||||||
}
|
|
||||||
|
|
||||||
@group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
|
|
||||||
`}},qt={name:"global-uniforms-bit",vertex:{header:`
|
|
||||||
uniform mat3 uProjectionMatrix;
|
|
||||||
uniform mat3 uWorldTransformMatrix;
|
|
||||||
uniform vec4 uWorldColorAlpha;
|
|
||||||
uniform vec2 uResolution;
|
|
||||||
`}};oe=function({bits:o,name:t}){const e=Nt({template:{fragment:Wt,vertex:Vt},bits:[Yt,...o]});return S.from({name:t,vertex:{source:e.vertex,entryPoint:"main"},fragment:{source:e.fragment,entryPoint:"main"}})};ne=function({bits:o,name:t}){return new nt({name:t,...Lt({template:{vertex:Kt,fragment:Xt},bits:[qt,...o]})})};let I;se={name:"color-bit",vertex:{header:`
|
|
||||||
@in aColor: vec4<f32>;
|
|
||||||
`,main:`
|
|
||||||
vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
|
|
||||||
`}};ie={name:"color-bit",vertex:{header:`
|
|
||||||
in vec4 aColor;
|
|
||||||
`,main:`
|
|
||||||
vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
|
|
||||||
`}};I={};function Zt(o){const t=[];if(o===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let e=0;for(let r=0;r<o;r++)t.push(`@group(1) @binding(${e++}) var textureSource${r+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${e++}) var textureSampler${r+1}: sampler;`)}return t.join(`
|
|
||||||
`)}function Jt(o){const t=[];if(o===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let e=0;e<o;e++)e===o-1?t.push(" default:{"):t.push(` case ${e}:{`),t.push(` outColor = textureSampleGrad(textureSource${e+1}, textureSampler${e+1}, vUV, uvDx, uvDy);`),t.push(" break;}");t.push("}")}return t.join(`
|
|
||||||
`)}ae=function(o){return I[o]||(I[o]={name:"texture-batch-bit",vertex:{header:`
|
|
||||||
@in aTextureIdAndRound: vec2<u32>;
|
|
||||||
@out @interpolate(flat) vTextureId : u32;
|
|
||||||
`,main:`
|
|
||||||
vTextureId = aTextureIdAndRound.y;
|
|
||||||
`,end:`
|
|
||||||
if(aTextureIdAndRound.x == 1)
|
|
||||||
{
|
|
||||||
vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
||||||
}
|
|
||||||
`},fragment:{header:`
|
|
||||||
@in @interpolate(flat) vTextureId: u32;
|
|
||||||
|
|
||||||
${Zt(N())}
|
|
||||||
`,main:`
|
|
||||||
var uvDx = dpdx(vUV);
|
|
||||||
var uvDy = dpdy(vUV);
|
|
||||||
|
|
||||||
${Jt(N())}
|
|
||||||
`}}),I[o]};const k={};function Qt(o){const t=[];for(let e=0;e<o;e++)e>0&&t.push("else"),e<o-1&&t.push(`if(vTextureId < ${e}.5)`),t.push("{"),t.push(` outColor = texture(uTextures[${e}], vUV);`),t.push("}");return t.join(`
|
|
||||||
`)}ue=function(o){return k[o]||(k[o]={name:"texture-batch-bit",vertex:{header:`
|
|
||||||
in vec2 aTextureIdAndRound;
|
|
||||||
out float vTextureId;
|
|
||||||
|
|
||||||
`,main:`
|
|
||||||
vTextureId = aTextureIdAndRound.y;
|
|
||||||
`,end:`
|
|
||||||
if(aTextureIdAndRound.x == 1.)
|
|
||||||
{
|
|
||||||
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
||||||
}
|
|
||||||
`},fragment:{header:`
|
|
||||||
in float vTextureId;
|
|
||||||
|
|
||||||
uniform sampler2D uTextures[${o}];
|
|
||||||
|
|
||||||
`,main:`
|
|
||||||
|
|
||||||
${Qt(N())}
|
|
||||||
`}}),k[o]};ce={name:"round-pixels-bit",vertex:{header:`
|
|
||||||
fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
|
|
||||||
{
|
|
||||||
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
||||||
}
|
|
||||||
`}};le={name:"round-pixels-bit",vertex:{header:`
|
|
||||||
vec2 roundPixels(vec2 position, vec2 targetSize)
|
|
||||||
{
|
|
||||||
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
||||||
}
|
|
||||||
`}};D={name:"local-uniform-bit",vertex:{header:`
|
|
||||||
|
|
||||||
struct LocalUniforms {
|
|
||||||
uTransformMatrix:mat3x3<f32>,
|
|
||||||
uColor:vec4<f32>,
|
|
||||||
uRound:f32,
|
|
||||||
}
|
|
||||||
|
|
||||||
@group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
|
||||||
`,main:`
|
|
||||||
vColor *= localUniforms.uColor;
|
|
||||||
modelMatrix *= localUniforms.uTransformMatrix;
|
|
||||||
`,end:`
|
|
||||||
if(localUniforms.uRound == 1)
|
|
||||||
{
|
|
||||||
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
||||||
}
|
|
||||||
`}};fe={...D,vertex:{...D.vertex,header:D.vertex.header.replace("group(1)","group(2)")}};de={name:"local-uniform-bit",vertex:{header:`
|
|
||||||
|
|
||||||
uniform mat3 uTransformMatrix;
|
|
||||||
uniform vec4 uColor;
|
|
||||||
uniform float uRound;
|
|
||||||
`,main:`
|
|
||||||
vColor *= uColor;
|
|
||||||
modelMatrix = uTransformMatrix;
|
|
||||||
`,end:`
|
|
||||||
if(uRound == 1.)
|
|
||||||
{
|
|
||||||
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
||||||
}
|
|
||||||
`}};me=class{constructor(){this.vertexSize=4,this.indexSize=6,this.location=0,this.batcher=null,this.batch=null,this.roundPixels=0}get blendMode(){return this.renderable.groupBlendMode}packAttributes(t,e,r,n){const s=this.renderable,a=this.texture,i=s.groupTransform,u=i.a,f=i.b,c=i.c,l=i.d,d=i.tx,p=i.ty,g=this.bounds,x=g.maxX,v=g.minX,b=g.maxY,y=g.minY,m=a.uvs,_=s.groupColorAlpha,M=n<<16|this.roundPixels&65535;t[r+0]=u*v+c*y+d,t[r+1]=l*y+f*v+p,t[r+2]=m.x0,t[r+3]=m.y0,e[r+4]=_,e[r+5]=M,t[r+6]=u*x+c*y+d,t[r+7]=l*y+f*x+p,t[r+8]=m.x1,t[r+9]=m.y1,e[r+10]=_,e[r+11]=M,t[r+12]=u*x+c*b+d,t[r+13]=l*b+f*x+p,t[r+14]=m.x2,t[r+15]=m.y2,e[r+16]=_,e[r+17]=M,t[r+18]=u*v+c*b+d,t[r+19]=l*b+f*v+p,t[r+20]=m.x3,t[r+21]=m.y3,e[r+22]=_,e[r+23]=M}packIndex(t,e,r){t[e]=r+0,t[e+1]=r+1,t[e+2]=r+2,t[e+3]=r+0,t[e+4]=r+2,t[e+5]=r+3}reset(){this.renderable=null,this.texture=null,this.batcher=null,this.batch=null,this.bounds=null}};he=function(o,t,e){const r=(o>>24&255)/255;t[e++]=(o&255)/255*r,t[e++]=(o>>8&255)/255*r,t[e++]=(o>>16&255)/255*r,t[e++]=r}});export{me as B,S as G,H as R,ee as S,re as T,Ft as U,se as a,ut as b,oe as c,W as d,D as e,nt as f,ae as g,St as h,he as i,ne as j,ie as k,fe as l,ue as m,le as n,de as o,ce as r,__tla};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{U as e,__tla as __tla_0}from"./colorToUniform-rMRo2qOn.js";let a;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{const i={};a=function(r){let o=i[r];if(o)return o;const n=new Int32Array(r);for(let t=0;t<r;t++)n[t]=t;return o=i[r]=new e({uTextures:{value:n,type:"i32",size:r}},{isStatic:!0}),o}});export{a as g,__tla};
|
|
||||||
862
qbit/vuetorrent/public/assets/index-BhWmfNB5.js
Normal file
862
qbit/vuetorrent/public/assets/index-BhWmfNB5.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
|||||||
import{A as g,B as A}from"./vue-CfSjRv-x.js";var B="Expected a function",S=NaN,F="[object Symbol]",M=/^\s+|\s+$/g,N=/^[-+]0x[0-9a-f]+$/i,W=/^0b[01]+$/i,R=/^0o[0-7]+$/i,_=parseInt,D=typeof g=="object"&&g&&g.Object===Object&&g,G=typeof self=="object"&&self&&self.Object===Object&&self,P=D||G||Function("return this")(),H=Object.prototype,U=H.toString,X=Math.max,q=Math.min,T=function(){return P.Date.now()};function z(e,t,i){var a,s,l,c,r,f,u=0,x=!1,d=!1,y=!0;if(typeof e!="function")throw new TypeError(B);t=E(t)||0,v(i)&&(x=!!i.leading,d="maxWait"in i,l=d?X(E(i.maxWait)||0,t):l,y="trailing"in i?!!i.trailing:y);function p(n){var o=a,m=s;return a=s=void 0,u=n,c=e.apply(m,o),c}function k(n){return u=n,r=setTimeout(b,t),x?p(n):c}function C(n){var o=n-f,m=n-u,h=t-o;return d?q(h,l-m):h}function I(n){var o=n-f,m=n-u;return f===void 0||o>=t||o<0||d&&m>=l}function b(){var n=T();if(I(n))return O(n);r=setTimeout(b,C(n))}function O(n){return r=void 0,y&&a?p(n):(a=s=void 0,c)}function L(){r!==void 0&&clearTimeout(r),u=0,a=f=s=r=void 0}function $(){return r===void 0?c:O(T())}function j(){var n=T(),o=I(n);if(a=arguments,s=this,f=n,o){if(r===void 0)return k(f);if(d)return r=setTimeout(b,t),p(f)}return r===void 0&&(r=setTimeout(b,t)),c}return j.cancel=L,j.flush=$,j}function v(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function J(e){return!!e&&typeof e=="object"}function K(e){return typeof e=="symbol"||J(e)&&U.call(e)==F}function E(e){if(typeof e=="number")return e;if(K(e))return S;if(v(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=v(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(M,"");var i=W.test(e);return i||R.test(e)?_(e.slice(2),i?2:8):N.test(e)?S:+e}var Q=z;const Y=A(Q);export{Y as d};
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
5
qbit/vuetorrent/public/assets/index-X6gg79ld.css
Normal file
5
qbit/vuetorrent/public/assets/index-X6gg79ld.css
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
74
qbit/vuetorrent/public/assets/vue-DFryKk-1.js
Normal file
74
qbit/vuetorrent/public/assets/vue-DFryKk-1.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1,5 +0,0 @@
|
|||||||
import{w as B,o as rn,e as on,s as P,F as mt,r as O,c as y,a as J,t as gt,b as ht,i as sn,C as an,d as yt,u as U,g as un,f as I,p as Z,h as S,j as cn,k as ln,l as pt,m as fn,n as E,q as dn,v as vt,x as me,y as mn,z as gn}from"./vue-CfSjRv-x.js";function hn(e,t){let n;function r(){n=on(),n.run(()=>t.length?t(()=>{n?.stop(),r()}):t())}B(e,o=>{o&&!n?r():o||(n?.stop(),n=void 0)},{immediate:!0}),rn(()=>{n?.stop()})}const D=typeof window<"u",wo=D&&"IntersectionObserver"in window,yn=D&&("ontouchstart"in window||window.navigator.maxTouchPoints>0),Do=D&&"EyeDropper"in window;function Le(e,t,n){pn(e,t),t.set(e,n)}function pn(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vn(e,t,n){return e.set(bt(e,t),n),n}function R(e,t){return e.get(bt(e,t))}function bt(e,t,n){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function wt(e,t,n){const r=t.length-1;if(r<0)return e===void 0?n:e;for(let o=0;o<r;o++){if(e==null)return n;e=e[t[o]]}return e==null||e[t[r]]===void 0?n:e[t[r]]}function bn(e,t){if(e===t)return!0;if(e instanceof Date&&t instanceof Date&&e.getTime()!==t.getTime()||e!==Object(e)||t!==Object(t))return!1;const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>bn(e[r],t[r]))}function Se(e,t,n){return e==null||!t||typeof t!="string"?n:e[t]!==void 0?e[t]:(t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),wt(e,t.split("."),n))}function So(e,t,n){if(t===!0)return e===void 0?n:e;if(t==null||typeof t=="boolean")return n;if(e!==Object(e)){if(typeof t!="function")return n;const o=t(e,n);return typeof o>"u"?n:o}if(typeof t=="string")return Se(e,t,n);if(Array.isArray(t))return wt(e,t,n);if(typeof t!="function")return n;const r=t(e,n);return typeof r>"u"?n:r}function Dt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Array.from({length:e},(n,r)=>t+r)}function ne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"px";if(!(e==null||e===""))return isNaN(+e)?String(e):isFinite(+e)?`${Number(e)}${t}`:void 0}function Ne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function St(e){if(e&&"$el"in e){const t=e.$el;return t?.nodeType===Node.TEXT_NODE?t.nextElementSibling:t}return e}const xo=Object.freeze({enter:13,tab:9,delete:46,esc:27,space:32,up:38,down:40,left:37,right:39,end:35,home:36,del:46,backspace:8,insert:45,pageup:33,pagedown:34,shift:16}),Co=Object.freeze({enter:"Enter",tab:"Tab",delete:"Delete",esc:"Escape",space:"Space",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",end:"End",home:"Home",del:"Delete",backspace:"Backspace",insert:"Insert",pageup:"PageUp",pagedown:"PageDown",shift:"Shift"});function To(e){return Object.keys(e)}function be(e,t){return t.every(n=>e.hasOwnProperty(n))}function wn(e,t){const n={},r=new Set(Object.keys(e));for(const o of t)r.has(o)&&(n[o]=e[o]);return n}function Be(e,t,n){const r=Object.create(null),o=Object.create(null);for(const s in e)t.some(a=>a instanceof RegExp?a.test(s):a===s)&&!n?.some(a=>a===s)?r[s]=e[s]:o[s]=e[s];return[r,o]}function Dn(e,t){const n={...e};return t.forEach(r=>delete n[r]),n}function Mo(e,t){const n={};return t.forEach(r=>n[r]=e[r]),n}const xt=/^on[^a-z]/,Ae=e=>xt.test(e),Sn=["onAfterscriptexecute","onAnimationcancel","onAnimationend","onAnimationiteration","onAnimationstart","onAuxclick","onBeforeinput","onBeforescriptexecute","onChange","onClick","onCompositionend","onCompositionstart","onCompositionupdate","onContextmenu","onCopy","onCut","onDblclick","onFocusin","onFocusout","onFullscreenchange","onFullscreenerror","onGesturechange","onGestureend","onGesturestart","onGotpointercapture","onInput","onKeydown","onKeypress","onKeyup","onLostpointercapture","onMousedown","onMousemove","onMouseout","onMouseover","onMouseup","onMousewheel","onPaste","onPointercancel","onPointerdown","onPointerenter","onPointerleave","onPointermove","onPointerout","onPointerover","onPointerup","onReset","onSelect","onSubmit","onTouchcancel","onTouchend","onTouchmove","onTouchstart","onTransitioncancel","onTransitionend","onTransitionrun","onTransitionstart","onWheel"],xn=["ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Enter","Escape","Tab"," "];function ko(e){return e.isComposing&&xn.includes(e.key)}function Ao(e){const[t,n]=Be(e,[xt]),r=Dn(t,Sn),[o,s]=Be(n,["class","style","id",/^data-/]);return Object.assign(o,t),Object.assign(s,r),[o,s]}function Oo(e){return e==null?[]:Array.isArray(e)?e:[e]}function Eo(e,t){let n=0;const r=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];clearTimeout(n),n=setTimeout(()=>e(...s),U(t))};return r.clear=()=>{clearTimeout(n)},r.immediate=e,r}function Ct(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;return Math.max(t,Math.min(n,e))}function Fo(e){const t=e.toString().trim();return t.includes(".")?t.length-t.indexOf(".")-1:0}function He(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0";return e+n.repeat(Math.max(0,t-e.length))}function Ye(e,t){return(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0").repeat(Math.max(0,t-e.length))+e}function Cn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const n=[];let r=0;for(;r<e.length;)n.push(e.substr(r,t)),r+=t;return n}function Po(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;if(e<t)return`${e} B`;const n=t===1024?["Ki","Mi","Gi"]:["k","M","G"];let r=-1;for(;Math.abs(e)>=t&&r<n.length-1;)e/=t,++r;return`${e.toFixed(1)} ${n[r]}B`}function w(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r={};for(const o in e)r[o]=e[o];for(const o in t){const s=e[o],a=t[o];if(Ne(s)&&Ne(a)){r[o]=w(s,a,n);continue}if(Array.isArray(s)&&Array.isArray(a)&&n){r[o]=n(s,a);continue}r[o]=a}return r}function Tn(e){return e.map(t=>t.type===mt?Tn(t.children):t).flat()}function N(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(N.cache.has(e))return N.cache.get(e);const t=e.replace(/[^a-z]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase();return N.cache.set(e,t),t}N.cache=new Map;function X(e,t){if(!t||typeof t!="object")return[];if(Array.isArray(t))return t.map(n=>X(e,n)).flat(1);if(t.suspense)return X(e,t.ssContent);if(Array.isArray(t.children))return t.children.map(n=>X(e,n)).flat(1);if(t.component){if(Object.getOwnPropertySymbols(t.component.provides).includes(e))return[t.component];if(t.component.subTree)return X(e,t.component.subTree).flat(1)}return[]}var re=new WeakMap,V=new WeakMap;class Io{constructor(t){Le(this,re,[]),Le(this,V,0),this.size=t}push(t){R(re,this)[R(V,this)]=t,vn(V,this,(R(V,this)+1)%this.size)}values(){return R(re,this).slice(R(V,this)).concat(R(re,this).slice(0,R(V,this)))}}function $o(e){return"touches"in e?{clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}:{clientX:e.clientX,clientY:e.clientY}}function Ro(e){const t=O({}),n=y(e);return J(()=>{for(const r in n.value)t[r]=n.value[r]},{flush:"sync"}),gt(t)}function xe(e,t){return e.includes(t)}function Tt(e){return e[2].toLowerCase()+e.slice(3)}const Lo=()=>[Function,Array];function No(e,t){return t="on"+ht(t),!!(e[t]||e[`${t}Once`]||e[`${t}Capture`]||e[`${t}OnceCapture`]||e[`${t}CaptureOnce`])}function Bo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(Array.isArray(e))for(const o of e)o(...n);else typeof e=="function"&&e(...n)}function Mn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=["button","[href]",'input:not([type="hidden"])',"select","textarea","[tabindex]"].map(r=>`${r}${t?':not([tabindex="-1"])':""}:not([disabled])`).join(", ");return[...e.querySelectorAll(n)]}function kn(e,t,n){let r,o=e.indexOf(document.activeElement);const s=t==="next"?1:-1;do o+=s,r=e[o];while((!r||r.offsetParent==null||!(n?.(r)??!0))&&o<e.length&&o>=0);return r}function An(e,t){const n=Mn(e);if(!t)(e===document.activeElement||!e.contains(document.activeElement))&&n[0]?.focus();else if(t==="first")n[0]?.focus();else if(t==="last")n.at(-1)?.focus();else if(typeof t=="number")n[t]?.focus();else{const r=kn(n,t);r?r.focus():An(e,t==="next"?"first":"last")}}function Ho(e){return e==null||typeof e=="string"&&e.trim()===""}function Yo(){}function Vo(e,t){if(!(D&&typeof CSS<"u"&&typeof CSS.supports<"u"&&CSS.supports(`selector(${t})`)))return null;try{return!!e&&e.matches(t)}catch{return null}}function On(e){return e.some(t=>sn(t)?t.type===an?!1:t.type!==mt||On(t.children):!0)?e:null}function Wo(e,t){if(!D||e===0)return t(),()=>{};const n=window.setTimeout(t,e);return()=>window.clearTimeout(n)}function Ve(e,t){const n=P();return J(()=>{n.value=e()},{flush:"sync",...t}),yt(n)}function jo(e,t){const n=e.clientX,r=e.clientY,o=t.getBoundingClientRect(),s=o.left,a=o.top,i=o.right,u=o.bottom;return n>=s&&n<=i&&r>=a&&r<=u}function En(){const e=P(),t=n=>{e.value=n};return Object.defineProperty(t,"value",{enumerable:!0,get:()=>e.value,set:n=>e.value=n}),Object.defineProperty(t,"el",{enumerable:!0,get:()=>St(e.value)}),t}const Mt=["top","bottom"],Fn=["start","end","left","right"];function Uo(e,t){let[n,r]=e.split(" ");return r||(r=xe(Mt,n)?"start":xe(Fn,n)?"top":"center"),{side:We(n,t),align:We(r,t)}}function We(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function zo(e){return{side:{center:"center",top:"bottom",bottom:"top",left:"right",right:"left"}[e.side],align:e.align}}function Go(e){return{side:e.side,align:{center:"center",top:"bottom",bottom:"top",left:"right",right:"left"}[e.align]}}function Zo(e){return{side:e.align,align:e.side}}function Ko(e){return xe(Mt,e.side)?"y":"x"}class ie{constructor(t){let{x:n,y:r,width:o,height:s}=t;this.x=n,this.y=r,this.width=o,this.height=s}get top(){return this.y}get bottom(){return this.y+this.height}get left(){return this.x}get right(){return this.x+this.width}}function _o(e,t){return{x:{before:Math.max(0,t.left-e.left),after:Math.max(0,e.right-t.right)},y:{before:Math.max(0,t.top-e.top),after:Math.max(0,e.bottom-t.bottom)}}}function Xo(e){return Array.isArray(e)?new ie({x:e[0],y:e[1],width:0,height:0}):e.getBoundingClientRect()}function Qo(e){const t=e.getBoundingClientRect(),n=getComputedStyle(e),r=n.transform;if(r){let o,s,a,i,u;if(r.startsWith("matrix3d("))o=r.slice(9,-1).split(/, /),s=+o[0],a=+o[5],i=+o[12],u=+o[13];else if(r.startsWith("matrix("))o=r.slice(7,-1).split(/, /),s=+o[0],a=+o[3],i=+o[4],u=+o[5];else return new ie(t);const c=n.transformOrigin,l=t.x-i-(1-s)*parseFloat(c),f=t.y-u-(1-a)*parseFloat(c.slice(c.indexOf(" ")+1)),g=s?t.width/s:e.offsetWidth+1,h=a?t.height/a:e.offsetHeight+1;return new ie({x:l,y:f,width:g,height:h})}else return new ie(t)}function qo(e,t,n){if(typeof e.animate>"u")return{finished:Promise.resolve()};let r;try{r=e.animate(t,n)}catch{return{finished:Promise.resolve()}}return typeof r.finished>"u"&&(r.finished=new Promise(o=>{r.onfinish=()=>{o(r)}})),r}const ue=new WeakMap;function Jo(e,t){Object.keys(t).forEach(n=>{if(Ae(n)){const r=Tt(n),o=ue.get(e);if(t[n]==null)o?.forEach(s=>{const[a,i]=s;a===r&&(e.removeEventListener(r,i),o.delete(s))});else if(!o||![...o].some(s=>s[0]===r&&s[1]===t[n])){e.addEventListener(r,t[n]);const s=o||new Set;s.add([r,t[n]]),ue.has(e)||ue.set(e,s)}}else t[n]==null?e.removeAttribute(n):e.setAttribute(n,t[n])})}function es(e,t){Object.keys(t).forEach(n=>{if(Ae(n)){const r=Tt(n),o=ue.get(e);o?.forEach(s=>{const[a,i]=s;a===r&&(e.removeEventListener(r,i),o.delete(s))})}else e.removeAttribute(n)})}const W=2.4,je=.2126729,Ue=.7151522,ze=.072175,Pn=.55,In=.58,$n=.57,Rn=.62,oe=.03,Ge=1.45,Ln=5e-4,Nn=1.25,Bn=1.25,Ze=.078,Ke=12.82051282051282,se=.06,_e=.001;function Xe(e,t){const n=(e.r/255)**W,r=(e.g/255)**W,o=(e.b/255)**W,s=(t.r/255)**W,a=(t.g/255)**W,i=(t.b/255)**W;let u=n*je+r*Ue+o*ze,c=s*je+a*Ue+i*ze;if(u<=oe&&(u+=(oe-u)**Ge),c<=oe&&(c+=(oe-c)**Ge),Math.abs(c-u)<Ln)return 0;let l;if(c>u){const f=(c**Pn-u**In)*Nn;l=f<_e?0:f<Ze?f-f*Ke*se:f-se}else{const f=(c**Rn-u**$n)*Bn;l=f>-_e?0:f>-Ze?f-f*Ke*se:f+se}return l*100}function ts(e){}function ns(e,t){t=Array.isArray(t)?t.slice(0,-1).map(n=>`'${n}'`).join(", ")+` or '${t.at(-1)}'`:`'${t}'`}const le=.20689655172413793,Hn=e=>e>le**3?Math.cbrt(e):e/(3*le**2)+4/29,Yn=e=>e>le?e**3:3*le**2*(e-4/29);function kt(e){const t=Hn,n=t(e[1]);return[116*n-16,500*(t(e[0]/.95047)-n),200*(n-t(e[2]/1.08883))]}function At(e){const t=Yn,n=(e[0]+16)/116;return[t(n+e[1]/500)*.95047,t(n),t(n-e[2]/200)*1.08883]}const Vn=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]],Wn=e=>e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055,jn=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],Un=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function Ot(e){const t=Array(3),n=Wn,r=Vn;for(let o=0;o<3;++o)t[o]=Math.round(Ct(n(r[o][0]*e[0]+r[o][1]*e[1]+r[o][2]*e[2]))*255);return{r:t[0],g:t[1],b:t[2]}}function Oe(e){let{r:t,g:n,b:r}=e;const o=[0,0,0],s=Un,a=jn;t=s(t/255),n=s(n/255),r=s(r/255);for(let i=0;i<3;++i)o[i]=a[i][0]*t+a[i][1]*n+a[i][2]*r;return o}function zn(e){return!!e&&/^(#|var\(--|(rgb|hsl)a?\()/.test(e)}function rs(e){return zn(e)&&!/^((rgb|hsl)a?\()?var\(--/.test(e)}const Qe=/^(?<fn>(?:rgb|hsl)a?)\((?<values>.+)\)/,Gn={rgb:(e,t,n,r)=>({r:e,g:t,b:n,a:r}),rgba:(e,t,n,r)=>({r:e,g:t,b:n,a:r}),hsl:(e,t,n,r)=>qe({h:e,s:t,l:n,a:r}),hsla:(e,t,n,r)=>qe({h:e,s:t,l:n,a:r}),hsv:(e,t,n,r)=>H({h:e,s:t,v:n,a:r}),hsva:(e,t,n,r)=>H({h:e,s:t,v:n,a:r})};function F(e){if(typeof e=="number")return{r:(e&16711680)>>16,g:(e&65280)>>8,b:e&255};if(typeof e=="string"&&Qe.test(e)){const{groups:t}=e.match(Qe),{fn:n,values:r}=t,o=r.split(/,\s*/).map(s=>s.endsWith("%")&&["hsl","hsla","hsv","hsva"].includes(n)?parseFloat(s)/100:parseFloat(s));return Gn[n](...o)}else if(typeof e=="string"){let t=e.startsWith("#")?e.slice(1):e;return[3,4].includes(t.length)?t=t.split("").map(n=>n+n).join(""):[6,8].includes(t.length),Pt(t)}else if(typeof e=="object"){if(be(e,["r","g","b"]))return e;if(be(e,["h","s","l"]))return H(Et(e));if(be(e,["h","s","v"]))return H(e)}throw new TypeError(`Invalid color: ${e==null?e:String(e)||e.constructor.name}
|
|
||||||
Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`)}function H(e){const{h:t,s:n,v:r,a:o}=e,s=i=>{const u=(i+t/60)%6;return r-r*n*Math.max(Math.min(u,4-u,1),0)},a=[s(5),s(3),s(1)].map(i=>Math.round(i*255));return{r:a[0],g:a[1],b:a[2],a:o}}function qe(e){return H(Et(e))}function Zn(e){if(!e)return{h:0,s:1,v:1,a:1};const t=e.r/255,n=e.g/255,r=e.b/255,o=Math.max(t,n,r),s=Math.min(t,n,r);let a=0;o!==s&&(o===t?a=60*(0+(n-r)/(o-s)):o===n?a=60*(2+(r-t)/(o-s)):o===r&&(a=60*(4+(t-n)/(o-s)))),a<0&&(a=a+360);const i=o===0?0:(o-s)/o,u=[a,i,o];return{h:u[0],s:u[1],v:u[2],a:e.a}}function os(e){const{h:t,s:n,v:r,a:o}=e,s=r-r*n/2,a=s===1||s===0?0:(r-s)/Math.min(s,1-s);return{h:t,s:a,l:s,a:o}}function Et(e){const{h:t,s:n,l:r,a:o}=e,s=r+n*Math.min(r,1-r),a=s===0?0:2-2*r/s;return{h:t,s:a,v:s,a:o}}function Kn(e){let{r:t,g:n,b:r,a:o}=e;return o===void 0?`rgb(${t}, ${n}, ${r})`:`rgba(${t}, ${n}, ${r}, ${o})`}function ss(e){return Kn(H(e))}function ae(e){const t=Math.round(e).toString(16);return("00".substr(0,2-t.length)+t).toUpperCase()}function Ft(e){let{r:t,g:n,b:r,a:o}=e;return`#${[ae(t),ae(n),ae(r),o!==void 0?ae(Math.round(o*255)):""].join("")}`}function Pt(e){e=_n(e);let[t,n,r,o]=Cn(e,2).map(s=>parseInt(s,16));return o=o===void 0?o:o/255,{r:t,g:n,b:r,a:o}}function as(e){const t=Pt(e);return Zn(t)}function is(e){return Ft(H(e))}function _n(e){return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),(e.length===3||e.length===4)&&(e=e.split("").map(t=>t+t).join("")),e.length!==6&&(e=He(He(e,6),8,"F")),e}function Xn(e,t){const n=kt(Oe(e));return n[0]=n[0]+t*10,Ot(At(n))}function Qn(e,t){const n=kt(Oe(e));return n[0]=n[0]-t*10,Ot(At(n))}function Ce(e){const t=F(e);return Oe(t)[1]}function us(e,t){const n=Ce(e),r=Ce(t),o=Math.max(n,r),s=Math.min(n,r);return(o+.05)/(s+.05)}function qn(e){const t=Math.abs(Xe(F(0),F(e)));return Math.abs(Xe(F(16777215),F(e)))>Math.min(t,50)?"#fff":"#000"}function Y(e,t){return n=>Object.keys(e).reduce((r,o)=>{const a=typeof e[o]=="object"&&e[o]!=null&&!Array.isArray(e[o])?e[o]:{type:e[o]};return n&&o in n?r[o]={...a,default:n[o]}:r[o]=a,t&&!r[o].source&&(r[o].source=t),r},{})}const Jn=Y({class:[String,Array,Object],style:{type:[String,Array,Object],default:null}},"component");function k(e,t){const n=un();if(!n)throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);return n}function er(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"composables";const t=k(e).type;return N(t?.aliasName||t?.name)}let It=0,ce=new WeakMap;function Ee(){const e=k("getUid");if(ce.has(e))return ce.get(e);{const t=It++;return ce.set(e,t),t}}Ee.reset=()=>{It=0,ce=new WeakMap};function tr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:k("injectSelf");const{provides:n}=t;if(n&&e in n)return n[e]}const z=Symbol.for("vuetify:defaults");function nr(e){return I(e)}function Fe(){const e=S(z);if(!e)throw new Error("[Vuetify] Could not find defaults instance");return e}function cs(e,t){const n=Fe(),r=I(e),o=y(()=>{if(U(t?.disabled))return n.value;const a=U(t?.scoped),i=U(t?.reset),u=U(t?.root);if(r.value==null&&!(a||i||u))return n.value;let c=w(r.value,{prev:n.value});if(a)return c;if(i||u){const l=Number(i||1/0);for(let f=0;f<=l&&!(!c||!("prev"in c));f++)c=c.prev;return c&&typeof u=="string"&&u in c&&(c=w(w(c,{prev:c}),c[u])),c}return c.prev?w(c.prev,c):c});return Z(z,o),o}function rr(e,t){return typeof e.props?.[t]<"u"||typeof e.props?.[N(t)]<"u"}function or(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fe();const r=k("useDefaults");if(t=t??r.type.name??r.type.__name,!t)throw new Error("[Vuetify] Could not determine component name");const o=y(()=>n.value?.[e._as??t]),s=new Proxy(e,{get(u,c){const l=Reflect.get(u,c);return c==="class"||c==="style"?[o.value?.[c],l].filter(f=>f!=null):typeof c=="string"&&!rr(r.vnode,c)?o.value?.[c]!==void 0?o.value?.[c]:n.value?.global?.[c]!==void 0?n.value?.global?.[c]:l:l}}),a=P();J(()=>{if(o.value){const u=Object.entries(o.value).filter(c=>{let[l]=c;return l.startsWith(l[0].toUpperCase())});a.value=u.length?Object.fromEntries(u):void 0}else a.value=void 0});function i(){const u=tr(z,r);Z(z,y(()=>a.value?w(u?.value??{},a.value):u?.value))}return{props:s,provideSubDefaults:i}}function ee(e){if(e._setup=e._setup??e.setup,!e.name)return e;if(e._setup){e.props=Y(e.props??{},e.name)();const t=Object.keys(e.props).filter(n=>n!=="class"&&n!=="style");e.filterProps=function(r){return wn(r,t)},e.props._as=String,e.setup=function(r,o){const s=Fe();if(!s.value)return e._setup(r,o);const{props:a,provideSubDefaults:i}=or(r,r._as??e.name,s),u=e._setup(a,o);return i(),u}}return e}function $t(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return t=>(e?ee:cn)(t)}function ls(e,t){return t.props=e,t}function fs(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"div",n=arguments.length>2?arguments[2]:void 0;return $t()({name:n??ht(ln(e.replace(/__/g,"-"))),props:{tag:{type:String,default:t},...Jn()},setup(r,o){let{slots:s}=o;return()=>pt(r.tag,{class:[e,r.class],style:r.style},s.default?.())}})}function ds(e){if(typeof e.getRootNode!="function"){for(;e.parentNode;)e=e.parentNode;return e!==document?null:document}const t=e.getRootNode();return t!==document&&t.getRootNode({composed:!0})!==document?null:t}const ms="cubic-bezier(0.4, 0, 0.2, 1)",gs="cubic-bezier(0.0, 0, 0.2, 1)",hs="cubic-bezier(0.4, 0, 1, 1)";function ys(e,t,n){return Object.keys(e).filter(r=>Ae(r)&&r.endsWith(t)).reduce((r,o)=>(r[o.slice(0,-t.length)]=s=>e[o](s,n(s)),r),{})}function ps(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(;e;){if(t?sr(e):Rt(e))return e;e=e.parentElement}return document.scrollingElement}function vs(e,t){const n=[];if(t&&e&&!t.contains(e))return n;for(;e&&(Rt(e)&&n.push(e),e!==t);)e=e.parentElement;return n}function Rt(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return t.overflowY==="scroll"||t.overflowY==="auto"&&e.scrollHeight>e.clientHeight}function sr(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return["scroll","auto"].includes(t.overflowY)}function bs(e){for(;e;){if(window.getComputedStyle(e).position==="fixed")return!0;e=e.offsetParent}return!1}function ws(e){const t=k("useRender");t.render=e}function ar(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:f=>f,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:f=>f;const s=k("useProxiedModel"),a=I(e[t]!==void 0?e[t]:n),i=N(t),c=i!==t?y(()=>(e[t],!!((s.vnode.props?.hasOwnProperty(t)||s.vnode.props?.hasOwnProperty(i))&&(s.vnode.props?.hasOwnProperty(`onUpdate:${t}`)||s.vnode.props?.hasOwnProperty(`onUpdate:${i}`))))):y(()=>(e[t],!!(s.vnode.props?.hasOwnProperty(t)&&s.vnode.props?.hasOwnProperty(`onUpdate:${t}`))));hn(()=>!c.value,()=>{B(()=>e[t],f=>{a.value=f})});const l=y({get(){const f=e[t];return r(c.value?f:a.value)},set(f){const g=o(f),h=fn(c.value?e[t]:a.value);h===g||r(h)===f||(a.value=g,s?.emit(`update:${t}`,g))}});return Object.defineProperty(l,"externalValue",{get:()=>c.value?e[t]:a.value}),l}const ir={badge:"Badge",open:"Open",close:"Close",dismiss:"Dismiss",confirmEdit:{ok:"OK",cancel:"Cancel"},dataIterator:{noResultsText:"No matching records found",loadingText:"Loading items..."},dataTable:{itemsPerPageText:"Rows per page:",ariaLabel:{sortDescending:"Sorted descending.",sortAscending:"Sorted ascending.",sortNone:"Not sorted.",activateNone:"Activate to remove sorting.",activateDescending:"Activate to sort descending.",activateAscending:"Activate to sort ascending."},sortBy:"Sort by"},dataFooter:{itemsPerPageText:"Items per page:",itemsPerPageAll:"All",nextPage:"Next page",prevPage:"Previous page",firstPage:"First page",lastPage:"Last page",pageText:"{0}-{1} of {2}"},dateRangeInput:{divider:"to"},datePicker:{itemsSelected:"{0} selected",range:{title:"Select dates",header:"Enter dates"},title:"Select date",header:"Enter date",input:{placeholder:"Enter date"}},noDataText:"No data available",carousel:{prev:"Previous visual",next:"Next visual",ariaLabel:{delimiter:"Carousel slide {0} of {1}"}},calendar:{moreEvents:"{0} more",today:"Today"},input:{clear:"Clear {0}",prependAction:"{0} prepended action",appendAction:"{0} appended action",otp:"Please enter OTP character {0}"},fileInput:{counter:"{0} files",counterSize:"{0} files ({1} in total)"},timePicker:{am:"AM",pm:"PM",title:"Select Time"},pagination:{ariaLabel:{root:"Pagination Navigation",next:"Next page",previous:"Previous page",page:"Go to page {0}",currentPage:"Page {0}, Current page",first:"First page",last:"Last page"}},stepper:{next:"Next",prev:"Previous"},rating:{ariaLabel:{item:"Rating {0} of {1}"}},loading:"Loading...",infiniteScroll:{loadMore:"Load more",empty:"No more"}},Je="$vuetify.",et=(e,t)=>e.replace(/\{(\d+)\}/g,(n,r)=>String(t[+r])),Lt=(e,t,n)=>function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!r.startsWith(Je))return et(r,s);const i=r.replace(Je,""),u=e.value&&n.value[e.value],c=t.value&&n.value[t.value];let l=Se(u,i,null);return l||(`${r}${e.value}`,l=Se(c,i,null)),l||(l=r),typeof l!="string"&&(l=r),et(l,s)};function Nt(e,t){return(n,r)=>new Intl.NumberFormat([e.value,t.value],r).format(n)}function we(e,t,n){const r=ar(e,t,e[t]??n.value);return r.value=e[t]??n.value,B(n,o=>{e[t]==null&&(r.value=n.value)}),r}function Bt(e){return t=>{const n=we(t,"locale",e.current),r=we(t,"fallback",e.fallback),o=we(t,"messages",e.messages);return{name:"vuetify",current:n,fallback:r,messages:o,t:Lt(n,r,o),n:Nt(n,r),provide:Bt({current:n,fallback:r,messages:o})}}}function ur(e){const t=P(e?.locale??"en"),n=P(e?.fallback??"en"),r=I({en:ir,...e?.messages});return{name:"vuetify",current:t,fallback:n,messages:r,t:Lt(t,n,r),n:Nt(t,n),provide:Bt({current:t,fallback:n,messages:r})}}const G=Symbol.for("vuetify:locale");function cr(e){return e.name!=null}function lr(e){const t=e?.adapter&&cr(e?.adapter)?e?.adapter:ur(e),n=mr(t,e);return{...t,...n}}function fr(){const e=S(G);if(!e)throw new Error("[Vuetify] Could not find injected locale instance");return e}function Ds(e){const t=S(G);if(!t)throw new Error("[Vuetify] Could not find injected locale instance");const n=t.provide(e),r=gr(n,t.rtl,e),o={...n,...r};return Z(G,o),o}function dr(){return{af:!1,ar:!0,bg:!1,ca:!1,ckb:!1,cs:!1,de:!1,el:!1,en:!1,es:!1,et:!1,fa:!0,fi:!1,fr:!1,hr:!1,hu:!1,he:!0,id:!1,it:!1,ja:!1,km:!1,ko:!1,lv:!1,lt:!1,nl:!1,no:!1,pl:!1,pt:!1,ro:!1,ru:!1,sk:!1,sl:!1,srCyrl:!1,srLatn:!1,sv:!1,th:!1,tr:!1,az:!1,uk:!1,vi:!1,zhHans:!1,zhHant:!1}}function mr(e,t){const n=I(t?.rtl??dr()),r=y(()=>n.value[e.current.value]??!1);return{isRtl:r,rtl:n,rtlClasses:y(()=>`v-locale--is-${r.value?"rtl":"ltr"}`)}}function gr(e,t,n){const r=y(()=>n.rtl??t.value[e.current.value]??!1);return{isRtl:r,rtl:t,rtlClasses:y(()=>`v-locale--is-${r.value?"rtl":"ltr"}`)}}function hr(){const e=S(G);if(!e)throw new Error("[Vuetify] Could not find injected rtl instance");return{isRtl:e.isRtl,rtlClasses:e.rtlClasses}}const Q={"001":1,AD:1,AE:6,AF:6,AG:0,AI:1,AL:1,AM:1,AN:1,AR:1,AS:0,AT:1,AU:1,AX:1,AZ:1,BA:1,BD:0,BE:1,BG:1,BH:6,BM:1,BN:1,BR:0,BS:0,BT:0,BW:0,BY:1,BZ:0,CA:0,CH:1,CL:1,CM:1,CN:1,CO:0,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DM:0,DO:0,DZ:6,EC:1,EE:1,EG:6,ES:1,ET:0,FI:1,FJ:1,FO:1,FR:1,GB:1,"GB-alt-variant":0,GE:1,GF:1,GP:1,GR:1,GT:0,GU:0,HK:0,HN:0,HR:1,HU:1,ID:0,IE:1,IL:0,IN:0,IQ:6,IR:6,IS:1,IT:1,JM:0,JO:6,JP:0,KE:0,KG:1,KH:0,KR:0,KW:6,KZ:1,LA:0,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MH:0,MK:1,MM:0,MN:1,MO:0,MQ:1,MT:0,MV:5,MX:0,MY:1,MZ:0,NI:0,NL:1,NO:1,NP:0,NZ:1,OM:6,PA:0,PE:0,PH:0,PK:0,PL:1,PR:0,PT:0,PY:0,QA:6,RE:1,RO:1,RS:1,RU:1,SA:0,SD:6,SE:1,SG:0,SI:1,SK:1,SM:1,SV:0,SY:6,TH:0,TJ:1,TM:1,TR:1,TT:0,TW:0,UA:1,UM:0,US:0,UY:1,UZ:1,VA:1,VE:0,VI:0,VN:1,WS:0,XK:1,YE:0,ZA:0,ZW:0};function yr(e,t){const n=[];let r=[];const o=Ht(e),s=Yt(e),a=(o.getDay()-Q[t.slice(-2).toUpperCase()]+7)%7,i=(s.getDay()-Q[t.slice(-2).toUpperCase()]+7)%7;for(let u=0;u<a;u++){const c=new Date(o);c.setDate(c.getDate()-(a-u)),r.push(c)}for(let u=1;u<=s.getDate();u++){const c=new Date(e.getFullYear(),e.getMonth(),u);r.push(c),r.length===7&&(n.push(r),r=[])}for(let u=1;u<7-i;u++){const c=new Date(s);c.setDate(c.getDate()+u),r.push(c)}return r.length>0&&n.push(r),n}function pr(e,t){const n=new Date(e);for(;n.getDay()!==(Q[t.slice(-2).toUpperCase()]??0);)n.setDate(n.getDate()-1);return n}function vr(e,t){const n=new Date(e),r=((Q[t.slice(-2).toUpperCase()]??0)+6)%7;for(;n.getDay()!==r;)n.setDate(n.getDate()+1);return n}function Ht(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Yt(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function br(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}const wr=/^([12]\d{3}-([1-9]|0[1-9]|1[0-2])-([1-9]|0[1-9]|[12]\d|3[01]))$/;function Vt(e){if(e==null)return new Date;if(e instanceof Date)return e;if(typeof e=="string"){let t;if(wr.test(e))return br(e);if(t=Date.parse(e),!isNaN(t))return new Date(t)}return null}const tt=new Date(2e3,0,2);function Dr(e){const t=Q[e.slice(-2).toUpperCase()];return Dt(7).map(n=>{const r=new Date(tt);return r.setDate(tt.getDate()+t+n),new Intl.DateTimeFormat(e,{weekday:"narrow"}).format(r)})}function Sr(e,t,n,r){const o=Vt(e)??new Date,s=r?.[t];if(typeof s=="function")return s(o,t,n);let a={};switch(t){case"fullDate":a={year:"numeric",month:"long",day:"numeric"};break;case"fullDateWithWeekday":a={weekday:"long",year:"numeric",month:"long",day:"numeric"};break;case"normalDate":const i=o.getDate(),u=new Intl.DateTimeFormat(n,{month:"long"}).format(o);return`${i} ${u}`;case"normalDateWithWeekday":a={weekday:"short",day:"numeric",month:"short"};break;case"shortDate":a={month:"short",day:"numeric"};break;case"year":a={year:"numeric"};break;case"month":a={month:"long"};break;case"monthShort":a={month:"short"};break;case"monthAndYear":a={month:"long",year:"numeric"};break;case"monthAndDate":a={month:"long",day:"numeric"};break;case"weekday":a={weekday:"long"};break;case"weekdayShort":a={weekday:"short"};break;case"dayOfMonth":return new Intl.NumberFormat(n).format(o.getDate());case"hours12h":a={hour:"numeric",hour12:!0};break;case"hours24h":a={hour:"numeric",hour12:!1};break;case"minutes":a={minute:"numeric"};break;case"seconds":a={second:"numeric"};break;case"fullTime":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullTime12h":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullTime24h":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"fullDateTime":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullDateTime12h":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullDateTime24h":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"keyboardDate":a={year:"numeric",month:"2-digit",day:"2-digit"};break;case"keyboardDateTime":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"keyboardDateTime12h":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"keyboardDateTime24h":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;default:a=s??{timeZone:"UTC",timeZoneName:"short"}}return new Intl.DateTimeFormat(n,a).format(o)}function xr(e,t){const n=e.toJsDate(t),r=n.getFullYear(),o=Ye(String(n.getMonth()+1),2,"0"),s=Ye(String(n.getDate()),2,"0");return`${r}-${o}-${s}`}function Cr(e){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}function Tr(e,t){const n=new Date(e);return n.setMinutes(n.getMinutes()+t),n}function Mr(e,t){const n=new Date(e);return n.setHours(n.getHours()+t),n}function kr(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function Ar(e,t){const n=new Date(e);return n.setDate(n.getDate()+t*7),n}function Or(e,t){const n=new Date(e);return n.setDate(1),n.setMonth(n.getMonth()+t),n}function Er(e){return e.getFullYear()}function Fr(e){return e.getMonth()}function Pr(e){return e.getDate()}function Ir(e){return new Date(e.getFullYear(),e.getMonth()+1,1)}function $r(e){return new Date(e.getFullYear(),e.getMonth()-1,1)}function Rr(e){return e.getHours()}function Lr(e){return e.getMinutes()}function Nr(e){return new Date(e.getFullYear(),0,1)}function Br(e){return new Date(e.getFullYear(),11,31)}function Hr(e,t){return fe(e,t[0])&&Wr(e,t[1])}function Yr(e){const t=new Date(e);return t instanceof Date&&!isNaN(t.getTime())}function fe(e,t){return e.getTime()>t.getTime()}function Vr(e,t){return fe(Te(e),Te(t))}function Wr(e,t){return e.getTime()<t.getTime()}function nt(e,t){return e.getTime()===t.getTime()}function jr(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Ur(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function zr(e,t){return e.getFullYear()===t.getFullYear()}function Gr(e,t,n){const r=new Date(e),o=new Date(t);switch(n){case"years":return r.getFullYear()-o.getFullYear();case"quarters":return Math.floor((r.getMonth()-o.getMonth()+(r.getFullYear()-o.getFullYear())*12)/4);case"months":return r.getMonth()-o.getMonth()+(r.getFullYear()-o.getFullYear())*12;case"weeks":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24*7));case"days":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24));case"hours":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60));case"minutes":return Math.floor((r.getTime()-o.getTime())/(1e3*60));case"seconds":return Math.floor((r.getTime()-o.getTime())/1e3);default:return r.getTime()-o.getTime()}}function Zr(e,t){const n=new Date(e);return n.setHours(t),n}function Kr(e,t){const n=new Date(e);return n.setMinutes(t),n}function _r(e,t){const n=new Date(e);return n.setMonth(t),n}function Xr(e,t){const n=new Date(e);return n.setDate(t),n}function Qr(e,t){const n=new Date(e);return n.setFullYear(t),n}function Te(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)}function qr(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999)}class Jr{constructor(t){this.locale=t.locale,this.formats=t.formats}date(t){return Vt(t)}toJsDate(t){return t}toISO(t){return xr(this,t)}parseISO(t){return Cr(t)}addMinutes(t,n){return Tr(t,n)}addHours(t,n){return Mr(t,n)}addDays(t,n){return kr(t,n)}addWeeks(t,n){return Ar(t,n)}addMonths(t,n){return Or(t,n)}getWeekArray(t){return yr(t,this.locale)}startOfWeek(t){return pr(t,this.locale)}endOfWeek(t){return vr(t,this.locale)}startOfMonth(t){return Ht(t)}endOfMonth(t){return Yt(t)}format(t,n){return Sr(t,n,this.locale,this.formats)}isEqual(t,n){return nt(t,n)}isValid(t){return Yr(t)}isWithinRange(t,n){return Hr(t,n)}isAfter(t,n){return fe(t,n)}isAfterDay(t,n){return Vr(t,n)}isBefore(t,n){return!fe(t,n)&&!nt(t,n)}isSameDay(t,n){return jr(t,n)}isSameMonth(t,n){return Ur(t,n)}isSameYear(t,n){return zr(t,n)}setMinutes(t,n){return Kr(t,n)}setHours(t,n){return Zr(t,n)}setMonth(t,n){return _r(t,n)}setDate(t,n){return Xr(t,n)}setYear(t,n){return Qr(t,n)}getDiff(t,n,r){return Gr(t,n,r)}getWeekdays(){return Dr(this.locale)}getYear(t){return Er(t)}getMonth(t){return Fr(t)}getDate(t){return Pr(t)}getNextMonth(t){return Ir(t)}getPreviousMonth(t){return $r(t)}getHours(t){return Rr(t)}getMinutes(t){return Lr(t)}startOfDay(t){return Te(t)}endOfDay(t){return qr(t)}startOfYear(t){return Nr(t)}endOfYear(t){return Br(t)}}const Wt=Symbol.for("vuetify:date-options"),rt=Symbol.for("vuetify:date-adapter");function eo(e,t){const n=w({adapter:Jr,locale:{af:"af-ZA",bg:"bg-BG",ca:"ca-ES",ckb:"",cs:"cs-CZ",de:"de-DE",el:"el-GR",en:"en-US",et:"et-EE",fa:"fa-IR",fi:"fi-FI",hr:"hr-HR",hu:"hu-HU",he:"he-IL",id:"id-ID",it:"it-IT",ja:"ja-JP",ko:"ko-KR",lv:"lv-LV",lt:"lt-LT",nl:"nl-NL",no:"no-NO",pl:"pl-PL",pt:"pt-PT",ro:"ro-RO",ru:"ru-RU",sk:"sk-SK",sl:"sl-SI",srCyrl:"sr-SP",srLatn:"sr-SP",sv:"sv-SE",th:"th-TH",tr:"tr-TR",az:"az-AZ",uk:"uk-UA",vi:"vi-VN",zhHans:"zh-CN",zhHant:"zh-TW"}},e);return{options:n,instance:jt(n,t)}}function jt(e,t){const n=O(typeof e.adapter=="function"?new e.adapter({locale:e.locale[t.current.value]??t.current.value,formats:e.formats}):e.adapter);return B(t.current,r=>{n.locale=e.locale[r]??r??n.locale}),n}function Ss(){const e=S(Wt);if(!e)throw new Error("[Vuetify] Could not find injected date options");const t=fr();return jt(e,t)}function xs(e,t){const n=e.toJsDate(t);let r=n.getFullYear(),o=new Date(r,0,1);if(n<o)r=r-1,o=new Date(r,0,1);else{const i=new Date(r+1,0,1);n>=i&&(r=r+1,o=i)}const s=Math.abs(n.getTime()-o.getTime()),a=Math.ceil(s/(1e3*60*60*24));return Math.floor(a/7)+1}const Cs=["sm","md","lg","xl","xxl"],Me=Symbol.for("vuetify:display"),ot={mobileBreakpoint:"lg",thresholds:{xs:0,sm:600,md:960,lg:1280,xl:1920,xxl:2560}},to=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ot;return w(ot,e)};function st(e){return D&&!e?window.innerWidth:typeof e=="object"&&e.clientWidth||0}function at(e){return D&&!e?window.innerHeight:typeof e=="object"&&e.clientHeight||0}function it(e){const t=D&&!e?window.navigator.userAgent:"ssr";function n(d){return!!t.match(d)}const r=n(/android/i),o=n(/iphone|ipad|ipod/i),s=n(/cordova/i),a=n(/electron/i),i=n(/chrome/i),u=n(/edge/i),c=n(/firefox/i),l=n(/opera/i),f=n(/win/i),g=n(/mac/i),h=n(/linux/i);return{android:r,ios:o,cordova:s,electron:a,chrome:i,edge:u,firefox:c,opera:l,win:f,mac:g,linux:h,touch:yn,ssr:t==="ssr"}}function no(e,t){const{thresholds:n,mobileBreakpoint:r}=to(e),o=P(at(t)),s=P(it(t)),a=O({}),i=P(st(t));function u(){o.value=at(),i.value=st()}function c(){u(),s.value=it()}return J(()=>{const l=i.value<n.sm,f=i.value<n.md&&!l,g=i.value<n.lg&&!(f||l),h=i.value<n.xl&&!(g||f||l),d=i.value<n.xxl&&!(h||g||f||l),m=i.value>=n.xxl,p=l?"xs":f?"sm":g?"md":h?"lg":d?"xl":"xxl",C=typeof r=="number"?r:n[r],T=i.value<C;a.xs=l,a.sm=f,a.md=g,a.lg=h,a.xl=d,a.xxl=m,a.smAndUp=!l,a.mdAndUp=!(l||f),a.lgAndUp=!(l||f||g),a.xlAndUp=!(l||f||g||h),a.smAndDown=!(g||h||d||m),a.mdAndDown=!(h||d||m),a.lgAndDown=!(d||m),a.xlAndDown=!m,a.name=p,a.height=o.value,a.width=i.value,a.mobile=T,a.mobileBreakpoint=r,a.platform=s.value,a.thresholds=n}),D&&window.addEventListener("resize",u,{passive:!0}),{...gt(a),update:c,ssr:!!t}}const Ts=Y({mobile:{type:Boolean,default:!1},mobileBreakpoint:[Number,String]},"display");function Ms(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:er();const n=S(Me);if(!n)throw new Error("Could not find Vuetify display injection");const r=y(()=>{if(e.mobile!=null)return e.mobile;if(!e.mobileBreakpoint)return n.mobile.value;const s=typeof e.mobileBreakpoint=="number"?e.mobileBreakpoint:n.thresholds.value[e.mobileBreakpoint];return n.width.value<s}),o=y(()=>t?{[`${t}--mobile`]:r.value}:{});return{...n,displayClasses:o,mobile:r}}const Ut=Symbol.for("vuetify:goto");function zt(){return{container:void 0,duration:300,layout:!1,offset:0,easing:"easeInOutCubic",patterns:{linear:e=>e,easeInQuad:e=>e**2,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e**2:-1+(4-2*e)*e,easeInCubic:e=>e**3,easeOutCubic:e=>--e**3+1,easeInOutCubic:e=>e<.5?4*e**3:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e**4,easeOutQuart:e=>1- --e**4,easeInOutQuart:e=>e<.5?8*e**4:1-8*--e**4,easeInQuint:e=>e**5,easeOutQuint:e=>1+--e**5,easeInOutQuint:e=>e<.5?16*e**5:1+16*--e**5}}}function ro(e){return Pe(e)??(document.scrollingElement||document.body)}function Pe(e){return typeof e=="string"?document.querySelector(e):St(e)}function De(e,t,n){if(typeof e=="number")return t&&n?-e:e;let r=Pe(e),o=0;for(;r;)o+=t?r.offsetLeft:r.offsetTop,r=r.offsetParent;return o}function oo(e,t){return{rtl:t.isRtl,options:w(zt(),e)}}async function ut(e,t,n,r){const o=n?"scrollLeft":"scrollTop",s=w(r?.options??zt(),t),a=r?.rtl.value,i=(typeof e=="number"?e:Pe(e))??0,u=s.container==="parent"&&i instanceof HTMLElement?i.parentElement:ro(s.container),c=typeof s.easing=="function"?s.easing:s.patterns[s.easing];if(!c)throw new TypeError(`Easing function "${s.easing}" not found.`);let l;if(typeof i=="number")l=De(i,n,a);else if(l=De(i,n,a)-De(u,n,a),s.layout){const d=window.getComputedStyle(i).getPropertyValue("--v-layout-top");d&&(l-=parseInt(d,10))}l+=s.offset,l=so(u,l,!!a,!!n);const f=u[o]??0;if(l===f)return Promise.resolve(l);const g=performance.now();return new Promise(h=>requestAnimationFrame(function d(m){const C=(m-g)/s.duration,T=Math.floor(f+(l-f)*c(Ct(C,0,1)));if(u[o]=T,C>=1&&Math.abs(T-u[o])<10)return h(l);if(C>2)return h(u[o]);requestAnimationFrame(d)}))}function ks(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=S(Ut),{isRtl:n}=hr();if(!t)throw new Error("[Vuetify] Could not find injected goto instance");const r={...t,rtl:y(()=>t.rtl.value||n.value)};async function o(s,a){return ut(s,w(e,a),!1,r)}return o.horizontal=async(s,a)=>ut(s,w(e,a),!0,r),o}function so(e,t,n,r){const{scrollWidth:o,scrollHeight:s}=e,[a,i]=e===document.scrollingElement?[window.innerWidth,window.innerHeight]:[e.offsetWidth,e.offsetHeight];let u,c;return r?n?(u=-(o-a),c=0):(u=0,c=o-a):(u=0,c=s+-i),Math.max(Math.min(t,c),u)}const ao={collapse:"mdi-chevron-up",complete:"mdi-check",cancel:"mdi-close-circle",close:"mdi-close",delete:"mdi-close-circle",clear:"mdi-close-circle",success:"mdi-check-circle",info:"mdi-information",warning:"mdi-alert-circle",error:"mdi-close-circle",prev:"mdi-chevron-left",next:"mdi-chevron-right",checkboxOn:"mdi-checkbox-marked",checkboxOff:"mdi-checkbox-blank-outline",checkboxIndeterminate:"mdi-minus-box",delimiter:"mdi-circle",sortAsc:"mdi-arrow-up",sortDesc:"mdi-arrow-down",expand:"mdi-chevron-down",menu:"mdi-menu",subgroup:"mdi-menu-down",dropdown:"mdi-menu-down",radioOn:"mdi-radiobox-marked",radioOff:"mdi-radiobox-blank",edit:"mdi-pencil",ratingEmpty:"mdi-star-outline",ratingFull:"mdi-star",ratingHalf:"mdi-star-half-full",loading:"mdi-cached",first:"mdi-page-first",last:"mdi-page-last",unfold:"mdi-unfold-more-horizontal",file:"mdi-paperclip",plus:"mdi-plus",minus:"mdi-minus",calendar:"mdi-calendar",treeviewCollapse:"mdi-menu-down",treeviewExpand:"mdi-menu-right",eyeDropper:"mdi-eyedropper"},io={component:e=>pt(Zt,{...e,class:"mdi"})},uo=[String,Function,Object,Array],ke=Symbol.for("vuetify:icons"),ge=Y({icon:{type:uo},tag:{type:String,required:!0}},"icon"),ct=$t()({name:"VComponentIcon",props:ge(),setup(e,t){let{slots:n}=t;return()=>{const r=e.icon;return E(e.tag,null,{default:()=>[e.icon?E(r,null,null):n.default?.()]})}}}),Gt=ee({name:"VSvgIcon",inheritAttrs:!1,props:ge(),setup(e,t){let{attrs:n}=t;return()=>E(e.tag,dn(n,{style:null}),{default:()=>[E("svg",{class:"v-icon__svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true"},[Array.isArray(e.icon)?e.icon.map(r=>Array.isArray(r)?E("path",{d:r[0],"fill-opacity":r[1]},null):E("path",{d:r},null)):E("path",{d:e.icon},null)])]})}}),As=ee({name:"VLigatureIcon",props:ge(),setup(e){return()=>E(e.tag,null,{default:()=>[e.icon]})}}),Zt=ee({name:"VClassIcon",props:ge(),setup(e){return()=>E(e.tag,{class:e.icon},null)}});function co(){return{svg:{component:Gt},class:{component:Zt}}}function lo(e){const t=co(),n=e?.defaultSet??"mdi";return n==="mdi"&&!t.mdi&&(t.mdi=io),w({defaultSet:n,sets:t,aliases:{...ao,vuetify:["M8.2241 14.2009L12 21L22 3H14.4459L8.2241 14.2009Z",["M7.26303 12.4733L7.00113 12L2 3H12.5261C12.5261 3 12.5261 3 12.5261 3L7.26303 12.4733Z",.6]],"vuetify-outline":"svg:M7.26 12.47 12.53 3H2L7.26 12.47ZM14.45 3 8.22 14.2 12 21 22 3H14.45ZM18.6 5 12 16.88 10.51 14.2 15.62 5ZM7.26 8.35 5.4 5H9.13L7.26 8.35Z","vuetify-play":["m6.376 13.184-4.11-7.192C1.505 4.66 2.467 3 4.003 3h8.532l-.953 1.576-.006.01-.396.677c-.429.732-.214 1.507.194 2.015.404.503 1.092.878 1.869.806a3.72 3.72 0 0 1 1.005.022c.276.053.434.143.523.237.138.146.38.635-.25 2.09-.893 1.63-1.553 1.722-1.847 1.677-.213-.033-.468-.158-.756-.406a4.95 4.95 0 0 1-.8-.927c-.39-.564-1.04-.84-1.66-.846-.625-.006-1.316.27-1.693.921l-.478.826-.911 1.506Z",["M9.093 11.552c.046-.079.144-.15.32-.148a.53.53 0 0 1 .43.207c.285.414.636.847 1.046 1.2.405.35.914.662 1.516.754 1.334.205 2.502-.698 3.48-2.495l.014-.028.013-.03c.687-1.574.774-2.852-.005-3.675-.37-.391-.861-.586-1.333-.676a5.243 5.243 0 0 0-1.447-.044c-.173.016-.393-.073-.54-.257-.145-.18-.127-.316-.082-.392l.393-.672L14.287 3h5.71c1.536 0 2.499 1.659 1.737 2.992l-7.997 13.996c-.768 1.344-2.706 1.344-3.473 0l-3.037-5.314 1.377-2.278.004-.006.004-.007.481-.831Z",.6]]}},e)}const Os=e=>{const t=S(ke);if(!t)throw new Error("Missing Vuetify Icons provide!");return{iconData:y(()=>{const r=U(e);if(!r)return{component:ct};let o=r;if(typeof o=="string"&&(o=o.trim(),o.startsWith("$")&&(o=t.aliases?.[o.slice(1)])),Array.isArray(o))return{component:Gt,icon:o};if(typeof o!="string")return{component:ct,icon:o};const s=Object.keys(t.sets).find(u=>typeof o=="string"&&o.startsWith(`${u}:`)),a=s?o.slice(s.length+1):o;return{component:t.sets[s??t.defaultSet].component,icon:a}})}},q=Symbol.for("vuetify:theme"),Es=Y({theme:String},"theme");function lt(){return{defaultTheme:"light",variations:{colors:[],lighten:0,darken:0},themes:{light:{dark:!1,colors:{background:"#FFFFFF",surface:"#FFFFFF","surface-bright":"#FFFFFF","surface-light":"#EEEEEE","surface-variant":"#424242","on-surface-variant":"#EEEEEE",primary:"#1867C0","primary-darken-1":"#1F5592",secondary:"#48A9A6","secondary-darken-1":"#018786",error:"#B00020",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"},variables:{"border-color":"#000000","border-opacity":.12,"high-emphasis-opacity":.87,"medium-emphasis-opacity":.6,"disabled-opacity":.38,"idle-opacity":.04,"hover-opacity":.04,"focus-opacity":.12,"selected-opacity":.08,"activated-opacity":.12,"pressed-opacity":.12,"dragged-opacity":.08,"theme-kbd":"#212529","theme-on-kbd":"#FFFFFF","theme-code":"#F5F5F5","theme-on-code":"#000000"}},dark:{dark:!0,colors:{background:"#121212",surface:"#212121","surface-bright":"#ccbfd6","surface-light":"#424242","surface-variant":"#a3a3a3","on-surface-variant":"#424242",primary:"#2196F3","primary-darken-1":"#277CC1",secondary:"#54B6B2","secondary-darken-1":"#48A9A6",error:"#CF6679",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"},variables:{"border-color":"#FFFFFF","border-opacity":.12,"high-emphasis-opacity":1,"medium-emphasis-opacity":.7,"disabled-opacity":.5,"idle-opacity":.1,"hover-opacity":.04,"focus-opacity":.12,"selected-opacity":.08,"activated-opacity":.12,"pressed-opacity":.16,"dragged-opacity":.08,"theme-kbd":"#212529","theme-on-kbd":"#FFFFFF","theme-code":"#343434","theme-on-code":"#CCCCCC"}}}}}function fo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lt();const t=lt();if(!e)return{...t,isDisabled:!0};const n={};for(const[r,o]of Object.entries(e.themes??{})){const s=o.dark||r==="dark"?t.themes?.dark:t.themes?.light;n[r]=w(s,o)}return w(t,{...e,themes:n})}function mo(e){const t=fo(e),n=I(t.defaultTheme),r=I(t.themes),o=y(()=>{const l={};for(const[f,g]of Object.entries(r.value)){const h=l[f]={...g,colors:{...g.colors}};if(t.variations)for(const d of t.variations.colors){const m=h.colors[d];if(m)for(const p of["lighten","darken"]){const C=p==="lighten"?Xn:Qn;for(const T of Dt(t.variations[p],1))h.colors[`${d}-${p}-${T}`]=Ft(C(F(m),T))}}for(const d of Object.keys(h.colors)){if(/^on-[a-z]/.test(d)||h.colors[`on-${d}`])continue;const m=`on-${d}`,p=F(h.colors[d]);h.colors[m]=qn(p)}}return l}),s=y(()=>o.value[n.value]),a=y(()=>{const l=[];s.value?.dark&&L(l,":root",["color-scheme: dark"]),L(l,":root",ft(s.value));for(const[d,m]of Object.entries(o.value))L(l,`.v-theme--${d}`,[`color-scheme: ${m.dark?"dark":"normal"}`,...ft(m)]);const f=[],g=[],h=new Set(Object.values(o.value).flatMap(d=>Object.keys(d.colors)));for(const d of h)/^on-[a-z]/.test(d)?L(g,`.${d}`,[`color: rgb(var(--v-theme-${d})) !important`]):(L(f,`.bg-${d}`,[`--v-theme-overlay-multiplier: var(--v-theme-${d}-overlay-multiplier)`,`background-color: rgb(var(--v-theme-${d})) !important`,`color: rgb(var(--v-theme-on-${d})) !important`]),L(g,`.text-${d}`,[`color: rgb(var(--v-theme-${d})) !important`]),L(g,`.border-${d}`,[`--v-border-color: var(--v-theme-${d})`]));return l.push(...f,...g),l.map((d,m)=>m===0?d:` ${d}`).join("")});function i(){return{style:[{children:a.value,id:"vuetify-theme-stylesheet",nonce:t.cspNonce||!1}]}}function u(l){if(t.isDisabled)return;const f=l._context.provides.usehead;if(f)if(f.push){const g=f.push(i);D&&B(a,()=>{g.patch(i)})}else D?(f.addHeadObjs(y(i)),J(()=>f.updateDOM())):f.addHeadObjs(i());else{let h=function(){if(typeof document<"u"&&!g){const d=document.createElement("style");d.type="text/css",d.id="vuetify-theme-stylesheet",t.cspNonce&&d.setAttribute("nonce",t.cspNonce),g=d,document.head.appendChild(g)}g&&(g.innerHTML=a.value)},g=D?document.getElementById("vuetify-theme-stylesheet"):null;D?B(a,h,{immediate:!0}):h()}}const c=y(()=>t.isDisabled?void 0:`v-theme--${n.value}`);return{install:u,isDisabled:t.isDisabled,name:n,themes:r,current:s,computedThemes:o,themeClasses:c,styles:a,global:{name:n,current:s}}}function Fs(e){k("provideTheme");const t=S(q,null);if(!t)throw new Error("Could not find Vuetify theme injection");const n=y(()=>e.theme??t.name.value),r=y(()=>t.themes.value[n.value]),o=y(()=>t.isDisabled?void 0:`v-theme--${n.value}`),s={...t,name:n,current:r,themeClasses:o};return Z(q,s),s}function Ps(){k("useTheme");const e=S(q,null);if(!e)throw new Error("Could not find Vuetify theme injection");return e}function L(e,t,n){e.push(`${t} {
|
|
||||||
`,...n.map(r=>` ${r};
|
|
||||||
`),`}
|
|
||||||
`)}function ft(e){const t=e.dark?2:1,n=e.dark?1:2,r=[];for(const[o,s]of Object.entries(e.colors)){const a=F(s);r.push(`--v-theme-${o}: ${a.r},${a.g},${a.b}`),o.startsWith("on-")||r.push(`--v-theme-${o}-overlay-multiplier: ${Ce(s)>.18?t:n}`)}for(const[o,s]of Object.entries(e.variables)){const a=typeof s=="string"&&s.startsWith("#")?F(s):void 0,i=a?`${a.r}, ${a.g}, ${a.b}`:void 0;r.push(`--v-${o}: ${i??s}`)}return r}function go(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"content";const n=En(),r=I();if(D){const o=new ResizeObserver(s=>{e?.(s,o),s.length&&(t==="content"?r.value=s[0].contentRect:r.value=s[0].target.getBoundingClientRect())});vt(()=>{o.disconnect()}),B(()=>n.el,(s,a)=>{a&&(o.unobserve(a),r.value=void 0),s&&o.observe(s)},{flush:"post"})}return{resizeRef:n,contentRect:yt(r)}}const de=Symbol.for("vuetify:layout"),Kt=Symbol.for("vuetify:layout-item"),dt=1e3,Is=Y({overlaps:{type:Array,default:()=>[]},fullHeight:Boolean},"layout"),$s=Y({name:{type:String},order:{type:[Number,String],default:0},absolute:Boolean},"layout-item");function Rs(){const e=S(de);if(!e)throw new Error("[Vuetify] Could not find injected layout");return{layoutIsReady:me(),getLayoutItem:e.getLayoutItem,mainRect:e.mainRect,mainStyles:e.mainStyles}}function Ls(e){const t=S(de);if(!t)throw new Error("[Vuetify] Could not find injected layout");const n=e.id??`layout-item-${Ee()}`,r=k("useLayoutItem");Z(Kt,{id:n});const o=P(!1);mn(()=>o.value=!0),gn(()=>o.value=!1);const s=me(),{layoutItemStyles:a,layoutItemScrimStyles:i}=t.register(r,{...e,active:y(()=>o.value?!1:e.active.value),id:n});return vt(()=>t.unregister(n)),{layoutItemStyles:a,layoutRect:t.layoutRect,layoutItemScrimStyles:i,layoutIsReady:s}}const ho=(e,t,n,r)=>{let o={top:0,left:0,right:0,bottom:0};const s=[{id:"",layer:{...o}}];for(const a of e){const i=t.get(a),u=n.get(a),c=r.get(a);if(!i||!u||!c)continue;const l={...o,[i.value]:parseInt(o[i.value],10)+(c.value?parseInt(u.value,10):0)};s.push({id:a,layer:l}),o=l}return s};function Ns(e){const t=S(de,null),n=y(()=>t?t.rootZIndex.value-100:dt),r=I([]),o=O(new Map),s=O(new Map),a=O(new Map),i=O(new Map),u=O(new Map),{resizeRef:c,contentRect:l}=go(),f=Ve(()=>{const b=[...new Set([...a.values()].map(v=>v.value))].sort((v,$)=>v-$),M=[];for(const v of b){const $=r.value.filter(x=>a.get(x)?.value===v);M.push(...$)}return ho(M,o,s,i)}),g=y(()=>!Array.from(u.values()).some(b=>b.value)),h=y(()=>f.value[f.value.length-1].layer),d=y(()=>({"--v-layout-left":ne(h.value.left),"--v-layout-right":ne(h.value.right),"--v-layout-top":ne(h.value.top),"--v-layout-bottom":ne(h.value.bottom),...g.value?void 0:{transition:"none"}})),m=Ve(()=>f.value.slice(1).map((b,M)=>{let{id:v}=b;const{layer:$}=f.value[M],x=s.get(v),te=o.get(v);return{id:v,...$,size:Number(x.value),position:te.value}})),p=b=>m.value.find(M=>M.id===b),C=k("createLayout"),T=me();Z(de,{register:(b,M)=>{let{id:v,order:$,position:x,layoutSize:te,elementSize:K,active:Ie,disableTransitions:$e,absolute:Qt}=M;a.set(v,$),o.set(v,x),s.set(v,te),i.set(v,Ie),$e&&u.set(v,$e);const Re=X(Kt,C?.vnode).indexOf(b);Re>-1?r.value.splice(Re,0,v):r.value.push(v);const he=y(()=>m.value.findIndex(_=>_.id===v)),ye=y(()=>n.value+f.value.length*2-he.value*2),qt=y(()=>{const _=x.value==="left"||x.value==="right",pe=x.value==="right",en=x.value==="bottom",ve=K.value??te.value,tn=ve===0?"%":"px",nn={[x.value]:0,zIndex:ye.value,transform:`translate${_?"X":"Y"}(${(Ie.value?0:-(ve===0?100:ve))*(pe||en?-1:1)}${tn})`,position:Qt.value||n.value!==dt?"absolute":"fixed",...g.value?void 0:{transition:"none"}};if(he.value<0)throw new Error(`Layout item "${v}" is missing`);const A=m.value[he.value];if(!A)throw new Error(`[Vuetify] Could not find layout item "${v}"`);return{...nn,height:_?`calc(100% - ${A.top}px - ${A.bottom}px)`:K.value?`${K.value}px`:void 0,left:pe?void 0:`${A.left}px`,right:pe?`${A.right}px`:void 0,top:x.value!=="bottom"?`${A.top}px`:void 0,bottom:x.value!=="top"?`${A.bottom}px`:void 0,width:_?K.value?`${K.value}px`:void 0:`calc(100% - ${A.left}px - ${A.right}px)`}}),Jt=y(()=>({zIndex:ye.value-1}));return{layoutItemStyles:qt,layoutItemScrimStyles:Jt,zIndex:ye}},unregister:b=>{a.delete(b),o.delete(b),s.delete(b),i.delete(b),u.delete(b),r.value=r.value.filter(M=>M!==b)},mainRect:h,mainStyles:d,getLayoutItem:p,items:m,layoutRect:l,rootZIndex:n,layoutIsReady:T});const _t=y(()=>["v-layout",{"v-layout--full-height":e.fullHeight}]),Xt=y(()=>({zIndex:t?n.value:void 0,position:t?"relative":void 0,overflow:t?"hidden":void 0}));return{layoutClasses:_t,layoutStyles:Xt,getLayoutItem:p,items:m,layoutRect:l,layoutIsReady:T,layoutRef:c}}function yo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{blueprint:t,...n}=e,r=w(t,n),{aliases:o={},components:s={},directives:a={}}=r,i=nr(r.defaults),u=no(r.display,r.ssr),c=mo(r.theme),l=lo(r.icons),f=lr(r.locale),g=eo(r.date,f),h=oo(r.goTo,f);return{install:m=>{for(const p in a)m.directive(p,a[p]);for(const p in s)m.component(p,s[p]);for(const p in o)m.component(p,ee({...o[p],name:p,aliasName:o[p].name}));if(c.install(m),m.provide(z,i),m.provide(Me,u),m.provide(q,c),m.provide(ke,l),m.provide(G,f),m.provide(Wt,g.options),m.provide(rt,g.instance),m.provide(Ut,h),D&&r.ssr)if(m.$nuxt)m.$nuxt.hook("app:suspense:resolve",()=>{u.update()});else{const{mount:p}=m;m.mount=function(){const C=p(...arguments);return me(()=>u.update()),m.mount=p,C}}Ee.reset(),m.mixin({computed:{$vuetify(){return O({defaults:j.call(this,z),display:j.call(this,Me),theme:j.call(this,q),icons:j.call(this,ke),locale:j.call(this,G),date:j.call(this,rt)})}}})},defaults:i,display:u,theme:c,icons:l,locale:f,date:g,goTo:h}}const po="3.6.10";yo.version=po;function j(e){const t=this.$,n=t.parent?.provides??t.vnode.appContext?.provides;if(n&&e in n)return n[e]}export{An as $,Ao as A,Vo as B,Dn as C,fr as D,Lo as E,qo as F,gs as G,ms as H,uo as I,hs as J,Xo as K,Qo as L,hn as M,Mo as N,hr as O,X as P,Ts as Q,go as R,wo as S,ks as T,D as U,Mn as V,No as W,ee as X,fs as Y,ns as Z,So as _,Ps as a,ct as a$,bs as a0,Uo as a1,zo as a2,Go as a3,Zo as a4,vs as a5,ie as a6,Ko as a7,_o as a8,Ct as a9,Zn as aA,os as aB,Et as aC,is as aD,as as aE,be as aF,Fo as aG,Dt as aH,Co as aI,Do as aJ,ss as aK,Kn as aL,us as aM,Se as aN,Ho as aO,ls as aP,ts as aQ,ys as aR,Ss as aS,xs as aT,Ds as aU,Rs as aV,Io as aW,We as aX,St as aY,de as aZ,Zt as a_,Rt as aa,Wo as ab,En as ac,Jo as ad,es as ae,ds as af,ps as ag,jo as ah,kn as ai,Ae as aj,wn as ak,Bo as al,Eo as am,On as an,Yo as ao,ko as ap,Cs as aq,Po as ar,$s as as,Ls as at,To as au,Is as av,Ns as aw,Be as ax,$o as ay,H as az,Y as b,As as b0,Gt as b1,yo as b2,rs as c,Ro as d,F as e,qn as f,$t as g,er as h,zn as i,xe as j,ne as k,Es as l,Jn as m,Fs as n,Os as o,cs as p,ws as q,Tn as r,k as s,bn as t,Ms as u,ar as v,Ee as w,Ne as x,xo as y,Oo as z};
|
|
||||||
5
qbit/vuetorrent/public/assets/vuetify-XtA0Y0Oj.js
Normal file
5
qbit/vuetorrent/public/assets/vuetify-XtA0Y0Oj.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import{w as Y,o as nn,e as rn,s as I,F as gt,r as E,c as h,a as me,t as ht,i as on,C as sn,b as pt,u as G,g as an,d as $,p as _,f as x,h as un,j as cn,k as yt,l as ln,m as F,n as fn,q as vt,v as dn,x as mn,y as gn,z as hn,A as pn}from"./vue-DFryKk-1.js";function yn(e,t){let n;function r(){n=rn(),n.run(()=>t.length?t(()=>{n?.stop(),r()}):t())}Y(e,o=>{o&&!n?r():o||(n?.stop(),n=void 0)},{immediate:!0}),nn(()=>{n?.stop()})}const S=typeof window<"u",So=S&&"IntersectionObserver"in window,vn=S&&("ontouchstart"in window||window.navigator.maxTouchPoints>0),Mo=S&&"EyeDropper"in window;function Be(e,t,n){bn(e,t),t.set(e,n)}function bn(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wn(e,t,n){return e.set(bt(e,t),n),n}function N(e,t){return e.get(bt(e,t))}function bt(e,t,n){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function wt(e,t,n){const r=t.length-1;if(r<0)return e===void 0?n:e;for(let o=0;o<r;o++){if(e==null)return n;e=e[t[o]]}return e==null||e[t[r]]===void 0?n:e[t[r]]}function Dn(e,t){if(e===t)return!0;if(e instanceof Date&&t instanceof Date&&e.getTime()!==t.getTime()||e!==Object(e)||t!==Object(t))return!1;const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>Dn(e[r],t[r]))}function Me(e,t,n){return e==null||!t||typeof t!="string"?n:e[t]!==void 0?e[t]:(t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),wt(e,t.split("."),n))}function xo(e,t,n){if(t===!0)return e===void 0?n:e;if(t==null||typeof t=="boolean")return n;if(e!==Object(e)){if(typeof t!="function")return n;const o=t(e,n);return typeof o>"u"?n:o}if(typeof t=="string")return Me(e,t,n);if(Array.isArray(t))return wt(e,t,n);if(typeof t!="function")return n;const r=t(e,n);return typeof r>"u"?n:r}function Dt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Array.from({length:e},(n,r)=>t+r)}function ne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"px";if(!(e==null||e===""))return isNaN(+e)?String(e):isFinite(+e)?`${Number(e)}${t}`:void 0}function To(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function He(e){let t;return e!==null&&typeof e=="object"&&((t=Object.getPrototypeOf(e))===Object.prototype||t===null)}function St(e){if(e&&"$el"in e){const t=e.$el;return t?.nodeType===Node.TEXT_NODE?t.nextElementSibling:t}return e}const Co=Object.freeze({enter:13,tab:9,delete:46,esc:27,space:32,up:38,down:40,left:37,right:39,end:35,home:36,del:46,backspace:8,insert:45,pageup:33,pagedown:34,shift:16}),ko=Object.freeze({enter:"Enter",tab:"Tab",delete:"Delete",esc:"Escape",space:"Space",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",end:"End",home:"Home",del:"Delete",backspace:"Backspace",insert:"Insert",pageup:"PageUp",pagedown:"PageDown",shift:"Shift"});function Ao(e){return Object.keys(e)}function we(e,t){return t.every(n=>e.hasOwnProperty(n))}function Sn(e,t){const n={},r=new Set(Object.keys(e));for(const o of t)r.has(o)&&(n[o]=e[o]);return n}function Ye(e,t,n){const r=Object.create(null),o=Object.create(null);for(const s in e)t.some(a=>a instanceof RegExp?a.test(s):a===s)&&!n?.some(a=>a===s)?r[s]=e[s]:o[s]=e[s];return[r,o]}function Mn(e,t){const n={...e};return t.forEach(r=>delete n[r]),n}function Oo(e,t){const n={};return t.forEach(r=>n[r]=e[r]),n}const Mt=/^on[^a-z]/,Oe=e=>Mt.test(e),xn=["onAfterscriptexecute","onAnimationcancel","onAnimationend","onAnimationiteration","onAnimationstart","onAuxclick","onBeforeinput","onBeforescriptexecute","onChange","onClick","onCompositionend","onCompositionstart","onCompositionupdate","onContextmenu","onCopy","onCut","onDblclick","onFocusin","onFocusout","onFullscreenchange","onFullscreenerror","onGesturechange","onGestureend","onGesturestart","onGotpointercapture","onInput","onKeydown","onKeypress","onKeyup","onLostpointercapture","onMousedown","onMousemove","onMouseout","onMouseover","onMouseup","onMousewheel","onPaste","onPointercancel","onPointerdown","onPointerenter","onPointerleave","onPointermove","onPointerout","onPointerover","onPointerup","onReset","onSelect","onSubmit","onTouchcancel","onTouchend","onTouchmove","onTouchstart","onTransitioncancel","onTransitionend","onTransitionrun","onTransitionstart","onWheel"],Tn=["ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Enter","Escape","Tab"," "];function Eo(e){return e.isComposing&&Tn.includes(e.key)}function Fo(e){const[t,n]=Ye(e,[Mt]),r=Mn(t,xn),[o,s]=Ye(n,["class","style","id",/^data-/]);return Object.assign(o,t),Object.assign(s,r),[o,s]}function Po(e){return e==null?[]:Array.isArray(e)?e:[e]}function Io(e,t){let n=0;const r=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];clearTimeout(n),n=setTimeout(()=>e(...s),G(t))};return r.clear=()=>{clearTimeout(n)},r.immediate=e,r}function xt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;return Math.max(t,Math.min(n,e))}function $o(e){const t=e.toString().trim();return t.includes(".")?t.length-t.indexOf(".")-1:0}function Ve(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0";return e+n.repeat(Math.max(0,t-e.length))}function je(e,t){return(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0").repeat(Math.max(0,t-e.length))+e}function Cn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const n=[];let r=0;for(;r<e.length;)n.push(e.substr(r,t)),r+=t;return n}function Ro(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;if(e<t)return`${e} B`;const n=t===1024?["Ki","Mi","Gi"]:["k","M","G"];let r=-1;for(;Math.abs(e)>=t&&r<n.length-1;)e/=t,++r;return`${e.toFixed(1)} ${n[r]}B`}function D(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r={};for(const o in e)r[o]=e[o];for(const o in t){const s=e[o],a=t[o];if(He(s)&&He(a)){r[o]=D(s,a,n);continue}if(n&&Array.isArray(s)&&Array.isArray(a)){r[o]=n(s,a);continue}r[o]=a}return r}function kn(e){return e.map(t=>t.type===gt?kn(t.children):t).flat()}function H(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(H.cache.has(e))return H.cache.get(e);const t=e.replace(/[^a-z]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase();return H.cache.set(e,t),t}H.cache=new Map;function J(e,t){if(!t||typeof t!="object")return[];if(Array.isArray(t))return t.map(n=>J(e,n)).flat(1);if(t.suspense)return J(e,t.ssContent);if(Array.isArray(t.children))return t.children.map(n=>J(e,n)).flat(1);if(t.component){if(Object.getOwnPropertySymbols(t.component.provides).includes(e))return[t.component];if(t.component.subTree)return J(e,t.component.subTree).flat(1)}return[]}var re=new WeakMap,W=new WeakMap;class Lo{constructor(t){Be(this,re,[]),Be(this,W,0),this.size=t}push(t){N(re,this)[N(W,this)]=t,wn(W,this,(N(W,this)+1)%this.size)}values(){return N(re,this).slice(N(W,this)).concat(N(re,this).slice(0,N(W,this)))}}function No(e){return"touches"in e?{clientX:e.touches[0].clientX,clientY:e.touches[0].clientY}:{clientX:e.clientX,clientY:e.clientY}}function Bo(e){const t=E({}),n=h(e);return me(()=>{for(const r in n.value)t[r]=n.value[r]},{flush:"sync"}),ht(t)}function xe(e,t){return e.includes(t)}function Tt(e){return e[2].toLowerCase()+e.slice(3)}const Ho=()=>[Function,Array];function Yo(e,t){return t="on"+pt(t),!!(e[t]||e[`${t}Once`]||e[`${t}Capture`]||e[`${t}OnceCapture`]||e[`${t}CaptureOnce`])}function Vo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(Array.isArray(e))for(const o of e)o(...n);else typeof e=="function"&&e(...n)}function An(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=["button","[href]",'input:not([type="hidden"])',"select","textarea","[tabindex]"].map(r=>`${r}${t?':not([tabindex="-1"])':""}:not([disabled])`).join(", ");return[...e.querySelectorAll(n)]}function On(e,t,n){let r,o=e.indexOf(document.activeElement);const s=t==="next"?1:-1;do o+=s,r=e[o];while((!r||r.offsetParent==null||!(n?.(r)??!0))&&o<e.length&&o>=0);return r}function En(e,t){const n=An(e);if(!t)(e===document.activeElement||!e.contains(document.activeElement))&&n[0]?.focus();else if(t==="first")n[0]?.focus();else if(t==="last")n.at(-1)?.focus();else if(typeof t=="number")n[t]?.focus();else{const r=On(n,t);r?r.focus():En(e,t==="next"?"first":"last")}}function jo(e){return e==null||typeof e=="string"&&e.trim()===""}function Wo(){}function Uo(e,t){if(!(S&&typeof CSS<"u"&&typeof CSS.supports<"u"&&CSS.supports(`selector(${t})`)))return null;try{return!!e&&e.matches(t)}catch{return null}}function Fn(e){return e.some(t=>on(t)?t.type===sn?!1:t.type!==gt||Fn(t.children):!0)?e:null}function zo(e,t){if(!S||e===0)return t(),()=>{};const n=window.setTimeout(t,e);return()=>window.clearTimeout(n)}function Go(e,t){const n=e.clientX,r=e.clientY,o=t.getBoundingClientRect(),s=o.left,a=o.top,i=o.right,c=o.bottom;return n>=s&&n<=i&&r>=a&&r<=c}function Pn(){const e=I(),t=n=>{e.value=n};return Object.defineProperty(t,"value",{enumerable:!0,get:()=>e.value,set:n=>e.value=n}),Object.defineProperty(t,"el",{enumerable:!0,get:()=>St(e.value)}),t}function Ko(e){const t=e.key.length===1,n=!e.ctrlKey&&!e.metaKey&&!e.altKey;return t&&n}const Ct=["top","bottom"],In=["start","end","left","right"];function Zo(e,t){let[n,r]=e.split(" ");return r||(r=xe(Ct,n)?"start":xe(In,n)?"top":"center"),{side:We(n,t),align:We(r,t)}}function We(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function _o(e){return{side:{center:"center",top:"bottom",bottom:"top",left:"right",right:"left"}[e.side],align:e.align}}function Xo(e){return{side:e.side,align:{center:"center",top:"bottom",bottom:"top",left:"right",right:"left"}[e.align]}}function Qo(e){return{side:e.align,align:e.side}}function qo(e){return xe(Ct,e.side)?"y":"x"}class ie{constructor(t){let{x:n,y:r,width:o,height:s}=t;this.x=n,this.y=r,this.width=o,this.height=s}get top(){return this.y}get bottom(){return this.y+this.height}get left(){return this.x}get right(){return this.x+this.width}}function Jo(e,t){return{x:{before:Math.max(0,t.left-e.left),after:Math.max(0,e.right-t.right)},y:{before:Math.max(0,t.top-e.top),after:Math.max(0,e.bottom-t.bottom)}}}function es(e){return Array.isArray(e)?new ie({x:e[0],y:e[1],width:0,height:0}):e.getBoundingClientRect()}function ts(e){const t=e.getBoundingClientRect(),n=getComputedStyle(e),r=n.transform;if(r){let o,s,a,i,c;if(r.startsWith("matrix3d("))o=r.slice(9,-1).split(/, /),s=+o[0],a=+o[5],i=+o[12],c=+o[13];else if(r.startsWith("matrix("))o=r.slice(7,-1).split(/, /),s=+o[0],a=+o[3],i=+o[4],c=+o[5];else return new ie(t);const l=n.transformOrigin,u=t.x-i-(1-s)*parseFloat(l),f=t.y-c-(1-a)*parseFloat(l.slice(l.indexOf(" ")+1)),m=s?t.width/s:e.offsetWidth+1,p=a?t.height/a:e.offsetHeight+1;return new ie({x:u,y:f,width:m,height:p})}else return new ie(t)}function ns(e,t,n){if(typeof e.animate>"u")return{finished:Promise.resolve()};let r;try{r=e.animate(t,n)}catch{return{finished:Promise.resolve()}}return typeof r.finished>"u"&&(r.finished=new Promise(o=>{r.onfinish=()=>{o(r)}})),r}const ue=new WeakMap;function rs(e,t){Object.keys(t).forEach(n=>{if(Oe(n)){const r=Tt(n),o=ue.get(e);if(t[n]==null)o?.forEach(s=>{const[a,i]=s;a===r&&(e.removeEventListener(r,i),o.delete(s))});else if(!o||![...o].some(s=>s[0]===r&&s[1]===t[n])){e.addEventListener(r,t[n]);const s=o||new Set;s.add([r,t[n]]),ue.has(e)||ue.set(e,s)}}else t[n]==null?e.removeAttribute(n):e.setAttribute(n,t[n])})}function os(e,t){Object.keys(t).forEach(n=>{if(Oe(n)){const r=Tt(n),o=ue.get(e);o?.forEach(s=>{const[a,i]=s;a===r&&(e.removeEventListener(r,i),o.delete(s))})}else e.removeAttribute(n)})}const U=2.4,Ue=.2126729,ze=.7151522,Ge=.072175,$n=.55,Rn=.58,Ln=.57,Nn=.62,oe=.03,Ke=1.45,Bn=5e-4,Hn=1.25,Yn=1.25,Ze=.078,_e=12.82051282051282,se=.06,Xe=.001;function Qe(e,t){const n=(e.r/255)**U,r=(e.g/255)**U,o=(e.b/255)**U,s=(t.r/255)**U,a=(t.g/255)**U,i=(t.b/255)**U;let c=n*Ue+r*ze+o*Ge,l=s*Ue+a*ze+i*Ge;if(c<=oe&&(c+=(oe-c)**Ke),l<=oe&&(l+=(oe-l)**Ke),Math.abs(l-c)<Bn)return 0;let u;if(l>c){const f=(l**$n-c**Rn)*Hn;u=f<Xe?0:f<Ze?f-f*_e*se:f-se}else{const f=(l**Nn-c**Ln)*Yn;u=f>-Xe?0:f>-Ze?f-f*_e*se:f+se}return u*100}function ss(e){}function as(e,t){t=Array.isArray(t)?t.slice(0,-1).map(n=>`'${n}'`).join(", ")+` or '${t.at(-1)}'`:`'${t}'`}const le=.20689655172413793,Vn=e=>e>le**3?Math.cbrt(e):e/(3*le**2)+4/29,jn=e=>e>le?e**3:3*le**2*(e-4/29);function kt(e){const t=Vn,n=t(e[1]);return[116*n-16,500*(t(e[0]/.95047)-n),200*(n-t(e[2]/1.08883))]}function At(e){const t=jn,n=(e[0]+16)/116;return[t(n+e[1]/500)*.95047,t(n),t(n-e[2]/200)*1.08883]}const Wn=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]],Un=e=>e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055,zn=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],Gn=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function Ot(e){const t=Array(3),n=Un,r=Wn;for(let o=0;o<3;++o)t[o]=Math.round(xt(n(r[o][0]*e[0]+r[o][1]*e[1]+r[o][2]*e[2]))*255);return{r:t[0],g:t[1],b:t[2]}}function Ee(e){let{r:t,g:n,b:r}=e;const o=[0,0,0],s=Gn,a=zn;t=s(t/255),n=s(n/255),r=s(r/255);for(let i=0;i<3;++i)o[i]=a[i][0]*t+a[i][1]*n+a[i][2]*r;return o}function Kn(e){return!!e&&/^(#|var\(--|(rgb|hsl)a?\()/.test(e)}function is(e){return Kn(e)&&!/^((rgb|hsl)a?\()?var\(--/.test(e)}const qe=/^(?<fn>(?:rgb|hsl)a?)\((?<values>.+)\)/,Zn={rgb:(e,t,n,r)=>({r:e,g:t,b:n,a:r}),rgba:(e,t,n,r)=>({r:e,g:t,b:n,a:r}),hsl:(e,t,n,r)=>Je({h:e,s:t,l:n,a:r}),hsla:(e,t,n,r)=>Je({h:e,s:t,l:n,a:r}),hsv:(e,t,n,r)=>V({h:e,s:t,v:n,a:r}),hsva:(e,t,n,r)=>V({h:e,s:t,v:n,a:r})};function P(e){if(typeof e=="number")return{r:(e&16711680)>>16,g:(e&65280)>>8,b:e&255};if(typeof e=="string"&&qe.test(e)){const{groups:t}=e.match(qe),{fn:n,values:r}=t,o=r.split(/,\s*/).map(s=>s.endsWith("%")&&["hsl","hsla","hsv","hsva"].includes(n)?parseFloat(s)/100:parseFloat(s));return Zn[n](...o)}else if(typeof e=="string"){let t=e.startsWith("#")?e.slice(1):e;return[3,4].includes(t.length)?t=t.split("").map(n=>n+n).join(""):[6,8].includes(t.length),Pt(t)}else if(typeof e=="object"){if(we(e,["r","g","b"]))return e;if(we(e,["h","s","l"]))return V(Et(e));if(we(e,["h","s","v"]))return V(e)}throw new TypeError(`Invalid color: ${e==null?e:String(e)||e.constructor.name}
|
||||||
|
Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`)}function V(e){const{h:t,s:n,v:r,a:o}=e,s=i=>{const c=(i+t/60)%6;return r-r*n*Math.max(Math.min(c,4-c,1),0)},a=[s(5),s(3),s(1)].map(i=>Math.round(i*255));return{r:a[0],g:a[1],b:a[2],a:o}}function Je(e){return V(Et(e))}function _n(e){if(!e)return{h:0,s:1,v:1,a:1};const t=e.r/255,n=e.g/255,r=e.b/255,o=Math.max(t,n,r),s=Math.min(t,n,r);let a=0;o!==s&&(o===t?a=60*(0+(n-r)/(o-s)):o===n?a=60*(2+(r-t)/(o-s)):o===r&&(a=60*(4+(t-n)/(o-s)))),a<0&&(a=a+360);const i=o===0?0:(o-s)/o,c=[a,i,o];return{h:c[0],s:c[1],v:c[2],a:e.a}}function us(e){const{h:t,s:n,v:r,a:o}=e,s=r-r*n/2,a=s===1||s===0?0:(r-s)/Math.min(s,1-s);return{h:t,s:a,l:s,a:o}}function Et(e){const{h:t,s:n,l:r,a:o}=e,s=r+n*Math.min(r,1-r),a=s===0?0:2-2*r/s;return{h:t,s:a,v:s,a:o}}function Xn(e){let{r:t,g:n,b:r,a:o}=e;return o===void 0?`rgb(${t}, ${n}, ${r})`:`rgba(${t}, ${n}, ${r}, ${o})`}function cs(e){return Xn(V(e))}function ae(e){const t=Math.round(e).toString(16);return("00".substr(0,2-t.length)+t).toUpperCase()}function Ft(e){let{r:t,g:n,b:r,a:o}=e;return`#${[ae(t),ae(n),ae(r),o!==void 0?ae(Math.round(o*255)):""].join("")}`}function Pt(e){e=Qn(e);let[t,n,r,o]=Cn(e,2).map(s=>parseInt(s,16));return o=o===void 0?o:o/255,{r:t,g:n,b:r,a:o}}function ls(e){const t=Pt(e);return _n(t)}function fs(e){return Ft(V(e))}function Qn(e){return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),(e.length===3||e.length===4)&&(e=e.split("").map(t=>t+t).join("")),e.length!==6&&(e=Ve(Ve(e,6),8,"F")),e}function qn(e,t){const n=kt(Ee(e));return n[0]=n[0]+t*10,Ot(At(n))}function Jn(e,t){const n=kt(Ee(e));return n[0]=n[0]-t*10,Ot(At(n))}function Te(e){const t=P(e);return Ee(t)[1]}function ds(e,t){const n=Te(e),r=Te(t),o=Math.max(n,r),s=Math.min(n,r);return(o+.05)/(s+.05)}function er(e){const t=Math.abs(Qe(P(0),P(e)));return Math.abs(Qe(P(16777215),P(e)))>Math.min(t,50)?"#fff":"#000"}function j(e,t){return n=>Object.keys(e).reduce((r,o)=>{const a=typeof e[o]=="object"&&e[o]!=null&&!Array.isArray(e[o])?e[o]:{type:e[o]};return n&&o in n?r[o]={...a,default:n[o]}:r[o]=a,t&&!r[o].source&&(r[o].source=t),r},{})}const tr=j({class:[String,Array,Object],style:{type:[String,Array,Object],default:null}},"component");function A(e,t){const n=an();if(!n)throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);return n}function nr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"composables";const t=A(e).type;return H(t?.aliasName||t?.name)}let It=0,ce=new WeakMap;function Fe(){const e=A("getUid");if(ce.has(e))return ce.get(e);{const t=It++;return ce.set(e,t),t}}Fe.reset=()=>{It=0,ce=new WeakMap};function rr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:A("injectSelf");const{provides:n}=t;if(n&&e in n)return n[e]}const K=Symbol.for("vuetify:defaults");function or(e){return $(e)}function Pe(){const e=x(K);if(!e)throw new Error("[Vuetify] Could not find defaults instance");return e}function ms(e,t){const n=Pe(),r=$(e),o=h(()=>{if(G(t?.disabled))return n.value;const a=G(t?.scoped),i=G(t?.reset),c=G(t?.root);if(r.value==null&&!(a||i||c))return n.value;let l=D(r.value,{prev:n.value});if(a)return l;if(i||c){const u=Number(i||1/0);for(let f=0;f<=u&&!(!l||!("prev"in l));f++)l=l.prev;return l&&typeof c=="string"&&c in l&&(l=D(D(l,{prev:l}),l[c])),l}return l.prev?D(l.prev,l):l});return _(K,o),o}function sr(e,t){return typeof e.props?.[t]<"u"||typeof e.props?.[H(t)]<"u"}function ar(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pe();const r=A("useDefaults");if(t=t??r.type.name??r.type.__name,!t)throw new Error("[Vuetify] Could not determine component name");const o=h(()=>n.value?.[e._as??t]),s=new Proxy(e,{get(c,l){const u=Reflect.get(c,l);return l==="class"||l==="style"?[o.value?.[l],u].filter(f=>f!=null):typeof l=="string"&&!sr(r.vnode,l)?o.value?.[l]!==void 0?o.value?.[l]:n.value?.global?.[l]!==void 0?n.value?.global?.[l]:u:u}}),a=I();me(()=>{if(o.value){const c=Object.entries(o.value).filter(l=>{let[u]=l;return u.startsWith(u[0].toUpperCase())});a.value=c.length?Object.fromEntries(c):void 0}else a.value=void 0});function i(){const c=rr(K,r);_(K,h(()=>a.value?D(c?.value??{},a.value):c?.value))}return{props:s,provideSubDefaults:i}}function te(e){if(e._setup=e._setup??e.setup,!e.name)return e;if(e._setup){e.props=j(e.props??{},e.name)();const t=Object.keys(e.props).filter(n=>n!=="class"&&n!=="style");e.filterProps=function(r){return Sn(r,t)},e.props._as=String,e.setup=function(r,o){const s=Pe();if(!s.value)return e._setup(r,o);const{props:a,provideSubDefaults:i}=ar(r,r._as??e.name,s),c=e._setup(a,o);return i(),c}}return e}function $t(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return t=>(e?te:un)(t)}function gs(e,t){return t.props=e,t}function hs(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"div",n=arguments.length>2?arguments[2]:void 0;return $t()({name:n??pt(cn(e.replace(/__/g,"-"))),props:{tag:{type:String,default:t},...tr()},setup(r,o){let{slots:s}=o;return()=>yt(r.tag,{class:[e,r.class],style:r.style},s.default?.())}})}function ps(e){if(typeof e.getRootNode!="function"){for(;e.parentNode;)e=e.parentNode;return e!==document?null:document}const t=e.getRootNode();return t!==document&&t.getRootNode({composed:!0})!==document?null:t}const ys="cubic-bezier(0.4, 0, 0.2, 1)",vs="cubic-bezier(0.0, 0, 0.2, 1)",bs="cubic-bezier(0.4, 0, 1, 1)";function ws(e,t,n){return Object.keys(e).filter(r=>Oe(r)&&r.endsWith(t)).reduce((r,o)=>(r[o.slice(0,-t.length)]=s=>e[o](s,n(s)),r),{})}function Ds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(;e;){if(t?ir(e):Rt(e))return e;e=e.parentElement}return document.scrollingElement}function Ss(e,t){const n=[];if(t&&e&&!t.contains(e))return n;for(;e&&(Rt(e)&&n.push(e),e!==t);)e=e.parentElement;return n}function Rt(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return t.overflowY==="scroll"||t.overflowY==="auto"&&e.scrollHeight>e.clientHeight}function ir(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return["scroll","auto"].includes(t.overflowY)}function Ms(e){for(;e;){if(window.getComputedStyle(e).position==="fixed")return!0;e=e.offsetParent}return!1}function xs(e){const t=A("useRender");t.render=e}function ur(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:f=>f,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:f=>f;const s=A("useProxiedModel"),a=$(e[t]!==void 0?e[t]:n),i=H(t),l=i!==t?h(()=>(e[t],!!((s.vnode.props?.hasOwnProperty(t)||s.vnode.props?.hasOwnProperty(i))&&(s.vnode.props?.hasOwnProperty(`onUpdate:${t}`)||s.vnode.props?.hasOwnProperty(`onUpdate:${i}`))))):h(()=>(e[t],!!(s.vnode.props?.hasOwnProperty(t)&&s.vnode.props?.hasOwnProperty(`onUpdate:${t}`))));yn(()=>!l.value,()=>{Y(()=>e[t],f=>{a.value=f})});const u=h({get(){const f=e[t];return r(l.value?f:a.value)},set(f){const m=o(f),p=ln(l.value?e[t]:a.value);p===m||r(p)===f||(a.value=m,s?.emit(`update:${t}`,m))}});return Object.defineProperty(u,"externalValue",{get:()=>l.value?e[t]:a.value}),u}const cr={badge:"Badge",open:"Open",close:"Close",dismiss:"Dismiss",confirmEdit:{ok:"OK",cancel:"Cancel"},dataIterator:{noResultsText:"No matching records found",loadingText:"Loading items..."},dataTable:{itemsPerPageText:"Rows per page:",ariaLabel:{sortDescending:"Sorted descending.",sortAscending:"Sorted ascending.",sortNone:"Not sorted.",activateNone:"Activate to remove sorting.",activateDescending:"Activate to sort descending.",activateAscending:"Activate to sort ascending."},sortBy:"Sort by"},dataFooter:{itemsPerPageText:"Items per page:",itemsPerPageAll:"All",nextPage:"Next page",prevPage:"Previous page",firstPage:"First page",lastPage:"Last page",pageText:"{0}-{1} of {2}"},dateRangeInput:{divider:"to"},datePicker:{itemsSelected:"{0} selected",range:{title:"Select dates",header:"Enter dates"},title:"Select date",header:"Enter date",input:{placeholder:"Enter date"}},noDataText:"No data available",carousel:{prev:"Previous visual",next:"Next visual",ariaLabel:{delimiter:"Carousel slide {0} of {1}"}},calendar:{moreEvents:"{0} more",today:"Today"},input:{clear:"Clear {0}",prependAction:"{0} prepended action",appendAction:"{0} appended action",otp:"Please enter OTP character {0}"},fileInput:{counter:"{0} files",counterSize:"{0} files ({1} in total)"},timePicker:{am:"AM",pm:"PM",title:"Select Time"},pagination:{ariaLabel:{root:"Pagination Navigation",next:"Next page",previous:"Previous page",page:"Go to page {0}",currentPage:"Page {0}, Current page",first:"First page",last:"Last page"}},stepper:{next:"Next",prev:"Previous"},rating:{ariaLabel:{item:"Rating {0} of {1}"}},loading:"Loading...",infiniteScroll:{loadMore:"Load more",empty:"No more"}},et="$vuetify.",tt=(e,t)=>e.replace(/\{(\d+)\}/g,(n,r)=>String(t[+r])),Lt=(e,t,n)=>function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!r.startsWith(et))return tt(r,s);const i=r.replace(et,""),c=e.value&&n.value[e.value],l=t.value&&n.value[t.value];let u=Me(c,i,null);return u||(`${r}${e.value}`,u=Me(l,i,null)),u||(u=r),typeof u!="string"&&(u=r),tt(u,s)};function Nt(e,t){return(n,r)=>new Intl.NumberFormat([e.value,t.value],r).format(n)}function De(e,t,n){const r=ur(e,t,e[t]??n.value);return r.value=e[t]??n.value,Y(n,o=>{e[t]==null&&(r.value=n.value)}),r}function Bt(e){return t=>{const n=De(t,"locale",e.current),r=De(t,"fallback",e.fallback),o=De(t,"messages",e.messages);return{name:"vuetify",current:n,fallback:r,messages:o,t:Lt(n,r,o),n:Nt(n,r),provide:Bt({current:n,fallback:r,messages:o})}}}function lr(e){const t=I(e?.locale??"en"),n=I(e?.fallback??"en"),r=$({en:cr,...e?.messages});return{name:"vuetify",current:t,fallback:n,messages:r,t:Lt(t,n,r),n:Nt(t,n),provide:Bt({current:t,fallback:n,messages:r})}}const Z=Symbol.for("vuetify:locale");function fr(e){return e.name!=null}function dr(e){const t=e?.adapter&&fr(e?.adapter)?e?.adapter:lr(e),n=hr(t,e);return{...t,...n}}function mr(){const e=x(Z);if(!e)throw new Error("[Vuetify] Could not find injected locale instance");return e}function Ts(e){const t=x(Z);if(!t)throw new Error("[Vuetify] Could not find injected locale instance");const n=t.provide(e),r=pr(n,t.rtl,e),o={...n,...r};return _(Z,o),o}function gr(){return{af:!1,ar:!0,bg:!1,ca:!1,ckb:!1,cs:!1,de:!1,el:!1,en:!1,es:!1,et:!1,fa:!0,fi:!1,fr:!1,hr:!1,hu:!1,he:!0,id:!1,it:!1,ja:!1,km:!1,ko:!1,lv:!1,lt:!1,nl:!1,no:!1,pl:!1,pt:!1,ro:!1,ru:!1,sk:!1,sl:!1,srCyrl:!1,srLatn:!1,sv:!1,th:!1,tr:!1,az:!1,uk:!1,vi:!1,zhHans:!1,zhHant:!1}}function hr(e,t){const n=$(t?.rtl??gr()),r=h(()=>n.value[e.current.value]??!1);return{isRtl:r,rtl:n,rtlClasses:h(()=>`v-locale--is-${r.value?"rtl":"ltr"}`)}}function pr(e,t,n){const r=h(()=>n.rtl??t.value[e.current.value]??!1);return{isRtl:r,rtl:t,rtlClasses:h(()=>`v-locale--is-${r.value?"rtl":"ltr"}`)}}function yr(){const e=x(Z);if(!e)throw new Error("[Vuetify] Could not find injected rtl instance");return{isRtl:e.isRtl,rtlClasses:e.rtlClasses}}const ge={"001":1,AD:1,AE:6,AF:6,AG:0,AI:1,AL:1,AM:1,AN:1,AR:1,AS:0,AT:1,AU:1,AX:1,AZ:1,BA:1,BD:0,BE:1,BG:1,BH:6,BM:1,BN:1,BR:0,BS:0,BT:0,BW:0,BY:1,BZ:0,CA:0,CH:1,CL:1,CM:1,CN:1,CO:0,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DM:0,DO:0,DZ:6,EC:1,EE:1,EG:6,ES:1,ET:0,FI:1,FJ:1,FO:1,FR:1,GB:1,"GB-alt-variant":0,GE:1,GF:1,GP:1,GR:1,GT:0,GU:0,HK:0,HN:0,HR:1,HU:1,ID:0,IE:1,IL:0,IN:0,IQ:6,IR:6,IS:1,IT:1,JM:0,JO:6,JP:0,KE:0,KG:1,KH:0,KR:0,KW:6,KZ:1,LA:0,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MH:0,MK:1,MM:0,MN:1,MO:0,MQ:1,MT:0,MV:5,MX:0,MY:1,MZ:0,NI:0,NL:1,NO:1,NP:0,NZ:1,OM:6,PA:0,PE:0,PH:0,PK:0,PL:1,PR:0,PT:0,PY:0,QA:6,RE:1,RO:1,RS:1,RU:1,SA:0,SD:6,SE:1,SG:0,SI:1,SK:1,SM:1,SV:0,SY:6,TH:0,TJ:1,TM:1,TR:1,TT:0,TW:0,UA:1,UM:0,US:0,UY:1,UZ:1,VA:1,VE:0,VI:0,VN:1,WS:0,XK:1,YE:0,ZA:0,ZW:0};function vr(e,t,n){const r=[];let o=[];const s=Ht(e),a=Yt(e),i=n??ge[t.slice(-2).toUpperCase()]??0,c=(s.getDay()-i+7)%7,l=(a.getDay()-i+7)%7;for(let u=0;u<c;u++){const f=new Date(s);f.setDate(f.getDate()-(c-u)),o.push(f)}for(let u=1;u<=a.getDate();u++){const f=new Date(e.getFullYear(),e.getMonth(),u);o.push(f),o.length===7&&(r.push(o),o=[])}for(let u=1;u<7-l;u++){const f=new Date(a);f.setDate(f.getDate()+u),o.push(f)}return o.length>0&&r.push(o),r}function br(e,t,n){const r=n??ge[t.slice(-2).toUpperCase()]??0,o=new Date(e);for(;o.getDay()!==r;)o.setDate(o.getDate()-1);return o}function wr(e,t){const n=new Date(e),r=((ge[t.slice(-2).toUpperCase()]??0)+6)%7;for(;n.getDay()!==r;)n.setDate(n.getDate()+1);return n}function Ht(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Yt(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function Dr(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}const Sr=/^([12]\d{3}-([1-9]|0[1-9]|1[0-2])-([1-9]|0[1-9]|[12]\d|3[01]))$/;function Vt(e){if(e==null)return new Date;if(e instanceof Date)return e;if(typeof e=="string"){let t;if(Sr.test(e))return Dr(e);if(t=Date.parse(e),!isNaN(t))return new Date(t)}return null}const nt=new Date(2e3,0,2);function Mr(e,t){const n=t??ge[e.slice(-2).toUpperCase()]??0;return Dt(7).map(r=>{const o=new Date(nt);return o.setDate(nt.getDate()+n+r),new Intl.DateTimeFormat(e,{weekday:"narrow"}).format(o)})}function xr(e,t,n,r){const o=Vt(e)??new Date,s=r?.[t];if(typeof s=="function")return s(o,t,n);let a={};switch(t){case"fullDate":a={year:"numeric",month:"long",day:"numeric"};break;case"fullDateWithWeekday":a={weekday:"long",year:"numeric",month:"long",day:"numeric"};break;case"normalDate":const i=o.getDate(),c=new Intl.DateTimeFormat(n,{month:"long"}).format(o);return`${i} ${c}`;case"normalDateWithWeekday":a={weekday:"short",day:"numeric",month:"short"};break;case"shortDate":a={month:"short",day:"numeric"};break;case"year":a={year:"numeric"};break;case"month":a={month:"long"};break;case"monthShort":a={month:"short"};break;case"monthAndYear":a={month:"long",year:"numeric"};break;case"monthAndDate":a={month:"long",day:"numeric"};break;case"weekday":a={weekday:"long"};break;case"weekdayShort":a={weekday:"short"};break;case"dayOfMonth":return new Intl.NumberFormat(n).format(o.getDate());case"hours12h":a={hour:"numeric",hour12:!0};break;case"hours24h":a={hour:"numeric",hour12:!1};break;case"minutes":a={minute:"numeric"};break;case"seconds":a={second:"numeric"};break;case"fullTime":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullTime12h":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullTime24h":a={hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"fullDateTime":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullDateTime12h":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"fullDateTime24h":a={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"keyboardDate":a={year:"numeric",month:"2-digit",day:"2-digit"};break;case"keyboardDateTime":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;case"keyboardDateTime12h":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0};break;case"keyboardDateTime24h":a={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1};break;default:a=s??{timeZone:"UTC",timeZoneName:"short"}}return new Intl.DateTimeFormat(n,a).format(o)}function Tr(e,t){const n=e.toJsDate(t),r=n.getFullYear(),o=je(String(n.getMonth()+1),2,"0"),s=je(String(n.getDate()),2,"0");return`${r}-${o}-${s}`}function Cr(e){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}function kr(e,t){const n=new Date(e);return n.setMinutes(n.getMinutes()+t),n}function Ar(e,t){const n=new Date(e);return n.setHours(n.getHours()+t),n}function Or(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function Er(e,t){const n=new Date(e);return n.setDate(n.getDate()+t*7),n}function Fr(e,t){const n=new Date(e);return n.setDate(1),n.setMonth(n.getMonth()+t),n}function Pr(e){return e.getFullYear()}function Ir(e){return e.getMonth()}function $r(e){return e.getDate()}function Rr(e){return new Date(e.getFullYear(),e.getMonth()+1,1)}function Lr(e){return new Date(e.getFullYear(),e.getMonth()-1,1)}function Nr(e){return e.getHours()}function Br(e){return e.getMinutes()}function Hr(e){return new Date(e.getFullYear(),0,1)}function Yr(e){return new Date(e.getFullYear(),11,31)}function Vr(e,t){return fe(e,t[0])&&Ur(e,t[1])}function jr(e){const t=new Date(e);return t instanceof Date&&!isNaN(t.getTime())}function fe(e,t){return e.getTime()>t.getTime()}function Wr(e,t){return fe(Ce(e),Ce(t))}function Ur(e,t){return e.getTime()<t.getTime()}function rt(e,t){return e.getTime()===t.getTime()}function zr(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Gr(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Kr(e,t){return e.getFullYear()===t.getFullYear()}function Zr(e,t,n){const r=new Date(e),o=new Date(t);switch(n){case"years":return r.getFullYear()-o.getFullYear();case"quarters":return Math.floor((r.getMonth()-o.getMonth()+(r.getFullYear()-o.getFullYear())*12)/4);case"months":return r.getMonth()-o.getMonth()+(r.getFullYear()-o.getFullYear())*12;case"weeks":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24*7));case"days":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24));case"hours":return Math.floor((r.getTime()-o.getTime())/(1e3*60*60));case"minutes":return Math.floor((r.getTime()-o.getTime())/(1e3*60));case"seconds":return Math.floor((r.getTime()-o.getTime())/1e3);default:return r.getTime()-o.getTime()}}function _r(e,t){const n=new Date(e);return n.setHours(t),n}function Xr(e,t){const n=new Date(e);return n.setMinutes(t),n}function Qr(e,t){const n=new Date(e);return n.setMonth(t),n}function qr(e,t){const n=new Date(e);return n.setDate(t),n}function Jr(e,t){const n=new Date(e);return n.setFullYear(t),n}function Ce(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)}function eo(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999)}class to{constructor(t){this.locale=t.locale,this.formats=t.formats}date(t){return Vt(t)}toJsDate(t){return t}toISO(t){return Tr(this,t)}parseISO(t){return Cr(t)}addMinutes(t,n){return kr(t,n)}addHours(t,n){return Ar(t,n)}addDays(t,n){return Or(t,n)}addWeeks(t,n){return Er(t,n)}addMonths(t,n){return Fr(t,n)}getWeekArray(t,n){return vr(t,this.locale,n?Number(n):void 0)}startOfWeek(t,n){return br(t,this.locale,n?Number(n):void 0)}endOfWeek(t){return wr(t,this.locale)}startOfMonth(t){return Ht(t)}endOfMonth(t){return Yt(t)}format(t,n){return xr(t,n,this.locale,this.formats)}isEqual(t,n){return rt(t,n)}isValid(t){return jr(t)}isWithinRange(t,n){return Vr(t,n)}isAfter(t,n){return fe(t,n)}isAfterDay(t,n){return Wr(t,n)}isBefore(t,n){return!fe(t,n)&&!rt(t,n)}isSameDay(t,n){return zr(t,n)}isSameMonth(t,n){return Gr(t,n)}isSameYear(t,n){return Kr(t,n)}setMinutes(t,n){return Xr(t,n)}setHours(t,n){return _r(t,n)}setMonth(t,n){return Qr(t,n)}setDate(t,n){return qr(t,n)}setYear(t,n){return Jr(t,n)}getDiff(t,n,r){return Zr(t,n,r)}getWeekdays(t){return Mr(this.locale,t?Number(t):void 0)}getYear(t){return Pr(t)}getMonth(t){return Ir(t)}getDate(t){return $r(t)}getNextMonth(t){return Rr(t)}getPreviousMonth(t){return Lr(t)}getHours(t){return Nr(t)}getMinutes(t){return Br(t)}startOfDay(t){return Ce(t)}endOfDay(t){return eo(t)}startOfYear(t){return Hr(t)}endOfYear(t){return Yr(t)}}const jt=Symbol.for("vuetify:date-options"),ot=Symbol.for("vuetify:date-adapter");function no(e,t){const n=D({adapter:to,locale:{af:"af-ZA",bg:"bg-BG",ca:"ca-ES",ckb:"",cs:"cs-CZ",de:"de-DE",el:"el-GR",en:"en-US",et:"et-EE",fa:"fa-IR",fi:"fi-FI",hr:"hr-HR",hu:"hu-HU",he:"he-IL",id:"id-ID",it:"it-IT",ja:"ja-JP",ko:"ko-KR",lv:"lv-LV",lt:"lt-LT",nl:"nl-NL",no:"no-NO",pl:"pl-PL",pt:"pt-PT",ro:"ro-RO",ru:"ru-RU",sk:"sk-SK",sl:"sl-SI",srCyrl:"sr-SP",srLatn:"sr-SP",sv:"sv-SE",th:"th-TH",tr:"tr-TR",az:"az-AZ",uk:"uk-UA",vi:"vi-VN",zhHans:"zh-CN",zhHant:"zh-TW"}},e);return{options:n,instance:Wt(n,t)}}function Wt(e,t){const n=E(typeof e.adapter=="function"?new e.adapter({locale:e.locale[t.current.value]??t.current.value,formats:e.formats}):e.adapter);return Y(t.current,r=>{n.locale=e.locale[r]??r??n.locale}),n}function Cs(){const e=x(jt);if(!e)throw new Error("[Vuetify] Could not find injected date options");const t=mr();return Wt(e,t)}function ks(e,t){const n=e.toJsDate(t);let r=n.getFullYear(),o=new Date(r,0,1);if(n<o)r=r-1,o=new Date(r,0,1);else{const i=new Date(r+1,0,1);n>=i&&(r=r+1,o=i)}const s=Math.abs(n.getTime()-o.getTime()),a=Math.ceil(s/(1e3*60*60*24));return Math.floor(a/7)+1}const As=["sm","md","lg","xl","xxl"],ke=Symbol.for("vuetify:display"),st={mobileBreakpoint:"lg",thresholds:{xs:0,sm:600,md:960,lg:1280,xl:1920,xxl:2560}},ro=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:st;return D(st,e)};function at(e){return S&&!e?window.innerWidth:typeof e=="object"&&e.clientWidth||0}function it(e){return S&&!e?window.innerHeight:typeof e=="object"&&e.clientHeight||0}function ut(e){const t=S&&!e?window.navigator.userAgent:"ssr";function n(d){return!!t.match(d)}const r=n(/android/i),o=n(/iphone|ipad|ipod/i),s=n(/cordova/i),a=n(/electron/i),i=n(/chrome/i),c=n(/edge/i),l=n(/firefox/i),u=n(/opera/i),f=n(/win/i),m=n(/mac/i),p=n(/linux/i);return{android:r,ios:o,cordova:s,electron:a,chrome:i,edge:c,firefox:l,opera:u,win:f,mac:m,linux:p,touch:vn,ssr:t==="ssr"}}function oo(e,t){const{thresholds:n,mobileBreakpoint:r}=ro(e),o=I(it(t)),s=I(ut(t)),a=E({}),i=I(at(t));function c(){o.value=it(),i.value=at()}function l(){c(),s.value=ut()}return me(()=>{const u=i.value<n.sm,f=i.value<n.md&&!u,m=i.value<n.lg&&!(f||u),p=i.value<n.xl&&!(m||f||u),d=i.value<n.xxl&&!(p||m||f||u),g=i.value>=n.xxl,y=u?"xs":f?"sm":m?"md":p?"lg":d?"xl":"xxl",T=typeof r=="number"?r:n[r],O=i.value<T;a.xs=u,a.sm=f,a.md=m,a.lg=p,a.xl=d,a.xxl=g,a.smAndUp=!u,a.mdAndUp=!(u||f),a.lgAndUp=!(u||f||m),a.xlAndUp=!(u||f||m||p),a.smAndDown=!(m||p||d||g),a.mdAndDown=!(p||d||g),a.lgAndDown=!(d||g),a.xlAndDown=!g,a.name=y,a.height=o.value,a.width=i.value,a.mobile=O,a.mobileBreakpoint=r,a.platform=s.value,a.thresholds=n}),S&&window.addEventListener("resize",c,{passive:!0}),{...ht(a),update:l,ssr:!!t}}const Os=j({mobile:{type:Boolean,default:!1},mobileBreakpoint:[Number,String]},"display");function Es(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nr();const n=x(ke);if(!n)throw new Error("Could not find Vuetify display injection");const r=h(()=>{if(e.mobile!=null)return e.mobile;if(!e.mobileBreakpoint)return n.mobile.value;const s=typeof e.mobileBreakpoint=="number"?e.mobileBreakpoint:n.thresholds.value[e.mobileBreakpoint];return n.width.value<s}),o=h(()=>t?{[`${t}--mobile`]:r.value}:{});return{...n,displayClasses:o,mobile:r}}const Ut=Symbol.for("vuetify:goto");function zt(){return{container:void 0,duration:300,layout:!1,offset:0,easing:"easeInOutCubic",patterns:{linear:e=>e,easeInQuad:e=>e**2,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e**2:-1+(4-2*e)*e,easeInCubic:e=>e**3,easeOutCubic:e=>--e**3+1,easeInOutCubic:e=>e<.5?4*e**3:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e**4,easeOutQuart:e=>1- --e**4,easeInOutQuart:e=>e<.5?8*e**4:1-8*--e**4,easeInQuint:e=>e**5,easeOutQuint:e=>1+--e**5,easeInOutQuint:e=>e<.5?16*e**5:1+16*--e**5}}}function so(e){return Ie(e)??(document.scrollingElement||document.body)}function Ie(e){return typeof e=="string"?document.querySelector(e):St(e)}function Se(e,t,n){if(typeof e=="number")return t&&n?-e:e;let r=Ie(e),o=0;for(;r;)o+=t?r.offsetLeft:r.offsetTop,r=r.offsetParent;return o}function ao(e,t){return{rtl:t.isRtl,options:D(zt(),e)}}async function ct(e,t,n,r){const o=n?"scrollLeft":"scrollTop",s=D(r?.options??zt(),t),a=r?.rtl.value,i=(typeof e=="number"?e:Ie(e))??0,c=s.container==="parent"&&i instanceof HTMLElement?i.parentElement:so(s.container),l=typeof s.easing=="function"?s.easing:s.patterns[s.easing];if(!l)throw new TypeError(`Easing function "${s.easing}" not found.`);let u;if(typeof i=="number")u=Se(i,n,a);else if(u=Se(i,n,a)-Se(c,n,a),s.layout){const d=window.getComputedStyle(i).getPropertyValue("--v-layout-top");d&&(u-=parseInt(d,10))}u+=s.offset,u=io(c,u,!!a,!!n);const f=c[o]??0;if(u===f)return Promise.resolve(u);const m=performance.now();return new Promise(p=>requestAnimationFrame(function d(g){const T=(g-m)/s.duration,O=Math.floor(f+(u-f)*l(xt(T,0,1)));if(c[o]=O,T>=1&&Math.abs(O-c[o])<10)return p(u);if(T>2)return p(c[o]);requestAnimationFrame(d)}))}function Fs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=x(Ut),{isRtl:n}=yr();if(!t)throw new Error("[Vuetify] Could not find injected goto instance");const r={...t,rtl:h(()=>t.rtl.value||n.value)};async function o(s,a){return ct(s,D(e,a),!1,r)}return o.horizontal=async(s,a)=>ct(s,D(e,a),!0,r),o}function io(e,t,n,r){const{scrollWidth:o,scrollHeight:s}=e,[a,i]=e===document.scrollingElement?[window.innerWidth,window.innerHeight]:[e.offsetWidth,e.offsetHeight];let c,l;return r?n?(c=-(o-a),l=0):(c=0,l=o-a):(c=0,l=s+-i),Math.max(Math.min(t,l),c)}const uo={collapse:"mdi-chevron-up",complete:"mdi-check",cancel:"mdi-close-circle",close:"mdi-close",delete:"mdi-close-circle",clear:"mdi-close-circle",success:"mdi-check-circle",info:"mdi-information",warning:"mdi-alert-circle",error:"mdi-close-circle",prev:"mdi-chevron-left",next:"mdi-chevron-right",checkboxOn:"mdi-checkbox-marked",checkboxOff:"mdi-checkbox-blank-outline",checkboxIndeterminate:"mdi-minus-box",delimiter:"mdi-circle",sortAsc:"mdi-arrow-up",sortDesc:"mdi-arrow-down",expand:"mdi-chevron-down",menu:"mdi-menu",subgroup:"mdi-menu-down",dropdown:"mdi-menu-down",radioOn:"mdi-radiobox-marked",radioOff:"mdi-radiobox-blank",edit:"mdi-pencil",ratingEmpty:"mdi-star-outline",ratingFull:"mdi-star",ratingHalf:"mdi-star-half-full",loading:"mdi-cached",first:"mdi-page-first",last:"mdi-page-last",unfold:"mdi-unfold-more-horizontal",file:"mdi-paperclip",plus:"mdi-plus",minus:"mdi-minus",calendar:"mdi-calendar",treeviewCollapse:"mdi-menu-down",treeviewExpand:"mdi-menu-right",eyeDropper:"mdi-eyedropper"},co={component:e=>yt(Kt,{...e,class:"mdi"})},lo=[String,Function,Object,Array],Ae=Symbol.for("vuetify:icons"),he=j({icon:{type:lo},tag:{type:String,required:!0}},"icon"),lt=$t()({name:"VComponentIcon",props:he(),setup(e,t){let{slots:n}=t;return()=>{const r=e.icon;return F(e.tag,null,{default:()=>[e.icon?F(r,null,null):n.default?.()]})}}}),Gt=te({name:"VSvgIcon",inheritAttrs:!1,props:he(),setup(e,t){let{attrs:n}=t;return()=>F(e.tag,fn(n,{style:null}),{default:()=>[F("svg",{class:"v-icon__svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true"},[Array.isArray(e.icon)?e.icon.map(r=>Array.isArray(r)?F("path",{d:r[0],"fill-opacity":r[1]},null):F("path",{d:r},null)):F("path",{d:e.icon},null)])]})}}),Ps=te({name:"VLigatureIcon",props:he(),setup(e){return()=>F(e.tag,null,{default:()=>[e.icon]})}}),Kt=te({name:"VClassIcon",props:he(),setup(e){return()=>F(e.tag,{class:e.icon},null)}});function fo(){return{svg:{component:Gt},class:{component:Kt}}}function mo(e){const t=fo(),n=e?.defaultSet??"mdi";return n==="mdi"&&!t.mdi&&(t.mdi=co),D({defaultSet:n,sets:t,aliases:{...uo,vuetify:["M8.2241 14.2009L12 21L22 3H14.4459L8.2241 14.2009Z",["M7.26303 12.4733L7.00113 12L2 3H12.5261C12.5261 3 12.5261 3 12.5261 3L7.26303 12.4733Z",.6]],"vuetify-outline":"svg:M7.26 12.47 12.53 3H2L7.26 12.47ZM14.45 3 8.22 14.2 12 21 22 3H14.45ZM18.6 5 12 16.88 10.51 14.2 15.62 5ZM7.26 8.35 5.4 5H9.13L7.26 8.35Z","vuetify-play":["m6.376 13.184-4.11-7.192C1.505 4.66 2.467 3 4.003 3h8.532l-.953 1.576-.006.01-.396.677c-.429.732-.214 1.507.194 2.015.404.503 1.092.878 1.869.806a3.72 3.72 0 0 1 1.005.022c.276.053.434.143.523.237.138.146.38.635-.25 2.09-.893 1.63-1.553 1.722-1.847 1.677-.213-.033-.468-.158-.756-.406a4.95 4.95 0 0 1-.8-.927c-.39-.564-1.04-.84-1.66-.846-.625-.006-1.316.27-1.693.921l-.478.826-.911 1.506Z",["M9.093 11.552c.046-.079.144-.15.32-.148a.53.53 0 0 1 .43.207c.285.414.636.847 1.046 1.2.405.35.914.662 1.516.754 1.334.205 2.502-.698 3.48-2.495l.014-.028.013-.03c.687-1.574.774-2.852-.005-3.675-.37-.391-.861-.586-1.333-.676a5.243 5.243 0 0 0-1.447-.044c-.173.016-.393-.073-.54-.257-.145-.18-.127-.316-.082-.392l.393-.672L14.287 3h5.71c1.536 0 2.499 1.659 1.737 2.992l-7.997 13.996c-.768 1.344-2.706 1.344-3.473 0l-3.037-5.314 1.377-2.278.004-.006.004-.007.481-.831Z",.6]]}},e)}const Is=e=>{const t=x(Ae);if(!t)throw new Error("Missing Vuetify Icons provide!");return{iconData:h(()=>{const r=G(e);if(!r)return{component:lt};let o=r;if(typeof o=="string"&&(o=o.trim(),o.startsWith("$")&&(o=t.aliases?.[o.slice(1)])),Array.isArray(o))return{component:Gt,icon:o};if(typeof o!="string")return{component:lt,icon:o};const s=Object.keys(t.sets).find(c=>typeof o=="string"&&o.startsWith(`${c}:`)),a=s?o.slice(s.length+1):o;return{component:t.sets[s??t.defaultSet].component,icon:a}})}},ee=Symbol.for("vuetify:theme"),$s=j({theme:String},"theme");function ft(){return{defaultTheme:"light",variations:{colors:[],lighten:0,darken:0},themes:{light:{dark:!1,colors:{background:"#FFFFFF",surface:"#FFFFFF","surface-bright":"#FFFFFF","surface-light":"#EEEEEE","surface-variant":"#424242","on-surface-variant":"#EEEEEE",primary:"#1867C0","primary-darken-1":"#1F5592",secondary:"#48A9A6","secondary-darken-1":"#018786",error:"#B00020",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"},variables:{"border-color":"#000000","border-opacity":.12,"high-emphasis-opacity":.87,"medium-emphasis-opacity":.6,"disabled-opacity":.38,"idle-opacity":.04,"hover-opacity":.04,"focus-opacity":.12,"selected-opacity":.08,"activated-opacity":.12,"pressed-opacity":.12,"dragged-opacity":.08,"theme-kbd":"#212529","theme-on-kbd":"#FFFFFF","theme-code":"#F5F5F5","theme-on-code":"#000000"}},dark:{dark:!0,colors:{background:"#121212",surface:"#212121","surface-bright":"#ccbfd6","surface-light":"#424242","surface-variant":"#a3a3a3","on-surface-variant":"#424242",primary:"#2196F3","primary-darken-1":"#277CC1",secondary:"#54B6B2","secondary-darken-1":"#48A9A6",error:"#CF6679",info:"#2196F3",success:"#4CAF50",warning:"#FB8C00"},variables:{"border-color":"#FFFFFF","border-opacity":.12,"high-emphasis-opacity":1,"medium-emphasis-opacity":.7,"disabled-opacity":.5,"idle-opacity":.1,"hover-opacity":.04,"focus-opacity":.12,"selected-opacity":.08,"activated-opacity":.12,"pressed-opacity":.16,"dragged-opacity":.08,"theme-kbd":"#212529","theme-on-kbd":"#FFFFFF","theme-code":"#343434","theme-on-code":"#CCCCCC"}}}}}function go(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ft();const t=ft();if(!e)return{...t,isDisabled:!0};const n={};for(const[r,o]of Object.entries(e.themes??{})){const s=o.dark||r==="dark"?t.themes?.dark:t.themes?.light;n[r]=D(s,o)}return D(t,{...e,themes:n})}function ho(e){const t=go(e),n=$(t.defaultTheme),r=$(t.themes),o=h(()=>{const u={};for(const[f,m]of Object.entries(r.value)){const p=u[f]={...m,colors:{...m.colors}};if(t.variations)for(const d of t.variations.colors){const g=p.colors[d];if(g)for(const y of["lighten","darken"]){const T=y==="lighten"?qn:Jn;for(const O of Dt(t.variations[y],1))p.colors[`${d}-${y}-${O}`]=Ft(T(P(g),O))}}for(const d of Object.keys(p.colors)){if(/^on-[a-z]/.test(d)||p.colors[`on-${d}`])continue;const g=`on-${d}`,y=P(p.colors[d]);p.colors[g]=er(y)}}return u}),s=h(()=>o.value[n.value]),a=h(()=>{const u=[];s.value?.dark&&B(u,":root",["color-scheme: dark"]),B(u,":root",dt(s.value));for(const[d,g]of Object.entries(o.value))B(u,`.v-theme--${d}`,[`color-scheme: ${g.dark?"dark":"normal"}`,...dt(g)]);const f=[],m=[],p=new Set(Object.values(o.value).flatMap(d=>Object.keys(d.colors)));for(const d of p)/^on-[a-z]/.test(d)?B(m,`.${d}`,[`color: rgb(var(--v-theme-${d})) !important`]):(B(f,`.bg-${d}`,[`--v-theme-overlay-multiplier: var(--v-theme-${d}-overlay-multiplier)`,`background-color: rgb(var(--v-theme-${d})) !important`,`color: rgb(var(--v-theme-on-${d})) !important`]),B(m,`.text-${d}`,[`color: rgb(var(--v-theme-${d})) !important`]),B(m,`.border-${d}`,[`--v-border-color: var(--v-theme-${d})`]));return u.push(...f,...m),u.map((d,g)=>g===0?d:` ${d}`).join("")});function i(){return{style:[{children:a.value,id:"vuetify-theme-stylesheet",nonce:t.cspNonce||!1}]}}function c(u){if(t.isDisabled)return;const f=u._context.provides.usehead;if(f)if(f.push){const m=f.push(i);S&&Y(a,()=>{m.patch(i)})}else S?(f.addHeadObjs(h(i)),me(()=>f.updateDOM())):f.addHeadObjs(i());else{let p=function(){if(typeof document<"u"&&!m){const d=document.createElement("style");d.type="text/css",d.id="vuetify-theme-stylesheet",t.cspNonce&&d.setAttribute("nonce",t.cspNonce),m=d,document.head.appendChild(m)}m&&(m.innerHTML=a.value)},m=S?document.getElementById("vuetify-theme-stylesheet"):null;S?Y(a,p,{immediate:!0}):p()}}const l=h(()=>t.isDisabled?void 0:`v-theme--${n.value}`);return{install:c,isDisabled:t.isDisabled,name:n,themes:r,current:s,computedThemes:o,themeClasses:l,styles:a,global:{name:n,current:s}}}function Rs(e){A("provideTheme");const t=x(ee,null);if(!t)throw new Error("Could not find Vuetify theme injection");const n=h(()=>e.theme??t.name.value),r=h(()=>t.themes.value[n.value]),o=h(()=>t.isDisabled?void 0:`v-theme--${n.value}`),s={...t,name:n,current:r,themeClasses:o};return _(ee,s),s}function Ls(){A("useTheme");const e=x(ee,null);if(!e)throw new Error("Could not find Vuetify theme injection");return e}function B(e,t,n){e.push(`${t} {
|
||||||
|
`,...n.map(r=>` ${r};
|
||||||
|
`),`}
|
||||||
|
`)}function dt(e){const t=e.dark?2:1,n=e.dark?1:2,r=[];for(const[o,s]of Object.entries(e.colors)){const a=P(s);r.push(`--v-theme-${o}: ${a.r},${a.g},${a.b}`),o.startsWith("on-")||r.push(`--v-theme-${o}-overlay-multiplier: ${Te(s)>.18?t:n}`)}for(const[o,s]of Object.entries(e.variables)){const a=typeof s=="string"&&s.startsWith("#")?P(s):void 0,i=a?`${a.r}, ${a.g}, ${a.b}`:void 0;r.push(`--v-${o}: ${i??s}`)}return r}function po(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"content";const n=Pn(),r=$();if(S){const o=new ResizeObserver(s=>{e?.(s,o),s.length&&(t==="content"?r.value=s[0].contentRect:r.value=s[0].target.getBoundingClientRect())});vt(()=>{o.disconnect()}),Y(()=>n.el,(s,a)=>{a&&(o.unobserve(a),r.value=void 0),s&&o.observe(s)},{flush:"post"})}return{resizeRef:n,contentRect:dn(r)}}const de=Symbol.for("vuetify:layout"),Zt=Symbol.for("vuetify:layout-item"),mt=1e3,Ns=j({overlaps:{type:Array,default:()=>[]},fullHeight:Boolean},"layout"),Bs=j({name:{type:String},order:{type:[Number,String],default:0},absolute:Boolean},"layout-item");function Hs(){const e=x(de);if(!e)throw new Error("[Vuetify] Could not find injected layout");return{getLayoutItem:e.getLayoutItem,mainRect:e.mainRect,mainStyles:e.mainStyles}}function Ys(e){const t=x(de);if(!t)throw new Error("[Vuetify] Could not find injected layout");const n=e.id??`layout-item-${Fe()}`,r=A("useLayoutItem");_(Zt,{id:n});const o=I(!1);mn(()=>o.value=!0),gn(()=>o.value=!1);const{layoutItemStyles:s,layoutItemScrimStyles:a}=t.register(r,{...e,active:h(()=>o.value?!1:e.active.value),id:n});return vt(()=>t.unregister(n)),{layoutItemStyles:s,layoutRect:t.layoutRect,layoutItemScrimStyles:a}}const yo=(e,t,n,r)=>{let o={top:0,left:0,right:0,bottom:0};const s=[{id:"",layer:{...o}}];for(const a of e){const i=t.get(a),c=n.get(a),l=r.get(a);if(!i||!c||!l)continue;const u={...o,[i.value]:parseInt(o[i.value],10)+(l.value?parseInt(c.value,10):0)};s.push({id:a,layer:u}),o=u}return s};function Vs(e){const t=x(de,null),n=h(()=>t?t.rootZIndex.value-100:mt),r=$([]),o=E(new Map),s=E(new Map),a=E(new Map),i=E(new Map),c=E(new Map),{resizeRef:l,contentRect:u}=po(),f=h(()=>{const b=new Map,C=e.overlaps??[];for(const v of C.filter(M=>M.includes(":"))){const[M,w]=v.split(":");if(!r.value.includes(M)||!r.value.includes(w))continue;const L=o.get(M),R=o.get(w),X=s.get(M),Q=s.get(w);!L||!R||!X||!Q||(b.set(w,{position:L.value,amount:parseInt(X.value,10)}),b.set(M,{position:R.value,amount:-parseInt(Q.value,10)}))}return b}),m=h(()=>{const b=[...new Set([...a.values()].map(v=>v.value))].sort((v,M)=>v-M),C=[];for(const v of b){const M=r.value.filter(w=>a.get(w)?.value===v);C.push(...M)}return yo(C,o,s,i)}),p=h(()=>!Array.from(c.values()).some(b=>b.value)),d=h(()=>m.value[m.value.length-1].layer),g=h(()=>({"--v-layout-left":ne(d.value.left),"--v-layout-right":ne(d.value.right),"--v-layout-top":ne(d.value.top),"--v-layout-bottom":ne(d.value.bottom),...p.value?void 0:{transition:"none"}})),y=h(()=>m.value.slice(1).map((b,C)=>{let{id:v}=b;const{layer:M}=m.value[C],w=s.get(v),L=o.get(v);return{id:v,...M,size:Number(w.value),position:L.value}})),T=b=>y.value.find(C=>C.id===b),O=A("createLayout"),$e=I(!1);hn(()=>{$e.value=!0}),_(de,{register:(b,C)=>{let{id:v,order:M,position:w,layoutSize:L,elementSize:R,active:X,disableTransitions:Q,absolute:Qt}=C;a.set(v,M),o.set(v,w),s.set(v,L),i.set(v,X),Q&&c.set(v,Q);const Re=J(Zt,O?.vnode).indexOf(b);Re>-1?r.value.splice(Re,0,v):r.value.push(v);const Le=h(()=>y.value.findIndex(q=>q.id===v)),pe=h(()=>n.value+m.value.length*2-Le.value*2),qt=h(()=>{const q=w.value==="left"||w.value==="right",ye=w.value==="right",en=w.value==="bottom",ve=R.value??L.value,tn=ve===0?"%":"px",Ne={[w.value]:0,zIndex:pe.value,transform:`translate${q?"X":"Y"}(${(X.value?0:-(ve===0?100:ve))*(ye||en?-1:1)}${tn})`,position:Qt.value||n.value!==mt?"absolute":"fixed",...p.value?void 0:{transition:"none"}};if(!$e.value)return Ne;const k=y.value[Le.value];if(!k)throw new Error(`[Vuetify] Could not find layout item "${v}"`);const be=f.value.get(v);return be&&(k[be.position]+=be.amount),{...Ne,height:q?`calc(100% - ${k.top}px - ${k.bottom}px)`:R.value?`${R.value}px`:void 0,left:ye?void 0:`${k.left}px`,right:ye?`${k.right}px`:void 0,top:w.value!=="bottom"?`${k.top}px`:void 0,bottom:w.value!=="top"?`${k.bottom}px`:void 0,width:q?R.value?`${R.value}px`:void 0:`calc(100% - ${k.left}px - ${k.right}px)`}}),Jt=h(()=>({zIndex:pe.value-1}));return{layoutItemStyles:qt,layoutItemScrimStyles:Jt,zIndex:pe}},unregister:b=>{a.delete(b),o.delete(b),s.delete(b),i.delete(b),c.delete(b),r.value=r.value.filter(C=>C!==b)},mainRect:d,mainStyles:g,getLayoutItem:T,items:y,layoutRect:u,rootZIndex:n});const _t=h(()=>["v-layout",{"v-layout--full-height":e.fullHeight}]),Xt=h(()=>({zIndex:t?n.value:void 0,position:t?"relative":void 0,overflow:t?"hidden":void 0}));return{layoutClasses:_t,layoutStyles:Xt,getLayoutItem:T,items:y,layoutRect:u,layoutRef:l}}function vo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{blueprint:t,...n}=e,r=D(t,n),{aliases:o={},components:s={},directives:a={}}=r,i=or(r.defaults),c=oo(r.display,r.ssr),l=ho(r.theme),u=mo(r.icons),f=dr(r.locale),m=no(r.date,f),p=ao(r.goTo,f);return{install:g=>{for(const y in a)g.directive(y,a[y]);for(const y in s)g.component(y,s[y]);for(const y in o)g.component(y,te({...o[y],name:y,aliasName:o[y].name}));if(l.install(g),g.provide(K,i),g.provide(ke,c),g.provide(ee,l),g.provide(Ae,u),g.provide(Z,f),g.provide(jt,m.options),g.provide(ot,m.instance),g.provide(Ut,p),S&&r.ssr)if(g.$nuxt)g.$nuxt.hook("app:suspense:resolve",()=>{c.update()});else{const{mount:y}=g;g.mount=function(){const T=y(...arguments);return pn(()=>c.update()),g.mount=y,T}}Fe.reset(),g.mixin({computed:{$vuetify(){return E({defaults:z.call(this,K),display:z.call(this,ke),theme:z.call(this,ee),icons:z.call(this,Ae),locale:z.call(this,Z),date:z.call(this,ot)})}}})},defaults:i,display:c,theme:l,icons:u,locale:f,date:m,goTo:p}}const bo="3.7.4";vo.version=bo;function z(e){const t=this.$,n=t.parent?.provides??t.vnode.appContext?.provides;if(n&&e in n)return n[e]}export{En as $,Po as A,Uo as B,Mn as C,mr as D,Ho as E,ns as F,vs as G,ys as H,lo as I,bs as J,es as K,ts as L,yn as M,Oo as N,yr as O,J as P,Os as Q,po as R,So as S,Fs as T,S as U,An as V,Yo as W,te as X,hs as Y,as as Z,xo as _,Es as a,Kt as a$,Ms as a0,Zo as a1,_o as a2,Xo as a3,Qo as a4,Ss as a5,ie as a6,qo as a7,Jo as a8,xt as a9,Hs as aA,Ye as aB,No as aC,V as aD,_n as aE,us as aF,Et as aG,fs as aH,ls as aI,we as aJ,$o as aK,Dt as aL,ko as aM,Mo as aN,cs as aO,ds as aP,Xn as aQ,Me as aR,jo as aS,gs as aT,ss as aU,ws as aV,Cs as aW,ks as aX,Ts as aY,St as aZ,de as a_,Rt as aa,zo as ab,Pn as ac,rs as ad,os as ae,ps as af,Ds as ag,Go as ah,On as ai,Oe as aj,Sn as ak,Vo as al,Io as am,Fn as an,Ko as ao,Wo as ap,Eo as aq,As as ar,Ro as as,Bs as at,Ys as au,Ao as av,Lo as aw,We as ax,Ns as ay,Vs as az,j as b,lt as b0,Ps as b1,Gt as b2,vo as b3,is as c,Bo as d,P as e,er as f,$t as g,nr as h,Kn as i,xe as j,ne as k,$s as l,tr as m,Rs as n,Is as o,ms as p,xs as q,kn as r,A as s,Dn as t,Ls as u,ur as v,Fe as w,To as x,Co as y,Fo as z};
|
||||||
287
qbit/vuetorrent/public/assets/webworkerAll-D3jJ_Vry.js
Normal file
287
qbit/vuetorrent/public/assets/webworkerAll-D3jJ_Vry.js
Normal file
@@ -0,0 +1,287 @@
|
|||||||
|
import{E as b,U as Ft,T as Be,a as Ve,a3 as k,a4 as W,a0 as R,ac as E,ad as Ce,ae as Pe,af as Z,ag as pe,D as K,v as A,M as U,w as $,V as ce,ah as Mt,ai as G,aj as ne,a6 as ge,l as j,d as $e,I as H,P as kt,R as me,J as je,c as Y,B as D,F as v,ak as Ut,al as _e,N as ue,am as N,t as xe,x as Wt,G as At,an as zt,m as Ke,a7 as Ye,s as Xe,aa as Ne,q as Gt,o as Ht,p as Dt,a8 as Lt,a9 as It,ab as Ot,ao as Et,ap as fe,n as Re,e as P,aq as Vt}from"./TorrentDetail-CoyYqyCA.js";import{S as ee,c as ie,a as $t,b as jt,B as qe}from"./colorToUniform-C2GHuDhf.js";import{C as O}from"./CanvasPool-BAToQajg.js";import"./ColoredChip.vue_vue_type_script_setup_true_lang-DosC_URk.js";import"./index-BhWmfNB5.js";import"./vue-DFryKk-1.js";import"./vuetify-XtA0Y0Oj.js";class Qe{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let t,r;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,r=globalThis.innerHeight;else{const{clientWidth:i,clientHeight:s}=this._resizeTo;t=i,r=s}this.renderer.resize(t,r),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Qe.extension=b.Application;class Je{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ft.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Be.shared:new Be,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Je.extension=b.Application;class Kt extends Ve{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return k(W,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return k(W,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return k(W,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return k(W,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return k(W,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=!1){this.emit("destroy",this),this.removeAllListeners();for(const t in this.chars)this.chars[t].texture?.destroy();this.chars=null,e&&(this.pages.forEach(t=>t.texture.destroy(!0)),this.pages=null)}}const Fe=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function Ze(n){const e=[];let t=0;for(let r=0;r<Fe.length;r++){const i=`_${Fe[r]}`;e[t++]=n[i]}return t=et(n._fill,e,t),t=Yt(n._stroke,e,t),t=Xt(n.dropShadow,e,t),e.join("-")}function et(n,e,t){return n&&(e[t++]=n.color,e[t++]=n.alpha,e[t++]=n.fill?.styleKey),t}function Yt(n,e,t){return n&&(t=et(n,e,t),e[t++]=n.width,e[t++]=n.alignment,e[t++]=n.cap,e[t++]=n.join,e[t++]=n.miterLimit),t}function Xt(n,e,t){return n&&(e[t++]=n.alpha,e[t++]=n.angle,e[t++]=n.blur,e[t++]=n.distance,e[t++]=R.shared.setValue(n.color).toNumber()),t}const be=class V extends Ve{constructor(e={}){super(),Nt(e);const t={...V.defaultTextStyle,...e};for(const r in t){const i=r;this[i]=t[r]}this.update()}get align(){return this._align}set align(e){this._align=e,this.update()}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update()}get dropShadow(){return this._dropShadow}set dropShadow(e){e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...V.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...V.defaultDropShadow}):null,this.update()}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update()}get fontSize(){return this._fontSize}set fontSize(e){typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update()}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e.toLowerCase(),this.update()}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update()}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update()}get leading(){return this._leading}set leading(e){this._leading=e,this.update()}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update()}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update()}get padding(){return this._padding}set padding(e){this._padding=e,this.update()}get trim(){return this._trim}set trim(e){this._trim=e,this.update()}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update()}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update()}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update()}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update()}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...E.defaultFillStyle,...e},()=>{this._fill=Ce({...this._originalFill},E.defaultFillStyle)})),this._fill=Ce(e===0?"black":e,E.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...E.defaultStrokeStyle,...e},()=>{this._stroke=Pe({...this._originalStroke},E.defaultStrokeStyle)})),this._stroke=Pe(e,E.defaultStrokeStyle),this.update())}_generateKey(){return this._styleKey=Ze(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this)}reset(){const e=V.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new V({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth})}destroy(e=!1){if(this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){const r=typeof e=="boolean"?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(r),this._originalFill?.texture&&this._originalFill.texture.destroy(r),this._stroke?.texture&&this._stroke.texture.destroy(r),this._originalStroke?.texture&&this._originalStroke.texture.destroy(r)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,t){return new Proxy(e,{set:(r,i,s)=>(r[i]=s,t?.(i,s),this.update(),!0)})}_isFillStyle(e){return(e??null)!==null&&!(R.isColorLike(e)||e instanceof Z||e instanceof pe)}};be.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};be.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let I=be;function Nt(n){const e=n;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const t=I.defaultDropShadow;n.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance}}if(e.strokeThickness!==void 0){k(W,"strokeThickness is now a part of stroke");const t=e.stroke;let r={};if(R.isColorLike(t))r.color=t;else if(t instanceof Z||t instanceof pe)r.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))r=t;else throw new Error("Invalid stroke value.");n.stroke={...r,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){k(W,"gradient fill is now a fill pattern: `new FillGradient(...)`");let t;n.fontSize==null?n.fontSize=I.defaultTextStyle.fontSize:typeof n.fontSize=="string"?t=parseInt(n.fontSize,10):t=n.fontSize;const r=new Z(0,0,0,t*1.7),i=e.fillGradientStops.map(s=>R.shared.setValue(s).toNumber());i.forEach((s,a)=>{const o=a/(i.length-1);r.addColorStop(o,s)}),n.fill={fill:r}}}const qt=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function te(n){const e=typeof n.fontSize=="number"?`${n.fontSize}px`:n.fontSize;let t=n.fontFamily;Array.isArray(n.fontFamily)||(t=n.fontFamily.split(","));for(let r=t.length-1;r>=0;r--){let i=t[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&!qt.includes(i)&&(i=`"${i}"`),t[r]=i}return`${n.fontStyle} ${n.fontVariant} ${n.fontWeight} ${e} ${t.join(",")}`}const ae={willReadFrequently:!0},z=class p{static get experimentalLetterSpacingSupported(){let e=p._experimentalLetterSpacingSupported;if(e!==void 0){const t=K.get().getCanvasRenderingContext2D().prototype;e=p._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,r,i,s,a,o,l,h){this.text=e,this.style=t,this.width=r,this.height=i,this.lines=s,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=l,this.fontProperties=h}static measureText(e=" ",t,r=p._canvas,i=t.wordWrap){const s=`${e}:${t.styleKey}`;if(p._measurementCache[s])return p._measurementCache[s];const a=te(t),o=p.measureFont(a);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const l=p.__context;l.font=a;const d=(i?p._wordWrap(e,t,r):e).split(/(?:\r\n|\r|\n)/),c=new Array(d.length);let f=0;for(let y=0;y<d.length;y++){const S=p._measureText(d[y],t.letterSpacing,l);c[y]=S,f=Math.max(f,S)}const g=t._stroke?.width||0;let u=f+g;t.dropShadow&&(u+=t.dropShadow.distance);const m=t.lineHeight||o.fontSize;let x=Math.max(m,o.fontSize+g)+(d.length-1)*(m+t.leading);return t.dropShadow&&(x+=t.dropShadow.distance),new p(e,t,u,x,d,c,m+t.leading,f,o)}static _measureText(e,t,r){let i=!1;p.experimentalLetterSpacingSupported&&(p.experimentalLetterSpacing?(r.letterSpacing=`${t}px`,r.textLetterSpacing=`${t}px`,i=!0):(r.letterSpacing="0px",r.textLetterSpacing="0px"));const s=r.measureText(e);let a=s.width;const o=-s.actualBoundingBoxLeft;let h=s.actualBoundingBoxRight-o;if(a>0)if(i)a-=t,h-=t;else{const d=(p.graphemeSegmenter(e).length-1)*t;a+=d,h+=d}return Math.max(a,h)}static _wordWrap(e,t,r=p._canvas){const i=r.getContext("2d",ae);let s=0,a="",o="";const l=Object.create(null),{letterSpacing:h,whiteSpace:d}=t,c=p._collapseSpaces(d),f=p._collapseNewlines(d);let g=!c;const u=t.wordWrapWidth+h,m=p._tokenize(e);for(let x=0;x<m.length;x++){let _=m[x];if(p._isNewline(_)){if(!f){o+=p._addLine(a),g=!c,a="",s=0;continue}_=" "}if(c){const S=p.isBreakingSpace(_),w=p.isBreakingSpace(a[a.length-1]);if(S&&w)continue}const y=p._getFromCache(_,h,l,i);if(y>u)if(a!==""&&(o+=p._addLine(a),a="",s=0),p.canBreakWords(_,t.breakWords)){const S=p.wordWrapSplit(_);for(let w=0;w<S.length;w++){let B=S[w],F=B,C=1;for(;S[w+C];){const M=S[w+C];if(!p.canBreakChars(F,M,_,w,t.breakWords))B+=M;else break;F=M,C++}w+=C-1;const T=p._getFromCache(B,h,l,i);T+s>u&&(o+=p._addLine(a),g=!1,a="",s=0),a+=B,s+=T}}else{a.length>0&&(o+=p._addLine(a),a="",s=0);const S=x===m.length-1;o+=p._addLine(_,!S),g=!1,a="",s=0}else y+s>u&&(g=!1,o+=p._addLine(a),a="",s=0),(a.length>0||!p.isBreakingSpace(_)||g)&&(a+=_,s+=y)}return o+=p._addLine(a,!1),o}static _addLine(e,t=!0){return e=p._trimRight(e),e=t?`${e}
|
||||||
|
`:e,e}static _getFromCache(e,t,r,i){let s=r[e];return typeof s!="number"&&(s=p._measureText(e,t,i)+t,r[e]=s),s}static _collapseSpaces(e){return e==="normal"||e==="pre-line"}static _collapseNewlines(e){return e==="normal"}static _trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const r=e[t];if(!p.isBreakingSpace(r))break;e=e.slice(0,-1)}return e}static _isNewline(e){return typeof e!="string"?!1:p._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:p._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){const t=[];let r="";if(typeof e!="string")return t;for(let i=0;i<e.length;i++){const s=e[i],a=e[i+1];if(p.isBreakingSpace(s,a)||p._isNewline(s)){r!==""&&(t.push(r),r=""),t.push(s);continue}r+=s}return r!==""&&t.push(r),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,r,i,s){return!0}static wordWrapSplit(e){return p.graphemeSegmenter(e)}static measureFont(e){if(p._fonts[e])return p._fonts[e];const t=p._context;t.font=e;const r=t.measureText(p.METRICS_STRING+p.BASELINE_SYMBOL),i={ascent:r.actualBoundingBoxAscent,descent:r.actualBoundingBoxDescent,fontSize:r.actualBoundingBoxAscent+r.actualBoundingBoxDescent};return p._fonts[e]=i,i}static clearMetrics(e=""){e?delete p._fonts[e]:p._fonts={}}static get _canvas(){if(!p.__canvas){let e;try{const t=new OffscreenCanvas(0,0);if(t.getContext("2d",ae)?.measureText)return p.__canvas=t,t;e=K.get().createCanvas()}catch{e=K.get().createCanvas()}e.width=e.height=10,p.__canvas=e}return p.__canvas}static get _context(){return p.__context||(p.__context=p._canvas.getContext("2d",ae)),p.__context}};z.METRICS_STRING="|ÉqÅ";z.BASELINE_SYMBOL="M";z.BASELINE_MULTIPLIER=1.4;z.HEIGHT_MULTIPLIER=2;z.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter=="function"){const n=new Intl.Segmenter;return e=>[...n.segment(e)].map(t=>t.segment)}return n=>[...n]})();z.experimentalLetterSpacing=!1;z._fonts={};z._newlines=[10,13];z._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];z._measurementCache={};let L=z;function re(n,e){if(n.texture===A.WHITE&&!n.fill)return R.shared.setValue(n.color).setAlpha(n.alpha??1).toHexa();if(n.fill){if(n.fill instanceof pe){const t=n.fill,r=e.createPattern(t.texture.source.resource,"repeat"),i=t.transform.copyTo(U.shared);return i.scale(t.texture.frame.width,t.texture.frame.height),r.setTransform(i),r}else if(n.fill instanceof Z){const t=n.fill;if(t.type==="linear"){const r=e.createLinearGradient(t.x0,t.y0,t.x1,t.y1);return t.gradientStops.forEach(i=>{r.addColorStop(i.offset,R.shared.setValue(i.color).toHex())}),r}}}else{const t=e.createPattern(n.texture.source.resource,"repeat"),r=n.matrix.copyTo(U.shared);return r.scale(n.texture.frame.width,n.texture.frame.height),t.setTransform(r),t}return $("FillStyle not recognised",n),"red"}function tt(n){if(n==="")return[];typeof n=="string"&&(n=[n]);const e=[];for(let t=0,r=n.length;t<r;t++){const i=n[t];if(Array.isArray(i)){if(i.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);if(i[0].length===0||i[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");const s=i[0].charCodeAt(0),a=i[1].charCodeAt(0);if(a<s)throw new Error("[BitmapFont]: Invalid character range.");for(let o=s,l=a;o<=l;o++)e.push(String.fromCharCode(o))}else e.push(...Array.from(i))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}const rt=class it extends Kt{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentPageIndex=-1,this._skipKerning=!1;const t={...it.defaultOptions,...e};this._textureSize=t.textureSize,this._mipmap=t.mipmap;const r=t.style.clone();t.overrideFill&&(r._fill.color=16777215,r._fill.alpha=1,r._fill.texture=A.WHITE,r._fill.fill=null),this.applyFillAsTint=t.overrideFill;const i=r.fontSize;r.fontSize=this.baseMeasurementFontSize;const s=te(r);t.overrideSize?r._stroke&&(r._stroke.width*=this.baseRenderedFontSize/i):r.fontSize=this.baseRenderedFontSize=i,this._style=r,this._skipKerning=t.skipKerning??!1,this.resolution=t.resolution??1,this._padding=t.padding??4,this.fontMetrics=L.measureFont(s),this.lineHeight=r.lineHeight||this.fontMetrics.fontSize||r.fontSize}ensureCharacters(e){const t=tt(e).filter(x=>!this._currentChars.includes(x)).filter((x,_,y)=>y.indexOf(x)===_);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let r;this._currentPageIndex===-1?r=this._nextPage():r=this.pages[this._currentPageIndex];let{canvas:i,context:s}=r.canvasAndContext,a=r.texture.source;const o=this._style;let l=this._currentX,h=this._currentY;const d=this.baseRenderedFontSize/this.baseMeasurementFontSize,c=this._padding*d;let f=0,g=!1;const u=i.width/this.resolution,m=i.height/this.resolution;for(let x=0;x<t.length;x++){const _=t[x],y=L.measureText(_,o,i,!1);y.lineHeight=y.height;const S=y.width*d,w=Math.ceil((o.fontStyle==="italic"?2:1)*S),B=y.height*d,F=w+c*2,C=B+c*2;if(g=!1,_!==`
|
||||||
|
`&&_!=="\r"&&_!==" "&&_!==" "&&(g=!0,f=Math.ceil(Math.max(C,f))),l+F>u&&(h+=f,f=C,l=0,h+f>m)){a.update();const M=this._nextPage();i=M.canvasAndContext.canvas,s=M.canvasAndContext.context,a=M.texture.source,h=0}const T=S/d-(o.dropShadow?.distance??0)-(o._stroke?.width??0);if(this.chars[_]={id:_.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:T,kerning:{}},g){this._drawGlyph(s,y,l+c,h+c,d,o);const M=a.width*d,X=a.height*d,se=new ce(l/M*a.width,h/X*a.height,F/M*a.width,C/X*a.height);this.chars[_].texture=new A({source:a,frame:se}),l+=Math.ceil(F)}}a.update(),this._currentX=l,this._currentY=h,this._skipKerning&&this._applyKerning(t,s)}get pageTextures(){return k(W,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(e,t){const r=this._measureCache;for(let i=0;i<e.length;i++){const s=e[i];for(let a=0;a<this._currentChars.length;a++){const o=this._currentChars[a];let l=r[s];l||(l=r[s]=t.measureText(s).width);let h=r[o];h||(h=r[o]=t.measureText(o).width);let d=t.measureText(s+o).width,c=d-(l+h);c&&(this.chars[s].kerning[o]=c),d=t.measureText(s+o).width,c=d-(l+h),c&&(this.chars[o].kerning[s]=c)}}}_nextPage(){this._currentPageIndex++;const e=this.resolution,t=O.getOptimalCanvasAndContext(this._textureSize,this._textureSize,e);this._setupContext(t.context,this._style,e);const r=e*(this.baseRenderedFontSize/this.baseMeasurementFontSize),i=new A({source:new Mt({resource:t.canvas,resolution:r,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})}),s={canvasAndContext:t,texture:i};return this.pages[this._currentPageIndex]=s,s}_setupContext(e,t,r){t.fontSize=this.baseRenderedFontSize,e.scale(r,r),e.font=te(t),t.fontSize=this.baseMeasurementFontSize,e.textBaseline=t.textBaseline;const i=t._stroke,s=i?.width??0;if(i&&(e.lineWidth=s,e.lineJoin=i.join,e.miterLimit=i.miterLimit,e.strokeStyle=re(i,e)),t._fill&&(e.fillStyle=re(t._fill,e)),t.dropShadow){const a=t.dropShadow,o=R.shared.setValue(a.color).toArray(),l=a.blur*r,h=a.distance*r;e.shadowColor=`rgba(${o[0]*255},${o[1]*255},${o[2]*255},${a.alpha})`,e.shadowBlur=l,e.shadowOffsetX=Math.cos(a.angle)*h,e.shadowOffsetY=Math.sin(a.angle)*h}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0}_drawGlyph(e,t,r,i,s,a){const o=t.text,l=t.fontProperties,d=(a._stroke?.width??0)*s,c=r+d/2,f=i-d/2,g=l.descent*s,u=t.lineHeight*s;a.stroke&&d&&e.strokeText(o,c,f+u-g),a._fill&&e.fillText(o,c,f+u-g)}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){const{canvasAndContext:t,texture:r}=this.pages[e];O.returnCanvasAndContext(t),r.destroy(!0)}this.pages=null}};rt.defaultOptions={textureSize:512,style:new I,mipmap:!0};let Me=rt;function st(n,e,t,r){const i={width:0,height:0,offsetY:0,scale:e.fontSize/t.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};i.offsetY=t.baseLineOffset;let s=i.lines[0],a=null,o=!0;const l={spaceWord:!1,width:0,start:0,index:0,positions:[],chars:[]},h=u=>{const m=s.width;for(let x=0;x<l.index;x++){const _=u.positions[x];s.chars.push(u.chars[x]),s.charPositions.push(_+m)}s.width+=u.width,o=!1,l.width=0,l.index=0,l.chars.length=0},d=()=>{let u=s.chars.length-1;if(r){let m=s.chars[u];for(;m===" ";)s.width-=t.chars[m].xAdvance,m=s.chars[--u]}i.width=Math.max(i.width,s.width),s={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},o=!0,i.lines.push(s),i.height+=t.lineHeight},c=t.baseMeasurementFontSize/e.fontSize,f=e.letterSpacing*c,g=e.wordWrapWidth*c;for(let u=0;u<n.length+1;u++){let m;const x=u===n.length;x||(m=n[u]);const _=t.chars[m]||t.chars[" "];if(/(?:\s)/.test(m)||m==="\r"||m===`
|
||||||
|
`||x){if(!o&&e.wordWrap&&s.width+l.width-f>g?(d(),h(l),x||s.charPositions.push(0)):(l.start=s.width,h(l),x||s.charPositions.push(0)),m==="\r"||m===`
|
||||||
|
`)s.width!==0&&d();else if(!x){const B=_.xAdvance+(_.kerning[a]||0)+f;s.width+=B,s.spaceWidth=B,s.spacesIndex.push(s.charPositions.length),s.chars.push(m)}}else{const w=_.kerning[a]||0,B=_.xAdvance+w+f;l.positions[l.index++]=l.width+w,l.chars.push(m),l.width+=B}a=m}return d(),e.align==="center"?Qt(i):e.align==="right"?Jt(i):e.align==="justify"&&Zt(i),i}function Qt(n){for(let e=0;e<n.lines.length;e++){const t=n.lines[e],r=n.width/2-t.width/2;for(let i=0;i<t.charPositions.length;i++)t.charPositions[i]+=r}}function Jt(n){for(let e=0;e<n.lines.length;e++){const t=n.lines[e],r=n.width-t.width;for(let i=0;i<t.charPositions.length;i++)t.charPositions[i]+=r}}function Zt(n){const e=n.width;for(let t=0;t<n.lines.length;t++){const r=n.lines[t];let i=0,s=r.spacesIndex[i++],a=0;const o=r.spacesIndex.length,h=(e-r.width)/o;for(let d=0;d<r.charPositions.length;d++)d===s&&(s=r.spacesIndex[i++],a+=h),r.charPositions[d]+=a}}let q=0;class er{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1}}getFont(e,t){let r=`${t.fontFamily}-bitmap`,i=!0;if(t._fill.fill&&!t._stroke)r+=t._fill.fill.styleKey,i=!1;else if(t._stroke||t.dropShadow){let a=t.styleKey;a=a.substring(0,a.lastIndexOf("-")),r=`${a}-bitmap`,i=!1}if(!G.has(r)){const a=new Me({style:t,overrideFill:i,overrideSize:!0,...this.defaultOptions});q++,q>50&&$("BitmapText",`You have dynamically created ${q} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),a.once("destroy",()=>{q--,G.remove(r)}),G.set(r,a)}const s=G.get(r);return s.ensureCharacters?.(e),s}getLayout(e,t,r=!0){const i=this.getFont(e,t);return st([...e],t,i,r)}measureText(e,t,r=!0){return this.getLayout(e,t,r)}install(...e){let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:e[2]?.chars,resolution:e[2]?.resolution,padding:e[2]?.padding,skipKerning:e[2]?.skipKerning},k(W,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));const r=t?.name;if(!r)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};const i=t.style,s=i instanceof I?i:new I(i),a=s._fill.fill!==null&&s._fill.fill!==void 0,o=new Me({style:s,overrideFill:a,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:!1}),l=tt(t.chars);return o.ensureCharacters(l.join("")),G.set(`${r}-bitmap`,o),o.once("destroy",()=>G.remove(`${r}-bitmap`)),o}uninstall(e){const t=`${e}-bitmap`,r=G.get(t);r&&r.destroy()}}const tr=new er;class nt{constructor(e){this._renderer=e}push(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:t,filterEffect:e})}pop(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(e){e.action==="pushFilter"?this._renderer.filter.push(e):e.action==="popFilter"&&this._renderer.filter.pop()}destroy(){this._renderer=null}}nt.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"filter"};const rr=new U;function ir(n,e){e.clear(),at(n,e),e.isValid||e.set(0,0,0,0);const t=n.renderGroup||n.parentRenderGroup;return e.applyMatrix(t.worldTransform),e}function at(n,e){if(n.localDisplayStatus!==7||!n.measurable)return;const t=!!n.effects.length;let r=e;if((n.renderGroup||t)&&(r=ne.get().clear()),n.boundsArea)e.addRect(n.boundsArea,n.worldTransform);else{if(n.renderPipeId){const s=n.bounds;r.addFrame(s.minX,s.minY,s.maxX,s.maxY,n.groupTransform)}const i=n.children;for(let s=0;s<i.length;s++)at(i[s],r)}if(t){let i=!1;for(let s=0;s<n.effects.length;s++)n.effects[s].addBounds&&(i||(i=!0,r.applyMatrix(n.parentRenderGroup.worldTransform)),n.effects[s].addBounds(r,!0));i&&(r.applyMatrix(n.parentRenderGroup.worldTransform.copyTo(rr).invert()),e.addBounds(r,n.relativeGroupTransform)),e.addBounds(r),ne.return(r)}else n.renderGroup&&(e.addBounds(r,n.relativeGroupTransform),ne.return(r))}function sr(n,e){e.clear();const t=e.matrix;for(let r=0;r<n.length;r++){const i=n[r];i.globalDisplayStatus<7||(e.matrix=i.worldTransform,e.addBounds(i.bounds))}return e.matrix=t,e}const nr=new ge({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:2*4,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])});class ot{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new j({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new $e({}),this.renderer=e}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){const t=this.renderer,r=e.filterEffect.filters;this._filterStack[this._filterStackIndex]||(this._filterStack[this._filterStackIndex]=this._getFilterData());const i=this._filterStack[this._filterStackIndex];if(this._filterStackIndex++,r.length===0){i.skip=!0;return}const s=i.bounds;if(e.renderables?sr(e.renderables,s):e.filterEffect.filterArea?(s.clear(),s.addRect(e.filterEffect.filterArea),s.applyMatrix(e.container.worldTransform)):ir(e.container,s),e.container){const u=(e.container.renderGroup||e.container.parentRenderGroup).cacheToLocalTransform;u&&s.applyMatrix(u)}const a=t.renderTarget.renderTarget.colorTexture.source;let o=1/0,l=0,h=!0,d=!1,c=!1,f=!0;for(let g=0;g<r.length;g++){const u=r[g];if(o=Math.min(o,u.resolution==="inherit"?a._resolution:u.resolution),l+=u.padding,u.antialias==="off"?h=!1:u.antialias==="inherit"&&h&&(h=a.antialias),u.clipToViewport||(f=!1),!!!(u.compatibleRenderers&t.type)){c=!1;break}if(u.blendRequired&&!(t.backBuffer?.useBackBuffer??!0)){$("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),c=!1;break}c=u.enabled||c,d||(d=u.blendRequired)}if(!c){i.skip=!0;return}if(f){const g=t.renderTarget.rootViewPort,u=t.renderTarget.renderTarget.resolution;s.fitBounds(0,g.width/u,0,g.height/u)}if(s.scale(o).ceil().scale(1/o).pad(l|0),!s.isPositive){i.skip=!0;return}i.skip=!1,i.bounds=s,i.blendRequired=d,i.container=e.container,i.filterEffect=e.filterEffect,i.previousRenderSurface=t.renderTarget.renderSurface,i.inputTexture=H.getOptimalTexture(s.width,s.height,o,h),t.renderTarget.bind(i.inputTexture,!0),t.globalUniforms.push({offset:s})}pop(){const e=this.renderer;this._filterStackIndex--;const t=this._filterStack[this._filterStackIndex];if(t.skip)return;this._activeFilterData=t;const r=t.inputTexture,i=t.bounds;let s=A.EMPTY;if(e.renderTarget.finishRenderPass(),t.blendRequired){const o=this._filterStackIndex>0?this._filterStack[this._filterStackIndex-1].bounds:null,l=e.renderTarget.getRenderTarget(t.previousRenderSurface);s=this.getBackTexture(l,i,o)}t.backTexture=s;const a=t.filterEffect.filters;if(this._globalFilterBindGroup.setResource(r.source.style,2),this._globalFilterBindGroup.setResource(s.source,3),e.globalUniforms.pop(),a.length===1)a[0].apply(this,r,t.previousRenderSurface,!1),H.returnTexture(r);else{let o=t.inputTexture,l=H.getOptimalTexture(i.width,i.height,o.source._resolution,!1),h=0;for(h=0;h<a.length-1;++h){a[h].apply(this,o,l,!0);const c=o;o=l,l=c}a[h].apply(this,o,t.previousRenderSurface,!1),H.returnTexture(o),H.returnTexture(l)}t.blendRequired&&H.returnTexture(s)}getBackTexture(e,t,r){const i=e.colorTexture.source._resolution,s=H.getOptimalTexture(t.width,t.height,i,!1);let a=t.minX,o=t.minY;r&&(a-=r.minX,o-=r.minY),a=Math.floor(a*i),o=Math.floor(o*i);const l=Math.ceil(t.width*i),h=Math.ceil(t.height*i);return this.renderer.renderTarget.copyToTexture(e,s,{x:a,y:o},{width:l,height:h},{x:0,y:0}),s}applyFilter(e,t,r,i){const s=this.renderer,a=this._filterStack[this._filterStackIndex],o=a.bounds,l=kt.shared,d=a.previousRenderSurface===r;let c=this.renderer.renderTarget.rootRenderTarget.colorTexture.source._resolution,f=this._filterStackIndex-1;for(;f>0&&this._filterStack[f].skip;)--f;f>0&&(c=this._filterStack[f].inputTexture.source._resolution);const g=this._filterGlobalUniforms,u=g.uniforms,m=u.uOutputFrame,x=u.uInputSize,_=u.uInputPixel,y=u.uInputClamp,S=u.uGlobalFrame,w=u.uOutputTexture;if(d){let C=this._filterStackIndex;for(;C>0;){C--;const T=this._filterStack[this._filterStackIndex-1];if(!T.skip){l.x=T.bounds.minX,l.y=T.bounds.minY;break}}m[0]=o.minX-l.x,m[1]=o.minY-l.y}else m[0]=0,m[1]=0;m[2]=t.frame.width,m[3]=t.frame.height,x[0]=t.source.width,x[1]=t.source.height,x[2]=1/x[0],x[3]=1/x[1],_[0]=t.source.pixelWidth,_[1]=t.source.pixelHeight,_[2]=1/_[0],_[3]=1/_[1],y[0]=.5*_[2],y[1]=.5*_[3],y[2]=t.frame.width*x[2]-.5*_[2],y[3]=t.frame.height*x[3]-.5*_[3];const B=this.renderer.renderTarget.rootRenderTarget.colorTexture;S[0]=l.x*c,S[1]=l.y*c,S[2]=B.source.width*c,S[3]=B.source.height*c;const F=this.renderer.renderTarget.getRenderTarget(r);if(s.renderTarget.bind(r,!!i),r instanceof A?(w[0]=r.frame.width,w[1]=r.frame.height):(w[0]=F.width,w[1]=F.height),w[2]=F.isRoot?-1:1,g.update(),s.renderPipes.uniformBatch){const C=s.renderPipes.uniformBatch.getUboResource(g);this._globalFilterBindGroup.setResource(C,0)}else this._globalFilterBindGroup.setResource(g,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,s.encoder.draw({geometry:nr,shader:e,state:e._state,topology:"triangle-list"}),s.type===me.WEBGL&&s.renderTarget.finishRenderPass()}_getFilterData(){return{skip:!1,inputTexture:null,bounds:new je,container:null,filterEffect:null,blendRequired:!1,previousRenderSurface:null}}calculateSpriteMatrix(e,t){const r=this._activeFilterData,i=e.set(r.inputTexture._source.width,0,0,r.inputTexture._source.height,r.bounds.minX,r.bounds.minY),s=t.worldTransform.copyTo(U.shared);return s.invert(),i.prepend(s),i.scale(1/t.texture.frame.width,1/t.texture.frame.height),i.translate(t.anchor.x,t.anchor.y),i}}ot.extension={type:[b.WebGLSystem,b.WebGPUSystem],name:"filter"};const lt=class dt extends ge{constructor(...e){let t=e[0]??{};t instanceof Float32Array&&(k(W,"use new MeshGeometry({ positions, uvs, indices }) instead"),t={positions:t,uvs:e[1],indices:e[2]}),t={...dt.defaultOptions,...t};const r=t.positions||new Float32Array([0,0,1,0,1,1,0,1]),i=t.uvs||new Float32Array([0,0,1,0,1,1,0,1]),s=t.indices||new Uint32Array([0,1,2,0,2,3]),a=t.shrinkBuffersToFit,o=new Y({data:r,label:"attribute-mesh-positions",shrinkToFit:a,usage:D.VERTEX|D.COPY_DST}),l=new Y({data:i,label:"attribute-mesh-uvs",shrinkToFit:a,usage:D.VERTEX|D.COPY_DST}),h=new Y({data:s,label:"index-mesh-buffer",shrinkToFit:a,usage:D.INDEX|D.COPY_DST});super({attributes:{aPosition:{buffer:o,format:"float32x2",stride:2*4,offset:0},aUV:{buffer:l,format:"float32x2",stride:2*4,offset:0}},indexBuffer:h,topology:t.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(e){this.attributes.aPosition.buffer.data=e}get uvs(){return this.attributes.aUV.buffer.data}set uvs(e){this.attributes.aUV.buffer.data=e}get indices(){return this.indexBuffer.data}set indices(e){this.indexBuffer.data=e}};lt.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};let ye=lt;function ar(n){const e=n._stroke,t=n._fill,i=[`div { ${[`color: ${R.shared.setValue(t.color).toHex()}`,`font-size: ${n.fontSize}px`,`font-family: ${n.fontFamily}`,`font-weight: ${n.fontWeight}`,`font-style: ${n.fontStyle}`,`font-variant: ${n.fontVariant}`,`letter-spacing: ${n.letterSpacing}px`,`text-align: ${n.align}`,`padding: ${n.padding}px`,`white-space: ${n.whiteSpace==="pre"&&n.wordWrap?"pre-wrap":n.whiteSpace}`,...n.lineHeight?[`line-height: ${n.lineHeight}px`]:[],...n.wordWrap?[`word-wrap: ${n.breakWords?"break-all":"break-word"}`,`max-width: ${n.wordWrapWidth}px`]:[],...e?[ct(e)]:[],...n.dropShadow?[ht(n.dropShadow)]:[],...n.cssOverrides].join(";")} }`];return or(n.tagStyles,i),i.join(" ")}function ht(n){const e=R.shared.setValue(n.color).setAlpha(n.alpha).toHexa(),t=Math.round(Math.cos(n.angle)*n.distance),r=Math.round(Math.sin(n.angle)*n.distance),i=`${t}px ${r}px`;return n.blur>0?`text-shadow: ${i} ${n.blur}px ${e}`:`text-shadow: ${i} ${e}`}function ct(n){return[`-webkit-text-stroke-width: ${n.width}px`,`-webkit-text-stroke-color: ${R.shared.setValue(n.color).toHex()}`,`text-stroke-width: ${n.width}px`,`text-stroke-color: ${R.shared.setValue(n.color).toHex()}`,"paint-order: stroke"].join(";")}const ke={fontSize:"font-size: {{VALUE}}px",fontFamily:"font-family: {{VALUE}}",fontWeight:"font-weight: {{VALUE}}",fontStyle:"font-style: {{VALUE}}",fontVariant:"font-variant: {{VALUE}}",letterSpacing:"letter-spacing: {{VALUE}}px",align:"text-align: {{VALUE}}",padding:"padding: {{VALUE}}px",whiteSpace:"white-space: {{VALUE}}",lineHeight:"line-height: {{VALUE}}px",wordWrapWidth:"max-width: {{VALUE}}px"},Ue={fill:n=>`color: ${R.shared.setValue(n).toHex()}`,breakWords:n=>`word-wrap: ${n?"break-all":"break-word"}`,stroke:ct,dropShadow:ht};function or(n,e){for(const t in n){const r=n[t],i=[];for(const s in r)Ue[s]?i.push(Ue[s](r[s])):ke[s]&&i.push(ke[s].replace("{{VALUE}}",r[s]));e.push(`${t} { ${i.join(";")} }`)}}class Se extends I{constructor(e={}){super(e),this._cssOverrides=[],this.cssOverrides??(this.cssOverrides=e.cssOverrides),this.tagStyles=e.tagStyles??{}}set cssOverrides(e){this._cssOverrides=e instanceof Array?e:[e],this.update()}get cssOverrides(){return this._cssOverrides}_generateKey(){return this._styleKey=Ze(this)+this._cssOverrides.join("-"),this._styleKey}update(){this._cssStyle=null,super.update()}clone(){return new Se({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow?{...this.dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides})}get cssStyle(){return this._cssStyle||(this._cssStyle=ar(this)),this._cssStyle}addOverride(...e){const t=e.filter(r=>!this.cssOverrides.includes(r));t.length>0&&(this.cssOverrides.push(...t),this.update())}removeOverride(...e){const t=e.filter(r=>this.cssOverrides.includes(r));t.length>0&&(this.cssOverrides=this.cssOverrides.filter(r=>!t.includes(r)),this.update())}set fill(e){typeof e!="string"&&typeof e!="number"&&$("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=e}set stroke(e){e&&typeof e!="string"&&typeof e!="number"&&$("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=e}}const We="http://www.w3.org/2000/svg",Ae="http://www.w3.org/1999/xhtml";class ut{constructor(){this.svgRoot=document.createElementNS(We,"svg"),this.foreignObject=document.createElementNS(We,"foreignObject"),this.domElement=document.createElementNS(Ae,"div"),this.styleElement=document.createElementNS(Ae,"style"),this.image=new Image;const{foreignObject:e,svgRoot:t,styleElement:r,domElement:i}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(r),e.appendChild(i)}}let ze;function lr(n,e,t,r){r||(r=ze||(ze=new ut));const{domElement:i,styleElement:s,svgRoot:a}=r;i.innerHTML=`<style>${e.cssStyle};</style><div style='padding:0'>${n}</div>`,i.setAttribute("style","transform-origin: top left; display: inline-block"),t&&(s.textContent=t),document.body.appendChild(a);const o=i.getBoundingClientRect();a.remove();const l=e.padding*2;return{width:o.width-l,height:o.height-l}}class ft{constructor(e,t){this.state=ee.for2d(),this._graphicsBatchesHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this.renderer=e,this._adaptor=t,this._adaptor.init(),this.renderer.renderableGC.addManagedHash(this,"_graphicsBatchesHash")}validateRenderable(e){const t=e.context,r=!!this._graphicsBatchesHash[e.uid],i=this.renderer.graphicsContext.updateGpuContext(t);return!!(i.isBatchable||r!==i.isBatchable)}addRenderable(e,t){const r=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),r.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e))}updateRenderable(e){const t=this._graphicsBatchesHash[e.uid];if(t)for(let r=0;r<t.length;r++){const i=t[r];i._batcher.updateElement(i)}}destroyRenderable(e){this._graphicsBatchesHash[e.uid]&&this._removeBatchForRenderable(e.uid),e.off("destroyed",this._destroyRenderableBound)}execute(e){if(!e.isRenderable)return;const t=this.renderer,r=e.context;if(!t.graphicsContext.getGpuContext(r).batches.length)return;const s=r.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;const a=s.resources.localUniforms.uniforms;a.uTransformMatrix=e.groupTransform,a.uRound=t._roundPixels|e._roundPixels,ie(e.groupColorAlpha,a.uColor,0),this._adaptor.execute(this,e)}_rebuild(e){const t=!!this._graphicsBatchesHash[e.uid],r=this.renderer.graphicsContext.updateGpuContext(e.context);t&&this._removeBatchForRenderable(e.uid),r.isBatchable&&this._initBatchesForRenderable(e),e.batched=r.isBatchable}_addToBatcher(e,t){const r=this.renderer.renderPipes.batch,i=this._getBatchesForRenderable(e);for(let s=0;s<i.length;s++){const a=i[s];r.addToBatch(a,t)}}_getBatchesForRenderable(e){return this._graphicsBatchesHash[e.uid]||this._initBatchesForRenderable(e)}_initBatchesForRenderable(e){const t=e.context,r=this.renderer.graphicsContext.getGpuContext(t),i=this.renderer._roundPixels|e._roundPixels,s=r.batches.map(a=>{const o=v.get(Ut);return a.copyTo(o),o.renderable=e,o.roundPixels=i,o});return this._graphicsBatchesHash[e.uid]===void 0&&e.on("destroyed",this._destroyRenderableBound),this._graphicsBatchesHash[e.uid]=s,s}_removeBatchForRenderable(e){this._graphicsBatchesHash[e].forEach(t=>{v.return(t)}),this._graphicsBatchesHash[e]=null}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;for(const e in this._graphicsBatchesHash)this._removeBatchForRenderable(e);this._graphicsBatchesHash=null}}ft.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"graphics"};const pt=class gt extends ye{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(k(W,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),t={width:t,height:e[1],verticesX:e[2],verticesY:e[3]}),this.build(t)}build(e){e={...gt.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;const t=this.verticesX*this.verticesY,r=[],i=[],s=[],a=this.verticesX-1,o=this.verticesY-1,l=this.width/a,h=this.height/o;for(let c=0;c<t;c++){const f=c%this.verticesX,g=c/this.verticesX|0;r.push(f*l,g*h),i.push(f/a,g/o)}const d=a*o;for(let c=0;c<d;c++){const f=c%a,g=c/a|0,u=g*this.verticesX+f,m=g*this.verticesX+f+1,x=(g+1)*this.verticesX+f,_=(g+1)*this.verticesX+f+1;s.push(u,m,x,m,_,x)}this.buffers[0].data=new Float32Array(r),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint32Array(s),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}};pt.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};let dr=pt;class we{constructor(){this.batcherName="default",this.packAsQuad=!1,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(e){this._topology=e}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}get uvs(){const t=this.geometry.getBuffer("aUV"),r=t.data;let i=r;const s=this.texture.textureMatrix;return s.isSimple||(i=this._transformedUvs,(this._textureMatrixUpdateId!==s._updateID||this._uvUpdateId!==t._updateID)&&((!i||i.length<r.length)&&(i=this._transformedUvs=new Float32Array(r.length)),this._textureMatrixUpdateId=s._updateID,this._uvUpdateId=t._updateID,s.multiplyUvs(r,i))),i}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}}class mt{constructor(e,t){this.localUniforms=new j({uTransformMatrix:{value:new U,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new $e({0:this.localUniforms}),this._meshDataHash=Object.create(null),this._gpuBatchableMeshHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this.renderer=e,this._adaptor=t,this._adaptor.init(),e.renderableGC.addManagedHash(this,"_gpuBatchableMeshHash"),e.renderableGC.addManagedHash(this,"_meshDataHash")}validateRenderable(e){const t=this._getMeshData(e),r=t.batched,i=e.batched;if(t.batched=i,r!==i)return!0;if(i){const s=e._geometry;if(s.indices.length!==t.indexSize||s.positions.length!==t.vertexSize)return t.indexSize=s.indices.length,t.vertexSize=s.positions.length,!0;const a=this._getBatchableMesh(e);return!a._batcher.checkAndUpdateTexture(a,e.texture)}return!1}addRenderable(e,t){const r=this.renderer.renderPipes.batch,{batched:i}=this._getMeshData(e);if(i){const s=this._getBatchableMesh(e);s.texture=e._texture,s.geometry=e._geometry,r.addToBatch(s,t)}else r.break(t),t.add(e)}updateRenderable(e){if(e.batched){const t=this._gpuBatchableMeshHash[e.uid];t.texture=e._texture,t.geometry=e._geometry,t._batcher.updateElement(t)}}destroyRenderable(e){this._meshDataHash[e.uid]=null;const t=this._gpuBatchableMeshHash[e.uid];t&&(v.return(t),this._gpuBatchableMeshHash[e.uid]=null),e.off("destroyed",this._destroyRenderableBound)}execute(e){if(!e.isRenderable)return;e.state.blendMode=_e(e.groupBlendMode,e.texture._source);const t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),ie(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e)}_getMeshData(e){return this._meshDataHash[e.uid]||this._initMeshData(e)}_initMeshData(e){return this._meshDataHash[e.uid]={batched:e.batched,indexSize:e._geometry.indices?.length,vertexSize:e._geometry.positions?.length},e.on("destroyed",this._destroyRenderableBound),this._meshDataHash[e.uid]}_getBatchableMesh(e){return this._gpuBatchableMeshHash[e.uid]||this._initBatchableMesh(e)}_initBatchableMesh(e){const t=v.get(we);return t.renderable=e,t.texture=e._texture,t.transform=e.groupTransform,t.roundPixels=this.renderer._roundPixels|e._roundPixels,this._gpuBatchableMeshHash[e.uid]=t,t}destroy(){for(const e in this._gpuBatchableMeshHash)this._gpuBatchableMeshHash[e]&&v.return(this._gpuBatchableMeshHash[e]);this._gpuBatchableMeshHash=null,this._meshDataHash=null,this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}}mt.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"mesh"};class hr{execute(e,t){const r=e.state,i=e.renderer,s=t.shader||e.defaultShader;s.resources.uTexture=t.texture._source,s.resources.uniforms=e.localUniforms;const a=i.gl,o=e.getBuffers(t);i.shader.bind(s),i.state.set(r),i.geometry.bind(o.geometry,s.glProgram);const h=o.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?a.UNSIGNED_SHORT:a.UNSIGNED_INT;a.drawElements(a.TRIANGLES,t.particleChildren.length*6,h,0)}}class cr{execute(e,t){const r=e.renderer,i=t.shader||e.defaultShader;i.groups[0]=r.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms,!0),i.groups[1]=r.texture.getTextureBindGroup(t.texture);const s=e.state,a=e.getBuffers(t);r.encoder.draw({geometry:a.geometry,shader:t.shader||e.defaultShader,state:s,size:t.particleChildren.length*6})}}function Ge(n,e=null){const t=n*6;if(t>65535?e||(e=new Uint32Array(t)):e||(e=new Uint16Array(t)),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let r=0,i=0;r<t;r+=6,i+=4)e[r+0]=i+0,e[r+1]=i+1,e[r+2]=i+2,e[r+3]=i+0,e[r+4]=i+2,e[r+5]=i+3;return e}function ur(n){return{dynamicUpdate:He(n,!0),staticUpdate:He(n,!1)}}function He(n,e){const t=[];t.push(`
|
||||||
|
|
||||||
|
var index = 0;
|
||||||
|
|
||||||
|
for (let i = 0; i < ps.length; ++i)
|
||||||
|
{
|
||||||
|
const p = ps[i];
|
||||||
|
|
||||||
|
`);let r=0;for(const s in n){const a=n[s];if(e!==a.dynamic)continue;t.push(`offset = index + ${r}`),t.push(a.code);const o=ue(a.format);r+=o.stride/4}t.push(`
|
||||||
|
index += stride * 4;
|
||||||
|
}
|
||||||
|
`),t.unshift(`
|
||||||
|
var stride = ${r};
|
||||||
|
`);const i=t.join(`
|
||||||
|
`);return new Function("ps","f32v","u32v",i)}class fr{constructor(e){this._size=0,this._generateParticleUpdateCache={};const t=this._size=e.size??1e3,r=e.properties;let i=0,s=0;for(const d in r){const c=r[d],f=ue(c.format);c.dynamic?s+=f.stride:i+=f.stride}this._dynamicStride=s/4,this._staticStride=i/4,this.staticAttributeBuffer=new N(t*4*i),this.dynamicAttributeBuffer=new N(t*4*s),this.indexBuffer=Ge(t);const a=new ge;let o=0,l=0;this._staticBuffer=new Y({data:new Float32Array(1),label:"static-particle-buffer",shrinkToFit:!1,usage:D.VERTEX|D.COPY_DST}),this._dynamicBuffer=new Y({data:new Float32Array(1),label:"dynamic-particle-buffer",shrinkToFit:!1,usage:D.VERTEX|D.COPY_DST});for(const d in r){const c=r[d],f=ue(c.format);c.dynamic?(a.addAttribute(c.attributeName,{buffer:this._dynamicBuffer,stride:this._dynamicStride*4,offset:o*4,format:c.format}),o+=f.size):(a.addAttribute(c.attributeName,{buffer:this._staticBuffer,stride:this._staticStride*4,offset:l*4,format:c.format}),l+=f.size)}a.addIndex(this.indexBuffer);const h=this.getParticleUpdate(r);this._dynamicUpload=h.dynamicUpdate,this._staticUpload=h.staticUpdate,this.geometry=a}getParticleUpdate(e){const t=pr(e);return this._generateParticleUpdateCache[t]?this._generateParticleUpdateCache[t]:(this._generateParticleUpdateCache[t]=this.generateParticleUpdate(e),this._generateParticleUpdateCache[t])}generateParticleUpdate(e){return ur(e)}update(e,t){e.length>this._size&&(t=!0,this._size=Math.max(e.length,this._size*1.5|0),this.staticAttributeBuffer=new N(this._size*this._staticStride*4*4),this.dynamicAttributeBuffer=new N(this._size*this._dynamicStride*4*4),this.indexBuffer=Ge(this._size),this.geometry.indexBuffer.setDataWithSize(this.indexBuffer,this.indexBuffer.byteLength,!0));const r=this.dynamicAttributeBuffer;if(this._dynamicUpload(e,r.float32View,r.uint32View),this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View,e.length*this._dynamicStride*4,!0),t){const i=this.staticAttributeBuffer;this._staticUpload(e,i.float32View,i.uint32View),this._staticBuffer.setDataWithSize(i.float32View,e.length*this._staticStride*4,!0)}}destroy(){this._staticBuffer.destroy(),this._dynamicBuffer.destroy(),this.geometry.destroy()}}function pr(n){const e=[];for(const t in n){const r=n[t];e.push(t,r.code,r.dynamic?"d":"s")}return e.join("_")}var gr=`varying vec2 vUV;
|
||||||
|
varying vec4 vColor;
|
||||||
|
|
||||||
|
uniform sampler2D uTexture;
|
||||||
|
|
||||||
|
void main(void){
|
||||||
|
vec4 color = texture2D(uTexture, vUV) * vColor;
|
||||||
|
gl_FragColor = color;
|
||||||
|
}`,mr=`attribute vec2 aVertex;
|
||||||
|
attribute vec2 aUV;
|
||||||
|
attribute vec4 aColor;
|
||||||
|
|
||||||
|
attribute vec2 aPosition;
|
||||||
|
attribute float aRotation;
|
||||||
|
|
||||||
|
uniform mat3 uTranslationMatrix;
|
||||||
|
uniform float uRound;
|
||||||
|
uniform vec2 uResolution;
|
||||||
|
uniform vec4 uColor;
|
||||||
|
|
||||||
|
varying vec2 vUV;
|
||||||
|
varying vec4 vColor;
|
||||||
|
|
||||||
|
vec2 roundPixels(vec2 position, vec2 targetSize)
|
||||||
|
{
|
||||||
|
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main(void){
|
||||||
|
float cosRotation = cos(aRotation);
|
||||||
|
float sinRotation = sin(aRotation);
|
||||||
|
float x = aVertex.x * cosRotation - aVertex.y * sinRotation;
|
||||||
|
float y = aVertex.x * sinRotation + aVertex.y * cosRotation;
|
||||||
|
|
||||||
|
vec2 v = vec2(x, y);
|
||||||
|
v = v + aPosition;
|
||||||
|
|
||||||
|
gl_Position = vec4((uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
|
||||||
|
|
||||||
|
if(uRound == 1.0)
|
||||||
|
{
|
||||||
|
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
||||||
|
}
|
||||||
|
|
||||||
|
vUV = aUV;
|
||||||
|
vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor;
|
||||||
|
}
|
||||||
|
`,De=`
|
||||||
|
struct ParticleUniforms {
|
||||||
|
uProjectionMatrix:mat3x3<f32>,
|
||||||
|
uColor:vec4<f32>,
|
||||||
|
uResolution:vec2<f32>,
|
||||||
|
uRoundPixels:f32,
|
||||||
|
};
|
||||||
|
|
||||||
|
@group(0) @binding(0) var<uniform> uniforms: ParticleUniforms;
|
||||||
|
|
||||||
|
@group(1) @binding(0) var uTexture: texture_2d<f32>;
|
||||||
|
@group(1) @binding(1) var uSampler : sampler;
|
||||||
|
|
||||||
|
struct VSOutput {
|
||||||
|
@builtin(position) position: vec4<f32>,
|
||||||
|
@location(0) uv : vec2<f32>,
|
||||||
|
@location(1) color : vec4<f32>,
|
||||||
|
};
|
||||||
|
@vertex
|
||||||
|
fn mainVertex(
|
||||||
|
@location(0) aVertex: vec2<f32>,
|
||||||
|
@location(1) aPosition: vec2<f32>,
|
||||||
|
@location(2) aUV: vec2<f32>,
|
||||||
|
@location(3) aColor: vec4<f32>,
|
||||||
|
@location(4) aRotation: f32,
|
||||||
|
) -> VSOutput {
|
||||||
|
|
||||||
|
let v = vec2(
|
||||||
|
aVertex.x * cos(aRotation) - aVertex.y * sin(aRotation),
|
||||||
|
aVertex.x * sin(aRotation) + aVertex.y * cos(aRotation)
|
||||||
|
) + aPosition;
|
||||||
|
|
||||||
|
let position = vec4((uniforms.uProjectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
|
||||||
|
|
||||||
|
let vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uniforms.uColor;
|
||||||
|
|
||||||
|
return VSOutput(
|
||||||
|
position,
|
||||||
|
aUV,
|
||||||
|
vColor,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@fragment
|
||||||
|
fn mainFragment(
|
||||||
|
@location(0) uv: vec2<f32>,
|
||||||
|
@location(1) color: vec4<f32>,
|
||||||
|
@builtin(position) position: vec4<f32>,
|
||||||
|
) -> @location(0) vec4<f32> {
|
||||||
|
|
||||||
|
var sample = textureSample(uTexture, uSampler, uv) * color;
|
||||||
|
|
||||||
|
return sample;
|
||||||
|
}`;class _r extends xe{constructor(){const e=Wt.from({vertex:mr,fragment:gr}),t=At.from({fragment:{source:De,entryPoint:"mainFragment"},vertex:{source:De,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:A.WHITE.source,uSampler:new zt({}),uniforms:{uTranslationMatrix:{value:new U,type:"mat3x3<f32>"},uColor:{value:new R(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}})}}class _t{constructor(e,t){this.state=ee.for2d(),this._gpuBufferHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this.localUniforms=new j({uTranslationMatrix:{value:new U,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=e,this.adaptor=t,this.defaultShader=new _r,this.state=ee.for2d()}validateRenderable(e){return!1}addRenderable(e,t){this.renderer.renderPipes.batch.break(t),t.add(e)}getBuffers(e){return this._gpuBufferHash[e.uid]||this._initBuffer(e)}_initBuffer(e){return this._gpuBufferHash[e.uid]=new fr({size:e.particleChildren.length,properties:e._properties}),e.on("destroyed",this._destroyRenderableBound),this._gpuBufferHash[e.uid]}updateRenderable(e){}destroyRenderable(e){this._gpuBufferHash[e.uid].destroy(),this._gpuBufferHash[e.uid]=null,e.off("destroyed",this._destroyRenderableBound)}execute(e){const t=e.particleChildren;if(t.length===0)return;const r=this.renderer,i=this.getBuffers(e);e.texture||(e.texture=t[0].texture);const s=this.state;i.update(t,e._childrenDirty),e._childrenDirty=!1,s.blendMode=_e(e.blendMode,e.texture._source);const a=this.localUniforms.uniforms,o=a.uTranslationMatrix;e.worldTransform.copyTo(o),o.prepend(r.globalUniforms.globalUniformData.projectionMatrix),a.uResolution=r.globalUniforms.globalUniformData.resolution,a.uRound=r._roundPixels|e._roundPixels,ie(e.groupColorAlpha,a.uColor,0),this.adaptor.execute(this,e)}destroy(){this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null)}}class xt extends _t{constructor(e){super(e,new hr)}}xt.extension={type:[b.WebGLPipes],name:"particle"};class bt extends _t{constructor(e){super(e,new cr)}}bt.extension={type:[b.WebGPUPipes],name:"particle"};const yt=class St extends dr{constructor(e={}){e={...St.defaultOptions,...e},super({width:e.width,height:e.height,verticesX:4,verticesY:4}),this.update(e)}update(e){this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this.updateUvs(),this.updatePositions()}updatePositions(){const e=this.positions,t=this._leftWidth+this._rightWidth,r=this.width>t?1:this.width/t,i=this._topHeight+this._bottomHeight,s=this.height>i?1:this.height/i,a=Math.min(r,s);e[9]=e[11]=e[13]=e[15]=this._topHeight*a,e[17]=e[19]=e[21]=e[23]=this.height-this._bottomHeight*a,e[25]=e[27]=e[29]=e[31]=this.height,e[2]=e[10]=e[18]=e[26]=this._leftWidth*a,e[4]=e[12]=e[20]=e[28]=this.width-this._rightWidth*a,e[6]=e[14]=e[22]=e[30]=this.width,this.getBuffer("aPosition").update()}updateUvs(){const e=this.uvs;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1;const t=1/this._originalWidth,r=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.getBuffer("aUV").update()}};yt.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};let xr=yt;class wt{constructor(e){this._gpuSpriteHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuSpriteHash")}addRenderable(e,t){const r=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,r),this._renderer.renderPipes.batch.addToBatch(r,t)}updateRenderable(e){const t=this._gpuSpriteHash[e.uid];e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t)}validateRenderable(e){const t=this._getGpuSprite(e);return!t._batcher.checkAndUpdateTexture(t,e._texture)}destroyRenderable(e){const t=this._gpuSpriteHash[e.uid];v.return(t.geometry),v.return(t),this._gpuSpriteHash[e.uid]=null,e.off("destroyed",this._destroyRenderableBound)}_updateBatchableSprite(e,t){t.geometry.update(e),t.texture=e._texture}_getGpuSprite(e){return this._gpuSpriteHash[e.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=v.get(we);return t.geometry=v.get(xr),t.renderable=e,t.transform=e.groupTransform,t.texture=e._texture,t.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuSpriteHash[e.uid]=t,e.didViewUpdate||this._updateBatchableSprite(e,t),e.on("destroyed",this._destroyRenderableBound),t}destroy(){for(const e in this._gpuSpriteHash)this._gpuSpriteHash[e].geometry.destroy();this._gpuSpriteHash=null,this._renderer=null}}wt.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"nineSliceSprite"};const br={name:"tiling-bit",vertex:{header:`
|
||||||
|
struct TilingUniforms {
|
||||||
|
uMapCoord:mat3x3<f32>,
|
||||||
|
uClampFrame:vec4<f32>,
|
||||||
|
uClampOffset:vec2<f32>,
|
||||||
|
uTextureTransform:mat3x3<f32>,
|
||||||
|
uSizeAnchor:vec4<f32>
|
||||||
|
};
|
||||||
|
|
||||||
|
@group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
|
||||||
|
@group(2) @binding(1) var uTexture: texture_2d<f32>;
|
||||||
|
@group(2) @binding(2) var uSampler: sampler;
|
||||||
|
`,main:`
|
||||||
|
uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy;
|
||||||
|
|
||||||
|
position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy;
|
||||||
|
`},fragment:{header:`
|
||||||
|
struct TilingUniforms {
|
||||||
|
uMapCoord:mat3x3<f32>,
|
||||||
|
uClampFrame:vec4<f32>,
|
||||||
|
uClampOffset:vec2<f32>,
|
||||||
|
uTextureTransform:mat3x3<f32>,
|
||||||
|
uSizeAnchor:vec4<f32>
|
||||||
|
};
|
||||||
|
|
||||||
|
@group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
|
||||||
|
@group(2) @binding(1) var uTexture: texture_2d<f32>;
|
||||||
|
@group(2) @binding(2) var uSampler: sampler;
|
||||||
|
`,main:`
|
||||||
|
|
||||||
|
var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV);
|
||||||
|
coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy;
|
||||||
|
var unclamped = coord;
|
||||||
|
coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw);
|
||||||
|
|
||||||
|
var bias = 0.;
|
||||||
|
|
||||||
|
if(unclamped.x == coord.x && unclamped.y == coord.y)
|
||||||
|
{
|
||||||
|
bias = -32.;
|
||||||
|
}
|
||||||
|
|
||||||
|
outColor = textureSampleBias(uTexture, uSampler, coord, bias);
|
||||||
|
`}},yr={name:"tiling-bit",vertex:{header:`
|
||||||
|
uniform mat3 uTextureTransform;
|
||||||
|
uniform vec4 uSizeAnchor;
|
||||||
|
|
||||||
|
`,main:`
|
||||||
|
uv = (uTextureTransform * vec3(aUV, 1.0)).xy;
|
||||||
|
|
||||||
|
position = (position - uSizeAnchor.zw) * uSizeAnchor.xy;
|
||||||
|
`},fragment:{header:`
|
||||||
|
uniform sampler2D uTexture;
|
||||||
|
uniform mat3 uMapCoord;
|
||||||
|
uniform vec4 uClampFrame;
|
||||||
|
uniform vec2 uClampOffset;
|
||||||
|
`,main:`
|
||||||
|
|
||||||
|
vec2 coord = vUV + ceil(uClampOffset - vUV);
|
||||||
|
coord = (uMapCoord * vec3(coord, 1.0)).xy;
|
||||||
|
vec2 unclamped = coord;
|
||||||
|
coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
|
||||||
|
|
||||||
|
outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0
|
||||||
|
|
||||||
|
`}};let oe,le;class Sr extends xe{constructor(){oe??(oe=Ke({name:"tiling-sprite-shader",bits:[$t,br,Xe]})),le??(le=Ye({name:"tiling-sprite-shader",bits:[jt,yr,Ne]}));const e=new j({uMapCoord:{value:new U,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new U,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:le,gpuProgram:oe,resources:{localUniforms:new j({uTransformMatrix:{value:new U,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:A.EMPTY.source,uSampler:A.EMPTY.source.style}})}updateUniforms(e,t,r,i,s,a){const o=this.resources.tilingUniforms,l=a.width,h=a.height,d=a.textureMatrix,c=o.uniforms.uTextureTransform;c.set(r.a*l/e,r.b*l/t,r.c*h/e,r.d*h/t,r.tx/e,r.ty/t),c.invert(),o.uniforms.uMapCoord=d.mapCoord,o.uniforms.uClampFrame=d.uClampFrame,o.uniforms.uClampOffset=d.uClampOffset,o.uniforms.uTextureTransform=c,o.uniforms.uSizeAnchor[0]=e,o.uniforms.uSizeAnchor[1]=t,o.uniforms.uSizeAnchor[2]=i,o.uniforms.uSizeAnchor[3]=s,a&&(this.resources.uTexture=a.source,this.resources.uSampler=a.source.style)}}class wr extends ye{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}}function Tr(n,e){const t=n.anchor.x,r=n.anchor.y;e[0]=-t*n.width,e[1]=-r*n.height,e[2]=(1-t)*n.width,e[3]=-r*n.height,e[4]=(1-t)*n.width,e[5]=(1-r)*n.height,e[6]=-t*n.width,e[7]=(1-r)*n.height}function vr(n,e,t,r){let i=0;const s=n.length/e,a=r.a,o=r.b,l=r.c,h=r.d,d=r.tx,c=r.ty;for(t*=e;i<s;){const f=n[t],g=n[t+1];n[t]=a*f+l*g+d,n[t+1]=o*f+h*g+c,t+=e,i++}}function Br(n,e){const t=n.texture,r=t.frame.width,i=t.frame.height;let s=0,a=0;n.applyAnchorToTexture&&(s=n.anchor.x,a=n.anchor.y),e[0]=e[6]=-s,e[2]=e[4]=1-s,e[1]=e[3]=-a,e[5]=e[7]=1-a;const o=U.shared;o.copyFrom(n._tileTransform.matrix),o.tx/=n.width,o.ty/=n.height,o.invert(),o.scale(n.width/r,n.height/i),vr(e,2,0,o)}const Q=new wr;class Tt{constructor(e){this._state=ee.default2d,this._tilingSpriteDataHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_tilingSpriteDataHash")}validateRenderable(e){const t=this._getTilingSpriteData(e),r=t.canBatch;this._updateCanBatch(e);const i=t.canBatch;if(i&&i===r){const{batchableMesh:s}=t;return!s._batcher.checkAndUpdateTexture(s,e.texture)}return r!==i}addRenderable(e,t){const r=this._renderer.renderPipes.batch;this._updateCanBatch(e);const i=this._getTilingSpriteData(e),{geometry:s,canBatch:a}=i;if(a){i.batchableMesh||(i.batchableMesh=new we);const o=i.batchableMesh;e.didViewUpdate&&(this._updateBatchableMesh(e),o.geometry=s,o.renderable=e,o.transform=e.groupTransform,o.texture=e._texture),o.roundPixels=this._renderer._roundPixels|e._roundPixels,r.addToBatch(o,t)}else r.break(t),i.shader||(i.shader=new Sr),this.updateRenderable(e),t.add(e)}execute(e){const{shader:t}=this._tilingSpriteDataHash[e.uid];t.groups[0]=this._renderer.globalUniforms.bindGroup;const r=t.resources.localUniforms.uniforms;r.uTransformMatrix=e.groupTransform,r.uRound=this._renderer._roundPixels|e._roundPixels,ie(e.groupColorAlpha,r.uColor,0),this._state.blendMode=_e(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:Q,shader:t,state:this._state})}updateRenderable(e){const t=this._getTilingSpriteData(e),{canBatch:r}=t;if(r){const{batchableMesh:i}=t;e.didViewUpdate&&this._updateBatchableMesh(e),i._batcher.updateElement(i)}else if(e.didViewUpdate){const{shader:i}=t;i.updateUniforms(e.width,e.height,e._tileTransform.matrix,e.anchor.x,e.anchor.y,e.texture)}}destroyRenderable(e){const t=this._getTilingSpriteData(e);t.batchableMesh=null,t.shader?.destroy(),this._tilingSpriteDataHash[e.uid]=null,e.off("destroyed",this._destroyRenderableBound)}_getTilingSpriteData(e){return this._tilingSpriteDataHash[e.uid]||this._initTilingSpriteData(e)}_initTilingSpriteData(e){const t=new ye({indices:Q.indices,positions:Q.positions.slice(),uvs:Q.uvs.slice()});return this._tilingSpriteDataHash[e.uid]={canBatch:!0,renderable:e,geometry:t},e.on("destroyed",this._destroyRenderableBound),this._tilingSpriteDataHash[e.uid]}_updateBatchableMesh(e){const t=this._getTilingSpriteData(e),{geometry:r}=t,i=e.texture.source.style;i.addressMode!=="repeat"&&(i.addressMode="repeat",i.update()),Br(e,r.uvs),Tr(e,r.positions)}destroy(){for(const e in this._tilingSpriteDataHash)this.destroyRenderable(this._tilingSpriteDataHash[e].renderable);this._tilingSpriteDataHash=null,this._renderer=null}_updateCanBatch(e){const t=this._getTilingSpriteData(e),r=e.texture;let i=!0;return this._renderer.type===me.WEBGL&&(i=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=r.textureMatrix.isSimple&&(i||r.source.isPowerOfTwo),t.canBatch}}Tt.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"tilingSprite"};const Cr={name:"local-uniform-msdf-bit",vertex:{header:`
|
||||||
|
struct LocalUniforms {
|
||||||
|
uColor:vec4<f32>,
|
||||||
|
uTransformMatrix:mat3x3<f32>,
|
||||||
|
uDistance: f32,
|
||||||
|
uRound:f32,
|
||||||
|
}
|
||||||
|
|
||||||
|
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
||||||
|
`,main:`
|
||||||
|
vColor *= localUniforms.uColor;
|
||||||
|
modelMatrix *= localUniforms.uTransformMatrix;
|
||||||
|
`,end:`
|
||||||
|
if(localUniforms.uRound == 1)
|
||||||
|
{
|
||||||
|
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
||||||
|
}
|
||||||
|
`},fragment:{header:`
|
||||||
|
struct LocalUniforms {
|
||||||
|
uColor:vec4<f32>,
|
||||||
|
uTransformMatrix:mat3x3<f32>,
|
||||||
|
uDistance: f32
|
||||||
|
}
|
||||||
|
|
||||||
|
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
||||||
|
`,main:`
|
||||||
|
outColor = vec4<f32>(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance));
|
||||||
|
`}},Pr={name:"local-uniform-msdf-bit",vertex:{header:`
|
||||||
|
uniform mat3 uTransformMatrix;
|
||||||
|
uniform vec4 uColor;
|
||||||
|
uniform float uRound;
|
||||||
|
`,main:`
|
||||||
|
vColor *= uColor;
|
||||||
|
modelMatrix *= uTransformMatrix;
|
||||||
|
`,end:`
|
||||||
|
if(uRound == 1.)
|
||||||
|
{
|
||||||
|
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
||||||
|
}
|
||||||
|
`},fragment:{header:`
|
||||||
|
uniform float uDistance;
|
||||||
|
`,main:`
|
||||||
|
outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));
|
||||||
|
`}},Rr={name:"msdf-bit",fragment:{header:`
|
||||||
|
fn calculateMSDFAlpha(msdfColor:vec4<f32>, shapeColor:vec4<f32>, distance:f32) -> f32 {
|
||||||
|
|
||||||
|
// MSDF
|
||||||
|
var median = msdfColor.r + msdfColor.g + msdfColor.b -
|
||||||
|
min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
|
||||||
|
max(msdfColor.r, max(msdfColor.g, msdfColor.b));
|
||||||
|
|
||||||
|
// SDF
|
||||||
|
median = min(median, msdfColor.a);
|
||||||
|
|
||||||
|
var screenPxDistance = distance * (median - 0.5);
|
||||||
|
var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
|
||||||
|
if (median < 0.01) {
|
||||||
|
alpha = 0.0;
|
||||||
|
} else if (median > 0.99) {
|
||||||
|
alpha = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Gamma correction for coverage-like alpha
|
||||||
|
var luma: f32 = dot(shapeColor.rgb, vec3<f32>(0.299, 0.587, 0.114));
|
||||||
|
var gamma: f32 = mix(1.0, 1.0 / 2.2, luma);
|
||||||
|
var coverage: f32 = pow(shapeColor.a * alpha, gamma);
|
||||||
|
|
||||||
|
return coverage;
|
||||||
|
|
||||||
|
}
|
||||||
|
`}},Fr={name:"msdf-bit",fragment:{header:`
|
||||||
|
float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {
|
||||||
|
|
||||||
|
// MSDF
|
||||||
|
float median = msdfColor.r + msdfColor.g + msdfColor.b -
|
||||||
|
min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
|
||||||
|
max(msdfColor.r, max(msdfColor.g, msdfColor.b));
|
||||||
|
|
||||||
|
// SDF
|
||||||
|
median = min(median, msdfColor.a);
|
||||||
|
|
||||||
|
float screenPxDistance = distance * (median - 0.5);
|
||||||
|
float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
|
||||||
|
|
||||||
|
if (median < 0.01) {
|
||||||
|
alpha = 0.0;
|
||||||
|
} else if (median > 0.99) {
|
||||||
|
alpha = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Gamma correction for coverage-like alpha
|
||||||
|
float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114));
|
||||||
|
float gamma = mix(1.0, 1.0 / 2.2, luma);
|
||||||
|
float coverage = pow(shapeColor.a * alpha, gamma);
|
||||||
|
|
||||||
|
return coverage;
|
||||||
|
}
|
||||||
|
`}};let de,he;class Mr extends xe{constructor(){const e=new j({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new U,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}}),t=Gt();de??(de=Ke({name:"sdf-shader",bits:[Ht,Dt(t),Cr,Rr,Xe]})),he??(he=Ye({name:"sdf-shader",bits:[Lt,It(t),Pr,Fr,Ne]})),super({glProgram:he,gpuProgram:de,resources:{localUniforms:e,batchSamplers:Ot(t)}})}}class vt{constructor(e){this._gpuBitmapText={},this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBitmapText")}validateRenderable(e){const t=this._getGpuBitmapText(e);return e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,t)),this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){const r=this._getGpuBitmapText(e);Le(e,r),e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,r)),this._renderer.renderPipes.graphics.addRenderable(r,t),r.context.customShader&&this._updateDistanceField(e)}destroyRenderable(e){e.off("destroyed",this._destroyRenderableBound),this._destroyRenderableByUid(e.uid)}_destroyRenderableByUid(e){const t=this._gpuBitmapText[e].context;t.customShader&&(v.return(t.customShader),t.customShader=null),v.return(this._gpuBitmapText[e]),this._gpuBitmapText[e]=null}updateRenderable(e){const t=this._getGpuBitmapText(e);Le(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e)}_updateContext(e,t){const{context:r}=t,i=tr.getFont(e.text,e._style);r.clear(),i.distanceField.type!=="none"&&(r.customShader||(r.customShader=v.get(Mr)));const s=Array.from(e.text),a=e._style;let o=i.baseLineOffset;const l=st(s,a,i,!0);let h=0;const d=a.padding,c=l.scale;let f=l.width,g=l.height+l.offsetY;a._stroke&&(f+=a._stroke.width/c,g+=a._stroke.width/c),r.translate(-e._anchor._x*f-d,-e._anchor._y*g-d).scale(c,c);const u=i.applyFillAsTint?a._fill.color:16777215;for(let m=0;m<l.lines.length;m++){const x=l.lines[m];for(let _=0;_<x.charPositions.length;_++){const y=s[h++],S=i.chars[y];S?.texture&&r.texture(S.texture,u||"black",Math.round(x.charPositions[_]+S.xOffset),Math.round(o+S.yOffset))}o+=i.lineHeight}}_getGpuBitmapText(e){return this._gpuBitmapText[e.uid]||this.initGpuText(e)}initGpuText(e){const t=v.get(Et);return this._gpuBitmapText[e.uid]=t,this._updateContext(e,t),e.on("destroyed",this._destroyRenderableBound),this._gpuBitmapText[e.uid]}_updateDistanceField(e){const t=this._getGpuBitmapText(e).context,r=e._style.fontFamily,i=G.get(`${r}-bitmap`),{a:s,b:a,c:o,d:l}=e.groupTransform,h=Math.sqrt(s*s+a*a),d=Math.sqrt(o*o+l*l),c=(Math.abs(h)+Math.abs(d))/2,f=i.baseRenderedFontSize/e._style.fontSize,g=c*i.distanceField.range*(1/f);t.customShader.resources.localUniforms.uniforms.uDistance=g}destroy(){for(const e in this._gpuBitmapText)this._destroyRenderableByUid(e);this._gpuBitmapText=null,this._renderer=null}}vt.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"bitmapText"};function Le(n,e){e.groupTransform=n.groupTransform,e.groupColorAlpha=n.groupColorAlpha,e.groupColor=n.groupColor,e.groupBlendMode=n.groupBlendMode,e.globalDisplayStatus=n.globalDisplayStatus,e.groupTransform=n.groupTransform,e.localDisplayStatus=n.localDisplayStatus,e.groupAlpha=n.groupAlpha,e._roundPixels=n._roundPixels}class Bt{constructor(e){this._gpuText=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=e,this._renderer.runners.resolutionChange.add(this),this._renderer.renderableGC.addManagedHash(this,"_gpuText")}resolutionChange(){for(const e in this._gpuText){const t=this._gpuText[e];if(!t)continue;const r=t.batchableSprite.renderable;r._autoResolution&&(r._resolution=this._renderer.resolution,r.onViewUpdate())}}validateRenderable(e){const t=this._getGpuText(e),r=e._getKey();return t.textureNeedsUploading?(t.textureNeedsUploading=!1,!0):t.currentKey!==r}addRenderable(e,t){const i=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),this._renderer.renderPipes.batch.addToBatch(i,t)}updateRenderable(e){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),r._batcher.updateElement(r)}destroyRenderable(e){e.off("destroyed",this._destroyRenderableBound),this._destroyRenderableById(e.uid)}_destroyRenderableById(e){const t=this._gpuText[e];this._renderer.htmlText.decreaseReferenceCount(t.currentKey),v.return(t.batchableSprite),this._gpuText[e]=null}_updateText(e){const t=e._getKey(),r=this._getGpuText(e),i=r.batchableSprite;r.currentKey!==t&&this._updateGpuText(e).catch(a=>{console.error(a)}),e._didTextUpdate=!1;const s=e._style.padding;fe(i.bounds,e._anchor,i.texture,s)}async _updateGpuText(e){e._didTextUpdate=!1;const t=this._getGpuText(e);if(t.generatingTexture)return;const r=e._getKey();this._renderer.htmlText.decreaseReferenceCount(t.currentKey),t.generatingTexture=!0,t.currentKey=r;const i=e.resolution??this._renderer.resolution,s=await this._renderer.htmlText.getManagedTexture(e.text,i,e._style,e._getKey()),a=t.batchableSprite;a.texture=t.texture=s,t.generatingTexture=!1,t.textureNeedsUploading=!0,e.onViewUpdate();const o=e._style.padding;fe(a.bounds,e._anchor,a.texture,o)}_getGpuText(e){return this._gpuText[e.uid]||this.initGpuText(e)}initGpuText(e){const t={texture:A.EMPTY,currentKey:"--",batchableSprite:v.get(qe),textureNeedsUploading:!1,generatingTexture:!1},r=t.batchableSprite;return r.renderable=e,r.transform=e.groupTransform,r.texture=A.EMPTY,r.bounds={minX:0,maxX:1,minY:0,maxY:0},r.roundPixels=this._renderer._roundPixels|e._roundPixels,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,this._gpuText[e.uid]=t,e.on("destroyed",this._destroyRenderableBound),t}destroy(){for(const e in this._gpuText)this._destroyRenderableById(e);this._gpuText=null,this._renderer=null}}Bt.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"htmlText"};function kr(){const{userAgent:n}=K.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(n)}const Ur=new je;function Ct(n,e,t,r){const i=Ur;i.minX=0,i.minY=0,i.maxX=n.width/r|0,i.maxY=n.height/r|0;const s=H.getOptimalTexture(i.width,i.height,r,!1);return s.source.uploadMethodId="image",s.source.resource=n,s.source.alphaMode="premultiply-alpha-on-upload",s.frame.width=e/r,s.frame.height=t/r,s.source.emit("update",s.source),s.updateUvs(),s}function Wr(n,e){const t=e.fontFamily,r=[],i={},s=/font-family:([^;"\s]+)/g,a=n.match(s);function o(l){i[l]||(r.push(l),i[l]=!0)}if(Array.isArray(t))for(let l=0;l<t.length;l++)o(t[l]);else o(t);a&&a.forEach(l=>{const h=l.split(":")[1].trim();o(h)});for(const l in e.tagStyles){const h=e.tagStyles[l].fontFamily;o(h)}return r}async function Ar(n){const t=await(await K.get().fetch(n)).blob(),r=new FileReader;return await new Promise((s,a)=>{r.onloadend=()=>s(r.result),r.onerror=a,r.readAsDataURL(t)})}async function Ie(n,e){const t=await Ar(e);return`@font-face {
|
||||||
|
font-family: "${n.fontFamily}";
|
||||||
|
src: url('${t}');
|
||||||
|
font-weight: ${n.fontWeight};
|
||||||
|
font-style: ${n.fontStyle};
|
||||||
|
}`}const J=new Map;async function zr(n,e,t){const r=n.filter(i=>G.has(`${i}-and-url`)).map((i,s)=>{if(!J.has(i)){const{url:a}=G.get(`${i}-and-url`);s===0?J.set(i,Ie({fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:i},a)):J.set(i,Ie({fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:i},a))}return J.get(i)});return(await Promise.all(r)).join(`
|
||||||
|
`)}function Gr(n,e,t,r,i){const{domElement:s,styleElement:a,svgRoot:o}=i;s.innerHTML=`<style>${e.cssStyle}</style><div style='padding:0;'>${n}</div>`,s.setAttribute("style",`transform: scale(${t});transform-origin: top left; display: inline-block`),a.textContent=r;const{width:l,height:h}=i.image;return o.setAttribute("width",l.toString()),o.setAttribute("height",h.toString()),new XMLSerializer().serializeToString(o)}function Hr(n,e){const t=O.getOptimalCanvasAndContext(n.width,n.height,e),{context:r}=t;return r.clearRect(0,0,n.width,n.height),r.drawImage(n,0,0),t}function Dr(n,e,t){return new Promise(async r=>{t&&await new Promise(i=>setTimeout(i,100)),n.onload=()=>{r()},n.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,n.crossOrigin="anonymous"})}class Te{constructor(e){this._activeTextures={},this._renderer=e,this._createCanvas=e.type===me.WEBGPU}getTexture(e){return this._buildTexturePromise(e.text,e.resolution,e.style)}getManagedTexture(e,t,r,i){if(this._activeTextures[i])return this._increaseReferenceCount(i),this._activeTextures[i].promise;const s=this._buildTexturePromise(e,t,r).then(a=>(this._activeTextures[i].texture=a,a));return this._activeTextures[i]={texture:null,promise:s,usageCount:1},s}async _buildTexturePromise(e,t,r){const i=v.get(ut),s=Wr(e,r),a=await zr(s,r,Se.defaultTextStyle),o=lr(e,r,a,i),l=Math.ceil(Math.ceil(Math.max(1,o.width)+r.padding*2)*t),h=Math.ceil(Math.ceil(Math.max(1,o.height)+r.padding*2)*t),d=i.image,c=2;d.width=(l|0)+c,d.height=(h|0)+c;const f=Gr(e,r,t,a,i);await Dr(d,f,kr()&&s.length>0);const g=d;let u;this._createCanvas&&(u=Hr(d,t));const m=Ct(u?u.canvas:g,d.width-c,d.height-c,t);return this._createCanvas&&(this._renderer.texture.initSource(m.source),O.returnCanvasAndContext(u)),v.return(i),m}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];t&&(t.usageCount--,t.usageCount===0&&(t.texture?this._cleanUp(t):t.promise.then(r=>{t.texture=r,this._cleanUp(t)}).catch(()=>{$("HTMLTextSystem: Failed to clean texture")}),this._activeTextures[e]=null))}_cleanUp(e){H.returnTexture(e.texture),e.texture.source.resource=null,e.texture.source.uploadMethodId="unknown"}getReferenceCount(e){return this._activeTextures[e].usageCount}destroy(){this._activeTextures=null}}Te.extension={type:[b.WebGLSystem,b.WebGPUSystem,b.CanvasSystem],name:"htmlText"};Te.defaultFontOptions={fontFamily:"Arial",fontStyle:"normal",fontWeight:"normal"};class Pt{constructor(e){this._gpuText=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=e,this._renderer.runners.resolutionChange.add(this),this._renderer.renderableGC.addManagedHash(this,"_gpuText")}resolutionChange(){for(const e in this._gpuText){const t=this._gpuText[e];if(!t)continue;const r=t.batchableSprite.renderable;r._autoResolution&&(r._resolution=this._renderer.resolution,r.onViewUpdate())}}validateRenderable(e){const t=this._getGpuText(e),r=e._getKey();return t.currentKey!==r}addRenderable(e,t){const i=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),this._renderer.renderPipes.batch.addToBatch(i,t)}updateRenderable(e){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),r._batcher.updateElement(r)}destroyRenderable(e){e.off("destroyed",this._destroyRenderableBound),this._destroyRenderableById(e.uid)}_destroyRenderableById(e){const t=this._gpuText[e];this._renderer.canvasText.decreaseReferenceCount(t.currentKey),v.return(t.batchableSprite),this._gpuText[e]=null}_updateText(e){const t=e._getKey(),r=this._getGpuText(e),i=r.batchableSprite;r.currentKey!==t&&this._updateGpuText(e),e._didTextUpdate=!1;const s=e._style.padding;fe(i.bounds,e._anchor,i.texture,s)}_updateGpuText(e){const t=this._getGpuText(e),r=t.batchableSprite;t.texture&&this._renderer.canvasText.decreaseReferenceCount(t.currentKey),t.texture=r.texture=this._renderer.canvasText.getManagedTexture(e),t.currentKey=e._getKey(),r.texture=t.texture}_getGpuText(e){return this._gpuText[e.uid]||this.initGpuText(e)}initGpuText(e){const t={texture:null,currentKey:"--",batchableSprite:v.get(qe)};return t.batchableSprite.renderable=e,t.batchableSprite.transform=e.groupTransform,t.batchableSprite.bounds={minX:0,maxX:1,minY:0,maxY:0},t.batchableSprite.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuText[e.uid]=t,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,this._updateText(e),e.on("destroyed",this._destroyRenderableBound),t}destroy(){for(const e in this._gpuText)this._destroyRenderableById(e);this._gpuText=null,this._renderer=null}}Pt.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"text"};function Oe(n,e,t){for(let r=0,i=4*t*e;r<e;++r,i+=4)if(n[i+3]!==0)return!1;return!0}function Ee(n,e,t,r,i){const s=4*e;for(let a=r,o=r*s+4*t;a<=i;++a,o+=s)if(n[o+3]!==0)return!1;return!0}function Lr(n,e=1){const{width:t,height:r}=n,i=n.getContext("2d",{willReadFrequently:!0});if(i===null)throw new TypeError("Failed to get canvas 2D context");const a=i.getImageData(0,0,t,r).data;let o=0,l=0,h=t-1,d=r-1;for(;l<r&&Oe(a,t,l);)++l;if(l===r)return ce.EMPTY;for(;Oe(a,t,d);)--d;for(;Ee(a,t,o,l,d);)++o;for(;Ee(a,t,h,l,d);)--h;return++h,++d,new ce(o/e,l/e,(h-o)/e,(d-l)/e)}class Rt{constructor(e){this._activeTextures={},this._renderer=e}getTextureSize(e,t,r){const i=L.measureText(e||" ",r);let s=Math.ceil(Math.ceil(Math.max(1,i.width)+r.padding*2)*t),a=Math.ceil(Math.ceil(Math.max(1,i.height)+r.padding*2)*t);return s=Math.ceil(s-1e-6),a=Math.ceil(a-1e-6),s=Re(s),a=Re(a),{width:s,height:a}}getTexture(e,t,r,i){typeof e=="string"&&(k("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:r,resolution:t}),e.style instanceof I||(e.style=new I(e.style));const{texture:s,canvasAndContext:a}=this.createTextureAndCanvas(e);return this._renderer.texture.initSource(s._source),O.returnCanvasAndContext(a),s}createTextureAndCanvas(e){const{text:t,style:r}=e,i=e.resolution??this._renderer.resolution,s=L.measureText(t||" ",r),a=Math.ceil(Math.ceil(Math.max(1,s.width)+r.padding*2)*i),o=Math.ceil(Math.ceil(Math.max(1,s.height)+r.padding*2)*i),l=O.getOptimalCanvasAndContext(a,o),{canvas:h}=l;this.renderTextToCanvas(t,r,i,l);const d=Ct(h,a,o,i);if(r.trim){const c=Lr(h,i);d.frame.copyFrom(c),d.updateUvs()}return{texture:d,canvasAndContext:l}}getManagedTexture(e){e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;const t=e._getKey();if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].texture;const{texture:r,canvasAndContext:i}=this.createTextureAndCanvas(e);return this._activeTextures[t]={canvasAndContext:i,texture:r,usageCount:1},r}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];if(t.usageCount--,t.usageCount===0){O.returnCanvasAndContext(t.canvasAndContext),H.returnTexture(t.texture);const r=t.texture.source;r.resource=null,r.uploadMethodId="unknown",r.alphaMode="no-premultiply-alpha",this._activeTextures[e]=null}}getReferenceCount(e){return this._activeTextures[e].usageCount}renderTextToCanvas(e,t,r,i){const{canvas:s,context:a}=i,o=te(t),l=L.measureText(e||" ",t),h=l.lines,d=l.lineHeight,c=l.lineWidths,f=l.maxLineWidth,g=l.fontProperties,u=s.height;if(a.resetTransform(),a.scale(r,r),a.textBaseline=t.textBaseline,t._stroke?.width){const y=t._stroke;a.lineWidth=y.width,a.miterLimit=y.miterLimit,a.lineJoin=y.join,a.lineCap=y.cap}a.font=o;let m,x;const _=t.dropShadow?2:1;for(let y=0;y<_;++y){const S=t.dropShadow&&y===0,w=S?Math.ceil(Math.max(1,u)+t.padding*2):0,B=w*r;if(S){a.fillStyle="black",a.strokeStyle="black";const T=t.dropShadow,M=T.color,X=T.alpha;a.shadowColor=R.shared.setValue(M).setAlpha(X).toRgbaString();const se=T.blur*r,ve=T.distance*r;a.shadowBlur=se,a.shadowOffsetX=Math.cos(T.angle)*ve,a.shadowOffsetY=Math.sin(T.angle)*ve+B}else a.fillStyle=t._fill?re(t._fill,a):null,t._stroke?.width&&(a.strokeStyle=re(t._stroke,a)),a.shadowColor="black";let F=(d-g.fontSize)/2;d-g.fontSize<0&&(F=0);const C=t._stroke?.width??0;for(let T=0;T<h.length;T++)m=C/2,x=C/2+T*d+g.ascent+F,t.align==="right"?m+=f-c[T]:t.align==="center"&&(m+=(f-c[T])/2),t._stroke?.width&&this._drawLetterSpacing(h[T],t,i,m+t.padding,x+t.padding-w,!0),t._fill!==void 0&&this._drawLetterSpacing(h[T],t,i,m+t.padding,x+t.padding-w)}}_drawLetterSpacing(e,t,r,i,s,a=!1){const{context:o}=r,l=t.letterSpacing;let h=!1;if(L.experimentalLetterSpacingSupported&&(L.experimentalLetterSpacing?(o.letterSpacing=`${l}px`,o.textLetterSpacing=`${l}px`,h=!0):(o.letterSpacing="0px",o.textLetterSpacing="0px")),l===0||h){a?o.strokeText(e,i,s):o.fillText(e,i,s);return}let d=i;const c=L.graphemeSegmenter(e);let f=o.measureText(e).width,g=0;for(let u=0;u<c.length;++u){const m=c[u];a?o.strokeText(m,d,s):o.fillText(m,d,s);let x="";for(let _=u+1;_<c.length;++_)x+=c[_];g=o.measureText(x).width,d+=f-g+l,f=g}}destroy(){this._activeTextures=null}}Rt.extension={type:[b.WebGLSystem,b.WebGPUSystem,b.CanvasSystem],name:"canvasText"};P.add(Qe);P.add(Je);P.add(ft);P.add(Vt);P.add(mt);P.add(xt);P.add(bt);P.add(Rt);P.add(Pt);P.add(vt);P.add(Te);P.add(Bt);P.add(Tt);P.add(wt);P.add(ot);P.add(nt);
|
||||||
@@ -1,173 +0,0 @@
|
|||||||
import{E as S,U as yt,T as xe,a as We,K as R,L as U,I as M,Q as O,V as _e,W as be,X as q,Y as le,D as Y,k as G,M as H,w as K,R as ae,Z as Tt,_ as W,$ as Z,O as Ue,d as Ae,P as vt,t as ze,c as ee,B as E,q as B,a0 as Ct,a1 as Ge,g as Bt,a2 as Ft,a3 as oe,n as Se,e as F,a4 as Pt,__tla as __tla_0}from"./TorrentDetail-CKmHZcwa.js";import{U as V,T as z,R as he,S as He,i as ce,b as Le,c as De,j as Ie,e as Mt,r as Oe,o as kt,n as Ee,a as Rt,g as Wt,k as Ut,m as At,B as $e,__tla as __tla_1}from"./colorToUniform-rMRo2qOn.js";import{C as I,__tla as __tla_2}from"./CanvasPool-D00IADyo.js";import{g as zt,__tla as __tla_3}from"./getBatchSamplersUniformGroup-B1Z3BKU1.js";import{__tla as __tla_4}from"./ColoredChip.vue_vue_type_script_setup_true_lang-CBDbhtDT.js";import{__tla as __tla_5}from"./index-C0tfT_Qc.js";import"./vue-CfSjRv-x.js";import"./vuetify-PctCzU6r.js";import{__tla as __tla_6}from"./MixedButton.vue_vue_type_script_setup_true_lang-Br4NUWtV.js";import"./FileIcon-DH65fwz5.js";import{__tla as __tla_7}from"./MoveTorrentFileDialog.vue_vue_type_script_setup_true_lang-C8uA-x2z.js";let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})(),(()=>{try{return __tla_3}catch{}})(),(()=>{try{return __tla_4}catch{}})(),(()=>{try{return __tla_5}catch{}})(),(()=>{try{return __tla_6}catch{}})(),(()=>{try{return __tla_7}catch{}})()]).then(async()=>{class Ke{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let t,r;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,r=globalThis.innerHeight;else{const{clientWidth:i,clientHeight:n}=this._resizeTo;t=i,r=n}this.renderer.resize(t,r),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Ke.extension=S.Application;class Ye{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,yt.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?xe.shared:new xe,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Ye.extension=S.Application;class Gt extends We{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return R(U,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return R(U,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return R(U,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return R(U,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return R(U,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=!1){this.emit("destroy",this),this.removeAllListeners();for(const t in this.chars)this.chars[t].texture?.destroy();this.chars=null,e&&(this.pages.forEach(t=>t.texture.destroy(!0)),this.pages=null)}}const we=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function Ve(s){const e=[];let t=0;for(let r=0;r<we.length;r++){const i=`_${we[r]}`;e[t++]=s[i]}return t=je(s._fill,e,t),t=Ht(s._stroke,e,t),t=Lt(s.dropShadow,e,t),e.join("-")}function je(s,e,t){return s&&(e[t++]=s.color,e[t++]=s.alpha,e[t++]=s.fill?.styleKey),t}function Ht(s,e,t){return s&&(t=je(s,e,t),e[t++]=s.width,e[t++]=s.alignment,e[t++]=s.cap,e[t++]=s.join,e[t++]=s.miterLimit),t}function Lt(s,e,t){return s&&(e[t++]=s.alpha,e[t++]=s.angle,e[t++]=s.blur,e[t++]=s.distance,e[t++]=M.shared.setValue(s.color).toNumber()),t}const de=class $ extends We{constructor(e={}){super(),Dt(e);const t={...$.defaultTextStyle,...e};for(const r in t){const i=r;this[i]=t[r]}this.update()}get align(){return this._align}set align(e){this._align=e,this.update()}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update()}get dropShadow(){return this._dropShadow}set dropShadow(e){e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...$.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...$.defaultDropShadow}):null,this.update()}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update()}get fontSize(){return this._fontSize}set fontSize(e){typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update()}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e,this.update()}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update()}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update()}get leading(){return this._leading}set leading(e){this._leading=e,this.update()}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update()}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update()}get padding(){return this._padding}set padding(e){this._padding=e,this.update()}get trim(){return this._trim}set trim(e){this._trim=e,this.update()}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update()}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update()}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update()}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update()}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...O.defaultFillStyle,...e},()=>{this._fill=_e({...this._originalFill},O.defaultFillStyle)})),this._fill=_e(e===0?"black":e,O.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...O.defaultStrokeStyle,...e},()=>{this._stroke=be({...this._originalStroke},O.defaultStrokeStyle)})),this._stroke=be(e,O.defaultStrokeStyle),this.update())}_generateKey(){return this._styleKey=Ve(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this)}reset(){const e=$.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new $({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth})}destroy(e=!1){if(this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){const r=typeof e=="boolean"?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(r),this._originalFill?.texture&&this._originalFill.texture.destroy(r),this._stroke?.texture&&this._stroke.texture.destroy(r),this._originalStroke?.texture&&this._originalStroke.texture.destroy(r)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,t){return new Proxy(e,{set:(r,i,n)=>(r[i]=n,t?.(i,n),this.update(),!0)})}_isFillStyle(e){return(e??null)!==null&&!(M.isColorLike(e)||e instanceof q||e instanceof le)}};de.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};de.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let D=de;function Dt(s){const e=s;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const t=D.defaultDropShadow;s.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance}}if(e.strokeThickness!==void 0){R(U,"strokeThickness is now a part of stroke");const t=e.stroke;let r={};if(M.isColorLike(t))r.color=t;else if(t instanceof q||t instanceof le)r.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))r=t;else throw new Error("Invalid stroke value.");s.stroke={...r,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){R(U,"gradient fill is now a fill pattern: `new FillGradient(...)`");let t;s.fontSize==null?s.fontSize=D.defaultTextStyle.fontSize:typeof s.fontSize=="string"?t=parseInt(s.fontSize,10):t=s.fontSize;const r=new q(0,0,0,t*1.7),i=e.fillGradientStops.map(n=>M.shared.setValue(n).toNumber());i.forEach((n,a)=>{const o=a/(i.length-1);r.addColorStop(o,n)}),s.fill={fill:r}}}const It=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function Q(s){const e=typeof s.fontSize=="number"?`${s.fontSize}px`:s.fontSize;let t=s.fontFamily;Array.isArray(s.fontFamily)||(t=s.fontFamily.split(","));for(let r=t.length-1;r>=0;r--){let i=t[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&!It.includes(i)&&(i=`"${i}"`),t[r]=i}return`${s.fontStyle} ${s.fontVariant} ${s.fontWeight} ${e} ${t.join(",")}`}const te={willReadFrequently:!0},A=class p{static get experimentalLetterSpacingSupported(){let e=p._experimentalLetterSpacingSupported;if(e!==void 0){const t=Y.get().getCanvasRenderingContext2D().prototype;e=p._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,r,i,n,a,o,l,c){this.text=e,this.style=t,this.width=r,this.height=i,this.lines=n,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=l,this.fontProperties=c}static measureText(e=" ",t,r=p._canvas,i=t.wordWrap){const n=`${e}:${t.styleKey}`;if(p._measurementCache[n])return p._measurementCache[n];const a=Q(t),o=p.measureFont(a);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const l=p.__context;l.font=a;const h=(i?p._wordWrap(e,t,r):e).split(/(?:\r\n|\r|\n)/),d=new Array(h.length);let _=0;for(let y=0;y<h.length;y++){const b=p._measureText(h[y],t.letterSpacing,l);d[y]=b,_=Math.max(_,b)}const u=t._stroke?.width||0;let f=_+u;t.dropShadow&&(f+=t.dropShadow.distance);const m=t.lineHeight||o.fontSize;let g=Math.max(m,o.fontSize+u)+(h.length-1)*(m+t.leading);return t.dropShadow&&(g+=t.dropShadow.distance),new p(e,t,f,g,h,d,m+t.leading,_,o)}static _measureText(e,t,r){let i=!1;p.experimentalLetterSpacingSupported&&(p.experimentalLetterSpacing?(r.letterSpacing=`${t}px`,r.textLetterSpacing=`${t}px`,i=!0):(r.letterSpacing="0px",r.textLetterSpacing="0px"));let n=r.measureText(e).width;return n>0&&(i?n-=t:n+=(p.graphemeSegmenter(e).length-1)*t),n}static _wordWrap(e,t,r=p._canvas){const i=r.getContext("2d",te);let n=0,a="",o="";const l=Object.create(null),{letterSpacing:c,whiteSpace:h}=t,d=p._collapseSpaces(h),_=p._collapseNewlines(h);let u=!d;const f=t.wordWrapWidth+c,m=p._tokenize(e);for(let g=0;g<m.length;g++){let x=m[g];if(p._isNewline(x)){if(!_){o+=p._addLine(a),u=!d,a="",n=0;continue}x=" "}if(d){const b=p.isBreakingSpace(x),w=p.isBreakingSpace(a[a.length-1]);if(b&&w)continue}const y=p._getFromCache(x,c,l,i);if(y>f)if(a!==""&&(o+=p._addLine(a),a="",n=0),p.canBreakWords(x,t.breakWords)){const b=p.wordWrapSplit(x);for(let w=0;w<b.length;w++){let T=b[w],P=T,v=1;for(;b[w+v];){const C=b[w+v];if(!p.canBreakChars(P,C,x,w,t.breakWords))T+=C;else break;P=C,v++}w+=v-1;const k=p._getFromCache(T,c,l,i);k+n>f&&(o+=p._addLine(a),u=!1,a="",n=0),a+=T,n+=k}}else{a.length>0&&(o+=p._addLine(a),a="",n=0);const b=g===m.length-1;o+=p._addLine(x,!b),u=!1,a="",n=0}else y+n>f&&(u=!1,o+=p._addLine(a),a="",n=0),(a.length>0||!p.isBreakingSpace(x)||u)&&(a+=x,n+=y)}return o+=p._addLine(a,!1),o}static _addLine(e,t=!0){return e=p._trimRight(e),e=t?`${e}
|
|
||||||
`:e,e}static _getFromCache(e,t,r,i){let n=r[e];return typeof n!="number"&&(n=p._measureText(e,t,i)+t,r[e]=n),n}static _collapseSpaces(e){return e==="normal"||e==="pre-line"}static _collapseNewlines(e){return e==="normal"}static _trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const r=e[t];if(!p.isBreakingSpace(r))break;e=e.slice(0,-1)}return e}static _isNewline(e){return typeof e!="string"?!1:p._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:p._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){const t=[];let r="";if(typeof e!="string")return t;for(let i=0;i<e.length;i++){const n=e[i],a=e[i+1];if(p.isBreakingSpace(n,a)||p._isNewline(n)){r!==""&&(t.push(r),r=""),t.push(n);continue}r+=n}return r!==""&&t.push(r),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,r,i,n){return!0}static wordWrapSplit(e){return p.graphemeSegmenter(e)}static measureFont(e){if(p._fonts[e])return p._fonts[e];const t=p._context;t.font=e;const r=t.measureText(p.METRICS_STRING+p.BASELINE_SYMBOL),i={ascent:r.actualBoundingBoxAscent,descent:r.actualBoundingBoxDescent,fontSize:r.actualBoundingBoxAscent+r.actualBoundingBoxDescent};return p._fonts[e]=i,i}static clearMetrics(e=""){e?delete p._fonts[e]:p._fonts={}}static get _canvas(){if(!p.__canvas){let e;try{const t=new OffscreenCanvas(0,0);if(t.getContext("2d",te)?.measureText)return p.__canvas=t,t;e=Y.get().createCanvas()}catch{e=Y.get().createCanvas()}e.width=e.height=10,p.__canvas=e}return p.__canvas}static get _context(){return p.__context||(p.__context=p._canvas.getContext("2d",te)),p.__context}};A.METRICS_STRING="|\xc9q\xc5";A.BASELINE_SYMBOL="M";A.BASELINE_MULTIPLIER=1.4;A.HEIGHT_MULTIPLIER=2;A.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter=="function"){const s=new Intl.Segmenter;return e=>[...s.segment(e)].map(t=>t.segment)}return s=>[...s]})();A.experimentalLetterSpacing=!1;A._fonts={};A._newlines=[10,13];A._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];A._measurementCache={};let L=A;function J(s,e){if(s.texture===G.WHITE&&!s.fill)return M.shared.setValue(s.color).toHex();if(s.fill){if(s.fill instanceof le){const t=s.fill,r=e.createPattern(t.texture.source.resource,"repeat"),i=t.transform.copyTo(H.shared);return i.scale(t.texture.frame.width,t.texture.frame.height),r.setTransform(i),r}else if(s.fill instanceof q){const t=s.fill;if(t.type==="linear"){const r=e.createLinearGradient(t.x0,t.y0,t.x1,t.y1);return t.gradientStops.forEach(i=>{r.addColorStop(i.offset,M.shared.setValue(i.color).toHex())}),r}}}else{const t=e.createPattern(s.texture.source.resource,"repeat"),r=s.matrix.copyTo(H.shared);return r.scale(s.texture.frame.width,s.texture.frame.height),t.setTransform(r),t}return K("FillStyle not recognised",s),"red"}function Xe(s){if(s==="")return[];typeof s=="string"&&(s=[s]);const e=[];for(let t=0,r=s.length;t<r;t++){const i=s[t];if(Array.isArray(i)){if(i.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);if(i[0].length===0||i[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");const n=i[0].charCodeAt(0),a=i[1].charCodeAt(0);if(a<n)throw new Error("[BitmapFont]: Invalid character range.");for(let o=n,l=a;o<=l;o++)e.push(String.fromCharCode(o))}else e.push(...Array.from(i))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}const Ne=class qe extends Gt{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentPageIndex=-1,this._skipKerning=!1;const t={...qe.defaultOptions,...e};this._textureSize=t.textureSize,this._mipmap=t.mipmap;const r=t.style.clone();t.overrideFill&&(r._fill.color=16777215,r._fill.alpha=1,r._fill.texture=G.WHITE,r._fill.fill=null),this.applyFillAsTint=t.overrideFill;const i=r.fontSize;r.fontSize=this.baseMeasurementFontSize;const n=Q(r);t.overrideSize?r._stroke&&(r._stroke.width*=this.baseRenderedFontSize/i):r.fontSize=this.baseRenderedFontSize=i,this._style=r,this._skipKerning=t.skipKerning??!1,this.resolution=t.resolution??1,this._padding=t.padding??4,this.fontMetrics=L.measureFont(n),this.lineHeight=r.lineHeight||this.fontMetrics.fontSize||r.fontSize}ensureCharacters(e){const t=Xe(e).filter(m=>!this._currentChars.includes(m)).filter((m,g,x)=>x.indexOf(m)===g);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let r;this._currentPageIndex===-1?r=this._nextPage():r=this.pages[this._currentPageIndex];let{canvas:i,context:n}=r.canvasAndContext,a=r.texture.source;const o=this._style;let l=this._currentX,c=this._currentY;const h=this.baseRenderedFontSize/this.baseMeasurementFontSize,d=this._padding*h,_=o.fontStyle==="italic"?2:1;let u=0,f=!1;for(let m=0;m<t.length;m++){const g=t[m],x=L.measureText(g,o,i,!1);x.lineHeight=x.height;const y=_*x.width*h,b=x.height*h,w=y+d*2,T=b+d*2;if(f=!1,g!==`
|
|
||||||
`&&g!=="\r"&&g!==" "&&g!==" "&&(f=!0,u=Math.ceil(Math.max(T,u))),l+w>this._textureSize&&(c+=u,u=T,l=0,c+u>this._textureSize)){a.update();const v=this._nextPage();i=v.canvasAndContext.canvas,n=v.canvasAndContext.context,a=v.texture.source,c=0}const P=y/h-(o.dropShadow?.distance??0)-(o._stroke?.width??0);if(this.chars[g]={id:g.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:P,kerning:{}},f){this._drawGlyph(n,x,l+d,c+d,h,o);const v=a.width*h,k=a.height*h,C=new ae(l/v*a.width,c/k*a.height,w/v*a.width,T/k*a.height);this.chars[g].texture=new G({source:a,frame:C}),l+=Math.ceil(w)}}a.update(),this._currentX=l,this._currentY=c,this._skipKerning&&this._applyKerning(t,n)}get pageTextures(){return R(U,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(e,t){const r=this._measureCache;for(let i=0;i<e.length;i++){const n=e[i];for(let a=0;a<this._currentChars.length;a++){const o=this._currentChars[a];let l=r[n];l||(l=r[n]=t.measureText(n).width);let c=r[o];c||(c=r[o]=t.measureText(o).width);let h=t.measureText(n+o).width,d=h-(l+c);d&&(this.chars[n].kerning[o]=d),h=t.measureText(n+o).width,d=h-(l+c),d&&(this.chars[o].kerning[n]=d)}}}_nextPage(){this._currentPageIndex++;const e=this.resolution,t=I.getOptimalCanvasAndContext(this._textureSize,this._textureSize,e);this._setupContext(t.context,this._style,e);const r=e*(this.baseRenderedFontSize/this.baseMeasurementFontSize),i=new G({source:new Tt({resource:t.canvas,resolution:r,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})}),n={canvasAndContext:t,texture:i};return this.pages[this._currentPageIndex]=n,n}_setupContext(e,t,r){t.fontSize=this.baseRenderedFontSize,e.scale(r,r),e.font=Q(t),t.fontSize=this.baseMeasurementFontSize,e.textBaseline=t.textBaseline;const i=t._stroke,n=i?.width??0;if(i&&(e.lineWidth=n,e.lineJoin=i.join,e.miterLimit=i.miterLimit,e.strokeStyle=J(i,e)),t._fill&&(e.fillStyle=J(t._fill,e)),t.dropShadow){const a=t.dropShadow,o=M.shared.setValue(a.color).toArray(),l=a.blur*r,c=a.distance*r;e.shadowColor=`rgba(${o[0]*255},${o[1]*255},${o[2]*255},${a.alpha})`,e.shadowBlur=l,e.shadowOffsetX=Math.cos(a.angle)*c,e.shadowOffsetY=Math.sin(a.angle)*c}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0}_drawGlyph(e,t,r,i,n,a){const o=t.text,l=t.fontProperties,h=(a._stroke?.width??0)*n,d=r+h/2,_=i-h/2,u=l.descent*n,f=t.lineHeight*n;a.stroke&&h&&e.strokeText(o,d,_+f-u),a._fill&&e.fillText(o,d,_+f-u)}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){const{canvasAndContext:t,texture:r}=this.pages[e];t.canvas.width=t.canvas.width,I.returnCanvasAndContext(t),r.destroy(!0)}this.pages=null}};Ne.defaultOptions={textureSize:512,style:new D,mipmap:!0};let ye=Ne;function Qe(s,e,t){const r={width:0,height:0,offsetY:0,scale:e.fontSize/t.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};r.offsetY=t.baseLineOffset;let i=r.lines[0],n=null,a=!0;const o={spaceWord:!1,width:0,start:0,index:0,positions:[],chars:[]},l=u=>{const f=i.width;for(let m=0;m<o.index;m++){const g=u.positions[m];i.chars.push(u.chars[m]),i.charPositions.push(g+f)}i.width+=u.width,a=!1,o.width=0,o.index=0,o.chars.length=0},c=()=>{let u=i.chars.length-1,f=i.chars[u];for(;f===" ";)i.width-=t.chars[f].xAdvance,f=i.chars[--u];r.width=Math.max(r.width,i.width),i={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},a=!0,r.lines.push(i),r.height+=t.lineHeight},h=t.baseMeasurementFontSize/e.fontSize,d=e.letterSpacing*h,_=e.wordWrapWidth*h;for(let u=0;u<s.length+1;u++){let f;const m=u===s.length;m||(f=s[u]);const g=t.chars[f]||t.chars[" "];if(/(?:\s)/.test(f)||f==="\r"||f===`
|
|
||||||
`||m){if(!a&&e.wordWrap&&i.width+o.width-d>_?(c(),l(o),m||i.charPositions.push(0)):(o.start=i.width,l(o),m||i.charPositions.push(0)),f==="\r"||f===`
|
|
||||||
`)i.width!==0&&c();else if(!m){const w=g.xAdvance+(g.kerning[n]||0)+d;i.width+=w,i.spaceWidth=w,i.spacesIndex.push(i.charPositions.length),i.chars.push(f)}}else{const b=g.kerning[n]||0,w=g.xAdvance+b+d;o.positions[o.index++]=o.width+b,o.chars.push(f),o.width+=w}n=f}return c(),e.align==="center"?Ot(r):e.align==="right"?Et(r):e.align==="justify"&&$t(r),r}function Ot(s){for(let e=0;e<s.lines.length;e++){const t=s.lines[e],r=s.width/2-t.width/2;for(let i=0;i<t.charPositions.length;i++)t.charPositions[i]+=r}}function Et(s){for(let e=0;e<s.lines.length;e++){const t=s.lines[e],r=s.width-t.width;for(let i=0;i<t.charPositions.length;i++)t.charPositions[i]+=r}}function $t(s){const e=s.width;for(let t=0;t<s.lines.length;t++){const r=s.lines[t];let i=0,n=r.spacesIndex[i++],a=0;const o=r.spacesIndex.length,c=(e-r.width)/o;for(let h=0;h<r.charPositions.length;h++)h===n&&(n=r.spacesIndex[i++],a+=c),r.charPositions[h]+=a}}let j=0;class Kt{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1}}getFont(e,t){let r=`${t.fontFamily}-bitmap`,i=!0;if(t._fill.fill&&!t._stroke)r+=t._fill.fill.styleKey,i=!1;else if(t._stroke||t.dropShadow){let a=t.styleKey;a=a.substring(0,a.lastIndexOf("-")),r=`${a}-bitmap`,i=!1}if(!W.has(r)){const a=new ye({style:t,overrideFill:i,overrideSize:!0,...this.defaultOptions});j++,j>50&&K("BitmapText",`You have dynamically created ${j} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),a.once("destroy",()=>{j--,W.remove(r)}),W.set(r,a)}const n=W.get(r);return n.ensureCharacters?.(e),n}getLayout(e,t){const r=this.getFont(e,t);return Qe([...e],t,r)}measureText(e,t){return this.getLayout(e,t)}install(...e){let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:e[2]?.chars,resolution:e[2]?.resolution,padding:e[2]?.padding,skipKerning:e[2]?.skipKerning},R(U,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));const r=t?.name;if(!r)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};const i=t.style,n=i instanceof D?i:new D(i),a=n._fill.fill!==null&&n._fill.fill!==void 0,o=new ye({style:n,overrideFill:a,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:!1}),l=Xe(t.chars);return o.ensureCharacters(l.join("")),W.set(`${r}-bitmap`,o),o.once("destroy",()=>W.remove(`${r}-bitmap`)),o}uninstall(e){const t=`${e}-bitmap`,r=W.get(t);r&&(W.remove(t),r.destroy())}}const Yt=new Kt;class Je{constructor(e){this._renderer=e}push(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:t,filterEffect:e})}pop(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(e){e.action==="pushFilter"?this._renderer.filter.push(e):e.action==="popFilter"&&this._renderer.filter.pop()}destroy(){this._renderer=null}}Je.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"filter"};const Vt=new H;function jt(s,e){return e.clear(),Ze(s,e),e.isValid||e.set(0,0,0,0),s.renderGroup?e.applyMatrix(s.renderGroup.localTransform):e.applyMatrix(s.parentRenderGroup.worldTransform),e}function Ze(s,e){if(s.localDisplayStatus!==7||!s.measurable)return;const t=!!s.effects.length;let r=e;if((s.renderGroup||t)&&(r=Z.get().clear()),s.boundsArea)e.addRect(s.boundsArea,s.worldTransform);else{if(s.renderPipeId){const n=s.bounds;r.addFrame(n.minX,n.minY,n.maxX,n.maxY,s.groupTransform)}const i=s.children;for(let n=0;n<i.length;n++)Ze(i[n],r)}if(t){let i=!1;for(let n=0;n<s.effects.length;n++)s.effects[n].addBounds&&(i||(i=!0,r.applyMatrix(s.parentRenderGroup.worldTransform)),s.effects[n].addBounds(r,!0));i&&(r.applyMatrix(s.parentRenderGroup.worldTransform.copyTo(Vt).invert()),e.addBounds(r,s.relativeGroupTransform)),e.addBounds(r),Z.return(r)}else s.renderGroup&&(e.addBounds(r,s.relativeGroupTransform),Z.return(r))}function Xt(s,e){e.clear();const t=e.matrix;for(let r=0;r<s.length;r++){const i=s[r];i.globalDisplayStatus<7||(e.matrix=i.worldTransform,i.addBounds(e))}return e.matrix=t,e}const Nt=new Ue({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),location:0,format:"float32x2",stride:2*4,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])});class et{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new V({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new Ae({}),this.renderer=e}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){const t=this.renderer,r=e.filterEffect.filters;this._filterStack[this._filterStackIndex]||(this._filterStack[this._filterStackIndex]=this._getFilterData());const i=this._filterStack[this._filterStackIndex];if(this._filterStackIndex++,r.length===0){i.skip=!0;return}const n=i.bounds;e.renderables?Xt(e.renderables,n):e.filterEffect.filterArea?(n.clear(),n.addRect(e.filterEffect.filterArea),n.applyMatrix(e.container.worldTransform)):jt(e.container,n);const a=t.renderTarget.rootRenderTarget.colorTexture.source;let o=a._resolution,l=0,c=a.antialias,h=!1,d=!1;for(let u=0;u<r.length;u++){const f=r[u];if(o=Math.min(o,f.resolution),l+=f.padding,f.antialias!=="inherit"&&(f.antialias==="on"?c=!0:c=!1),!!!(f.compatibleRenderers&t.type)){d=!1;break}if(f.blendRequired&&!(t.backBuffer?.useBackBuffer??!0)){K("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),d=!1;break}d=f.enabled||d,h=h||f.blendRequired}if(!d){i.skip=!0;return}const _=t.renderTarget.rootViewPort;if(n.scale(o).fitBounds(0,_.width,0,_.height).scale(1/o).pad(l).ceil(),!n.isPositive){i.skip=!0;return}i.skip=!1,i.bounds=n,i.blendRequired=h,i.container=e.container,i.filterEffect=e.filterEffect,i.previousRenderSurface=t.renderTarget.renderSurface,i.inputTexture=z.getOptimalTexture(n.width,n.height,o,c),t.renderTarget.bind(i.inputTexture,!0),t.globalUniforms.push({offset:n})}pop(){const e=this.renderer;this._filterStackIndex--;const t=this._filterStack[this._filterStackIndex];if(t.skip)return;this._activeFilterData=t;const r=t.inputTexture,i=t.bounds;let n=G.EMPTY;if(e.renderTarget.finishRenderPass(),t.blendRequired){const o=this._filterStackIndex>0?this._filterStack[this._filterStackIndex-1].bounds:null,l=e.renderTarget.getRenderTarget(t.previousRenderSurface);n=this.getBackTexture(l,i,o)}t.backTexture=n;const a=t.filterEffect.filters;if(this._globalFilterBindGroup.setResource(r.source.style,2),this._globalFilterBindGroup.setResource(n.source,3),e.globalUniforms.pop(),a.length===1)a[0].apply(this,r,t.previousRenderSurface,!1),z.returnTexture(r);else{let o=t.inputTexture,l=z.getOptimalTexture(i.width,i.height,o.source._resolution,!1),c=0;for(c=0;c<a.length-1;++c){a[c].apply(this,o,l,!0);const d=o;o=l,l=d}a[c].apply(this,o,t.previousRenderSurface,!1),z.returnTexture(o),z.returnTexture(l)}t.blendRequired&&z.returnTexture(n)}getBackTexture(e,t,r){const i=e.colorTexture.source._resolution,n=z.getOptimalTexture(t.width,t.height,i,!1);let a=t.minX,o=t.minY;r&&(a-=r.minX,o-=r.minY),a=Math.floor(a*i),o=Math.floor(o*i);const l=Math.ceil(t.width*i),c=Math.ceil(t.height*i);return this.renderer.renderTarget.copyToTexture(e,n,{x:a,y:o},{width:l,height:c},{x:0,y:0}),n}applyFilter(e,t,r,i){const n=this.renderer,a=this._filterStack[this._filterStackIndex],o=a.bounds,l=vt.shared,h=a.previousRenderSurface===r;let d=this.renderer.renderTarget.rootRenderTarget.colorTexture.source._resolution,_=this._filterStackIndex-1;for(;_>0&&this._filterStack[_].skip;)--_;_>0&&(d=this._filterStack[_].inputTexture.source._resolution);const u=this._filterGlobalUniforms,f=u.uniforms,m=f.uOutputFrame,g=f.uInputSize,x=f.uInputPixel,y=f.uInputClamp,b=f.uGlobalFrame,w=f.uOutputTexture;if(h){let v=this._filterStackIndex;for(;v>0;){v--;const k=this._filterStack[this._filterStackIndex-1];if(!k.skip){l.x=k.bounds.minX,l.y=k.bounds.minY;break}}m[0]=o.minX-l.x,m[1]=o.minY-l.y}else m[0]=0,m[1]=0;m[2]=t.frame.width,m[3]=t.frame.height,g[0]=t.source.width,g[1]=t.source.height,g[2]=1/g[0],g[3]=1/g[1],x[0]=t.source.pixelWidth,x[1]=t.source.pixelHeight,x[2]=1/x[0],x[3]=1/x[1],y[0]=.5*x[2],y[1]=.5*x[3],y[2]=t.frame.width*g[2]-.5*x[2],y[3]=t.frame.height*g[3]-.5*x[3];const T=this.renderer.renderTarget.rootRenderTarget.colorTexture;b[0]=l.x*d,b[1]=l.y*d,b[2]=T.source.width*d,b[3]=T.source.height*d;const P=this.renderer.renderTarget.getRenderTarget(r);if(n.renderTarget.bind(r,!!i),r instanceof G?(w[0]=r.frame.width,w[1]=r.frame.height):(w[0]=P.width,w[1]=P.height),w[2]=P.isRoot?-1:1,u.update(),n.renderPipes.uniformBatch){const v=n.renderPipes.uniformBatch.getUboResource(u);this._globalFilterBindGroup.setResource(v,0)}else this._globalFilterBindGroup.setResource(u,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,n.encoder.draw({geometry:Nt,shader:e,state:e._state,topology:"triangle-list"}),n.type===he.WEBGL&&n.renderTarget.finishRenderPass()}_getFilterData(){return{skip:!1,inputTexture:null,bounds:new ze,container:null,filterEffect:null,blendRequired:!1,previousRenderSurface:null}}calculateSpriteMatrix(e,t){const r=this._activeFilterData,i=e.set(r.inputTexture._source.width,0,0,r.inputTexture._source.height,r.bounds.minX,r.bounds.minY),n=t.worldTransform.copyTo(H.shared);return n.invert(),i.prepend(n),i.scale(1/t.texture.frame.width,1/t.texture.frame.height),i.translate(t.anchor.x,t.anchor.y),i}}et.extension={type:[S.WebGLSystem,S.WebGPUSystem],name:"filter"};const tt=class rt extends Ue{constructor(...e){let t=e[0]??{};t instanceof Float32Array&&(R(U,"use new MeshGeometry({ positions, uvs, indices }) instead"),t={positions:t,uvs:e[1],indices:e[2]}),t={...rt.defaultOptions,...t};const r=t.positions||new Float32Array([0,0,1,0,1,1,0,1]),i=t.uvs||new Float32Array([0,0,1,0,1,1,0,1]),n=t.indices||new Uint32Array([0,1,2,0,2,3]),a=t.shrinkBuffersToFit,o=new ee({data:r,label:"attribute-mesh-positions",shrinkToFit:a,usage:E.VERTEX|E.COPY_DST}),l=new ee({data:i,label:"attribute-mesh-uvs",shrinkToFit:a,usage:E.VERTEX|E.COPY_DST}),c=new ee({data:n,label:"index-mesh-buffer",shrinkToFit:a,usage:E.INDEX|E.COPY_DST});super({attributes:{aPosition:{buffer:o,format:"float32x2",stride:2*4,offset:0},aUV:{buffer:l,format:"float32x2",stride:2*4,offset:0}},indexBuffer:c,topology:t.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(e){this.attributes.aPosition.buffer.data=e}get uvs(){return this.attributes.aUV.buffer.data}set uvs(e){this.attributes.aUV.buffer.data=e}get indices(){return this.indexBuffer.data}set indices(e){this.indexBuffer.data=e}};tt.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};let ue=tt;function qt(s){const e=s._stroke,t=s._fill,i=[`div { ${[`color: ${M.shared.setValue(t.color).toHex()}`,`font-size: ${s.fontSize}px`,`font-family: ${s.fontFamily}`,`font-weight: ${s.fontWeight}`,`font-style: ${s.fontStyle}`,`font-variant: ${s.fontVariant}`,`letter-spacing: ${s.letterSpacing}px`,`text-align: ${s.align}`,`padding: ${s.padding}px`,`white-space: ${s.whiteSpace==="pre"&&s.wordWrap?"pre-wrap":s.whiteSpace}`,...s.lineHeight?[`line-height: ${s.lineHeight}px`]:[],...s.wordWrap?[`word-wrap: ${s.breakWords?"break-all":"break-word"}`,`max-width: ${s.wordWrapWidth}px`]:[],...e?[st(e)]:[],...s.dropShadow?[it(s.dropShadow)]:[],...s.cssOverrides].join(";")} }`];return Qt(s.tagStyles,i),i.join(" ")}function it(s){const e=M.shared.setValue(s.color).setAlpha(s.alpha).toHexa(),t=Math.round(Math.cos(s.angle)*s.distance),r=Math.round(Math.sin(s.angle)*s.distance),i=`${t}px ${r}px`;return s.blur>0?`text-shadow: ${i} ${s.blur}px ${e}`:`text-shadow: ${i} ${e}`}function st(s){return[`-webkit-text-stroke-width: ${s.width}px`,`-webkit-text-stroke-color: ${M.shared.setValue(s.color).toHex()}`,`text-stroke-width: ${s.width}px`,`text-stroke-color: ${M.shared.setValue(s.color).toHex()}`,"paint-order: stroke"].join(";")}const Te={fontSize:"font-size: {{VALUE}}px",fontFamily:"font-family: {{VALUE}}",fontWeight:"font-weight: {{VALUE}}",fontStyle:"font-style: {{VALUE}}",fontVariant:"font-variant: {{VALUE}}",letterSpacing:"letter-spacing: {{VALUE}}px",align:"text-align: {{VALUE}}",padding:"padding: {{VALUE}}px",whiteSpace:"white-space: {{VALUE}}",lineHeight:"line-height: {{VALUE}}px",wordWrapWidth:"max-width: {{VALUE}}px"},ve={fill:s=>`color: ${M.shared.setValue(s).toHex()}`,breakWords:s=>`word-wrap: ${s?"break-all":"break-word"}`,stroke:st,dropShadow:it};function Qt(s,e){for(const t in s){const r=s[t],i=[];for(const n in r)ve[n]?i.push(ve[n](r[n])):Te[n]&&i.push(Te[n].replace("{{VALUE}}",r[n]));e.push(`${t} { ${i.join(";")} }`)}}class fe extends D{constructor(e={}){super(e),this._cssOverrides=[],this.cssOverrides??(this.cssOverrides=e.cssOverrides),this.tagStyles=e.tagStyles??{}}set cssOverrides(e){this._cssOverrides=e instanceof Array?e:[e],this.update()}get cssOverrides(){return this._cssOverrides}_generateKey(){return this._styleKey=Ve(this)+this._cssOverrides.join("-"),this._styleKey}update(){this._cssStyle=null,super.update()}clone(){return new fe({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow?{...this.dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides})}get cssStyle(){return this._cssStyle||(this._cssStyle=qt(this)),this._cssStyle}addOverride(...e){const t=e.filter(r=>!this.cssOverrides.includes(r));t.length>0&&(this.cssOverrides.push(...t),this.update())}removeOverride(...e){const t=e.filter(r=>this.cssOverrides.includes(r));t.length>0&&(this.cssOverrides=this.cssOverrides.filter(r=>!t.includes(r)),this.update())}set fill(e){typeof e!="string"&&typeof e!="number"&&K("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=e}set stroke(e){e&&typeof e!="string"&&typeof e!="number"&&K("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=e}}const Ce="http://www.w3.org/2000/svg",Be="http://www.w3.org/1999/xhtml";class nt{constructor(){this.svgRoot=document.createElementNS(Ce,"svg"),this.foreignObject=document.createElementNS(Ce,"foreignObject"),this.domElement=document.createElementNS(Be,"div"),this.styleElement=document.createElementNS(Be,"style"),this.image=new Image;const{foreignObject:e,svgRoot:t,styleElement:r,domElement:i}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(r),e.appendChild(i)}}let Fe;function Jt(s,e,t,r){r=r||Fe||(Fe=new nt);const{domElement:i,styleElement:n,svgRoot:a}=r;i.innerHTML=`<style>${e.cssStyle}</style><div>${s}</div>`,i.setAttribute("style","transform-origin: top left; display: inline-block"),t&&(n.textContent=t),document.body.appendChild(a);const o=i.getBoundingClientRect();a.remove();const l=L.measureFont(e.fontStyle).descent;return{width:o.width,height:o.height+l}}class at{constructor(e,t){this.state=He.for2d(),this._graphicsBatchesHash=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init()}validateRenderable(e){const t=e.context,r=!!this._graphicsBatchesHash[e.uid],i=this.renderer.graphicsContext.updateGpuContext(t);return!!(i.isBatchable||r!==i.isBatchable)}addRenderable(e,t){const r=this.renderer.graphicsContext.updateGpuContext(e.context);e._didGraphicsUpdate&&(e._didGraphicsUpdate=!1,this._rebuild(e)),r.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e))}updateRenderable(e){const t=this._graphicsBatchesHash[e.uid];if(t)for(let r=0;r<t.length;r++){const i=t[r];i.batcher.updateElement(i)}}destroyRenderable(e){this._graphicsBatchesHash[e.uid]&&this._removeBatchForRenderable(e.uid)}execute(e){if(!e.isRenderable)return;const t=this.renderer,r=e.context;if(!t.graphicsContext.getGpuContext(r).batches.length)return;const n=r.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;const a=n.resources.localUniforms.uniforms;a.uTransformMatrix=e.groupTransform,a.uRound=t._roundPixels|e._roundPixels,ce(e.groupColorAlpha,a.uColor,0),this._adaptor.execute(this,e)}_rebuild(e){const t=!!this._graphicsBatchesHash[e.uid],r=this.renderer.graphicsContext.updateGpuContext(e.context);t&&this._removeBatchForRenderable(e.uid),r.isBatchable&&this._initBatchesForRenderable(e),e.batched=r.isBatchable}_addToBatcher(e,t){const r=this.renderer.renderPipes.batch,i=this._getBatchesForRenderable(e);for(let n=0;n<i.length;n++){const a=i[n];r.addToBatch(a,t)}}_getBatchesForRenderable(e){return this._graphicsBatchesHash[e.uid]||this._initBatchesForRenderable(e)}_initBatchesForRenderable(e){const t=e.context,r=this.renderer.graphicsContext.getGpuContext(t),i=this.renderer._roundPixels|e._roundPixels,n=r.batches.map(a=>{const o=B.get(Ct);return a.copyTo(o),o.renderable=e,o.roundPixels=i,o});return this._graphicsBatchesHash[e.uid]===void 0&&e.on("destroyed",()=>{this.destroyRenderable(e)}),this._graphicsBatchesHash[e.uid]=n,n}_removeBatchForRenderable(e){this._graphicsBatchesHash[e].forEach(t=>{B.return(t)}),this._graphicsBatchesHash[e]=null}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;for(const e in this._graphicsBatchesHash)this._removeBatchForRenderable(e);this._graphicsBatchesHash=null}}at.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"graphics"};const ot=class lt extends ue{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(R(U,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),t={width:t,height:e[1],verticesX:e[2],verticesY:e[3]}),this.build(t)}build(e){e={...lt.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;const t=this.verticesX*this.verticesY,r=[],i=[],n=[],a=this.verticesX-1,o=this.verticesY-1,l=this.width/a,c=this.height/o;for(let d=0;d<t;d++){const _=d%this.verticesX,u=d/this.verticesX|0;r.push(_*l,u*c),i.push(_/a,u/o)}const h=a*o;for(let d=0;d<h;d++){const _=d%a,u=d/a|0,f=u*this.verticesX+_,m=u*this.verticesX+_+1,g=(u+1)*this.verticesX+_,x=(u+1)*this.verticesX+_+1;n.push(f,m,g,m,x,g)}this.buffers[0].data=new Float32Array(r),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}};ot.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};let Zt=ot;class pe{constructor(){this.batcher=null,this.batch=null,this.roundPixels=0,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}get blendMode(){return this.mesh.groupBlendMode}reset(){this.mesh=null,this.texture=null,this.batcher=null,this.batch=null}packIndex(e,t,r){const i=this.geometry.indices;for(let n=0;n<i.length;n++)e[t++]=i[n]+r}packAttributes(e,t,r,i){const n=this.mesh,a=this.geometry,o=n.groupTransform,l=i<<16|this.roundPixels&65535,c=o.a,h=o.b,d=o.c,_=o.d,u=o.tx,f=o.ty,m=a.positions,g=a.getBuffer("aUV"),x=g.data;let y=x;const b=this.texture.textureMatrix;b.isSimple||(y=this._transformedUvs,(this._textureMatrixUpdateId!==b._updateID||this._uvUpdateId!==g._updateID)&&((!y||y.length<x.length)&&(y=this._transformedUvs=new Float32Array(x.length)),this._textureMatrixUpdateId=b._updateID,this._uvUpdateId=g._updateID,b.multiplyUvs(x,y)));const w=n.groupColorAlpha;for(let T=0;T<m.length;T+=2){const P=m[T],v=m[T+1];e[r]=c*P+d*v+u,e[r+1]=h*P+_*v+f,e[r+2]=y[T],e[r+3]=y[T+1],t[r+4]=w,t[r+5]=l,r+=6}}get vertexSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}}class ht{constructor(e,t){this.localUniforms=new V({uTransformMatrix:{value:new H,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new Ae({0:this.localUniforms}),this._meshDataHash=Object.create(null),this._gpuBatchableMeshHash=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init()}validateRenderable(e){const t=this._getMeshData(e),r=t.batched,i=e.batched;if(t.batched=i,r!==i)return!0;if(i){const n=e._geometry;if(n.indices.length!==t.indexSize||n.positions.length!==t.vertexSize)return t.indexSize=n.indices.length,t.vertexSize=n.positions.length,!0;const a=this._getBatchableMesh(e),o=e.texture;if(a.texture._source!==o._source&&a.texture._source!==o._source)return!a.batcher.checkAndUpdateTexture(a,o)}return!1}addRenderable(e,t){const r=this.renderer.renderPipes.batch,{batched:i}=this._getMeshData(e);if(i){const n=this._getBatchableMesh(e);n.texture=e._texture,n.geometry=e._geometry,r.addToBatch(n)}else r.break(t),t.add({renderPipeId:"mesh",mesh:e})}updateRenderable(e){if(e.batched){const t=this._gpuBatchableMeshHash[e.uid];t.texture=e._texture,t.geometry=e._geometry,t.batcher.updateElement(t)}}destroyRenderable(e){this._meshDataHash[e.uid]=null;const t=this._gpuBatchableMeshHash[e.uid];t&&(B.return(t),this._gpuBatchableMeshHash[e.uid]=null)}execute({mesh:e}){if(!e.isRenderable)return;e.state.blendMode=Ge(e.groupBlendMode,e.texture._source);const t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),ce(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e)}_getMeshData(e){return this._meshDataHash[e.uid]||this._initMeshData(e)}_initMeshData(e){return this._meshDataHash[e.uid]={batched:e.batched,indexSize:e._geometry.indices?.length,vertexSize:e._geometry.positions?.length},e.on("destroyed",()=>{this.destroyRenderable(e)}),this._meshDataHash[e.uid]}_getBatchableMesh(e){return this._gpuBatchableMeshHash[e.uid]||this._initBatchableMesh(e)}_initBatchableMesh(e){const t=B.get(pe);return t.mesh=e,t.texture=e._texture,t.roundPixels=this.renderer._roundPixels|e._roundPixels,this._gpuBatchableMeshHash[e.uid]=t,t.mesh=e,t}destroy(){for(const e in this._gpuBatchableMeshHash)this._gpuBatchableMeshHash[e]&&B.return(this._gpuBatchableMeshHash[e]);this._gpuBatchableMeshHash=null,this._meshDataHash=null,this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}}ht.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"mesh"};const ct=class dt extends Zt{constructor(e={}){e={...dt.defaultOptions,...e},super({width:e.width,height:e.height,verticesX:4,verticesY:4}),this.update(e)}update(e){this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this.updateUvs(),this.updatePositions()}updatePositions(){const e=this.positions,t=this._leftWidth+this._rightWidth,r=this.width>t?1:this.width/t,i=this._topHeight+this._bottomHeight,n=this.height>i?1:this.height/i,a=Math.min(r,n);e[9]=e[11]=e[13]=e[15]=this._topHeight*a,e[17]=e[19]=e[21]=e[23]=this.height-this._bottomHeight*a,e[25]=e[27]=e[29]=e[31]=this.height,e[2]=e[10]=e[18]=e[26]=this._leftWidth*a,e[4]=e[12]=e[20]=e[28]=this.width-this._rightWidth*a,e[6]=e[14]=e[22]=e[30]=this.width,this.getBuffer("aPosition").update()}updateUvs(){const e=this.uvs;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1;const t=1/this._originalWidth,r=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.getBuffer("aUV").update()}};ct.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};let er=ct;class ut{constructor(e){this._gpuSpriteHash=Object.create(null),this._renderer=e}addRenderable(e,t){const r=this._getGpuSprite(e);e._didSpriteUpdate&&this._updateBatchableSprite(e,r),this._renderer.renderPipes.batch.addToBatch(r)}updateRenderable(e){const t=this._gpuSpriteHash[e.uid];e._didSpriteUpdate&&this._updateBatchableSprite(e,t),t.batcher.updateElement(t)}validateRenderable(e){const t=e._texture,r=this._getGpuSprite(e);return r.texture._source!==t._source?!r.batcher.checkAndUpdateTexture(r,t):!1}destroyRenderable(e){const t=this._gpuSpriteHash[e.uid];B.return(t),this._gpuSpriteHash[e.uid]=null}_updateBatchableSprite(e,t){e._didSpriteUpdate=!1,t.geometry.update(e),t.texture=e._texture}_getGpuSprite(e){return this._gpuSpriteHash[e.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=new pe;return t.geometry=new er,t.mesh=e,t.texture=e._texture,t.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuSpriteHash[e.uid]=t,e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuSpriteHash)this._gpuSpriteHash[e].geometry.destroy();this._gpuSpriteHash=null,this._renderer=null}}ut.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"nineSliceSprite"};const tr={name:"tiling-bit",vertex:{header:`
|
|
||||||
struct TilingUniforms {
|
|
||||||
uMapCoord:mat3x3<f32>,
|
|
||||||
uClampFrame:vec4<f32>,
|
|
||||||
uClampOffset:vec2<f32>,
|
|
||||||
uTextureTransform:mat3x3<f32>,
|
|
||||||
uSizeAnchor:vec4<f32>
|
|
||||||
};
|
|
||||||
|
|
||||||
@group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
|
|
||||||
@group(2) @binding(1) var uTexture: texture_2d<f32>;
|
|
||||||
@group(2) @binding(2) var uSampler: sampler;
|
|
||||||
`,main:`
|
|
||||||
uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy;
|
|
||||||
|
|
||||||
position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy;
|
|
||||||
`},fragment:{header:`
|
|
||||||
struct TilingUniforms {
|
|
||||||
uMapCoord:mat3x3<f32>,
|
|
||||||
uClampFrame:vec4<f32>,
|
|
||||||
uClampOffset:vec2<f32>,
|
|
||||||
uTextureTransform:mat3x3<f32>,
|
|
||||||
uSizeAnchor:vec4<f32>
|
|
||||||
};
|
|
||||||
|
|
||||||
@group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
|
|
||||||
@group(2) @binding(1) var uTexture: texture_2d<f32>;
|
|
||||||
@group(2) @binding(2) var uSampler: sampler;
|
|
||||||
`,main:`
|
|
||||||
|
|
||||||
var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV);
|
|
||||||
coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy;
|
|
||||||
var unclamped = coord;
|
|
||||||
coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw);
|
|
||||||
|
|
||||||
var bias = 0.;
|
|
||||||
|
|
||||||
if(unclamped.x == coord.x && unclamped.y == coord.y)
|
|
||||||
{
|
|
||||||
bias = -32.;
|
|
||||||
}
|
|
||||||
|
|
||||||
outColor = textureSampleBias(uTexture, uSampler, coord, bias);
|
|
||||||
`}},rr={name:"tiling-bit",vertex:{header:`
|
|
||||||
uniform mat3 uTextureTransform;
|
|
||||||
uniform vec4 uSizeAnchor;
|
|
||||||
|
|
||||||
`,main:`
|
|
||||||
uv = (uTextureTransform * vec3(aUV, 1.0)).xy;
|
|
||||||
|
|
||||||
position = (position - uSizeAnchor.zw) * uSizeAnchor.xy;
|
|
||||||
`},fragment:{header:`
|
|
||||||
uniform sampler2D uTexture;
|
|
||||||
uniform mat3 uMapCoord;
|
|
||||||
uniform vec4 uClampFrame;
|
|
||||||
uniform vec2 uClampOffset;
|
|
||||||
`,main:`
|
|
||||||
|
|
||||||
vec2 coord = vUV + ceil(uClampOffset - vUV);
|
|
||||||
coord = (uMapCoord * vec3(coord, 1.0)).xy;
|
|
||||||
vec2 unclamped = coord;
|
|
||||||
coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
|
|
||||||
|
|
||||||
outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0
|
|
||||||
|
|
||||||
`}};let re,ie;class ir extends Le{constructor(){re??(re=De({name:"tiling-sprite-shader",bits:[Mt,tr,Oe]})),ie??(ie=Ie({name:"tiling-sprite-shader",bits:[kt,rr,Ee]}));const e=new V({uMapCoord:{value:new H,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new H,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:ie,gpuProgram:re,resources:{localUniforms:new V({uTransformMatrix:{value:new H,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:G.EMPTY.source,uSampler:G.EMPTY.source.style}})}updateUniforms(e,t,r,i,n,a){const o=this.resources.tilingUniforms,l=a.width,c=a.height,h=a.textureMatrix,d=o.uniforms.uTextureTransform;d.set(r.a*l/e,r.b*l/t,r.c*c/e,r.d*c/t,r.tx/e,r.ty/t),d.invert(),o.uniforms.uMapCoord=h.mapCoord,o.uniforms.uClampFrame=h.uClampFrame,o.uniforms.uClampOffset=h.uClampOffset,o.uniforms.uTextureTransform=d,o.uniforms.uSizeAnchor[0]=e,o.uniforms.uSizeAnchor[1]=t,o.uniforms.uSizeAnchor[2]=i,o.uniforms.uSizeAnchor[3]=n,a&&(this.resources.uTexture=a.source,this.resources.uSampler=a.source.style)}}class sr extends ue{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}}function nr(s,e){const t=s.anchor.x,r=s.anchor.y;e[0]=-t*s.width,e[1]=-r*s.height,e[2]=(1-t)*s.width,e[3]=-r*s.height,e[4]=(1-t)*s.width,e[5]=(1-r)*s.height,e[6]=-t*s.width,e[7]=(1-r)*s.height}function ar(s,e,t,r){let i=0;const n=s.length/e,a=r.a,o=r.b,l=r.c,c=r.d,h=r.tx,d=r.ty;for(t*=e;i<n;){const _=s[t],u=s[t+1];s[t]=a*_+l*u+h,s[t+1]=o*_+c*u+d,t+=e,i++}}function or(s,e){const t=s.texture,r=t.frame.width,i=t.frame.height;let n=0,a=0;s._applyAnchorToTexture&&(n=s.anchor.x,a=s.anchor.y),e[0]=e[6]=-n,e[2]=e[4]=1-n,e[1]=e[3]=-a,e[5]=e[7]=1-a;const o=H.shared;o.copyFrom(s._tileTransform.matrix),o.tx/=s.width,o.ty/=s.height,o.invert(),o.scale(s.width/r,s.height/i),ar(e,2,0,o)}const X=new sr;class ft{constructor(e){this._state=He.default2d,this._tilingSpriteDataHash=Object.create(null),this._renderer=e}validateRenderable(e){const t=this._getTilingSpriteData(e),r=t.canBatch;this._updateCanBatch(e);const i=t.canBatch;if(i&&i===r){const{batchableMesh:n}=t;if(n&&n.texture._source!==e.texture._source)return!n.batcher.checkAndUpdateTexture(n,e.texture)}return r!==i}addRenderable(e,t){const r=this._renderer.renderPipes.batch;this._updateCanBatch(e);const i=this._getTilingSpriteData(e),{geometry:n,canBatch:a}=i;if(a){i.batchableMesh||(i.batchableMesh=new pe);const o=i.batchableMesh;e._didTilingSpriteUpdate&&(e._didTilingSpriteUpdate=!1,this._updateBatchableMesh(e),o.geometry=n,o.mesh=e,o.texture=e._texture),o.roundPixels=this._renderer._roundPixels|e._roundPixels,r.addToBatch(o)}else r.break(t),i.shader||(i.shader=new ir),this.updateRenderable(e),t.add(e)}execute(e){const{shader:t}=this._tilingSpriteDataHash[e.uid];t.groups[0]=this._renderer.globalUniforms.bindGroup;const r=t.resources.localUniforms.uniforms;r.uTransformMatrix=e.groupTransform,r.uRound=this._renderer._roundPixels|e._roundPixels,ce(e.groupColorAlpha,r.uColor,0),this._state.blendMode=Ge(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:X,shader:t,state:this._state})}updateRenderable(e){const t=this._getTilingSpriteData(e),{canBatch:r}=t;if(r){const{batchableMesh:i}=t;e._didTilingSpriteUpdate&&this._updateBatchableMesh(e),i.batcher.updateElement(i)}else if(e._didTilingSpriteUpdate){const{shader:i}=t;i.updateUniforms(e.width,e.height,e._tileTransform.matrix,e.anchor.x,e.anchor.y,e.texture)}e._didTilingSpriteUpdate=!1}destroyRenderable(e){const t=this._getTilingSpriteData(e);t.batchableMesh=null,t.shader?.destroy(),this._tilingSpriteDataHash[e.uid]=null}_getTilingSpriteData(e){return this._tilingSpriteDataHash[e.uid]||this._initTilingSpriteData(e)}_initTilingSpriteData(e){const t=new ue({indices:X.indices,positions:X.positions.slice(),uvs:X.uvs.slice()});return this._tilingSpriteDataHash[e.uid]={canBatch:!0,renderable:e,geometry:t},e.on("destroyed",()=>{this.destroyRenderable(e)}),this._tilingSpriteDataHash[e.uid]}_updateBatchableMesh(e){const t=this._getTilingSpriteData(e),{geometry:r}=t,i=e.texture.source.style;i.addressMode!=="repeat"&&(i.addressMode="repeat",i.update()),or(e,r.uvs),nr(e,r.positions)}destroy(){for(const e in this._tilingSpriteDataHash)this.destroyRenderable(this._tilingSpriteDataHash[e].renderable);this._tilingSpriteDataHash=null,this._renderer=null}_updateCanBatch(e){const t=this._getTilingSpriteData(e),r=e.texture;let i=!0;return this._renderer.type===he.WEBGL&&(i=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=r.textureMatrix.isSimple&&(i||r.source.isPowerOfTwo),t.canBatch}}ft.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"tilingSprite"};const lr={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
||||||
struct LocalUniforms {
|
|
||||||
uColor:vec4<f32>,
|
|
||||||
uTransformMatrix:mat3x3<f32>,
|
|
||||||
uDistance: f32,
|
|
||||||
uRound:f32,
|
|
||||||
}
|
|
||||||
|
|
||||||
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
|
||||||
`,main:`
|
|
||||||
vColor *= localUniforms.uColor;
|
|
||||||
modelMatrix *= localUniforms.uTransformMatrix;
|
|
||||||
`,end:`
|
|
||||||
if(localUniforms.uRound == 1)
|
|
||||||
{
|
|
||||||
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
||||||
}
|
|
||||||
`},fragment:{header:`
|
|
||||||
struct LocalUniforms {
|
|
||||||
uColor:vec4<f32>,
|
|
||||||
uTransformMatrix:mat3x3<f32>,
|
|
||||||
uDistance: f32
|
|
||||||
}
|
|
||||||
|
|
||||||
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
|
||||||
`,main:`
|
|
||||||
outColor = vec4<f32>(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance));
|
|
||||||
`}},hr={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
||||||
uniform mat3 uTransformMatrix;
|
|
||||||
uniform vec4 uColor;
|
|
||||||
uniform float uRound;
|
|
||||||
`,main:`
|
|
||||||
vColor *= uColor;
|
|
||||||
modelMatrix *= uTransformMatrix;
|
|
||||||
`,end:`
|
|
||||||
if(uRound == 1.)
|
|
||||||
{
|
|
||||||
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
||||||
}
|
|
||||||
`},fragment:{header:`
|
|
||||||
uniform float uDistance;
|
|
||||||
`,main:`
|
|
||||||
outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));
|
|
||||||
`}},cr={name:"msdf-bit",fragment:{header:`
|
|
||||||
fn calculateMSDFAlpha(msdfColor:vec4<f32>, shapeColor:vec4<f32>, distance:f32) -> f32 {
|
|
||||||
|
|
||||||
// MSDF
|
|
||||||
var median = msdfColor.r + msdfColor.g + msdfColor.b -
|
|
||||||
min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
|
|
||||||
max(msdfColor.r, max(msdfColor.g, msdfColor.b));
|
|
||||||
|
|
||||||
// SDF
|
|
||||||
median = min(median, msdfColor.a);
|
|
||||||
|
|
||||||
var screenPxDistance = distance * (median - 0.5);
|
|
||||||
var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
|
|
||||||
if (median < 0.01) {
|
|
||||||
alpha = 0.0;
|
|
||||||
} else if (median > 0.99) {
|
|
||||||
alpha = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gamma correction for coverage-like alpha
|
|
||||||
var luma: f32 = dot(shapeColor.rgb, vec3<f32>(0.299, 0.587, 0.114));
|
|
||||||
var gamma: f32 = mix(1.0, 1.0 / 2.2, luma);
|
|
||||||
var coverage: f32 = pow(shapeColor.a * alpha, gamma);
|
|
||||||
|
|
||||||
return coverage;
|
|
||||||
|
|
||||||
}
|
|
||||||
`}},dr={name:"msdf-bit",fragment:{header:`
|
|
||||||
float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {
|
|
||||||
|
|
||||||
// MSDF
|
|
||||||
float median = msdfColor.r + msdfColor.g + msdfColor.b -
|
|
||||||
min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
|
|
||||||
max(msdfColor.r, max(msdfColor.g, msdfColor.b));
|
|
||||||
|
|
||||||
// SDF
|
|
||||||
median = min(median, msdfColor.a);
|
|
||||||
|
|
||||||
float screenPxDistance = distance * (median - 0.5);
|
|
||||||
float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
|
|
||||||
|
|
||||||
if (median < 0.01) {
|
|
||||||
alpha = 0.0;
|
|
||||||
} else if (median > 0.99) {
|
|
||||||
alpha = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gamma correction for coverage-like alpha
|
|
||||||
float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114));
|
|
||||||
float gamma = mix(1.0, 1.0 / 2.2, luma);
|
|
||||||
float coverage = pow(shapeColor.a * alpha, gamma);
|
|
||||||
|
|
||||||
return coverage;
|
|
||||||
}
|
|
||||||
`}};let se,ne;class ur extends Le{constructor(){const e=new V({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new H,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}}),t=Bt();se??(se=De({name:"sdf-shader",bits:[Rt,Wt(t),lr,cr,Oe]})),ne??(ne=Ie({name:"sdf-shader",bits:[Ut,At(t),hr,dr,Ee]})),super({glProgram:ne,gpuProgram:se,resources:{localUniforms:e,batchSamplers:zt(t)}})}}class pt{constructor(e){this._gpuBitmapText={},this._renderer=e}validateRenderable(e){const t=this._getGpuBitmapText(e);return e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,t)),this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){const r=this._getGpuBitmapText(e);Pe(e,r),e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,r)),this._renderer.renderPipes.graphics.addRenderable(r,t),r.context.customShader&&this._updateDistanceField(e)}destroyRenderable(e){this._destroyRenderableByUid(e.uid)}_destroyRenderableByUid(e){const t=this._gpuBitmapText[e].context;t.customShader&&(B.return(t.customShader),t.customShader=null),B.return(this._gpuBitmapText[e]),this._gpuBitmapText[e]=null}updateRenderable(e){const t=this._getGpuBitmapText(e);Pe(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e)}_updateContext(e,t){const{context:r}=t,i=Yt.getFont(e.text,e._style);r.clear(),i.distanceField.type!=="none"&&(r.customShader||(r.customShader=B.get(ur)));const n=Array.from(e.text),a=e._style;let o=i.baseLineOffset;const l=Qe(n,a,i);let c=0;const h=a.padding,d=l.scale;r.translate(-e._anchor._x*l.width-h,-e._anchor._y*(l.height+l.offsetY)-h).scale(d,d);const _=i.applyFillAsTint?a._fill.color:16777215;for(let u=0;u<l.lines.length;u++){const f=l.lines[u];for(let m=0;m<f.charPositions.length;m++){const g=n[c++],x=i.chars[g];x?.texture&&r.texture(x.texture,_||"black",Math.round(f.charPositions[m]+x.xOffset),Math.round(o+x.yOffset))}o+=i.lineHeight}}_getGpuBitmapText(e){return this._gpuBitmapText[e.uid]||this.initGpuText(e)}initGpuText(e){const t=B.get(Ft);return this._gpuBitmapText[e.uid]=t,this._updateContext(e,t),e.on("destroyed",()=>{this.destroyRenderable(e)}),this._gpuBitmapText[e.uid]}_updateDistanceField(e){const t=this._getGpuBitmapText(e).context,r=e._style.fontFamily,i=W.get(`${r}-bitmap`),{a:n,b:a,c:o,d:l}=e.groupTransform,c=Math.sqrt(n*n+a*a),h=Math.sqrt(o*o+l*l),d=(Math.abs(c)+Math.abs(h))/2,_=i.baseRenderedFontSize/e._style.fontSize,u=d*i.distanceField.range*(1/_);t.customShader.resources.localUniforms.uniforms.uDistance=u}destroy(){for(const e in this._gpuBitmapText)this._destroyRenderableByUid(e);this._gpuBitmapText=null,this._renderer=null}}pt.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"bitmapText"};function Pe(s,e){e.groupTransform=s.groupTransform,e.groupColorAlpha=s.groupColorAlpha,e.groupColor=s.groupColor,e.groupBlendMode=s.groupBlendMode,e.globalDisplayStatus=s.globalDisplayStatus,e.groupTransform=s.groupTransform,e.localDisplayStatus=s.localDisplayStatus,e.groupAlpha=s.groupAlpha,e._roundPixels=s._roundPixels}class gt{constructor(e){this._gpuText=Object.create(null),this._renderer=e}validateRenderable(e){const t=this._getGpuText(e),r=e._getKey();return t.textureNeedsUploading?(t.textureNeedsUploading=!1,!0):t.currentKey!==r}addRenderable(e){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),this._renderer.renderPipes.batch.addToBatch(r)}updateRenderable(e){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),r.batcher.updateElement(r)}destroyRenderable(e){this._destroyRenderableById(e.uid)}_destroyRenderableById(e){const t=this._gpuText[e];this._renderer.htmlText.decreaseReferenceCount(t.currentKey),B.return(t.batchableSprite),this._gpuText[e]=null}_updateText(e){const t=e._getKey(),r=this._getGpuText(e),i=r.batchableSprite;r.currentKey!==t&&this._updateGpuText(e).catch(a=>{console.error(a)}),e._didTextUpdate=!1;const n=e._style.padding;oe(i.bounds,e._anchor,i.texture,n)}async _updateGpuText(e){e._didTextUpdate=!1;const t=this._getGpuText(e);if(t.generatingTexture)return;const r=e._getKey();this._renderer.htmlText.decreaseReferenceCount(t.currentKey),t.generatingTexture=!0,t.currentKey=r;const i=e.resolution??this._renderer.resolution,n=await this._renderer.htmlText.getManagedTexture(e.text,i,e._style,e._getKey()),a=t.batchableSprite;a.texture=t.texture=n,t.generatingTexture=!1,t.textureNeedsUploading=!0,e.onViewUpdate();const o=e._style.padding;oe(a.bounds,e._anchor,a.texture,o)}_getGpuText(e){return this._gpuText[e.uid]||this.initGpuText(e)}initGpuText(e){const t={texture:G.EMPTY,currentKey:"--",batchableSprite:B.get($e),textureNeedsUploading:!1,generatingTexture:!1},r=t.batchableSprite;return r.renderable=e,r.texture=G.EMPTY,r.bounds={minX:0,maxX:1,minY:0,maxY:0},r.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuText[e.uid]=t,e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuText)this._destroyRenderableById(e);this._gpuText=null,this._renderer=null}}gt.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"htmlText"};function fr(){const{userAgent:s}=Y.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(s)}const pr=new ze;function mt(s,e,t,r){const i=pr;i.minX=0,i.minY=0,i.maxX=s.width/r|0,i.maxY=s.height/r|0;const n=z.getOptimalTexture(i.width,i.height,r,!1);return n.source.uploadMethodId="image",n.source.resource=s,n.source.alphaMode="premultiply-alpha-on-upload",n.frame.width=e/r,n.frame.height=t/r,n.source.emit("update",n.source),n.updateUvs(),n}function gr(s,e){const t=e.fontFamily,r=[],i={},n=/font-family:([^;"\s]+)/g,a=s.match(n);function o(l){i[l]||(r.push(l),i[l]=!0)}if(Array.isArray(t))for(let l=0;l<t.length;l++)o(t[l]);else o(t);a&&a.forEach(l=>{const c=l.split(":")[1].trim();o(c)});for(const l in e.tagStyles){const c=e.tagStyles[l].fontFamily;o(c)}return r}async function mr(s){const t=await (await Y.get().fetch(s)).blob(),r=new FileReader;return await new Promise((n,a)=>{r.onloadend=()=>n(r.result),r.onerror=a,r.readAsDataURL(t)})}async function Me(s,e){const t=await mr(e);return`@font-face {
|
|
||||||
font-family: "${s.fontFamily}";
|
|
||||||
src: url('${t}');
|
|
||||||
font-weight: ${s.fontWeight};
|
|
||||||
font-style: ${s.fontStyle};
|
|
||||||
}`}const N=new Map;async function xr(s,e,t){const r=s.filter(i=>W.has(`${i}-and-url`)).map((i,n)=>{if(!N.has(i)){const{url:a}=W.get(`${i}-and-url`);n===0?N.set(i,Me(e,a)):N.set(i,Me({fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:i},a))}return N.get(i)});return(await Promise.all(r)).join(`
|
|
||||||
`)}function _r(s,e,t,r,i){const{domElement:n,styleElement:a,svgRoot:o}=i;n.innerHTML=`<style>${e.cssStyle}</style><div>${s}</div>`,n.setAttribute("style",`transform: scale(${t});transform-origin: top left; display: inline-block`),a.textContent=r;const{width:l,height:c}=i.image;return o.setAttribute("width",l.toString()),o.setAttribute("height",c.toString()),new XMLSerializer().serializeToString(o)}function br(s,e){const t=I.getOptimalCanvasAndContext(s.width,s.height,e),{context:r}=t;return r.clearRect(0,0,s.width,s.height),r.drawImage(s,0,0),I.returnCanvasAndContext(t),t.canvas}function Sr(s,e,t){return new Promise(async r=>{t&&await new Promise(i=>setTimeout(i,100)),s.onload=()=>{r()},s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,s.crossOrigin="anonymous"})}class ge{constructor(e){this._activeTextures={},this._renderer=e,this._createCanvas=e.type===he.WEBGPU}getTexture(e){return this._buildTexturePromise(e.text,e.resolution,e.style)}getManagedTexture(e,t,r,i){if(this._activeTextures[i])return this._increaseReferenceCount(i),this._activeTextures[i].promise;const n=this._buildTexturePromise(e,t,r).then(a=>(this._activeTextures[i].texture=a,a));return this._activeTextures[i]={texture:null,promise:n,usageCount:1},n}async _buildTexturePromise(e,t,r){const i=B.get(nt),n=gr(e,r),a=await xr(n,r,fe.defaultTextStyle),o=Jt(e,r,a,i),l=Math.ceil(Math.ceil(Math.max(1,o.width)+r.padding*2)*t),c=Math.ceil(Math.ceil(Math.max(1,o.height)+r.padding*2)*t),h=i.image;h.width=l|0,h.height=c|0;const d=_r(e,r,t,a,i);await Sr(h,d,fr()&&n.length>0);let _=h;this._createCanvas&&(_=br(h,t));const u=mt(_,h.width,h.height,t);return this._createCanvas&&this._renderer.texture.initSource(u.source),B.return(i),u}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];t&&(t.usageCount--,t.usageCount===0&&(t.texture?this._cleanUp(t):t.promise.then(r=>{t.texture=r,this._cleanUp(t)}).catch(()=>{K("HTMLTextSystem: Failed to clean texture")}),this._activeTextures[e]=null))}_cleanUp(e){z.returnTexture(e.texture),e.texture.source.resource=null,e.texture.source.uploadMethodId="unknown"}getReferenceCount(e){return this._activeTextures[e].usageCount}destroy(){this._activeTextures=null}}ge.extension={type:[S.WebGLSystem,S.WebGPUSystem,S.CanvasSystem],name:"htmlText"};ge.defaultFontOptions={fontFamily:"Arial",fontStyle:"normal",fontWeight:"normal"};class xt{constructor(e){this._gpuText=Object.create(null),this._renderer=e}validateRenderable(e){const t=this._getGpuText(e),r=e._getKey();if(t.currentKey!==r){const i=e.resolution??this._renderer.resolution,{width:n,height:a}=this._renderer.canvasText.getTextureSize(e.text,i,e._style);return!(this._renderer.canvasText.getReferenceCount(t.currentKey)===1&&n===t.texture._source.width&&a===t.texture._source.height)}return!1}addRenderable(e,t){const i=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),this._renderer.renderPipes.batch.addToBatch(i)}updateRenderable(e){const r=this._getGpuText(e).batchableSprite;e._didTextUpdate&&this._updateText(e),r.batcher.updateElement(r)}destroyRenderable(e){this._destroyRenderableById(e.uid)}_destroyRenderableById(e){const t=this._gpuText[e];this._renderer.canvasText.decreaseReferenceCount(t.currentKey),B.return(t.batchableSprite),this._gpuText[e]=null}_updateText(e){const t=e._getKey(),r=this._getGpuText(e),i=r.batchableSprite;r.currentKey!==t&&this._updateGpuText(e),e._didTextUpdate=!1;const n=e._style.padding;oe(i.bounds,e._anchor,i.texture,n)}_updateGpuText(e){const t=this._getGpuText(e),r=t.batchableSprite;t.texture&&this._renderer.canvasText.decreaseReferenceCount(t.currentKey),t.texture=r.texture=this._renderer.canvasText.getManagedTexture(e),t.currentKey=e._getKey(),r.texture=t.texture}_getGpuText(e){return this._gpuText[e.uid]||this.initGpuText(e)}initGpuText(e){const t={texture:null,currentKey:"--",batchableSprite:B.get($e)};return t.batchableSprite.renderable=e,t.batchableSprite.bounds={minX:0,maxX:1,minY:0,maxY:0},t.batchableSprite.roundPixels=this._renderer._roundPixels|e._roundPixels,this._gpuText[e.uid]=t,this._updateText(e),e.on("destroyed",()=>{this.destroyRenderable(e)}),t}destroy(){for(const e in this._gpuText)this._destroyRenderableById(e);this._gpuText=null,this._renderer=null}}xt.extension={type:[S.WebGLPipes,S.WebGPUPipes,S.CanvasPipes],name:"text"};function ke(s,e,t){for(let r=0,i=4*t*e;r<e;++r,i+=4)if(s[i+3]!==0)return!1;return!0}function Re(s,e,t,r,i){const n=4*e;for(let a=r,o=r*n+4*t;a<=i;++a,o+=n)if(s[o+3]!==0)return!1;return!0}function wr(s,e=1){const{width:t,height:r}=s,i=s.getContext("2d",{willReadFrequently:!0});if(i===null)throw new TypeError("Failed to get canvas 2D context");const a=i.getImageData(0,0,t,r).data;let o=0,l=0,c=t-1,h=r-1;for(;l<r&&ke(a,t,l);)++l;if(l===r)return ae.EMPTY;for(;ke(a,t,h);)--h;for(;Re(a,t,o,l,h);)++o;for(;Re(a,t,c,l,h);)--c;return++c,++h,new ae(o/e,l/e,(c-o)/e,(h-l)/e)}class _t{constructor(e){this._activeTextures={},this._renderer=e}getTextureSize(e,t,r){const i=L.measureText(e||" ",r);let n=Math.ceil(Math.ceil(Math.max(1,i.width)+r.padding*2)*t),a=Math.ceil(Math.ceil(Math.max(1,i.height)+r.padding*2)*t);return n=Math.ceil(n-1e-6),a=Math.ceil(a-1e-6),n=Se(n),a=Se(a),{width:n,height:a}}getTexture(e,t,r,i){typeof e=="string"&&(R("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:r,resolution:t}),e.style instanceof D||(e.style=new D(e.style));const{texture:n,canvasAndContext:a}=this.createTextureAndCanvas(e);return this._renderer.texture.initSource(n._source),I.returnCanvasAndContext(a),n}createTextureAndCanvas(e){const{text:t,style:r}=e,i=e.resolution??this._renderer.resolution,n=L.measureText(t||" ",r),a=Math.ceil(Math.ceil(Math.max(1,n.width)+r.padding*2)*i),o=Math.ceil(Math.ceil(Math.max(1,n.height)+r.padding*2)*i),l=I.getOptimalCanvasAndContext(a,o),{canvas:c}=l;this.renderTextToCanvas(t,r,i,l);const h=mt(c,a,o,i);if(r.trim){const d=wr(c,i);h.frame.copyFrom(d),h.updateUvs()}return{texture:h,canvasAndContext:l}}getManagedTexture(e){const t=e._getKey();if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].texture;const{texture:r,canvasAndContext:i}=this.createTextureAndCanvas(e);return this._activeTextures[t]={canvasAndContext:i,texture:r,usageCount:1},r}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];if(t.usageCount--,t.usageCount===0){I.returnCanvasAndContext(t.canvasAndContext),z.returnTexture(t.texture);const r=t.texture.source;r.resource=null,r.uploadMethodId="unknown",r.alphaMode="no-premultiply-alpha",this._activeTextures[e]=null}}getReferenceCount(e){return this._activeTextures[e].usageCount}renderTextToCanvas(e,t,r,i){const{canvas:n,context:a}=i,o=Q(t),l=L.measureText(e||" ",t),c=l.lines,h=l.lineHeight,d=l.lineWidths,_=l.maxLineWidth,u=l.fontProperties,f=n.height;a.resetTransform(),a.scale(r,r);const m=t.padding*2;if(a.clearRect(0,0,l.width+4+m,l.height+4+m),t._stroke?.width){const b=t._stroke;a.lineWidth=b.width,a.miterLimit=b.miterLimit,a.lineJoin=b.join,a.lineCap=b.cap}a.font=o;let g,x;const y=t.dropShadow?2:1;for(let b=0;b<y;++b){const w=t.dropShadow&&b===0,T=w?Math.ceil(Math.max(1,f)+t.padding*2):0,P=T*r;if(w){a.fillStyle="black",a.strokeStyle="black";const C=t.dropShadow,bt=C.color,St=C.alpha;a.shadowColor=M.shared.setValue(bt).setAlpha(St).toRgbaString();const wt=C.blur*r,me=C.distance*r;a.shadowBlur=wt,a.shadowOffsetX=Math.cos(C.angle)*me,a.shadowOffsetY=Math.sin(C.angle)*me+P}else a.globalAlpha=t._fill?.alpha??1,a.fillStyle=t._fill?J(t._fill,a):null,t._stroke?.width&&(a.strokeStyle=J(t._stroke,a)),a.shadowColor="black";let v=(h-u.fontSize)/2;h-u.fontSize<0&&(v=0);const k=t._stroke?.width??0;for(let C=0;C<c.length;C++)g=k/2,x=k/2+C*h+u.ascent+v,t.align==="right"?g+=_-d[C]:t.align==="center"&&(g+=(_-d[C])/2),t._stroke?.width&&this._drawLetterSpacing(c[C],t,i,g+t.padding,x+t.padding-T,!0),t._fill!==void 0&&this._drawLetterSpacing(c[C],t,i,g+t.padding,x+t.padding-T)}}_drawLetterSpacing(e,t,r,i,n,a=!1){const{context:o}=r,l=t.letterSpacing;let c=!1;if(L.experimentalLetterSpacingSupported&&(L.experimentalLetterSpacing?(o.letterSpacing=`${l}px`,o.textLetterSpacing=`${l}px`,c=!0):(o.letterSpacing="0px",o.textLetterSpacing="0px")),l===0||c){a?o.strokeText(e,i,n):o.fillText(e,i,n);return}let h=i;const d=L.graphemeSegmenter(e);let _=o.measureText(e).width,u=0;for(let f=0;f<d.length;++f){const m=d[f];a?o.strokeText(m,h,n):o.fillText(m,h,n);let g="";for(let x=f+1;x<d.length;++x)g+=d[x];u=o.measureText(g).width,h+=_-u+l,_=u}}destroy(){this._activeTextures=null}}_t.extension={type:[S.WebGLSystem,S.WebGPUSystem,S.CanvasSystem],name:"canvasText"};F.add(Ke);F.add(Ye);F.add(at);F.add(Pt);F.add(ht);F.add(_t);F.add(xt);F.add(pt);F.add(ge);F.add(gt);F.add(ft);F.add(ut);F.add(et);F.add(Je)});export{__tla};
|
|
||||||
@@ -12,15 +12,17 @@
|
|||||||
<link rel="icon" href="icon.svg" type="image/svg+xml" />
|
<link rel="icon" href="icon.svg" type="image/svg+xml" />
|
||||||
<link rel="apple-touch-icon" href="apple-touch-icon.png" />
|
<link rel="apple-touch-icon" href="apple-touch-icon.png" />
|
||||||
<meta name="theme-color" content="#000" />
|
<meta name="theme-color" content="#000" />
|
||||||
|
<meta name="robots" content="noindex, nofollow" />
|
||||||
<title>VueTorrent</title>
|
<title>VueTorrent</title>
|
||||||
|
|
||||||
|
|
||||||
<!-- PWA setup -->
|
<!-- PWA setup -->
|
||||||
<link rel="manifest" href="manifest.webmanifest" crossorigin="use-credentials" />
|
<link rel="manifest" href="manifest.webmanifest" crossorigin="use-credentials" />
|
||||||
<script src="registerSW.js"></script>
|
<script src="registerSW.js"></script>
|
||||||
<script type="module" crossorigin src="./assets/index-C0tfT_Qc.js"></script>
|
<script type="module" crossorigin src="./assets/index-BhWmfNB5.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="./assets/vue-CfSjRv-x.js">
|
<link rel="modulepreload" crossorigin href="./assets/vue-DFryKk-1.js">
|
||||||
<link rel="modulepreload" crossorigin href="./assets/vuetify-PctCzU6r.js">
|
<link rel="modulepreload" crossorigin href="./assets/vuetify-XtA0Y0Oj.js">
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index-DrdRrMdo.css">
|
<link rel="stylesheet" crossorigin href="./assets/index-X6gg79ld.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -1,22 +1,115 @@
|
|||||||
{
|
{
|
||||||
"name": "VueTorrent",
|
|
||||||
"short_name": "VueTorrent",
|
|
||||||
"start_url": ".",
|
|
||||||
"display": "standalone",
|
|
||||||
"background_color": "#000",
|
"background_color": "#000",
|
||||||
"lang": "en",
|
"categories": [
|
||||||
"scope": "./",
|
"utilities"
|
||||||
"theme_color": "#597566",
|
],
|
||||||
|
"description": "The sleekest looking WEBUI for qBittorrent made with Vuejs!",
|
||||||
|
"display": "standalone",
|
||||||
|
"file_handlers": [
|
||||||
|
{
|
||||||
|
"action": ".",
|
||||||
|
"accept": {
|
||||||
|
"application/x-bittorrent": [
|
||||||
|
".torrent"
|
||||||
|
],
|
||||||
|
"text/magnet": [
|
||||||
|
".magnet"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "./icon-192.png",
|
"src": "icon-192.png",
|
||||||
"type": "image/png",
|
"type": "image/png",
|
||||||
"sizes": "192x192"
|
"sizes": "192x192"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "./icon-512.png",
|
"src": "icon-512.png",
|
||||||
"type": "image/png",
|
"type": "image/png",
|
||||||
"sizes": "512x512"
|
"sizes": "512x512"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"lang": "en",
|
||||||
|
"launch_handler": {
|
||||||
|
"client_mode": "focus-existing"
|
||||||
|
},
|
||||||
|
"name": "VueTorrent",
|
||||||
|
"orientation": "any",
|
||||||
|
"protocol_handlers": [
|
||||||
|
{
|
||||||
|
"protocol": "magnet",
|
||||||
|
"url": "#/magnet/%s"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"scope": "./",
|
||||||
|
"screenshots": [
|
||||||
|
{
|
||||||
|
"src": "screenshots/screenshot-desktop.jpeg",
|
||||||
|
"sizes": "1788x909",
|
||||||
|
"type": "image/jpeg",
|
||||||
|
"form_factor": "wide",
|
||||||
|
"label": "Screenshot Desktop (Light Mode)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "screenshots/screenshot-desktop-dark-mode.jpeg",
|
||||||
|
"sizes": "1788x909",
|
||||||
|
"type": "image/jpeg",
|
||||||
|
"form_factor": "wide",
|
||||||
|
"label": "Screenshot Desktop (Dark Mode)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "screenshots/screenshot-mobile.jpeg",
|
||||||
|
"sizes": "425x885",
|
||||||
|
"type": "image/jpeg",
|
||||||
|
"form_factor": "narrow",
|
||||||
|
"label": "Screenshot Mobile Dashboard (Light Mode)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "screenshots/screenshot-mobile-navbar.jpeg",
|
||||||
|
"sizes": "425x885",
|
||||||
|
"type": "image/jpeg",
|
||||||
|
"form_factor": "narrow",
|
||||||
|
"label": "Screenshot Mobile Navbar (Light Mode)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "screenshots/screenshot-mobile-dark-mode.jpeg",
|
||||||
|
"sizes": "425x885",
|
||||||
|
"type": "image/jpeg",
|
||||||
|
"form_factor": "narrow",
|
||||||
|
"label": "Screenshot Mobile Dashboard (Dark Mode)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "screenshots/screenshot-mobile-navbar-dark-mode.jpeg",
|
||||||
|
"sizes": "425x885",
|
||||||
|
"type": "image/jpeg",
|
||||||
|
"form_factor": "narrow",
|
||||||
|
"label": "Screenshot Mobile Navbar (Dark Mode)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"short_name": "VueTorrent",
|
||||||
|
"shortcuts": [
|
||||||
|
{
|
||||||
|
"name": "Dashboard",
|
||||||
|
"url": "#/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Settings",
|
||||||
|
"url": "#/settings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RSS Feeds",
|
||||||
|
"url": "#/rss"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Search Engine",
|
||||||
|
"url": "#/search"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Logs",
|
||||||
|
"url": "#/logs"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"theme_color": "#64CEAA"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
User-agent: *
|
User-agent: *
|
||||||
Disallow:
|
Disallow: /
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 238 KiB |
BIN
qbit/vuetorrent/public/screenshots/screenshot-desktop.jpeg
Normal file
BIN
qbit/vuetorrent/public/screenshots/screenshot-desktop.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 221 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 85 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
BIN
qbit/vuetorrent/public/screenshots/screenshot-mobile-navbar.jpeg
Normal file
BIN
qbit/vuetorrent/public/screenshots/screenshot-mobile-navbar.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
BIN
qbit/vuetorrent/public/screenshots/screenshot-mobile.jpeg
Normal file
BIN
qbit/vuetorrent/public/screenshots/screenshot-mobile.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
@@ -1 +1 @@
|
|||||||
2.10.2
|
2.19.0
|
||||||
Reference in New Issue
Block a user