Files
dotfiles/qbit/vuetorrent/public/assets/Dashboard-Dm_HpGRr.js
2024-04-21 16:42:32 -04:00

1 line
54 KiB
JavaScript

import{g as S,G as Ae,_ as U,c as v,I as c,W as f,X as y,m as d,u as h,K as m,a6 as ut,M as p,F as H,n as G,J as A,O as V,d as N,r as dt,H as De,x as ct,L as B,N as re,P as Me,Q as ke,T as ht,U as tt,Y as Z,Z as ae,a7 as ze,a8 as Be,a9 as We,aa as Pt,ab as Lt,w as Ot,q as Nt,A as Ne}from"./vue-BSryv7ps.js";import{ax as ne,ay as Ht,T as me,az as g,f as se,aA as ee,R as Ft,aB as Ut,h as Re,i as O,aC as Q,k as He,w as mt,y as _e,a as Xe,V as fe,c as Ye,d as Te,e as Qe,g as Ze,j as Je,S as Pe,aD as Kt,aE as Fe,v as et,x as xe,A as Ie,m as ft,a0 as Gt,aF as pt,r as K,aG as Ve,I as le,aH as qt,aI as jt,aJ as gt,H as Le,aK as bt,aL as vt,aM as zt,aN as Wt,aO as M,aP as yt,Q as Xt,aQ as Yt,au as Qt,aR as Zt,C as at,aS as Ue,aT as Jt,__tla as __tla_0}from"./index-bUuJUL5l.js";import{d as ea}from"./index-BIiPWG4K.js";import{_ as ta,a as nt,__tla as __tla_1}from"./MoveTorrentDialog.vue_vue_type_script_setup_true_lang-Bt9E0pwX.js";import{u as _t}from"./vuetify-i5Qjiq6M.js";import{u as aa,__tla as __tla_2}from"./ArrayPagination-DuWOkPss.js";let Jn;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})(),(()=>{try{return __tla_1}catch{}})(),(()=>{try{return __tla_2}catch{}})()]).then(async()=>{function L(a,e){na(a)&&(a="100%");const t=oa(a);return a=e===360?a:Math.min(e,Math.max(0,parseFloat(a))),t&&(a=parseInt(String(a*e),10)/100),Math.abs(a-e)<1e-6?1:(e===360?a=(a<0?a%e+e:a%e)/parseFloat(String(e)):a=a%e/parseFloat(String(e)),a)}function Se(a){return Math.min(1,Math.max(0,a))}function na(a){return typeof a=="string"&&a.indexOf(".")!==-1&&parseFloat(a)===1}function oa(a){return typeof a=="string"&&a.indexOf("%")!==-1}function kt(a){return a=parseFloat(a),(isNaN(a)||a<0||a>1)&&(a=1),a}function Ce(a){return Number(a)<=1?`${Number(a)*100}%`:a}function oe(a){return a.length===1?"0"+a:String(a)}function ra(a,e,t){return{r:L(a,255)*255,g:L(e,255)*255,b:L(t,255)*255}}function ot(a,e,t){a=L(a,255),e=L(e,255),t=L(t,255);const n=Math.max(a,e,t),o=Math.min(a,e,t);let r=0,s=0;const l=(n+o)/2;if(n===o)s=0,r=0;else{const i=n-o;switch(s=l>.5?i/(2-n-o):i/(n+o),n){case a:r=(e-t)/i+(e<t?6:0);break;case e:r=(t-a)/i+2;break;case t:r=(a-e)/i+4;break}r/=6}return{h:r,s,l}}function Ke(a,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?a+(e-a)*(6*t):t<1/2?e:t<2/3?a+(e-a)*(2/3-t)*6:a}function sa(a,e,t){let n,o,r;if(a=L(a,360),e=L(e,100),t=L(t,100),e===0)o=t,r=t,n=t;else{const s=t<.5?t*(1+e):t+e-t*e,l=2*t-s;n=Ke(l,s,a+1/3),o=Ke(l,s,a),r=Ke(l,s,a-1/3)}return{r:n*255,g:o*255,b:r*255}}function rt(a,e,t){a=L(a,255),e=L(e,255),t=L(t,255);const n=Math.max(a,e,t),o=Math.min(a,e,t);let r=0;const s=n,l=n-o,i=n===0?0:l/n;if(n===o)r=0;else{switch(n){case a:r=(e-t)/l+(e<t?6:0);break;case e:r=(t-a)/l+2;break;case t:r=(a-e)/l+4;break}r/=6}return{h:r,s:i,v:s}}function la(a,e,t){a=L(a,360)*6,e=L(e,100),t=L(t,100);const n=Math.floor(a),o=a-n,r=t*(1-e),s=t*(1-o*e),l=t*(1-(1-o)*e),i=n%6,u=[t,s,r,r,l,t][i],w=[l,t,t,s,r,r][i],_=[r,r,l,t,t,s][i];return{r:u*255,g:w*255,b:_*255}}function st(a,e,t,n){const o=[oe(Math.round(a).toString(16)),oe(Math.round(e).toString(16)),oe(Math.round(t).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function ia(a,e,t,n,o){const r=[oe(Math.round(a).toString(16)),oe(Math.round(e).toString(16)),oe(Math.round(t).toString(16)),oe(ua(n))];return o&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))&&r[3].startsWith(r[3].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0):r.join("")}function ua(a){return Math.round(parseFloat(a)*255).toString(16)}function lt(a){return F(a)/255}function F(a){return parseInt(a,16)}function da(a){return{r:a>>16,g:(a&65280)>>8,b:a&255}}const je={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function ca(a){let e={r:0,g:0,b:0},t=1,n=null,o=null,r=null,s=!1,l=!1;return typeof a=="string"&&(a=fa(a)),typeof a=="object"&&(X(a.r)&&X(a.g)&&X(a.b)?(e=ra(a.r,a.g,a.b),s=!0,l=String(a.r).substr(-1)==="%"?"prgb":"rgb"):X(a.h)&&X(a.s)&&X(a.v)?(n=Ce(a.s),o=Ce(a.v),e=la(a.h,n,o),s=!0,l="hsv"):X(a.h)&&X(a.s)&&X(a.l)&&(n=Ce(a.s),r=Ce(a.l),e=sa(a.h,n,r),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(a,"a")&&(t=a.a)),t=kt(t),{ok:s,format:a.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}const ha="[-\\+]?\\d+%?",ma="[-\\+]?\\d*\\.\\d+%?",te="(?:"+ma+")|(?:"+ha+")",Ge="[\\s|\\(]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")\\s*\\)?",qe="[\\s|\\(]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")\\s*\\)?",j={CSS_UNIT:new RegExp(te),rgb:new RegExp("rgb"+Ge),rgba:new RegExp("rgba"+qe),hsl:new RegExp("hsl"+Ge),hsla:new RegExp("hsla"+qe),hsv:new RegExp("hsv"+Ge),hsva:new RegExp("hsva"+qe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function fa(a){if(a=a.trim().toLowerCase(),a.length===0)return!1;let e=!1;if(je[a])a=je[a],e=!0;else if(a==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let t=j.rgb.exec(a);return t?{r:t[1],g:t[2],b:t[3]}:(t=j.rgba.exec(a),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=j.hsl.exec(a),t?{h:t[1],s:t[2],l:t[3]}:(t=j.hsla.exec(a),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=j.hsv.exec(a),t?{h:t[1],s:t[2],v:t[3]}:(t=j.hsva.exec(a),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=j.hex8.exec(a),t?{r:F(t[1]),g:F(t[2]),b:F(t[3]),a:lt(t[4]),format:e?"name":"hex8"}:(t=j.hex6.exec(a),t?{r:F(t[1]),g:F(t[2]),b:F(t[3]),format:e?"name":"hex"}:(t=j.hex4.exec(a),t?{r:F(t[1]+t[1]),g:F(t[2]+t[2]),b:F(t[3]+t[3]),a:lt(t[4]+t[4]),format:e?"name":"hex8"}:(t=j.hex3.exec(a),t?{r:F(t[1]+t[1]),g:F(t[2]+t[2]),b:F(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function X(a){return!!j.CSS_UNIT.exec(String(a))}class D{constructor(e="",t={}){if(e instanceof D)return e;typeof e=="number"&&(e=da(e)),this.originalInput=e;const n=ca(e);this.originalInput=e,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=t.format??n.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3}getLuminance(){const e=this.toRgb();let t,n,o;const r=e.r/255,s=e.g/255,l=e.b/255;return r<=.03928?t=r/12.92:t=Math.pow((r+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),l<=.03928?o=l/12.92:o=Math.pow((l+.055)/1.055,2.4),.2126*t+.7152*n+.0722*o}getAlpha(){return this.a}setAlpha(e){return this.a=kt(e),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:e}=this.toHsl();return e===0}toHsv(){const e=rt(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}}toHsvString(){const e=rt(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),o=Math.round(e.v*100);return this.a===1?`hsv(${t}, ${n}%, ${o}%)`:`hsva(${t}, ${n}%, ${o}%, ${this.roundA})`}toHsl(){const e=ot(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}}toHslString(){const e=ot(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),o=Math.round(e.l*100);return this.a===1?`hsl(${t}, ${n}%, ${o}%)`:`hsla(${t}, ${n}%, ${o}%, ${this.roundA})`}toHex(e=!1){return st(this.r,this.g,this.b,e)}toHexString(e=!1){return"#"+this.toHex(e)}toHex8(e=!1){return ia(this.r,this.g,this.b,this.a,e)}toHex8String(e=!1){return"#"+this.toHex8(e)}toHexShortString(e=!1){return this.a===1?this.toHexString(e):this.toHex8String(e)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?`rgb(${e}, ${t}, ${n})`:`rgba(${e}, ${t}, ${n}, ${this.roundA})`}toPercentageRgb(){const e=t=>`${Math.round(L(t,255)*100)}%`;return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}}toPercentageRgbString(){const e=t=>Math.round(L(t,255)*100);return this.a===1?`rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)`:`rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const e="#"+st(this.r,this.g,this.b,!1);for(const[t,n]of Object.entries(je))if(e===n)return t;return!1}toString(e){const t=!!e;e=e??this.format;let n=!1;const o=this.a<1&&this.a>=0;return!t&&o&&(e.startsWith("hex")||e==="name")?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new D(this.toString())}lighten(e=10){const t=this.toHsl();return t.l+=e/100,t.l=Se(t.l),new D(t)}brighten(e=10){const t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new D(t)}darken(e=10){const t=this.toHsl();return t.l-=e/100,t.l=Se(t.l),new D(t)}tint(e=10){return this.mix("white",e)}shade(e=10){return this.mix("black",e)}desaturate(e=10){const t=this.toHsl();return t.s-=e/100,t.s=Se(t.s),new D(t)}saturate(e=10){const t=this.toHsl();return t.s+=e/100,t.s=Se(t.s),new D(t)}greyscale(){return this.desaturate(100)}spin(e){const t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new D(t)}mix(e,t=50){const n=this.toRgb(),o=new D(e).toRgb(),r=t/100,s={r:(o.r-n.r)*r+n.r,g:(o.g-n.g)*r+n.g,b:(o.b-n.b)*r+n.b,a:(o.a-n.a)*r+n.a};return new D(s)}analogous(e=6,t=30){const n=this.toHsl(),o=360/t,r=[this];for(n.h=(n.h-(o*e>>1)+720)%360;--e;)n.h=(n.h+o)%360,r.push(new D(n));return r}complement(){const e=this.toHsl();return e.h=(e.h+180)%360,new D(e)}monochromatic(e=6){const t=this.toHsv(),{h:n}=t,{s:o}=t;let{v:r}=t;const s=[],l=1/e;for(;e--;)s.push(new D({h:n,s:o,v:r})),r=(r+l)%1;return s}splitcomplement(){const e=this.toHsl(),{h:t}=e;return[this,new D({h:(t+72)%360,s:e.s,l:e.l}),new D({h:(t+216)%360,s:e.s,l:e.l})]}onBackground(e){const t=this.toRgb(),n=new D(e).toRgb(),o=t.a+n.a*(1-t.a);return new D({r:(t.r*t.a+n.r*n.a*(1-t.a))/o,g:(t.g*t.a+n.g*n.a*(1-t.a))/o,b:(t.b*t.a+n.b*n.a*(1-t.a))/o,a:o})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(e){const t=this.toHsl(),{h:n}=t,o=[this],r=360/e;for(let s=1;s<e;s++)o.push(new D({h:(n+s*r)%360,s:t.s,l:t.l}));return o}equals(e){return this.toRgbString()===new D(e).toRgbString()}}function Tt(a={}){if(a.count!==void 0&&a.count!==null){const r=a.count,s=[];for(a.count=void 0;r>s.length;)a.count=null,a.seed&&(a.seed+=1),s.push(Tt(a));return a.count=r,s}const e=pa(a.hue,a.seed),t=ga(e,a),n=ba(e,t,a),o={h:e,s:t,v:n};return a.alpha!==void 0&&(o.a=a.alpha),new D(o)}function pa(a,e){const t=ya(a);let n=Ee(t,e);return n<0&&(n=360+n),n}function ga(a,e){if(e.hue==="monochrome")return 0;if(e.luminosity==="random")return Ee([0,100],e.seed);const{saturationRange:t}=$t(a);let n=t[0],o=t[1];switch(e.luminosity){case"bright":n=55;break;case"dark":n=o-10;break;case"light":o=55;break}return Ee([n,o],e.seed)}function ba(a,e,t){let n=va(a,e),o=100;switch(t.luminosity){case"dark":o=n+20;break;case"light":n=(o+n)/2;break;case"random":n=0,o=100;break}return Ee([n,o],t.seed)}function va(a,e){const{lowerBounds:t}=$t(a);for(let n=0;n<t.length-1;n++){const o=t[n][0],r=t[n][1],s=t[n+1][0],l=t[n+1][1];if(e>=o&&e<=s){const i=(l-r)/(s-o),u=r-i*o;return i*e+u}}return 0}function ya(a){const e=parseInt(a,10);if(!Number.isNaN(e)&&e<360&&e>0)return[e,e];if(typeof a=="string"){const t=St.find(o=>o.name===a);if(t){const o=wt(t);if(o.hueRange)return o.hueRange}const n=new D(a);if(n.isValid){const o=n.toHsv().h;return[o,o]}}return[0,360]}function $t(a){a>=334&&a<=360&&(a-=360);for(const e of St){const t=wt(e);if(t.hueRange&&a>=t.hueRange[0]&&a<=t.hueRange[1])return t}throw Error("Color not found")}function Ee(a,e){if(e===void 0)return Math.floor(a[0]+Math.random()*(a[1]+1-a[0]));const t=a[1]||1,n=a[0]||0;e=(e*9301+49297)%233280;const o=e/233280;return Math.floor(n+o*(t-n))}function wt(a){const e=a.lowerBounds[0][0],t=a.lowerBounds[a.lowerBounds.length-1][0],n=a.lowerBounds[a.lowerBounds.length-1][1],o=a.lowerBounds[0][1];return{name:a.name,hueRange:a.hueRange,lowerBounds:a.lowerBounds,saturationRange:[e,t],brightnessRange:[n,o]}}const St=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function _a(a){let e=5381;for(let t=0;t<a.length;t++)e=e*33^a.charCodeAt(t);return e>>>0}function Ct(a){return Tt({seed:_a(a)}).toHexString()}let ka,Ta,$a,wa,Sa,he,Y,Ca,it,xa,Ia,Ma,Va,Ea,xt,Aa,Da,Ba,Ra,It,Pa,La,Oa,Mt,Na,Ha,Fa,Ua,Vt,Ka,Ga,qa,ja,Et,za,Wa,At,Xa,Ya,Dt,Qa,Za,Ja,Bt,en,tn,Rt,an,nn,on,rn,sn,ln,un,dn,cn,hn,mn,fn,pn,gn,bn,vn,yn,_n,kn,Tn,$n,wn,Sn,Cn,xn,In,Mn,Vn,En,An,Dn,Bn,Rn,Pn,Ln,On,Nn,Hn,Fn,Un,Kn,Gn,qn,jn;ka={class:"d-flex my-3"};Ta={class:"pa-0"};$a={class:"d-flex align-center text-uppercase text-select",style:{"font-size":"0.8em"}};wa=S({__name:"Toolbar",setup(a){const{t:e}=Ae(),t=ne(),{torrentCountString:n,isSelectionMultiple:o,displayMode:r}=U(t),{isDrawerOpen:s}=U(Ht()),l=me(),{sortOptions:i}=U(l),u=[{value:g.ADDED_ON,title:e("dashboard.sortBy.added_on")},{value:g.AMOUNT_LEFT,title:e("dashboard.sortBy.amount_left")},{value:g.AUTO_TMM,title:e("dashboard.sortBy.auto_tmm")},{value:g.AVAILABILITY,title:e("dashboard.sortBy.availability")},{value:g.AVG_DOWNLOAD_SPEED,title:e("dashboard.sortBy.avg_download_speed")},{value:g.AVG_UPLOAD_SPEED,title:e("dashboard.sortBy.avg_upload_speed")},{value:g.CATEGORY,title:e("dashboard.sortBy.category")},{value:g.COMPLETED,title:e("dashboard.sortBy.completed")},{value:g.COMPLETION_ON,title:e("dashboard.sortBy.completion_on")},{value:g.CONTENT_PATH,title:e("dashboard.sortBy.content_path")},{value:g.DL_LIMIT,title:e("dashboard.sortBy.dl_limit")},{value:g.DLSPEED,title:e("dashboard.sortBy.dlspeed")},{value:g.DOWNLOAD_PATH,title:e("dashboard.sortBy.download_path")},{value:g.DOWNLOADED,title:e("dashboard.sortBy.downloaded")},{value:g.DOWNLOADED_SESSION,title:e("dashboard.sortBy.downloaded_session")},{value:g.ETA,title:e("dashboard.sortBy.eta")},{value:g.F_L_PIECE_PRIO,title:e("dashboard.sortBy.f_l_piece_prio")},{value:g.FORCE_START,title:e("dashboard.sortBy.force_start")},{value:g.GLOBALSPEED,title:e("dashboard.sortBy.globalSpeed")},{value:g.GLOBALVOLUME,title:e("dashboard.sortBy.globalVolume")},{value:g.HASH,title:e("dashboard.sortBy.hash")},{value:g.INFOHASH_V1,title:e("dashboard.sortBy.infohash_v1")},{value:g.INFOHASH_V2,title:e("dashboard.sortBy.infohash_v2")},{value:g.LAST_ACTIVITY,title:e("dashboard.sortBy.last_activity")},{value:g.MAGNET_URI,title:e("dashboard.sortBy.magnet_uri")},{value:g.MAX_RATIO,title:e("dashboard.sortBy.max_ratio")},{value:g.MAX_SEEDING_TIME,title:e("dashboard.sortBy.max_seeding_time")},{value:g.NAME,title:e("dashboard.sortBy.name")},{value:g.NUM_COMPLETE,title:e("dashboard.sortBy.num_complete")},{value:g.NUM_INCOMPLETE,title:e("dashboard.sortBy.num_incomplete")},{value:g.NUM_LEECHS,title:e("dashboard.sortBy.num_leechs")},{value:g.NUM_SEEDS,title:e("dashboard.sortBy.num_seeds")},{value:g.PRIORITY,title:e("dashboard.sortBy.priority")},{value:g.PROGRESS,title:e("dashboard.sortBy.progress")},{value:g.RATIO,title:e("dashboard.sortBy.ratio")},{value:g.RATIO_LIMIT,title:e("dashboard.sortBy.ratio_limit")},{value:g.SAVE_PATH,title:e("dashboard.sortBy.save_path")},{value:g.SEEDING_TIME,title:e("dashboard.sortBy.seeding_time")},{value:g.SEEDING_TIME_LIMIT,title:e("dashboard.sortBy.seeding_time_limit")},{value:g.SEEN_COMPLETE,title:e("dashboard.sortBy.seen_complete")},{value:g.SEQ_DL,title:e("dashboard.sortBy.seq_dl")},{value:g.SIZE,title:e("dashboard.sortBy.size")},{value:g.STATE,title:e("dashboard.sortBy.state")},{value:g.SUPER_SEEDING,title:e("dashboard.sortBy.super_seeding")},{value:g.TAGS,title:e("dashboard.sortBy.tags")},{value:g.TIME_ACTIVE,title:e("dashboard.sortBy.time_active")},{value:g.TOTAL_SIZE,title:e("dashboard.sortBy.total_size")},{value:g.TRACKER,title:e("dashboard.sortBy.tracker")},{value:g.TRACKERS_COUNT,title:e("dashboard.sortBy.trackers_count")},{value:g.UP_LIMIT,title:e("dashboard.sortBy.up_limit")},{value:g.UPLOADED,title:e("dashboard.sortBy.uploaded")},{value:g.UPLOADED_SESSION,title:e("dashboard.sortBy.uploaded_session")},{value:g.UPSPEED,title:e("dashboard.sortBy.upspeed")}].sort((E,k)=>E.title.localeCompare(k.title));u.splice(0,0,{value:g.DEFAULT,title:e("dashboard.sortBy.default")});function w(){l.textFilter=""}const _=v({get:()=>l.textFilter,set:ea(E=>{l.textFilter=E??""},300)});function P(){o.value&&t.unselectAllTorrents(),o.value=!o.value}return(E,k)=>(c(),f(H,null,[y("div",null,[d(se,{id:"searchInput",modelValue:_.value,"onUpdate:modelValue":k[0]||(k[0]=C=>_.value=C),label:h(e)("dashboard.searchInputLabel"),clearable:"",density:"compact","single-line":"","hide-details":"","prepend-inner-icon":"mdi-magnify",variant:"solo","onClick:clear":k[1]||(k[1]=C=>w())},null,8,["modelValue","label"])]),y("div",ka,[d(ee,{text:h(e)("dashboard.toggleSelectMode"),location:"top"},{activator:m(({props:C})=>[d(O,G({icon:h(o)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline"},C,{variant:"plain",onClick:P}),null,16,["icon"])]),_:1},8,["text"]),d(Ft,null,{activator:m(({props:C})=>[d(ee,{text:E.$t("dashboard.displayMode.title"),location:"top"},{activator:m(({props:x})=>[d(O,G({icon:""},G(C,x),{variant:"plain"}),{default:m(()=>[h(r)===h(Q).LIST?(c(),A(He,{key:0,icon:"mdi-view-list"})):V("",!0),h(r)===h(Q).GRID?(c(),A(He,{key:1,icon:"mdi-view-grid"})):V("",!0),h(r)===h(Q).TABLE?(c(),A(He,{key:2,icon:"mdi-table"})):V("",!0)]),_:2},1040)]),_:2},1032,["text"])]),default:m(()=>[d(mt,null,{default:m(()=>[d(_e,{title:E.$t("dashboard.displayMode.list"),"prepend-icon":"mdi-view-list",onClick:k[2]||(k[2]=C=>r.value=h(Q).LIST)},null,8,["title"]),d(_e,{title:E.$t("dashboard.displayMode.grid"),"prepend-icon":"mdi-view-grid",onClick:k[3]||(k[3]=C=>r.value=h(Q).GRID)},null,8,["title"]),d(_e,{title:E.$t("dashboard.displayMode.table"),"prepend-icon":"mdi-table",onClick:k[4]||(k[4]=C=>r.value=h(Q).TABLE)},null,8,["title"])]),_:1})]),_:1}),d(ee,{text:h(e)("dashboard.toggleSortOrder"),location:"top"},{activator:m(({props:C})=>[d(O,G({icon:h(i).reverseOrder?"mdi-arrow-up-thin":"mdi-arrow-down-thin"},C,{variant:"plain",onClick:k[5]||(k[5]=x=>h(i).reverseOrder=!h(i).reverseOrder)}),null,16,["icon"])]),_:1},8,["text"]),y("div",Ta,[d(Ut,{modelValue:h(i).sortBy,"onUpdate:modelValue":k[6]||(k[6]=C=>h(i).sortBy=C),items:h(u),label:h(e)("dashboard.sortLabel"),"auto-select-first":"",density:"compact","hide-details":"",variant:"solo-filled",style:ut(`width: ${E.$vuetify.display.xs||E.$vuetify.display.sm&&h(s)?140:260}px`)},null,8,["modelValue","items","label","style"])]),d(Re),y("div",$a,p(h(n)),1)])],64))}});Sa=S({__name:"RenameTorrentDialog",props:{guid:{},hash:{}},setup(a){const e=a,{isOpened:t}=Xe(e.guid),{t:n}=Ae(),o=me(),r=N(),s=N(),l=N(!1),i=dt({newName:""}),u=[k=>!!k||n("dialogs.renameTorrent.required"),k=>k!==_.value||n("dialogs.renameTorrent.sameName")],w=v(()=>o.getTorrentByHash(e.hash)),_=v(()=>w.value?.name);async function P(){await s.value?.validate(),l.value&&(await o.renameTorrent(e.hash,i.newName),E())}const E=()=>{t.value=!1};return De(()=>{i.newName=w.value?.name||""}),ct(()=>{r.value?.select()}),(k,C)=>(c(),A(Je,{modelValue:h(t),"onUpdate:modelValue":C[3]||(C[3]=x=>ke(t)?t.value=x:null)},{default:m(()=>[d(fe,null,{default:m(()=>[d(Ye,null,{default:m(()=>[B(p(k.$t("dialogs.renameTorrent.title")),1)]),_:1}),d(Te,null,{default:m(()=>[d(h(Qe),{modelValue:l.value,"onUpdate:modelValue":C[1]||(C[1]=x=>l.value=x),ref_key:"form",ref:s,onSubmit:C[2]||(C[2]=re(()=>{},["prevent"]))},{default:m(()=>[_.value?(c(),A(se,{key:0,"model-value":_.value,disabled:"",label:k.$t("dialogs.renameTorrent.oldName")},null,8,["model-value","label"])):V("",!0),d(se,{modelValue:i.newName,"onUpdate:modelValue":C[0]||(C[0]=x=>i.newName=x),ref_key:"field",ref:r,rules:u,autofocus:"",label:k.$t("dialogs.renameTorrent.newName"),onKeydown:Me(P,["enter"])},null,8,["modelValue","label"])]),_:1},8,["modelValue"])]),_:1}),d(Ze,null,{default:m(()=>[d(Re),d(O,{color:"error",onClick:E},{default:m(()=>[B(p(k.$t("common.cancel")),1)]),_:1}),d(O,{color:"accent",disabled:!l.value,onClick:P},{default:m(()=>[B(p(k.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]))}});he=-2;Y=-1;Ca=S({__name:"ShareLimitDialog",props:{guid:{},hashes:{}},setup(a){const e=a,{isOpened:t}=Xe(e.guid),n=Pe(),o=me(),r=N(!1),s=N("global"),l=N(!1),i=N(0),u=N(!1),w=N(0),_=N(!1),P=N(0),E=v(()=>s.value!=="enabled");function k(){t.value=!1}async function C(){switch(s.value){case"global":await n.setShareLimit(e.hashes,he,he,he);break;case"disabled":await n.setShareLimit(e.hashes,Y,Y,Y);break;case"enabled":await n.setShareLimit(e.hashes,l.value?i.value:Y,u.value?w.value:Y,_.value?P.value:Y);break}k()}return De(async()=>{const x=o.getTorrentByHash(e.hashes[0]);if(!x)return k();const T=x.ratio_limit,I=x.seeding_time_limit,z=x.inactive_seeding_time_limit;T===he&&I===he&&z===he?s.value="global":T===Y&&I===Y&&z===Y?s.value="disabled":(s.value="enabled",l.value=T>=0,i.value=l.value?T:0,u.value=I>=0,w.value=u.value?I:0,_.value=z>=0,P.value=_.value?z:0)}),(x,T)=>(c(),A(Je,{modelValue:h(t),"onUpdate:modelValue":T[9]||(T[9]=I=>ke(t)?t.value=I:null),"max-width":"500"},{default:m(()=>[d(fe,{title:x.$t("dialogs.share_limit.title")},{default:m(()=>[d(Te,null,{default:m(()=>[d(Qe,{modelValue:r.value,"onUpdate:modelValue":T[7]||(T[7]=I=>r.value=I),onSubmit:T[8]||(T[8]=re(()=>{},["prevent"])),onKeydown:Me(re(C,["prevent"]),["enter"])},{default:m(()=>[d(Kt,{modelValue:s.value,"onUpdate:modelValue":T[0]||(T[0]=I=>s.value=I)},{default:m(()=>[d(Fe,{label:x.$t("dialogs.share_limit.global"),value:"global"},null,8,["label"]),d(Fe,{label:x.$t("dialogs.share_limit.disabled"),value:"disabled"},null,8,["label"]),d(Fe,{label:x.$t("dialogs.share_limit.enabled"),value:"enabled"},null,8,["label"])]),_:1},8,["modelValue"]),d(et,null,{default:m(()=>[d(xe,{cols:"12",class:"d-flex align-center"},{default:m(()=>[y("span",null,[d(Ie,{modelValue:l.value,"onUpdate:modelValue":T[1]||(T[1]=I=>l.value=I),disabled:E.value},null,8,["modelValue","disabled"])]),d(se,{modelValue:i.value,"onUpdate:modelValue":T[2]||(T[2]=I=>i.value=I),disabled:E.value||!l.value,density:"compact","hide-details":"",label:x.$t("dialogs.share_limit.ratio_limit")},null,8,["modelValue","disabled","label"])]),_:1}),d(xe,{cols:"12",class:"d-flex align-center"},{default:m(()=>[y("span",null,[d(Ie,{modelValue:u.value,"onUpdate:modelValue":T[3]||(T[3]=I=>u.value=I),disabled:E.value},null,8,["modelValue","disabled"])]),d(se,{modelValue:w.value,"onUpdate:modelValue":T[4]||(T[4]=I=>w.value=I),disabled:E.value||!u.value,density:"compact","hide-details":"",label:x.$t("dialogs.share_limit.seeding_time_limit")},null,8,["modelValue","disabled","label"])]),_:1}),d(xe,{cols:"12",class:"d-flex align-center"},{default:m(()=>[y("span",null,[d(Ie,{modelValue:_.value,"onUpdate:modelValue":T[5]||(T[5]=I=>_.value=I),disabled:E.value},null,8,["modelValue","disabled"])]),d(se,{modelValue:P.value,"onUpdate:modelValue":T[6]||(T[6]=I=>P.value=I),disabled:E.value||!_.value,density:"compact","hide-details":"",label:x.$t("dialogs.share_limit.inactive_seeding_time_limit")},null,8,["modelValue","disabled","label"])]),_:1})]),_:1})]),_:1},8,["modelValue","onKeydown"])]),_:1}),d(Ze,null,{default:m(()=>[d(Re),d(O,{color:"error",onClick:k},{default:m(()=>[B(p(x.$t("common.cancel")),1)]),_:1}),d(O,{color:"accent",disabled:!r.value,onClick:C},{default:m(()=>[B(p(x.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}});it=S({__name:"SpeedLimitDialog",props:{guid:{},hashes:{},mode:{}},setup(a){const e=a,{isOpened:t}=Xe(e.guid),n=Pe(),o=me(),r=N(!1),s=N(0);function l(){t.value=!1}async function i(){const u=Math.max(0,s.value)*1e3;switch(e.mode){case"download":await n.setDownloadLimit(u,e.hashes);break;case"upload":await n.setUploadLimit(u,e.hashes);break}l()}return De(async()=>{const u=o.getTorrentByHash(e.hashes[0]);if(!u)return l();switch(e.mode){case"download":s.value=Math.max(0,Math.round(u.dl_limit/1e3));break;case"upload":s.value=Math.max(0,Math.round(u.up_limit/1e3));break}}),(u,w)=>(c(),A(Je,{modelValue:h(t),"onUpdate:modelValue":w[3]||(w[3]=_=>ke(t)?t.value=_:null)},{default:m(()=>[d(fe,{title:u.$t(`dialogs.speed_limit.${u.mode}`)},{default:m(()=>[d(Te,null,{default:m(()=>[d(Qe,{modelValue:r.value,"onUpdate:modelValue":w[1]||(w[1]=_=>r.value=_),onSubmit:w[2]||(w[2]=re(()=>{},["prevent"])),onKeydown:Me(re(i,["prevent"]),["enter"])},{default:m(()=>[d(se,{modelValue:s.value,"onUpdate:modelValue":w[0]||(w[0]=_=>s.value=_),modelModifiers:{number:!0},type:"number",autofocus:"",clearable:"",label:u.$t("dialogs.speed_limit.label"),"prepend-inner-icon":"mdi-speedometer",suffix:"kB/s",onKeydown:Me(re(i,["prevent"]),["enter"])},null,8,["modelValue","label","onKeydown"])]),_:1},8,["modelValue","onKeydown"])]),_:1}),d(Ze,null,{default:m(()=>[d(Re),d(O,{color:"error",onClick:l},{default:m(()=>[B(p(u.$t("common.cancel")),1)]),_:1}),d(O,{color:"accent",disabled:!r.value,onClick:i},{default:m(()=>[B(p(u.$t("common.save")),1)]),_:1},8,["disabled"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}});xa={class:"d-flex justify-space-around"};Ia=S({__name:"RightClick",props:{rightClickProperties:{}},setup(a){const{t:e}=Ae(),t=ht(),n=ne(),o=ft(),r=Pe(),s=Gt(),l=me(),i=v(()=>n.selectedTorrents.length>1),u=v(()=>n.selectedTorrents),w=v(()=>u.value[0]),_=v(()=>l.getTorrentByHash(w.value)),P=v(()=>n.selectedTorrents.map(l.getTorrentByHash).filter(b=>!!b)),E=v(()=>[{name:""},...r.categories]);async function k(){await l.resumeTorrents(u)}async function C(){await l.forceResumeTorrents(u)}async function x(){await l.pauseTorrents(u)}function T(){o.createDialog(pt,{hashes:[...n.selectedTorrents]})}function I(){o.createDialog(nt,{hashes:[...n.selectedTorrents],mode:"dl"})}function z(){o.createDialog(nt,{hashes:[...n.selectedTorrents],mode:"save"})}function J(){o.createDialog(Sa,{hash:n.selectedTorrents[0]})}async function pe(){await l.recheckTorrents(u)}async function $e(){await r.reannounceTorrents(u)}async function Oe(){await r.toggleSeqDl(u)}async function ge(){await r.toggleFLPiecePrio(u)}async function be(){await r.toggleAutoTmm(u,!_.value?.auto_tmm)}function ie(b){return P.value.every(W=>W&&W.tags&&W.tags.includes(b))}async function ue(b){ie(b)?await l.removeTorrentTags(u.value,[b]):await l.addTorrentTags(u.value,[b])}async function de(b){try{await navigator.clipboard.writeText(b)}catch{tt.error(e("toast.copy.error"));return}tt.success(e("toast.copy.success"))}function ve(){o.createDialog(it,{hashes:u.value,mode:"download"})}function ye(){o.createDialog(it,{hashes:u.value,mode:"upload"})}function we(){o.createDialog(Ca,{hashes:u.value})}async function $(){u.value.forEach(b=>{l.exportTorrent(b).then(W=>{const q=window.URL.createObjectURL(W),ce=document.createElement("a");ce.href=q,ce.style.opacity="0",ce.setAttribute("download",`${b}.torrent`),document.body.appendChild(ce),ce.click(),document.body.removeChild(ce)})})}const R=v(()=>[{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:I},{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:i.value,action:J},{text:e("dashboard.right_click.advanced.recheck"),icon:"mdi-playlist-check",action:pe},{text:e("dashboard.right_click.advanced.reannounce"),icon:"mdi-bullhorn",action:$e},{text:e("dashboard.right_click.advanced.seq_dl"),icon:_.value?.seq_dl?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:Oe},{text:e("dashboard.right_click.advanced.f_l_prio"),icon:_.value?.f_l_piece_prio?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:ge},{text:e("dashboard.right_click.advanced.auto_tmm"),icon:_.value?.auto_tmm?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:be}]},{text:e("dashboard.right_click.priority.title"),icon:"mdi-priority-high",hidden:!s.preferences?.queueing_enabled,children:[{text:e("dashboard.right_click.priority.top"),icon:"mdi-priority-high",action:async()=>await l.setTorrentPriority(u.value,"topPrio")},{text:e("dashboard.right_click.priority.increase"),icon:"mdi-arrow-up",action:async()=>await l.setTorrentPriority(u.value,"increasePrio")},{text:e("dashboard.right_click.priority.decrease"),icon:"mdi-arrow-down",action:async()=>await l.setTorrentPriority(u.value,"decreasePrio")},{text:e("dashboard.right_click.priority.bottom"),icon:"mdi-priority-low",action:async()=>await l.setTorrentPriority(u.value,"bottomPrio")}]},{text:e("dashboard.right_click.tags.title"),icon:"mdi-tag",disabled:r.tags.length===0,disabledText:e("dashboard.right_click.tags.disabled_title"),disabledIcon:"mdi-tag-off",children:r.tags.map(b=>({text:b,icon:ie(b)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",action:async()=>await ue(b)}))},{text:e("dashboard.right_click.category.title"),icon:"mdi-label",disabled:r.categories.length===0,disabledText:e("dashboard.right_click.category.disabled_title"),disabledIcon:"mdi-label-off",children:E.value.map(b=>({text:b.name===""?e("dashboard.right_click.category.clear"):b.name,action:async()=>await l.setTorrentCategory(u.value,b.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:ve},{text:e("dashboard.right_click.speed_limit.upload"),icon:"mdi-upload",action:ye},{text:e("dashboard.right_click.speed_limit.share"),icon:"mdi-account-group",action:we}]},{text:e("dashboard.right_click.copy.title"),icon:"mdi-content-copy",hidden:i.value,children:[{text:e("dashboard.right_click.copy.name"),icon:"mdi-alphabetical-variant",action:async()=>_.value&&await de(_.value.name)},{text:e("dashboard.right_click.copy.hash"),icon:"mdi-pound",action:async()=>await de(w.value)},{text:e("dashboard.right_click.copy.magnet"),icon:"mdi-magnet",action:async()=>_.value&&await de(_.value.magnet)}]},{text:e("dashboard.right_click.export",n.selectedTorrents.length),icon:i.value?"mdi-download-multiple":"mdi-download",action:$},{text:e("dashboard.right_click.info"),icon:"mdi-information",hidden:i.value,action:()=>t.push({name:"torrentDetail",params:{hash:w.value}})}]);return(b,W)=>(c(),f("div",{style:ut(`position: absolute; left: ${b.rightClickProperties.offset[0]}px; top: ${b.rightClickProperties.offset[1]}px;`)},[d(h(ta),{modelValue:b.rightClickProperties.isVisible,"onUpdate:modelValue":W[0]||(W[0]=q=>b.rightClickProperties.isVisible=q),"menu-data":R.value},{top:m(()=>[d(_e,null,{default:m(()=>[y("div",xa,[d(ee,{location:"top"},{activator:m(({props:q})=>[d(O,G({density:"compact",variant:"plain",icon:"mdi-play"},q,{onClick:k}),null,16)]),default:m(()=>[y("span",null,p(b.$t("dashboard.right_click.top.resume")),1)]),_:1}),d(ee,{location:"top"},{activator:m(({props:q})=>[d(O,G({density:"compact",variant:"plain",icon:"mdi-fast-forward"},q,{onClick:C}),null,16)]),default:m(()=>[y("span",null,p(b.$t("dashboard.right_click.top.force_resume")),1)]),_:1}),d(ee,{location:"top"},{activator:m(({props:q})=>[d(O,G({density:"compact",variant:"plain",icon:"mdi-pause"},q,{onClick:x}),null,16)]),default:m(()=>[y("span",null,p(b.$t("dashboard.right_click.top.pause")),1)]),_:1}),d(ee,{location:"top"},{activator:m(({props:q})=>[d(O,G({color:"red",density:"compact",variant:"plain",icon:"mdi-delete-forever"},q,{onClick:T}),null,16)]),default:m(()=>[y("span",null,p(b.$t("dashboard.right_click.top.delete")),1)]),_:1})])]),_:1})]),_:1},8,["modelValue","menu-data"])],4))}});Ma={class:"d-flex flex-column"};Va={key:0,class:"text-caption text-grey"};Ea={key:0,class:"text-caption text-grey"};xt=S({__name:"ItemAmount",props:{torrent:{},titleKey:{},value:{type:Function},total:{type:Function}},setup(a){return(e,t)=>(c(),f("div",Ma,[e.titleKey?(c(),f("div",Va,p(e.$t(e.titleKey)),1)):V("",!0),y("div",null,[B(p(e.value(e.torrent))+" ",1),e.total?(c(),f("span",Ea," / "+p(e.total(e.torrent)),1)):V("",!0)])]))}});Aa={key:0,class:"d-flex flex-column"};Da={key:0,class:"text-caption text-grey"};Ba={class:"d-flex flex-row gap"};Ra=S({__name:"ItemChip",props:{torrent:{},titleKey:{},value:{},emptyValueKey:{},color:{},enableHashColor:{type:Boolean,default:!1}},setup(a){const e=a,{hideChipIfUnset:t,enableHashColors:n}=U(K()),o=v(()=>e.value(e.torrent)),r=v(()=>o.value.length<1||o.value[0]===""),s=v(()=>!(t.value&&r.value)),l=v(()=>n.value&&e.enableHashColor);return(i,u)=>s.value?(c(),f("div",Aa,[i.titleKey?(c(),f("div",Da,p(i.$t(i.titleKey)),1)):V("",!0),y("div",Ba,[r.value?(c(),A(Ve,{key:0,color:i.color(i.torrent),variant:"flat",size:"small"},{default:m(()=>[B(p(i.$t(i.emptyValueKey)),1)]),_:1},8,["color"])):(c(!0),f(H,{key:1},Z(o.value,w=>(c(),A(Ve,{color:l.value?h(Ct)(w):i.color(i.torrent),variant:"flat",size:"small"},{default:m(()=>[B(p(w),1)]),_:2},1032,["color"]))),256))])])):V("",!0)}});It=le(Ra,[["__scopeId","data-v-a2950234"]]);Pa={class:"d-flex flex-column"};La={key:0,class:"text-caption text-grey"};Oa={class:"text-caption text-grey"};Mt=S({__name:"ItemData",props:{torrent:{},titleKey:{},value:{type:Function}},setup(a){const e=a,{useBinarySize:t}=U(K()),n=v(()=>e.value(e.torrent));return(o,r)=>(c(),f("div",Pa,[o.titleKey?(c(),f("div",La,p(o.$t(o.titleKey)),1)):V("",!0),y("div",null,[B(p(h(qt)(n.value,h(t)))+" ",1),y("span",Oa,p(h(jt)(n.value,h(t))),1)])]))}});Na={class:"d-flex flex-column"};Ha={key:0,class:"text-caption text-grey"};Fa={key:0};Ua={key:1};Vt=S({__name:"ItemDateTime",props:{torrent:{},titleKey:{},value:{type:Function}},setup(a){const e=a,{dateFormat:t}=U(K()),n=v(()=>e.value(e.torrent));return(o,r)=>(c(),f("div",Na,[o.titleKey?(c(),f("div",Ha,p(o.$t(o.titleKey)),1)):V("",!0),y("div",null,[n.value>0?(c(),f("span",Fa,p(h(gt)(n.value,h(t))),1)):(c(),f("span",Ua,p(o.$t("dashboard.not_complete")),1))])]))}});Ka={class:"d-flex flex-column"};Ga={key:0,class:"text-caption text-grey"};qa={key:0};ja={key:1};Et=S({__name:"ItemDuration",props:{torrent:{},titleKey:{},value:{type:Function}},setup(a){const e=a,t=v(()=>e.value(e.torrent)),n=v(()=>{const o=Le.duration(t.value,"seconds"),r=[o.years(),o.months(),o.days(),o.hours(),o.minutes(),o.seconds()],s=["Y","M","d","h","m","s"];let l=!1;return r.map((i,u)=>{if(l||i)return l=!0,`${i}${s[u]}`}).filter(i=>i).join(" ")});return(o,r)=>(c(),f("div",Ka,[o.titleKey?(c(),f("div",Ga,p(o.$t(o.titleKey)),1)):V("",!0),y("div",null,[t.value>0?(c(),f("span",qa,p(n.value),1)):(c(),f("span",ja,p(o.$t("dashboard.not_complete")),1))])]))}});za={class:"d-flex flex-column"};Wa={key:0,class:"text-caption text-grey"};At=S({__name:"ItemPercent",props:{torrent:{},titleKey:{},value:{type:Function},color:{type:Function}},setup(a){const e=a,t=v(()=>e.value(e.torrent));return(n,o)=>(c(),f("div",za,[n.titleKey?(c(),f("div",Wa,p(n.$t(n.titleKey)),1)):V("",!0),d(vt,{"model-value":t.value,max:1,height:20,color:n.color(n.torrent),rounded:"sm",style:{width:"10em"}},{default:m(()=>[B(p(h(bt)(t.value)),1)]),_:1},8,["model-value","color"])]))}});Xa={class:"d-flex flex-column"};Ya={key:0,class:"text-caption text-grey"};Dt=S({__name:"ItemRelativeTime",props:{torrent:{},titleKey:{},value:{type:Function}},setup(a){return(e,t)=>(c(),f("div",Xa,[e.titleKey?(c(),f("div",Ya,p(e.$t(e.titleKey)),1)):V("",!0),y("div",null,[y("span",null,p(h(Le)(e.value(e.torrent)*1e3).fromNow()),1)])]))}});Qa={class:"d-flex flex-column"};Za={key:0,class:"text-caption text-grey"};Ja={class:"text-caption text-grey"};Bt=S({__name:"ItemSpeed",props:{torrent:{},titleKey:{},value:{type:Function}},setup(a){const e=a,{useBitSpeed:t}=U(K()),n=v(()=>e.value(e.torrent));return(o,r)=>(c(),f("div",Qa,[o.titleKey?(c(),f("div",Za,p(o.$t(o.titleKey)),1)):V("",!0),y("div",null,[B(p(h(zt)(n.value,h(t)))+" ",1),y("span",Ja,p(h(Wt)(n.value,h(t))),1)])]))}});en={class:"d-flex flex-column"};tn={key:0,class:"text-caption text-grey"};Rt=S({__name:"ItemText",props:{torrent:{},titleKey:{},value:{type:Function},color:{type:Function}},setup(a){const e=a,t=v(()=>e.value(e.torrent));return(n,o)=>(c(),f("div",en,[n.titleKey?(c(),f("div",tn,p(n.$t(n.titleKey)),1)):V("",!0),y("div",{class:ae(n.color?n.color(t.value):"")},p(t.value),3)]))}});an={class:"d-flex gap flex-wrap"};nn=S({__name:"GridTorrent",props:{torrent:{}},emits:["onTorrentClick"],setup(a){const e=a,t=ne(),n=K(),o=v(()=>(e.torrent.progress===1?n.doneGridProperties:n.busyGridProperties).filter(i=>i.active).sort((i,u)=>i.order-u.order)),r=l=>{switch(l){case M.AMOUNT:return xt;case M.CHIP:return It;case M.DATA:return Mt;case M.DATETIME:return Vt;case M.DURATION:return Et;case M.PERCENT:return At;case M.RELATIVE:return Dt;case M.SPEED:return Bt;case M.TEXT:default:return Rt}},s=v(()=>t.isTorrentInSelection(e.torrent.hash));return(l,i)=>(c(),A(fe,{class:ae(`sideborder ${l.torrent.state} pointer`),height:"100%",color:s.value?`torrent-${l.torrent.state}-darken-3`:void 0,onClick:i[0]||(i[0]=u=>l.$emit("onTorrentClick",u,l.torrent))},{default:m(()=>[d(Ye,{class:"text-wrap text-subtitle-1 pt-1 pb-0"},{default:m(()=>[B(p(l.torrent.name),1)]),_:1}),d(Te,null,{default:m(()=>[y("div",an,[(c(!0),f(H,null,Z(o.value,u=>(c(),f(H,null,[u.props?(c(),A(ze(r(u.type)),G({key:0,torrent:l.torrent},u.props),null,16,["torrent"])):V("",!0)],64))),256))])]),_:1})]),_:1},8,["class","color"]))}});on=le(nn,[["__scopeId","data-v-f6fdaf5d"]]);rn={class:"d-flex align-center",style:{height:"100%",width:"100%"}};sn=S({__name:"GridView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(a){const e=_t(),t=ne();return(n,o)=>(c(),A(et,{id:"torrentList"},{default:m(()=>[(c(!0),f(H,null,Z(n.paginatedTorrents,r=>(c(),A(xe,{cols:"12",lg:"3",md:"4",sm:"6",xl:"2",class:ae([h(e).mobile?"pb-2":"pb-4","pt-0"]),onContextmenu:s=>n.$emit("onTorrentRightClick",s,r),onTouchcancel:o[1]||(o[1]=s=>n.$emit("endPress")),onTouchend:o[2]||(o[2]=s=>n.$emit("endPress")),onTouchmove:o[3]||(o[3]=s=>n.$emit("endPress")),onTouchstart:s=>n.$emit("startPress",s.touches.item(0),r),onDblclick:s=>n.$emit("onTorrentDblClick",r)},{default:m(()=>[y("div",rn,[d(yt,null,{default:m(()=>[Be(d(O,{color:`torrent-${r.state}`,icon:h(t).isTorrentInSelection(r.hash)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"mr-2",variant:"text",onClick:s=>n.$emit("onCheckboxClick",r)},null,8,["color","icon","onClick"]),[[We,h(t).isSelectionMultiple]])]),_:2},1024),d(on,{torrent:r,onOnTorrentClick:o[0]||(o[0]=(s,l)=>n.$emit("onTorrentClick",s,l))},null,8,["torrent"])])]),_:2},1032,["class","onContextmenu","onTouchstart","onDblclick"]))),256))]),_:1}))}});ln=le(sn,[["__scopeId","data-v-8292d1aa"]]);un={class:"d-flex gap flex-wrap"};dn=S({__name:"ListTorrent",props:{torrent:{}},emits:["onTorrentClick"],setup(a){const e=a,t=ne(),n=K(),o=v(()=>(e.torrent.progress===1?n.doneTorrentProperties:n.busyTorrentProperties).filter(i=>i.active).sort((i,u)=>i.order-u.order)),r=l=>{switch(l){case M.AMOUNT:return xt;case M.CHIP:return It;case M.DATA:return Mt;case M.DATETIME:return Vt;case M.DURATION:return Et;case M.PERCENT:return At;case M.RELATIVE:return Dt;case M.SPEED:return Bt;case M.TEXT:default:return Rt}},s=v(()=>t.isTorrentInSelection(e.torrent.hash));return(l,i)=>(c(),A(fe,{class:ae(`sideborder ${l.torrent.state} pointer`),width:"100%",color:s.value?`torrent-${l.torrent.state}-darken-3`:void 0,onClick:i[0]||(i[0]=u=>l.$emit("onTorrentClick",u,l.torrent))},{default:m(()=>[d(Ye,{class:"text-wrap pt-1 pb-0 px-2 text-truncate",style:{"font-size":"0.97em"}},{default:m(()=>[B(p(l.torrent.name),1)]),_:1}),d(Te,{class:"pa-2 pt-0"},{default:m(()=>[y("div",un,[(c(!0),f(H,null,Z(o.value,u=>(c(),f(H,null,[u.props?(c(),A(ze(r(u.type)),G({key:0,torrent:l.torrent},u.props),null,16,["torrent"])):V("",!0)],64))),256))])]),_:1})]),_:1},8,["class","color"]))}});cn=le(dn,[["__scopeId","data-v-1e562e0e"]]);hn={class:"d-flex align-center"};mn=S({__name:"ListView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(a){const e=_t(),t=ne();return(n,o)=>(c(),A(mt,{id:"torrentList",class:"pa-0"},{default:m(()=>[(c(!0),f(H,null,Z(n.paginatedTorrents,r=>(c(),A(_e,{id:`torrent-${r.hash}`,class:ae([h(e).mobile?"mb-2":"mb-4","pa-0"]),onContextmenu:s=>n.$emit("onTorrentRightClick",s,r),onTouchcancel:o[1]||(o[1]=s=>n.$emit("endPress")),onTouchend:o[2]||(o[2]=s=>n.$emit("endPress")),onTouchmove:o[3]||(o[3]=s=>n.$emit("endPress")),onTouchstart:s=>n.$emit("startPress",s.touches.item(0),r),onDblclick:s=>n.$emit("onTorrentDblClick",r)},{default:m(()=>[y("div",hn,[d(yt,null,{default:m(()=>[Be(d(O,{color:`torrent-${r.state}`,icon:h(t).isTorrentInSelection(r.hash)?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"mr-2",variant:"text",onClick:s=>n.$emit("onCheckboxClick",r)},null,8,["color","icon","onClick"]),[[We,h(t).isSelectionMultiple]])]),_:2},1024),d(cn,{torrent:r,onOnTorrentClick:o[0]||(o[0]=(s,l)=>n.$emit("onTorrentClick",s,l))},null,8,["torrent"])])]),_:2},1032,["id","class","onContextmenu","onTouchstart","onDblclick"]))),256))]),_:1}))}});fn=le(mn,[["__scopeId","data-v-2b24c5da"]]);pn={key:0};gn=S({__name:"ItemAmount",props:{torrent:{},value:{type:Function},total:{type:Function}},setup(a){return(e,t)=>(c(),f("td",null,[B(p(e.value(e.torrent))+" ",1),e.total?(c(),f("span",pn," / "+p(e.total(e.torrent)),1)):V("",!0)]))}});bn={key:0,class:"d-flex flex-row gap"};vn=S({__name:"ItemChip",props:{torrent:{},value:{},emptyValueKey:{},color:{},enableHashColor:{type:Boolean,default:!1}},setup(a){const e=a,{hideChipIfUnset:t,enableHashColors:n}=U(K()),o=v(()=>e.value(e.torrent)),r=v(()=>o.value.length<1||o.value[0]===""),s=v(()=>!(t.value&&r.value)),l=v(()=>n.value&&e.enableHashColor);return(i,u)=>(c(),f("td",null,[s.value?(c(),f("div",bn,[r.value?(c(),A(Ve,{key:0,color:i.color(i.torrent),variant:"flat",size:"small"},{default:m(()=>[B(p(i.$t(i.emptyValueKey)),1)]),_:1},8,["color"])):(c(!0),f(H,{key:1},Z(o.value,w=>(c(),A(Ve,{color:l.value?h(Ct)(w):i.color(i.torrent),variant:"flat",size:"small"},{default:m(()=>[B(p(w),1)]),_:2},1032,["color"]))),256))])):V("",!0)]))}});yn=le(vn,[["__scopeId","data-v-20bf1baa"]]);_n=S({__name:"ItemData",props:{torrent:{},value:{type:Function}},setup(a){const{useBinarySize:e}=U(K());return(t,n)=>(c(),f("td",null,p(h(Xt)(t.value(t.torrent),h(e))),1))}});kn={key:0};Tn={key:1};$n=S({__name:"ItemDateTime",props:{torrent:{},value:{type:Function}},setup(a){const e=a,{dateFormat:t}=U(K()),n=v(()=>e.value(e.torrent));return(o,r)=>n.value>0?(c(),f("td",kn,p(h(gt)(n.value,h(t))),1)):(c(),f("td",Tn,p(o.$t("dashboard.not_complete")),1))}});wn={key:0};Sn={key:1};Cn=S({__name:"ItemDuration",props:{torrent:{},value:{type:Function}},setup(a){const e=a,t=v(()=>e.value(e.torrent)),n=v(()=>{const o=Le.duration(t.value,"seconds"),r=[o.years(),o.months(),o.days(),o.hours(),o.minutes(),o.seconds()],s=["Y","M","d","h","m","s"];let l=!1;return r.map((i,u)=>{if(l||i)return l=!0,`${i}${s[u]}`}).filter(i=>i).join(" ")});return(o,r)=>t.value>0?(c(),f("td",wn,p(n.value),1)):(c(),f("td",Sn,p(o.$t("dashboard.not_complete")),1))}});xn=S({__name:"ItemPercent",props:{torrent:{},value:{type:Function},color:{type:Function}},setup(a){const e=a,t=v(()=>e.value(e.torrent));return(n,o)=>(c(),f("td",null,[d(vt,{"model-value":t.value,max:1,height:20,color:n.color(n.torrent),rounded:"sm",style:{width:"10em"}},{default:m(()=>[B(p(h(bt)(t.value)),1)]),_:1},8,["model-value","color"])]))}});In=S({__name:"ItemRelativeTime",props:{torrent:{},value:{type:Function}},setup(a){return(e,t)=>(c(),f("td",null,p(h(Le)(e.value(e.torrent)*1e3).fromNow()),1))}});Mn=S({__name:"ItemSpeed",props:{torrent:{},value:{type:Function}},setup(a){const{useBitSpeed:e}=U(K());return(t,n)=>(c(),f("td",null,p(h(Yt)(t.value(t.torrent),h(e))),1))}});Vn=S({__name:"ItemText",props:{torrent:{},value:{type:Function},color:{type:Function}},setup(a){const e=a,t=v(()=>e.value(e.torrent));return(n,o)=>(c(),f("td",{class:ae(n.color?n.color(t.value):"")},p(t.value),3))}});En=S({__name:"TableTorrent",props:{torrent:{}},setup(a){const e=K(),t=v(()=>e.tableProperties.filter(o=>o.active).sort((o,r)=>o.order-r.order)),n=o=>{switch(o){case M.AMOUNT:return gn;case M.CHIP:return yn;case M.DATA:return _n;case M.DATETIME:return $n;case M.DURATION:return Cn;case M.PERCENT:return xn;case M.RELATIVE:return In;case M.SPEED:return Mn;case M.TEXT:default:return Vn}};return(o,r)=>(c(!0),f(H,null,Z(t.value,s=>(c(),f(H,null,[s.props?(c(),A(ze(n(s.type)),G({key:0,torrent:o.torrent},s.props),null,16,["torrent"])):V("",!0)],64))),256))}});An=a=>(Pt("data-v-44c00880"),a=a(),Lt(),a);Dn=An(()=>y("th",{class:"px-1"},null,-1));Bn={key:0};Rn={class:"text-left"};Pn={class:"text-left"};Ln=["onContextmenu","onTouchstart","onClick","onDblclick"];On={key:0};Nn=S({__name:"TableView",props:{paginatedTorrents:{}},emits:["onCheckboxClick","onTorrentClick","onTorrentDblClick","onTorrentRightClick","startPress","endPress"],setup(a){const e=ne(),t=K(),n=v(()=>t.tableProperties.filter(s=>s.active).sort((s,l)=>s.order-l.order));function o(s){return e.isTorrentInSelection(s.hash)}const r=s=>["pointer",o(s)?`bg-torrent-${s.state}-darken-3 selected`:""];return(s,l)=>(c(),A(Qt,{id:"torrentList",class:"pa-0",density:"compact"},{default:m(()=>[y("thead",null,[y("tr",null,[Dn,h(e).isSelectionMultiple?(c(),f("th",Bn)):V("",!0),y("th",Rn,p(s.$t("torrent.properties.name")),1),(c(!0),f(H,null,Z(n.value,i=>(c(),f("th",Pn,p(s.$t(i.props.titleKey)),1))),256))])]),y("tbody",null,[(c(!0),f(H,null,Z(s.paginatedTorrents,i=>Be((c(),f("tr",{class:ae(r(i)),onContextmenu:u=>s.$emit("onTorrentRightClick",u,i),onTouchcancel:l[0]||(l[0]=u=>s.$emit("endPress")),onTouchend:l[1]||(l[1]=u=>s.$emit("endPress")),onTouchmove:l[2]||(l[2]=u=>s.$emit("endPress")),onTouchstart:u=>s.$emit("startPress",u.touches.item(0),i),onClick:u=>s.$emit("onTorrentClick",u,i),onDblclick:u=>s.$emit("onTorrentDblClick",i)},[y("td",{class:ae(`pa-0 bg-torrent-${i.state}`)},null,2),h(e).isSelectionMultiple?(c(),f("td",On,[d(Ie,{"model-value":o(i),color:`torrent-${i.state}`,variant:"text",onClick:re(u=>s.$emit("onCheckboxClick",i),["stop"])},null,8,["model-value","color","onClick"])])):V("",!0),y("td",null,p(i.name),1),d(En,{torrent:i},null,8,["torrent"])],42,Ln)),[[Zt]])),256))])]),_:1}))}});Hn=le(Nn,[["__scopeId","data-v-44c00880"]]);Fn={class:"pt-4 px-1 px-sm-5"};Un={class:"text-grey"};Kn={key:0,class:"mt-5 text-xs-center"};Gn={class:"text-grey"};qn={key:1};jn={key:5};Jn=S({__name:"Dashboard",setup(a){const{t:e}=Ae(),t=ht(),n=ne(),{currentPage:o,isSelectionMultiple:r,selectedTorrents:s,displayMode:l}=U(n),i=ft(),u=Pe(),w=me(),{filteredTorrents:_}=U(w),P=K(),E=v(()=>l.value===Q.LIST),k=v(()=>l.value===Q.GRID),C=v(()=>l.value===Q.TABLE),{paginatedResults:x,currentPage:T,pageCount:I}=aa(_,P.paginationSize,o),z=v(()=>_.value.length<=s.value.length),J=dt({isVisible:!1,offset:[0,0]});function pe(){window.scrollTo({top:0,behavior:"smooth"})}function $e($){if($)return Ne(()=>{document.getElementById("searchInput")?.focus()});Ne(()=>{document.getElementById("searchInput")?.blur()})}function Oe(){z.value?n.unselectAllTorrents():n.selectTorrents(..._.value.map($=>$.hash))}function ge($){r.value||t.push({name:"torrentDetail",params:{hash:$.hash}})}function be($){n.toggleSelect($.hash)}function ie($,R){$.shiftKey?n.spanTorrentSelection(R.hash):(Ue($)||n.isSelectionMultiple)&&(n.isSelectionMultiple=!0,n.toggleSelect(R.hash))}async function ue($,R){J.isVisible&&(J.isVisible=!1,await Ne()),J.isVisible=!0,J.offset=[$.pageX,$.pageY],r.value?s.value.length===0&&n.selectTorrent(R.hash):(n.unselectAllTorrents(),n.selectTorrent(R.hash))}const de=N();function ve($,R){de.value=setTimeout(()=>{ue($,R)},500)}function ye(){clearTimeout(de.value)}function we($){if(i.hasActiveDialog)return!1;const R=$.target;if(Ue($)&&$.key==="a"&&R.tagName!=="INPUT")return n.unselectAllTorrents(),n.selectTorrents(..._.value.map(b=>b.hash)),$.preventDefault(),!0;if(Ue($)&&$.key==="f"){const b=document.getElementById("searchInput");if(document.activeElement!==b)return $e(!0),$.preventDefault(),!0}if($.key==="Escape"){const b=document.getElementById("searchInput");return document.activeElement===b?$e(!1):(r.value=!1,n.unselectAllTorrents()),$.preventDefault(),!0}if($.key==="Delete")return s.value.length===0?void 0:(i.createDialog(pt,{hashes:s.value}),$.preventDefault(),!0);if($.key==="/"){const b=document.getElementById("searchInput");return document.activeElement!==b&&(t.push({name:"searchEngine"}),$.preventDefault()),!0}}return Ot(()=>J.isVisible,$=>{!$&&!r.value&&n.unselectAllTorrents()}),De(async()=>{await u.fetchCategories(),await u.fetchTags()}),ct(()=>{document.addEventListener("keydown",we),r.value=!1,pe()}),Nt(()=>{document.removeEventListener("keydown",we)}),($,R)=>(c(),f(H,null,[y("div",Fn,[d(wa),d(et,{class:"ma-0 pa-0"},{default:m(()=>[d(Jt,null,{default:m(()=>[Be(d(fe,{color:"transparent"},{default:m(()=>[d(ee,{text:h(e)("common.selectAll"),location:"bottom"},{activator:m(({props:b})=>[d(O,G({icon:z.value?"mdi-checkbox-marked":"mdi-checkbox-blank-outline",class:"text-grey",color:"transparent",style:{left:"-8px"}},b,{onClick:Oe}),null,16,["icon"])]),_:1},8,["text"]),y("span",Un,p(h(e)("dashboard.selectAll")),1)]),_:1},512),[[We,h(r)]])]),_:1})]),_:1}),h(_).length===0?(c(),f("div",Kn,[y("p",Gn,p(h(e)("common.emptyList")),1)])):V("",!0),h(P).isPaginationOnTop&&!h(P).isInfiniteScrollActive&&h(I)>1?(c(),f("div",qn,[d(at,{modelValue:h(T),"onUpdate:modelValue":R[0]||(R[0]=b=>ke(T)?T.value=b:null),length:h(I),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left",onInput:pe},null,8,["modelValue","length"])])):V("",!0),E.value?(c(),A(fn,{key:2,"paginated-torrents":h(x),onOnTorrentClick:ie,onOnTorrentDblClick:ge,onOnCheckboxClick:be,onOnTorrentRightClick:ue,onStartPress:ve,onEndPress:ye},null,8,["paginated-torrents"])):k.value?(c(),A(ln,{key:3,class:"mb-2","paginated-torrents":h(x),onOnTorrentClick:ie,onOnTorrentDblClick:ge,onOnCheckboxClick:be,onOnTorrentRightClick:ue,onStartPress:ve,onEndPress:ye},null,8,["paginated-torrents"])):C.value?(c(),A(Hn,{key:4,"paginated-torrents":h(x),onOnTorrentClick:ie,onOnTorrentDblClick:ge,onOnCheckboxClick:be,onOnTorrentRightClick:ue,onStartPress:ve,onEndPress:ye},null,8,["paginated-torrents"])):V("",!0),!h(P).isPaginationOnTop&&!h(P).isInfiniteScrollActive&&h(I)>1?(c(),f("div",jn,[d(at,{modelValue:h(T),"onUpdate:modelValue":R[1]||(R[1]=b=>ke(T)?T.value=b:null),length:h(I),"next-icon":"mdi-menu-right","prev-icon":"mdi-menu-left",onInput:pe},null,8,["modelValue","length"])])):V("",!0)]),d(Ia,{"right-click-properties":J},null,8,["right-click-properties"])],64))}})});export{Jn as default,__tla};