From a219f4e8e4e47034a101df0eb6c6021e404956ed Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 20 Nov 2020 17:11:26 -0600 Subject: [PATCH] chore: update transmission-app.js --- web/public_html/transmission-app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/public_html/transmission-app.js b/web/public_html/transmission-app.js index 523d3dde2..cb15267cd 100644 --- a/web/public_html/transmission-app.js +++ b/web/public_html/transmission-app.js @@ -1,3 +1,3 @@ /*! For license information please see transmission-app.js.LICENSE.txt */ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=40)}([function(e,t,n){"use strict";e.exports=function(e,t){return t||(t={}),"string"!=typeof(e=e&&e.__esModule?e.default:e)?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},function(e,t,n){(function(e,n){var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",A="[object Map]",p="[object Number]",u="[object Object]",g="[object Promise]",m="[object RegExp]",h="[object Set]",f="[object String]",b="[object Symbol]",C="[object WeakMap]",v="[object ArrayBuffer]",y="[object DataView]",E=/^\[object .+?Constructor\]$/,w=/^(?:0|[1-9]\d*)$/,x={};x["[object Float32Array]"]=x["[object Float64Array]"]=x["[object Int8Array]"]=x["[object Int16Array]"]=x["[object Int32Array]"]=x["[object Uint8Array]"]=x["[object Uint8ClampedArray]"]=x["[object Uint16Array]"]=x["[object Uint32Array]"]=!0,x[i]=x[s]=x[v]=x[a]=x[y]=x[l]=x[c]=x[d]=x[A]=x[p]=x[u]=x[m]=x[h]=x[f]=x[C]=!1;var k="object"==typeof e&&e&&e.Object===Object&&e,M="object"==typeof self&&self&&self.Object===Object&&self,S=k||M||Function("return this")(),B=t&&!t.nodeType&&t,I=B&&"object"==typeof n&&n&&!n.nodeType&&n,T=I&&I.exports===B,D=T&&k.process,L=function(){try{return D&&D.binding&&D.binding("util")}catch(e){}}(),N=L&&L.isTypedArray;function j(e,t){for(var n=-1,r=null==e?0:e.length;++na))return!1;var c=i.get(e);if(c&&i.get(t))return c==t;var d=-1,A=!0,p=2&n?new ve:void 0;for(i.set(e,t),i.set(t,e);++d-1},be.prototype.set=function(e,t){var n=this.__data__,r=we(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Ce.prototype.clear=function(){this.size=0,this.__data__={hash:new fe,map:new(ie||be),string:new fe}},Ce.prototype.delete=function(e){var t=De(this,e).delete(e);return this.size-=t?1:0,t},Ce.prototype.get=function(e){return De(this,e).get(e)},Ce.prototype.has=function(e){return De(this,e).has(e)},Ce.prototype.set=function(e,t){var n=De(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ve.prototype.add=ve.prototype.push=function(e){return this.__data__.set(e,r),this},ve.prototype.has=function(e){return this.__data__.has(e)},ye.prototype.clear=function(){this.__data__=new be,this.size=0},ye.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ye.prototype.get=function(e){return this.__data__.get(e)},ye.prototype.has=function(e){return this.__data__.has(e)},ye.prototype.set=function(e,t){var n=this.__data__;if(n instanceof be){var r=n.__data__;if(!ie||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ce(r)}return n.set(e,t),this.size=n.size,this};var Ne=te?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Qe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ye(e){return null!=e&&"object"==typeof e}var We=N?function(e){return function(t){return e(t)}}(N):function(e){return Ye(e)&&Ue(e.length)&&!!x[xe(e)]};function Je(e){return null!=(t=e)&&Ue(t.length)&&!Ge(t)?Ee(e):Be(e);var t}n.exports=function(e,t){return Me(e,t)}}).call(this,n(35),n(36)(e))},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(s=r,a=btoa(unescape(encodeURIComponent(JSON.stringify(s)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),"/*# ".concat(l," */")),i=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(i).concat([o]).join("\n")}var s,a,l;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i*{margin:0;padding:0}.mainwin-workarea{display:flex;flex:1;flex-direction:row;overflow:auto}#mainwin-toolbar{align-items:center;background:var(--color-toolbar-background);border-bottom:1px solid var(--color-border);display:flex;flex-direction:row;height:36px;margin:0;padding:2px;width:100%}#mainwin-toolbar button{background-color:transparent;background-position:center;background-repeat:no-repeat;border:0;cursor:pointer;height:36px;margin-right:6px;user-select:none;width:36px}#mainwin-toolbar button:hover:not(:disabled){background-color:var(--color-bg-hover)}#mainwin-toolbar button:disabled{cursor:default;opacity:.25}#mainwin-toolbar>.toolbar-separator{border-left:1px solid var(--color-border);height:25px;margin:0 6px 0 0}#mainwin-toolbar :nth-last-child(2){border:0;flex-grow:1}#toolbar-open{background-image:url("+O+")}#toolbar-remove{background-image:url("+G+")}#toolbar-start{background-image:url("+U+")}#toolbar-pause{background-image:url("+Q+")}#toolbar-inspector{background-image:url("+Y+")}#toolbar-overflow{background-color:transparent;background-image:url("+W+");background-position:center;background-size:26px;margin-right:4px;width:36px}#toolbar-overflow.alt-speed-enabled{background-image:url("+J+"),url("+W+");background-position:bottom left,center,center;background-size:16px 9px,26px,26px}.mainwin-filterbar{align-items:center;background:var(--color-toolbar-background);border-bottom:1px solid var(--color-border);display:flex;flex-direction:row;font-size:smaller;width:100%}@media(max-width: 599px){.mainwin-filterbar>:not(select):not(input){display:none}.mainwin-filterbar>input{min-width:50px}.mainwin-filterbar>input,.mainwin-filterbar>select{height:100%}}.mainwin-filterbar>*{padding:0 5px}#torrent-search.blur{color:var(--color-fg-tertiary)}.speed-up-icon{background-image:url("+H+");background-repeat:no-repeat;background-size:12px 12px;height:12px;width:12px}.speed-dn-icon{background-image:url("+q+");background-repeat:no-repeat;background-size:12px 12px;height:12px;width:12px}.flex{flex-grow:1}#torrent-container{flex-grow:1;left:0;margin:0;overflow:auto;-webkit-overflow-scrolling:touch;padding:0;right:0}.torrent-container{background-color:#fff}.torrent-list{cursor:pointer;list-style-type:none;margin:0;padding:0;text-align:left;width:100%}.torrent-list .torrent{border-bottom:1px solid var(--color-border);color:var(--color-fg-secondary);user-select:none}.torrent-list .torrent.paused{color:var(--color-fg-disabled)}.torrent-list .torrent .icon{background-position:center,top left}.torrent-list .torrent .icon[data-icon-mime-type=audio]{background-image:url("+Z+")}.torrent-list .torrent .icon[data-icon-mime-type=audio][data-icon-multifile=true]{background-image:url("+Z+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=application]{background-image:url("+K+")}.torrent-list .torrent .icon[data-icon-mime-type=application][data-icon-multifile=true]{background-image:url("+K+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=font]{background-image:url("+X+")}.torrent-list .torrent .icon[data-icon-mime-type=font][data-icon-multifile=true]{background-image:url("+X+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=image]{background-image:url("+$+")}.torrent-list .torrent .icon[data-icon-mime-type=image][data-icon-multifile=true]{background-image:url("+$+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=model]{background-image:url("+ee+")}.torrent-list .torrent .icon[data-icon-mime-type=model][data-icon-multifile=true]{background-image:url("+ee+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=text]{background-image:url("+te+")}.torrent-list .torrent .icon[data-icon-mime-type=text][data-icon-multifile=true]{background-image:url("+te+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=video]{background-image:url("+ne+")}.torrent-list .torrent .icon[data-icon-mime-type=video][data-icon-multifile=true]{background-image:url("+ne+"),url("+V+')}.torrent-list .torrent.compact{align-items:center;display:flex;flex-direction:row-reverse}.torrent-list .torrent.compact .icon{background-size:16px,8px;flex-shrink:0;height:16px;width:16px}.torrent-list .torrent.compact>*{margin:4px 5px}.torrent-list .torrent:not(.compact){align-items:center;display:grid;grid-column-gap:12px;grid-template-areas:"icon name" "icon peers" "icon progressbar" "icon progress-text";grid-template-columns:32px 1fr;padding:2px 12px}.torrent-list .torrent:not(.compact) .icon{background-size:32px,16px;grid-area:icon;height:32px;width:32px}.torrent-list .torrent:not(.compact) .torrent-name{grid-area:name}.torrent-list .torrent:not(.compact) .torrent-peer-details{grid-area:peers}.torrent-list .torrent:not(.compact) .torrent-progress{display:flex;flex-direction:row;grid-area:progressbar}.torrent-list .torrent:not(.compact) .torrent-progress-details{grid-area:progress-text}.torrent-list .torrent:not(.compact)>*{margin:1px 0}.torrent-list .torrent.selected{background-color:var(--color-bg-selection-1)}.torrent-list .torrent.selected .torrent-progress-details.error,.torrent-list .torrent.selected .torrent-peer-details.error{color:#fff}.torrent-list .icon{background-position:center;background-repeat:no-repeat}.torrent-list .torrent-pauseresume-button{background-position:center center;background-repeat:no-repeat;background-size:14px;margin-left:7px;width:14px}.torrent-list .torrent-pauseresume-button[data-action=pause]{background-image:url('+re+")}.torrent-list .torrent-pauseresume-button[data-action=pause]:active,.torrent-list .torrent-pauseresume-button[data-action=pause]:hover{background-image:url("+oe+")}.torrent-list .torrent-pauseresume-button[data-action=resume]{background-image:url("+ie+")}.torrent-list .torrent-pauseresume-button[data-action=resume]:active,.torrent-list .torrent-pauseresume-button[data-action=resume]:hover{background-image:url("+se+")}.torrent-list .torrent-progress-details.error,.torrent-list .torrent-peer-details.error{color:var(--color-fg-error)}.torrent-list .torrent-name{font-weight:bold;margin-bottom:2px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.torrent-list .torrent-name.compact{flex:1;font-size:1em;font-weight:normal}.torrent-list .torrent-name:not(.paused){color:var(--color-fg-name)}.torrent-list .torrent-progress-details,.torrent-list .torrent-peer-details{font-size:x-small}.torrent-list .torrent-progress-bar{background-repeat:no-repeat;border-radius:3px;border-style:solid;border-width:1px;height:12px}.torrent-list .torrent-progress-bar.full{flex-grow:1;margin:2px 0}.torrent-list .torrent-progress-bar.compact{min-width:50px;width:50px}.torrent-list .torrent-progress-bar.leech.paused{background:linear-gradient(to bottom, var(--color-progressbar-leech-paused-1), var(--color-progressbar-leech-paused-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.leech.queued{background:linear-gradient(to bottom, var(--color-progressbar-leech-queued-1), var(--color-progressbar-leech-queued-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.leech{background:linear-gradient(to bottom, var(--color-progressbar-leech-1), var(--color-progressbar-leech-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.magnet.paused{background:linear-gradient(to bottom, var(--color-progressbar-magnet-paused-1), var(--color-progressbar-magnet-paused-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.magnet{background:linear-gradient(to bottom, var(--color-progressbar-magnet-1), var(--color-progressbar-magnet-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.seed.paused{background:linear-gradient(to bottom, var(--color-progressbar-seed-paused-1), var(--color-progressbar-seed-paused-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.seed.queued{background:linear-gradient(to bottom, var(--color-progressbar-seed-queued-1), var(--color-progressbar-seed-queued-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.seed{background:linear-gradient(to bottom, var(--color-progressbar-seed-1), var(--color-progressbar-seed-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.verify{background:linear-gradient(to bottom, var(--color-progressbar-verify-1), var(--color-progressbar-verify-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}#inspector-tab-info{background-image:url("+ae+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#inspector-tab-info:active,#inspector-tab-info:checked,#inspector-tab-info.selected{background-image:url("+ae+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#inspector-tab-peers{background-image:url("+le+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#inspector-tab-peers:active,#inspector-tab-peers:checked,#inspector-tab-peers.selected{background-image:url("+le+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#inspector-tab-tiers{background-image:url("+ce+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#inspector-tab-tiers:active,#inspector-tab-tiers:checked,#inspector-tab-tiers.selected{background-image:url("+ce+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#inspector-tab-files{background-image:url("+de+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#inspector-tab-files:active,#inspector-tab-files:checked,#inspector-tab-files.selected{background-image:url("+de+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}@media(max-width: 599px){#inspector,#prefs-dialog{left:0}}@media(min-width: 600px){#inspector,#prefs-dialog{border-left:1px solid var(--color-fg-secondary);width:570px}}#prefs-dialog{background:#fff;bottom:0;box-shadow:0 3px 6px rgba(0,0,0,.7);position:absolute;right:0;top:61px;z-index:2}#prefs-dialog .tabs-page{grid-column-gap:8px;grid-row-gap:5px;grid-template-columns:1fr 1fr;margin:20px}#prefs-dialog .tabs-page:not(.hidden){display:grid}#prefs-dialog .tabs-page .section-label{font-weight:bold;grid-column:span 2;margin-left:-20px;padding-bottom:5px}#prefs-dialog .tabs-page .section-label:not(:first-of-type){margin-top:20px}#prefs-dialog .alt-speed-section-label{background:transparent url("+J+") no-repeat;background-position:left 4px;padding-left:22px}#prefs-dialog :disabled,#prefs-dialog .disabled{color:var(--color-fg-disabled)}#prefs-dialog #alt-times-div,#prefs-dialog #autostart-div,#prefs-dialog #port-forwarding,#prefs-dialog #randomize-port,#prefs-dialog #suffix-div,#prefs-dialog #use-dht-div,#prefs-dialog #use-lpd-div,#prefs-dialog #use-pex-div,#prefs-dialog #utp-enabled,#prefs-dialog .alt-speed-label{grid-column:span 2}#prefs-dialog .blocklist-size-label,#prefs-dialog .blocklist-update-button,#prefs-dialog .port-status{grid-column:2/3}#prefs-dialog .blocklist-size-label{font-size:smaller}#prefs-dialog .blocklist-size-number{font-weight:bolder}#prefs-dialog .port-status-label{display:inline-block;font-weight:bold;margin-left:5px}#prefs-dialog .port-status-label[data-open=true]{color:var(--color-fg-port-open)}#prefs-dialog .port-status-label[data-open=false]{color:var(--color-fg-port-closed)}#prefs-dialog .alt-speed-label{font-size:smaller;font-style:lighter;margin:-10px 0 10px -20px}#prefs-dialog.ui-tabs .ui-tabs-panel{padding:0;user-select:none}.prefs-section{text-align:left}.prefs-section>*{padding:0 8px 8px}.prefs-section .title{font-size:larger;font-weight:bold;padding-left:0}.prefs-section .row .key{float:left;padding-top:3px}.prefs-section .row .key>*{margin-left:0}.prefs-section .row .value{margin-left:150px}.prefs-section .row .value>*{width:100%}.prefs-section .checkbox-row>input{margin:0}.prefs-section .checkbox-row>label{margin-left:5px}.prefs-section #alternative-speed-limits-title{background:transparent url("+J+") no-repeat;padding-left:18px}.prefs-section #alternative-speed-limits-desc{font-size:smaller;padding-bottom:4px}.tabs-container{align-items:stretch;background:#fff;border-left:solid 1px var(--color-border);bottom:0;display:flex;flex-direction:column;position:absolute;right:0;top:61px;z-index:2}@media(max-width: 599px){.tabs-container{left:0}}@media(min-width: 600px){.tabs-container{width:550px}}.tabs-buttons{align-self:center;display:flex;padding:10px}.tabs-buttons button{border:1px solid var(--color-border);cursor:pointer;display:inline-block;padding:3px;user-select:none;appearance:none;padding:3px}.file-priority-radiobox :first-child,.tabs-buttons :first-child{border-bottom-left-radius:8px;border-top-left-radius:8px}.file-priority-radiobox :last-child,.tabs-buttons :last-child{border-bottom-right-radius:8px;border-top-right-radius:8px}.tabs-pages{box-sizing:border-box;flex:1;overflow-x:hidden;overflow-y:auto}@media(max-width: 599px){.tabs-pages{padding:0 8px 20px}}@media(min-width: 600px){.tabs-pages{padding:0 20px 20px}}.tabs-button{background-position:center;background-repeat:no-repeat}#inspector{box-shadow:0 3px 6px rgba(0,0,0,.7)}.inspector-info-page{grid-column-gap:8px;grid-row-gap:5px;grid-template-columns:auto 1fr;margin:20px;padding:12px}.inspector-info-page:not(.hidden){display:grid}.inspector-info-page .section-label{font-weight:bold;grid-column:span 2;margin-left:-20px;padding-bottom:5px}.inspector-info-page .section-label:not(:first-of-type){margin-top:20px}.inspector-info-page :not(.section-label){overflow-x:hidden;text-overflow:ellipsis}#inspector .tabs-button,#prefs-dialog .tabs-button{background-size:20px 20px,40px 30px;height:30px;margin:0;padding:0;width:40px}#prefs-tab-torrent{background-image:url("+Ae+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#prefs-tab-torrent:active,#prefs-tab-torrent:checked,#prefs-tab-torrent.selected{background-image:url("+Ae+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#prefs-tab-speed{background-image:url("+pe+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#prefs-tab-speed:active,#prefs-tab-speed:checked,#prefs-tab-speed.selected{background-image:url("+pe+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#prefs-tab-peers{background-image:url("+le+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#prefs-tab-peers:active,#prefs-tab-peers:checked,#prefs-tab-peers.selected{background-image:url("+le+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#prefs-tab-network{background-image:url("+ue+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#prefs-tab-network:active,#prefs-tab-network:checked,#prefs-tab-network.selected{background-image:url("+ue+'),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#inspector-file-list{margin:0;padding:0}#inspector-file-list .inspector-torrent-file-list-entry{display:grid;grid-column-gap:5px;grid-template-areas:"check name priority" "blank1 info blank2";grid-template-columns:20px 1fr 65px;margin-bottom:4px;padding:5px}#inspector-file-list .inspector-torrent-file-list-entry.skip{opacity:.5}#inspector-file-list .file-wanted-control{grid-area:check}#inspector-file-list .inspector-torrent-file-list-entry-name{color:var(--color-fg-name);cursor:pointer;grid-area:name;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#inspector-file-list .inspector-torrent-file-list-entry.skip>.inspector-torrent-file-list-entry-name{color:var(--color-fg-disabled)}#inspector-file-list .inspector-torrent-file-list-entry-progress{color:var(--color-fg-secondary);grid-area:info}#inspector-file-list .single-file .inspector-torrent-file-list-entry>.file-wanted-control,#inspector-file-list .inspector-torrent-file-list-entry.complete>.file-wanted-control{cursor:default}#inspector-header{margin:8px 0}#torrent-inspector-name{font-size:large;font-weight:bold}#inspector-tiers-list{color:var(--color-fg-secondary);margin:0 10px;padding:0 12px}#inspector-tiers-list .tier-list-row{display:grid;grid-column-gap:8px;grid-row-gap:4px;margin-top:8px}#inspector-tiers-list .tier-list-torrent{color:var(--color-fg-primary);font-size:larger;font-weight:bolder;margin-left:-12px;overflow-x:hidden;padding-top:20px;text-overflow:ellipsis;white-space:nowrap}#inspector-tiers-list .tier-list-tracker{font-weight:bolder;grid-column:span 2;margin-top:8px;padding-bottom:4px}#inspector-tiers-list .tier-announce,#inspector-tiers-list .tier-scrape,#inspector-tiers-list .tier-state{text-align:left}#inspector-tiers-list .tier-downloads,#inspector-tiers-list .tier-leechers,#inspector-tiers-list .tier-seeders{text-align:right}.peer-list{border:1px solid #f6f8fa;border-collapse:collapse;cursor:default;table-layout:fixed;text-align:left;width:100%}.peer-list td,.peer-list th{font-size:smaller;padding:5px}.peer-list td{border:1px solid #f6f8fa;color:var(--color-fg-secondary)}.peer-list .torrent-row td{background:#f6f8fa;color:var(--color-fg-primary);font-size:normal;font-weight:bolder;overflow-x:hidden;padding:10px;text-overflow:ellipsis;white-space:nowrap}.peer-list .encryption{width:16px}.peer-list .encryption[data-encrypted=true]{background:transparent url('+ge+") center center no-repeat;height:16px;width:16px}.peer-list .peer-address,.peer-list .percent-done,.peer-list .speed-down,.peer-list .speed-up{text-align:right}.peer-list .percent-done{width:10%}.peer-list .speed-down,.peer-list .speed-up{width:15%}.peer-list .peer-address{width:25%}.peer-list .peer-app-name{overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}@media(max-width: 599px){.peer-list .peer-app-name{display:none}}@media(min-width: 600px){.peer-list .peer-app-name{width:25%}}.peer-list .status{cursor:pointer}.file-priority-radiobox{grid-area:priority}.file-priority-radiobox>*{border:1px solid var(--color-border);cursor:pointer;display:inline-block;padding:3px;user-select:none;appearance:none;background-position:center;background-repeat:no-repeat;background-size:10px,20px;height:20px;margin:0;padding:0;width:20px}.file-priority-radiobox>.low{background-image:url("+q+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2));border-right-width:0}.file-priority-radiobox>.low:active,.file-priority-radiobox>.low:checked,.file-priority-radiobox>.low.selected{background-image:url("+q+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}.file-priority-radiobox>.normal{background-image:url("+me+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}.file-priority-radiobox>.normal:active,.file-priority-radiobox>.normal:checked,.file-priority-radiobox>.normal.selected{background-image:url("+me+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}.file-priority-radiobox>.high{background-image:url("+H+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2));border-left-width:0}.file-priority-radiobox>.high:active,.file-priority-radiobox>.high:checked,.file-priority-radiobox>.high.selected{background-image:url("+H+'),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}.context-menu{background:var(--color-bg-menu);box-shadow:0 3px 6px rgba(0,0,0,.7);position:absolute;z-index:2}.context-menu .context-menuitem{list-style:none;padding:5px 10px}.context-menu .context-menuitem:hover:not(:disabled),.context-menu .context-menuitem:focus:not(:disabled){background-image:linear-gradient(#fff, var(--color-bg-menu));cursor:pointer}.context-menu .context-menuitem:disabled{color:var(--color-fg-disabled);cursor:none}.context-menu-separator{border-bottom:1px solid var(--color-fg-secondary);margin-bottom:10px;padding-bottom:10px}.overflow-menu{background:linear-gradient(160deg, #d21, 1%, var(--color-bg-hover), 40%, var(--color-bg-menu));border-radius:8px;box-shadow:0 3px 6px rgba(0,0,0,.7);padding:20px;position:fixed;width:200px;z-index:2}.overflow-menu fieldset{border:0;margin-bottom:8px;padding:0}.overflow-menu>.actions,.overflow-menu>.info,.overflow-menu>.links{display:flex;flex-direction:column}.overflow-menu legend{font-weight:bolder;margin-bottom:4px}.overflow-menu legend~*{margin-left:12px}.overflow-menu a,.overflow-menu button,.overflow-menu label{color:var(--color-fg-primary);font-size:1em}.overflow-menu a:disabled,.overflow-menu button:disabled,.overflow-menu label:disabled{color:var(--color-fg-disabled);cursor:default}.overflow-menu a:focus:not(:disabled),.overflow-menu a:hover:not(:disabled),.overflow-menu button:focus:not(:disabled),.overflow-menu button:hover:not(:disabled),.overflow-menu label:focus:not(:disabled),.overflow-menu label:hover:not(:disabled){background-color:var(--color-bg-hover)}.overflow-menu a,.overflow-menu button{background:transparent;border:0;cursor:pointer;display:block;padding:4px 0;text-align:left;text-decoration:none;width:150px}.overflow-menu .input-and-label{align-items:center;display:inline-flex;flex-direction:row}.overflow-menu #display-options>*{align-items:center;display:inline-flex;flex-direction:row}.overflow-menu #display-options>*>*{margin:4px}.overflow-menu #display-options>* :first-child{margin-left:0}.overflow-menu #display-options>* :last-child{margin-right:0}.overflow-menu #speed-options{display:flex;flex-direction:column}.overflow-menu #speed-options>.speed-up,.overflow-menu #speed-options>.speed-down{align-items:center;display:flex;flex-direction:row;padding:4px 0}.overflow-menu #speed-options>.speed-up>label,.overflow-menu #speed-options>.speed-down>label{overflow:hidden;width:80px}.overflow-menu #speed-options .alt-speed{display:grid;grid-column-gap:5px;grid-row-gap:5px;grid-template-areas:"check lb" "turtle values";grid-template-columns:20px 1fr;margin-bottom:4px}.overflow-menu #speed-options #alt-speed-check{grid-area:check}.overflow-menu #speed-options #alt-speed-check:checked~#alt-speed-image{background-image:url('+J+")}.overflow-menu #speed-options #alt-speed-check:not(:checked)~#alt-speed-image{background-image:url("+he+')}.overflow-menu #speed-options #alt-speed-image{background-position:center;background-repeat:no-repeat;grid-area:turtle}.overflow-menu #speed-options #alt-speed-label{grid-area:lb}.overflow-menu #speed-options #alt-speed-values-label{font-size:small;grid-area:values}@media(min-width: 600px){#display-fullscreen-check,#display-fullscreen-label{display:none}}@media(max-width: 599px){.dialog-buttons{padding-top:13.3333333333px}.dialog-container{opacity:96%;position:absolute;top:61px;width:100%}.dialog-logo{padding-bottom:13.3333333333px}.dialog-window{align-items:center;display:flex;flex-direction:column}}@media(min-width: 600px){.dialog-container{left:50%;min-width:400px;position:absolute;top:122px;transform:translateX(-50%)}.dialog-heading{grid-area:heading}.dialog-logo{grid-area:icon;padding-right:13.3333333333px}.dialog-window{display:grid;grid-column-gap:12px;grid-template-areas:"icon heading" "icon message" "icon workarea" "icon buttons";grid-template-columns:64px 1fr;padding:2px 12px}}.dialog-buttons{display:flex;float:right;grid-area:buttons;margin:10px 0 0;text-align:center}.dialog-buttons button{appearance:none;background:transparent;border:1px solid var(--color-border);border-radius:5px;color:var(--color-fg-name);margin-left:8px;padding:8px;text-decoration:none}.dialog-buttons a:hover,.dialog-buttons a:active{background:linear-gradient(#fff, var(--color-bg-menu))}.dialog-buttons-begin{flex-grow:1}.dialog-buttons-end{display:none}.dialog-container{border:0;box-shadow:0 3px 6px rgba(0,0,0,.7);color:var(--color-fg-primary);display:block;margin:0;padding:0;z-index:2}.dialog-heading{align-items:center;display:flex;font-size:1.2em;font-weight:bold}.dialog-logo{background:transparent url('+fe+") top left no-repeat;height:64px;width:64px}.dialog-message{grid-area:message;margin:10px 0 0}.dialog-window{background:linear-gradient(160deg, #d21, 1%, #f7f7f7, 40%, #ccc);height:100%;padding:20px}.dialog-workarea{display:flex;flex-direction:column;grid-area:workarea;margin:10px 0 0}.dialog-workarea>*{margin-bottom:5px}.about-dialog .dialog-workarea>*{margin-bottom:10px}.about-dialog-version-number{margin-left:4px}.about-dialog-version-checksum{font-size:small;font-style:italic;font-weight:normal;margin-left:auto;padding-left:10px}.shortcuts-dialog table{border-collapse:collapse;width:100%}.shortcuts-dialog th,.shortcuts-dialog td{border:1px solid var(--color-border);padding:5px 10px}#torrent-rename-name{min-width:400px}#move-container #torrent-path{min-width:400px}.tabs-pages .content,.inspector-info-page .content,.statistics-dialog .content{column-gap:16px;display:grid;grid-row-gap:6px;grid-template-columns:auto 1fr;margin-top:4px}@media(max-width: 599px){.tabs-pages .content,.inspector-info-page .content,.statistics-dialog .content{margin:4px 0 16px}}@media(min-width: 600px){.tabs-pages .content,.inspector-info-page .content,.statistics-dialog .content{margin:4px 16px 16px}}.tabs-pages .content div,.inspector-info-page .content div,.statistics-dialog .content div{word-break:break-word}.tabs-pages fieldset,.inspector-info-page fieldset,.statistics-dialog fieldset{border:0;margin:0;padding:0}.tabs-pages legend,.inspector-info-page legend,.statistics-dialog legend{font-weight:bolder;margin-bottom:4px}#free-space-text{display:inline-block;float:right;font-size:smaller;font-style:italic}#torrent-upload-frame{border:0;display:block;height:0;left:-1000px;margin:0;padding:0;position:absolute;top:-1000px;width:0}.ui-menu{width:200px}","",{version:3,sources:["webpack://style/transmission-app.scss"],names:[],mappings:"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",sourcesContent:["@use 'sass:color';\n@use 'sass:math';\n\n// Color palette recycled from GitHub Primer.\n// Please use those values if you need to add colors.\n// https://primer.style/css/support/color-system\n$blue-100: #dbedff;\n$blue-200: #c8e1ff;\n$blue-300: #79b8ff;\n$blue-700: #044289;\n$green-100: #dcffe4;\n$green-200: #bef5cb;\n$green-300: #85e89d;\n$green-500: #28a745;\n$green-700: #176f2c;\n$grey-100: #f6f8fa;\n$grey-200: #e1e4e8;\n$grey-300: #d1d5da;\n$grey-400: #959da5;\n$grey-500: #6a737d;\n$grey-800: #2f363d;\n$pink-300: #f692ce;\n$pink-700: #b93a86;\n$purple-000: #f5f0ff;\n$purple-100: #e6dcfd;\n$red-500: #d73a49;\n$white: #fff;\n$yellow-200: #fff5b1;\n$yellow-300: #ffea7f;\n$yellow-700: #dbab09;\n\n// Z-INDEX ENUM\n// $z-index-progressbar: 1;\n$z-index-popup: 2;\n\n// SVG ICONS -- see images/README.md for sources and license details\n// Are you a designer? New icon PRs welcomed!\n$image-analytics: 'images/analytics.svg';\n$image-baseline: 'images/horizontal-rule.svg';\n$image-files: 'images/files.svg';\n$image-chevron-dn: 'images/chevron-down.svg';\n$image-chevron-up: 'images/chevron-up.svg';\n$image-lock-fill: 'images/lock-fill.svg';\n$image-network: 'images/router.svg';\n$image-overflow: 'images/three-dots-vertical.svg';\n$image-pause-circle-active: 'images/pause-circle-active.svg';\n$image-pause-circle-idle: 'images/pause-circle-idle.svg';\n$image-peers: 'images/team.svg';\n$image-play-circle-active: 'images/play-circle-active.svg';\n$image-play-circle-idle: 'images/play-circle-idle.svg';\n$image-speed: 'images/checkered-flag.svg';\n$image-tiers: 'images/diagram-3-fill.svg';\n$image-upload-download: 'images/up-and-down-arrows.svg';\n\n@mixin for-phone-only {\n @media (max-width: 599px) {\n @content;\n }\n}\n@mixin for-tablet-portrait-up {\n @media (min-width: 600px) {\n @content;\n }\n}\n// @mixin for-tablet-landscape-up {media (min-width: 900px) { @content; }}\n// @mixin for-desktop-up {@media (min-width: 1200px) { @content; }}\n// @mixin for-big-desktop-up {@media (min-width: 1800px) { @content; }}\n\n/// MIXINS\n\n@mixin image-on-vertical-gradient($src, $topColor, $bottomColor) {\n background-image: url($src), linear-gradient($topColor, $bottomColor);\n}\n\n@mixin button {\n border: 1px solid var(--color-border);\n cursor: pointer;\n display: inline-block;\n padding: 3px;\n user-select: none;\n}\n\n@mixin rounded-box($radius) {\n border-radius: $radius;\n}\n\n@mixin rounded-button($radius) {\n @include button;\n border-radius: $radius;\n}\n\n/// GLOBAL\n\n:root {\n --color-bg-even: #{$white};\n --color-bg-hover: #{$grey-100};\n --color-bg-menu: #{$grey-200};\n --color-bg-odd: #{$grey-100};\n --color-bg-selection-1: #{$purple-100};\n --color-bg-selection-2: #{$purple-000};\n --color-border: #{$grey-400};\n --color-fg-disabled: #{$grey-400};\n --color-fg-error: #{$red-500};\n --color-fg-name: #{$grey-800};\n --color-fg-port-closed: #{$red-500};\n --color-fg-port-open: #{$green-500};\n @media (prefers-color-scheme: dark) {\n --color-fg-primary: #{$grey-100};\n --color-fg-secondary: #{$grey-400};\n --color-fg-tertiary: #{$grey-500};\n }\n @media (prefers-color-scheme: light) {\n --color-fg-primary: #{$grey-800};\n --color-fg-secondary: #{$grey-500};\n --color-fg-tertiary: #{$grey-400};\n }\n --color-progressbar-background-1: #{$grey-100};\n --color-progressbar-background-2: #{$grey-400};\n --color-progressbar-verify-1: #{$pink-300};\n --color-progressbar-verify-2: #{$pink-700};\n --color-progressbar-magnet-1: #{$yellow-300};\n --color-progressbar-magnet-2: #{$yellow-700};\n --color-progressbar-magnet-paused-1: #{$yellow-200};\n --color-progressbar-magnet-paused-2: #{$grey-500};\n --color-progressbar-leech-paused-1: #{$blue-200};\n --color-progressbar-leech-paused-2: #{$grey-500};\n --color-progressbar-leech-queued-1: #{$blue-100};\n --color-progressbar-leech-queued-2: #{$blue-300};\n --color-progressbar-leech-1: #{$blue-300};\n --color-progressbar-leech-2: #{$blue-700};\n --color-progressbar-seed-paused-1: #{$green-200};\n --color-progressbar-seed-paused-2: #{$grey-500};\n --color-progressbar-seed-queued-1: #{$green-100};\n --color-progressbar-seed-queued-2: #{$green-300};\n --color-progressbar-seed-1: #{$green-300};\n --color-progressbar-seed-2: #{$green-700};\n --color-tab-deselected-1: #{$grey-100};\n --color-tab-deselected-2: #{$grey-400};\n --color-tab-selected-1: #{$purple-100};\n --color-tab-selected-2: #{$purple-000};\n --color-toolbar-background: linear-gradient(#{$grey-300}, #{$grey-400});\n}\n\nhtml,\nbody {\n color: var(--color-fg-primary);\n font-family: Verdana, Arial, Helvetica, sans-serif;\n height: 100%;\n margin: 0;\n overflow: hidden;\n}\n\nimg {\n border: 0;\n}\n\na {\n outline: 0;\n}\n\n.hidden {\n display: none;\n}\n\n.even {\n background-color: var(--color-bg-even);\n}\n.odd {\n background-color: var(--color-bg-odd);\n}\n\n.mainwin {\n display: flex;\n flex-direction: column;\n height: 100%;\n position: relative;\n\n > * {\n margin: 0;\n padding: 0;\n }\n}\n\n.mainwin-workarea {\n display: flex;\n flex: 1;\n flex-direction: row;\n overflow: auto;\n}\n\n/// TOOLBAR\n\n$toolbar-height-number: 36;\n$toolbar-height: $toolbar-height-number * 1px;\n\n#mainwin-toolbar {\n align-items: center;\n background: var(--color-toolbar-background);\n border-bottom: 1px solid var(--color-border);\n display: flex;\n flex-direction: row;\n height: $toolbar-height;\n margin: 0;\n padding: 2px;\n width: 100%;\n\n button {\n background-color: transparent;\n background-position: center;\n background-repeat: no-repeat;\n border: 0;\n cursor: pointer;\n height: $toolbar-height;\n margin-right: 6px;\n user-select: none;\n width: $toolbar-height;\n\n &:hover:not(:disabled) {\n background-color: var(--color-bg-hover);\n }\n\n &:disabled {\n cursor: default;\n opacity: 0.25;\n }\n }\n\n > .toolbar-separator {\n border-left: 1px solid var(--color-border);\n height: 25px;\n margin: 0 6px 0 0;\n }\n\n :nth-last-child(2) {\n border: 0;\n flex-grow: 1;\n }\n}\n\n#toolbar-open {\n background-image: url('images/toolbar-folder.png');\n}\n\n#toolbar-remove {\n background-image: url('images/toolbar-close.png');\n}\n\n#toolbar-start {\n background-image: url('images/toolbar-start.png');\n}\n\n#toolbar-pause {\n background-image: url('images/toolbar-pause.png');\n}\n\n#toolbar-inspector {\n background-image: url('images/toolbar-info.png');\n}\n\n#toolbar-overflow {\n background-color: transparent;\n background-image: url($image-overflow);\n background-position: center;\n background-size: 26px;\n margin-right: 4px;\n width: 36px;\n\n &.alt-speed-enabled {\n background-image: url('images/blue-turtle.png'), url($image-overflow);\n background-position: bottom left, center, center;\n background-size: 16px 9px, 26px, 26px;\n }\n}\n\n/// FILTERBAR\n\n// $filterbar-height-number: 30;\n// $filterbar-height: $filterbar-height-number * 1px;\n\n.mainwin-filterbar {\n align-items: center;\n background: var(--color-toolbar-background);\n border-bottom: 1px solid var(--color-border);\n display: flex;\n flex-direction: row;\n font-size: smaller;\n // height: $filterbar-height;\n width: 100%;\n\n @include for-phone-only {\n > :not(select):not(input) {\n display: none;\n }\n > input {\n min-width: 50px;\n }\n > input,\n > select {\n height: 100%;\n }\n }\n\n > * {\n padding: 0 5px;\n }\n}\n\n#torrent-search {\n &.blur {\n color: var(--color-fg-tertiary);\n }\n}\n\n$speed-icon-size: 12px;\n\n.speed-up-icon {\n background-image: url($image-chevron-up);\n background-repeat: no-repeat;\n background-size: $speed-icon-size $speed-icon-size;\n height: $speed-icon-size;\n width: $speed-icon-size;\n}\n\n.speed-dn-icon {\n background-image: url($image-chevron-dn);\n background-repeat: no-repeat;\n background-size: $speed-icon-size $speed-icon-size;\n height: $speed-icon-size;\n width: $speed-icon-size;\n}\n\n/// TORRENT CONTAINER\n\n$pauseresume-size-number: 14;\n$pauseresume-size: $pauseresume-size-number * 1px;\n$progressbar-border-number: 1;\n$progressbar-height-number: 14;\n$popup-top: 61px; // TODO: ugly that this is hardcoded\n\n.flex {\n flex-grow: 1;\n}\n\n#torrent-container {\n flex-grow: 1;\n left: 0;\n margin: 0;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n padding: 0;\n right: 0;\n}\n\n.torrent-container {\n background-color: $white;\n}\n\n.torrent-list {\n $app-image: 'images/application-x-executable.png';\n $audio-image: 'images/audio-x-generic.png';\n $folder-image: 'images/folder.png';\n $font-image: 'images/font-x-generic.png';\n $image-image: 'images/image-x-generic.png';\n $package-image: 'images/package-x-generic.png';\n $text-image: 'images/folder.png';\n $text-image: 'images/text-x-generic.png';\n $video-image: 'images/video-x-generic.png';\n\n cursor: pointer;\n list-style-type: none;\n margin: 0;\n padding: 0;\n text-align: left;\n width: 100%;\n\n .torrent {\n border-bottom: 1px solid var(--color-border);\n color: var(--color-fg-secondary);\n user-select: none;\n\n &.paused {\n color: var(--color-fg-disabled);\n }\n\n .icon {\n background-position: center, top left;\n\n @mixin mime-icon-compact($mime-icon) {\n background-image: url($mime-icon);\n\n &[data-icon-multifile='true'] {\n background-image: url($mime-icon), url($folder-image);\n }\n }\n\n &[data-icon-mime-type='audio'] {\n @include mime-icon-compact($audio-image);\n }\n\n &[data-icon-mime-type='application'] {\n @include mime-icon-compact($app-image);\n }\n\n &[data-icon-mime-type='font'] {\n @include mime-icon-compact($font-image);\n }\n\n &[data-icon-mime-type='image'] {\n @include mime-icon-compact($image-image);\n }\n\n &[data-icon-mime-type='model'] {\n @include mime-icon-compact($package-image);\n }\n\n &[data-icon-mime-type='text'] {\n @include mime-icon-compact($text-image);\n }\n\n &[data-icon-mime-type='video'] {\n @include mime-icon-compact($video-image);\n }\n }\n\n &.compact {\n $icon-size-num: 16;\n $icon-size: $icon-size-num * 1px;\n\n align-items: center;\n display: flex;\n flex-direction: row-reverse;\n\n .icon {\n background-size: $icon-size, $icon-size-num * 0.5px;\n flex-shrink: 0;\n height: $icon-size;\n width: $icon-size;\n }\n\n > * {\n margin: 4px 5px;\n }\n }\n\n &:not(.compact) {\n $icon-size-num: 32;\n $icon-size: $icon-size-num * 1px;\n align-items: center;\n display: grid;\n grid-column-gap: 12px;\n grid-template-areas:\n 'icon name'\n 'icon peers'\n 'icon progressbar'\n 'icon progress-text';\n grid-template-columns: $icon-size 1fr;\n padding: 2px 12px;\n\n .icon {\n background-size: $icon-size, $icon-size-num * 0.5px;\n grid-area: icon;\n height: $icon-size;\n width: $icon-size;\n }\n\n .torrent-name {\n grid-area: name;\n }\n\n .torrent-peer-details {\n grid-area: peers;\n }\n\n .torrent-progress {\n display: flex;\n flex-direction: row;\n grid-area: progressbar;\n }\n\n .torrent-progress-details {\n grid-area: progress-text;\n }\n\n > * {\n margin: 1px 0;\n }\n }\n\n &.selected {\n background-color: var(--color-bg-selection-1);\n }\n\n &.selected .torrent-progress-details.error,\n &.selected .torrent-peer-details.error {\n color: $white;\n }\n }\n\n .icon {\n background-position: center;\n background-repeat: no-repeat;\n }\n\n .torrent-pauseresume-button {\n background-position: center center;\n background-repeat: no-repeat;\n background-size: $pauseresume-size;\n margin-left: math.floor($pauseresume-size-number / 2) * 1px;\n width: $pauseresume-size;\n\n &[data-action='pause'] {\n background-image: url($image-pause-circle-idle);\n &:active,\n &:hover {\n background-image: url($image-pause-circle-active);\n }\n }\n &[data-action='resume'] {\n background-image: url($image-play-circle-idle);\n &:active,\n &:hover {\n background-image: url($image-play-circle-active);\n }\n }\n }\n\n .torrent-progress-details.error,\n .torrent-peer-details.error {\n color: var(--color-fg-error);\n }\n\n .torrent-name {\n font-weight: bold;\n margin-bottom: 2px;\n margin-top: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n &.compact {\n flex: 1;\n font-size: 1em;\n font-weight: normal;\n }\n\n &:not(.paused) {\n color: var(--color-fg-name);\n }\n }\n\n .torrent-progress-details,\n .torrent-peer-details {\n font-size: x-small;\n }\n\n .torrent-progress-bar {\n background-repeat: no-repeat;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n height: ($progressbar-height-number - ($progressbar-border-number * 2)) *\n 1px;\n\n &.full {\n flex-grow: 1;\n margin: 2px 0;\n }\n &.compact {\n min-width: 50px;\n width: 50px;\n }\n\n @function progressbar-gradient($color1, $color2) {\n @return linear-gradient(to bottom, $color1, $color2 80%);\n }\n\n @mixin progressbar-background($color1, $color2) {\n background: progressbar-gradient($color1, $color2),\n progressbar-gradient(\n var(--color-progressbar-background-1),\n var(--color-progressbar-background-2)\n );\n background-repeat: no-repeat;\n }\n\n &.leech.paused {\n @include progressbar-background(\n var(--color-progressbar-leech-paused-1),\n var(--color-progressbar-leech-paused-2)\n );\n }\n &.leech.queued {\n @include progressbar-background(\n var(--color-progressbar-leech-queued-1),\n var(--color-progressbar-leech-queued-2)\n );\n }\n &.leech {\n @include progressbar-background(\n var(--color-progressbar-leech-1),\n var(--color-progressbar-leech-2)\n );\n }\n &.magnet.paused {\n @include progressbar-background(\n var(--color-progressbar-magnet-paused-1),\n var(--color-progressbar-magnet-paused-2)\n );\n }\n &.magnet {\n @include progressbar-background(\n var(--color-progressbar-magnet-1),\n var(--color-progressbar-magnet-2)\n );\n }\n &.seed.paused {\n @include progressbar-background(\n var(--color-progressbar-seed-paused-1),\n var(--color-progressbar-seed-paused-2)\n );\n }\n &.seed.queued {\n @include progressbar-background(\n var(--color-progressbar-seed-queued-1),\n var(--color-progressbar-seed-queued-2)\n );\n }\n &.seed {\n @include progressbar-background(\n var(--color-progressbar-seed-1),\n var(--color-progressbar-seed-2)\n );\n }\n &.verify {\n @include progressbar-background(\n var(--color-progressbar-verify-1),\n var(--color-progressbar-verify-2)\n );\n }\n }\n}\n\n/// PREFERENCES DIALOG\n\n@mixin tab-image($image-url) {\n background-image: url($image-url),\n linear-gradient(\n var(--color-tab-deselected-1),\n var(--color-tab-deselected-2)\n );\n\n &:active,\n &:checked,\n &.selected {\n background-image: url($image-url),\n linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2));\n }\n}\n\n#inspector-tab-info {\n @include tab-image($image-analytics);\n}\n\n#inspector-tab-peers {\n @include tab-image($image-peers);\n}\n\n#inspector-tab-tiers {\n @include tab-image($image-tiers);\n}\n\n#inspector-tab-files {\n @include tab-image($image-files);\n}\n\n#inspector,\n#prefs-dialog {\n @include for-phone-only {\n left: 0;\n }\n @include for-tablet-portrait-up {\n border-left: 1px solid var(--color-fg-secondary);\n width: 570px;\n }\n}\n\n#prefs-dialog {\n $background-color: $white;\n\n background: $background-color;\n bottom: 0;\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);\n position: absolute;\n right: 0;\n top: $popup-top;\n z-index: $z-index-popup;\n\n .tabs-page {\n grid-column-gap: 8px;\n grid-row-gap: 5px;\n grid-template-columns: 1fr 1fr;\n margin: 20px;\n\n &:not(.hidden) {\n display: grid;\n }\n\n .section-label {\n font-weight: bold;\n grid-column: span 2;\n margin-left: -20px;\n padding-bottom: 5px;\n\n &:not(:first-of-type) {\n margin-top: 20px;\n }\n }\n }\n\n .alt-speed-section-label {\n background: transparent url('images/blue-turtle.png') no-repeat;\n background-position: left 4px;\n padding-left: 22px;\n }\n\n :disabled,\n .disabled {\n color: var(--color-fg-disabled);\n }\n\n #alt-times-div,\n #autostart-div,\n #port-forwarding,\n #randomize-port,\n #suffix-div,\n #use-dht-div,\n #use-lpd-div,\n #use-pex-div,\n #utp-enabled,\n .alt-speed-label {\n grid-column: span 2;\n }\n\n .blocklist-size-label,\n .blocklist-update-button,\n .port-status {\n grid-column: 2 / 3;\n }\n\n .blocklist-size-label {\n font-size: smaller;\n }\n .blocklist-size-number {\n font-weight: bolder;\n }\n\n .port-status-label {\n display: inline-block;\n font-weight: bold;\n margin-left: 5px;\n &[data-open='true'] {\n color: var(--color-fg-port-open);\n }\n &[data-open='false'] {\n color: var(--color-fg-port-closed);\n }\n }\n\n .alt-speed-label {\n font-size: smaller;\n font-style: lighter;\n // nudge it up next to the section label\n margin: -10px 0 10px -20px;\n }\n}\n\n#prefs-dialog.ui-tabs .ui-tabs-panel {\n padding: 0;\n user-select: none;\n}\n\n.prefs-section {\n text-align: left;\n\n > * {\n padding: 0 8px 8px;\n }\n\n .title {\n font-size: larger;\n font-weight: bold;\n padding-left: 0;\n }\n\n .row {\n .key {\n float: left;\n padding-top: 3px;\n\n > * {\n margin-left: 0;\n }\n }\n\n .value {\n margin-left: 150px;\n\n > * {\n width: 100%;\n }\n }\n }\n\n .checkbox-row {\n > input {\n margin: 0;\n }\n\n > label {\n margin-left: 5px;\n }\n }\n\n #alternative-speed-limits-title {\n background: transparent url('images/blue-turtle.png') no-repeat;\n padding-left: 18px;\n }\n\n #alternative-speed-limits-desc {\n font-size: smaller;\n padding-bottom: 4px;\n }\n}\n\n/// TABS\n\n.tabs-container {\n align-items: stretch;\n background: $white;\n border-left: solid 1px var(--color-border);\n bottom: 0;\n display: flex;\n flex-direction: column;\n position: absolute;\n right: 0;\n top: $popup-top;\n z-index: $z-index-popup;\n @include for-phone-only {\n left: 0;\n }\n @include for-tablet-portrait-up {\n width: 550px;\n }\n}\n\n.tabs-buttons {\n align-self: center;\n display: flex;\n padding: 10px;\n\n button {\n @include button;\n appearance: none;\n padding: 3px;\n }\n}\n\n.file-priority-radiobox,\n.tabs-buttons {\n $radius: 8px;\n :first-child {\n border-bottom-left-radius: $radius;\n border-top-left-radius: $radius;\n }\n :last-child {\n border-bottom-right-radius: $radius;\n border-top-right-radius: $radius;\n }\n}\n\n.tabs-pages {\n box-sizing: border-box;\n flex: 1;\n overflow-x: hidden;\n overflow-y: auto;\n @include for-phone-only {\n padding: 0 8px 20px;\n }\n @include for-tablet-portrait-up {\n padding: 0 20px 20px;\n }\n}\n\n.tabs-button {\n background-position: center;\n background-repeat: no-repeat;\n}\n\n/// INSPECTOR\n\n#inspector {\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);\n}\n\n.inspector-info-page {\n // TODO: this is (mostly) copied from prefs-dialog.\n // can it be folded into a single set of rules?\n\n grid-column-gap: 8px;\n grid-row-gap: 5px;\n grid-template-columns: auto 1fr;\n margin: 20px;\n padding: 12px;\n\n &:not(.hidden) {\n display: grid;\n }\n\n .section-label {\n font-weight: bold;\n grid-column: span 2;\n margin-left: -20px;\n padding-bottom: 5px;\n\n &:not(:first-of-type) {\n margin-top: 20px;\n }\n }\n\n :not(.section-label) {\n // this section is not copied\n overflow-x: hidden;\n text-overflow: ellipsis;\n }\n}\n\n#inspector .tabs-button,\n#prefs-dialog .tabs-button {\n background-size: 20px 20px, 40px 30px;\n height: 30px;\n margin: 0;\n padding: 0;\n width: 40px;\n}\n\n#prefs-tab-torrent {\n @include tab-image($image-upload-download);\n}\n\n#prefs-tab-speed {\n @include tab-image($image-speed);\n}\n\n#prefs-tab-peers {\n @include tab-image($image-peers);\n}\n\n#prefs-tab-network {\n @include tab-image($image-network);\n}\n\n#inspector-file-list {\n margin: 0;\n padding: 0;\n\n .inspector-torrent-file-list-entry {\n display: grid;\n grid-column-gap: 5px;\n grid-template-areas:\n 'check name priority'\n 'blank1 info blank2';\n grid-template-columns: 20px 1fr 65px;\n margin-bottom: 4px;\n padding: 5px;\n\n &.skip {\n opacity: 0.5;\n }\n }\n\n .file-wanted-control {\n grid-area: check;\n }\n\n .inspector-torrent-file-list-entry-name {\n color: var(--color-fg-name);\n cursor: pointer;\n grid-area: name;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .inspector-torrent-file-list-entry.skip\n > .inspector-torrent-file-list-entry-name {\n color: var(--color-fg-disabled);\n }\n\n .inspector-torrent-file-list-entry-progress {\n color: var(--color-fg-secondary);\n grid-area: info;\n }\n\n .single-file .inspector-torrent-file-list-entry > .file-wanted-control,\n .inspector-torrent-file-list-entry.complete > .file-wanted-control {\n cursor: default;\n }\n}\n\n#inspector-header {\n margin: 8px 0;\n}\n\n#torrent-inspector-name {\n font-size: large;\n font-weight: bold;\n}\n\n#inspector-tiers-list {\n color: var(--color-fg-secondary);\n margin: 0 10px;\n padding: 0 12px;\n\n .tier-list-row {\n display: grid;\n grid-column-gap: 8px;\n grid-row-gap: 4px;\n margin-top: 8px;\n }\n\n .tier-list-torrent {\n color: var(--color-fg-primary);\n font-size: larger;\n font-weight: bolder;\n margin-left: -12px;\n overflow-x: hidden;\n padding-top: 20px;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .tier-list-tracker {\n font-weight: bolder;\n grid-column: span 2;\n margin-top: 8px;\n padding-bottom: 4px;\n }\n\n .tier-announce,\n .tier-scrape,\n .tier-state {\n text-align: left;\n }\n\n .tier-downloads,\n .tier-leechers,\n .tier-seeders {\n text-align: right;\n }\n}\n\n// Peers Tab\n\n.peer-list {\n $table-border-color: $grey-100;\n $table-border: 1px solid $table-border-color;\n\n border: $table-border;\n border-collapse: collapse;\n cursor: default;\n table-layout: fixed;\n text-align: left;\n width: 100%;\n\n td,\n th {\n font-size: smaller;\n padding: 5px;\n }\n\n td {\n border: $table-border;\n color: var(--color-fg-secondary);\n // padding: 5px 10px;\n }\n\n .torrent-row td {\n background: $table-border-color;\n color: var(--color-fg-primary);\n font-size: normal;\n font-weight: bolder;\n overflow-x: hidden;\n padding: 10px;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .encryption {\n width: 16px;\n &[data-encrypted='true'] {\n background: transparent url($image-lock-fill) center center no-repeat;\n height: 16px;\n width: 16px;\n }\n }\n\n .peer-address,\n .percent-done,\n .speed-down,\n .speed-up {\n text-align: right;\n }\n\n .percent-done {\n width: 10%;\n }\n .speed-down,\n .speed-up {\n width: 15%;\n }\n .peer-address {\n width: 25%;\n }\n\n .peer-app-name {\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n @include for-phone-only {\n display: none;\n }\n @include for-tablet-portrait-up {\n width: 25%;\n }\n }\n\n .status {\n cursor: pointer;\n }\n}\n\n/// FILE PRIORITY BUTTONS\n\n.file-priority-radiobox {\n $size-number: 20;\n $size: $size-number * 1px;\n $halfsize: math.floor($size-number / 2) * 1px;\n\n grid-area: priority;\n\n > * {\n @include button;\n appearance: none;\n background-position: center;\n background-repeat: no-repeat;\n background-size: $halfsize, $size;\n height: $size;\n margin: 0;\n padding: 0;\n width: $size;\n }\n\n > .low {\n @include tab-image($image-chevron-dn);\n border-right-width: 0;\n }\n\n > .normal {\n @include tab-image($image-baseline);\n }\n\n > .high {\n @include tab-image($image-chevron-up);\n border-left-width: 0;\n }\n}\n\n/// CONTEXT MENU\n\n.context-menu {\n $background-color: var(--color-bg-menu);\n $disabled-color: var(--color-fg-disabled);\n\n background: $background-color;\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);\n position: absolute;\n z-index: $z-index-popup;\n\n .context-menuitem {\n list-style: none;\n padding: 5px 10px;\n\n &:hover:not(:disabled),\n &:focus:not(:disabled) {\n background-image: linear-gradient($white, var(--color-bg-menu));\n cursor: pointer;\n }\n\n &:disabled {\n color: $disabled-color;\n cursor: none;\n }\n }\n}\n\n.context-menu-separator {\n border-bottom: 1px solid var(--color-fg-secondary);\n margin-bottom: 10px;\n padding-bottom: 10px;\n}\n\n/// OVERFLOW MENU\n\n.overflow-menu {\n background: linear-gradient(\n 160deg,\n #d21,\n 1%,\n var(--color-bg-hover),\n 40%,\n var(--color-bg-menu)\n );\n border-radius: 8px;\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);\n padding: 20px;\n position: fixed;\n width: 200px;\n z-index: $z-index-popup;\n\n fieldset {\n border: 0;\n margin-bottom: 8px;\n padding: 0;\n }\n\n > .actions,\n > .info,\n > .links {\n display: flex;\n flex-direction: column;\n }\n\n legend {\n font-weight: bolder;\n margin-bottom: 4px;\n }\n\n legend ~ * {\n margin-left: 12px;\n }\n\n a,\n button,\n label {\n color: var(--color-fg-primary);\n font-size: 1em;\n\n &:disabled {\n color: var(--color-fg-disabled);\n cursor: default;\n }\n\n &:focus:not(:disabled),\n &:hover:not(:disabled) {\n background-color: var(--color-bg-hover);\n }\n }\n\n a,\n button {\n background: transparent;\n border: 0;\n cursor: pointer;\n display: block;\n padding: 4px 0;\n text-align: left;\n text-decoration: none;\n width: 150px;\n }\n\n .input-and-label {\n align-items: center;\n display: inline-flex;\n flex-direction: row;\n }\n\n #display-options {\n > * {\n align-items: center;\n display: inline-flex;\n flex-direction: row;\n\n > * {\n margin: 4px;\n }\n\n :first-child {\n margin-left: 0;\n }\n\n :last-child {\n margin-right: 0;\n }\n }\n }\n\n #speed-options {\n display: flex;\n flex-direction: column;\n\n > .speed-up,\n > .speed-down {\n align-items: center;\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n\n > label {\n overflow: hidden;\n width: 80px;\n }\n }\n\n .alt-speed {\n display: grid;\n grid-column-gap: 5px;\n grid-row-gap: 5px;\n grid-template-areas:\n 'check lb'\n 'turtle values';\n grid-template-columns: 20px 1fr;\n margin-bottom: 4px;\n }\n\n #alt-speed-check {\n grid-area: check;\n\n &:checked ~ #alt-speed-image {\n background-image: url('images/blue-turtle.png');\n }\n\n &:not(:checked) ~ #alt-speed-image {\n background-image: url('images/turtle.png');\n }\n }\n\n #alt-speed-image {\n background-position: center;\n background-repeat: no-repeat;\n grid-area: turtle;\n }\n\n #alt-speed-label {\n grid-area: lb;\n }\n\n #alt-speed-values-label {\n font-size: small;\n grid-area: values;\n }\n }\n}\n\n// hide the fullscreen button unless we're on mobile\n@include for-tablet-portrait-up {\n #display-fullscreen-check,\n #display-fullscreen-label {\n display: none;\n }\n}\n\n/// DIALOGS\n\n$dialog-padding-number: 20;\n$dialog-logo-padding-number: $dialog-padding-number * 2 / 3;\n$logo-size: 64px;\n\n@include for-phone-only {\n .dialog-buttons {\n padding-top: $dialog-logo-padding-number * 1px;\n }\n\n .dialog-container {\n opacity: 96%;\n position: absolute;\n top: $popup-top;\n width: 100%;\n }\n\n .dialog-logo {\n padding-bottom: $dialog-logo-padding-number * 1px;\n }\n\n .dialog-window {\n align-items: center;\n display: flex;\n flex-direction: column;\n }\n}\n@include for-tablet-portrait-up {\n .dialog-container {\n left: 50%;\n min-width: 400px;\n position: absolute;\n top: $popup-top * 2;\n transform: translateX(-50%);\n }\n\n .dialog-heading {\n grid-area: heading;\n }\n\n .dialog-logo {\n grid-area: icon;\n padding-right: $dialog-logo-padding-number * 1px;\n }\n\n .dialog-window {\n display: grid;\n grid-column-gap: 12px;\n grid-template-areas:\n 'icon heading'\n 'icon message'\n 'icon workarea'\n 'icon buttons';\n grid-template-columns: $logo-size 1fr;\n padding: 2px 12px;\n }\n}\n\n.dialog-buttons {\n display: flex;\n float: right;\n grid-area: buttons;\n margin: 10px 0 0;\n text-align: center;\n\n button {\n appearance: none;\n background: transparent;\n border: 1px solid var(--color-border);\n border-radius: 5px;\n color: var(--color-fg-name);\n margin-left: 8px;\n padding: 8px;\n text-decoration: none;\n }\n\n a:hover,\n a:active {\n background: linear-gradient($white, var(--color-bg-menu));\n }\n}\n\n.dialog-buttons-begin {\n flex-grow: 1;\n}\n\n.dialog-buttons-end {\n display: none;\n}\n\n.dialog-container {\n border: 0;\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);\n color: var(--color-fg-primary);\n display: block;\n margin: 0;\n padding: 0;\n z-index: $z-index-popup;\n}\n\n.dialog-heading {\n align-items: center;\n display: flex;\n font-size: 1.2em;\n font-weight: bold;\n}\n\n.dialog-logo {\n background: transparent url('images/logo.png') top left no-repeat;\n height: $logo-size;\n width: $logo-size;\n}\n\n.dialog-message {\n grid-area: message;\n margin: 10px 0 0;\n}\n\n.dialog-window {\n background: linear-gradient(160deg, #d21, 1%, #f7f7f7, 40%, #ccc);\n height: 100%;\n padding: $dialog-padding-number * 1px;\n}\n\n.dialog-workarea {\n display: flex;\n flex-direction: column;\n grid-area: workarea;\n margin: 10px 0 0;\n\n > * {\n margin-bottom: 5px;\n }\n}\n\n/// ABOUT DIALOG\n\n.about-dialog .dialog-workarea > * {\n margin-bottom: 10px;\n}\n\n.about-dialog-version-number {\n margin-left: 4px;\n}\n\n.about-dialog-version-checksum {\n font-size: small;\n font-style: italic;\n font-weight: normal;\n margin-left: auto;\n padding-left: 10px;\n}\n\n/// HOTKEYS DIALOG\n\n.shortcuts-dialog {\n table {\n border-collapse: collapse;\n width: 100%;\n }\n\n th,\n td {\n border: 1px solid var(--color-border);\n padding: 5px 10px;\n }\n}\n\n/// RENAME DIALOG\n\n#torrent-rename-name {\n min-width: 400px;\n}\n\n/// SET-LOCATION DIALOG\n\n#move-container #torrent-path {\n min-width: 400px;\n}\n\n/// STATISTICS DIALOG\n\n.tabs-pages,\n.inspector-info-page,\n.statistics-dialog {\n .content {\n column-gap: 16px;\n display: grid;\n grid-row-gap: 6px;\n grid-template-columns: auto 1fr;\n margin-top: 4px;\n\n @include for-phone-only {\n margin: 4px 0 16px;\n }\n @include for-tablet-portrait-up {\n margin: 4px 16px 16px;\n }\n\n div {\n word-break: break-word;\n }\n }\n\n fieldset {\n border: 0;\n margin: 0;\n padding: 0;\n }\n\n legend {\n font-weight: bolder;\n margin-bottom: 4px;\n }\n}\n\n/// UPLOAD DIALOG\n\n#free-space-text {\n display: inline-block;\n float: right;\n font-size: smaller;\n font-style: italic;\n}\n\n#torrent-upload-frame {\n border: 0;\n display: block; /* Don't change this : safari forms won't target hidden frames (they open a new window) */\n height: 0;\n left: -1000px;\n margin: 0;\n padding: 0;\n position: absolute;\n top: -1000px;\n width: 0;\n}\n\n.ui-menu {\n width: 200px;\n}\n"],sourceRoot:""}]),t.default=R},function(e,t,n){"use strict";n.r(t);class r extends EventTarget{constructor(){super(),this.actions=Object.seal({"deselect-all":{enabled:!1,shortcut:"Control+A",text:"Deselect all"},"move-bottom":{enabled:!1,text:"Move to the back of the queue"},"move-down":{enabled:!1,text:"Move down in the queue"},"move-top":{enabled:!1,text:"Move to the front of the queue"},"move-up":{enabled:!1,text:"Move up in the queue"},"open-torrent":{enabled:!0,shortcut:"Alt+O",text:"Open torrent…"},"pause-all-torrents":{enabled:!1,text:"Pause all"},"pause-selected-torrents":{enabled:!1,shortcut:"Alt+U",text:"Pause"},"reannounce-selected-torrents":{enabled:!1,text:"Ask tracker for more peers"},"remove-selected-torrents":{enabled:!1,text:"Remove from list…"},"resume-selected-torrents":{enabled:!1,shortcut:"Alt+R",text:"Resume"},"resume-selected-torrents-now":{enabled:!1,text:"Resume now"},"select-all":{enabled:!1,shortcut:"Alt+A",text:"Select all"},"show-about-dialog":{enabled:!0,text:"About"},"show-inspector":{enabled:!0,shortcut:"Alt+I",text:"Torrent Inspector"},"show-move-dialog":{enabled:!1,shortcut:"Alt+L",text:"Set location…"},"show-overflow-menu":{enabled:!0,text:"More options…"},"show-preferences-dialog":{enabled:!0,shortcut:"Alt+P",text:"Edit preferences"},"show-rename-dialog":{enabled:!1,shortcut:"Alt+N",text:"Rename…"},"show-shortcuts-dialog":{enabled:!0,text:"Keyboard shortcuts"},"show-statistics-dialog":{enabled:!0,shortcut:"Alt+S",text:"Statistics"},"start-all-torrents":{enabled:!1,text:"Start all"},"toggle-compact-rows":{enabled:!0,text:"Compact rows"},"trash-selected-torrents":{enabled:!1,text:"Trash data and remove from list…"},"verify-selected-torrents":{enabled:!1,shortcut:"Alt+V",text:"Verify local data"}})}click(e){if(this.isEnabled(e)){const t=new Event("click");t.action=e,this.dispatchEvent(t)}}getActionForShortcut(e){for(const[t,n]of Object.entries(this.actions))if(e===n.shortcut)return t;return null}allShortcuts(){return new Map(Object.entries(this.actions).filter((([,e])=>e.shortcut)).map((([e,t])=>[t.shortcut,e])))}isEnabled(e){return this._getAction(e).enabled}text(e){return this._getAction(e).text}keyshortcuts(e){return this._getAction(e).shortcut}update(e){const t=r._recount(e.selected,e.nonselected);this._updateStates(t)}_getAction(e){const t=this.actions[e];if(!t)throw new Error("no such action: "+e);return t}static _recount(e,t){const n=e=>e.isStopped(),r=e.length+t.length,o=e.filter(n).length,i=e.length-o,s=t.filter(n).length,a=t.length-s,l=o+s,c=i+a,d=e.filter((e=>e.isQueued())).length;return{active:c,nonselected_active:a,nonselected_paused:s,paused:l,selected:e.length,selected_active:i,selected_paused:o,selected_queued:d,total:r}}_updateStates(e){const t=(e,t)=>{for(const n of t)this._updateActionState(n,e)};t(e.selected_paused>0,["resume-selected-torrents"]),t(e.paused>0,["start-all-torrents"]),t(e.active>0,["pause-all-torrents"]),t(e.selected_paused>0||e.selected_queued>0,["resume-selected-torrents-now"]),t(e.selected_active>0,["pause-selected-torrents","reannounce-selected-torrents"]),t(e.selected>0,["deselect-all","move-bottom","move-down","move-top","move-up","show-inspector","show-move-dialog","remove-selected-torrents","trash-selected-torrents","verify-selected-torrents"]),t(1===e.selected,["show-rename-dialog"]),t(e.selected{for(const e of o.children)e.classList.toggle("selected",e===t);for(const e of i.children)e.classList.toggle("hidden",e!==r);n&&n(r)}))}return s[0].classList.add("selected"),i.children[0].classList.remove("hidden"),{buttons:s,root:r}}function l(e){const t=document.createElement("dialog");t.classList.add("dialog-container","popup",e),t.open=!0,t.setAttribute("role","dialog");const n=document.createElement("div");n.classList.add("dialog-window"),t.append(n);const r=document.createElement("div");r.classList.add("dialog-logo"),n.append(r);const o=document.createElement("div");o.classList.add("dialog-heading"),n.append(o);const i=document.createElement("div");i.classList.add("dialog-message"),n.append(i);const s=document.createElement("div");s.classList.add("dialog-workarea"),n.append(s);const a=document.createElement("div");a.classList.add("dialog-buttons"),n.append(a);const l=document.createElement("span");l.classList.add("dialog-buttons-begin"),a.append(l);const c=document.createElement("button");c.classList.add("dialog-dismiss-button"),c.textContent="Cancel",a.append(c);const d=document.createElement("button");d.textContent="OK",a.append(d);const A=document.createElement("span");return A.classList.add("dialog-buttons-end"),a.append(A),{confirm:d,dismiss:c,heading:o,message:i,root:t,workarea:s}}function c(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))}function d(e,t){const n=[],{root:r,content:o}=function(e){const t=document.createElement("fieldset");t.classList.add("section");const n=document.createElement("legend");n.classList.add("title"),n.textContent=e,t.append(n);const r=document.createElement("div");return r.classList.add("content"),t.append(r),{content:r,root:t}}(e);for(const e of t){const t=document.createElement("label");t.textContent=e,o.append(t);const r=document.createElement("div");r.id=c(),o.append(r),t.setAttribute("for",r.id),n.push(r)}return{children:n,root:r}}function A(e,t=100){let n=null;return(...r)=>{n||(n=setTimeout((()=>{n=null,e(r)}),t))}}function p(e,t){return i()(e,t)}function u(e,t,n){n?e.setAttribute(t,!0):e.removeAttribute(t)}function g(e,t){u(e,"disabled",!t)}function m(e,t){u(e,"checked",t)}function h(e,t,n,r){const o=function(e,t){let{x:n,y:r}=e;const{width:o,height:i}=e;return n>t.x+t.width-o&&n-o>=t.x?n-=o:n=Math.min(n,t.x+t.width-o),r>t.y+t.height-i&&r-i>=t.y?r-=i:r=Math.min(r,t.y+t.height-i),new DOMRect(n,r,o,i)}(new DOMRect(t,n,e.clientWidth,e.clientHeight),r.getBoundingClientRect());e.style.left=o.left+"px",e.style.top=o.top+"px"}class f extends EventTarget{constructor(e){super(),this.listener=t=>{e.contains(t.target)||(this.dispatchEvent(new MouseEvent(t.type,t)),t.preventDefault())},Object.seal(this),this.start()}start(){setTimeout((()=>document.addEventListener("click",this.listener)),0)}stop(){document.removeEventListener("click",this.listener)}}function b(e,t){e.textContent!==t&&(e.textContent=t)}class C{constructor(e){this._prefs=e,this._elements={toggle:document.querySelector("#toggle-notifications")}}_setEnabled(e){this.prefs.notifications_enabled=e,b(this._toggle,(e?"Disable":"Enable")+" Notifications")}_requestPermission(){Notification.requestPermission().then((e=>this._setEnabled("granted"===e)))}toggle(){this._enabled?this._setEnabled(!1):"granted"===Notification.permission?this._setEnabled(!0):"denied"!==Notification.permission&&this._requestPermission()}}class v extends EventTarget{constructor(){super(),this._cache={},this.dispatchPrefsChange=A(((e,t,n)=>{const r=new Event("change");Object.assign(r,{key:e,old_value:t,value:n}),this.dispatchEvent(r)}));for(const[e,t]of Object.entries(v._Defaults))this._set(e,v._getCookie(e,t)),Object.defineProperty(this,e.replaceAll("-","_"),{get:()=>this._get(e),set:t=>{this._set(e,t)}});Object.seal(this)}entries(){return Object.entries(this._cache)}keys(){return Object.keys(this._cache)}_get(e){const{_cache:t}=this;if(!Object.prototype.hasOwnProperty.call(t,e))throw new Error(e);return t[e]}_set(e,t){const{_cache:n}=this,r=n[e];r!==t&&(n[e]=t,v._setCookie(e,t),this.dispatchPrefsChange(e,r,t))}static _setCookie(e,t){const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${e}=${t}; SameSite=Strict; expires=${n.toGMTString()}; path=/`}static _getCookie(e,t){const n=v._readCookie(e);return null===n?t:"true"===n||"false"!==n&&(n.match(/^\d+$/)?Number.parseInt(n,10):n)}static _readCookie(e){const t=("; "+document.cookie).split(`; ${e}=`);return 2===t.length?t.pop().split(";").shift():null}}v.AltSpeedEnabled="alt-speed-enabled",v.DisplayCompact="compact",v.DisplayFull="full",v.DisplayMode="display-mode",v.FilterActive="active",v.FilterAll="all",v.FilterDownloading="downloading",v.FilterFinished="finished",v.FilterMode="filter-mode",v.FilterPaused="paused",v.FilterSeeding="seeding",v.NotificationsEnabled="notifications-enabled",v.RefreshRate="refresh-rate-sec",v.SortAscending="ascending",v.SortByActivity="activity",v.SortByAge="age",v.SortByName="name",v.SortByProgress="progress",v.SortByQueue="queue",v.SortByRatio="ratio",v.SortBySize="size",v.SortByState="state",v.SortDescending="descending",v.SortDirection="sort-direction",v.SortMode="sort-mode",v._Defaults={[v.AltSpeedEnabled]:!1,[v.DisplayMode]:v.DisplayFull,[v.FilterMode]:v.FilterAll,[v.NotificationsEnabled]:!1,[v.RefreshRate]:5,[v.SortDirection]:v.SortAscending,[v.SortMode]:v.SortByName};class y extends EventTarget{constructor(e){super(),this.elements=y._create(e),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),document.body.append(this.elements.root),this.elements.dismiss.focus()}close(){this.elements.root.remove(),this.dispatchEvent(new Event("close")),delete this.elements}_onDismiss(){this.close()}static _create(e){const t=l("about-dialog");t.root.setAttribute("aria-label","About transmission"),t.heading.textContent="Transmission",t.dismiss.textContent="Close";let n=document.createElement("div");return n.classList.add("about-dialog-version-number"),n.textContent=e.version,t.heading.append(n),n=document.createElement("div"),n.classList.add("about-dialog-version-checksum"),n.textContent=e.checksum,t.heading.append(n),n=document.createElement("div"),n.textContent="A fast and easy bitTorrent client",t.workarea.append(n),n=document.createElement("div"),n.textContent="Copyright © The Transmission Project",t.workarea.append(n),t.confirm.remove(),delete t.confirm,t}}class E extends EventTarget{constructor(e){super(),this.action_listener=this._update.bind(this),this.action_manager=e,this.action_manager.addEventListener("change",this.action_listener),Object.assign(this,this._create()),this.show()}show(){for(const[e,t]of Object.entries(this.actions))g(t,this.action_manager.isEnabled(e));document.body.append(this.root)}close(){if(!this.closed){this.action_manager.removeEventListener("change",this.action_listener),this.root.remove(),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))delete this[e];this.closed=!0}}_update(e){const t=this.actions[e.action];t&&g(t,e.enabled)}_create(){const e=document.createElement("div");e.role="menu",e.classList.add("context-menu","popup");const t={},n=n=>{const r=document.createElement("div"),o=this.action_manager.text(n);r.role="menuitem",r.classList.add("context-menuitem"),r.dataset.action=n,r.textContent=o;const i=this.action_manager.keyshortcuts(n);i&&r.setAttribute("aria-keyshortcuts",i),r.addEventListener("click",(()=>{this.action_manager.click(n),this.close()})),t[n]=r,e.append(r)},r=()=>{const t=document.createElement("div");t.classList.add("context-menu-separator"),e.append(t)};return n("resume-selected-torrents"),n("resume-selected-torrents-now"),n("pause-selected-torrents"),r(),n("move-top"),n("move-up"),n("move-down"),n("move-bottom"),r(),n("remove-selected-torrents"),n("trash-selected-torrents"),r(),n("verify-selected-torrents"),n("show-move-dialog"),n("show-rename-dialog"),r(),n("reannounce-selected-torrents"),r(),n("select-all"),n("deselect-all"),{actions:t,root:e}}}const w=new Intl.PluralRules,x=w.resolvedOptions().locale,k=new Intl.NumberFormat(x),M=1e3,S=[new Intl.NumberFormat(x,{style:"unit",unit:"byte"}),new Intl.NumberFormat(x,{style:"unit",unit:"kilobyte"}),new Intl.NumberFormat(x,{style:"unit",unit:"megabyte"}),new Intl.NumberFormat(x,{style:"unit",unit:"gigabyte"}),new Intl.NumberFormat(x,{style:"unit",unit:"terabyte"}),new Intl.NumberFormat(x,{style:"unit",unit:"petabyte"})],B=new Intl.NumberFormat(x,{style:"unit",unit:"kilobyte-per-second"}),I=new Intl.NumberFormat(x,{style:"unit",unit:"megabyte-per-second"});class T{static countString(e,t,n){return`${this.number(n)} ${this.ngettext(e,t,n)}`}static mem(e){if(e<0)return"Unknown";if(0===e)return"None";let t=e;for(const e of S){if(t12&&(l-=12,c="PM"),0===l&&(l=12),l<10&&(l="0"+l);let d=t.getMinutes();return d<10&&(d="0"+d),(e=t.getSeconds())<10&&(e="0"+e),o=[l,d,e].join(":"),[r,o,c].join(" ")}static toKBps(e){return Math.floor(e/M)}static number(e){return k.format(e)}static _toTruncFixed(e,t){return(Math.floor(e*10**t)/10**t).toFixed(t)}}class D extends EventTarget{isDone(){return this.fields.have>=this.fields.size}isEditable(){return this.fields.torrent.getFileCount()>1&&!this.isDone()}refreshWantedHTML(){const e=this.elements.root;e.classList.toggle("skip",!this.fields.isWanted),e.classList.toggle("complete",this.isDone()),g(e.checkbox,this.isEditable()),e.checkbox.checked=this.fields.isWanted}refreshProgressHTML(){const{size:e,have:t}=this.fields,n=100*(e?t/e:1),r=T,o=`${r.size(t)} of ${r.size(e)} (${r.percentString(n)}%)`;b(this.elements.progress,o)}refresh(){let e=0,t=!1,n=!1,r=!1,o=0,i=!1;const s=this.fields.torrent.getFiles();for(const a of this.fields.indices){const l=s[a];switch(e+=l.bytesCompleted,o+=l.length,i|=l.wanted,l.priority){case-1:n=!0;break;case 1:t=!0;break;default:r=!0}}m(this.elements.priority_low_button,n),m(this.elements.priority_normal_button,r),m(this.elements.priority_high_button,t),this.fields.have===e&&this.fields.size===o||(this.fields.have=e,this.fields.size=o,this.refreshProgressHTML()),this.fields.isWanted!==i&&(this.fields.isWanted=i,this.refreshWantedHTML())}fireWantedChanged(e){const t=new Event("wantedToggled");t.indices=[...this.fields.indices],t.wanted=e,this.dispatchEvent(t)}firePriorityChanged(e){const t=new Event("priorityToggled");t.indices=[...this.fields.indices],t.priority=e,this.dispatchEvent(t)}createRow(e,t,n,r){const o=document.createElement("li");o.classList.add("inspector-torrent-file-list-entry",r?"even":"odd"),this.elements.root=o;let i=document.createElement("input");const s=c();i.type="checkbox",i.className="file-wanted-control",i.title="Download file",i.id=s,i.addEventListener("change",(e=>this.fireWantedChanged(e.target.checked))),o.checkbox=i,o.append(i),i=document.createElement("label"),i.className="inspector-torrent-file-list-entry-name",i.setAttribute("for",s),b(i,n),o.append(i),i=document.createElement("div"),i.className="inspector-torrent-file-list-entry-progress",o.append(i),this.elements.progress=i,i=document.createElement("div"),i.className="file-priority-radiobox";const a=i,l=e=>this.firePriorityChanged(e.target.value);i=document.createElement("input"),i.type="radio",i.value=-1,i.className="low",i.title="Low Priority",i.addEventListener("click",l),this.elements.priority_low_button=i,a.append(i),i=document.createElement("input"),i.type="radio",i.value=0,i.className="normal",i.title="Normal Priority",i.addEventListener("click",l),this.elements.priority_normal_button=i,a.append(i),i=document.createElement("input"),i.type="radio",i.value=1,i.title="High Priority",i.className="high",i.addEventListener("click",l),this.elements.priority_high_button=i,a.append(i),o.append(a),o.style.paddingLeft=20*t+"px",this.refresh()}getElement(){return this.elements.root}constructor(e,t,n,r,o){super(),this.fields={have:0,indices:r,isWanted:!0,size:0,torrent:e},this.elements={priority_high_button:null,priority_low_button:null,priority_normal_button:null,progress:null,root:null},this.createRow(e,t,n,o)}}const L={};function N(e){if(L[e])return L[e];const t=new URL(e),n=function(e){const t=e.indexOf(".");return t!==e.lastIndexOf(".")&&(e=e.slice(t+1)),e}(t.host),r={domain:n,name:function(e){e.length>0&&(e=e.charAt(0).toUpperCase()+e.slice(1));const t=e.indexOf(".");return-1!==t&&(e=e.slice(0,t)),e}(n),url:t};return L[e]=r,r}class j extends EventTarget{constructor(e){super(),this.fieldObservers={},this.fields={},this.refresh(e)}notifyOnFieldChange(e,t){this.fieldObservers[e]=this.fieldObservers[e]||[],this.fieldObservers[e].push(t)}setField(e,t,n){const r=e[t];if(p(r,n))return!1;const o=this.fieldObservers[t];if(e===this.fields&&o&&o.length>0)for(const e of o)e.call(this,n,r,t);return e[t]=n,!0}updateFiles(e){let t=!1;const n=this.fields.files||[],r=["length","name","bytesCompleted","wanted","priority"];for(const[o,i]of e.entries()){const e=n[o]||{};for(const n of r)n in i&&(t|=this.setField(e,n,i[n]));n[o]=e}return this.fields.files=n,t}static collateTrackers(e){return e.map((e=>e.announce.toLowerCase())).join("\t")}refreshFields(e){let t=!1;for(const[n,r]of Object.entries(e))switch(n){case"files":case"fileStats":t|=this.updateFiles(r);break;case"trackerStats":t|=this.setField(this.fields,"trackers",r);break;case"trackers":n in this.fields||(t|=this.setField(this.fields,n,r));break;default:t|=this.setField(this.fields,n,r)}return t}refresh(e){this.refreshFields(e)&&this.dispatchEvent(new Event("dataChanged"))}getComment(){return this.fields.comment}getCreator(){return this.fields.creator}getDateAdded(){return this.fields.addedDate}getDateCreated(){return this.fields.dateCreated}getDesiredAvailable(){return this.fields.desiredAvailable}getDownloadDir(){return this.fields.downloadDir}getDownloadSpeed(){return this.fields.rateDownload}getDownloadedEver(){return this.fields.downloadedEver}getError(){return this.fields.error}getErrorString(){return this.fields.errorString}getETA(){return this.fields.eta}getFailedEver(){return this.fields.corruptEver}getFiles(){return this.fields.files||[]}getFile(e){return this.fields.files[e]}getFileCount(){return this.fields["file-count"]}getHashString(){return this.fields.hashString}getHave(){return this.getHaveValid()+this.getHaveUnchecked()}getHaveUnchecked(){return this.fields.haveUnchecked}getHaveValid(){return this.fields.haveValid}getId(){return this.fields.id}getLastActivity(){return this.fields.activityDate}getLeftUntilDone(){return this.fields.leftUntilDone}getMetadataPercentComplete(){return this.fields.metadataPercentComplete}getName(){return this.fields.name||"Unknown"}getPeers(){return this.fields.peers||[]}getPeersConnected(){return this.fields.peersConnected}getPeersGettingFromUs(){return this.fields.peersGettingFromUs}getPeersSendingToUs(){return this.fields.peersSendingToUs}getPieceCount(){return this.fields.pieceCount}getPieceSize(){return this.fields.pieceSize}getPrimaryMimeType(){return this.fields["primary-mime-type"]}getPrivateFlag(){return this.fields.isPrivate}getQueuePosition(){return this.fields.queuePosition}getRecheckProgress(){return this.fields.recheckProgress}getSeedRatioLimit(){return this.fields.seedRatioLimit}getSeedRatioMode(){return this.fields.seedRatioMode}getSizeWhenDone(){return this.fields.sizeWhenDone}getStartDate(){return this.fields.startDate}getStatus(){return this.fields.status}getTotalSize(){return this.fields.totalSize}getTrackers(){const e=this.fields.trackers||[];for(const t of e)t.announce&&!t.domain&&Object.assign(t,N(t.announce));return this.fields.trackers}getUploadSpeed(){return this.fields.rateUpload}getUploadRatio(){return this.fields.uploadRatio}getUploadedEver(){return this.fields.uploadedEver}getWebseedsSendingToUs(){return this.fields.webseedsSendingToUs}isFinished(){return this.fields.isFinished}hasExtraInfo(){return"hashString"in this.fields}isSeeding(){return this.getStatus()===j._StatusSeed}isStopped(){return this.getStatus()===j._StatusStopped}isChecking(){return this.getStatus()===j._StatusCheck}isDownloading(){return this.getStatus()===j._StatusDownload}isQueued(){return this.getStatus()===j._StatusDownloadWait||this.getStatus()===j._StatusSeedWait}isDone(){return this.getLeftUntilDone()<1}needsMetaData(){return this.getMetadataPercentComplete()<1}getActivity(){return this.getDownloadSpeed()+this.getUploadSpeed()}getPercentDoneStr(){return T.percentString(100*this.getPercentDone())}getPercentDone(){return this.fields.percentDone}getStateString(){switch(this.getStatus()){case j._StatusStopped:return this.isFinished()?"Seeding complete":"Paused";case j._StatusCheckWait:return"Queued for verification";case j._StatusCheck:return"Verifying local data";case j._StatusDownloadWait:return"Queued for download";case j._StatusDownload:return"Downloading";case j._StatusSeedWait:return"Queued for seeding";case j._StatusSeed:return"Seeding";case null:return"Unknown";default:return"Error"}}seedRatioLimit(e){switch(this.getSeedRatioMode()){case j._RatioUseGlobal:return e.seedRatioLimit();case j._RatioUseLocal:return this.getSeedRatioLimit();default:return-1}}getErrorMessage(){const e=this.getErrorString();switch(this.getError()){case j._ErrTrackerWarning:return"Tracker returned a warning: "+e;case j._ErrTrackerError:return"Tracker returned an error: "+e;case j._ErrLocalError:return"Error: "+e;default:return null}}getCollatedName(){const e=this.fields;return!e.collatedName&&e.name&&(e.collatedName=e.name.toLowerCase()),e.collatedName||""}getCollatedTrackers(){const e=this.fields;return!e.collatedTrackers&&e.trackers&&(e.collatedTrackers=j.collateTrackers(e.trackers)),e.collatedTrackers||""}testState(e){const t=this.getStatus();switch(e){case v.FilterActive:return this.getPeersGettingFromUs()>0||this.getPeersSendingToUs()>0||this.getWebseedsSendingToUs()>0||this.isChecking();case v.FilterSeeding:return t===j._StatusSeed||t===j._StatusSeedWait;case v.FilterDownloading:return t===j._StatusDownload||t===j._StatusDownloadWait;case v.FilterPaused:return this.isStopped();case v.FilterFinished:return this.isFinished();default:return!0}}test(e,t,n){let r=this.testState(e);return r&&t&&t.length>0&&(r=this.getCollatedName().includes(t.toLowerCase())),r&&n&&n.length>0&&(r=this.getCollatedTrackers().includes(n)),r}static compareById(e,t){return e.getId()-t.getId()}static compareByName(e,t){return e.getCollatedName().localeCompare(t.getCollatedName())||j.compareById(e,t)}static compareByQueue(e,t){return e.getQueuePosition()-t.getQueuePosition()}static compareByAge(e,t){const n=e.getDateAdded();return t.getDateAdded()-n||j.compareByQueue(e,t)}static compareByState(e,t){const n=e.getStatus();return t.getStatus()-n||j.compareByQueue(e,t)}static compareByActivity(e,t){const n=e.getActivity();return t.getActivity()-n||j.compareByState(e,t)}static compareByRatio(e,t){const n=e.getUploadRatio(),r=t.getUploadRatio();return nr?-1:j.compareByState(e,t)}static compareByProgress(e,t){return e.getPercentDone()-t.getPercentDone()||j.compareByRatio(e,t)}static compareBySize(e,t){return e.getTotalSize()-t.getTotalSize()||j.compareByName(e,t)}static compareTorrents(e,t,n,r){let o=0;switch(n){case v.SortByActivity:o=j.compareByActivity(e,t);break;case v.SortByAge:o=j.compareByAge(e,t);break;case v.SortByQueue:o=j.compareByQueue(e,t);break;case v.SortByProgress:o=j.compareByProgress(e,t);break;case v.SortBySize:o=j.compareBySize(e,t);break;case v.SortByState:o=j.compareByState(e,t);break;case v.SortByRatio:o=j.compareByRatio(e,t);break;case v.SortByName:o=j.compareByName(e,t);break;default:console.log("Unrecognized sort mode: "+n),o=j.compareByName(e,t)}return r===v.SortDescending&&(o=-o),o}static sortTorrents(e,t,n){switch(t){case v.SortByActivity:e.sort(this.compareByActivity);break;case v.SortByAge:e.sort(this.compareByAge);break;case v.SortByName:e.sort(this.compareByName);break;case v.SortByProgress:e.sort(this.compareByProgress);break;case v.SortByQueue:e.sort(this.compareByQueue);break;case v.SortByRatio:e.sort(this.compareByRatio);break;case v.SortBySize:e.sort(this.compareBySize);break;case v.SortByState:e.sort(this.compareByState);break;default:console.log("Unrecognized sort mode: "+t),e.sort(this.compareByName)}return n===v.SortDescending&&e.reverse(),e}}j._StatusStopped=0,j._StatusCheckWait=1,j._StatusCheck=2,j._StatusDownloadWait=3,j._StatusDownload=4,j._StatusSeedWait=5,j._StatusSeed=6,j._RatioUseGlobal=0,j._RatioUseLocal=1,j._RatioUnlimited=2,j._ErrNone=0,j._ErrTrackerWarning=1,j._ErrTrackerError=2,j._ErrLocalError=3,j._TrackerInactive=0,j._TrackerWaiting=1,j._TrackerQueued=2,j._TrackerActive=3,j.Fields={},j.Fields.Metadata=["addedDate","file-count","name","primary-mime-type","totalSize"],j.Fields.Stats=["error","errorString","eta","isFinished","isStalled","leftUntilDone","metadataPercentComplete","peersConnected","peersGettingFromUs","peersSendingToUs","percentDone","queuePosition","rateDownload","rateUpload","recheckProgress","seedRatioMode","seedRatioLimit","sizeWhenDone","status","trackers","downloadDir","uploadedEver","uploadRatio","webseedsSendingToUs"],j.Fields.InfoExtra=["comment","creator","dateCreated","files","hashString","isPrivate","pieceCount","pieceSize"],j.Fields.StatsExtra=["activityDate","corruptEver","desiredAvailable","downloadedEver","fileStats","haveUnchecked","haveValid","peers","startDate","trackerStats"];const _=["encryption","speed-up","speed-down","percent-done","status","peer-address","peer-app-name"];class z extends EventTarget{constructor(e){super(),this.closed=!1,this.controller=e,this.elements=this._create(),this.current_page=this.elements.info.root,this.interval=setInterval(this._refreshTorrents.bind(this),3e3),this.name="inspector",this.selection_listener=e=>this._setTorrents(e.selected),this.torrent_listener=()=>this._updateCurrentPage(),this.torrents=[],this.file_torrent=null,this.file_torrent_n=null,this.file_rows=null,this.outside=new f(this.elements.root),this.outside.addEventListener("click",(()=>this.close())),Object.seal(this),e.addEventListener("torrent-selection-changed",this.selection_listener),this._setTorrents(this.controller.getSelectedTorrents()),document.body.append(this.elements.root)}close(){if(!this.closed){this.outside.stop(),clearInterval(this.interval),this._setTorrents([]),this.elements.root.remove(),this.controller.removeEventListener("torrent-selection-changed",this.selection_listener),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))this[e]=null;this.closed=!0}}static _createInfoPage(){const e=document.createElement("div");e.classList.add("inspector-info-page");const t={root:e},n=t=>{const n=document.createElement("div");n.textContent=t,n.classList.add("section-label"),e.append(n)},r=t=>{const n=document.createElement("label");b(n,t),e.append(n);const r=document.createElement("label");return e.append(r),r};n("Activity");let o=[["have","Have:"],["availability","Availability:"],["uploaded","Uploaded:"],["downloaded","Downloaded:"],["state","State:"],["running_time","Running time:"],["remaining_time","Remaining:"],["last_activity","Last activity:"],["error","Error:"]];for(const[e,n]of o)t[e]=r(n);n("Details"),o=[["size","Size:"],["location","Location:"],["hash","Hash:"],["privacy","Privacy:"],["origin","Origin:"],["comment","Comment:"]];for(const[e,n]of o)t[e]=r(n);return t}static _createListPage(e,t){const n=document.createElement("div"),r=document.createElement(e);return r.id=t,n.append(r),{list:r,root:n}}static _createTiersPage(){return z._createListPage("div","inspector-tiers-list")}static _createFilesPage(){return z._createListPage("ul","inspector-file-list")}static _createPeersPage(){const e=document.createElement("table");e.classList.add("peer-list");const t=document.createElement("thead"),n=document.createElement("tr");["","Up","Down","Done","Status","Address","Client"].forEach(((e,t)=>{const r=document.createElement("th"),o=_[t];"encryption"===o&&(r.dataset.encrypted=!0),r.classList.add(o),b(r,e),n.append(r)}));const r=document.createElement("tbody");return t.append(n),e.append(t),e.append(r),{root:e,tbody:r}}_create(){const e={files:z._createFilesPage(),info:z._createInfoPage(),peers:z._createPeersPage(),tiers:z._createTiersPage()};return{...a("inspector",[["inspector-tab-info",e.info.root],["inspector-tab-peers",e.peers.root],["inspector-tab-tiers",e.tiers.root],["inspector-tab-files",e.files.root]],(e=>{this.current_page=e,this._updateCurrentPage()}).bind(this)),...e}}_setTorrents(e){const t="dataChanged",n=this.torrent_listener;this.torrents.forEach((e=>e.removeEventListener(t,n))),this.torrents=[...e],this.torrents.forEach((e=>e.addEventListener(t,n))),this._refreshTorrents(),this._updateCurrentPage()}static _needsExtraInfo(e){return e.some((e=>!e.hasExtraInfo()))}_refreshTorrents(){const{controller:e,torrents:t}=this,n=t.map((e=>e.getId()));if(n&&n.length>0){const r=["id",...j.Fields.StatsExtra];z._needsExtraInfo(t)&&r.push(...j.Fields.InfoExtra),e.updateTorrents(n,r)}}_updateCurrentPage(){const{elements:e}=this;switch(this.current_page){case e.files.root:this._updateFiles();break;case e.info.root:this._updateInfo();break;case e.peers.root:this._updatePeers();break;case e.tiers.root:this._updateTiers();break;default:console.warn("unexpected page"),console.log(this.current_page)}}_updateInfo(){const e="None",t="Mixed",n="Unknown",r=T,o=Date.now(),{torrents:i}=this,a=this.elements,l=i.reduce(((e,t)=>e+t.getSizeWhenDone()),0);let c=null;if(0===i.length)c=e;else if(i.every((e=>e.isFinished())))c="Finished";else if(i.every((e=>e.isStopped())))c="Paused";else{const e=e=>e.getStateString(),n=e(i[0]);c=i.every((t=>e(t)===n))?n:t}b(a.info.state,c);const d=c;if(0===i.length)c=e;else{const e=i.reduce(((e,t)=>e+t.getHaveValid()),0),t=i.reduce(((e,t)=>e+t.getHaveUnchecked()),0),n=i.reduce(((e,t)=>e+t.getLeftUntilDone()),0),o=100*(l?(l-n)/l:1);c=r.percentString(o),c=t||n?t?`${r.size(e)} of ${r.size(l)} (${c}%), ${r.size(t)} Unverified`:`${r.size(e)} of ${r.size(l)} (${c}%)`:r.size(e)+" (100%)"}if(b(a.info.have,c),0===i.length)c=e;else if(0===l)c=e;else{const e=i.reduce(((e,t)=>t.getHave()+t.getDesiredAvailable()),0);c=r.percentString(100*e/l)+"%"}if(b(a.info.availability,c),0===i.length)c=e;else{const e=i.reduce(((e,t)=>e+t.getDownloadedEver()),0),t=i.reduce(((e,t)=>e+t.getFailedEver()),0);c=t?`${r.size(e)} (${r.size(t)} corrupt)`:r.size(e)}if(b(a.info.downloaded,c),0===i.length)c=e;else{const e=i.reduce(((e,t)=>e+t.getUploadedEver()),0),t=i.reduce(((e,t)=>e+t.getDownloadedEver()),0)||i.reduce(((e,t)=>e+t.getHaveValid()),0);c=`${r.size(e)} (Ratio: ${r.ratioString(s.ratio(e,t))})`}if(b(a.info.uploaded,c),0===i.length)c=e;else if(i.every((e=>e.isStopped())))c=d;else{const e=e=>e.getStartDate(),n=e(i[0]);c=i.every((t=>e(t)===n))?r.timeInterval(o/1e3-n):t}if(b(a.info.running_time,c),0===i.length)c=e;else{const e=e=>e.getETA(),o=e(i[0]);c=i.every((t=>e(t)===o))?o<0?n:r.timeInterval(o):t}if(b(a.info.remaining_time,c),0===i.length)c=e;else{const t=i.reduce(((e,t)=>Math.max(e,t.getLastActivity())),-1),n=Math.floor(o/1e3);if(0e.getErrorString(),n=e(i[0]);c=i.every((t=>e(t)===n))?n:t}if(b(a.info.error,c||e),0===i.length)c=e;else{const e=i.reduce(((e,t)=>e+t.getTotalSize()),0);if(e){const t=e=>e.getPieceSize(),n=i.reduce(((e,t)=>e+t.getPieceCount()),0),o=r.number(n),s=t(i[0]);c=i.every((e=>t(e)===s))?`${r.size(e)} (${o} pieces @ ${r.mem(s)})`:`${r.size(e)} (${o} pieces)`}else c="None"}if(b(a.info.size,c),0===i.length)c=e;else{const e=e=>e.getHashString(),n=e(i[0]);c=i.every((t=>e(t)===n))?n:t}if(b(a.info.hash,c),0===i.length)c=e;else{const e=e=>e.getPrivateFlag(),n=e(i[0]);c=i.every((t=>e(t)===n))?n?"Private to this tracker -- DHT and PEX disabled":"Public torrent":t}if(b(a.info.privacy,c),0===i.length)c=e;else{const e=e=>e.getComment(),n=e(i[0]);c=i.every((t=>e(t)===n))?n:t}if(c=c||e,c.startsWith("https://")||c.startsWith("http://")?(c=encodeURI(c),s.setInnerHTML(a.info.comment,`${c}`)):b(a.info.comment,c),0===i.length)c=e;else{let e=e=>e.getCreator();const r=e(i[0]),o=!i.every((t=>e(t)===r));e=e=>e.getDateCreated();const s=e(i[0]),a=!i.every((t=>e(t)===s)),l=!r||!r.length,d=!s;c=o||a?t:l&&d?n:d&&!l?"Created by "+r:l&&!d?"Created on "+new Date(1e3*s).toDateString():`Created by ${r} on ${new Date(1e3*s).toDateString()}`}if(b(a.info.origin,c),0===i.length)c=e;else{const e=e=>e.getDownloadDir(),n=e(i[0]);c=i.every((t=>e(t)===n))?n:t}b(a.info.location,c)}static _peerStatusTitle(e){const t=Object.seal({"?":"We unchoked this peer, but they're not interested",D:"Downloading from this peer",E:"Encrypted Connection",H:"Peer was discovered through Distributed Hash Table (DHT)",I:"Peer is an incoming connection",K:"Peer has unchoked us, but we're not interested",O:"Optimistic unchoke",T:"Peer is connected via uTP",U:"Uploading to peer",X:"Peer was discovered through Peer Exchange (PEX)",d:"We would download from this peer if they'd let us",u:"We would upload to this peer if they'd ask"});return[...e].filter((e=>t[e])).map((e=>`${e}: ${t[e]}`)).join("\n")}_updatePeers(){const e=T,{torrents:t}=this,{tbody:n}=this.elements.peers,r=[(e,t)=>{t.dataset.encrypted=e.isEncrypted},(t,n)=>b(n,t.rateToPeer?e.speedBps(t.rateToPeer):""),(t,n)=>b(n,t.rateToClient?e.speedBps(t.rateToClient):""),(e,t)=>b(t,Math.floor(100*e.progress)+"%"),(e,t)=>{b(t,e.flagStr),t.setAttribute("title",z._peerStatusTitle(e.flagStr))},(e,t)=>b(t,e.address),(e,t)=>b(t,e.clientName)],o=[];for(const e of t){const t=document.createElement("tr");t.classList.add("torrent-row");const i=document.createElement("td");i.setAttribute("colspan",r.length),b(i,e.getName()),t.append(i),o.push(t);for(const t of e.getPeers()){const e=document.createElement("tr");e.classList.add("peer-row"),r.forEach(((n,r)=>{const o=document.createElement("td");o.classList.add(_[r]),n(t,o),e.append(o)})),o.push(e)}for(;n.firstChild;)n.firstChild.remove();n.append(...o)}}static getAnnounceState(e){switch(e.announceState){case j._TrackerActive:return"Announce in progress";case j._TrackerWaiting:{const t=Math.max(0,e.nextAnnounceTime-(new Date).getTime()/1e3);return"Next announce in "+T.timeInterval(t)}case j._TrackerQueued:return"Announce is queued";case j._TrackerInactive:return e.isBackup?"Tracker will be used as a backup":"Announce not scheduled";default:return"unknown announce state: "+e.announceState}}static lastAnnounceStatus(e){let t="Last Announce",n=["N/A"];if(e.hasAnnounced){const r=T.timestamp(e.lastAnnounceTime);e.lastAnnounceSucceeded?n=[r," (got ",T.countString("peer","peers",e.lastAnnouncePeerCount),")"]:(t="Announce error",n=[e.lastAnnounceResult?e.lastAnnounceResult+" - ":"",r])}return{label:t,value:n.join("")}}static lastScrapeStatus(e){let t="Last Scrape",n="N/A";if(e.hasScraped){const r=T.timestamp(e.lastScrapeTime);e.lastScrapeSucceeded?n=r:(t="Scrape error",n=(e.lastScrapeResult?e.lastScrapeResult+" - ":"")+r)}return{label:t,value:n}}_updateTiers(){const e="N/A",{list:t}=this.elements.tiers,{torrents:n}=this,r=[];for(const t of n){const o=document.createElement("div");if(o.classList.add("inspector-group"),r.push(o),n.length>1){const e=document.createElement("div");e.classList.add("tier-list-torrent"),b(e,t.getName()),r.push(e)}t.getTrackers().forEach(((t,n)=>{const o=z.getAnnounceState(t),i=z.lastAnnounceStatus(t),s=z.lastScrapeStatus(t),a=document.createElement("div");a.classList.add("tier-list-row",n%2?"odd":"even");let l=document.createElement("div");l.classList.add("tier-list-tracker"),b(l,`${t.domain||t.host||t.announce} - tier ${t.tier+1}`),l.setAttribute("title",t.announce),a.append(l),l=document.createElement("div"),l.classList.add("tier-announce"),b(l,`${i.label}: ${i.value}`),a.append(l),l=document.createElement("div"),l.classList.add("tier-seeders"),b(l,"Seeders: "+(t.seederCount>-1?t.seederCount:e)),a.append(l),l=document.createElement("div"),l.classList.add("tier-state"),b(l,o),a.append(l),l=document.createElement("div"),l.classList.add("tier-leechers"),b(l,"Leechers: "+(t.leecherCount>-1?t.leecherCount:e)),a.append(l),l=document.createElement("div"),l.classList.add("tier-scrape"),b(l,`${s.label}: ${s.value}`),a.append(l),l=document.createElement("div"),l.classList.add("tier-downloads"),b(l,"Downloads: "+(t.downloadCount>-1?t.downloadCount:e)),a.append(l),r.push(a)}))}for(;t.firstChild;)t.firstChild.remove();t.append(...r)}_changeFileCommand(e,t){const{controller:n,file_torrent:r}=this,o=r.getId();n.changeFileCommand(o,e,t)}_onFileWantedToggled(e){const{indices:t,wanted:n}=e;this._changeFileCommand(t,n?"files-wanted":"files-unwanted")}_onFilePriorityToggled(e){const{indices:t,priority:n}=e;let r=null;switch(n){case-1:r="priority-low";break;case 1:r="priority-high";break;default:r="priority-normal"}this._changeFileCommand(t,r)}_clearFileList(){const{list:e}=this.elements.files;for(;e.firstChild;)e.firstChild.remove();this.file_torrent=null,this.file_torrent_n=null,this.file_rows=null}static createFileTreeModel(e){const t=[],n={children:{},file_indices:[]};e.getFiles().forEach(((e,r)=>{const{name:o}=e,i=o.split("/");let s=n;for(const[e,t]of i.entries()){let n=s.children[t];n||(s.children[t]=n={children:{},depth:e,file_indices:[],name:t,parent:s}),s=n}s.file_index=r,delete s.children,t.push(s)}));for(const e of t){const{file_index:t}=e;let n=e;do{n.file_indices.push(t),n=n.parent}while(n)}return n}addNodeToView(e,t,n,r){const o=new D(e,n.depth,n.name,n.file_indices,r%2);o.addEventListener("wantedToggled",this._onFileWantedToggled.bind(this)),o.addEventListener("priorityToggled",this._onFilePriorityToggled.bind(this)),this.file_rows.push(o),t.append(o.getElement())}addSubtreeToView(e,t,n,r){if(n.parent&&this.addNodeToView(e,t,n,r++),n.children)for(const o of Object.values(n.children))r=this.addSubtreeToView(e,t,o,r);return r}_updateFiles(){const{list:e}=this.elements.files,{torrents:t}=this;if(1!==t.length)return void this._clearFileList();const[n]=t,r=n.getFiles().length;if(n!==this.file_torrent||r!==this.file_torrent_n){this._clearFileList(),this.file_torrent=n,this.file_torrent_n=r,this.file_rows=[];const t=document.createDocumentFragment(),o=z.createFileTreeModel(n);this.addSubtreeToView(n,t,o,0),e.append(t)}else this.file_rows.forEach((e=>e.refresh()))}}let F="";class P extends EventTarget{constructor(e,t){super(),this.controller=e,this.remote=t,this.elements={},this.torrents=[],this.show()}show(){const e=this.controller.getSelectedTorrents();0!==e.length&&(F=F||e[0].getDownloadDir(),this.torrents=e,this.elements=P._create(),this.elements.confirm.addEventListener("click",(()=>this._onConfirm())),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),this.elements.entry.value=F,document.body.append(this.elements.root),this.elements.entry.focus())}close(){this.elements.root.remove(),this.dispatchEvent(new Event("close")),delete this.controller,delete this.remote,delete this.elements,delete this.torrents}_onDismiss(){this.close()}_onConfirm(){const e=this.torrents.map((e=>e.getId())),t=this.elements.entry.value.trim();F=t,this.remote.moveTorrents(e,t),this.close()}static _create(){const e=l("move-dialog");e.root.setAttribute("aria-label","Move Torrent"),e.heading.textContent="Set Torrent Location",confirm.textContent="Apply";const t=document.createElement("label");t.setAttribute("for","torrent-path"),t.textContent="Location:",e.workarea.append(t);const n=document.createElement("input");return n.setAttribute("type","text"),n.id="torrent-path",e.entry=n,e.workarea.append(n),e}}class R extends EventTarget{constructor(e){super(),this.elements=R._create(e),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),this.options=e,document.body.append(this.elements.root),this.elements.dismiss.focus()}close(){if(!this.closed){this.elements.root.remove(),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))delete this[e];this.closed=!0}}_onDismiss(){this.close()}static _create(e){const{heading:t,message:n}=e,r=l("confirm-dialog");return r.confirm.remove(),delete r.confirm,r.heading.textContent=t,r.workarea.textContent=n,r}}class O extends EventTarget{constructor(e,t){super(),this.controller=e,this.remote=t,this.elements=this._create(),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),this.elements.confirm.addEventListener("click",(()=>this._onConfirm())),this._updateFreeSpaceInAddDialog(),document.body.append(this.elements.root),this.elements.url_input.focus()}close(){if(!this.closed){clearInterval(this.interval),this.elements.root.remove(),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))delete this[e];this.closed=!0}}_onDismiss(){this.close()}_updateFreeSpaceInAddDialog(){const e=this.elements.folder_input.value;this.remote.getFreeSpace(e,((e,t)=>{const n=t>0?T.size(t)+" Free":"";this.elements.freespace.textContent=n}))}_onConfirm(){const{remote:e}=this,{file_input:t,folder_input:n,start_input:r,url_input:o}=this.elements,i=!r.checked,s=n.value.trim();for(const n of t.files){const t=new FileReader;t.addEventListener("load",(t=>{const r=t.target.result,o="base64,",a=r.indexOf(o);if(-1===a)return;const l={arguments:{"download-dir":s,metainfo:r.slice(Math.max(0,a+o.length)),paused:i},method:"torrent-add"};console.log(l),e.sendRequest(l,(e=>{"success"!==e.result&&(alert(`Error adding "${n.name}": ${e.result}`),this.controller.setCurrentPopup(new R({heading:`Error adding "${n.name}"`,message:e.result})))}))})),t.readAsDataURL(n)}let a=o.value.trim();if(a.length>0){a.match(/^[\da-f]{40}$/i)&&(a="magnet:?xt=urn:btih:"+a);const t={arguments:{"download-dir":s,filename:a,paused:i},method:"torrent-add"};console.log(t),e.sendRequest(t,((e,t)=>{"success"!==t.result&&this.controller.setCurrentPopup(new R({heading:`Error adding "${a}"`,message:t.result}))}))}this._onDismiss()}_create(){const e=l(),{confirm:t,root:n,heading:r,workarea:o}=e;n.classList.add("open-torrent"),r.textContent="Add Torrents",t.textContent="Add";let i=c(),s=document.createElement("label");s.setAttribute("for",i),s.textContent="Please select torrent files to add:",o.append(s);let a=document.createElement("input");a.type="file",a.name="torrent-files[]",a.id=i,a.multiple="multiple",o.append(a),e.file_input=a,i=c(),s=document.createElement("label"),s.setAttribute("for",i),s.textContent="Or enter a URL:",o.append(s),a=document.createElement("input"),a.type="url",a.id=i,o.append(a),e.url_input=a,i=c(),s=document.createElement("label"),s.id="add-dialog-folder-label",s.for=i,s.textContent="Destination folder:",o.append(s);const d=document.createElement("span");d.id="free-space-text",s.append(d),o.append(s),e.freespace=d,a=document.createElement("input"),a.type="text",a.id="add-dialog-folder-input",a.addEventListener("change",(()=>this._updateFreeSpaceInAddDialog())),a.value=this.controller.session_properties["download-dir"],o.append(a),e.folder_input=a;const A=document.createElement("div");o.append(A);const p=document.createElement("input");return p.type="checkbox",p.id="auto-start-check",p.checked=this.controller.shouldAddedTorrentsStart(),A.append(p),e.start_input=p,s=document.createElement("label"),s.id="auto-start-label",s.setAttribute("for",p.id),s.textContent="Start when added",A.append(s),e}}const G="speed-limit-down",U="speed-limit-down-enabled",Q="queue-move-bottom",Y="queue-move-down",W="queue-move-top",J="queue-move-up",H="https://torrent.trainto.me/transmission/rpc",q="alt-speed-down",Z="alt-speed-enabled",V="alt-speed-up",K="speed-limit-up",X="speed-limit-up-enabled";class ${constructor(e){this._controller=e,this._error="",this._session_id=""}sendRequest(e,t,n){const r=new Headers;r.append("cache-control","no-cache"),r.append("content-type","application/json"),r.append("pragma","no-cache"),this._session_id&&r.append($._SessionHeader,this._session_id);let o=null;fetch(H,{body:JSON.stringify(e),headers:r,method:"POST"}).then((e=>{if(o=e,409===e.status){const t=new Error($._SessionHeader);throw t.header=e.headers.get($._SessionHeader),t}return e.json()})).then((e=>{t&&t.call(n,e,o)})).catch((r=>{if(r.message===$._SessionHeader)return this._session_id=r.header,void this.sendRequest(e,t,n);console.trace(r),this._controller.togglePeriodicSessionRefresh(!1),this._controller.setCurrentPopup(new R({heading:"Connection failed",message:"Could not connect to the server. You may need to reload the page to reconnect."}))}))}loadDaemonPrefs(e,t){this.sendRequest({method:"session-get"},e,t)}checkPort(e,t){this.sendRequest({method:"port-test"},e,t)}renameTorrent(e,t,n,r,o){const i={arguments:{ids:e,name:n,path:t},method:"torrent-rename-path"};this.sendRequest(i,r,o)}loadDaemonStats(e,t){this.sendRequest({method:"session-stats"},e,t)}updateTorrents(e,t,n,r){const o={arguments:{fields:t,format:"table"},method:"torrent-get"};e&&(o.arguments.ids=e),this.sendRequest(o,(e=>{const t=e.arguments;n.call(r,t.torrents,t.removed)}))}getFreeSpace(e,t,n){const r={arguments:{path:e},method:"free-space"};this.sendRequest(r,(e=>{const r=e.arguments;t.call(n,r.path,r["size-bytes"])}))}changeFileCommand(e,t,n){const r={ids:[e]};r[n]=t,this.sendRequest({arguments:r,method:"torrent-set"},(()=>{this._controller.refreshTorrents([e])}))}sendTorrentSetRequests(e,t,n,r,o){n||(n={}),n.ids=t;const i={arguments:n,method:e};this.sendRequest(i,r,o)}sendTorrentActionRequests(e,t,n,r){this.sendTorrentSetRequests(e,t,null,n,r)}startTorrents(e,t,n,r){const o=t?"torrent-start-now":"torrent-start";this.sendTorrentActionRequests(o,e,n,r)}stopTorrents(e,t,n){this.sendTorrentActionRequests("torrent-stop",e,t,n)}moveTorrents(e,t,n,r){this.sendTorrentSetRequests("torrent-set-location",e,{location:t,move:!0},n,r)}removeTorrents(e,t,n){this.sendTorrentActionRequests("torrent-remove",e,t,n)}removeTorrentsAndData(e){const t={arguments:{"delete-local-data":!0,ids:[]},method:"torrent-remove"};if(e)for(let n=0,r=e.length;n{this._controller.refreshTorrents()}))}verifyTorrents(e,t,n){this.sendTorrentActionRequests("torrent-verify",e,t,n)}reannounceTorrents(e,t,n){this.sendTorrentActionRequests("torrent-reannounce",e,t,n)}addTorrentByUrl(e,t){e.match(/^[\da-f]{40}$/i)&&(e="magnet:?xt=urn:btih:"+e);const n={arguments:{filename:e,paused:t.paused},method:"torrent-add"};this.sendRequest(n,(()=>{this._controller.refreshTorrents()}))}savePrefs(e){const t={arguments:e,method:"session-set"};this.sendRequest(t,(()=>{this._controller.loadDaemonPrefs()}))}updateBlocklist(){this.sendRequest({method:"blocklist-update"},(()=>{this._controller.loadDaemonPrefs()}))}moveTorrentsToTop(e,t,n){this.sendTorrentActionRequests(W,e,t,n)}moveTorrentsToBottom(e,t,n){this.sendTorrentActionRequests(Q,e,t,n)}moveTorrentsUp(e,t,n){this.sendTorrentActionRequests(J,e,t,n)}moveTorrentsDown(e,t,n){this.sendTorrentActionRequests(Y,e,t,n)}}function ee(e,t){const n=document.createElement("fieldset");n.classList.add("section",e);const r=document.createElement("legend");return r.classList.add("title"),r.textContent=t,n.append(r),n}function te(e,t,n,r){const o=document.createElement("button");return o.textContent=t,o.addEventListener("click",r),e.append(o),o.dataset.action=n,o}$._SessionHeader="X-Transmission-Session-Id";class ne extends EventTarget{constructor(e,t,n,r){super(),this.action_listener=this._onActionChange.bind(this),this.action_manager=r,this.action_manager.addEventListener("change",this.action_listener),this.prefs_listener=this._onPrefsChange.bind(this),this.prefs=t,this.prefs.addEventListener("change",this.prefs_listener),this.closed=!1,this.remote=n,this.name="overflow-menu",this.session_listener=this._onSessionChange.bind(this),this.session_manager=e,this.session_manager.addEventListener("session-change",this.session_listener);const{session_properties:o}=e;Object.assign(this,this._create(o)),this.outside=new f(this.root),this.outside.addEventListener("click",(()=>this.close())),Object.seal(this),this.show()}show(){document.body.append(this.root)}close(){if(!this.closed){this.outside.stop(),this.session_manager.removeEventListener("session-change",this.session_listener),this.action_manager.removeEventListener("change",this.action_listener),this.prefs.removeEventListener("change",this.prefs_listener),this.root.remove(),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))this[e]=null;this.closed=!0}}_onSessionChange(e){const{alt_speed_check:t}=this.elements,{session_properties:n}=e;t.checked=n[Z]}_onPrefsChange(e){switch(e.key){case v.SortDirection:case v.SortMode:this.root.querySelector(`[data-pref="${e.key}"]`).value=e.value}}_onActionChange(e){const t=this.actions[e.action];t&&this._updateElement(t)}_updateElement(e){if(e.dataset.action){const{action:t}=e.dataset,n=this.action_manager.keyshortcuts(t);n&&e.setAttribute("aria-keyshortcuts",n),g(e,this.action_manager.isEnabled(t))}}_onClick(e){const{action:t,pref:n}=e.target.dataset;t?this.action_manager.click(t):n?this.prefs[n]=e.target.value:(console.log("unhandled"),console.log(e),console.trace())}_create(e){const t={},n={},r=this._onClick.bind(this),o=document.createElement("div");o.classList.add("overflow-menu","popup");let i=ee("display","Display");o.append(i);let s=document.createElement("div");s.id="display-options",i.append(s);let a=document.createElement("div");s.append(a);let l=document.createElement("label");l.id="display-sort-mode-label",l.textContent="Sort by",a.append(l);let c=document.createElement("select");c.id="display-sort-mode-select",c.dataset.pref=v.SortMode,a.append(c);const d=[[v.SortByActivity,"Activity"],[v.SortByAge,"Age"],[v.SortByName,"Name"],[v.SortByProgress,"Progress"],[v.SortByQueue,"Queue order"],[v.SortByRatio,"Ratio"],[v.SortBySize,"Size"],[v.SortByState,"State"]];for(const[e,t]of d){const n=document.createElement("option");n.value=e,n.textContent=t,c.append(n)}l.setAttribute("for",c.id),c.value=this.prefs.sort_mode,c.addEventListener("change",(e=>{this.prefs.sort_mode=e.target.value})),a=document.createElement("div"),s.append(a);let A=document.createElement("input");A.id="display-sort-reverse-check",A.dataset.pref=v.SortDirection,A.type="checkbox",a.append(A),l=document.createElement("label"),l.id="display-sort-reverse-label",l.setAttribute("for",A.id),l.textContent="Reverse sort",a.append(l),A.checked=this.prefs.sort_direction!==v.SortAscending,A.addEventListener("input",(e=>{this.prefs.sort_direction=e.target.checked?v.SortDescending:v.SortAscending})),a=document.createElement("div"),s.append(a);const p="toggle-compact-rows";A=document.createElement("input"),A.id="display-compact-check",A.dataset.action=p,A.type="checkbox",a.append(A),l=document.createElement("label"),l.id="display-compact-label",l.for=A.id,l.setAttribute("for",A.id),l.textContent=this.action_manager.text(p),a.append(l),A.checked=this.prefs.display_mode===v.DisplayCompact,A.addEventListener("input",(e=>{const{checked:t}=e.target;this.prefs.display_mode=t?v.DisplayCompact:v.DisplayFull})),a=document.createElement("div"),s.append(a),A=document.createElement("input"),A.id="display-fullscreen-check",A.type="checkbox";const u=()=>null!==document.fullscreenElement;A.checked=u(),A.addEventListener("input",(()=>{u()?document.exitFullscreen():document.body.requestFullscreen()})),document.addEventListener("fullscreenchange",(()=>{A.checked=u()})),a.append(A),l=document.createElement("label"),l.id="display-fullscreen-label",l.for=A.id,l.setAttribute("for",A.id),l.textContent="Fullscreen",a.append(l),i=ee("speed","Speed Limit"),o.append(i),s=document.createElement("div"),s.id="speed-options",i.append(s),a=document.createElement("div"),a.classList.add("speed-up"),s.append(a),l=document.createElement("label"),l.id="speed-up-label",l.textContent="Upload:",a.append(l);const g="Unlimited";c=document.createElement("select"),c.id="speed-up-select",a.append(c);const m=["10","100","200","500","750",g];for(const t of[...new Set(m).add(""+e[K]).values()].sort()){const e=document.createElement("option");e.value=t,e.textContent=t===g?g:T.speed(t),c.append(e)}l.setAttribute("for",c.id),c.value=e[X]?""+e[K]:g,c.addEventListener("change",(e=>{const{value:t}=e.target;console.log(e),e.target.value===g?this.remote.savePrefs({[X]:!1}):this.remote.savePrefs({[X]:!0,[K]:Number.parseInt(t,10)})})),a=document.createElement("div"),a.classList.add("speed-down"),s.append(a),l=document.createElement("label"),l.id="speed-down-label",l.textContent="Download:",a.append(l),c=document.createElement("select"),c.id="speed-down-select",a.append(c);for(const t of[...new Set(m).add(""+e[G]).values()].sort()){const e=document.createElement("option");e.value=t,e.textContent=t,c.append(e)}l.setAttribute("for",c.id),c.value=e[U]?""+e[G]:g,c.addEventListener("change",(e=>{const{value:t}=e.target;console.log(e),e.target.value===g?this.remote.savePrefs({[U]:!1}):this.remote.savePrefs({[U]:!0,[G]:Number.parseInt(t,10)})})),a=document.createElement("div"),a.classList.add("alt-speed"),s.append(a),A=document.createElement("input"),A.id="alt-speed-check",A.type="checkbox",A.checked=e[Z],A.addEventListener("change",(e=>{this.remote.savePrefs({[Z]:e.target.checked})})),a.append(A),n.alt_speed_check=A,l=document.createElement("label"),l.id="alt-speed-image",l.setAttribute("for",A.id),a.append(l),l=document.createElement("label"),l.id="alt-speed-label",l.setAttribute("for",A.id),l.textContent="Use Temp limits",a.append(l),l=document.createElement("label"),l.id="alt-speed-values-label",l.setAttribute("for",A.id);const h=T.speed(e[V]),f=T.speed(e[q]);l.textContent=`(${h} up, ${f} down)`,a.append(l),i=ee("actions","Actions"),o.append(i);for(const e of["show-preferences-dialog","pause-all-torrents","start-all-torrents"]){const n=this.action_manager.text(e);t[e]=te(i,n,e,r)}i=ee("info","Info"),o.append(i),s=document.createElement("div"),i.append(s);for(const e of["show-about-dialog","show-shortcuts-dialog","show-statistics-dialog"]){const n=this.action_manager.text(e);t[e]=te(s,n,e,r)}i=ee("links","Links"),o.append(i),s=document.createElement("div"),i.append(s);let b=document.createElement("a");return b.href="https://transmissionbt.com/",b.tabindex="0",b.textContent="Homepage",s.append(b),b=document.createElement("a"),b.href="https://transmissionbt.com/donate/",b.tabindex="0",b.textContent="Tip Jar",s.append(b),b=document.createElement("a"),b.href="https://github.com/transmission/transmission/",b.tabindex="0",b.textContent="Source Code",s.append(b),Object.values(t).forEach(this._updateElement.bind(this)),{actions:t,elements:n,root:o}}}class re extends EventTarget{static _initTimeDropDown(e){for(let t=0;t<96;++t){const n=15*t,r=`${Number.parseInt(t/4,10)}:${t%4*15||"00"}`;e.options[t]=new Option(r,n)}}static _initDayDropDown(e){const t=[["Everyday","127"],["Weekdays","62"],["Weekends","65"],["Sunday","1"],["Monday","2"],["Tuesday","4"],["Wednesday","8"],["Thursday","16"],["Friday","32"],["Saturday","64"]];for(let n=0;t[n];++n){const[r,o]=t[n];e.options[n]=new Option(r,o)}}_checkPort(){const e=this.elements.network.port_status_label;e.removeAttribute("data-open"),b(e,"Checking..."),this.remote.checkPort(this._onPortChecked,this)}_onPortChecked(e){const t=this.elements.network.port_status_label,n=e.arguments["port-is-open"];t.dataset.open=n,b(t,n?"Open":"Closed")}_setBlocklistButtonEnabled(e){const t=this.elements.peers.blocklist_update_button;g(t,e),t.value=e?"Update":"Updating..."}static _getValue(e){switch(e.type){case"checkbox":case"radio":return e.checked;case"number":case"text":case"url":{const t=e.value;return Number.parseInt(t,10).toString()===t?Number.parseInt(t,10):Number.parseFloat(t).toString()===t?Number.parseFloat(t):t}default:return null}}_onControlChanged(e){const{key:t}=e.target.dataset;this.remote.savePrefs({[t]:re._getValue(e.target)}),"peer-port"!==t&&"port-forwarding-enabled"!==t||this._checkPort()}_onDialogClosed(){this.dispatchEvent(new Event("closed"))}_update(e){if(e){this._setBlocklistButtonEnabled(!0);for(const[t,n]of Object.entries(e))for(const e of this.elements.root.querySelectorAll(`[data-key="${t}"]`))if("blocklist-size"===t){const t=T.number(n);e.innerHTML=`Blocklist has ${t} rules`,b(this.elements.peers.blocklist_update_button,"Update")}else switch(e.type){case"checkbox":case"radio":e.checked!==n&&(e.checked=n,e.dispatchEvent(new Event("change")));break;case"text":case"url":case"email":case"number":case"search":e.value!=n&&e!==document.activeElement&&(e.value=n,e.dispatchEvent(new Event("change")));break;case"select-one":e.value!==n&&(e.value=n,e.dispatchEvent(new Event("change")))}}}shouldAddedTorrentsStart(){return this.data.elements.root.find("#start-added-torrents")[0].checked}static _createCheckAndLabel(e,t){const n=document.createElement("div");n.id=e;const r=document.createElement("input");r.id=c(),r.type="checkbox",n.append(r);const o=document.createElement("label");return o.textContent=t,o.setAttribute("for",r.id),n.append(o),{check:r,label:o,root:n}}static _enableIfChecked(e,t){const n=()=>{"INPUT"===e.tagName?g(e,t.checked):e.classList.toggle("disabled",!t.checked)};t.addEventListener("change",n),n()}static _createTorrentsPage(){const e=document.createElement("div");e.classList.add("prefs-torrents-page");let t=document.createElement("div");t.textContent="Downloading",t.classList.add("section-label"),e.append(t),t=document.createElement("label"),t.textContent="Download to:",e.append(t);let n=document.createElement("input");n.type="text",n.id=c(),n.dataset.key="download-dir",t.setAttribute("for",n.id),e.append(n);const r=n;let o=re._createCheckAndLabel("autostart-div","Start when added");o.check.dataset.key="start-added-torrents",e.append(o.root);const i=o.check;o=re._createCheckAndLabel("suffix-div",'Append "part" to incomplete files\' names'),o.check.dataset.key="rename-partial-files",e.append(o.root);const s=o.check;t=document.createElement("div"),t.textContent="Seeding",t.classList.add("section-label"),e.append(t),o=re._createCheckAndLabel("stop-ratio-div","Stop seeding at ratio:"),o.check.dataset.key="seedRatioLimited",e.append(o.root);const a=o.check;n=document.createElement("input"),n.type="number",n.dataset.key="seedRatioLimit",e.append(n),re._enableIfChecked(n,o.check);const l=n;o=re._createCheckAndLabel("stop-idle-div","Stop seeding if idle for N mins:"),o.check.dataset.key="idle-seeding-limit-enabled",e.append(o.root);const d=o.check;n=document.createElement("input"),n.type="number",n.dataset.key="idle-seeding-limit",e.append(n),re._enableIfChecked(n,o.check);return{autostart_check:i,download_dir:r,root:e,stop_idle_check:d,stop_idle_input:n,stop_ratio_check:a,stop_ratio_input:l,suffix_check:s}}static _createSpeedPage(){const e=document.createElement("div");e.classList.add("prefs-speed-page");let t=document.createElement("div");t.textContent="Speed Limits",t.classList.add("section-label"),e.append(t);let n=re._createCheckAndLabel("upload-speed-div","Upload (kB/s):");n.check.dataset.key="speed-limit-up-enabled",e.append(n.root);const r=n.check;let o=document.createElement("input");o.type="number",o.dataset.key="speed-limit-up",e.append(o),re._enableIfChecked(o,n.check);const i=o;n=re._createCheckAndLabel("download-speed-div","Download (kB/s):"),n.check.dataset.key="speed-limit-down-enabled",e.append(n.root);const s=n.check;o=document.createElement("input"),o.type="number",o.dataset.key="speed-limit-down",e.append(o),re._enableIfChecked(o,n.check);const a=o;t=document.createElement("div"),t.textContent="Alternative Speed Limits",t.classList.add("section-label","alt-speed-section-label"),e.append(t),t=document.createElement("div"),t.textContent="Override normal speed limits manually or at scheduled times",t.classList.add("alt-speed-label"),e.append(t),t=document.createElement("label"),t.textContent="Upload (kB/s):",e.append(t),o=document.createElement("input"),o.type="number",o.dataset.key="alt-speed-up",o.id=c(),t.setAttribute("for",o.id),e.append(o);const l=o;t=document.createElement("label"),t.textContent="Download (kB/s):",e.append(t),o=document.createElement("input"),o.type="number",o.dataset.key="alt-speed-down",o.id=c(),t.setAttribute("for",o.id),e.append(o);const d=o;n=re._createCheckAndLabel("alt-times-div","Scheduled times"),n.check.dataset.key="alt-speed-time-enabled",e.append(n.root);const A=n.check;t=document.createElement("label"),t.textContent="From:",re._enableIfChecked(t,n.check),e.append(t);let p=document.createElement("select");p.id=c(),p.dataset.key="alt-speed-time-begin",re._initTimeDropDown(p),t.setAttribute("for",p.id),e.append(p),re._enableIfChecked(p,n.check);const u=p;t=document.createElement("label"),t.textContent="To:",re._enableIfChecked(t,n.check),e.append(t),p=document.createElement("select"),p.id=c(),p.dataset.key="alt-speed-time-end",re._initTimeDropDown(p),t.setAttribute("for",p.id),e.append(p),re._enableIfChecked(p,n.check);const g=p;t=document.createElement("label"),t.textContent="On days:",re._enableIfChecked(t,n.check),e.append(t),p=document.createElement("select"),p.id=c(),p.dataset.key="alt-speed-time-day",re._initDayDropDown(p),t.setAttribute("for",p.id),e.append(p),re._enableIfChecked(p,n.check);return{alt_days_select:p,alt_download_speed_input:d,alt_from_select:u,alt_times_check:A,alt_to_select:g,alt_upload_speed_input:l,download_speed_check:s,download_speed_input:a,root:e,upload_speed_check:r,upload_speed_input:i}}static _createPeersPage(){const e=document.createElement("div");e.classList.add("prefs-peers-page");let t=document.createElement("div");t.textContent="Connections",t.classList.add("section-label"),e.append(t);let n=re._createCheckAndLabel("max-peers-per-torrent-div","Max peers per torrent:");e.append(n.root);const r=n.check;let o=document.createElement("input");o.type="number",o.dataset.key="peer-limit-per-torrent",e.append(o),re._enableIfChecked(o,n.check);const i=o;n=re._createCheckAndLabel("max-peers-overall-div","Max peers overall:"),e.append(n.root);const s=n.check;o=document.createElement("input"),o.type="number",o.dataset.key="peer-limit-global",e.append(o),re._enableIfChecked(o,n.check);const a=o;t=document.createElement("div"),t.textContent="Options",t.classList.add("section-label"),e.append(t),t=document.createElement("label"),t.textContent="Encryption mode:",e.append(t);const l=document.createElement("select");l.id=c(),l.dataset.key="encryption",l.options[0]=new Option("Prefer encryption","preferred"),l.options[1]=new Option("Allow encryption","tolerated"),l.options[2]=new Option("Require encryption","required"),e.append(l);const d=l;n=re._createCheckAndLabel("use-pex-div","Use PEX to find more peers"),n.check.title="PEX is a tool for exchanging peer lists with the peers you're connected to.",n.check.dataset.key="pex-enabled",n.label.title=n.check.title,e.append(n.root);const A=n.check;n=re._createCheckAndLabel("use-dht-div","Use DHT to find more peers"),n.check.title="DHT is a tool for finding peers without a tracker.",n.check.dataset.key="dht-enabled",n.label.title=n.check.title,e.append(n.root);const p=n.check;n=re._createCheckAndLabel("use-lpd-div","Use LPD to find more peers"),n.check.title="LPD is a tool for finding peers on your local network.",n.check.dataset.key="lpd-enabled",n.label.title=n.check.title,e.append(n.root);const u=n.check;t=document.createElement("div"),t.textContent="Blocklist",t.classList.add("section-label"),e.append(t),n=re._createCheckAndLabel("blocklist-enabled-div","Enable blocklist:"),n.check.dataset.key="blocklist-enabled",e.append(n.root);const g=n.check;o=document.createElement("input"),o.type="url",o.value="http://www.example.com/blocklist",o.dataset.key="blocklist-url",e.append(o),re._enableIfChecked(o,n.check);const m=o;t=document.createElement("label"),t.textContent="Blocklist has {n} rules",t.dataset.key="blocklist-size",t.classList.add("blocklist-size-label"),re._enableIfChecked(t,n.check),e.append(t);const h=document.createElement("button");h.classList.add("blocklist-update-button"),h.textContent="Update",e.append(h),re._enableIfChecked(h,n.check);return{blocklist_enabled_check:g,blocklist_update_button:h,blocklist_url_input:m,dht_check:p,encryption_select:d,lpd_check:u,max_peers_overall_check:s,max_peers_overall_input:a,max_peers_per_torrent_check:r,max_peers_per_torrent_input:i,pex_check:A,root:e}}static _createNetworkPage(){const e=document.createElement("div");e.classList.add("prefs-network-page");let t=document.createElement("div");t.textContent="Listening Port",t.classList.add("section-label"),e.append(t),t=document.createElement("label"),t.textContent="Peer listening port:",e.append(t);const n=document.createElement("input");n.type="number",n.dataset.key="peer-port",n.id=c(),t.setAttribute("for",n.id),e.append(n);const r=n,o=document.createElement("div");o.classList.add("port-status"),t=document.createElement("label"),t.textContent="Port is",o.append(t);const i=document.createElement("label");i.textContent="?",i.classList.add("port-status-label"),o.append(i),e.append(o);let s=re._createCheckAndLabel("randomize-port","Randomize port on launch");s.check.dataset.key="peer-port-random-on-start",e.append(s.root);const a=s.check;s=re._createCheckAndLabel("port-forwarding","Use port forwarding from my router"),s.check.dataset.key="port-forwarding-enabled",e.append(s.root);const l=s.check;t=document.createElement("div"),t.textContent="Options",t.classList.add("section-label"),e.append(t),s=re._createCheckAndLabel("utp-enabled","Enable uTP for peer communication"),s.check.dataset.key="utp-enabled",e.append(s.root);return{port_forwarding_check:l,port_input:r,port_status_label:i,random_port_check:a,root:e,utp_check:s.check}}static _create(){const e={network:re._createNetworkPage(),peers:re._createPeersPage(),speed:re._createSpeedPage(),torrents:re._createTorrentsPage()};return{...a("prefs-dialog",[["prefs-tab-torrent",e.torrents.root],["prefs-tab-speed",e.speed.root],["prefs-tab-peers",e.peers.root],["prefs-tab-network",e.network.root]]),...e}}constructor(e,t){super(),this.closed=!1,this.session_manager=e,this.remote=t,this.update_soon=()=>this._update(this.session_manager.session_properties),this.elements=re._create(),this.elements.peers.blocklist_update_button.addEventListener("click",(e=>{b(e.target,"Updating blocklist..."),this.remote.updateBlocklist(),this._setBlocklistButtonEnabled(!1)})),this.outside=new f(this.elements.root),this.outside.addEventListener("click",(()=>this.close())),Object.seal(this);const n=this._onControlChanged.bind(this),r=e=>{for(const t of Object.values(e))if("INPUT"===t.tagName)switch(t.type){case"checkbox":case"radio":case"number":case"text":case"url":t.addEventListener("change",n);break;default:console.trace("unhandled input: "+t.type)}};r(this.elements.network),r(this.elements.peers),r(this.elements.speed),r(this.elements.torrents),this.session_manager.addEventListener("session-change",this.update_soon),this.update_soon(),document.body.append(this.elements.root)}close(){if(!this.closed){this.outside.stop(),this.session_manager.removeEventListener("session-change",this.update_soon),this.elements.root.remove(),dispatchEvent(new Event("close"));for(const e of Object.keys(this))this[e]=null;this.closed=!0}}}class oe extends EventTarget{constructor(e){super(),this.options=e,this.elements=oe._create(e),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),this.elements.confirm.addEventListener("click",(()=>this._onConfirm())),document.body.append(this.elements.root),this.elements.dismiss.focus()}close(){if(!this.closed){this.elements.root.remove(),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))delete this[e];this.closed=!0}}_onDismiss(){this.close()}_onConfirm(){const{torrents:e}=this.options;e.length>0&&(this.options.trash?this.options.remote.removeTorrentsAndData(e):this.options.remote.removeTorrents(e)),this.close()}static _create(e){const{trash:t}=e,{heading:n,message:r}=oe._createMessage(e),o=l("remove-dialog");return o.heading.textContent=n,o.message.textContent=r,o.confirm.textContent=t?"Trash":"Remove",o}static _createMessage(e){let t=null,n=null;const{torrents:r}=e,[o]=r;return e.trash&&1===r.length?(t=`Remove ${o.getName()} and delete data?`,n="All data downloaded for this torrent will be deleted. Are you sure you want to remove it?"):e.trash?(t=`Remove ${r.length} transfers and delete data?`,n="All data downloaded for these torrents will be deleted. Are you sure you want to remove them?"):1===r.length?(t=`Remove ${o.getName()}?`,n="Once removed, continuing the transfer will require the torrent file. Are you sure you want to remove it?"):(t=`Remove ${r.length} transfers?`,n="Once removed, continuing the transfers will require the torrent files. Are you sure you want to remove them?"),{heading:t,message:n}}}class ie extends EventTarget{constructor(e,t){super(),this.controller=e,this.remote=t,this.elements={},this.torrents=[],this.show()}show(){const e=this.controller.getSelectedTorrents();1===e.length?(this.torrents=e,this.elements=ie._create(),this.elements.entry.value=e[0].getName(),document.body.append(this.elements.root),this.elements.entry.focus()):console.trace()}close(){this.elements.root.remove(),this.dispatchEvent(new Event("close")),delete this.controller,delete this.remote,delete this.elements,delete this.torrents}_onDismiss(){this.close()}_onConfirm(){const[e]=this.torrents,t=e.getName(),n=this.elements.entry.value;this.remote.renameTorrent([e.getId()],t,n,(t=>{"success"===t.result&&e.refresh(t.arguments)})),this.close()}static _create(){const e=l("rename-dialog");e.root.setAttribute("aria-label","Rename Torrent"),e.heading.textContent="Enter new name:",e.confirm.textContent="Rename",e.dismiss.addEventListener("click",(()=>this._onDismiss())),e.confirm.addEventListener("click",(()=>this._onConfirm()));const t=document.createElement("label");t.setAttribute("for","torrent-rename-name"),t.textContent="Enter new name:",e.workarea.append(t);const n=document.createElement("input");return n.setAttribute("type","text"),n.id="torrent-rename-name",e.entry=n,e.workarea.append(n),e}}class se extends EventTarget{constructor(e){super(),this.elements=se._create(e),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),document.body.append(this.elements.root),this.elements.dismiss.focus()}close(){this.elements.root.remove(),this.dispatchEvent(new Event("close")),delete this.elements}_onDismiss(){this.close()}static _create(e){const t=l("shortcuts-dialog");t.root.setAttribute("aria-label","Keyboard Shortcuts");const n=document.createElement("table"),r=document.createElement("thead");n.append(r);let o=document.createElement("tr");r.append(o);let i=document.createElement("th");i.textContent="Key",o.append(i),i=document.createElement("th"),i.textContent="Action",o.append(i);const s=document.createElement("tbody");n.append(s);const a={};for(const[t,n]of e.allShortcuts().entries()){const e=t.split("+");a[[e.pop(),...e].join("+")]={name:n,shortcut:t}}for(const[,t]of Object.entries(a).sort()){const{name:n,shortcut:r}=t;o=document.createElement("tr"),s.append(o);let i=document.createElement("td");i.textContent=r.replaceAll("+"," + "),o.append(i),i=document.createElement("td"),i.textContent=e.text(n),o.append(i)}return t.heading.textContent="Transmission",t.dismiss.textContent="Close",t.heading.textContent="Keyboard shortcuts",t.message.append(n),t.confirm.remove(),delete t.confirm,t}}class ae extends EventTarget{constructor(e){super(),this.remote=e;const t=()=>this.remote.loadDaemonStats((e=>this._update(e.arguments)));this.interval=setInterval(t,5e3),t(),this.elements=ae._create(),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),document.body.append(this.elements.root),this.elements.dismiss.focus()}close(){if(!this.closed){clearInterval(this.interval),this.elements.root.remove();for(const e of Object.keys(this))delete this[e];this.closed=!0}}_onDismiss(){this.close()}_update(e){console.log(e);const t=T;let n=e["current-stats"],r=s.ratio(n.uploadedBytes,n.downloadedBytes);b(this.elements.session.up,t.size(n.uploadedBytes)),b(this.elements.session.down,t.size(n.downloadedBytes)),b(this.elements.session.ratio,t.ratioString(r)),b(this.elements.session.time,t.timeInterval(n.secondsActive)),n=e["cumulative-stats"],r=s.ratio(n.uploadedBytes,n.downloadedBytes),b(this.elements.total.up,t.size(n.uploadedBytes)),b(this.elements.total.down,t.size(n.downloadedBytes)),b(this.elements.total.ratio,t.ratioString(r)),b(this.elements.total.time,t.timeInterval(n.secondsActive))}static _create(){const e=l("statistics-dialog"),{workarea:t}=e;e.confirm.remove(),e.dismiss.textContent="Close",delete e.confirm;const n="Statistics";e.root.setAttribute("aria-label",n),e.heading.textContent=n;const r=["Uploaded:","Downloaded:","Ratio:","Running time:"];let o=d("Current session",r);const[i,s,a,c]=o.children,A=e.session={};A.up=i,A.down=s,A.ratio=a,A.time=c,t.append(o.root),o=d("Total",r);const[p,u,g,m]=o.children,h=e.total={};return h.up=p,h.down=u,h.ratio=g,h.time=m,t.append(o.root),e}}class le{static getProgressInfo(e,t){const n=t.getStatus(),r=["torrent-progress-bar"];let o=null;if(n===j._StatusStopped&&r.push("paused"),t.needsMetaData())r.push("magnet"),o=Math.round(100*t.getMetadataPercentComplete());else if(n===j._StatusCheck)r.push("verify"),o=Math.round(100*t.getRecheckProgress());else if(t.getLeftUntilDone()>0)r.push("leech"),o=Math.round(100*t.getPercentDone());else{r.push("seed");const n=t.seedRatioLimit(e);o=n>0?100*t.getUploadRatio()/n:100}return t.isQueued()&&r.push("queued"),{classList:r,percent:o}}static renderProgressbar(e,t,n){const r=le.getProgressInfo(e,t);n.className=r.classList.join(" "),n.style["background-size"]=r.percent+"% 100%, 100% 100%"}static formatUL(e){return"▲"+T.speedBps(e.getUploadSpeed())}static formatDL(e){return"▼"+T.speedBps(e.getDownloadSpeed())}static formatETA(e){const t=e.getETA();return t<0||t>=3596400?"":"ETA: "+T.timeInterval(t)}}class ce{static getPeerDetails(e){const t=T,n=e.getErrorMessage();if(n)return n;if(e.isDownloading()){const n=e.getPeersConnected(),r=e.getWebseedsSendingToUs();return r&&n?["Downloading from",e.getPeersSendingToUs(),"of",t.countString("peer","peers",n),"and",t.countString("web seed","web seeds",r),"–",le.formatDL(e),le.formatUL(e)].join(" "):r?["Downloading from",t.countString("web seed","web seeds",r),"–",le.formatDL(e),le.formatUL(e)].join(" "):["Downloading from",e.getPeersSendingToUs(),"of",t.countString("peer","peers",n),"–",le.formatDL(e),le.formatUL(e)].join(" ")}return e.isSeeding()?["Seeding to",e.getPeersGettingFromUs(),"of",t.countString("peer","peers",e.getPeersConnected()),"-",le.formatUL(e)].join(" "):e.isChecking()?["Verifying local data (",T.percentString(100*e.getRecheckProgress()),"% tested)"].join(""):e.getStateString()}static getProgressDetails(e,t){if(t.needsMetaData()){let e="retrieving";t.isStopped()&&(e="needs");const n=100*t.getMetadataPercentComplete();return[`Magnetized transfer - ${e} metadata (`,T.percentString(n),"%)"].join("")}const n=t.getSizeWhenDone(),r=t.getTotalSize(),o=t.isDone()||t.isSeeding(),i=[];if(o?(r===n?i.push(T.size(r)):i.push(T.size(n)," of ",T.size(t.getTotalSize())," (",t.getPercentDoneStr(),"%)"),i.push(", uploaded ",T.size(t.getUploadedEver())," (Ratio ",T.ratioString(t.getUploadRatio()),")")):i.push(T.size(n-t.getLeftUntilDone())," of ",T.size(n)," (",t.getPercentDoneStr(),"%)"),!t.isStopped()&&(!o||t.seedRatioLimit(e)>0)){i.push(" - ");const e=t.getETA();e<0||e>=3596400?i.push("remaining time unknown"):i.push(T.timeInterval(t.getETA())," remaining")}return i.join("")}render(e,t,n){const r=t.isStopped();let o=n._name_container;b(o,t.getName()),o.classList.toggle("paused",r),le.renderProgressbar(e,t,n._progressbar),n._progressbar.classList.add("full");const i=t.getError()!==j._ErrNone;o=n._peer_details_container,o.classList.toggle("error",i),b(o,ce.getPeerDetails(t)),o=n._progress_details_container,b(o,ce.getProgressDetails(e,t)),o=n._toggle_running_button,o.alt=r?"Resume":"Pause",o.dataset.action=r?"resume":"pause"}createRow(e){const t=document.createElement("li");t.className="torrent";const n=document.createElement("div");n.classList.add("icon"),n.dataset.iconMimeType=e.getPrimaryMimeType().split("/",1).pop(),n.dataset.iconMultifile=e.getFileCount()>1?"true":"false";const r=document.createElement("div");r.className="torrent-name";const o=document.createElement("div");o.className="torrent-peer-details";const i=document.createElement("div");i.classList.add("torrent-progress");const s=document.createElement("div");s.classList.add("torrent-progress-bar","full"),i.append(s);const a=document.createElement("a");a.className="torrent-pauseresume-button",i.append(a);const l=document.createElement("div");return l.className="torrent-progress-details",t.append(n),t.append(r),t.append(o),t.append(i),t.append(l),t._icon=n,t._name_container=r,t._peer_details_container=o,t._progress_details_container=l,t._progressbar=s,t._toggle_running_button=a,t}}class de{static getPeerDetails(e){const t=e.getErrorMessage();if(t)return t;if(e.isDownloading()){const t=e.getDownloadSpeed()>0,n=e.getUploadSpeed()>0;if(!n&&!t)return"Idle";const r=[le.formatETA(e)+" "];return t&&r.push(le.formatDL(e)),n&&r.push(le.formatUL(e)),r.join(" ")}return e.isSeeding()?`Ratio: ${T.ratioString(e.getUploadRatio())}, ${le.formatUL(e)}`:e.getStateString()}render(e,t,n){let r=n._name_container;r.classList.toggle("paused",t.isStopped()),b(r,t.getName());const o=t.getError()!==j._ErrNone;r=n._details_container,r.classList.toggle("error",o),b(r,de.getPeerDetails(t)),le.renderProgressbar(e,t,n._progressbar),n._progressbar.classList.add("compact")}createRow(e){const t=document.createElement("div");t.classList.add("torrent-progress-bar","compact");const n=document.createElement("div");n.classList.add("icon"),n.dataset.iconMimeType=e.getPrimaryMimeType().split("/",1).pop(),n.dataset.iconMultifile=e.getFileCount()>1?"true":"false";const r=document.createElement("div");r.className="torrent-peer-details compact";const o=document.createElement("div");o.className="torrent-name compact";const i=document.createElement("li");return i.append(t),i.append(r),i.append(o),i.append(n),i.className="torrent compact",i._progressbar=t,i._details_container=r,i._name_container=o,i}}class Ae{constructor(e,t,n){this._view=e,this._torrent=n,this._element=e.createRow(n);const r=()=>this.render(t);this._torrent.addEventListener("dataChanged",r),r()}getElement(){return this._element}render(e){const t=this.getTorrent();t&&this._view.render(e,t,this.getElement())}isSelected(){return this.getElement().classList.contains("selected")}getTorrent(){return this._torrent}getTorrentId(){return this.getTorrent().getId()}}class pe extends EventTarget{constructor(e,t,n){super(),this.action_manager=e,this.notifications=t,this.prefs=n,this.remote=new $(this),this.addEventListener("torrent-selection-changed",(e=>this.action_manager.update(e))),this.filterText="",this._torrents={},this._rows=[],this.dirtyTorrents=new Set,this.refilterSoon=A((()=>this._refilter(!1))),this.refilterAllSoon=A((()=>this._refilter(!0))),this.boundPopupCloseListener=this.popupCloseListener.bind(this),this.dispatchSelectionChangedSoon=A((()=>this._dispatchSelectionChanged()),200);for(const e of document.querySelectorAll("button[data-action]")){const{action:t}=e.dataset;g(e,this.action_manager.isEnabled(t)),e.addEventListener("click",(()=>{this.action_manager.click(t)}))}document.querySelector("#filter-tracker").addEventListener("change",(e=>{this.setFilterTracker("all"===e.target.value?null:e.target.value)})),this.action_manager.addEventListener("change",(e=>{for(const t of document.querySelectorAll(`[data-action="${e.action}"]`))g(t,e.enabled)})),this.action_manager.addEventListener("click",(e=>{switch(e.action){case"deselect-all":this._deselectAll();break;case"move-bottom":this._moveBottom();break;case"move-down":this._moveDown();break;case"move-top":this._moveTop();break;case"move-up":this._moveUp();break;case"open-torrent":this.setCurrentPopup(new O(this,this.remote));break;case"pause-all-torrents":this._stopTorrents(this._getAllTorrents());break;case"pause-selected-torrents":this._stopTorrents(this.getSelectedTorrents());break;case"reannounce-selected-torrents":this._reannounceTorrents(this.getSelectedTorrents());break;case"remove-selected-torrents":this._removeSelectedTorrents(!1);break;case"resume-selected-torrents":this._startSelectedTorrents(!1);break;case"resume-selected-torrents-now":this._startSelectedTorrents(!0);break;case"select-all":this._selectAll();break;case"show-about-dialog":this.setCurrentPopup(new y(this.version_info));break;case"show-inspector":this.setCurrentPopup(new z(this));break;case"show-move-dialog":this.setCurrentPopup(new P(this,this.remote));break;case"show-overflow-menu":if(this.popup instanceof ne)this.setCurrentPopup(null);else{this.setCurrentPopup(new ne(this,this.prefs,this.remote,this.action_manager));const e=document.querySelector("#toolbar-overflow").getBoundingClientRect();h(this.popup.root,e.left+e.width,e.top+e.height,document.body)}break;case"show-preferences-dialog":this.setCurrentPopup(new re(this,this.remote));break;case"show-shortcuts-dialog":this.setCurrentPopup(new se(this.action_manager));break;case"show-statistics-dialog":this.setCurrentPopup(new ae(this.remote));break;case"show-rename-dialog":this.setCurrentPopup(new ie(this,this.remote));break;case"start-all-torrents":this._startTorrents(this._getAllTorrents());break;case"toggle-compact-rows":this.prefs.display_mode=this.prefs.display_mode!==v.DisplayCompact?v.DisplayCompact:v.DisplayFull;break;case"trash-selected-torrents":this._removeSelectedTorrents(!0);break;case"verify-selected-torrents":this._verifyTorrents(this.getSelectedTorrents());break;default:console.warn("unhandled action: "+e.action)}}));let r=document.querySelector("#filter-mode");r.value=this.prefs.filter_mode,r.addEventListener("change",(e=>{this.prefs.filter_mode=e.target.value})),document.addEventListener("keydown",this._keyDown.bind(this)),document.addEventListener("keyup",this._keyUp.bind(this)),r=document.querySelector("#torrent-container"),r.addEventListener("click",(()=>{this.popup&&"inspector"!==this.popup.name?this.setCurrentPopup(null):this._deselectAll()})),r.addEventListener("dragenter",pe._dragenter),r.addEventListener("dragover",pe._dragenter),r.addEventListener("drop",this._drop.bind(this)),this._setupSearchBox(),this.elements={torrent_list:document.querySelector("#torrent-list")},this.elements.torrent_list.addEventListener("contextmenu",(e=>{let t=event.target;for(;t&&!t.classList.contains("torrent");)t=t.parentNode;const n=this._rows.find((e=>e.getElement()===t));n&&!n.isSelected()&&this._setSelectedRow(n);const r=new E(this.action_manager);this.setCurrentPopup(r),h(r.root,e.x,e.y,document.querySelector("#torrent-container")),e.preventDefault()})),this.loadDaemonPrefs(),this._initializeTorrents(),this.refreshTorrents(),this.togglePeriodicSessionRefresh(!0),this.prefs.addEventListener("change",(({key:e,value:t})=>this._onPrefChanged(e,t))),this.prefs.entries().forEach((([e,t])=>this._onPrefChanged(e,t)))}loadDaemonPrefs(){this.remote.loadDaemonPrefs((e=>{this.session_properties=e.arguments}))}get session_properties(){return this._session_properties}set session_properties(e){if(p(this._session_properties,e))return;this._session_properties=Object.seal(e);const t=new Event("session-change");t.session_properties=e,this.dispatchEvent(t),this._updateGuiFromSession(e)}_setupSearchBox(){const e=document.querySelector("#torrent-search"),t="blur";e.classList.add(t),e.addEventListener("blur",(()=>e.classList.add(t))),e.addEventListener("focus",(()=>e.classList.remove(t))),e.addEventListener("keyup",(()=>this._setFilterText(e.value)))}_onPrefChanged(e,t){switch(e){case v.DisplayMode:this.torrentRenderer="compact"===t?new de:new ce,this.refilterAllSoon();break;case v.FilterMode:case v.SortDirection:case v.SortMode:this.refilterAllSoon();break;case v.RefreshRate:{clearInterval(this.refreshTorrentsInterval);const e=this.refreshTorrents.bind(this),t=1e3*Math.max(2,this.prefs.refresh_rate_sec);this.refreshTorrentsInterval=setInterval(e,t);break}case v.AltSpeedEnabled:case v.NotificationsEnabled:}}_getAllTorrents(){return Object.values(this._torrents)}static _getTorrentIds(e){return e.map((e=>e.getId()))}seedRatioLimit(){const e=this.session_properties;return e&&e.seedRatioLimited?e.seedRatioLimit:-1}_getSelectedRows(){return this._rows.filter((e=>e.isSelected()))}getSelectedTorrents(){return this._getSelectedRows().map((e=>e.getTorrent()))}_getSelectedTorrentIds(){return pe._getTorrentIds(this.getSelectedTorrents())}_setSelectedRow(e){const t=e?e.getElement():null;for(const e of this.elements.torrent_list.children)e.classList.toggle("selected",e===t);this.dispatchSelectionChangedSoon()}_selectRow(e){e.getElement().classList.add("selected"),this.dispatchSelectionChangedSoon()}_deselectRow(e){e.getElement().classList.remove("selected"),this.dispatchSelectionChangedSoon()}_selectAll(){for(const e of this.elements.torrent_list.children)e.classList.add("selected");this.dispatchSelectionChangedSoon()}_deselectAll(){for(const e of this.elements.torrent_list.children)e.classList.remove("selected");this.dispatchSelectionChangedSoon(),delete this._last_torrent_clicked}_indexOfLastTorrent(){return this._rows.findIndex((e=>e.getTorrentId()===this._last_torrent_clicked))}_selectRange(e){const t=this._indexOfLastTorrent();if(-1===t)this._selectRow(e);else{const n=this._rows.indexOf(e),r=Math.min(t,n),o=Math.max(t,n);for(let e=r;e<=o;++e)this._selectRow(this._rows[e])}this.dispatchSelectionChangedSoon()}_dispatchSelectionChanged(){const e=[],t=[];this._rows.forEach((n=>(n.isSelected()?t:e).push(n.getTorrent())));const n=new Event("torrent-selection-changed");n.nonselected=e,n.selected=t,this.dispatchEvent(n)}static _createKeyShortcutFromKeyboardEvent(e){const t=[];return e.ctrlKey&&t.push("Control"),e.altKey&&t.push("Alt"),e.metaKey&&t.push("Meta"),e.shitKey&&t.push("Shift"),t.push(1===e.key.length?e.key.toUpperCase():e.key),t.join("+")}_keyDown(e){const{keyCode:t}=e,n=pe._createKeyShortcutFromKeyboardEvent(e),r=this.action_manager.getActionForShortcut(n);if(r)return e.preventDefault(),void this.action_manager.click(r);if(27===t&&this.popup)return this.setCurrentPopup(null),void e.preventDefault();const o=document.querySelector(".popup:not(.hidden)"),i=e.target.matches("input"),s=this._rows;if(!(i||o||e.metaKey||e.ctrlKey)){const n=16===t,r=38===t,o=40===t;if((r||o)&&s.length>0){const t=this._indexOfLastTorrent(),n=this._shift_index,i=0,a=s.length-1;let l=t;o&&l+1<=a?++l:r&&l-1>=i&&--l;const c=s[l];n>=0?n<=t&&t=t&&t>l?this._selectRow(c):(n>=t&&l>t||n<=t&&t>l)&&this._deselectRow(s[t]):e.shiftKey?this._selectRange(c):this._setSelectedRow(c),c&&(this._last_torrent_clicked=c.getTorrentId(),c.getElement().scrollIntoView(),e.preventDefault())}else n&&(this._shift_index=this._indexOfLastTorrent())}}_keyUp(e){16===e.keyCode&&delete this._shift_index}static _dragenter(e){if(e.dataTransfer&&e.dataTransfer.types){const t=new Set(["text/uri-list","text/plain"]);if(e.dataTransfer.types.some((e=>t.has(e))))return e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy",!1}else e.dataTransfer&&(e.dataTransfer.dropEffect="none");return!0}static _isValidURL(e){try{return!!new URL(e)}catch{return!1}}shouldAddedTorrentsStart(){return this.session_properties["start-added-torrents"]}_drop(e){const t=!this.shouldAddedTorrentsStart();if(!e.dataTransfer||!e.dataTransfer.types)return!0;const n=e.data.Transfer.types.filter((e=>["text/uri-list","text/plain"].contains(e))).pop();return e.dataTransfer.getData(n).split("\n").map((e=>e.trim())).filter((e=>pe._isValidURL(e))).forEach((e=>this.remote.addTorrentByUrl(e,t))),e.preventDefault(),!1}togglePeriodicSessionRefresh(e){if(!e&&this.sessionInterval&&(clearInterval(this.sessionInterval),delete this.sessionInterval),e&&(this.loadDaemonPrefs(),!this.sessionInterval)){const e=8e3;this.sessionInterval=setInterval(this.loadDaemonPrefs.bind(this),e)}}_setFilterText(e){this.filterText=e?e.trim():null,this.refilterAllSoon()}_onTorrentChanged(e){const t=e.currentTarget;this.dirtyTorrents.add(t.getId()),this.refilterSoon()}updateTorrents(e,t){this.remote.updateTorrents(e,t,((e,t)=>{const n=[],r=e.shift(),o={};for(const t of e){r.forEach(((e,n)=>{o[e]=t[n]}));const{id:e}=o;let i=this._torrents[e];if(i){const t=i.needsMetaData();i.refresh(o),t&&!i.needsMetaData()&&n.push(e)}else i=this._torrents[e]=new j(o),i.addEventListener("dataChanged",this._onTorrentChanged.bind(this)),this.dirtyTorrents.add(e),"name"in i.fields&&"status"in i.fields||n.push(e)}if(n.length>0){const e=["id"].concat(j.Fields.Metadata,j.Fields.Stats);this.updateTorrents(n,e),this.refilterSoon()}t&&(this._deleteTorrents(t),this.refilterSoon())}))}refreshTorrents(){const e=["id"].concat(j.Fields.Stats);this.updateTorrents("recently-active",e)}_initializeTorrents(){const e=["id"].concat(j.Fields.Metadata,j.Fields.Stats);this.updateTorrents(null,e)}_onRowClicked(e){const t=e.metaKey||e.ctrlKey,{row:n}=e.currentTarget;if(this.popup&&"inspector"!==this.popup.name)this.setCurrentPopup(null);else{if(e.target.classList.contains("torrent-pauseresume-button"))switch(e.target.dataset.action){case"pause":this._stopTorrents([n.getTorrent()]);break;case"resume":this._startTorrents([n.getTorrent()])}e.stopPropagation(),e.shiftKey?(this._selectRange(n),window.focus()):!n.isSelected()&&t?this._selectRow(n):n.isSelected()?n.isSelected()&&t?this._deselectRow(n):n.isSelected()&&this._setSelectedRow(n):this._setSelectedRow(n),this._last_torrent_clicked=n.getTorrentId()}}_deleteTorrents(e){if(e&&e.length>0){for(const t of e)this.dirtyTorrents.add(t),delete this._torrents[t];this.refilterSoon()}}_removeSelectedTorrents(e){const t=this.getSelectedTorrents();t.length>0&&this.setCurrentPopup(new oe({remote:this.remote,torrents:t,trash:e}))}_startSelectedTorrents(e){this._startTorrents(this.getSelectedTorrents(),e)}_startTorrents(e,t){this.remote.startTorrents(pe._getTorrentIds(e),t,this.refreshTorrents,this)}_verifyTorrents(e){this.remote.verifyTorrents(pe._getTorrentIds(e),this.refreshTorrents,this)}_reannounceTorrents(e){this.remote.reannounceTorrents(pe._getTorrentIds(e),this.refreshTorrents,this)}_stopTorrents(e){this.remote.stopTorrents(pe._getTorrentIds(e),this.refreshTorrents,this)}changeFileCommand(e,t,n){this.remote.changeFileCommand(e,t,n)}_moveTop(){this.remote.moveTorrentsToTop(this._getSelectedTorrentIds(),this.refreshTorrents,this)}_moveUp(){this.remote.moveTorrentsUp(this._getSelectedTorrentIds(),this.refreshTorrents,this)}_moveDown(){this.remote.moveTorrentsDown(this._getSelectedTorrentIds(),this.refreshTorrents,this)}_moveBottom(){this.remote.moveTorrentsToBottom(this._getSelectedTorrentIds(),this.refreshTorrents,this)}_updateGuiFromSession(e){const[,t,n]=e.version.match(/(.*)\s\(([\da-f]+)\)/);this.version_info={checksum:n,version:t};document.querySelector("#toolbar-overflow").classList.toggle("alt-speed-enabled",e[Z])}_updateStatusbar(){const e=T,t=this._getAllTorrents(),n=t.reduce(((e,t)=>e+t.getUploadSpeed()),0),r=t.reduce(((e,t)=>e+t.getDownloadSpeed()),0),o=e.countString("Transfer","Transfers",this._rows.length);b(document.querySelector("#speed-up-label"),e.speedBps(n)),b(document.querySelector("#speed-dn-label"),e.speedBps(r)),b(document.querySelector("#filter-count"),o)}_updateFilterSelect(){const e=this._getTrackers(),t=Object.keys(e).sort();let n="";n+=this.filterTracker?'':'';for(const r of t){n+=``}this.filterTrackersStr&&this.filterTrackersStr===n||(this.filterTrackersStr=n,document.querySelector("#filter-tracker").innerHTML=n)}sortRows(e){const t=e.map((e=>e.getTorrent())),n=e.reduce(((e,t)=>(e[t.getTorrent().getId()]=t,e)),{});j.sortTorrents(t,this.prefs.sort_mode,this.prefs.sort_direction),t.forEach(((t,r)=>e[r]=n[t.getId()]))}_refilter(e){const{sort_mode:t,sort_direction:n,filter_mode:r}=this.prefs,o=this.filterText,i=this.filterTracker,s=this.torrentRenderer,a=this.elements.torrent_list,l=()=>[...a.children].length,c=()=>[...a.children].reduce(((e,t)=>e+t.classList.contains("selected")?1:0),0),d=l(),A=c();if(this._updateFilterSelect(),clearTimeout(this.refilterTimer),delete this.refilterTimer,e){for(;a.firstChild;)a.firstChild.remove();this._rows=[],this.dirtyTorrents=new Set(Object.keys(this._torrents))}const p=[];let u=[];for(const e of this._rows)this.dirtyTorrents.has(e.getTorrentId())?u.push(e):p.push(e);for(const e of u)e.getElement().remove();const g=[];for(const e of u){const t=e.getTorrentId(),n=this._torrents[t];n&&n.test(r,o,i)&&g.push(e),this.dirtyTorrents.delete(t)}u=g;for(const e of this.dirtyTorrents.values()){const t=this._torrents[e];if(t&&t.test(r,o,i)){const e=new Ae(s,this,t),n=e.getElement();n.row=e,u.push(e),n.addEventListener("click",this._onRowClicked.bind(this)),n.addEventListener("dblclick",(()=>this.action_manager.click("show-inspector")))}}this.sortRows(u);const m=[],h=p.length,f=u.length,b=document.createDocumentFragment();let C=0,v=0;for(;C!==h||v!==f;){let e=null;if(C===h)e=!1;else if(v===f)e=!0;else{e=j.compareTorrents(p[C].getTorrent(),u[v].getTorrent(),t,n)<0}if(e)m.push(p[C++]);else{const e=u[v++],t=e.getElement();C!==h?a.insertBefore(t,p[C].getElement()):b.append(t),m.push(e)}}a.append(b),this._rows=m,this.dirtyTorrents.clear(),m.map((e=>e.getElement())).forEach(((e,t)=>{const n=t%2==0;e.classList.toggle("even",n),e.classList.toggle("odd",!n)})),this._updateStatusbar(),A===c()&&d===l()||this.dispatchSelectionChangedSoon()}setFilterTracker(e){document.querySelector("#filter-tracker").value=e?pe._getReadableDomain(e):"all",this.filterTracker=e,this.refilterAllSoon()}_getTrackers(){const e={};for(const t of this._getAllTorrents()){const n=new Set;for(const r of t.getTrackers()){const{domain:t,name:o}=r;e[o]||(e[o]={count:0,domain:t}),n.add(o)}for(const t of n.values())++e[t].count}return e}popupCloseListener(e){if(e.target!==this.popup)throw new Error(e);this.popup.removeEventListener("close",this.boundPopupCloseListener),delete this.popup}setCurrentPopup(e){this.popup&&this.popup.close(),this.popup=e,this.popup&&this.popup.addEventListener("close",this.boundPopupCloseListener)}}n(37);document.addEventListener("DOMContentLoaded",(function(){const e=new r,t=new v,n=new C(t),o=new pe(e,n,t),i=A((()=>o.elements.torrent_list.scrollTo(0,1)));window.addEventListener("load",i),window.onorientationchange=i}))}]); +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=40)}([function(e,t,n){"use strict";e.exports=function(e,t){return t||(t={}),"string"!=typeof(e=e&&e.__esModule?e.default:e)?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},function(e,t,n){(function(e,n){var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",A="[object Map]",p="[object Number]",u="[object Object]",g="[object Promise]",m="[object RegExp]",h="[object Set]",f="[object String]",b="[object Symbol]",C="[object WeakMap]",v="[object ArrayBuffer]",y="[object DataView]",E=/^\[object .+?Constructor\]$/,w=/^(?:0|[1-9]\d*)$/,x={};x["[object Float32Array]"]=x["[object Float64Array]"]=x["[object Int8Array]"]=x["[object Int16Array]"]=x["[object Int32Array]"]=x["[object Uint8Array]"]=x["[object Uint8ClampedArray]"]=x["[object Uint16Array]"]=x["[object Uint32Array]"]=!0,x[i]=x[s]=x[v]=x[a]=x[y]=x[l]=x[c]=x[d]=x[A]=x[p]=x[u]=x[m]=x[h]=x[f]=x[C]=!1;var k="object"==typeof e&&e&&e.Object===Object&&e,M="object"==typeof self&&self&&self.Object===Object&&self,S=k||M||Function("return this")(),B=t&&!t.nodeType&&t,I=B&&"object"==typeof n&&n&&!n.nodeType&&n,T=I&&I.exports===B,D=T&&k.process,L=function(){try{return D&&D.binding&&D.binding("util")}catch(e){}}(),N=L&&L.isTypedArray;function j(e,t){for(var n=-1,r=null==e?0:e.length;++na))return!1;var c=i.get(e);if(c&&i.get(t))return c==t;var d=-1,A=!0,p=2&n?new ve:void 0;for(i.set(e,t),i.set(t,e);++d-1},be.prototype.set=function(e,t){var n=this.__data__,r=we(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Ce.prototype.clear=function(){this.size=0,this.__data__={hash:new fe,map:new(ie||be),string:new fe}},Ce.prototype.delete=function(e){var t=De(this,e).delete(e);return this.size-=t?1:0,t},Ce.prototype.get=function(e){return De(this,e).get(e)},Ce.prototype.has=function(e){return De(this,e).has(e)},Ce.prototype.set=function(e,t){var n=De(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ve.prototype.add=ve.prototype.push=function(e){return this.__data__.set(e,r),this},ve.prototype.has=function(e){return this.__data__.has(e)},ye.prototype.clear=function(){this.__data__=new be,this.size=0},ye.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ye.prototype.get=function(e){return this.__data__.get(e)},ye.prototype.has=function(e){return this.__data__.has(e)},ye.prototype.set=function(e,t){var n=this.__data__;if(n instanceof be){var r=n.__data__;if(!ie||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ce(r)}return n.set(e,t),this.size=n.size,this};var Ne=te?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Qe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ye(e){return null!=e&&"object"==typeof e}var We=N?function(e){return function(t){return e(t)}}(N):function(e){return Ye(e)&&Ue(e.length)&&!!x[xe(e)]};function Je(e){return null!=(t=e)&&Ue(t.length)&&!Ge(t)?Ee(e):Be(e);var t}n.exports=function(e,t){return Me(e,t)}}).call(this,n(35),n(36)(e))},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(s=r,a=btoa(unescape(encodeURIComponent(JSON.stringify(s)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),"/*# ".concat(l," */")),i=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(i).concat([o]).join("\n")}var s,a,l;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i*{margin:0;padding:0}.mainwin-workarea{display:flex;flex:1;flex-direction:row;overflow:auto}#mainwin-toolbar{align-items:center;background:var(--color-toolbar-background);border-bottom:1px solid var(--color-border);display:flex;flex-direction:row;height:36px;margin:0;padding:2px;width:100%}#mainwin-toolbar button{background-color:transparent;background-position:center;background-repeat:no-repeat;border:0;cursor:pointer;height:36px;margin-right:6px;user-select:none;width:36px}#mainwin-toolbar button:hover:not(:disabled){background-color:var(--color-bg-hover)}#mainwin-toolbar button:disabled{cursor:default;opacity:.25}#mainwin-toolbar>.toolbar-separator{border-left:1px solid var(--color-border);height:25px;margin:0 6px 0 0}#mainwin-toolbar :nth-last-child(2){border:0;flex-grow:1}#toolbar-open{background-image:url("+O+")}#toolbar-remove{background-image:url("+G+")}#toolbar-start{background-image:url("+U+")}#toolbar-pause{background-image:url("+Q+")}#toolbar-inspector{background-image:url("+Y+")}#toolbar-overflow{background-color:transparent;background-image:url("+W+");background-position:center;background-size:26px;margin-right:4px;width:36px}#toolbar-overflow.alt-speed-enabled{background-image:url("+J+"),url("+W+");background-position:bottom left,center,center;background-size:16px 9px,26px,26px}.mainwin-filterbar{align-items:center;background:var(--color-toolbar-background);border-bottom:1px solid var(--color-border);display:flex;flex-direction:row;font-size:smaller;width:100%}@media(max-width: 599px){.mainwin-filterbar>:not(select):not(input){display:none}.mainwin-filterbar>input{min-width:50px}.mainwin-filterbar>input,.mainwin-filterbar>select{height:100%}}.mainwin-filterbar>*{padding:0 5px}#torrent-search.blur{color:var(--color-fg-tertiary)}.speed-up-icon{background-image:url("+H+");background-repeat:no-repeat;background-size:12px 12px;height:12px;width:12px}.speed-dn-icon{background-image:url("+q+");background-repeat:no-repeat;background-size:12px 12px;height:12px;width:12px}.flex{flex-grow:1}#torrent-container{flex-grow:1;left:0;margin:0;overflow:auto;-webkit-overflow-scrolling:touch;padding:0;right:0}.torrent-container{background-color:#fff}.torrent-list{cursor:pointer;list-style-type:none;margin:0;padding:0;text-align:left;width:100%}.torrent-list .torrent{border-bottom:1px solid var(--color-border);color:var(--color-fg-secondary);user-select:none}.torrent-list .torrent.paused{color:var(--color-fg-disabled)}.torrent-list .torrent .icon{background-position:center,top left}.torrent-list .torrent .icon[data-icon-mime-type=audio]{background-image:url("+Z+")}.torrent-list .torrent .icon[data-icon-mime-type=audio][data-icon-multifile=true]{background-image:url("+Z+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=application]{background-image:url("+K+")}.torrent-list .torrent .icon[data-icon-mime-type=application][data-icon-multifile=true]{background-image:url("+K+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=font]{background-image:url("+X+")}.torrent-list .torrent .icon[data-icon-mime-type=font][data-icon-multifile=true]{background-image:url("+X+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=image]{background-image:url("+$+")}.torrent-list .torrent .icon[data-icon-mime-type=image][data-icon-multifile=true]{background-image:url("+$+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=model]{background-image:url("+ee+")}.torrent-list .torrent .icon[data-icon-mime-type=model][data-icon-multifile=true]{background-image:url("+ee+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=text]{background-image:url("+te+")}.torrent-list .torrent .icon[data-icon-mime-type=text][data-icon-multifile=true]{background-image:url("+te+"),url("+V+")}.torrent-list .torrent .icon[data-icon-mime-type=video]{background-image:url("+ne+")}.torrent-list .torrent .icon[data-icon-mime-type=video][data-icon-multifile=true]{background-image:url("+ne+"),url("+V+')}.torrent-list .torrent.compact{align-items:center;display:flex;flex-direction:row-reverse}.torrent-list .torrent.compact .icon{background-size:16px,8px;flex-shrink:0;height:16px;width:16px}.torrent-list .torrent.compact>*{margin:4px 5px}.torrent-list .torrent:not(.compact){align-items:center;display:grid;grid-column-gap:12px;grid-template-areas:"icon name" "icon peers" "icon progressbar" "icon progress-text";grid-template-columns:32px 1fr;padding:2px 12px}.torrent-list .torrent:not(.compact) .icon{background-size:32px,16px;grid-area:icon;height:32px;width:32px}.torrent-list .torrent:not(.compact) .torrent-name{grid-area:name}.torrent-list .torrent:not(.compact) .torrent-peer-details{grid-area:peers}.torrent-list .torrent:not(.compact) .torrent-progress{display:flex;flex-direction:row;grid-area:progressbar}.torrent-list .torrent:not(.compact) .torrent-progress-details{grid-area:progress-text}.torrent-list .torrent:not(.compact)>*{margin:1px 0}.torrent-list .torrent.selected{background-color:var(--color-bg-selection-1)}.torrent-list .torrent.selected .torrent-progress-details.error,.torrent-list .torrent.selected .torrent-peer-details.error{color:#fff}.torrent-list .icon{background-position:center;background-repeat:no-repeat}.torrent-list .torrent-pauseresume-button{background-position:center center;background-repeat:no-repeat;background-size:14px;margin-left:7px;width:14px}.torrent-list .torrent-pauseresume-button[data-action=pause]{background-image:url('+re+")}.torrent-list .torrent-pauseresume-button[data-action=pause]:active,.torrent-list .torrent-pauseresume-button[data-action=pause]:hover{background-image:url("+oe+")}.torrent-list .torrent-pauseresume-button[data-action=resume]{background-image:url("+ie+")}.torrent-list .torrent-pauseresume-button[data-action=resume]:active,.torrent-list .torrent-pauseresume-button[data-action=resume]:hover{background-image:url("+se+")}.torrent-list .torrent-progress-details.error,.torrent-list .torrent-peer-details.error{color:var(--color-fg-error)}.torrent-list .torrent-name{font-weight:bold;margin-bottom:2px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.torrent-list .torrent-name.compact{flex:1;font-size:1em;font-weight:normal}.torrent-list .torrent-name:not(.paused){color:var(--color-fg-name)}.torrent-list .torrent-progress-details,.torrent-list .torrent-peer-details{font-size:x-small}.torrent-list .torrent-progress-bar{background-repeat:no-repeat;border-radius:3px;border-style:solid;border-width:1px;height:12px}.torrent-list .torrent-progress-bar.full{flex-grow:1;margin:2px 0}.torrent-list .torrent-progress-bar.compact{min-width:50px;width:50px}.torrent-list .torrent-progress-bar.leech.paused{background:linear-gradient(to bottom, var(--color-progressbar-leech-paused-1), var(--color-progressbar-leech-paused-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.leech.queued{background:linear-gradient(to bottom, var(--color-progressbar-leech-queued-1), var(--color-progressbar-leech-queued-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.leech{background:linear-gradient(to bottom, var(--color-progressbar-leech-1), var(--color-progressbar-leech-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.magnet.paused{background:linear-gradient(to bottom, var(--color-progressbar-magnet-paused-1), var(--color-progressbar-magnet-paused-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.magnet{background:linear-gradient(to bottom, var(--color-progressbar-magnet-1), var(--color-progressbar-magnet-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.seed.paused{background:linear-gradient(to bottom, var(--color-progressbar-seed-paused-1), var(--color-progressbar-seed-paused-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.seed.queued{background:linear-gradient(to bottom, var(--color-progressbar-seed-queued-1), var(--color-progressbar-seed-queued-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.seed{background:linear-gradient(to bottom, var(--color-progressbar-seed-1), var(--color-progressbar-seed-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}.torrent-list .torrent-progress-bar.verify{background:linear-gradient(to bottom, var(--color-progressbar-verify-1), var(--color-progressbar-verify-2) 80%),linear-gradient(to bottom, var(--color-progressbar-background-1), var(--color-progressbar-background-2) 80%);background-repeat:no-repeat}#inspector-tab-info{background-image:url("+ae+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#inspector-tab-info:active,#inspector-tab-info:checked,#inspector-tab-info.selected{background-image:url("+ae+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#inspector-tab-peers{background-image:url("+le+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#inspector-tab-peers:active,#inspector-tab-peers:checked,#inspector-tab-peers.selected{background-image:url("+le+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#inspector-tab-tiers{background-image:url("+ce+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#inspector-tab-tiers:active,#inspector-tab-tiers:checked,#inspector-tab-tiers.selected{background-image:url("+ce+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#inspector-tab-files{background-image:url("+de+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#inspector-tab-files:active,#inspector-tab-files:checked,#inspector-tab-files.selected{background-image:url("+de+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}@media(max-width: 599px){#inspector,#prefs-dialog{left:0}}@media(min-width: 600px){#inspector,#prefs-dialog{border-left:1px solid var(--color-fg-secondary);width:570px}}#prefs-dialog{background:#fff;bottom:0;box-shadow:0 3px 6px rgba(0,0,0,.7);position:absolute;right:0;top:61px;z-index:2}#prefs-dialog .tabs-page{grid-column-gap:8px;grid-row-gap:5px;grid-template-columns:1fr 1fr;margin:20px}#prefs-dialog .tabs-page:not(.hidden){display:grid}#prefs-dialog .tabs-page .section-label{font-weight:bold;grid-column:span 2;margin-left:-20px;padding-bottom:5px}#prefs-dialog .tabs-page .section-label:not(:first-of-type){margin-top:20px}#prefs-dialog .alt-speed-section-label{background:transparent url("+J+") no-repeat;background-position:left 4px;padding-left:22px}#prefs-dialog :disabled,#prefs-dialog .disabled{color:var(--color-fg-disabled)}#prefs-dialog #alt-times-div,#prefs-dialog #autostart-div,#prefs-dialog #port-forwarding,#prefs-dialog #randomize-port,#prefs-dialog #suffix-div,#prefs-dialog #use-dht-div,#prefs-dialog #use-lpd-div,#prefs-dialog #use-pex-div,#prefs-dialog #utp-enabled,#prefs-dialog .alt-speed-label{grid-column:span 2}#prefs-dialog .blocklist-size-label,#prefs-dialog .blocklist-update-button,#prefs-dialog .port-status{grid-column:2/3}#prefs-dialog .blocklist-size-label{font-size:smaller}#prefs-dialog .blocklist-size-number{font-weight:bolder}#prefs-dialog .port-status-label{display:inline-block;font-weight:bold;margin-left:5px}#prefs-dialog .port-status-label[data-open=true]{color:var(--color-fg-port-open)}#prefs-dialog .port-status-label[data-open=false]{color:var(--color-fg-port-closed)}#prefs-dialog .alt-speed-label{font-size:smaller;font-style:lighter;margin:-10px 0 10px -20px}#prefs-dialog.ui-tabs .ui-tabs-panel{padding:0;user-select:none}.prefs-section{text-align:left}.prefs-section>*{padding:0 8px 8px}.prefs-section .title{font-size:larger;font-weight:bold;padding-left:0}.prefs-section .row .key{float:left;padding-top:3px}.prefs-section .row .key>*{margin-left:0}.prefs-section .row .value{margin-left:150px}.prefs-section .row .value>*{width:100%}.prefs-section .checkbox-row>input{margin:0}.prefs-section .checkbox-row>label{margin-left:5px}.prefs-section #alternative-speed-limits-title{background:transparent url("+J+") no-repeat;padding-left:18px}.prefs-section #alternative-speed-limits-desc{font-size:smaller;padding-bottom:4px}.tabs-container{align-items:stretch;background:#fff;border-left:solid 1px var(--color-border);bottom:0;display:flex;flex-direction:column;position:absolute;right:0;top:61px;z-index:2}@media(max-width: 599px){.tabs-container{left:0}}@media(min-width: 600px){.tabs-container{width:550px}}.tabs-buttons{align-self:center;display:flex;padding:10px}.tabs-buttons button{border:1px solid var(--color-border);cursor:pointer;display:inline-block;padding:3px;user-select:none;appearance:none;padding:3px}.file-priority-radiobox :first-child,.tabs-buttons :first-child{border-bottom-left-radius:8px;border-top-left-radius:8px}.file-priority-radiobox :last-child,.tabs-buttons :last-child{border-bottom-right-radius:8px;border-top-right-radius:8px}.tabs-pages{box-sizing:border-box;flex:1;overflow-x:hidden;overflow-y:auto}@media(max-width: 599px){.tabs-pages{padding:0 8px 20px}}@media(min-width: 600px){.tabs-pages{padding:0 20px 20px}}.tabs-button{background-position:center;background-repeat:no-repeat}#inspector{box-shadow:0 3px 6px rgba(0,0,0,.7)}.inspector-info-page{grid-column-gap:8px;grid-row-gap:5px;grid-template-columns:auto 1fr;margin:20px;padding:12px}.inspector-info-page:not(.hidden){display:grid}.inspector-info-page .section-label{font-weight:bold;grid-column:span 2;margin-left:-20px;padding-bottom:5px}.inspector-info-page .section-label:not(:first-of-type){margin-top:20px}.inspector-info-page :not(.section-label){overflow-x:hidden;text-overflow:ellipsis}#inspector .tabs-button,#prefs-dialog .tabs-button{background-size:20px 20px,40px 30px;height:30px;margin:0;padding:0;width:40px}#prefs-tab-torrent{background-image:url("+Ae+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#prefs-tab-torrent:active,#prefs-tab-torrent:checked,#prefs-tab-torrent.selected{background-image:url("+Ae+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#prefs-tab-speed{background-image:url("+pe+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#prefs-tab-speed:active,#prefs-tab-speed:checked,#prefs-tab-speed.selected{background-image:url("+pe+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#prefs-tab-peers{background-image:url("+le+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#prefs-tab-peers:active,#prefs-tab-peers:checked,#prefs-tab-peers.selected{background-image:url("+le+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#prefs-tab-network{background-image:url("+ue+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}#prefs-tab-network:active,#prefs-tab-network:checked,#prefs-tab-network.selected{background-image:url("+ue+'),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}#inspector-file-list{margin:0;padding:0}#inspector-file-list .inspector-torrent-file-list-entry{display:grid;grid-column-gap:5px;grid-template-areas:"check name priority" "blank1 info blank2";grid-template-columns:20px 1fr 65px;margin-bottom:4px;padding:5px}#inspector-file-list .inspector-torrent-file-list-entry.skip{opacity:.5}#inspector-file-list .file-wanted-control{grid-area:check}#inspector-file-list .inspector-torrent-file-list-entry-name{color:var(--color-fg-name);cursor:pointer;grid-area:name;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#inspector-file-list .inspector-torrent-file-list-entry.skip>.inspector-torrent-file-list-entry-name{color:var(--color-fg-disabled)}#inspector-file-list .inspector-torrent-file-list-entry-progress{color:var(--color-fg-secondary);grid-area:info}#inspector-file-list .single-file .inspector-torrent-file-list-entry>.file-wanted-control,#inspector-file-list .inspector-torrent-file-list-entry.complete>.file-wanted-control{cursor:default}#inspector-header{margin:8px 0}#torrent-inspector-name{font-size:large;font-weight:bold}#inspector-tiers-list{color:var(--color-fg-secondary);margin:0 10px;padding:0 12px}#inspector-tiers-list .tier-list-row{display:grid;grid-column-gap:8px;grid-row-gap:4px;margin-top:8px}#inspector-tiers-list .tier-list-torrent{color:var(--color-fg-primary);font-size:larger;font-weight:bolder;margin-left:-12px;overflow-x:hidden;padding-top:20px;text-overflow:ellipsis;white-space:nowrap}#inspector-tiers-list .tier-list-tracker{font-weight:bolder;grid-column:span 2;margin-top:8px;padding-bottom:4px}#inspector-tiers-list .tier-announce,#inspector-tiers-list .tier-scrape,#inspector-tiers-list .tier-state{text-align:left}#inspector-tiers-list .tier-downloads,#inspector-tiers-list .tier-leechers,#inspector-tiers-list .tier-seeders{text-align:right}.peer-list{border:1px solid #f6f8fa;border-collapse:collapse;cursor:default;table-layout:fixed;text-align:left;width:100%}.peer-list td,.peer-list th{font-size:smaller;padding:5px}.peer-list td{border:1px solid #f6f8fa;color:var(--color-fg-secondary)}.peer-list .torrent-row td{background:#f6f8fa;color:var(--color-fg-primary);font-size:normal;font-weight:bolder;overflow-x:hidden;padding:10px;text-overflow:ellipsis;white-space:nowrap}.peer-list .encryption{width:16px}.peer-list .encryption[data-encrypted=true]{background:transparent url('+ge+") center center no-repeat;height:16px;width:16px}.peer-list .peer-address,.peer-list .percent-done,.peer-list .speed-down,.peer-list .speed-up{text-align:right}.peer-list .percent-done{width:10%}.peer-list .speed-down,.peer-list .speed-up{width:15%}.peer-list .peer-address{width:25%}.peer-list .peer-app-name{overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}@media(max-width: 599px){.peer-list .peer-app-name{display:none}}@media(min-width: 600px){.peer-list .peer-app-name{width:25%}}.peer-list .status{cursor:pointer}.file-priority-radiobox{grid-area:priority}.file-priority-radiobox>*{border:1px solid var(--color-border);cursor:pointer;display:inline-block;padding:3px;user-select:none;appearance:none;background-position:center;background-repeat:no-repeat;background-size:10px,20px;height:20px;margin:0;padding:0;width:20px}.file-priority-radiobox>.low{background-image:url("+q+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2));border-right-width:0}.file-priority-radiobox>.low:active,.file-priority-radiobox>.low:checked,.file-priority-radiobox>.low.selected{background-image:url("+q+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}.file-priority-radiobox>.normal{background-image:url("+me+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2))}.file-priority-radiobox>.normal:active,.file-priority-radiobox>.normal:checked,.file-priority-radiobox>.normal.selected{background-image:url("+me+"),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}.file-priority-radiobox>.high{background-image:url("+H+"),linear-gradient(var(--color-tab-deselected-1), var(--color-tab-deselected-2));border-left-width:0}.file-priority-radiobox>.high:active,.file-priority-radiobox>.high:checked,.file-priority-radiobox>.high.selected{background-image:url("+H+'),linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2))}.context-menu{background:var(--color-bg-menu);box-shadow:0 3px 6px rgba(0,0,0,.7);position:absolute;z-index:2}.context-menu .context-menuitem{list-style:none;padding:5px 10px}.context-menu .context-menuitem:hover:not(:disabled),.context-menu .context-menuitem:focus:not(:disabled){background-image:linear-gradient(#fff, var(--color-bg-menu));cursor:pointer}.context-menu .context-menuitem:disabled{color:var(--color-fg-disabled);cursor:none}.context-menu-separator{border-bottom:1px solid var(--color-fg-secondary);margin-bottom:10px;padding-bottom:10px}.overflow-menu{background:linear-gradient(160deg, #d21, 1%, var(--color-bg-hover), 40%, var(--color-bg-menu));border-radius:8px;box-shadow:0 3px 6px rgba(0,0,0,.7);padding:20px;position:fixed;width:200px;z-index:2}.overflow-menu fieldset{border:0;margin-bottom:8px;padding:0}.overflow-menu>.actions,.overflow-menu>.info,.overflow-menu>.links{display:flex;flex-direction:column}.overflow-menu legend{font-weight:bolder;margin-bottom:4px}.overflow-menu legend~*{margin-left:12px}.overflow-menu a,.overflow-menu button,.overflow-menu label{color:var(--color-fg-primary);font-size:1em}.overflow-menu a:disabled,.overflow-menu button:disabled,.overflow-menu label:disabled{color:var(--color-fg-disabled);cursor:default}.overflow-menu a:focus:not(:disabled),.overflow-menu a:hover:not(:disabled),.overflow-menu button:focus:not(:disabled),.overflow-menu button:hover:not(:disabled),.overflow-menu label:focus:not(:disabled),.overflow-menu label:hover:not(:disabled){background-color:var(--color-bg-hover)}.overflow-menu a,.overflow-menu button{background:transparent;border:0;cursor:pointer;display:block;padding:4px 0;text-align:left;text-decoration:none;width:150px}.overflow-menu .input-and-label{align-items:center;display:inline-flex;flex-direction:row}.overflow-menu #display-options>*{align-items:center;display:inline-flex;flex-direction:row}.overflow-menu #display-options>*>*{margin:4px}.overflow-menu #display-options>* :first-child{margin-left:0}.overflow-menu #display-options>* :last-child{margin-right:0}.overflow-menu #speed-options{display:flex;flex-direction:column}.overflow-menu #speed-options>.speed-up,.overflow-menu #speed-options>.speed-down{align-items:center;display:flex;flex-direction:row;padding:4px 0}.overflow-menu #speed-options>.speed-up>label,.overflow-menu #speed-options>.speed-down>label{overflow:hidden;width:80px}.overflow-menu #speed-options .alt-speed{display:grid;grid-column-gap:5px;grid-row-gap:5px;grid-template-areas:"check lb" "turtle values";grid-template-columns:20px 1fr;margin-bottom:4px}.overflow-menu #speed-options #alt-speed-check{grid-area:check}.overflow-menu #speed-options #alt-speed-check:checked~#alt-speed-image{background-image:url('+J+")}.overflow-menu #speed-options #alt-speed-check:not(:checked)~#alt-speed-image{background-image:url("+he+')}.overflow-menu #speed-options #alt-speed-image{background-position:center;background-repeat:no-repeat;grid-area:turtle}.overflow-menu #speed-options #alt-speed-label{grid-area:lb}.overflow-menu #speed-options #alt-speed-values-label{font-size:small;grid-area:values}@media(min-width: 600px){#display-fullscreen-check,#display-fullscreen-label{display:none}}@media(max-width: 599px){.dialog-buttons{padding-top:13.3333333333px}.dialog-container{opacity:96%;position:absolute;top:61px;width:100%}.dialog-logo{padding-bottom:13.3333333333px}.dialog-window{align-items:center;display:flex;flex-direction:column}}@media(min-width: 600px){.dialog-container{left:50%;min-width:400px;position:absolute;top:122px;transform:translateX(-50%)}.dialog-heading{grid-area:heading}.dialog-logo{grid-area:icon;padding-right:13.3333333333px}.dialog-window{display:grid;grid-column-gap:12px;grid-template-areas:"icon heading" "icon message" "icon workarea" "icon buttons";grid-template-columns:64px 1fr;padding:2px 12px}}.dialog-buttons{display:flex;float:right;grid-area:buttons;margin:10px 0 0;text-align:center}.dialog-buttons button{appearance:none;background:transparent;border:1px solid var(--color-border);border-radius:5px;color:var(--color-fg-name);margin-left:8px;padding:8px;text-decoration:none}.dialog-buttons a:hover,.dialog-buttons a:active{background:linear-gradient(#fff, var(--color-bg-menu))}.dialog-buttons-begin{flex-grow:1}.dialog-buttons-end{display:none}.dialog-container{border:0;box-shadow:0 3px 6px rgba(0,0,0,.7);color:var(--color-fg-primary);display:block;margin:0;padding:0;z-index:2}.dialog-heading{align-items:center;display:flex;font-size:1.2em;font-weight:bold}.dialog-logo{background:transparent url('+fe+") top left no-repeat;height:64px;width:64px}.dialog-message{grid-area:message;margin:10px 0 0}.dialog-window{background:linear-gradient(160deg, #d21, 1%, #f7f7f7, 40%, #ccc);height:100%;padding:20px}.dialog-workarea{display:flex;flex-direction:column;grid-area:workarea;margin:10px 0 0}.dialog-workarea>*{margin-bottom:5px}.about-dialog .dialog-workarea>*{margin-bottom:10px}.about-dialog-version-number{margin-left:4px}.about-dialog-version-checksum{font-size:small;font-style:italic;font-weight:normal;margin-left:auto;padding-left:10px}.shortcuts-dialog table{border-collapse:collapse;width:100%}.shortcuts-dialog th,.shortcuts-dialog td{border:1px solid var(--color-border);padding:5px 10px}#torrent-rename-name{min-width:400px}#move-container #torrent-path{min-width:400px}.tabs-pages .content,.inspector-info-page .content,.statistics-dialog .content{column-gap:16px;display:grid;grid-row-gap:6px;grid-template-columns:auto 1fr;margin-top:4px}@media(max-width: 599px){.tabs-pages .content,.inspector-info-page .content,.statistics-dialog .content{margin:4px 0 16px}}@media(min-width: 600px){.tabs-pages .content,.inspector-info-page .content,.statistics-dialog .content{margin:4px 16px 16px}}.tabs-pages .content div,.inspector-info-page .content div,.statistics-dialog .content div{word-break:break-word}.tabs-pages fieldset,.inspector-info-page fieldset,.statistics-dialog fieldset{border:0;margin:0;padding:0}.tabs-pages legend,.inspector-info-page legend,.statistics-dialog legend{font-weight:bolder;margin-bottom:4px}#free-space-text{display:inline-block;float:right;font-size:smaller;font-style:italic}#torrent-upload-frame{border:0;display:block;height:0;left:-1000px;margin:0;padding:0;position:absolute;top:-1000px;width:0}.ui-menu{width:200px}","",{version:3,sources:["webpack://style/transmission-app.scss"],names:[],mappings:"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",sourcesContent:["@use 'sass:color';\n@use 'sass:math';\n\n// Color palette recycled from GitHub Primer.\n// Please use those values if you need to add colors.\n// https://primer.style/css/support/color-system\n$blue-100: #dbedff;\n$blue-200: #c8e1ff;\n$blue-300: #79b8ff;\n$blue-700: #044289;\n$green-100: #dcffe4;\n$green-200: #bef5cb;\n$green-300: #85e89d;\n$green-500: #28a745;\n$green-700: #176f2c;\n$grey-100: #f6f8fa;\n$grey-200: #e1e4e8;\n$grey-300: #d1d5da;\n$grey-400: #959da5;\n$grey-500: #6a737d;\n$grey-800: #2f363d;\n$pink-300: #f692ce;\n$pink-700: #b93a86;\n$purple-000: #f5f0ff;\n$purple-100: #e6dcfd;\n$red-500: #d73a49;\n$white: #fff;\n$yellow-200: #fff5b1;\n$yellow-300: #ffea7f;\n$yellow-700: #dbab09;\n\n// Z-INDEX ENUM\n// $z-index-progressbar: 1;\n$z-index-popup: 2;\n\n// SVG ICONS -- see images/README.md for sources and license details\n// Are you a designer? New icon PRs welcomed!\n$image-analytics: 'images/analytics.svg';\n$image-baseline: 'images/horizontal-rule.svg';\n$image-files: 'images/files.svg';\n$image-chevron-dn: 'images/chevron-down.svg';\n$image-chevron-up: 'images/chevron-up.svg';\n$image-lock-fill: 'images/lock-fill.svg';\n$image-network: 'images/router.svg';\n$image-overflow: 'images/three-dots-vertical.svg';\n$image-pause-circle-active: 'images/pause-circle-active.svg';\n$image-pause-circle-idle: 'images/pause-circle-idle.svg';\n$image-peers: 'images/team.svg';\n$image-play-circle-active: 'images/play-circle-active.svg';\n$image-play-circle-idle: 'images/play-circle-idle.svg';\n$image-speed: 'images/checkered-flag.svg';\n$image-tiers: 'images/diagram-3-fill.svg';\n$image-upload-download: 'images/up-and-down-arrows.svg';\n\n@mixin for-phone-only {\n @media (max-width: 599px) {\n @content;\n }\n}\n@mixin for-tablet-portrait-up {\n @media (min-width: 600px) {\n @content;\n }\n}\n// @mixin for-tablet-landscape-up {media (min-width: 900px) { @content; }}\n// @mixin for-desktop-up {@media (min-width: 1200px) { @content; }}\n// @mixin for-big-desktop-up {@media (min-width: 1800px) { @content; }}\n\n/// MIXINS\n\n@mixin image-on-vertical-gradient($src, $topColor, $bottomColor) {\n background-image: url($src), linear-gradient($topColor, $bottomColor);\n}\n\n@mixin button {\n border: 1px solid var(--color-border);\n cursor: pointer;\n display: inline-block;\n padding: 3px;\n user-select: none;\n}\n\n@mixin rounded-box($radius) {\n border-radius: $radius;\n}\n\n@mixin rounded-button($radius) {\n @include button;\n border-radius: $radius;\n}\n\n/// GLOBAL\n\n:root {\n --color-bg-even: #{$white};\n --color-bg-hover: #{$grey-100};\n --color-bg-menu: #{$grey-200};\n --color-bg-odd: #{$grey-100};\n --color-bg-selection-1: #{$purple-100};\n --color-bg-selection-2: #{$purple-000};\n --color-border: #{$grey-400};\n --color-fg-disabled: #{$grey-400};\n --color-fg-error: #{$red-500};\n --color-fg-name: #{$grey-800};\n --color-fg-port-closed: #{$red-500};\n --color-fg-port-open: #{$green-500};\n @media (prefers-color-scheme: dark) {\n --color-fg-primary: #{$grey-100};\n --color-fg-secondary: #{$grey-400};\n --color-fg-tertiary: #{$grey-500};\n }\n @media (prefers-color-scheme: light) {\n --color-fg-primary: #{$grey-800};\n --color-fg-secondary: #{$grey-500};\n --color-fg-tertiary: #{$grey-400};\n }\n --color-progressbar-background-1: #{$grey-100};\n --color-progressbar-background-2: #{$grey-400};\n --color-progressbar-verify-1: #{$pink-300};\n --color-progressbar-verify-2: #{$pink-700};\n --color-progressbar-magnet-1: #{$yellow-300};\n --color-progressbar-magnet-2: #{$yellow-700};\n --color-progressbar-magnet-paused-1: #{$yellow-200};\n --color-progressbar-magnet-paused-2: #{$grey-500};\n --color-progressbar-leech-paused-1: #{$blue-200};\n --color-progressbar-leech-paused-2: #{$grey-500};\n --color-progressbar-leech-queued-1: #{$blue-100};\n --color-progressbar-leech-queued-2: #{$blue-300};\n --color-progressbar-leech-1: #{$blue-300};\n --color-progressbar-leech-2: #{$blue-700};\n --color-progressbar-seed-paused-1: #{$green-200};\n --color-progressbar-seed-paused-2: #{$grey-500};\n --color-progressbar-seed-queued-1: #{$green-100};\n --color-progressbar-seed-queued-2: #{$green-300};\n --color-progressbar-seed-1: #{$green-300};\n --color-progressbar-seed-2: #{$green-700};\n --color-tab-deselected-1: #{$grey-100};\n --color-tab-deselected-2: #{$grey-400};\n --color-tab-selected-1: #{$purple-100};\n --color-tab-selected-2: #{$purple-000};\n --color-toolbar-background: linear-gradient(#{$grey-300}, #{$grey-400});\n}\n\nhtml,\nbody {\n color: var(--color-fg-primary);\n font-family: Verdana, Arial, Helvetica, sans-serif;\n height: 100%;\n margin: 0;\n overflow: hidden;\n}\n\nimg {\n border: 0;\n}\n\na {\n outline: 0;\n}\n\n.hidden {\n display: none;\n}\n\n.even {\n background-color: var(--color-bg-even);\n}\n.odd {\n background-color: var(--color-bg-odd);\n}\n\n.mainwin {\n display: flex;\n flex-direction: column;\n height: 100%;\n position: relative;\n\n > * {\n margin: 0;\n padding: 0;\n }\n}\n\n.mainwin-workarea {\n display: flex;\n flex: 1;\n flex-direction: row;\n overflow: auto;\n}\n\n/// TOOLBAR\n\n$toolbar-height-number: 36;\n$toolbar-height: $toolbar-height-number * 1px;\n\n#mainwin-toolbar {\n align-items: center;\n background: var(--color-toolbar-background);\n border-bottom: 1px solid var(--color-border);\n display: flex;\n flex-direction: row;\n height: $toolbar-height;\n margin: 0;\n padding: 2px;\n width: 100%;\n\n button {\n background-color: transparent;\n background-position: center;\n background-repeat: no-repeat;\n border: 0;\n cursor: pointer;\n height: $toolbar-height;\n margin-right: 6px;\n user-select: none;\n width: $toolbar-height;\n\n &:hover:not(:disabled) {\n background-color: var(--color-bg-hover);\n }\n\n &:disabled {\n cursor: default;\n opacity: 0.25;\n }\n }\n\n > .toolbar-separator {\n border-left: 1px solid var(--color-border);\n height: 25px;\n margin: 0 6px 0 0;\n }\n\n :nth-last-child(2) {\n border: 0;\n flex-grow: 1;\n }\n}\n\n#toolbar-open {\n background-image: url('images/toolbar-folder.png');\n}\n\n#toolbar-remove {\n background-image: url('images/toolbar-close.png');\n}\n\n#toolbar-start {\n background-image: url('images/toolbar-start.png');\n}\n\n#toolbar-pause {\n background-image: url('images/toolbar-pause.png');\n}\n\n#toolbar-inspector {\n background-image: url('images/toolbar-info.png');\n}\n\n#toolbar-overflow {\n background-color: transparent;\n background-image: url($image-overflow);\n background-position: center;\n background-size: 26px;\n margin-right: 4px;\n width: 36px;\n\n &.alt-speed-enabled {\n background-image: url('images/blue-turtle.png'), url($image-overflow);\n background-position: bottom left, center, center;\n background-size: 16px 9px, 26px, 26px;\n }\n}\n\n/// FILTERBAR\n\n// $filterbar-height-number: 30;\n// $filterbar-height: $filterbar-height-number * 1px;\n\n.mainwin-filterbar {\n align-items: center;\n background: var(--color-toolbar-background);\n border-bottom: 1px solid var(--color-border);\n display: flex;\n flex-direction: row;\n font-size: smaller;\n // height: $filterbar-height;\n width: 100%;\n\n @include for-phone-only {\n > :not(select):not(input) {\n display: none;\n }\n > input {\n min-width: 50px;\n }\n > input,\n > select {\n height: 100%;\n }\n }\n\n > * {\n padding: 0 5px;\n }\n}\n\n#torrent-search {\n &.blur {\n color: var(--color-fg-tertiary);\n }\n}\n\n$speed-icon-size: 12px;\n\n.speed-up-icon {\n background-image: url($image-chevron-up);\n background-repeat: no-repeat;\n background-size: $speed-icon-size $speed-icon-size;\n height: $speed-icon-size;\n width: $speed-icon-size;\n}\n\n.speed-dn-icon {\n background-image: url($image-chevron-dn);\n background-repeat: no-repeat;\n background-size: $speed-icon-size $speed-icon-size;\n height: $speed-icon-size;\n width: $speed-icon-size;\n}\n\n/// TORRENT CONTAINER\n\n$pauseresume-size-number: 14;\n$pauseresume-size: $pauseresume-size-number * 1px;\n$progressbar-border-number: 1;\n$progressbar-height-number: 14;\n$popup-top: 61px; // TODO: ugly that this is hardcoded\n\n.flex {\n flex-grow: 1;\n}\n\n#torrent-container {\n flex-grow: 1;\n left: 0;\n margin: 0;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n padding: 0;\n right: 0;\n}\n\n.torrent-container {\n background-color: $white;\n}\n\n.torrent-list {\n $app-image: 'images/application-x-executable.png';\n $audio-image: 'images/audio-x-generic.png';\n $folder-image: 'images/folder.png';\n $font-image: 'images/font-x-generic.png';\n $image-image: 'images/image-x-generic.png';\n $package-image: 'images/package-x-generic.png';\n $text-image: 'images/folder.png';\n $text-image: 'images/text-x-generic.png';\n $video-image: 'images/video-x-generic.png';\n\n cursor: pointer;\n list-style-type: none;\n margin: 0;\n padding: 0;\n text-align: left;\n width: 100%;\n\n .torrent {\n border-bottom: 1px solid var(--color-border);\n color: var(--color-fg-secondary);\n user-select: none;\n\n &.paused {\n color: var(--color-fg-disabled);\n }\n\n .icon {\n background-position: center, top left;\n\n @mixin mime-icon-compact($mime-icon) {\n background-image: url($mime-icon);\n\n &[data-icon-multifile='true'] {\n background-image: url($mime-icon), url($folder-image);\n }\n }\n\n &[data-icon-mime-type='audio'] {\n @include mime-icon-compact($audio-image);\n }\n\n &[data-icon-mime-type='application'] {\n @include mime-icon-compact($app-image);\n }\n\n &[data-icon-mime-type='font'] {\n @include mime-icon-compact($font-image);\n }\n\n &[data-icon-mime-type='image'] {\n @include mime-icon-compact($image-image);\n }\n\n &[data-icon-mime-type='model'] {\n @include mime-icon-compact($package-image);\n }\n\n &[data-icon-mime-type='text'] {\n @include mime-icon-compact($text-image);\n }\n\n &[data-icon-mime-type='video'] {\n @include mime-icon-compact($video-image);\n }\n }\n\n &.compact {\n $icon-size-num: 16;\n $icon-size: $icon-size-num * 1px;\n\n align-items: center;\n display: flex;\n flex-direction: row-reverse;\n\n .icon {\n background-size: $icon-size, $icon-size-num * 0.5px;\n flex-shrink: 0;\n height: $icon-size;\n width: $icon-size;\n }\n\n > * {\n margin: 4px 5px;\n }\n }\n\n &:not(.compact) {\n $icon-size-num: 32;\n $icon-size: $icon-size-num * 1px;\n align-items: center;\n display: grid;\n grid-column-gap: 12px;\n grid-template-areas:\n 'icon name'\n 'icon peers'\n 'icon progressbar'\n 'icon progress-text';\n grid-template-columns: $icon-size 1fr;\n padding: 2px 12px;\n\n .icon {\n background-size: $icon-size, $icon-size-num * 0.5px;\n grid-area: icon;\n height: $icon-size;\n width: $icon-size;\n }\n\n .torrent-name {\n grid-area: name;\n }\n\n .torrent-peer-details {\n grid-area: peers;\n }\n\n .torrent-progress {\n display: flex;\n flex-direction: row;\n grid-area: progressbar;\n }\n\n .torrent-progress-details {\n grid-area: progress-text;\n }\n\n > * {\n margin: 1px 0;\n }\n }\n\n &.selected {\n background-color: var(--color-bg-selection-1);\n }\n\n &.selected .torrent-progress-details.error,\n &.selected .torrent-peer-details.error {\n color: $white;\n }\n }\n\n .icon {\n background-position: center;\n background-repeat: no-repeat;\n }\n\n .torrent-pauseresume-button {\n background-position: center center;\n background-repeat: no-repeat;\n background-size: $pauseresume-size;\n margin-left: math.floor($pauseresume-size-number / 2) * 1px;\n width: $pauseresume-size;\n\n &[data-action='pause'] {\n background-image: url($image-pause-circle-idle);\n &:active,\n &:hover {\n background-image: url($image-pause-circle-active);\n }\n }\n &[data-action='resume'] {\n background-image: url($image-play-circle-idle);\n &:active,\n &:hover {\n background-image: url($image-play-circle-active);\n }\n }\n }\n\n .torrent-progress-details.error,\n .torrent-peer-details.error {\n color: var(--color-fg-error);\n }\n\n .torrent-name {\n font-weight: bold;\n margin-bottom: 2px;\n margin-top: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n &.compact {\n flex: 1;\n font-size: 1em;\n font-weight: normal;\n }\n\n &:not(.paused) {\n color: var(--color-fg-name);\n }\n }\n\n .torrent-progress-details,\n .torrent-peer-details {\n font-size: x-small;\n }\n\n .torrent-progress-bar {\n background-repeat: no-repeat;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n height: ($progressbar-height-number - ($progressbar-border-number * 2)) *\n 1px;\n\n &.full {\n flex-grow: 1;\n margin: 2px 0;\n }\n &.compact {\n min-width: 50px;\n width: 50px;\n }\n\n @function progressbar-gradient($color1, $color2) {\n @return linear-gradient(to bottom, $color1, $color2 80%);\n }\n\n @mixin progressbar-background($color1, $color2) {\n background: progressbar-gradient($color1, $color2),\n progressbar-gradient(\n var(--color-progressbar-background-1),\n var(--color-progressbar-background-2)\n );\n background-repeat: no-repeat;\n }\n\n &.leech.paused {\n @include progressbar-background(\n var(--color-progressbar-leech-paused-1),\n var(--color-progressbar-leech-paused-2)\n );\n }\n &.leech.queued {\n @include progressbar-background(\n var(--color-progressbar-leech-queued-1),\n var(--color-progressbar-leech-queued-2)\n );\n }\n &.leech {\n @include progressbar-background(\n var(--color-progressbar-leech-1),\n var(--color-progressbar-leech-2)\n );\n }\n &.magnet.paused {\n @include progressbar-background(\n var(--color-progressbar-magnet-paused-1),\n var(--color-progressbar-magnet-paused-2)\n );\n }\n &.magnet {\n @include progressbar-background(\n var(--color-progressbar-magnet-1),\n var(--color-progressbar-magnet-2)\n );\n }\n &.seed.paused {\n @include progressbar-background(\n var(--color-progressbar-seed-paused-1),\n var(--color-progressbar-seed-paused-2)\n );\n }\n &.seed.queued {\n @include progressbar-background(\n var(--color-progressbar-seed-queued-1),\n var(--color-progressbar-seed-queued-2)\n );\n }\n &.seed {\n @include progressbar-background(\n var(--color-progressbar-seed-1),\n var(--color-progressbar-seed-2)\n );\n }\n &.verify {\n @include progressbar-background(\n var(--color-progressbar-verify-1),\n var(--color-progressbar-verify-2)\n );\n }\n }\n}\n\n/// PREFERENCES DIALOG\n\n@mixin tab-image($image-url) {\n background-image: url($image-url),\n linear-gradient(\n var(--color-tab-deselected-1),\n var(--color-tab-deselected-2)\n );\n\n &:active,\n &:checked,\n &.selected {\n background-image: url($image-url),\n linear-gradient(var(--color-tab-selected-1), var(--color-tab-selected-2));\n }\n}\n\n#inspector-tab-info {\n @include tab-image($image-analytics);\n}\n\n#inspector-tab-peers {\n @include tab-image($image-peers);\n}\n\n#inspector-tab-tiers {\n @include tab-image($image-tiers);\n}\n\n#inspector-tab-files {\n @include tab-image($image-files);\n}\n\n#inspector,\n#prefs-dialog {\n @include for-phone-only {\n left: 0;\n }\n @include for-tablet-portrait-up {\n border-left: 1px solid var(--color-fg-secondary);\n width: 570px;\n }\n}\n\n#prefs-dialog {\n $background-color: $white;\n\n background: $background-color;\n bottom: 0;\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);\n position: absolute;\n right: 0;\n top: $popup-top;\n z-index: $z-index-popup;\n\n .tabs-page {\n grid-column-gap: 8px;\n grid-row-gap: 5px;\n grid-template-columns: 1fr 1fr;\n margin: 20px;\n\n &:not(.hidden) {\n display: grid;\n }\n\n .section-label {\n font-weight: bold;\n grid-column: span 2;\n margin-left: -20px;\n padding-bottom: 5px;\n\n &:not(:first-of-type) {\n margin-top: 20px;\n }\n }\n }\n\n .alt-speed-section-label {\n background: transparent url('images/blue-turtle.png') no-repeat;\n background-position: left 4px;\n padding-left: 22px;\n }\n\n :disabled,\n .disabled {\n color: var(--color-fg-disabled);\n }\n\n #alt-times-div,\n #autostart-div,\n #port-forwarding,\n #randomize-port,\n #suffix-div,\n #use-dht-div,\n #use-lpd-div,\n #use-pex-div,\n #utp-enabled,\n .alt-speed-label {\n grid-column: span 2;\n }\n\n .blocklist-size-label,\n .blocklist-update-button,\n .port-status {\n grid-column: 2 / 3;\n }\n\n .blocklist-size-label {\n font-size: smaller;\n }\n .blocklist-size-number {\n font-weight: bolder;\n }\n\n .port-status-label {\n display: inline-block;\n font-weight: bold;\n margin-left: 5px;\n &[data-open='true'] {\n color: var(--color-fg-port-open);\n }\n &[data-open='false'] {\n color: var(--color-fg-port-closed);\n }\n }\n\n .alt-speed-label {\n font-size: smaller;\n font-style: lighter;\n // nudge it up next to the section label\n margin: -10px 0 10px -20px;\n }\n}\n\n#prefs-dialog.ui-tabs .ui-tabs-panel {\n padding: 0;\n user-select: none;\n}\n\n.prefs-section {\n text-align: left;\n\n > * {\n padding: 0 8px 8px;\n }\n\n .title {\n font-size: larger;\n font-weight: bold;\n padding-left: 0;\n }\n\n .row {\n .key {\n float: left;\n padding-top: 3px;\n\n > * {\n margin-left: 0;\n }\n }\n\n .value {\n margin-left: 150px;\n\n > * {\n width: 100%;\n }\n }\n }\n\n .checkbox-row {\n > input {\n margin: 0;\n }\n\n > label {\n margin-left: 5px;\n }\n }\n\n #alternative-speed-limits-title {\n background: transparent url('images/blue-turtle.png') no-repeat;\n padding-left: 18px;\n }\n\n #alternative-speed-limits-desc {\n font-size: smaller;\n padding-bottom: 4px;\n }\n}\n\n/// TABS\n\n.tabs-container {\n align-items: stretch;\n background: $white;\n border-left: solid 1px var(--color-border);\n bottom: 0;\n display: flex;\n flex-direction: column;\n position: absolute;\n right: 0;\n top: $popup-top;\n z-index: $z-index-popup;\n @include for-phone-only {\n left: 0;\n }\n @include for-tablet-portrait-up {\n width: 550px;\n }\n}\n\n.tabs-buttons {\n align-self: center;\n display: flex;\n padding: 10px;\n\n button {\n @include button;\n appearance: none;\n padding: 3px;\n }\n}\n\n.file-priority-radiobox,\n.tabs-buttons {\n $radius: 8px;\n :first-child {\n border-bottom-left-radius: $radius;\n border-top-left-radius: $radius;\n }\n :last-child {\n border-bottom-right-radius: $radius;\n border-top-right-radius: $radius;\n }\n}\n\n.tabs-pages {\n box-sizing: border-box;\n flex: 1;\n overflow-x: hidden;\n overflow-y: auto;\n @include for-phone-only {\n padding: 0 8px 20px;\n }\n @include for-tablet-portrait-up {\n padding: 0 20px 20px;\n }\n}\n\n.tabs-button {\n background-position: center;\n background-repeat: no-repeat;\n}\n\n/// INSPECTOR\n\n#inspector {\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);\n}\n\n.inspector-info-page {\n // TODO: this is (mostly) copied from prefs-dialog.\n // can it be folded into a single set of rules?\n\n grid-column-gap: 8px;\n grid-row-gap: 5px;\n grid-template-columns: auto 1fr;\n margin: 20px;\n padding: 12px;\n\n &:not(.hidden) {\n display: grid;\n }\n\n .section-label {\n font-weight: bold;\n grid-column: span 2;\n margin-left: -20px;\n padding-bottom: 5px;\n\n &:not(:first-of-type) {\n margin-top: 20px;\n }\n }\n\n :not(.section-label) {\n // this section is not copied\n overflow-x: hidden;\n text-overflow: ellipsis;\n }\n}\n\n#inspector .tabs-button,\n#prefs-dialog .tabs-button {\n background-size: 20px 20px, 40px 30px;\n height: 30px;\n margin: 0;\n padding: 0;\n width: 40px;\n}\n\n#prefs-tab-torrent {\n @include tab-image($image-upload-download);\n}\n\n#prefs-tab-speed {\n @include tab-image($image-speed);\n}\n\n#prefs-tab-peers {\n @include tab-image($image-peers);\n}\n\n#prefs-tab-network {\n @include tab-image($image-network);\n}\n\n#inspector-file-list {\n margin: 0;\n padding: 0;\n\n .inspector-torrent-file-list-entry {\n display: grid;\n grid-column-gap: 5px;\n grid-template-areas:\n 'check name priority'\n 'blank1 info blank2';\n grid-template-columns: 20px 1fr 65px;\n margin-bottom: 4px;\n padding: 5px;\n\n &.skip {\n opacity: 0.5;\n }\n }\n\n .file-wanted-control {\n grid-area: check;\n }\n\n .inspector-torrent-file-list-entry-name {\n color: var(--color-fg-name);\n cursor: pointer;\n grid-area: name;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .inspector-torrent-file-list-entry.skip\n > .inspector-torrent-file-list-entry-name {\n color: var(--color-fg-disabled);\n }\n\n .inspector-torrent-file-list-entry-progress {\n color: var(--color-fg-secondary);\n grid-area: info;\n }\n\n .single-file .inspector-torrent-file-list-entry > .file-wanted-control,\n .inspector-torrent-file-list-entry.complete > .file-wanted-control {\n cursor: default;\n }\n}\n\n#inspector-header {\n margin: 8px 0;\n}\n\n#torrent-inspector-name {\n font-size: large;\n font-weight: bold;\n}\n\n#inspector-tiers-list {\n color: var(--color-fg-secondary);\n margin: 0 10px;\n padding: 0 12px;\n\n .tier-list-row {\n display: grid;\n grid-column-gap: 8px;\n grid-row-gap: 4px;\n margin-top: 8px;\n }\n\n .tier-list-torrent {\n color: var(--color-fg-primary);\n font-size: larger;\n font-weight: bolder;\n margin-left: -12px;\n overflow-x: hidden;\n padding-top: 20px;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .tier-list-tracker {\n font-weight: bolder;\n grid-column: span 2;\n margin-top: 8px;\n padding-bottom: 4px;\n }\n\n .tier-announce,\n .tier-scrape,\n .tier-state {\n text-align: left;\n }\n\n .tier-downloads,\n .tier-leechers,\n .tier-seeders {\n text-align: right;\n }\n}\n\n// Peers Tab\n\n.peer-list {\n $table-border-color: $grey-100;\n $table-border: 1px solid $table-border-color;\n\n border: $table-border;\n border-collapse: collapse;\n cursor: default;\n table-layout: fixed;\n text-align: left;\n width: 100%;\n\n td,\n th {\n font-size: smaller;\n padding: 5px;\n }\n\n td {\n border: $table-border;\n color: var(--color-fg-secondary);\n // padding: 5px 10px;\n }\n\n .torrent-row td {\n background: $table-border-color;\n color: var(--color-fg-primary);\n font-size: normal;\n font-weight: bolder;\n overflow-x: hidden;\n padding: 10px;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .encryption {\n width: 16px;\n &[data-encrypted='true'] {\n background: transparent url($image-lock-fill) center center no-repeat;\n height: 16px;\n width: 16px;\n }\n }\n\n .peer-address,\n .percent-done,\n .speed-down,\n .speed-up {\n text-align: right;\n }\n\n .percent-done {\n width: 10%;\n }\n .speed-down,\n .speed-up {\n width: 15%;\n }\n .peer-address {\n width: 25%;\n }\n\n .peer-app-name {\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n @include for-phone-only {\n display: none;\n }\n @include for-tablet-portrait-up {\n width: 25%;\n }\n }\n\n .status {\n cursor: pointer;\n }\n}\n\n/// FILE PRIORITY BUTTONS\n\n.file-priority-radiobox {\n $size-number: 20;\n $size: $size-number * 1px;\n $halfsize: math.floor($size-number / 2) * 1px;\n\n grid-area: priority;\n\n > * {\n @include button;\n appearance: none;\n background-position: center;\n background-repeat: no-repeat;\n background-size: $halfsize, $size;\n height: $size;\n margin: 0;\n padding: 0;\n width: $size;\n }\n\n > .low {\n @include tab-image($image-chevron-dn);\n border-right-width: 0;\n }\n\n > .normal {\n @include tab-image($image-baseline);\n }\n\n > .high {\n @include tab-image($image-chevron-up);\n border-left-width: 0;\n }\n}\n\n/// CONTEXT MENU\n\n.context-menu {\n $background-color: var(--color-bg-menu);\n $disabled-color: var(--color-fg-disabled);\n\n background: $background-color;\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);\n position: absolute;\n z-index: $z-index-popup;\n\n .context-menuitem {\n list-style: none;\n padding: 5px 10px;\n\n &:hover:not(:disabled),\n &:focus:not(:disabled) {\n background-image: linear-gradient($white, var(--color-bg-menu));\n cursor: pointer;\n }\n\n &:disabled {\n color: $disabled-color;\n cursor: none;\n }\n }\n}\n\n.context-menu-separator {\n border-bottom: 1px solid var(--color-fg-secondary);\n margin-bottom: 10px;\n padding-bottom: 10px;\n}\n\n/// OVERFLOW MENU\n\n.overflow-menu {\n background: linear-gradient(\n 160deg,\n #d21,\n 1%,\n var(--color-bg-hover),\n 40%,\n var(--color-bg-menu)\n );\n border-radius: 8px;\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);\n padding: 20px;\n position: fixed;\n width: 200px;\n z-index: $z-index-popup;\n\n fieldset {\n border: 0;\n margin-bottom: 8px;\n padding: 0;\n }\n\n > .actions,\n > .info,\n > .links {\n display: flex;\n flex-direction: column;\n }\n\n legend {\n font-weight: bolder;\n margin-bottom: 4px;\n }\n\n legend ~ * {\n margin-left: 12px;\n }\n\n a,\n button,\n label {\n color: var(--color-fg-primary);\n font-size: 1em;\n\n &:disabled {\n color: var(--color-fg-disabled);\n cursor: default;\n }\n\n &:focus:not(:disabled),\n &:hover:not(:disabled) {\n background-color: var(--color-bg-hover);\n }\n }\n\n a,\n button {\n background: transparent;\n border: 0;\n cursor: pointer;\n display: block;\n padding: 4px 0;\n text-align: left;\n text-decoration: none;\n width: 150px;\n }\n\n .input-and-label {\n align-items: center;\n display: inline-flex;\n flex-direction: row;\n }\n\n #display-options {\n > * {\n align-items: center;\n display: inline-flex;\n flex-direction: row;\n\n > * {\n margin: 4px;\n }\n\n :first-child {\n margin-left: 0;\n }\n\n :last-child {\n margin-right: 0;\n }\n }\n }\n\n #speed-options {\n display: flex;\n flex-direction: column;\n\n > .speed-up,\n > .speed-down {\n align-items: center;\n display: flex;\n flex-direction: row;\n padding: 4px 0;\n\n > label {\n overflow: hidden;\n width: 80px;\n }\n }\n\n .alt-speed {\n display: grid;\n grid-column-gap: 5px;\n grid-row-gap: 5px;\n grid-template-areas:\n 'check lb'\n 'turtle values';\n grid-template-columns: 20px 1fr;\n margin-bottom: 4px;\n }\n\n #alt-speed-check {\n grid-area: check;\n\n &:checked ~ #alt-speed-image {\n background-image: url('images/blue-turtle.png');\n }\n\n &:not(:checked) ~ #alt-speed-image {\n background-image: url('images/turtle.png');\n }\n }\n\n #alt-speed-image {\n background-position: center;\n background-repeat: no-repeat;\n grid-area: turtle;\n }\n\n #alt-speed-label {\n grid-area: lb;\n }\n\n #alt-speed-values-label {\n font-size: small;\n grid-area: values;\n }\n }\n}\n\n// hide the fullscreen button unless we're on mobile\n@include for-tablet-portrait-up {\n #display-fullscreen-check,\n #display-fullscreen-label {\n display: none;\n }\n}\n\n/// DIALOGS\n\n$dialog-padding-number: 20;\n$dialog-logo-padding-number: $dialog-padding-number * 2 / 3;\n$logo-size: 64px;\n\n@include for-phone-only {\n .dialog-buttons {\n padding-top: $dialog-logo-padding-number * 1px;\n }\n\n .dialog-container {\n opacity: 96%;\n position: absolute;\n top: $popup-top;\n width: 100%;\n }\n\n .dialog-logo {\n padding-bottom: $dialog-logo-padding-number * 1px;\n }\n\n .dialog-window {\n align-items: center;\n display: flex;\n flex-direction: column;\n }\n}\n@include for-tablet-portrait-up {\n .dialog-container {\n left: 50%;\n min-width: 400px;\n position: absolute;\n top: $popup-top * 2;\n transform: translateX(-50%);\n }\n\n .dialog-heading {\n grid-area: heading;\n }\n\n .dialog-logo {\n grid-area: icon;\n padding-right: $dialog-logo-padding-number * 1px;\n }\n\n .dialog-window {\n display: grid;\n grid-column-gap: 12px;\n grid-template-areas:\n 'icon heading'\n 'icon message'\n 'icon workarea'\n 'icon buttons';\n grid-template-columns: $logo-size 1fr;\n padding: 2px 12px;\n }\n}\n\n.dialog-buttons {\n display: flex;\n float: right;\n grid-area: buttons;\n margin: 10px 0 0;\n text-align: center;\n\n button {\n appearance: none;\n background: transparent;\n border: 1px solid var(--color-border);\n border-radius: 5px;\n color: var(--color-fg-name);\n margin-left: 8px;\n padding: 8px;\n text-decoration: none;\n }\n\n a:hover,\n a:active {\n background: linear-gradient($white, var(--color-bg-menu));\n }\n}\n\n.dialog-buttons-begin {\n flex-grow: 1;\n}\n\n.dialog-buttons-end {\n display: none;\n}\n\n.dialog-container {\n border: 0;\n box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);\n color: var(--color-fg-primary);\n display: block;\n margin: 0;\n padding: 0;\n z-index: $z-index-popup;\n}\n\n.dialog-heading {\n align-items: center;\n display: flex;\n font-size: 1.2em;\n font-weight: bold;\n}\n\n.dialog-logo {\n background: transparent url('images/logo.png') top left no-repeat;\n height: $logo-size;\n width: $logo-size;\n}\n\n.dialog-message {\n grid-area: message;\n margin: 10px 0 0;\n}\n\n.dialog-window {\n background: linear-gradient(160deg, #d21, 1%, #f7f7f7, 40%, #ccc);\n height: 100%;\n padding: $dialog-padding-number * 1px;\n}\n\n.dialog-workarea {\n display: flex;\n flex-direction: column;\n grid-area: workarea;\n margin: 10px 0 0;\n\n > * {\n margin-bottom: 5px;\n }\n}\n\n/// ABOUT DIALOG\n\n.about-dialog .dialog-workarea > * {\n margin-bottom: 10px;\n}\n\n.about-dialog-version-number {\n margin-left: 4px;\n}\n\n.about-dialog-version-checksum {\n font-size: small;\n font-style: italic;\n font-weight: normal;\n margin-left: auto;\n padding-left: 10px;\n}\n\n/// HOTKEYS DIALOG\n\n.shortcuts-dialog {\n table {\n border-collapse: collapse;\n width: 100%;\n }\n\n th,\n td {\n border: 1px solid var(--color-border);\n padding: 5px 10px;\n }\n}\n\n/// RENAME DIALOG\n\n#torrent-rename-name {\n min-width: 400px;\n}\n\n/// SET-LOCATION DIALOG\n\n#move-container #torrent-path {\n min-width: 400px;\n}\n\n/// STATISTICS DIALOG\n\n.tabs-pages,\n.inspector-info-page,\n.statistics-dialog {\n .content {\n column-gap: 16px;\n display: grid;\n grid-row-gap: 6px;\n grid-template-columns: auto 1fr;\n margin-top: 4px;\n\n @include for-phone-only {\n margin: 4px 0 16px;\n }\n @include for-tablet-portrait-up {\n margin: 4px 16px 16px;\n }\n\n div {\n word-break: break-word;\n }\n }\n\n fieldset {\n border: 0;\n margin: 0;\n padding: 0;\n }\n\n legend {\n font-weight: bolder;\n margin-bottom: 4px;\n }\n}\n\n/// UPLOAD DIALOG\n\n#free-space-text {\n display: inline-block;\n float: right;\n font-size: smaller;\n font-style: italic;\n}\n\n#torrent-upload-frame {\n border: 0;\n display: block; /* Don't change this : safari forms won't target hidden frames (they open a new window) */\n height: 0;\n left: -1000px;\n margin: 0;\n padding: 0;\n position: absolute;\n top: -1000px;\n width: 0;\n}\n\n.ui-menu {\n width: 200px;\n}\n"],sourceRoot:""}]),t.default=R},function(e,t,n){"use strict";n.r(t);class r extends EventTarget{constructor(){super(),this.actions=Object.seal({"deselect-all":{enabled:!1,shortcut:"Control+A",text:"Deselect all"},"move-bottom":{enabled:!1,text:"Move to the back of the queue"},"move-down":{enabled:!1,text:"Move down in the queue"},"move-top":{enabled:!1,text:"Move to the front of the queue"},"move-up":{enabled:!1,text:"Move up in the queue"},"open-torrent":{enabled:!0,shortcut:"Alt+O",text:"Open torrent…"},"pause-all-torrents":{enabled:!1,text:"Pause all"},"pause-selected-torrents":{enabled:!1,shortcut:"Alt+U",text:"Pause"},"reannounce-selected-torrents":{enabled:!1,text:"Ask tracker for more peers"},"remove-selected-torrents":{enabled:!1,text:"Remove from list…"},"resume-selected-torrents":{enabled:!1,shortcut:"Alt+R",text:"Resume"},"resume-selected-torrents-now":{enabled:!1,text:"Resume now"},"select-all":{enabled:!1,shortcut:"Alt+A",text:"Select all"},"show-about-dialog":{enabled:!0,text:"About"},"show-inspector":{enabled:!0,shortcut:"Alt+I",text:"Torrent Inspector"},"show-move-dialog":{enabled:!1,shortcut:"Alt+L",text:"Set location…"},"show-overflow-menu":{enabled:!0,text:"More options…"},"show-preferences-dialog":{enabled:!0,shortcut:"Alt+P",text:"Edit preferences"},"show-rename-dialog":{enabled:!1,shortcut:"Alt+N",text:"Rename…"},"show-shortcuts-dialog":{enabled:!0,text:"Keyboard shortcuts"},"show-statistics-dialog":{enabled:!0,shortcut:"Alt+S",text:"Statistics"},"start-all-torrents":{enabled:!1,text:"Start all"},"toggle-compact-rows":{enabled:!0,text:"Compact rows"},"trash-selected-torrents":{enabled:!1,text:"Trash data and remove from list…"},"verify-selected-torrents":{enabled:!1,shortcut:"Alt+V",text:"Verify local data"}})}click(e){if(this.isEnabled(e)){const t=new Event("click");t.action=e,this.dispatchEvent(t)}}getActionForShortcut(e){for(const[t,n]of Object.entries(this.actions))if(e===n.shortcut)return t;return null}allShortcuts(){return new Map(Object.entries(this.actions).filter((([,e])=>e.shortcut)).map((([e,t])=>[t.shortcut,e])))}isEnabled(e){return this._getAction(e).enabled}text(e){return this._getAction(e).text}keyshortcuts(e){return this._getAction(e).shortcut}update(e){const t=r._recount(e.selected,e.nonselected);this._updateStates(t)}_getAction(e){const t=this.actions[e];if(!t)throw new Error("no such action: "+e);return t}static _recount(e,t){const n=e=>e.isStopped(),r=e.length+t.length,o=e.filter(n).length,i=e.length-o,s=t.filter(n).length,a=t.length-s,l=o+s,c=i+a,d=e.filter((e=>e.isQueued())).length;return{active:c,nonselected_active:a,nonselected_paused:s,paused:l,selected:e.length,selected_active:i,selected_paused:o,selected_queued:d,total:r}}_updateStates(e){const t=(e,t)=>{for(const n of t)this._updateActionState(n,e)};t(e.selected_paused>0,["resume-selected-torrents"]),t(e.paused>0,["start-all-torrents"]),t(e.active>0,["pause-all-torrents"]),t(e.selected_paused>0||e.selected_queued>0,["resume-selected-torrents-now"]),t(e.selected_active>0,["pause-selected-torrents","reannounce-selected-torrents"]),t(e.selected>0,["deselect-all","move-bottom","move-down","move-top","move-up","show-inspector","show-move-dialog","remove-selected-torrents","trash-selected-torrents","verify-selected-torrents"]),t(1===e.selected,["show-rename-dialog"]),t(e.selected{for(const e of o.children)e.classList.toggle("selected",e===t);for(const e of i.children)e.classList.toggle("hidden",e!==r);n&&n(r)}))}return s[0].classList.add("selected"),i.children[0].classList.remove("hidden"),{buttons:s,root:r}}function l(e){const t=document.createElement("dialog");t.classList.add("dialog-container","popup",e),t.open=!0,t.setAttribute("role","dialog");const n=document.createElement("div");n.classList.add("dialog-window"),t.append(n);const r=document.createElement("div");r.classList.add("dialog-logo"),n.append(r);const o=document.createElement("div");o.classList.add("dialog-heading"),n.append(o);const i=document.createElement("div");i.classList.add("dialog-message"),n.append(i);const s=document.createElement("div");s.classList.add("dialog-workarea"),n.append(s);const a=document.createElement("div");a.classList.add("dialog-buttons"),n.append(a);const l=document.createElement("span");l.classList.add("dialog-buttons-begin"),a.append(l);const c=document.createElement("button");c.classList.add("dialog-dismiss-button"),c.textContent="Cancel",a.append(c);const d=document.createElement("button");d.textContent="OK",a.append(d);const A=document.createElement("span");return A.classList.add("dialog-buttons-end"),a.append(A),{confirm:d,dismiss:c,heading:o,message:i,root:t,workarea:s}}function c(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))}function d(e,t){const n=[],{root:r,content:o}=function(e){const t=document.createElement("fieldset");t.classList.add("section");const n=document.createElement("legend");n.classList.add("title"),n.textContent=e,t.append(n);const r=document.createElement("div");return r.classList.add("content"),t.append(r),{content:r,root:t}}(e);for(const e of t){const t=document.createElement("label");t.textContent=e,o.append(t);const r=document.createElement("div");r.id=c(),o.append(r),t.setAttribute("for",r.id),n.push(r)}return{children:n,root:r}}function A(e,t=100){let n=null;return(...r)=>{n||(n=setTimeout((()=>{n=null,e(r)}),t))}}function p(e,t){return i()(e,t)}function u(e,t,n){n?e.setAttribute(t,!0):e.removeAttribute(t)}function g(e,t){u(e,"disabled",!t)}function m(e,t){u(e,"checked",t)}function h(e,t,n,r){const o=function(e,t){let{x:n,y:r}=e;const{width:o,height:i}=e;return n>t.x+t.width-o&&n-o>=t.x?n-=o:n=Math.min(n,t.x+t.width-o),r>t.y+t.height-i&&r-i>=t.y?r-=i:r=Math.min(r,t.y+t.height-i),new DOMRect(n,r,o,i)}(new DOMRect(t,n,e.clientWidth,e.clientHeight),r.getBoundingClientRect());e.style.left=o.left+"px",e.style.top=o.top+"px"}class f extends EventTarget{constructor(e){super(),this.listener=t=>{e.contains(t.target)||(this.dispatchEvent(new MouseEvent(t.type,t)),t.preventDefault())},Object.seal(this),this.start()}start(){setTimeout((()=>document.addEventListener("click",this.listener)),0)}stop(){document.removeEventListener("click",this.listener)}}function b(e,t){e.textContent!==t&&(e.textContent=t)}class C{constructor(e){this._prefs=e,this._elements={toggle:document.querySelector("#toggle-notifications")}}_setEnabled(e){this.prefs.notifications_enabled=e,b(this._toggle,(e?"Disable":"Enable")+" Notifications")}_requestPermission(){Notification.requestPermission().then((e=>this._setEnabled("granted"===e)))}toggle(){this._enabled?this._setEnabled(!1):"granted"===Notification.permission?this._setEnabled(!0):"denied"!==Notification.permission&&this._requestPermission()}}class v extends EventTarget{constructor(){super(),this._cache={},this.dispatchPrefsChange=A(((e,t,n)=>{const r=new Event("change");Object.assign(r,{key:e,old_value:t,value:n}),this.dispatchEvent(r)}));for(const[e,t]of Object.entries(v._Defaults))this._set(e,v._getCookie(e,t)),Object.defineProperty(this,e.replaceAll("-","_"),{get:()=>this._get(e),set:t=>{this._set(e,t)}});Object.seal(this)}entries(){return Object.entries(this._cache)}keys(){return Object.keys(this._cache)}_get(e){const{_cache:t}=this;if(!Object.prototype.hasOwnProperty.call(t,e))throw new Error(e);return t[e]}_set(e,t){const{_cache:n}=this,r=n[e];r!==t&&(n[e]=t,v._setCookie(e,t),this.dispatchPrefsChange(e,r,t))}static _setCookie(e,t){const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${e}=${t}; SameSite=Strict; expires=${n.toGMTString()}; path=/`}static _getCookie(e,t){const n=v._readCookie(e);return null===n?t:"true"===n||"false"!==n&&(n.match(/^\d+$/)?Number.parseInt(n,10):n)}static _readCookie(e){const t=("; "+document.cookie).split(`; ${e}=`);return 2===t.length?t.pop().split(";").shift():null}}v.AltSpeedEnabled="alt-speed-enabled",v.DisplayCompact="compact",v.DisplayFull="full",v.DisplayMode="display-mode",v.FilterActive="active",v.FilterAll="all",v.FilterDownloading="downloading",v.FilterFinished="finished",v.FilterMode="filter-mode",v.FilterPaused="paused",v.FilterSeeding="seeding",v.NotificationsEnabled="notifications-enabled",v.RefreshRate="refresh-rate-sec",v.SortAscending="ascending",v.SortByActivity="activity",v.SortByAge="age",v.SortByName="name",v.SortByProgress="progress",v.SortByQueue="queue",v.SortByRatio="ratio",v.SortBySize="size",v.SortByState="state",v.SortDescending="descending",v.SortDirection="sort-direction",v.SortMode="sort-mode",v._Defaults={[v.AltSpeedEnabled]:!1,[v.DisplayMode]:v.DisplayFull,[v.FilterMode]:v.FilterAll,[v.NotificationsEnabled]:!1,[v.RefreshRate]:5,[v.SortDirection]:v.SortAscending,[v.SortMode]:v.SortByName};class y extends EventTarget{constructor(e){super(),this.elements=y._create(e),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),document.body.append(this.elements.root),this.elements.dismiss.focus()}close(){this.elements.root.remove(),this.dispatchEvent(new Event("close")),delete this.elements}_onDismiss(){this.close()}static _create(e){const t=l("about-dialog");t.root.setAttribute("aria-label","About transmission"),t.heading.textContent="Transmission",t.dismiss.textContent="Close";let n=document.createElement("div");return n.classList.add("about-dialog-version-number"),n.textContent=e.version,t.heading.append(n),n=document.createElement("div"),n.classList.add("about-dialog-version-checksum"),n.textContent=e.checksum,t.heading.append(n),n=document.createElement("div"),n.textContent="A fast and easy bitTorrent client",t.workarea.append(n),n=document.createElement("div"),n.textContent="Copyright © The Transmission Project",t.workarea.append(n),t.confirm.remove(),delete t.confirm,t}}class E extends EventTarget{constructor(e){super(),this.action_listener=this._update.bind(this),this.action_manager=e,this.action_manager.addEventListener("change",this.action_listener),Object.assign(this,this._create()),this.show()}show(){for(const[e,t]of Object.entries(this.actions))g(t,this.action_manager.isEnabled(e));document.body.append(this.root)}close(){if(!this.closed){this.action_manager.removeEventListener("change",this.action_listener),this.root.remove(),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))delete this[e];this.closed=!0}}_update(e){const t=this.actions[e.action];t&&g(t,e.enabled)}_create(){const e=document.createElement("div");e.role="menu",e.classList.add("context-menu","popup");const t={},n=n=>{const r=document.createElement("div"),o=this.action_manager.text(n);r.role="menuitem",r.classList.add("context-menuitem"),r.dataset.action=n,r.textContent=o;const i=this.action_manager.keyshortcuts(n);i&&r.setAttribute("aria-keyshortcuts",i),r.addEventListener("click",(()=>{this.action_manager.click(n),this.close()})),t[n]=r,e.append(r)},r=()=>{const t=document.createElement("div");t.classList.add("context-menu-separator"),e.append(t)};return n("resume-selected-torrents"),n("resume-selected-torrents-now"),n("pause-selected-torrents"),r(),n("move-top"),n("move-up"),n("move-down"),n("move-bottom"),r(),n("remove-selected-torrents"),n("trash-selected-torrents"),r(),n("verify-selected-torrents"),n("show-move-dialog"),n("show-rename-dialog"),r(),n("reannounce-selected-torrents"),r(),n("select-all"),n("deselect-all"),{actions:t,root:e}}}const w=new Intl.PluralRules,x=w.resolvedOptions().locale,k=new Intl.NumberFormat(x),M=1e3,S=[new Intl.NumberFormat(x,{style:"unit",unit:"byte"}),new Intl.NumberFormat(x,{style:"unit",unit:"kilobyte"}),new Intl.NumberFormat(x,{style:"unit",unit:"megabyte"}),new Intl.NumberFormat(x,{style:"unit",unit:"gigabyte"}),new Intl.NumberFormat(x,{style:"unit",unit:"terabyte"}),new Intl.NumberFormat(x,{style:"unit",unit:"petabyte"})],B=new Intl.NumberFormat(x,{style:"unit",unit:"kilobyte-per-second"}),I=new Intl.NumberFormat(x,{style:"unit",unit:"megabyte-per-second"});class T{static countString(e,t,n){return`${this.number(n)} ${this.ngettext(e,t,n)}`}static mem(e){if(e<0)return"Unknown";if(0===e)return"None";let t=e;for(const e of S){if(t12&&(l-=12,c="PM"),0===l&&(l=12),l<10&&(l="0"+l);let d=t.getMinutes();return d<10&&(d="0"+d),(e=t.getSeconds())<10&&(e="0"+e),o=[l,d,e].join(":"),[r,o,c].join(" ")}static toKBps(e){return Math.floor(e/M)}static number(e){return k.format(e)}static _toTruncFixed(e,t){return(Math.floor(e*10**t)/10**t).toFixed(t)}}class D extends EventTarget{isDone(){return this.fields.have>=this.fields.size}isEditable(){return this.fields.torrent.getFileCount()>1&&!this.isDone()}refreshWantedHTML(){const e=this.elements.root;e.classList.toggle("skip",!this.fields.isWanted),e.classList.toggle("complete",this.isDone()),g(e.checkbox,this.isEditable()),e.checkbox.checked=this.fields.isWanted}refreshProgressHTML(){const{size:e,have:t}=this.fields,n=100*(e?t/e:1),r=T,o=`${r.size(t)} of ${r.size(e)} (${r.percentString(n)}%)`;b(this.elements.progress,o)}refresh(){let e=0,t=!1,n=!1,r=!1,o=0,i=!1;const s=this.fields.torrent.getFiles();for(const a of this.fields.indices){const l=s[a];switch(e+=l.bytesCompleted,o+=l.length,i|=l.wanted,l.priority){case-1:n=!0;break;case 1:t=!0;break;default:r=!0}}m(this.elements.priority_low_button,n),m(this.elements.priority_normal_button,r),m(this.elements.priority_high_button,t),this.fields.have===e&&this.fields.size===o||(this.fields.have=e,this.fields.size=o,this.refreshProgressHTML()),this.fields.isWanted!==i&&(this.fields.isWanted=i,this.refreshWantedHTML())}fireWantedChanged(e){const t=new Event("wantedToggled");t.indices=[...this.fields.indices],t.wanted=e,this.dispatchEvent(t)}firePriorityChanged(e){const t=new Event("priorityToggled");t.indices=[...this.fields.indices],t.priority=e,this.dispatchEvent(t)}createRow(e,t,n,r){const o=document.createElement("li");o.classList.add("inspector-torrent-file-list-entry",r?"even":"odd"),this.elements.root=o;let i=document.createElement("input");const s=c();i.type="checkbox",i.className="file-wanted-control",i.title="Download file",i.id=s,i.addEventListener("change",(e=>this.fireWantedChanged(e.target.checked))),o.checkbox=i,o.append(i),i=document.createElement("label"),i.className="inspector-torrent-file-list-entry-name",i.setAttribute("for",s),b(i,n),o.append(i),i=document.createElement("div"),i.className="inspector-torrent-file-list-entry-progress",o.append(i),this.elements.progress=i,i=document.createElement("div"),i.className="file-priority-radiobox";const a=i,l=e=>this.firePriorityChanged(e.target.value);i=document.createElement("input"),i.type="radio",i.value=-1,i.className="low",i.title="Low Priority",i.addEventListener("click",l),this.elements.priority_low_button=i,a.append(i),i=document.createElement("input"),i.type="radio",i.value=0,i.className="normal",i.title="Normal Priority",i.addEventListener("click",l),this.elements.priority_normal_button=i,a.append(i),i=document.createElement("input"),i.type="radio",i.value=1,i.title="High Priority",i.className="high",i.addEventListener("click",l),this.elements.priority_high_button=i,a.append(i),o.append(a),o.style.paddingLeft=20*t+"px",this.refresh()}getElement(){return this.elements.root}constructor(e,t,n,r,o){super(),this.fields={have:0,indices:r,isWanted:!0,size:0,torrent:e},this.elements={priority_high_button:null,priority_low_button:null,priority_normal_button:null,progress:null,root:null},this.createRow(e,t,n,o)}}const L={};function N(e){if(L[e])return L[e];const t=new URL(e),n=function(e){const t=e.indexOf(".");return t!==e.lastIndexOf(".")&&(e=e.slice(t+1)),e}(t.host),r={domain:n,name:function(e){e.length>0&&(e=e.charAt(0).toUpperCase()+e.slice(1));const t=e.indexOf(".");return-1!==t&&(e=e.slice(0,t)),e}(n),url:t};return L[e]=r,r}class j extends EventTarget{constructor(e){super(),this.fieldObservers={},this.fields={},this.refresh(e)}notifyOnFieldChange(e,t){this.fieldObservers[e]=this.fieldObservers[e]||[],this.fieldObservers[e].push(t)}setField(e,t,n){const r=e[t];if(p(r,n))return!1;const o=this.fieldObservers[t];if(e===this.fields&&o&&o.length>0)for(const e of o)e.call(this,n,r,t);return e[t]=n,!0}updateFiles(e){let t=!1;const n=this.fields.files||[],r=["length","name","bytesCompleted","wanted","priority"];for(const[o,i]of e.entries()){const e=n[o]||{};for(const n of r)n in i&&(t|=this.setField(e,n,i[n]));n[o]=e}return this.fields.files=n,t}static collateTrackers(e){return e.map((e=>e.announce.toLowerCase())).join("\t")}refreshFields(e){let t=!1;for(const[n,r]of Object.entries(e))switch(n){case"files":case"fileStats":t|=this.updateFiles(r);break;case"trackerStats":t|=this.setField(this.fields,"trackers",r);break;case"trackers":n in this.fields||(t|=this.setField(this.fields,n,r));break;default:t|=this.setField(this.fields,n,r)}return t}refresh(e){this.refreshFields(e)&&this.dispatchEvent(new Event("dataChanged"))}getComment(){return this.fields.comment}getCreator(){return this.fields.creator}getDateAdded(){return this.fields.addedDate}getDateCreated(){return this.fields.dateCreated}getDesiredAvailable(){return this.fields.desiredAvailable}getDownloadDir(){return this.fields.downloadDir}getDownloadSpeed(){return this.fields.rateDownload}getDownloadedEver(){return this.fields.downloadedEver}getError(){return this.fields.error}getErrorString(){return this.fields.errorString}getETA(){return this.fields.eta}getFailedEver(){return this.fields.corruptEver}getFiles(){return this.fields.files||[]}getFile(e){return this.fields.files[e]}getFileCount(){return this.fields["file-count"]}getHashString(){return this.fields.hashString}getHave(){return this.getHaveValid()+this.getHaveUnchecked()}getHaveUnchecked(){return this.fields.haveUnchecked}getHaveValid(){return this.fields.haveValid}getId(){return this.fields.id}getLastActivity(){return this.fields.activityDate}getLeftUntilDone(){return this.fields.leftUntilDone}getMetadataPercentComplete(){return this.fields.metadataPercentComplete}getName(){return this.fields.name||"Unknown"}getPeers(){return this.fields.peers||[]}getPeersConnected(){return this.fields.peersConnected}getPeersGettingFromUs(){return this.fields.peersGettingFromUs}getPeersSendingToUs(){return this.fields.peersSendingToUs}getPieceCount(){return this.fields.pieceCount}getPieceSize(){return this.fields.pieceSize}getPrimaryMimeType(){return this.fields["primary-mime-type"]}getPrivateFlag(){return this.fields.isPrivate}getQueuePosition(){return this.fields.queuePosition}getRecheckProgress(){return this.fields.recheckProgress}getSeedRatioLimit(){return this.fields.seedRatioLimit}getSeedRatioMode(){return this.fields.seedRatioMode}getSizeWhenDone(){return this.fields.sizeWhenDone}getStartDate(){return this.fields.startDate}getStatus(){return this.fields.status}getTotalSize(){return this.fields.totalSize}getTrackers(){const e=this.fields.trackers||[];for(const t of e)t.announce&&!t.domain&&Object.assign(t,N(t.announce));return this.fields.trackers}getUploadSpeed(){return this.fields.rateUpload}getUploadRatio(){return this.fields.uploadRatio}getUploadedEver(){return this.fields.uploadedEver}getWebseedsSendingToUs(){return this.fields.webseedsSendingToUs}isFinished(){return this.fields.isFinished}hasExtraInfo(){return"hashString"in this.fields}isSeeding(){return this.getStatus()===j._StatusSeed}isStopped(){return this.getStatus()===j._StatusStopped}isChecking(){return this.getStatus()===j._StatusCheck}isDownloading(){return this.getStatus()===j._StatusDownload}isQueued(){return this.getStatus()===j._StatusDownloadWait||this.getStatus()===j._StatusSeedWait}isDone(){return this.getLeftUntilDone()<1}needsMetaData(){return this.getMetadataPercentComplete()<1}getActivity(){return this.getDownloadSpeed()+this.getUploadSpeed()}getPercentDoneStr(){return T.percentString(100*this.getPercentDone())}getPercentDone(){return this.fields.percentDone}getStateString(){switch(this.getStatus()){case j._StatusStopped:return this.isFinished()?"Seeding complete":"Paused";case j._StatusCheckWait:return"Queued for verification";case j._StatusCheck:return"Verifying local data";case j._StatusDownloadWait:return"Queued for download";case j._StatusDownload:return"Downloading";case j._StatusSeedWait:return"Queued for seeding";case j._StatusSeed:return"Seeding";case null:return"Unknown";default:return"Error"}}seedRatioLimit(e){switch(this.getSeedRatioMode()){case j._RatioUseGlobal:return e.seedRatioLimit();case j._RatioUseLocal:return this.getSeedRatioLimit();default:return-1}}getErrorMessage(){const e=this.getErrorString();switch(this.getError()){case j._ErrTrackerWarning:return"Tracker returned a warning: "+e;case j._ErrTrackerError:return"Tracker returned an error: "+e;case j._ErrLocalError:return"Error: "+e;default:return null}}getCollatedName(){const e=this.fields;return!e.collatedName&&e.name&&(e.collatedName=e.name.toLowerCase()),e.collatedName||""}getCollatedTrackers(){const e=this.fields;return!e.collatedTrackers&&e.trackers&&(e.collatedTrackers=j.collateTrackers(e.trackers)),e.collatedTrackers||""}testState(e){const t=this.getStatus();switch(e){case v.FilterActive:return this.getPeersGettingFromUs()>0||this.getPeersSendingToUs()>0||this.getWebseedsSendingToUs()>0||this.isChecking();case v.FilterSeeding:return t===j._StatusSeed||t===j._StatusSeedWait;case v.FilterDownloading:return t===j._StatusDownload||t===j._StatusDownloadWait;case v.FilterPaused:return this.isStopped();case v.FilterFinished:return this.isFinished();default:return!0}}test(e,t,n){let r=this.testState(e);return r&&t&&t.length>0&&(r=this.getCollatedName().includes(t.toLowerCase())),r&&n&&n.length>0&&(r=this.getCollatedTrackers().includes(n)),r}static compareById(e,t){return e.getId()-t.getId()}static compareByName(e,t){return e.getCollatedName().localeCompare(t.getCollatedName())||j.compareById(e,t)}static compareByQueue(e,t){return e.getQueuePosition()-t.getQueuePosition()}static compareByAge(e,t){const n=e.getDateAdded();return t.getDateAdded()-n||j.compareByQueue(e,t)}static compareByState(e,t){const n=e.getStatus();return t.getStatus()-n||j.compareByQueue(e,t)}static compareByActivity(e,t){const n=e.getActivity();return t.getActivity()-n||j.compareByState(e,t)}static compareByRatio(e,t){const n=e.getUploadRatio(),r=t.getUploadRatio();return nr?-1:j.compareByState(e,t)}static compareByProgress(e,t){return e.getPercentDone()-t.getPercentDone()||j.compareByRatio(e,t)}static compareBySize(e,t){return e.getTotalSize()-t.getTotalSize()||j.compareByName(e,t)}static compareTorrents(e,t,n,r){let o=0;switch(n){case v.SortByActivity:o=j.compareByActivity(e,t);break;case v.SortByAge:o=j.compareByAge(e,t);break;case v.SortByQueue:o=j.compareByQueue(e,t);break;case v.SortByProgress:o=j.compareByProgress(e,t);break;case v.SortBySize:o=j.compareBySize(e,t);break;case v.SortByState:o=j.compareByState(e,t);break;case v.SortByRatio:o=j.compareByRatio(e,t);break;case v.SortByName:o=j.compareByName(e,t);break;default:console.log("Unrecognized sort mode: "+n),o=j.compareByName(e,t)}return r===v.SortDescending&&(o=-o),o}static sortTorrents(e,t,n){switch(t){case v.SortByActivity:e.sort(this.compareByActivity);break;case v.SortByAge:e.sort(this.compareByAge);break;case v.SortByName:e.sort(this.compareByName);break;case v.SortByProgress:e.sort(this.compareByProgress);break;case v.SortByQueue:e.sort(this.compareByQueue);break;case v.SortByRatio:e.sort(this.compareByRatio);break;case v.SortBySize:e.sort(this.compareBySize);break;case v.SortByState:e.sort(this.compareByState);break;default:console.log("Unrecognized sort mode: "+t),e.sort(this.compareByName)}return n===v.SortDescending&&e.reverse(),e}}j._StatusStopped=0,j._StatusCheckWait=1,j._StatusCheck=2,j._StatusDownloadWait=3,j._StatusDownload=4,j._StatusSeedWait=5,j._StatusSeed=6,j._RatioUseGlobal=0,j._RatioUseLocal=1,j._RatioUnlimited=2,j._ErrNone=0,j._ErrTrackerWarning=1,j._ErrTrackerError=2,j._ErrLocalError=3,j._TrackerInactive=0,j._TrackerWaiting=1,j._TrackerQueued=2,j._TrackerActive=3,j.Fields={},j.Fields.Metadata=["addedDate","file-count","name","primary-mime-type","totalSize"],j.Fields.Stats=["error","errorString","eta","isFinished","isStalled","leftUntilDone","metadataPercentComplete","peersConnected","peersGettingFromUs","peersSendingToUs","percentDone","queuePosition","rateDownload","rateUpload","recheckProgress","seedRatioMode","seedRatioLimit","sizeWhenDone","status","trackers","downloadDir","uploadedEver","uploadRatio","webseedsSendingToUs"],j.Fields.InfoExtra=["comment","creator","dateCreated","files","hashString","isPrivate","pieceCount","pieceSize"],j.Fields.StatsExtra=["activityDate","corruptEver","desiredAvailable","downloadedEver","fileStats","haveUnchecked","haveValid","peers","startDate","trackerStats"];const _=["encryption","speed-up","speed-down","percent-done","status","peer-address","peer-app-name"];class z extends EventTarget{constructor(e){super(),this.closed=!1,this.controller=e,this.elements=this._create(),this.current_page=this.elements.info.root,this.interval=setInterval(this._refreshTorrents.bind(this),3e3),this.name="inspector",this.selection_listener=e=>this._setTorrents(e.selected),this.torrent_listener=()=>this._updateCurrentPage(),this.torrents=[],this.file_torrent=null,this.file_torrent_n=null,this.file_rows=null,this.outside=new f(this.elements.root),this.outside.addEventListener("click",(()=>this.close())),Object.seal(this),e.addEventListener("torrent-selection-changed",this.selection_listener),this._setTorrents(this.controller.getSelectedTorrents()),document.body.append(this.elements.root)}close(){if(!this.closed){this.outside.stop(),clearInterval(this.interval),this._setTorrents([]),this.elements.root.remove(),this.controller.removeEventListener("torrent-selection-changed",this.selection_listener),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))this[e]=null;this.closed=!0}}static _createInfoPage(){const e=document.createElement("div");e.classList.add("inspector-info-page");const t={root:e},n=t=>{const n=document.createElement("div");n.textContent=t,n.classList.add("section-label"),e.append(n)},r=t=>{const n=document.createElement("label");b(n,t),e.append(n);const r=document.createElement("label");return e.append(r),r};n("Activity");let o=[["have","Have:"],["availability","Availability:"],["uploaded","Uploaded:"],["downloaded","Downloaded:"],["state","State:"],["running_time","Running time:"],["remaining_time","Remaining:"],["last_activity","Last activity:"],["error","Error:"]];for(const[e,n]of o)t[e]=r(n);n("Details"),o=[["size","Size:"],["location","Location:"],["hash","Hash:"],["privacy","Privacy:"],["origin","Origin:"],["comment","Comment:"]];for(const[e,n]of o)t[e]=r(n);return t}static _createListPage(e,t){const n=document.createElement("div"),r=document.createElement(e);return r.id=t,n.append(r),{list:r,root:n}}static _createTiersPage(){return z._createListPage("div","inspector-tiers-list")}static _createFilesPage(){return z._createListPage("ul","inspector-file-list")}static _createPeersPage(){const e=document.createElement("table");e.classList.add("peer-list");const t=document.createElement("thead"),n=document.createElement("tr");["","Up","Down","Done","Status","Address","Client"].forEach(((e,t)=>{const r=document.createElement("th"),o=_[t];"encryption"===o&&(r.dataset.encrypted=!0),r.classList.add(o),b(r,e),n.append(r)}));const r=document.createElement("tbody");return t.append(n),e.append(t),e.append(r),{root:e,tbody:r}}_create(){const e={files:z._createFilesPage(),info:z._createInfoPage(),peers:z._createPeersPage(),tiers:z._createTiersPage()};return{...a("inspector",[["inspector-tab-info",e.info.root],["inspector-tab-peers",e.peers.root],["inspector-tab-tiers",e.tiers.root],["inspector-tab-files",e.files.root]],(e=>{this.current_page=e,this._updateCurrentPage()}).bind(this)),...e}}_setTorrents(e){const t="dataChanged",n=this.torrent_listener;this.torrents.forEach((e=>e.removeEventListener(t,n))),this.torrents=[...e],this.torrents.forEach((e=>e.addEventListener(t,n))),this._refreshTorrents(),this._updateCurrentPage()}static _needsExtraInfo(e){return e.some((e=>!e.hasExtraInfo()))}_refreshTorrents(){const{controller:e,torrents:t}=this,n=t.map((e=>e.getId()));if(n&&n.length>0){const r=["id",...j.Fields.StatsExtra];z._needsExtraInfo(t)&&r.push(...j.Fields.InfoExtra),e.updateTorrents(n,r)}}_updateCurrentPage(){const{elements:e}=this;switch(this.current_page){case e.files.root:this._updateFiles();break;case e.info.root:this._updateInfo();break;case e.peers.root:this._updatePeers();break;case e.tiers.root:this._updateTiers();break;default:console.warn("unexpected page"),console.log(this.current_page)}}_updateInfo(){const e="None",t="Mixed",n="Unknown",r=T,o=Date.now(),{torrents:i}=this,a=this.elements,l=i.reduce(((e,t)=>e+t.getSizeWhenDone()),0);let c=null;if(0===i.length)c=e;else if(i.every((e=>e.isFinished())))c="Finished";else if(i.every((e=>e.isStopped())))c="Paused";else{const e=e=>e.getStateString(),n=e(i[0]);c=i.every((t=>e(t)===n))?n:t}b(a.info.state,c);const d=c;if(0===i.length)c=e;else{const e=i.reduce(((e,t)=>e+t.getHaveValid()),0),t=i.reduce(((e,t)=>e+t.getHaveUnchecked()),0),n=i.reduce(((e,t)=>e+t.getLeftUntilDone()),0),o=100*(l?(l-n)/l:1);c=r.percentString(o),c=t||n?t?`${r.size(e)} of ${r.size(l)} (${c}%), ${r.size(t)} Unverified`:`${r.size(e)} of ${r.size(l)} (${c}%)`:r.size(e)+" (100%)"}if(b(a.info.have,c),0===i.length)c=e;else if(0===l)c=e;else{const e=i.reduce(((e,t)=>t.getHave()+t.getDesiredAvailable()),0);c=r.percentString(100*e/l)+"%"}if(b(a.info.availability,c),0===i.length)c=e;else{const e=i.reduce(((e,t)=>e+t.getDownloadedEver()),0),t=i.reduce(((e,t)=>e+t.getFailedEver()),0);c=t?`${r.size(e)} (${r.size(t)} corrupt)`:r.size(e)}if(b(a.info.downloaded,c),0===i.length)c=e;else{const e=i.reduce(((e,t)=>e+t.getUploadedEver()),0),t=i.reduce(((e,t)=>e+t.getDownloadedEver()),0)||i.reduce(((e,t)=>e+t.getHaveValid()),0);c=`${r.size(e)} (Ratio: ${r.ratioString(s.ratio(e,t))})`}if(b(a.info.uploaded,c),0===i.length)c=e;else if(i.every((e=>e.isStopped())))c=d;else{const e=e=>e.getStartDate(),n=e(i[0]);c=i.every((t=>e(t)===n))?r.timeInterval(o/1e3-n):t}if(b(a.info.running_time,c),0===i.length)c=e;else{const e=e=>e.getETA(),o=e(i[0]);c=i.every((t=>e(t)===o))?o<0?n:r.timeInterval(o):t}if(b(a.info.remaining_time,c),0===i.length)c=e;else{const t=i.reduce(((e,t)=>Math.max(e,t.getLastActivity())),-1),n=Math.floor(o/1e3);if(0e.getErrorString(),n=e(i[0]);c=i.every((t=>e(t)===n))?n:t}if(b(a.info.error,c||e),0===i.length)c=e;else{const e=i.reduce(((e,t)=>e+t.getTotalSize()),0);if(e){const t=e=>e.getPieceSize(),n=i.reduce(((e,t)=>e+t.getPieceCount()),0),o=r.number(n),s=t(i[0]);c=i.every((e=>t(e)===s))?`${r.size(e)} (${o} pieces @ ${r.mem(s)})`:`${r.size(e)} (${o} pieces)`}else c="None"}if(b(a.info.size,c),0===i.length)c=e;else{const e=e=>e.getHashString(),n=e(i[0]);c=i.every((t=>e(t)===n))?n:t}if(b(a.info.hash,c),0===i.length)c=e;else{const e=e=>e.getPrivateFlag(),n=e(i[0]);c=i.every((t=>e(t)===n))?n?"Private to this tracker -- DHT and PEX disabled":"Public torrent":t}if(b(a.info.privacy,c),0===i.length)c=e;else{const e=e=>e.getComment(),n=e(i[0]);c=i.every((t=>e(t)===n))?n:t}if(c=c||e,c.startsWith("https://")||c.startsWith("http://")?(c=encodeURI(c),s.setInnerHTML(a.info.comment,`${c}`)):b(a.info.comment,c),0===i.length)c=e;else{let e=e=>e.getCreator();const r=e(i[0]),o=!i.every((t=>e(t)===r));e=e=>e.getDateCreated();const s=e(i[0]),a=!i.every((t=>e(t)===s)),l=!r||!r.length,d=!s;c=o||a?t:l&&d?n:d&&!l?"Created by "+r:l&&!d?"Created on "+new Date(1e3*s).toDateString():`Created by ${r} on ${new Date(1e3*s).toDateString()}`}if(b(a.info.origin,c),0===i.length)c=e;else{const e=e=>e.getDownloadDir(),n=e(i[0]);c=i.every((t=>e(t)===n))?n:t}b(a.info.location,c)}static _peerStatusTitle(e){const t=Object.seal({"?":"We unchoked this peer, but they're not interested",D:"Downloading from this peer",E:"Encrypted Connection",H:"Peer was discovered through Distributed Hash Table (DHT)",I:"Peer is an incoming connection",K:"Peer has unchoked us, but we're not interested",O:"Optimistic unchoke",T:"Peer is connected via uTP",U:"Uploading to peer",X:"Peer was discovered through Peer Exchange (PEX)",d:"We would download from this peer if they'd let us",u:"We would upload to this peer if they'd ask"});return[...e].filter((e=>t[e])).map((e=>`${e}: ${t[e]}`)).join("\n")}_updatePeers(){const e=T,{torrents:t}=this,{tbody:n}=this.elements.peers,r=[(e,t)=>{t.dataset.encrypted=e.isEncrypted},(t,n)=>b(n,t.rateToPeer?e.speedBps(t.rateToPeer):""),(t,n)=>b(n,t.rateToClient?e.speedBps(t.rateToClient):""),(e,t)=>b(t,Math.floor(100*e.progress)+"%"),(e,t)=>{b(t,e.flagStr),t.setAttribute("title",z._peerStatusTitle(e.flagStr))},(e,t)=>b(t,e.address),(e,t)=>b(t,e.clientName)],o=[];for(const e of t){const t=document.createElement("tr");t.classList.add("torrent-row");const i=document.createElement("td");i.setAttribute("colspan",r.length),b(i,e.getName()),t.append(i),o.push(t);for(const t of e.getPeers()){const e=document.createElement("tr");e.classList.add("peer-row"),r.forEach(((n,r)=>{const o=document.createElement("td");o.classList.add(_[r]),n(t,o),e.append(o)})),o.push(e)}for(;n.firstChild;)n.firstChild.remove();n.append(...o)}}static getAnnounceState(e){switch(e.announceState){case j._TrackerActive:return"Announce in progress";case j._TrackerWaiting:{const t=Math.max(0,e.nextAnnounceTime-(new Date).getTime()/1e3);return"Next announce in "+T.timeInterval(t)}case j._TrackerQueued:return"Announce is queued";case j._TrackerInactive:return e.isBackup?"Tracker will be used as a backup":"Announce not scheduled";default:return"unknown announce state: "+e.announceState}}static lastAnnounceStatus(e){let t="Last Announce",n=["N/A"];if(e.hasAnnounced){const r=T.timestamp(e.lastAnnounceTime);e.lastAnnounceSucceeded?n=[r," (got ",T.countString("peer","peers",e.lastAnnouncePeerCount),")"]:(t="Announce error",n=[e.lastAnnounceResult?e.lastAnnounceResult+" - ":"",r])}return{label:t,value:n.join("")}}static lastScrapeStatus(e){let t="Last Scrape",n="N/A";if(e.hasScraped){const r=T.timestamp(e.lastScrapeTime);e.lastScrapeSucceeded?n=r:(t="Scrape error",n=(e.lastScrapeResult?e.lastScrapeResult+" - ":"")+r)}return{label:t,value:n}}_updateTiers(){const e="N/A",{list:t}=this.elements.tiers,{torrents:n}=this,r=[];for(const t of n){const o=document.createElement("div");if(o.classList.add("inspector-group"),r.push(o),n.length>1){const e=document.createElement("div");e.classList.add("tier-list-torrent"),b(e,t.getName()),r.push(e)}t.getTrackers().forEach(((t,n)=>{const o=z.getAnnounceState(t),i=z.lastAnnounceStatus(t),s=z.lastScrapeStatus(t),a=document.createElement("div");a.classList.add("tier-list-row",n%2?"odd":"even");let l=document.createElement("div");l.classList.add("tier-list-tracker"),b(l,`${t.domain||t.host||t.announce} - tier ${t.tier+1}`),l.setAttribute("title",t.announce),a.append(l),l=document.createElement("div"),l.classList.add("tier-announce"),b(l,`${i.label}: ${i.value}`),a.append(l),l=document.createElement("div"),l.classList.add("tier-seeders"),b(l,"Seeders: "+(t.seederCount>-1?t.seederCount:e)),a.append(l),l=document.createElement("div"),l.classList.add("tier-state"),b(l,o),a.append(l),l=document.createElement("div"),l.classList.add("tier-leechers"),b(l,"Leechers: "+(t.leecherCount>-1?t.leecherCount:e)),a.append(l),l=document.createElement("div"),l.classList.add("tier-scrape"),b(l,`${s.label}: ${s.value}`),a.append(l),l=document.createElement("div"),l.classList.add("tier-downloads"),b(l,"Downloads: "+(t.downloadCount>-1?t.downloadCount:e)),a.append(l),r.push(a)}))}for(;t.firstChild;)t.firstChild.remove();t.append(...r)}_changeFileCommand(e,t){const{controller:n,file_torrent:r}=this,o=r.getId();n.changeFileCommand(o,e,t)}_onFileWantedToggled(e){const{indices:t,wanted:n}=e;this._changeFileCommand(t,n?"files-wanted":"files-unwanted")}_onFilePriorityToggled(e){const{indices:t,priority:n}=e;let r=null;switch(n){case-1:r="priority-low";break;case 1:r="priority-high";break;default:r="priority-normal"}this._changeFileCommand(t,r)}_clearFileList(){const{list:e}=this.elements.files;for(;e.firstChild;)e.firstChild.remove();this.file_torrent=null,this.file_torrent_n=null,this.file_rows=null}static createFileTreeModel(e){const t=[],n={children:{},file_indices:[]};e.getFiles().forEach(((e,r)=>{const{name:o}=e,i=o.split("/");let s=n;for(const[e,t]of i.entries()){let n=s.children[t];n||(s.children[t]=n={children:{},depth:e,file_indices:[],name:t,parent:s}),s=n}s.file_index=r,delete s.children,t.push(s)}));for(const e of t){const{file_index:t}=e;let n=e;do{n.file_indices.push(t),n=n.parent}while(n)}return n}addNodeToView(e,t,n,r){const o=new D(e,n.depth,n.name,n.file_indices,r%2);o.addEventListener("wantedToggled",this._onFileWantedToggled.bind(this)),o.addEventListener("priorityToggled",this._onFilePriorityToggled.bind(this)),this.file_rows.push(o),t.append(o.getElement())}addSubtreeToView(e,t,n,r){if(n.parent&&this.addNodeToView(e,t,n,r++),n.children)for(const o of Object.values(n.children))r=this.addSubtreeToView(e,t,o,r);return r}_updateFiles(){const{list:e}=this.elements.files,{torrents:t}=this;if(1!==t.length)return void this._clearFileList();const[n]=t,r=n.getFiles().length;if(n!==this.file_torrent||r!==this.file_torrent_n){this._clearFileList(),this.file_torrent=n,this.file_torrent_n=r,this.file_rows=[];const t=document.createDocumentFragment(),o=z.createFileTreeModel(n);this.addSubtreeToView(n,t,o,0),e.append(t)}else this.file_rows.forEach((e=>e.refresh()))}}let F="";class P extends EventTarget{constructor(e,t){super(),this.controller=e,this.remote=t,this.elements={},this.torrents=[],this.show()}show(){const e=this.controller.getSelectedTorrents();0!==e.length&&(F=F||e[0].getDownloadDir(),this.torrents=e,this.elements=P._create(),this.elements.confirm.addEventListener("click",(()=>this._onConfirm())),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),this.elements.entry.value=F,document.body.append(this.elements.root),this.elements.entry.focus())}close(){this.elements.root.remove(),this.dispatchEvent(new Event("close")),delete this.controller,delete this.remote,delete this.elements,delete this.torrents}_onDismiss(){this.close()}_onConfirm(){const e=this.torrents.map((e=>e.getId())),t=this.elements.entry.value.trim();F=t,this.remote.moveTorrents(e,t),this.close()}static _create(){const e=l("move-dialog");e.root.setAttribute("aria-label","Move Torrent"),e.heading.textContent="Set Torrent Location",confirm.textContent="Apply";const t=document.createElement("label");t.setAttribute("for","torrent-path"),t.textContent="Location:",e.workarea.append(t);const n=document.createElement("input");return n.setAttribute("type","text"),n.id="torrent-path",e.entry=n,e.workarea.append(n),e}}class R extends EventTarget{constructor(e){super(),this.elements=R._create(e),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),this.options=e,document.body.append(this.elements.root),this.elements.dismiss.focus()}close(){if(!this.closed){this.elements.root.remove(),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))delete this[e];this.closed=!0}}_onDismiss(){this.close()}static _create(e){const{heading:t,message:n}=e,r=l("confirm-dialog");return r.confirm.remove(),delete r.confirm,r.heading.textContent=t,r.workarea.textContent=n,r}}class O extends EventTarget{constructor(e,t){super(),this.controller=e,this.remote=t,this.elements=this._create(),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),this.elements.confirm.addEventListener("click",(()=>this._onConfirm())),this._updateFreeSpaceInAddDialog(),document.body.append(this.elements.root),this.elements.url_input.focus()}close(){if(!this.closed){clearInterval(this.interval),this.elements.root.remove(),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))delete this[e];this.closed=!0}}_onDismiss(){this.close()}_updateFreeSpaceInAddDialog(){const e=this.elements.folder_input.value;this.remote.getFreeSpace(e,((e,t)=>{const n=t>0?T.size(t)+" Free":"";this.elements.freespace.textContent=n}))}_onConfirm(){const{remote:e}=this,{file_input:t,folder_input:n,start_input:r,url_input:o}=this.elements,i=!r.checked,s=n.value.trim();for(const n of t.files){const t=new FileReader;t.addEventListener("load",(t=>{const r=t.target.result,o="base64,",a=r.indexOf(o);if(-1===a)return;const l={arguments:{"download-dir":s,metainfo:r.slice(Math.max(0,a+o.length)),paused:i},method:"torrent-add"};console.log(l),e.sendRequest(l,(e=>{"success"!==e.result&&(alert(`Error adding "${n.name}": ${e.result}`),this.controller.setCurrentPopup(new R({heading:`Error adding "${n.name}"`,message:e.result})))}))})),t.readAsDataURL(n)}let a=o.value.trim();if(a.length>0){a.match(/^[\da-f]{40}$/i)&&(a="magnet:?xt=urn:btih:"+a);const t={arguments:{"download-dir":s,filename:a,paused:i},method:"torrent-add"};console.log(t),e.sendRequest(t,((e,t)=>{"success"!==t.result&&this.controller.setCurrentPopup(new R({heading:`Error adding "${a}"`,message:t.result}))}))}this._onDismiss()}_create(){const e=l(),{confirm:t,root:n,heading:r,workarea:o}=e;n.classList.add("open-torrent"),r.textContent="Add Torrents",t.textContent="Add";let i=c(),s=document.createElement("label");s.setAttribute("for",i),s.textContent="Please select torrent files to add:",o.append(s);let a=document.createElement("input");a.type="file",a.name="torrent-files[]",a.id=i,a.multiple="multiple",o.append(a),e.file_input=a,i=c(),s=document.createElement("label"),s.setAttribute("for",i),s.textContent="Or enter a URL:",o.append(s),a=document.createElement("input"),a.type="url",a.id=i,o.append(a),e.url_input=a,i=c(),s=document.createElement("label"),s.id="add-dialog-folder-label",s.for=i,s.textContent="Destination folder:",o.append(s);const d=document.createElement("span");d.id="free-space-text",s.append(d),o.append(s),e.freespace=d,a=document.createElement("input"),a.type="text",a.id="add-dialog-folder-input",a.addEventListener("change",(()=>this._updateFreeSpaceInAddDialog())),a.value=this.controller.session_properties["download-dir"],o.append(a),e.folder_input=a;const A=document.createElement("div");o.append(A);const p=document.createElement("input");return p.type="checkbox",p.id="auto-start-check",p.checked=this.controller.shouldAddedTorrentsStart(),A.append(p),e.start_input=p,s=document.createElement("label"),s.id="auto-start-label",s.setAttribute("for",p.id),s.textContent="Start when added",A.append(s),e}}const G="speed-limit-down",U="speed-limit-down-enabled",Q="queue-move-bottom",Y="queue-move-down",W="queue-move-top",J="queue-move-up",H="../rpc",q="alt-speed-down",Z="alt-speed-enabled",V="alt-speed-up",K="speed-limit-up",X="speed-limit-up-enabled";class ${constructor(e){this._controller=e,this._error="",this._session_id=""}sendRequest(e,t,n){const r=new Headers;r.append("cache-control","no-cache"),r.append("content-type","application/json"),r.append("pragma","no-cache"),this._session_id&&r.append($._SessionHeader,this._session_id);let o=null;fetch(H,{body:JSON.stringify(e),headers:r,method:"POST"}).then((e=>{if(o=e,409===e.status){const t=new Error($._SessionHeader);throw t.header=e.headers.get($._SessionHeader),t}return e.json()})).then((e=>{t&&t.call(n,e,o)})).catch((r=>{if(r.message===$._SessionHeader)return this._session_id=r.header,void this.sendRequest(e,t,n);console.trace(r),this._controller.togglePeriodicSessionRefresh(!1),this._controller.setCurrentPopup(new R({heading:"Connection failed",message:"Could not connect to the server. You may need to reload the page to reconnect."}))}))}loadDaemonPrefs(e,t){this.sendRequest({method:"session-get"},e,t)}checkPort(e,t){this.sendRequest({method:"port-test"},e,t)}renameTorrent(e,t,n,r,o){const i={arguments:{ids:e,name:n,path:t},method:"torrent-rename-path"};this.sendRequest(i,r,o)}loadDaemonStats(e,t){this.sendRequest({method:"session-stats"},e,t)}updateTorrents(e,t,n,r){const o={arguments:{fields:t,format:"table"},method:"torrent-get"};e&&(o.arguments.ids=e),this.sendRequest(o,(e=>{const t=e.arguments;n.call(r,t.torrents,t.removed)}))}getFreeSpace(e,t,n){const r={arguments:{path:e},method:"free-space"};this.sendRequest(r,(e=>{const r=e.arguments;t.call(n,r.path,r["size-bytes"])}))}changeFileCommand(e,t,n){const r={ids:[e]};r[n]=t,this.sendRequest({arguments:r,method:"torrent-set"},(()=>{this._controller.refreshTorrents([e])}))}sendTorrentSetRequests(e,t,n,r,o){n||(n={}),n.ids=t;const i={arguments:n,method:e};this.sendRequest(i,r,o)}sendTorrentActionRequests(e,t,n,r){this.sendTorrentSetRequests(e,t,null,n,r)}startTorrents(e,t,n,r){const o=t?"torrent-start-now":"torrent-start";this.sendTorrentActionRequests(o,e,n,r)}stopTorrents(e,t,n){this.sendTorrentActionRequests("torrent-stop",e,t,n)}moveTorrents(e,t,n,r){this.sendTorrentSetRequests("torrent-set-location",e,{location:t,move:!0},n,r)}removeTorrents(e,t,n){this.sendTorrentActionRequests("torrent-remove",e,t,n)}removeTorrentsAndData(e){const t={arguments:{"delete-local-data":!0,ids:[]},method:"torrent-remove"};if(e)for(let n=0,r=e.length;n{this._controller.refreshTorrents()}))}verifyTorrents(e,t,n){this.sendTorrentActionRequests("torrent-verify",e,t,n)}reannounceTorrents(e,t,n){this.sendTorrentActionRequests("torrent-reannounce",e,t,n)}addTorrentByUrl(e,t){e.match(/^[\da-f]{40}$/i)&&(e="magnet:?xt=urn:btih:"+e);const n={arguments:{filename:e,paused:t.paused},method:"torrent-add"};this.sendRequest(n,(()=>{this._controller.refreshTorrents()}))}savePrefs(e){const t={arguments:e,method:"session-set"};this.sendRequest(t,(()=>{this._controller.loadDaemonPrefs()}))}updateBlocklist(){this.sendRequest({method:"blocklist-update"},(()=>{this._controller.loadDaemonPrefs()}))}moveTorrentsToTop(e,t,n){this.sendTorrentActionRequests(W,e,t,n)}moveTorrentsToBottom(e,t,n){this.sendTorrentActionRequests(Q,e,t,n)}moveTorrentsUp(e,t,n){this.sendTorrentActionRequests(J,e,t,n)}moveTorrentsDown(e,t,n){this.sendTorrentActionRequests(Y,e,t,n)}}function ee(e,t){const n=document.createElement("fieldset");n.classList.add("section",e);const r=document.createElement("legend");return r.classList.add("title"),r.textContent=t,n.append(r),n}function te(e,t,n,r){const o=document.createElement("button");return o.textContent=t,o.addEventListener("click",r),e.append(o),o.dataset.action=n,o}$._SessionHeader="X-Transmission-Session-Id";class ne extends EventTarget{constructor(e,t,n,r){super(),this.action_listener=this._onActionChange.bind(this),this.action_manager=r,this.action_manager.addEventListener("change",this.action_listener),this.prefs_listener=this._onPrefsChange.bind(this),this.prefs=t,this.prefs.addEventListener("change",this.prefs_listener),this.closed=!1,this.remote=n,this.name="overflow-menu",this.session_listener=this._onSessionChange.bind(this),this.session_manager=e,this.session_manager.addEventListener("session-change",this.session_listener);const{session_properties:o}=e;Object.assign(this,this._create(o)),this.outside=new f(this.root),this.outside.addEventListener("click",(()=>this.close())),Object.seal(this),this.show()}show(){document.body.append(this.root)}close(){if(!this.closed){this.outside.stop(),this.session_manager.removeEventListener("session-change",this.session_listener),this.action_manager.removeEventListener("change",this.action_listener),this.prefs.removeEventListener("change",this.prefs_listener),this.root.remove(),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))this[e]=null;this.closed=!0}}_onSessionChange(e){const{alt_speed_check:t}=this.elements,{session_properties:n}=e;t.checked=n[Z]}_onPrefsChange(e){switch(e.key){case v.SortDirection:case v.SortMode:this.root.querySelector(`[data-pref="${e.key}"]`).value=e.value}}_onActionChange(e){const t=this.actions[e.action];t&&this._updateElement(t)}_updateElement(e){if(e.dataset.action){const{action:t}=e.dataset,n=this.action_manager.keyshortcuts(t);n&&e.setAttribute("aria-keyshortcuts",n),g(e,this.action_manager.isEnabled(t))}}_onClick(e){const{action:t,pref:n}=e.target.dataset;t?this.action_manager.click(t):n?this.prefs[n]=e.target.value:(console.log("unhandled"),console.log(e),console.trace())}_create(e){const t={},n={},r=this._onClick.bind(this),o=document.createElement("div");o.classList.add("overflow-menu","popup");let i=ee("display","Display");o.append(i);let s=document.createElement("div");s.id="display-options",i.append(s);let a=document.createElement("div");s.append(a);let l=document.createElement("label");l.id="display-sort-mode-label",l.textContent="Sort by",a.append(l);let c=document.createElement("select");c.id="display-sort-mode-select",c.dataset.pref=v.SortMode,a.append(c);const d=[[v.SortByActivity,"Activity"],[v.SortByAge,"Age"],[v.SortByName,"Name"],[v.SortByProgress,"Progress"],[v.SortByQueue,"Queue order"],[v.SortByRatio,"Ratio"],[v.SortBySize,"Size"],[v.SortByState,"State"]];for(const[e,t]of d){const n=document.createElement("option");n.value=e,n.textContent=t,c.append(n)}l.setAttribute("for",c.id),c.value=this.prefs.sort_mode,c.addEventListener("change",(e=>{this.prefs.sort_mode=e.target.value})),a=document.createElement("div"),s.append(a);let A=document.createElement("input");A.id="display-sort-reverse-check",A.dataset.pref=v.SortDirection,A.type="checkbox",a.append(A),l=document.createElement("label"),l.id="display-sort-reverse-label",l.setAttribute("for",A.id),l.textContent="Reverse sort",a.append(l),A.checked=this.prefs.sort_direction!==v.SortAscending,A.addEventListener("input",(e=>{this.prefs.sort_direction=e.target.checked?v.SortDescending:v.SortAscending})),a=document.createElement("div"),s.append(a);const p="toggle-compact-rows";A=document.createElement("input"),A.id="display-compact-check",A.dataset.action=p,A.type="checkbox",a.append(A),l=document.createElement("label"),l.id="display-compact-label",l.for=A.id,l.setAttribute("for",A.id),l.textContent=this.action_manager.text(p),a.append(l),A.checked=this.prefs.display_mode===v.DisplayCompact,A.addEventListener("input",(e=>{const{checked:t}=e.target;this.prefs.display_mode=t?v.DisplayCompact:v.DisplayFull})),a=document.createElement("div"),s.append(a),A=document.createElement("input"),A.id="display-fullscreen-check",A.type="checkbox";const u=()=>null!==document.fullscreenElement;A.checked=u(),A.addEventListener("input",(()=>{u()?document.exitFullscreen():document.body.requestFullscreen()})),document.addEventListener("fullscreenchange",(()=>{A.checked=u()})),a.append(A),l=document.createElement("label"),l.id="display-fullscreen-label",l.for=A.id,l.setAttribute("for",A.id),l.textContent="Fullscreen",a.append(l),i=ee("speed","Speed Limit"),o.append(i),s=document.createElement("div"),s.id="speed-options",i.append(s),a=document.createElement("div"),a.classList.add("speed-up"),s.append(a),l=document.createElement("label"),l.id="speed-up-label",l.textContent="Upload:",a.append(l);const g="Unlimited";c=document.createElement("select"),c.id="speed-up-select",a.append(c);const m=["10","100","200","500","750",g];for(const t of[...new Set(m).add(""+e[K]).values()].sort()){const e=document.createElement("option");e.value=t,e.textContent=t===g?g:T.speed(t),c.append(e)}l.setAttribute("for",c.id),c.value=e[X]?""+e[K]:g,c.addEventListener("change",(e=>{const{value:t}=e.target;console.log(e),e.target.value===g?this.remote.savePrefs({[X]:!1}):this.remote.savePrefs({[X]:!0,[K]:Number.parseInt(t,10)})})),a=document.createElement("div"),a.classList.add("speed-down"),s.append(a),l=document.createElement("label"),l.id="speed-down-label",l.textContent="Download:",a.append(l),c=document.createElement("select"),c.id="speed-down-select",a.append(c);for(const t of[...new Set(m).add(""+e[G]).values()].sort()){const e=document.createElement("option");e.value=t,e.textContent=t,c.append(e)}l.setAttribute("for",c.id),c.value=e[U]?""+e[G]:g,c.addEventListener("change",(e=>{const{value:t}=e.target;console.log(e),e.target.value===g?this.remote.savePrefs({[U]:!1}):this.remote.savePrefs({[U]:!0,[G]:Number.parseInt(t,10)})})),a=document.createElement("div"),a.classList.add("alt-speed"),s.append(a),A=document.createElement("input"),A.id="alt-speed-check",A.type="checkbox",A.checked=e[Z],A.addEventListener("change",(e=>{this.remote.savePrefs({[Z]:e.target.checked})})),a.append(A),n.alt_speed_check=A,l=document.createElement("label"),l.id="alt-speed-image",l.setAttribute("for",A.id),a.append(l),l=document.createElement("label"),l.id="alt-speed-label",l.setAttribute("for",A.id),l.textContent="Use Temp limits",a.append(l),l=document.createElement("label"),l.id="alt-speed-values-label",l.setAttribute("for",A.id);const h=T.speed(e[V]),f=T.speed(e[q]);l.textContent=`(${h} up, ${f} down)`,a.append(l),i=ee("actions","Actions"),o.append(i);for(const e of["show-preferences-dialog","pause-all-torrents","start-all-torrents"]){const n=this.action_manager.text(e);t[e]=te(i,n,e,r)}i=ee("info","Info"),o.append(i),s=document.createElement("div"),i.append(s);for(const e of["show-about-dialog","show-shortcuts-dialog","show-statistics-dialog"]){const n=this.action_manager.text(e);t[e]=te(s,n,e,r)}i=ee("links","Links"),o.append(i),s=document.createElement("div"),i.append(s);let b=document.createElement("a");return b.href="https://transmissionbt.com/",b.tabindex="0",b.textContent="Homepage",s.append(b),b=document.createElement("a"),b.href="https://transmissionbt.com/donate/",b.tabindex="0",b.textContent="Tip Jar",s.append(b),b=document.createElement("a"),b.href="https://github.com/transmission/transmission/",b.tabindex="0",b.textContent="Source Code",s.append(b),Object.values(t).forEach(this._updateElement.bind(this)),{actions:t,elements:n,root:o}}}class re extends EventTarget{static _initTimeDropDown(e){for(let t=0;t<96;++t){const n=15*t,r=`${Number.parseInt(t/4,10)}:${t%4*15||"00"}`;e.options[t]=new Option(r,n)}}static _initDayDropDown(e){const t=[["Everyday","127"],["Weekdays","62"],["Weekends","65"],["Sunday","1"],["Monday","2"],["Tuesday","4"],["Wednesday","8"],["Thursday","16"],["Friday","32"],["Saturday","64"]];for(let n=0;t[n];++n){const[r,o]=t[n];e.options[n]=new Option(r,o)}}_checkPort(){const e=this.elements.network.port_status_label;e.removeAttribute("data-open"),b(e,"Checking..."),this.remote.checkPort(this._onPortChecked,this)}_onPortChecked(e){const t=this.elements.network.port_status_label,n=e.arguments["port-is-open"];t.dataset.open=n,b(t,n?"Open":"Closed")}_setBlocklistButtonEnabled(e){const t=this.elements.peers.blocklist_update_button;g(t,e),t.value=e?"Update":"Updating..."}static _getValue(e){switch(e.type){case"checkbox":case"radio":return e.checked;case"number":case"text":case"url":{const t=e.value;return Number.parseInt(t,10).toString()===t?Number.parseInt(t,10):Number.parseFloat(t).toString()===t?Number.parseFloat(t):t}default:return null}}_onControlChanged(e){const{key:t}=e.target.dataset;this.remote.savePrefs({[t]:re._getValue(e.target)}),"peer-port"!==t&&"port-forwarding-enabled"!==t||this._checkPort()}_onDialogClosed(){this.dispatchEvent(new Event("closed"))}_update(e){if(e){this._setBlocklistButtonEnabled(!0);for(const[t,n]of Object.entries(e))for(const e of this.elements.root.querySelectorAll(`[data-key="${t}"]`))if("blocklist-size"===t){const t=T.number(n);e.innerHTML=`Blocklist has ${t} rules`,b(this.elements.peers.blocklist_update_button,"Update")}else switch(e.type){case"checkbox":case"radio":e.checked!==n&&(e.checked=n,e.dispatchEvent(new Event("change")));break;case"text":case"url":case"email":case"number":case"search":e.value!=n&&e!==document.activeElement&&(e.value=n,e.dispatchEvent(new Event("change")));break;case"select-one":e.value!==n&&(e.value=n,e.dispatchEvent(new Event("change")))}}}shouldAddedTorrentsStart(){return this.data.elements.root.find("#start-added-torrents")[0].checked}static _createCheckAndLabel(e,t){const n=document.createElement("div");n.id=e;const r=document.createElement("input");r.id=c(),r.type="checkbox",n.append(r);const o=document.createElement("label");return o.textContent=t,o.setAttribute("for",r.id),n.append(o),{check:r,label:o,root:n}}static _enableIfChecked(e,t){const n=()=>{"INPUT"===e.tagName?g(e,t.checked):e.classList.toggle("disabled",!t.checked)};t.addEventListener("change",n),n()}static _createTorrentsPage(){const e=document.createElement("div");e.classList.add("prefs-torrents-page");let t=document.createElement("div");t.textContent="Downloading",t.classList.add("section-label"),e.append(t),t=document.createElement("label"),t.textContent="Download to:",e.append(t);let n=document.createElement("input");n.type="text",n.id=c(),n.dataset.key="download-dir",t.setAttribute("for",n.id),e.append(n);const r=n;let o=re._createCheckAndLabel("autostart-div","Start when added");o.check.dataset.key="start-added-torrents",e.append(o.root);const i=o.check;o=re._createCheckAndLabel("suffix-div",'Append "part" to incomplete files\' names'),o.check.dataset.key="rename-partial-files",e.append(o.root);const s=o.check;t=document.createElement("div"),t.textContent="Seeding",t.classList.add("section-label"),e.append(t),o=re._createCheckAndLabel("stop-ratio-div","Stop seeding at ratio:"),o.check.dataset.key="seedRatioLimited",e.append(o.root);const a=o.check;n=document.createElement("input"),n.type="number",n.dataset.key="seedRatioLimit",e.append(n),re._enableIfChecked(n,o.check);const l=n;o=re._createCheckAndLabel("stop-idle-div","Stop seeding if idle for N mins:"),o.check.dataset.key="idle-seeding-limit-enabled",e.append(o.root);const d=o.check;n=document.createElement("input"),n.type="number",n.dataset.key="idle-seeding-limit",e.append(n),re._enableIfChecked(n,o.check);return{autostart_check:i,download_dir:r,root:e,stop_idle_check:d,stop_idle_input:n,stop_ratio_check:a,stop_ratio_input:l,suffix_check:s}}static _createSpeedPage(){const e=document.createElement("div");e.classList.add("prefs-speed-page");let t=document.createElement("div");t.textContent="Speed Limits",t.classList.add("section-label"),e.append(t);let n=re._createCheckAndLabel("upload-speed-div","Upload (kB/s):");n.check.dataset.key="speed-limit-up-enabled",e.append(n.root);const r=n.check;let o=document.createElement("input");o.type="number",o.dataset.key="speed-limit-up",e.append(o),re._enableIfChecked(o,n.check);const i=o;n=re._createCheckAndLabel("download-speed-div","Download (kB/s):"),n.check.dataset.key="speed-limit-down-enabled",e.append(n.root);const s=n.check;o=document.createElement("input"),o.type="number",o.dataset.key="speed-limit-down",e.append(o),re._enableIfChecked(o,n.check);const a=o;t=document.createElement("div"),t.textContent="Alternative Speed Limits",t.classList.add("section-label","alt-speed-section-label"),e.append(t),t=document.createElement("div"),t.textContent="Override normal speed limits manually or at scheduled times",t.classList.add("alt-speed-label"),e.append(t),t=document.createElement("label"),t.textContent="Upload (kB/s):",e.append(t),o=document.createElement("input"),o.type="number",o.dataset.key="alt-speed-up",o.id=c(),t.setAttribute("for",o.id),e.append(o);const l=o;t=document.createElement("label"),t.textContent="Download (kB/s):",e.append(t),o=document.createElement("input"),o.type="number",o.dataset.key="alt-speed-down",o.id=c(),t.setAttribute("for",o.id),e.append(o);const d=o;n=re._createCheckAndLabel("alt-times-div","Scheduled times"),n.check.dataset.key="alt-speed-time-enabled",e.append(n.root);const A=n.check;t=document.createElement("label"),t.textContent="From:",re._enableIfChecked(t,n.check),e.append(t);let p=document.createElement("select");p.id=c(),p.dataset.key="alt-speed-time-begin",re._initTimeDropDown(p),t.setAttribute("for",p.id),e.append(p),re._enableIfChecked(p,n.check);const u=p;t=document.createElement("label"),t.textContent="To:",re._enableIfChecked(t,n.check),e.append(t),p=document.createElement("select"),p.id=c(),p.dataset.key="alt-speed-time-end",re._initTimeDropDown(p),t.setAttribute("for",p.id),e.append(p),re._enableIfChecked(p,n.check);const g=p;t=document.createElement("label"),t.textContent="On days:",re._enableIfChecked(t,n.check),e.append(t),p=document.createElement("select"),p.id=c(),p.dataset.key="alt-speed-time-day",re._initDayDropDown(p),t.setAttribute("for",p.id),e.append(p),re._enableIfChecked(p,n.check);return{alt_days_select:p,alt_download_speed_input:d,alt_from_select:u,alt_times_check:A,alt_to_select:g,alt_upload_speed_input:l,download_speed_check:s,download_speed_input:a,root:e,upload_speed_check:r,upload_speed_input:i}}static _createPeersPage(){const e=document.createElement("div");e.classList.add("prefs-peers-page");let t=document.createElement("div");t.textContent="Connections",t.classList.add("section-label"),e.append(t);let n=re._createCheckAndLabel("max-peers-per-torrent-div","Max peers per torrent:");e.append(n.root);const r=n.check;let o=document.createElement("input");o.type="number",o.dataset.key="peer-limit-per-torrent",e.append(o),re._enableIfChecked(o,n.check);const i=o;n=re._createCheckAndLabel("max-peers-overall-div","Max peers overall:"),e.append(n.root);const s=n.check;o=document.createElement("input"),o.type="number",o.dataset.key="peer-limit-global",e.append(o),re._enableIfChecked(o,n.check);const a=o;t=document.createElement("div"),t.textContent="Options",t.classList.add("section-label"),e.append(t),t=document.createElement("label"),t.textContent="Encryption mode:",e.append(t);const l=document.createElement("select");l.id=c(),l.dataset.key="encryption",l.options[0]=new Option("Prefer encryption","preferred"),l.options[1]=new Option("Allow encryption","tolerated"),l.options[2]=new Option("Require encryption","required"),e.append(l);const d=l;n=re._createCheckAndLabel("use-pex-div","Use PEX to find more peers"),n.check.title="PEX is a tool for exchanging peer lists with the peers you're connected to.",n.check.dataset.key="pex-enabled",n.label.title=n.check.title,e.append(n.root);const A=n.check;n=re._createCheckAndLabel("use-dht-div","Use DHT to find more peers"),n.check.title="DHT is a tool for finding peers without a tracker.",n.check.dataset.key="dht-enabled",n.label.title=n.check.title,e.append(n.root);const p=n.check;n=re._createCheckAndLabel("use-lpd-div","Use LPD to find more peers"),n.check.title="LPD is a tool for finding peers on your local network.",n.check.dataset.key="lpd-enabled",n.label.title=n.check.title,e.append(n.root);const u=n.check;t=document.createElement("div"),t.textContent="Blocklist",t.classList.add("section-label"),e.append(t),n=re._createCheckAndLabel("blocklist-enabled-div","Enable blocklist:"),n.check.dataset.key="blocklist-enabled",e.append(n.root);const g=n.check;o=document.createElement("input"),o.type="url",o.value="http://www.example.com/blocklist",o.dataset.key="blocklist-url",e.append(o),re._enableIfChecked(o,n.check);const m=o;t=document.createElement("label"),t.textContent="Blocklist has {n} rules",t.dataset.key="blocklist-size",t.classList.add("blocklist-size-label"),re._enableIfChecked(t,n.check),e.append(t);const h=document.createElement("button");h.classList.add("blocklist-update-button"),h.textContent="Update",e.append(h),re._enableIfChecked(h,n.check);return{blocklist_enabled_check:g,blocklist_update_button:h,blocklist_url_input:m,dht_check:p,encryption_select:d,lpd_check:u,max_peers_overall_check:s,max_peers_overall_input:a,max_peers_per_torrent_check:r,max_peers_per_torrent_input:i,pex_check:A,root:e}}static _createNetworkPage(){const e=document.createElement("div");e.classList.add("prefs-network-page");let t=document.createElement("div");t.textContent="Listening Port",t.classList.add("section-label"),e.append(t),t=document.createElement("label"),t.textContent="Peer listening port:",e.append(t);const n=document.createElement("input");n.type="number",n.dataset.key="peer-port",n.id=c(),t.setAttribute("for",n.id),e.append(n);const r=n,o=document.createElement("div");o.classList.add("port-status"),t=document.createElement("label"),t.textContent="Port is",o.append(t);const i=document.createElement("label");i.textContent="?",i.classList.add("port-status-label"),o.append(i),e.append(o);let s=re._createCheckAndLabel("randomize-port","Randomize port on launch");s.check.dataset.key="peer-port-random-on-start",e.append(s.root);const a=s.check;s=re._createCheckAndLabel("port-forwarding","Use port forwarding from my router"),s.check.dataset.key="port-forwarding-enabled",e.append(s.root);const l=s.check;t=document.createElement("div"),t.textContent="Options",t.classList.add("section-label"),e.append(t),s=re._createCheckAndLabel("utp-enabled","Enable uTP for peer communication"),s.check.dataset.key="utp-enabled",e.append(s.root);return{port_forwarding_check:l,port_input:r,port_status_label:i,random_port_check:a,root:e,utp_check:s.check}}static _create(){const e={network:re._createNetworkPage(),peers:re._createPeersPage(),speed:re._createSpeedPage(),torrents:re._createTorrentsPage()};return{...a("prefs-dialog",[["prefs-tab-torrent",e.torrents.root],["prefs-tab-speed",e.speed.root],["prefs-tab-peers",e.peers.root],["prefs-tab-network",e.network.root]]),...e}}constructor(e,t){super(),this.closed=!1,this.session_manager=e,this.remote=t,this.update_soon=()=>this._update(this.session_manager.session_properties),this.elements=re._create(),this.elements.peers.blocklist_update_button.addEventListener("click",(e=>{b(e.target,"Updating blocklist..."),this.remote.updateBlocklist(),this._setBlocklistButtonEnabled(!1)})),this.outside=new f(this.elements.root),this.outside.addEventListener("click",(()=>this.close())),Object.seal(this);const n=this._onControlChanged.bind(this),r=e=>{for(const t of Object.values(e))if("INPUT"===t.tagName)switch(t.type){case"checkbox":case"radio":case"number":case"text":case"url":t.addEventListener("change",n);break;default:console.trace("unhandled input: "+t.type)}};r(this.elements.network),r(this.elements.peers),r(this.elements.speed),r(this.elements.torrents),this.session_manager.addEventListener("session-change",this.update_soon),this.update_soon(),document.body.append(this.elements.root)}close(){if(!this.closed){this.outside.stop(),this.session_manager.removeEventListener("session-change",this.update_soon),this.elements.root.remove(),dispatchEvent(new Event("close"));for(const e of Object.keys(this))this[e]=null;this.closed=!0}}}class oe extends EventTarget{constructor(e){super(),this.options=e,this.elements=oe._create(e),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),this.elements.confirm.addEventListener("click",(()=>this._onConfirm())),document.body.append(this.elements.root),this.elements.dismiss.focus()}close(){if(!this.closed){this.elements.root.remove(),this.dispatchEvent(new Event("close"));for(const e of Object.keys(this))delete this[e];this.closed=!0}}_onDismiss(){this.close()}_onConfirm(){const{torrents:e}=this.options;e.length>0&&(this.options.trash?this.options.remote.removeTorrentsAndData(e):this.options.remote.removeTorrents(e)),this.close()}static _create(e){const{trash:t}=e,{heading:n,message:r}=oe._createMessage(e),o=l("remove-dialog");return o.heading.textContent=n,o.message.textContent=r,o.confirm.textContent=t?"Trash":"Remove",o}static _createMessage(e){let t=null,n=null;const{torrents:r}=e,[o]=r;return e.trash&&1===r.length?(t=`Remove ${o.getName()} and delete data?`,n="All data downloaded for this torrent will be deleted. Are you sure you want to remove it?"):e.trash?(t=`Remove ${r.length} transfers and delete data?`,n="All data downloaded for these torrents will be deleted. Are you sure you want to remove them?"):1===r.length?(t=`Remove ${o.getName()}?`,n="Once removed, continuing the transfer will require the torrent file. Are you sure you want to remove it?"):(t=`Remove ${r.length} transfers?`,n="Once removed, continuing the transfers will require the torrent files. Are you sure you want to remove them?"),{heading:t,message:n}}}class ie extends EventTarget{constructor(e,t){super(),this.controller=e,this.remote=t,this.elements={},this.torrents=[],this.show()}show(){const e=this.controller.getSelectedTorrents();1===e.length?(this.torrents=e,this.elements=ie._create(),this.elements.entry.value=e[0].getName(),document.body.append(this.elements.root),this.elements.entry.focus()):console.trace()}close(){this.elements.root.remove(),this.dispatchEvent(new Event("close")),delete this.controller,delete this.remote,delete this.elements,delete this.torrents}_onDismiss(){this.close()}_onConfirm(){const[e]=this.torrents,t=e.getName(),n=this.elements.entry.value;this.remote.renameTorrent([e.getId()],t,n,(t=>{"success"===t.result&&e.refresh(t.arguments)})),this.close()}static _create(){const e=l("rename-dialog");e.root.setAttribute("aria-label","Rename Torrent"),e.heading.textContent="Enter new name:",e.confirm.textContent="Rename",e.dismiss.addEventListener("click",(()=>this._onDismiss())),e.confirm.addEventListener("click",(()=>this._onConfirm()));const t=document.createElement("label");t.setAttribute("for","torrent-rename-name"),t.textContent="Enter new name:",e.workarea.append(t);const n=document.createElement("input");return n.setAttribute("type","text"),n.id="torrent-rename-name",e.entry=n,e.workarea.append(n),e}}class se extends EventTarget{constructor(e){super(),this.elements=se._create(e),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),document.body.append(this.elements.root),this.elements.dismiss.focus()}close(){this.elements.root.remove(),this.dispatchEvent(new Event("close")),delete this.elements}_onDismiss(){this.close()}static _create(e){const t=l("shortcuts-dialog");t.root.setAttribute("aria-label","Keyboard Shortcuts");const n=document.createElement("table"),r=document.createElement("thead");n.append(r);let o=document.createElement("tr");r.append(o);let i=document.createElement("th");i.textContent="Key",o.append(i),i=document.createElement("th"),i.textContent="Action",o.append(i);const s=document.createElement("tbody");n.append(s);const a={};for(const[t,n]of e.allShortcuts().entries()){const e=t.split("+");a[[e.pop(),...e].join("+")]={name:n,shortcut:t}}for(const[,t]of Object.entries(a).sort()){const{name:n,shortcut:r}=t;o=document.createElement("tr"),s.append(o);let i=document.createElement("td");i.textContent=r.replaceAll("+"," + "),o.append(i),i=document.createElement("td"),i.textContent=e.text(n),o.append(i)}return t.heading.textContent="Transmission",t.dismiss.textContent="Close",t.heading.textContent="Keyboard shortcuts",t.message.append(n),t.confirm.remove(),delete t.confirm,t}}class ae extends EventTarget{constructor(e){super(),this.remote=e;const t=()=>this.remote.loadDaemonStats((e=>this._update(e.arguments)));this.interval=setInterval(t,5e3),t(),this.elements=ae._create(),this.elements.dismiss.addEventListener("click",(()=>this._onDismiss())),document.body.append(this.elements.root),this.elements.dismiss.focus()}close(){if(!this.closed){clearInterval(this.interval),this.elements.root.remove();for(const e of Object.keys(this))delete this[e];this.closed=!0}}_onDismiss(){this.close()}_update(e){console.log(e);const t=T;let n=e["current-stats"],r=s.ratio(n.uploadedBytes,n.downloadedBytes);b(this.elements.session.up,t.size(n.uploadedBytes)),b(this.elements.session.down,t.size(n.downloadedBytes)),b(this.elements.session.ratio,t.ratioString(r)),b(this.elements.session.time,t.timeInterval(n.secondsActive)),n=e["cumulative-stats"],r=s.ratio(n.uploadedBytes,n.downloadedBytes),b(this.elements.total.up,t.size(n.uploadedBytes)),b(this.elements.total.down,t.size(n.downloadedBytes)),b(this.elements.total.ratio,t.ratioString(r)),b(this.elements.total.time,t.timeInterval(n.secondsActive))}static _create(){const e=l("statistics-dialog"),{workarea:t}=e;e.confirm.remove(),e.dismiss.textContent="Close",delete e.confirm;const n="Statistics";e.root.setAttribute("aria-label",n),e.heading.textContent=n;const r=["Uploaded:","Downloaded:","Ratio:","Running time:"];let o=d("Current session",r);const[i,s,a,c]=o.children,A=e.session={};A.up=i,A.down=s,A.ratio=a,A.time=c,t.append(o.root),o=d("Total",r);const[p,u,g,m]=o.children,h=e.total={};return h.up=p,h.down=u,h.ratio=g,h.time=m,t.append(o.root),e}}class le{static getProgressInfo(e,t){const n=t.getStatus(),r=["torrent-progress-bar"];let o=null;if(n===j._StatusStopped&&r.push("paused"),t.needsMetaData())r.push("magnet"),o=Math.round(100*t.getMetadataPercentComplete());else if(n===j._StatusCheck)r.push("verify"),o=Math.round(100*t.getRecheckProgress());else if(t.getLeftUntilDone()>0)r.push("leech"),o=Math.round(100*t.getPercentDone());else{r.push("seed");const n=t.seedRatioLimit(e);o=n>0?100*t.getUploadRatio()/n:100}return t.isQueued()&&r.push("queued"),{classList:r,percent:o}}static renderProgressbar(e,t,n){const r=le.getProgressInfo(e,t);n.className=r.classList.join(" "),n.style["background-size"]=r.percent+"% 100%, 100% 100%"}static formatUL(e){return"▲"+T.speedBps(e.getUploadSpeed())}static formatDL(e){return"▼"+T.speedBps(e.getDownloadSpeed())}static formatETA(e){const t=e.getETA();return t<0||t>=3596400?"":"ETA: "+T.timeInterval(t)}}class ce{static getPeerDetails(e){const t=T,n=e.getErrorMessage();if(n)return n;if(e.isDownloading()){const n=e.getPeersConnected(),r=e.getWebseedsSendingToUs();return r&&n?["Downloading from",e.getPeersSendingToUs(),"of",t.countString("peer","peers",n),"and",t.countString("web seed","web seeds",r),"–",le.formatDL(e),le.formatUL(e)].join(" "):r?["Downloading from",t.countString("web seed","web seeds",r),"–",le.formatDL(e),le.formatUL(e)].join(" "):["Downloading from",e.getPeersSendingToUs(),"of",t.countString("peer","peers",n),"–",le.formatDL(e),le.formatUL(e)].join(" ")}return e.isSeeding()?["Seeding to",e.getPeersGettingFromUs(),"of",t.countString("peer","peers",e.getPeersConnected()),"-",le.formatUL(e)].join(" "):e.isChecking()?["Verifying local data (",T.percentString(100*e.getRecheckProgress()),"% tested)"].join(""):e.getStateString()}static getProgressDetails(e,t){if(t.needsMetaData()){let e="retrieving";t.isStopped()&&(e="needs");const n=100*t.getMetadataPercentComplete();return[`Magnetized transfer - ${e} metadata (`,T.percentString(n),"%)"].join("")}const n=t.getSizeWhenDone(),r=t.getTotalSize(),o=t.isDone()||t.isSeeding(),i=[];if(o?(r===n?i.push(T.size(r)):i.push(T.size(n)," of ",T.size(t.getTotalSize())," (",t.getPercentDoneStr(),"%)"),i.push(", uploaded ",T.size(t.getUploadedEver())," (Ratio ",T.ratioString(t.getUploadRatio()),")")):i.push(T.size(n-t.getLeftUntilDone())," of ",T.size(n)," (",t.getPercentDoneStr(),"%)"),!t.isStopped()&&(!o||t.seedRatioLimit(e)>0)){i.push(" - ");const e=t.getETA();e<0||e>=3596400?i.push("remaining time unknown"):i.push(T.timeInterval(t.getETA())," remaining")}return i.join("")}render(e,t,n){const r=t.isStopped();let o=n._name_container;b(o,t.getName()),o.classList.toggle("paused",r),le.renderProgressbar(e,t,n._progressbar),n._progressbar.classList.add("full");const i=t.getError()!==j._ErrNone;o=n._peer_details_container,o.classList.toggle("error",i),b(o,ce.getPeerDetails(t)),o=n._progress_details_container,b(o,ce.getProgressDetails(e,t)),o=n._toggle_running_button,o.alt=r?"Resume":"Pause",o.dataset.action=r?"resume":"pause"}createRow(e){const t=document.createElement("li");t.className="torrent";const n=document.createElement("div");n.classList.add("icon"),n.dataset.iconMimeType=e.getPrimaryMimeType().split("/",1).pop(),n.dataset.iconMultifile=e.getFileCount()>1?"true":"false";const r=document.createElement("div");r.className="torrent-name";const o=document.createElement("div");o.className="torrent-peer-details";const i=document.createElement("div");i.classList.add("torrent-progress");const s=document.createElement("div");s.classList.add("torrent-progress-bar","full"),i.append(s);const a=document.createElement("a");a.className="torrent-pauseresume-button",i.append(a);const l=document.createElement("div");return l.className="torrent-progress-details",t.append(n),t.append(r),t.append(o),t.append(i),t.append(l),t._icon=n,t._name_container=r,t._peer_details_container=o,t._progress_details_container=l,t._progressbar=s,t._toggle_running_button=a,t}}class de{static getPeerDetails(e){const t=e.getErrorMessage();if(t)return t;if(e.isDownloading()){const t=e.getDownloadSpeed()>0,n=e.getUploadSpeed()>0;if(!n&&!t)return"Idle";const r=[le.formatETA(e)+" "];return t&&r.push(le.formatDL(e)),n&&r.push(le.formatUL(e)),r.join(" ")}return e.isSeeding()?`Ratio: ${T.ratioString(e.getUploadRatio())}, ${le.formatUL(e)}`:e.getStateString()}render(e,t,n){let r=n._name_container;r.classList.toggle("paused",t.isStopped()),b(r,t.getName());const o=t.getError()!==j._ErrNone;r=n._details_container,r.classList.toggle("error",o),b(r,de.getPeerDetails(t)),le.renderProgressbar(e,t,n._progressbar),n._progressbar.classList.add("compact")}createRow(e){const t=document.createElement("div");t.classList.add("torrent-progress-bar","compact");const n=document.createElement("div");n.classList.add("icon"),n.dataset.iconMimeType=e.getPrimaryMimeType().split("/",1).pop(),n.dataset.iconMultifile=e.getFileCount()>1?"true":"false";const r=document.createElement("div");r.className="torrent-peer-details compact";const o=document.createElement("div");o.className="torrent-name compact";const i=document.createElement("li");return i.append(t),i.append(r),i.append(o),i.append(n),i.className="torrent compact",i._progressbar=t,i._details_container=r,i._name_container=o,i}}class Ae{constructor(e,t,n){this._view=e,this._torrent=n,this._element=e.createRow(n);const r=()=>this.render(t);this._torrent.addEventListener("dataChanged",r),r()}getElement(){return this._element}render(e){const t=this.getTorrent();t&&this._view.render(e,t,this.getElement())}isSelected(){return this.getElement().classList.contains("selected")}getTorrent(){return this._torrent}getTorrentId(){return this.getTorrent().getId()}}class pe extends EventTarget{constructor(e,t,n){super(),this.action_manager=e,this.notifications=t,this.prefs=n,this.remote=new $(this),this.addEventListener("torrent-selection-changed",(e=>this.action_manager.update(e))),this.filterText="",this._torrents={},this._rows=[],this.dirtyTorrents=new Set,this.refilterSoon=A((()=>this._refilter(!1))),this.refilterAllSoon=A((()=>this._refilter(!0))),this.boundPopupCloseListener=this.popupCloseListener.bind(this),this.dispatchSelectionChangedSoon=A((()=>this._dispatchSelectionChanged()),200);for(const e of document.querySelectorAll("button[data-action]")){const{action:t}=e.dataset;g(e,this.action_manager.isEnabled(t)),e.addEventListener("click",(()=>{this.action_manager.click(t)}))}document.querySelector("#filter-tracker").addEventListener("change",(e=>{this.setFilterTracker("all"===e.target.value?null:e.target.value)})),this.action_manager.addEventListener("change",(e=>{for(const t of document.querySelectorAll(`[data-action="${e.action}"]`))g(t,e.enabled)})),this.action_manager.addEventListener("click",(e=>{switch(e.action){case"deselect-all":this._deselectAll();break;case"move-bottom":this._moveBottom();break;case"move-down":this._moveDown();break;case"move-top":this._moveTop();break;case"move-up":this._moveUp();break;case"open-torrent":this.setCurrentPopup(new O(this,this.remote));break;case"pause-all-torrents":this._stopTorrents(this._getAllTorrents());break;case"pause-selected-torrents":this._stopTorrents(this.getSelectedTorrents());break;case"reannounce-selected-torrents":this._reannounceTorrents(this.getSelectedTorrents());break;case"remove-selected-torrents":this._removeSelectedTorrents(!1);break;case"resume-selected-torrents":this._startSelectedTorrents(!1);break;case"resume-selected-torrents-now":this._startSelectedTorrents(!0);break;case"select-all":this._selectAll();break;case"show-about-dialog":this.setCurrentPopup(new y(this.version_info));break;case"show-inspector":this.setCurrentPopup(new z(this));break;case"show-move-dialog":this.setCurrentPopup(new P(this,this.remote));break;case"show-overflow-menu":if(this.popup instanceof ne)this.setCurrentPopup(null);else{this.setCurrentPopup(new ne(this,this.prefs,this.remote,this.action_manager));const e=document.querySelector("#toolbar-overflow").getBoundingClientRect();h(this.popup.root,e.left+e.width,e.top+e.height,document.body)}break;case"show-preferences-dialog":this.setCurrentPopup(new re(this,this.remote));break;case"show-shortcuts-dialog":this.setCurrentPopup(new se(this.action_manager));break;case"show-statistics-dialog":this.setCurrentPopup(new ae(this.remote));break;case"show-rename-dialog":this.setCurrentPopup(new ie(this,this.remote));break;case"start-all-torrents":this._startTorrents(this._getAllTorrents());break;case"toggle-compact-rows":this.prefs.display_mode=this.prefs.display_mode!==v.DisplayCompact?v.DisplayCompact:v.DisplayFull;break;case"trash-selected-torrents":this._removeSelectedTorrents(!0);break;case"verify-selected-torrents":this._verifyTorrents(this.getSelectedTorrents());break;default:console.warn("unhandled action: "+e.action)}}));let r=document.querySelector("#filter-mode");r.value=this.prefs.filter_mode,r.addEventListener("change",(e=>{this.prefs.filter_mode=e.target.value})),document.addEventListener("keydown",this._keyDown.bind(this)),document.addEventListener("keyup",this._keyUp.bind(this)),r=document.querySelector("#torrent-container"),r.addEventListener("click",(()=>{this.popup&&"inspector"!==this.popup.name?this.setCurrentPopup(null):this._deselectAll()})),r.addEventListener("dragenter",pe._dragenter),r.addEventListener("dragover",pe._dragenter),r.addEventListener("drop",this._drop.bind(this)),this._setupSearchBox(),this.elements={torrent_list:document.querySelector("#torrent-list")},this.elements.torrent_list.addEventListener("contextmenu",(e=>{let t=event.target;for(;t&&!t.classList.contains("torrent");)t=t.parentNode;const n=this._rows.find((e=>e.getElement()===t));n&&!n.isSelected()&&this._setSelectedRow(n);const r=new E(this.action_manager);this.setCurrentPopup(r),h(r.root,e.x,e.y,document.querySelector("#torrent-container")),e.preventDefault()})),this.loadDaemonPrefs(),this._initializeTorrents(),this.refreshTorrents(),this.togglePeriodicSessionRefresh(!0),this.prefs.addEventListener("change",(({key:e,value:t})=>this._onPrefChanged(e,t))),this.prefs.entries().forEach((([e,t])=>this._onPrefChanged(e,t)))}loadDaemonPrefs(){this.remote.loadDaemonPrefs((e=>{this.session_properties=e.arguments}))}get session_properties(){return this._session_properties}set session_properties(e){if(p(this._session_properties,e))return;this._session_properties=Object.seal(e);const t=new Event("session-change");t.session_properties=e,this.dispatchEvent(t),this._updateGuiFromSession(e)}_setupSearchBox(){const e=document.querySelector("#torrent-search"),t="blur";e.classList.add(t),e.addEventListener("blur",(()=>e.classList.add(t))),e.addEventListener("focus",(()=>e.classList.remove(t))),e.addEventListener("keyup",(()=>this._setFilterText(e.value)))}_onPrefChanged(e,t){switch(e){case v.DisplayMode:this.torrentRenderer="compact"===t?new de:new ce,this.refilterAllSoon();break;case v.FilterMode:case v.SortDirection:case v.SortMode:this.refilterAllSoon();break;case v.RefreshRate:{clearInterval(this.refreshTorrentsInterval);const e=this.refreshTorrents.bind(this),t=1e3*Math.max(2,this.prefs.refresh_rate_sec);this.refreshTorrentsInterval=setInterval(e,t);break}case v.AltSpeedEnabled:case v.NotificationsEnabled:}}_getAllTorrents(){return Object.values(this._torrents)}static _getTorrentIds(e){return e.map((e=>e.getId()))}seedRatioLimit(){const e=this.session_properties;return e&&e.seedRatioLimited?e.seedRatioLimit:-1}_getSelectedRows(){return this._rows.filter((e=>e.isSelected()))}getSelectedTorrents(){return this._getSelectedRows().map((e=>e.getTorrent()))}_getSelectedTorrentIds(){return pe._getTorrentIds(this.getSelectedTorrents())}_setSelectedRow(e){const t=e?e.getElement():null;for(const e of this.elements.torrent_list.children)e.classList.toggle("selected",e===t);this.dispatchSelectionChangedSoon()}_selectRow(e){e.getElement().classList.add("selected"),this.dispatchSelectionChangedSoon()}_deselectRow(e){e.getElement().classList.remove("selected"),this.dispatchSelectionChangedSoon()}_selectAll(){for(const e of this.elements.torrent_list.children)e.classList.add("selected");this.dispatchSelectionChangedSoon()}_deselectAll(){for(const e of this.elements.torrent_list.children)e.classList.remove("selected");this.dispatchSelectionChangedSoon(),delete this._last_torrent_clicked}_indexOfLastTorrent(){return this._rows.findIndex((e=>e.getTorrentId()===this._last_torrent_clicked))}_selectRange(e){const t=this._indexOfLastTorrent();if(-1===t)this._selectRow(e);else{const n=this._rows.indexOf(e),r=Math.min(t,n),o=Math.max(t,n);for(let e=r;e<=o;++e)this._selectRow(this._rows[e])}this.dispatchSelectionChangedSoon()}_dispatchSelectionChanged(){const e=[],t=[];this._rows.forEach((n=>(n.isSelected()?t:e).push(n.getTorrent())));const n=new Event("torrent-selection-changed");n.nonselected=e,n.selected=t,this.dispatchEvent(n)}static _createKeyShortcutFromKeyboardEvent(e){const t=[];return e.ctrlKey&&t.push("Control"),e.altKey&&t.push("Alt"),e.metaKey&&t.push("Meta"),e.shitKey&&t.push("Shift"),t.push(1===e.key.length?e.key.toUpperCase():e.key),t.join("+")}_keyDown(e){const{keyCode:t}=e,n=pe._createKeyShortcutFromKeyboardEvent(e),r=this.action_manager.getActionForShortcut(n);if(r)return e.preventDefault(),void this.action_manager.click(r);if(27===t&&this.popup)return this.setCurrentPopup(null),void e.preventDefault();const o=document.querySelector(".popup:not(.hidden)"),i=e.target.matches("input"),s=this._rows;if(!(i||o||e.metaKey||e.ctrlKey)){const n=16===t,r=38===t,o=40===t;if((r||o)&&s.length>0){const t=this._indexOfLastTorrent(),n=this._shift_index,i=0,a=s.length-1;let l=t;o&&l+1<=a?++l:r&&l-1>=i&&--l;const c=s[l];n>=0?n<=t&&t=t&&t>l?this._selectRow(c):(n>=t&&l>t||n<=t&&t>l)&&this._deselectRow(s[t]):e.shiftKey?this._selectRange(c):this._setSelectedRow(c),c&&(this._last_torrent_clicked=c.getTorrentId(),c.getElement().scrollIntoView(),e.preventDefault())}else n&&(this._shift_index=this._indexOfLastTorrent())}}_keyUp(e){16===e.keyCode&&delete this._shift_index}static _dragenter(e){if(e.dataTransfer&&e.dataTransfer.types){const t=new Set(["text/uri-list","text/plain"]);if(e.dataTransfer.types.some((e=>t.has(e))))return e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy",!1}else e.dataTransfer&&(e.dataTransfer.dropEffect="none");return!0}static _isValidURL(e){try{return!!new URL(e)}catch{return!1}}shouldAddedTorrentsStart(){return this.session_properties["start-added-torrents"]}_drop(e){const t=!this.shouldAddedTorrentsStart();if(!e.dataTransfer||!e.dataTransfer.types)return!0;const n=e.data.Transfer.types.filter((e=>["text/uri-list","text/plain"].contains(e))).pop();return e.dataTransfer.getData(n).split("\n").map((e=>e.trim())).filter((e=>pe._isValidURL(e))).forEach((e=>this.remote.addTorrentByUrl(e,t))),e.preventDefault(),!1}togglePeriodicSessionRefresh(e){if(!e&&this.sessionInterval&&(clearInterval(this.sessionInterval),delete this.sessionInterval),e&&(this.loadDaemonPrefs(),!this.sessionInterval)){const e=8e3;this.sessionInterval=setInterval(this.loadDaemonPrefs.bind(this),e)}}_setFilterText(e){this.filterText=e?e.trim():null,this.refilterAllSoon()}_onTorrentChanged(e){const t=e.currentTarget;this.dirtyTorrents.add(t.getId()),this.refilterSoon()}updateTorrents(e,t){this.remote.updateTorrents(e,t,((e,t)=>{const n=[],r=e.shift(),o={};for(const t of e){r.forEach(((e,n)=>{o[e]=t[n]}));const{id:e}=o;let i=this._torrents[e];if(i){const t=i.needsMetaData();i.refresh(o),t&&!i.needsMetaData()&&n.push(e)}else i=this._torrents[e]=new j(o),i.addEventListener("dataChanged",this._onTorrentChanged.bind(this)),this.dirtyTorrents.add(e),"name"in i.fields&&"status"in i.fields||n.push(e)}if(n.length>0){const e=["id"].concat(j.Fields.Metadata,j.Fields.Stats);this.updateTorrents(n,e),this.refilterSoon()}t&&(this._deleteTorrents(t),this.refilterSoon())}))}refreshTorrents(){const e=["id"].concat(j.Fields.Stats);this.updateTorrents("recently-active",e)}_initializeTorrents(){const e=["id"].concat(j.Fields.Metadata,j.Fields.Stats);this.updateTorrents(null,e)}_onRowClicked(e){const t=e.metaKey||e.ctrlKey,{row:n}=e.currentTarget;if(this.popup&&"inspector"!==this.popup.name)this.setCurrentPopup(null);else{if(e.target.classList.contains("torrent-pauseresume-button"))switch(e.target.dataset.action){case"pause":this._stopTorrents([n.getTorrent()]);break;case"resume":this._startTorrents([n.getTorrent()])}e.stopPropagation(),e.shiftKey?(this._selectRange(n),window.focus()):!n.isSelected()&&t?this._selectRow(n):n.isSelected()?n.isSelected()&&t?this._deselectRow(n):n.isSelected()&&this._setSelectedRow(n):this._setSelectedRow(n),this._last_torrent_clicked=n.getTorrentId()}}_deleteTorrents(e){if(e&&e.length>0){for(const t of e)this.dirtyTorrents.add(t),delete this._torrents[t];this.refilterSoon()}}_removeSelectedTorrents(e){const t=this.getSelectedTorrents();t.length>0&&this.setCurrentPopup(new oe({remote:this.remote,torrents:t,trash:e}))}_startSelectedTorrents(e){this._startTorrents(this.getSelectedTorrents(),e)}_startTorrents(e,t){this.remote.startTorrents(pe._getTorrentIds(e),t,this.refreshTorrents,this)}_verifyTorrents(e){this.remote.verifyTorrents(pe._getTorrentIds(e),this.refreshTorrents,this)}_reannounceTorrents(e){this.remote.reannounceTorrents(pe._getTorrentIds(e),this.refreshTorrents,this)}_stopTorrents(e){this.remote.stopTorrents(pe._getTorrentIds(e),this.refreshTorrents,this)}changeFileCommand(e,t,n){this.remote.changeFileCommand(e,t,n)}_moveTop(){this.remote.moveTorrentsToTop(this._getSelectedTorrentIds(),this.refreshTorrents,this)}_moveUp(){this.remote.moveTorrentsUp(this._getSelectedTorrentIds(),this.refreshTorrents,this)}_moveDown(){this.remote.moveTorrentsDown(this._getSelectedTorrentIds(),this.refreshTorrents,this)}_moveBottom(){this.remote.moveTorrentsToBottom(this._getSelectedTorrentIds(),this.refreshTorrents,this)}_updateGuiFromSession(e){const[,t,n]=e.version.match(/(.*)\s\(([\da-f]+)\)/);this.version_info={checksum:n,version:t};document.querySelector("#toolbar-overflow").classList.toggle("alt-speed-enabled",e[Z])}_updateStatusbar(){const e=T,t=this._getAllTorrents(),n=t.reduce(((e,t)=>e+t.getUploadSpeed()),0),r=t.reduce(((e,t)=>e+t.getDownloadSpeed()),0),o=e.countString("Transfer","Transfers",this._rows.length);b(document.querySelector("#speed-up-label"),e.speedBps(n)),b(document.querySelector("#speed-dn-label"),e.speedBps(r)),b(document.querySelector("#filter-count"),o)}_updateFilterSelect(){const e=this._getTrackers(),t=Object.keys(e).sort();let n="";n+=this.filterTracker?'':'';for(const r of t){n+=``}this.filterTrackersStr&&this.filterTrackersStr===n||(this.filterTrackersStr=n,document.querySelector("#filter-tracker").innerHTML=n)}sortRows(e){const t=e.map((e=>e.getTorrent())),n=e.reduce(((e,t)=>(e[t.getTorrent().getId()]=t,e)),{});j.sortTorrents(t,this.prefs.sort_mode,this.prefs.sort_direction),t.forEach(((t,r)=>e[r]=n[t.getId()]))}_refilter(e){const{sort_mode:t,sort_direction:n,filter_mode:r}=this.prefs,o=this.filterText,i=this.filterTracker,s=this.torrentRenderer,a=this.elements.torrent_list,l=()=>[...a.children].length,c=()=>[...a.children].reduce(((e,t)=>e+t.classList.contains("selected")?1:0),0),d=l(),A=c();if(this._updateFilterSelect(),clearTimeout(this.refilterTimer),delete this.refilterTimer,e){for(;a.firstChild;)a.firstChild.remove();this._rows=[],this.dirtyTorrents=new Set(Object.keys(this._torrents))}const p=[];let u=[];for(const e of this._rows)this.dirtyTorrents.has(e.getTorrentId())?u.push(e):p.push(e);for(const e of u)e.getElement().remove();const g=[];for(const e of u){const t=e.getTorrentId(),n=this._torrents[t];n&&n.test(r,o,i)&&g.push(e),this.dirtyTorrents.delete(t)}u=g;for(const e of this.dirtyTorrents.values()){const t=this._torrents[e];if(t&&t.test(r,o,i)){const e=new Ae(s,this,t),n=e.getElement();n.row=e,u.push(e),n.addEventListener("click",this._onRowClicked.bind(this)),n.addEventListener("dblclick",(()=>this.action_manager.click("show-inspector")))}}this.sortRows(u);const m=[],h=p.length,f=u.length,b=document.createDocumentFragment();let C=0,v=0;for(;C!==h||v!==f;){let e=null;if(C===h)e=!1;else if(v===f)e=!0;else{e=j.compareTorrents(p[C].getTorrent(),u[v].getTorrent(),t,n)<0}if(e)m.push(p[C++]);else{const e=u[v++],t=e.getElement();C!==h?a.insertBefore(t,p[C].getElement()):b.append(t),m.push(e)}}a.append(b),this._rows=m,this.dirtyTorrents.clear(),m.map((e=>e.getElement())).forEach(((e,t)=>{const n=t%2==0;e.classList.toggle("even",n),e.classList.toggle("odd",!n)})),this._updateStatusbar(),A===c()&&d===l()||this.dispatchSelectionChangedSoon()}setFilterTracker(e){document.querySelector("#filter-tracker").value=e?pe._getReadableDomain(e):"all",this.filterTracker=e,this.refilterAllSoon()}_getTrackers(){const e={};for(const t of this._getAllTorrents()){const n=new Set;for(const r of t.getTrackers()){const{domain:t,name:o}=r;e[o]||(e[o]={count:0,domain:t}),n.add(o)}for(const t of n.values())++e[t].count}return e}popupCloseListener(e){if(e.target!==this.popup)throw new Error(e);this.popup.removeEventListener("close",this.boundPopupCloseListener),delete this.popup}setCurrentPopup(e){this.popup&&this.popup.close(),this.popup=e,this.popup&&this.popup.addEventListener("close",this.boundPopupCloseListener)}}n(37);document.addEventListener("DOMContentLoaded",(function(){const e=new r,t=new v,n=new C(t),o=new pe(e,n,t),i=A((()=>o.elements.torrent_list.scrollTo(0,1)));window.addEventListener("load",i),window.onorientationchange=i}))}]); //# sourceMappingURL=transmission-app.js.map \ No newline at end of file