var app=function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){o=!0,a=t},f:function(){try{s||null==i.return||i.return()}finally{if(o)throw a}}}}function r(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function a(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function s(t){for(var e=1;e=0;--a){var s=this.tryEntries[a],o=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var l=n.call(s,"catchLoc"),c=n.call(s,"finallyLoc");if(l&&c){if(this.prev=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),D(i),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;D(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(e,i,n){return this.delegate={iterator:z(e),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,a,s,o=[],l=!0,c=!1;try{if(a=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=a.call(i)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw r}}return o}}(t,e)||c(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,i){if(e){if("string"==typeof e)return t(e,i);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,i):void 0}}function d(){}var h,u=t=>t;function f(t){return t()}function p(){return Object.create(null)}function v(t){t.forEach(f)}function g(t){return"function"==typeof t}function m(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function b(t,e){return t===e||(h||(h=document.createElement("a")),h.href=e,t===h.href)}function x(t,e,i){t.$$.on_destroy.push(function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;ro.unsubscribe():o}(e,i))}function _(t,e,i,n){if(t){var r=y(t,e,i,n);return t[0](r)}}function y(t,e,i,n){return t[1]&&n?function(t,e){for(var i in e)t[i]=e[i];return t}(i.ctx.slice(),t[1](n(e))):i.ctx}function w(t,e,i,n){if(t[2]&&n){var r=t[2](n(i));if(void 0===e.dirty)return r;if("object"==typeof r){for(var a=[],s=Math.max(e.dirty.length,r.length),o=0;o32){for(var e=[],i=t.ctx.length/32,n=0;nwindow.performance.now():()=>Date.now(),T=C?t=>requestAnimationFrame(t):d,P=new Set;function D(t){P.forEach((e=>{e.c(t)||(P.delete(e),e.f())})),0!==P.size&&T(D)}function L(t){var e;return 0===P.size&&T(D),{promise:new Promise((i=>{P.add(e={c:t,f:i})})),abort(){P.delete(e)}}}var z="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function O(t,e){t.appendChild(e)}function A(t,e,i){var n=E(t);if(!n.getElementById(e)){var r=N("style");r.id=e,r.textContent=i,I(n,r)}}function E(t){if(!t)return document;var e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function j(t){var e=N("style");return e.textContent="/* empty */",I(E(t),e),e.sheet}function I(t,e){return O(t.head||t,e),e.sheet}function R(t,e,i){t.insertBefore(e,i||null)}function F(t){t.parentNode&&t.parentNode.removeChild(t)}function H(t,e){for(var i=0;it.removeEventListener(e,i,n)}function U(t){return function(e){return e.preventDefault(),t.call(this,e)}}function X(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function G(t,e,i){null==i?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function K(t){var e;return{p(){for(var i=arguments.length,n=new Array(i),r=0;rt.push(e)))},r(){e.forEach((e=>t.splice(t.indexOf(e),1)))}}}function Z(t,e){e=""+e,t.data!==e&&(t.data=e)}function J(t,e){t.value=null==e?"":e}function Q(t,e,i,n){null==i?t.style.removeProperty(e):t.style.setProperty(e,i,"")}function tt(t,e,i){t.classList.toggle(e,!!i)}function et(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.bubbles,r=void 0!==n&&n,a=i.cancelable;return new CustomEvent(t,{detail:e,bubbles:r,cancelable:void 0!==a&&a})}var it,nt=new Map,rt=0;function at(t,e,i,n,r,a,s){for(var o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=16.666/n,c="{\n",d=0;d<=1;d+=l){var h=e+(i-e)*a(d);c+=100*d+"%{".concat(s(h,1-h),"}\n")}var u=c+"100% {".concat(s(i,1-i),"}\n}"),f="__svelte_".concat(function(t){for(var e=5381,i=t.length;i--;)e=(e<<5)-e^t.charCodeAt(i);return e>>>0}(u),"_").concat(o),p=E(t),v=nt.get(p)||function(t,e){var i={stylesheet:j(e),rules:{}};return nt.set(t,i),i}(p,t),g=v.stylesheet,m=v.rules;m[f]||(m[f]=!0,g.insertRule("@keyframes ".concat(f," ").concat(u),g.cssRules.length));var b=t.style.animation||"";return t.style.animation="".concat(b?"".concat(b,", "):"").concat(f," ").concat(n,"ms linear ").concat(r,"ms 1 both"),rt+=1,f}function st(t,e){var i=(t.style.animation||"").split(", "),n=i.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=i.length-n.length;r&&(t.style.animation=n.join(", "),(rt-=r)||T((()=>{rt||(nt.forEach((t=>{var e=t.stylesheet.ownerNode;e&&F(e)})),nt.clear())})))}function ot(t){var e=getComputedStyle(t);if("absolute"!==e.position&&"fixed"!==e.position){var i=e.width,n=e.height,r=t.getBoundingClientRect();t.style.position="absolute",t.style.width=i,t.style.height=n,function(t,e){var i=t.getBoundingClientRect();if(e.left!==i.left||e.top!==i.top){var n=getComputedStyle(t),r="none"===n.transform?"":n.transform;t.style.transform="".concat(r," translate(").concat(e.left-i.left,"px, ").concat(e.top-i.top,"px)")}}(t,r)}}function lt(t){it=t}function ct(){if(!it)throw new Error("Function called outside component initialization");return it}function dt(t){ct().$$.on_mount.push(t)}function ht(){var t=ct();return function(e,i){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).cancelable,r=void 0!==n&&n,a=t.$$.callbacks[e];if(a){var s=et(e,i,{cancelable:r});return a.slice().forEach((e=>{e.call(t,s)})),!s.defaultPrevented}return!0}}function ut(t,e){var i=t.$$.callbacks[e.type];i&&i.slice().forEach((t=>t.call(this,e)))}var ft=[],pt=[],vt=[],gt=[],mt=Promise.resolve(),bt=!1;function xt(){bt||(bt=!0,mt.then(Mt))}function _t(){return xt(),mt}function yt(t){vt.push(t)}var wt,kt=new Set,$t=0;function Mt(){if(0===$t){var t=it;do{try{for(;$t{Pt.delete(t),n&&(i&&t.d(1),n())})),t.o(e)}else n&&n()}var At={duration:0};function Et(t,e,i,n){var r,a=e(t,i,{direction:"both"}),s=n?0:1,o=null,l=null,c=null;function h(){c&&st(t,c)}function f(t,e){var i=t.b-s;return e*=Math.abs(i),{a:s,b:t.b,d:i,duration:e,start:t.start,end:t.start+e,group:t.group}}function p(e){var i=a||At,n=i.delay,p=void 0===n?0:n,g=i.duration,m=void 0===g?300:g,b=i.easing,x=void 0===b?u:b,_=i.tick,y=void 0===_?d:_,w=i.css,k={start:S()+p,b:e};e||(k.group=Tt,Tt.r+=1),"inert"in t&&(e?void 0!==r&&(t.inert=r):(r=t.inert,t.inert=!0)),o||l?l=k:(w&&(h(),c=at(t,s,e,m,p,x,w)),e&&y(0,1),o=f(k,m),yt((()=>St(t,e,"start"))),L((e=>{if(l&&e>l.start&&(o=f(l,m),l=null,St(t,o.b,"start"),w&&(h(),c=at(t,s,o.b,o.duration,0,x,a.css))),o)if(e>=o.end)y(s=o.b,1-s),St(t,o.b,"end"),l||(o.b?h():--o.group.r||v(o.group.c)),o=null;else if(e>=o.start){var i=e-o.start;s=o.a+o.d*x(i/o.duration),y(s,1-s)}return!(!o&&!l)})))}return{run(t){g(a)?(wt||(wt=Promise.resolve()).then((()=>{wt=null})),wt).then((()=>{a=a({direction:t?"in":"out"}),p(t)})):p(t)},end(){h(),o=l=null}}}function jt(t){return void 0!==(null==t?void 0:t.length)?t:Array.from(t)}function It(t,e){t.d(1),e.delete(t.key)}function Rt(t,e){t.f(),It(t,e)}function Ft(t,e,i,n,r,a,s,o,l,c,d,h){for(var u=t.length,f=a.length,p=u,g={};p--;)g[t[p].key]=p;var m=[],b=new Map,x=new Map,_=[];p=f;for(var y=function(){var t=h(r,a,p),n=i(t),o=s.get(n);o?_.push((()=>o.p(t,e))):(o=c(n,t)).c(),b.set(n,m[p]=o),n in g&&x.set(n,Math.abs(p-g[n]))};p--;)y();var w=new Set,k=new Set;function $(t){zt(t,1),t.m(o,d),s.set(t.key,t),d=t.first,f--}for(;u&&f;){var M=m[f-1],C=t[u-1],S=M.key,T=C.key;M===C?(d=M.first,u--,f--):b.has(T)?!s.has(S)||w.has(S)?$(M):k.has(T)?u--:x.get(S)>x.get(T)?(k.add(S),$(M)):(w.add(T),u--):(l(C,s),u--)}for(;u--;){var P=t[u];b.has(P.key)||l(P,s)}for(;f;)$(m[f-1]);return v(_),m}function Ht(t){t&&t.c()}function Nt(t,e,i){var n=t.$$,r=n.fragment,a=n.after_update;r&&r.m(e,i),yt((()=>{var e=t.$$.on_mount.map(f).filter(g);t.$$.on_destroy?t.$$.on_destroy.push(...e):v(e),t.$$.on_mount=[]})),a.forEach(yt)}function Vt(t,e){var i,n,r,a=t.$$;null!==a.fragment&&(i=a.after_update,n=[],r=[],vt.forEach((t=>-1===i.indexOf(t)?n.push(t):r.push(t))),r.forEach((t=>t())),vt=n,v(a.on_destroy),a.fragment&&a.fragment.d(e),a.on_destroy=a.fragment=null,a.ctx=[])}function Bt(t,e,i,n,r,a){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[-1],l=it;lt(t);var c=t.$$={fragment:null,ctx:[],props:a,update:d,not_equal:r,bound:p(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:p(),dirty:o,skip_bound:!1,root:e.target||l.$$.root};s&&s(c.root);var h=!1;if(c.ctx=i?i(t,e.props||{},(function(e,i){var n=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:i;return c.ctx&&r(c.ctx[e],c.ctx[e]=n)&&(!c.skip_bound&&c.bound[e]&&c.bound[e](n),h&&function(t,e){-1===t.$$.dirty[0]&&(ft.push(t),xt(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{var t=i.indexOf(e);-1!==t&&i.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");var qt={id:"",name:"",size:0,bandwidth_used:0,bandwidth_used_paid:0,downloads:0,views:0,mime_type:"",availability:"",abuse_type:"",hash_sha256:"",show_ads:!1,can_edit:!1,can_download:!1,get_href:"",info_href:"",download_href:"",icon_href:""},Yt={id:"",title:"",files:[],download_href:"",info_href:"",can_edit:!1},Ut=t=>{t.get_href=window.api_endpoint+"/file/"+t.id,t.info_href=window.api_endpoint+"/file/"+t.id+"/info",t.download_href=window.api_endpoint+"/file/"+t.id+"?download",t.icon_href=window.api_endpoint+"/file/"+t.id+"/thumbnail",t.timeseries_href=window.api_endpoint+"/file/"+t.id+"/timeseries"},Xt=t=>"application/bittorrent"===t.mime_type||"application/x-bittorrent"===t.mime_type?"torrent":"application/zip"===t.mime_type||"application/x-7z-compressed"===t.mime_type||"application/x-tar"===t.mime_type||"application/gzip"===t.mime_type&&t.name.endsWith(".tar.gz")||"application/x-xz"===t.mime_type&&t.name.endsWith(".tar.xz")||"application/zstd"===t.mime_type&&t.name.endsWith(".tar.zst")?"zip":t.mime_type.startsWith("image")?"image":t.mime_type.startsWith("video")&&"video/x-matroska"!==t.mime_type?"video":t.mime_type.startsWith("audio")||"application/ogg"===t.mime_type||t.name.endsWith(".mp3")?"audio":"application/pdf"===t.mime_type||"application/x-pdf"===t.mime_type?"pdf":"application/json"===t.mime_type||"application/x-shellscript"===t.mime_type||t.mime_type.startsWith("text")?"text":"file";function Gt(t){var e=t-1;return e*e*e+1}function Kt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.delay,n=void 0===i?0:i,r=e.duration,a=void 0===r?400:r,s=e.easing,o=void 0===s?u:s,l=+getComputedStyle(t).opacity;return{delay:n,duration:a,easing:o,css:t=>"opacity: ".concat(t*l)}}function Zt(t){A(t,"svelte-1ef47mx",".button.svelte-1ef47mx{flex:0 0 content}.flat.svelte-1ef47mx{background:none;color:var(--body_text_color);box-shadow:none}")}function Jt(t){var e,i,n,r=""!==t[5]&&te(t),a=""!==t[7]&&ee(t);return{c(){e=N("a"),r&&r.c(),i=W(),a&&a.c(),G(e,"href",t[9]),G(e,"target",t[10]),G(e,"class","button svelte-1ef47mx"),G(e,"title",t[8]),G(e,"style",t[11]),G(e,"disabled",n=t[4]?"disabled":null),tt(e,"button_highlight",t[0]),tt(e,"button_red",t[1]),tt(e,"round",t[2]),tt(e,"flat",t[3])},m(t,n){R(t,e,n),r&&r.m(e,null),O(e,i),a&&a.m(e,null)},p(t,s){""!==t[5]?r?r.p(t,s):((r=te(t)).c(),r.m(e,i)):r&&(r.d(1),r=null),""!==t[7]?a?a.p(t,s):((a=ee(t)).c(),a.m(e,null)):a&&(a.d(1),a=null),512&s&&G(e,"href",t[9]),1024&s&&G(e,"target",t[10]),256&s&&G(e,"title",t[8]),2048&s&&G(e,"style",t[11]),16&s&&n!==(n=t[4]?"disabled":null)&&G(e,"disabled",n),1&s&&tt(e,"button_highlight",t[0]),2&s&&tt(e,"button_red",t[1]),4&s&&tt(e,"round",t[2]),8&s&&tt(e,"flat",t[3])},d(t){t&&F(e),r&&r.d(),a&&a.d()}}}function Qt(t){var e,i,n,r,a,s=""!==t[5]&&ie(t),o=""!==t[7]&&ne(t);return{c(){e=N("button"),s&&s.c(),i=W(),o&&o.c(),G(e,"class","button svelte-1ef47mx"),G(e,"title",t[8]),G(e,"style",t[11]),G(e,"type",t[12]),G(e,"form",t[13]),e.disabled=n=t[4]?"disabled":null,tt(e,"button_highlight",t[0]),tt(e,"button_red",t[1]),tt(e,"round",t[2]),tt(e,"flat",t[3])},m(n,l){R(n,e,l),s&&s.m(e,null),O(e,i),o&&o.m(e,null),r||(a=Y(e,"click",t[14]),r=!0)},p(t,r){""!==t[5]?s?s.p(t,r):((s=ie(t)).c(),s.m(e,i)):s&&(s.d(1),s=null),""!==t[7]?o?o.p(t,r):((o=ne(t)).c(),o.m(e,null)):o&&(o.d(1),o=null),256&r&&G(e,"title",t[8]),2048&r&&G(e,"style",t[11]),4096&r&&G(e,"type",t[12]),8192&r&&G(e,"form",t[13]),16&r&&n!==(n=t[4]?"disabled":null)&&(e.disabled=n),1&r&&tt(e,"button_highlight",t[0]),2&r&&tt(e,"button_red",t[1]),4&r&&tt(e,"round",t[2]),8&r&&tt(e,"flat",t[3])},d(t){t&&F(e),s&&s.d(),o&&o.d(),r=!1,a()}}}function te(t){var e,i;return{c(){e=N("i"),i=B(t[5]),G(e,"class","icon"),tt(e,"small",t[6])},m(t,n){R(t,e,n),O(e,i)},p(t,n){32&n&&Z(i,t[5]),64&n&&tt(e,"small",t[6])},d(t){t&&F(e)}}}function ee(t){var e,i;return{c(){e=N("span"),i=B(t[7])},m(t,n){R(t,e,n),O(e,i)},p(t,e){128&e&&Z(i,t[7])},d(t){t&&F(e)}}}function ie(t){var e,i;return{c(){e=N("i"),i=B(t[5]),G(e,"class","icon"),tt(e,"small",t[6])},m(t,n){R(t,e,n),O(e,i)},p(t,n){32&n&&Z(i,t[5]),64&n&&tt(e,"small",t[6])},d(t){t&&F(e)}}}function ne(t){var e,i;return{c(){e=N("span"),i=B(t[7])},m(t,n){R(t,e,n),O(e,i)},p(t,e){128&e&&Z(i,t[7])},d(t){t&&F(e)}}}function re(t){var e;function i(t,e){return""===t[9]?Qt:Jt}var n=i(t),r=n(t);return{c(){r.c(),e=q()},m(t,i){r.m(t,i),R(t,e,i)},p(t,a){var s=l(a,1)[0];n===(n=i(t))&&r?r.p(t,s):(r.d(1),(r=n(t))&&(r.c(),r.m(e.parentNode,e)))},i:d,o:d,d(t){t&&F(e),r.d(t)}}}function ae(t,e,i){var n=e.highlight,r=void 0!==n&&n,a=e.highlight_on_click,s=void 0!==a&&a,o=e.red,l=void 0!==o&&o,c=e.round,d=void 0!==c&&c,h=e.flat,u=void 0!==h&&h,f=e.disabled,p=void 0!==f&&f,v=e.icon,g=void 0===v?"":v,m=e.icon_small,b=void 0!==m&&m,x=e.label,_=void 0===x?"":x,y=e.title,w=void 0===y?null:y,k=e.link_href,$=void 0===k?"":k,M=e.link_target,C=void 0===M?"_self":M,S=e.click,T=void 0===S?t=>{}:S,P=e.style,D=void 0===P?null:P,L=e.type,z=void 0===L?null:L,O=e.form,A=void 0===O?null:O;return t.$$set=t=>{"highlight"in t&&i(0,r=t.highlight),"highlight_on_click"in t&&i(15,s=t.highlight_on_click),"red"in t&&i(1,l=t.red),"round"in t&&i(2,d=t.round),"flat"in t&&i(3,u=t.flat),"disabled"in t&&i(4,p=t.disabled),"icon"in t&&i(5,g=t.icon),"icon_small"in t&&i(6,b=t.icon_small),"label"in t&&i(7,_=t.label),"title"in t&&i(8,w=t.title),"link_href"in t&&i(9,$=t.link_href),"link_target"in t&&i(10,C=t.link_target),"click"in t&&i(16,T=t.click),"style"in t&&i(11,D=t.style),"type"in t&&i(12,z=t.type),"form"in t&&i(13,A=t.form)},[r,l,d,u,p,g,b,_,w,$,C,D,z,A,t=>{if(s)try{T(t),i(0,r=!0)}catch(t){throw i(1,l=!0),t}else T(t)},s,T]}class se extends Wt{constructor(t){super(),Bt(this,t,ae,re,m,{highlight:0,highlight_on_click:15,red:1,round:2,flat:3,disabled:4,icon:5,icon_small:6,label:7,title:8,link_href:9,link_target:10,click:16,style:11,type:12,form:13},Zt)}}function oe(t){A(t,"svelte-1f8gt9n",".background.svelte-1f8gt9n{position:fixed;display:flex;flex-direction:column;align-items:center;justify-content:center;top:0;right:0;bottom:0;left:0;background-color:rgba(0, 0, 0, 0.7)}.top_padding.svelte-1f8gt9n{flex:1 1 25%}.bottom_padding.svelte-1f8gt9n{flex:1 1 75%}.window.svelte-1f8gt9n{position:relative;z-index:inherit;flex:0 0 auto;display:flex;flex-direction:column;background:var(--body_color);max-height:100%;max-width:100%;padding:0;border-radius:18px 18px 8px 8px;overflow:hidden;text-align:left}.header.svelte-1f8gt9n{flex-grow:0;flex-shrink:0;display:flex;flex-direction:row;padding:1px;background:var(--background_color);color:var(--background_text_color);align-items:center}.title.svelte-1f8gt9n{flex-grow:1;flex-shrink:1;font-size:1.1em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-align:center}.body.svelte-1f8gt9n{flex-grow:1;flex-shrink:1;overflow:auto}.padding.svelte-1f8gt9n{padding:10px}")}var le=t=>({}),ce=t=>({});function de(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p=t[15].title,g=_(p,t,t[14],ce),m=g||function(t){var e,i,n,r,a=[ue,he],s=[];function o(t,e){return""!==t[1]?0:1}return e=o(t),i=s[e]=a[e](t),{c(){i.c(),n=q()},m(t,i){s[e].m(t,i),R(t,n,i),r=!0},p(t,r){var l=e;(e=o(t))===l?s[e].p(t,r):(Dt(),Ot(s[l],1,1,(()=>{s[l]=null})),Lt(),(i=s[e])?i.p(t,r):(i=s[e]=a[e](t)).c(),zt(i,1),i.m(n.parentNode,n))},i(t){r||(zt(i),r=!0)},o(t){Ot(i),r=!1},d(t){t&&F(n),s[e].d(t)}}}(t),b=t[15].default,x=_(b,t,t[14],null);return{c(){e=N("div"),i=N("div"),n=W(),r=N("div"),a=N("div"),m&&m.c(),s=W(),o=N("div"),x&&x.c(),l=W(),c=N("div"),G(i,"class","top_padding svelte-1f8gt9n"),G(a,"class","header svelte-1f8gt9n"),G(o,"class","body svelte-1f8gt9n"),tt(o,"padding",t[5]),G(r,"class","window svelte-1f8gt9n"),G(r,"role","dialog"),G(r,"aria-modal","true"),Q(r,"width",t[3]),Q(r,"height",t[4]),G(c,"class","bottom_padding svelte-1f8gt9n"),G(e,"class","background svelte-1f8gt9n"),G(e,"style",t[6]),G(e,"role","dialog")},m(d,p){R(d,e,p),O(e,i),O(e,n),O(e,r),O(r,a),m&&m.m(a,null),O(r,s),O(r,o),x&&x.m(o,null),O(e,l),O(e,c),h=!0,u||(f=[Y(r,"click",X(t[16])),Y(r,"keydown",t[9]),M(t[8].call(null,e)),Y(e,"click",t[7]),Y(e,"keydown",t[9])],u=!0)},p(t,i){g?g.p&&(!h||16384&i)&&k(g,p,t,t[14],h?w(p,t[14],i,le):$(t[14]),ce):m&&m.p&&(!h||6&i)&&m.p(t,h?i:-1),x&&x.p&&(!h||16384&i)&&k(x,b,t,t[14],h?w(b,t[14],i,null):$(t[14]),null),(!h||32&i)&&tt(o,"padding",t[5]),(!h||8&i)&&Q(r,"width",t[3]),(!h||16&i)&&Q(r,"height",t[4]),(!h||64&i)&&G(e,"style",t[6])},i(t){h||(zt(m,t),zt(x,t),t&&yt((()=>{h&&(d||(d=Et(e,Kt,{duration:200},!0)),d.run(1))})),h=!0)},o(t){Ot(m,t),Ot(x,t),t&&(d||(d=Et(e,Kt,{duration:200},!1)),d.run(0)),h=!1},d(t){t&&F(e),m&&m.d(t),x&&x.d(t),t&&d&&d.end(),u=!1,v(f)}}}function he(t){var e,i,n,r,a;return r=new se({props:{round:!0,click:t[7],icon:"close"}}),{c(){e=N("span"),i=B(t[2]),n=W(),Ht(r.$$.fragment),G(e,"class","title svelte-1f8gt9n")},m(t,s){R(t,e,s),O(e,i),R(t,n,s),Nt(r,t,s),a=!0},p(t,e){(!a||4&e)&&Z(i,t[2])},i(t){a||(zt(r.$$.fragment,t),a=!0)},o(t){Ot(r.$$.fragment,t),a=!1},d(t){t&&(F(e),F(n)),Vt(r,t)}}}function ue(t){var e,i,n,r,a,s,o;return e=new se({props:{round:!0,click:t[7],icon:"close"}}),s=new se({props:{round:!0,highlight:!0,type:"submit",form:t[1],click:t[7],icon:"save",label:"Save"}}),{c(){Ht(e.$$.fragment),i=W(),n=N("span"),r=B(t[2]),a=W(),Ht(s.$$.fragment),G(n,"class","title svelte-1f8gt9n")},m(t,l){Nt(e,t,l),R(t,i,l),R(t,n,l),O(n,r),R(t,a,l),Nt(s,t,l),o=!0},p(t,e){(!o||4&e)&&Z(r,t[2]);var i={};2&e&&(i.form=t[1]),s.$set(i)},i(t){o||(zt(e.$$.fragment,t),zt(s.$$.fragment,t),o=!0)},o(t){Ot(e.$$.fragment,t),Ot(s.$$.fragment,t),o=!1},d(t){t&&(F(i),F(n),F(a)),Vt(e,t),Vt(s,t)}}}function fe(t){var e,i,n,r,a=t[0]&&de(t);return{c(){a&&a.c(),e=q()},m(s,o){a&&a.m(s,o),R(s,e,o),i=!0,n||(r=Y(window,"keydown",t[9]),n=!0)},p(t,i){var n=l(i,1)[0];t[0]?a?(a.p(t,n),1&n&&zt(a,1)):((a=de(t)).c(),zt(a,1),a.m(e.parentNode,e)):a&&(Dt(),Ot(a,1,1,(()=>{a=null})),Lt())},i(t){i||(zt(a),i=!0)},o(t){Ot(a),i=!1},d(t){t&&F(e),a&&a.d(t),n=!1,r()}}}var pe=1e4;function ve(t,e,i){var n=e.$$slots,r=void 0===n?{}:n,a=e.$$scope,s=e.form,o=void 0===s?"":s,l=e.title,c=void 0===l?"":l,d=e.width,h=void 0===d?"800px":d,u=e.height,f=void 0===u?"auto":u,p=e.padding,v=void 0!==p&&p,g=e.visible,m=void 0!==g&&g,b=e.style,x=void 0===b?"":b,_=ht(),y=t=>{i(0,m=t),_("is_visible",m)};return t.$$set=t=>{"form"in t&&i(1,o=t.form),"title"in t&&i(2,c=t.title),"width"in t&&i(3,h=t.width),"height"in t&&i(4,f=t.height),"padding"in t&&i(5,v=t.padding),"visible"in t&&i(0,m=t.visible),"style"in t&&i(6,x=t.style),"$$scope"in t&&i(14,a=t.$$scope)},[m,o,c,h,f,v,x,()=>{y(!1)},t=>{t.style.zIndex=pe.valueOf(),pe++},t=>{if(!document.activeElement.type||"text"!==document.activeElement.type)return"Escape"===t.key&&m?(y(!1),t.preventDefault(),void t.stopPropagation()):void 0},()=>{y(!0)},()=>{y(!m)},()=>m,y,a,r,function(e){ut.call(this,t,e)}]}class ge extends Wt{constructor(t){super(),Bt(this,t,ve,fe,m,{form:1,title:2,width:3,height:4,padding:5,visible:0,style:6,show:10,hide:7,toggle:11,is_visible:12,set_visible:13},oe)}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[7]}get toggle(){return this.$$.ctx[11]}get is_visible(){return this.$$.ctx[12]}get set_visible(){return this.$$.ctx[13]}}var me=t=>t.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "),be=(t,e)=>(e<3&&(e=3),t>=999e15?(t/1e18).toPrecision(e)+" EB":t>=999e12?(t/1e15).toPrecision(e)+" PB":t>=999e9?(t/1e12).toPrecision(e)+" TB":t>=999e6?(t/1e9).toPrecision(e)+" GB":t>=999e3?(t/1e6).toPrecision(e)+" MB":t>=999?(t/1e3).toPrecision(e)+" kB":t.toPrecision(e)+" B"),xe=6e4,_e=36e5,ye=24*_e,we=(t,e)=>{var i="";return t>=ye&&(i+=Math.floor(t/ye)+"d "),t>=_e&&(i+=Math.floor(t%ye/_e)+"h "),t>=xe&&(i+=Math.floor(t%_e/xe)+"m "),i+(t%xe/1e3).toFixed(e)+"s"},ke=(t,e,i,n)=>{t instanceof Date||(t=new Date(t));var r=t.getFullYear()+"-"+("00"+(t.getMonth()+1)).slice(-2)+"-"+("00"+t.getDate()).slice(-2);return r+=" "+("00"+t.getHours()).slice(-2),r+=":"+("00"+t.getMinutes()).slice(-2),n&&(r+=":"+("00"+t.getMinutes()).slice(-2)),r};function $e(){var t=window.location.protocol+"//"+window.location.hostname;return""!=window.location.port&&(t=t+":"+window.location.port),t}var Me=t=>getComputedStyle(document.documentElement).getPropertyValue("--"+t); /*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License */function Ce(t){return t+.5|0}var Se=(t,e,i)=>Math.max(Math.min(t,i),e);function Te(t){return Se(Ce(2.55*t),0,255)}function Pe(t){return Se(Ce(255*t),0,255)}function De(t){return Se(Ce(t/2.55)/100,0,1)}function Le(t){return Se(Ce(100*t),0,100)}var ze={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Oe=[..."0123456789ABCDEF"],Ae=t=>Oe[15&t],Ee=t=>Oe[(240&t)>>4]+Oe[15&t],je=t=>(240&t)>>4==(15&t);function Ie(t){var e=(t=>je(t.r)&&je(t.g)&&je(t.b)&&je(t.a))(t)?Ae:Ee;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}var Re=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Fe(t,e,i){var n=e*Math.min(i,1-i),r=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+t/30)%12;return i-n*Math.max(Math.min(r-3,9-r,1),-1)};return[r(0),r(8),r(4)]}function He(t,e,i){var n=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(n+t/60)%6;return i-i*e*Math.max(Math.min(r,4-r,1),0)};return[n(5),n(3),n(1)]}function Ne(t,e,i){var n,r=Fe(t,1,.5);for(e+i>1&&(e*=n=1/(e+i),i*=n),n=0;n<3;n++)r[n]*=1-e-i,r[n]+=e;return r}function Ve(t){var e,i,n,r=t.r/255,a=t.g/255,s=t.b/255,o=Math.max(r,a,s),l=Math.min(r,a,s),c=(o+l)/2;return o!==l&&(n=o-l,i=c>.5?n/(2-o-l):n/(o+l),e=function(t,e,i,n,r){return t===r?(e-i)/n+(e>16&255,i>>8&255,255&i]}return a}()).transparent=[0,0,0,0]);var e=Ue[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}var Ze=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;var Je=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Qe=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function ti(t,e,i){if(t){var n=Ve(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=We(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function ei(t,e){return t?Object.assign(e||{},t):t}function ii(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Pe(t[3]))):(e=ei(t,{r:0,g:0,b:0,a:1})).a=Pe(e.a),e}function ni(t){return"r"===t.charAt(0)?function(t){var e,i,n,r=Ze.exec(t),a=255;if(r){if(r[7]!==e){var s=+r[7];a=r[8]?Te(s):Se(255*s,0,255)}return e=+r[1],i=+r[3],n=+r[5],{r:e=255&(r[2]?Te(e):Se(e,0,255)),g:i=255&(r[4]?Te(i):Se(i,0,255)),b:n=255&(r[6]?Te(n):Se(n,0,255)),a:a}}}(t):Ye(t)}class ri{constructor(t){if(t instanceof ri)return t;var e,i,n,r,a=typeof t;"object"===a?e=ii(t):"string"===a&&(r=(i=t).length,"#"===i[0]&&(4===r||5===r?n={r:255&17*ze[i[1]],g:255&17*ze[i[2]],b:255&17*ze[i[3]],a:5===r?17*ze[i[4]]:255}:7!==r&&9!==r||(n={r:ze[i[1]]<<4|ze[i[2]],g:ze[i[3]]<<4|ze[i[4]],b:ze[i[5]]<<4|ze[i[6]],a:9===r?ze[i[7]]<<4|ze[i[8]]:255})),e=n||Ke(t)||ni(t)),this._rgb=e,this._valid=!!e}get valid(){return this._valid}get rgb(){var t=ei(this._rgb);return t&&(t.a=De(t.a)),t}set rgb(t){this._rgb=ii(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?"rgba(".concat(t.r,", ").concat(t.g,", ").concat(t.b,", ").concat(De(t.a),")"):"rgb(".concat(t.r,", ").concat(t.g,", ").concat(t.b,")")):void 0;var t}hexString(){return this._valid?Ie(this._rgb):void 0}hslString(){return this._valid?function(t){if(t){var e=Ve(t),i=e[0],n=Le(e[1]),r=Le(e[2]);return t.a<255?"hsla(".concat(i,", ").concat(n,"%, ").concat(r,"%, ").concat(De(t.a),")"):"hsl(".concat(i,", ").concat(n,"%, ").concat(r,"%)")}}(this._rgb):void 0}mix(t,e){if(t){var i,n=this.rgb,r=t.rgb,a=e===i?.5:e,s=2*a-1,o=n.a-r.a,l=((s*o==-1?s:(s+o)/(1+s*o))+1)/2;i=1-l,n.r=255&l*n.r+i*r.r+.5,n.g=255&l*n.g+i*r.g+.5,n.b=255&l*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){var n=Qe(De(t.r)),r=Qe(De(t.g)),a=Qe(De(t.b));return{r:Pe(Je(n+i*(Qe(De(e.r))-n))),g:Pe(Je(r+i*(Qe(De(e.g))-r))),b:Pe(Je(a+i*(Qe(De(e.b))-a))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new ri(this.rgb)}alpha(t){return this._rgb.a=Pe(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){var t=this._rgb,e=Ce(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){var t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ti(this._rgb,2,t),this}darken(t){return ti(this._rgb,2,-t),this}saturate(t){return ti(this._rgb,1,t),this}desaturate(t){return ti(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Ve(t);i[0]=qe(i[0]+e),i=We(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function ai(){}var si,oi=(si=0,()=>si++);function li(t){return null==t}function ci(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function di(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function hi(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function ui(t,e){return hi(t)?t:e}function fi(t,e){return void 0===t?e:t}var pi=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function vi(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function gi(t,e,i,n){var r,a,s;if(ci(t))for(a=t.length,r=0;rt,x:t=>t.x,y:t=>t.y};function Mi(t){var e=function(t){var e,i=[],r="",a=n(t.split("."));try{for(a.s();!(e=a.n()).done;)(r+=e.value).endsWith("\\")?r=r.slice(0,-1)+".":(i.push(r),r="")}catch(t){a.e(t)}finally{a.f()}return i}(t);return t=>{var i,r=n(e);try{for(r.s();!(i=r.n()).done;){var a=i.value;if(""===a)break;t=t&&t[a]}}catch(t){r.e(t)}finally{r.f()}return t}}function Ci(t,e){return($i[e]||($i[e]=Mi(e)))(t)}function Si(t){return t.charAt(0).toUpperCase()+t.slice(1)}var Ti=t=>void 0!==t,Pi=t=>"function"==typeof t,Di=(t,e)=>{if(t.size!==e.size)return!1;var i,r=n(t);try{for(r.s();!(i=r.n()).done;){var a=i.value;if(!e.has(a))return!1}}catch(t){r.e(t)}finally{r.f()}return!0};var Li=Math.PI,zi=2*Li,Oi=zi+Li,Ai=Number.POSITIVE_INFINITY,Ei=Li/180,ji=Li/2,Ii=Li/4,Ri=2*Li/3,Fi=Math.log10,Hi=Math.sign;function Ni(t,e,i){return Math.abs(t-e)l&&c3&&void 0!==arguments[3]?arguments[3]:1e-6;return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function en(t,e,i){i=i||(i=>t[i]1;)i(n=a+r>>1)?a=n:r=n;return{lo:a,hi:r}}var nn=(t,e,i,n)=>en(t,i,n?n=>{var r=t[n][e];return rt[n][e]en(t,i,(n=>t[n][e]>=i));var an=["push","pop","shift","splice","unshift"];function sn(t,e){var i=t._chartjs;if(i){var n=i.listeners,r=n.indexOf(e);-1!==r&&n.splice(r,1),n.length>0||(an.forEach((e=>{delete t[e]})),delete t._chartjs)}}function on(t){var e=new Set(t);return e.size===t.length?t:Array.from(e)}var ln="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function cn(t,e){var i=[],n=!1;return function(){for(var r=arguments.length,a=new Array(r),s=0;s{n=!1,t.apply(e,i)})))}}var dn=t=>"start"===t?"left":"end"===t?"right":"center",hn=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function un(t,e,i){var n=e.length,r=0,a=n;if(t._sorted){var s=t.iScale,o=t._parsed,l=s.axis,c=s.getUserBounds(),d=c.min,h=c.max,u=c.minDefined,f=c.maxDefined;u&&(r=Qi(Math.min(nn(o,l,d).lo,i?n:nn(e,l,s.getPixelForValue(d)).lo),0,n-1)),a=f?Qi(Math.max(nn(o,s.axis,h,!0).hi+1,i?0:nn(e,l,s.getPixelForValue(h),!0).hi+1),r,n)-r:n-r}return{start:r,count:a}}function fn(t){var e=t.xScale,i=t.yScale,n=t._scaleRanges,r={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=r,!0;var a=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,r),a}var pn=t=>0===t||1===t,vn=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*zi/i),gn=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*zi/i)+1,mn={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*ji),easeOutSine:t=>Math.sin(t*ji),easeInOutSine:t=>-.5*(Math.cos(Li*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>pn(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>pn(t)?t:vn(t,.075,.3),easeOutElastic:t=>pn(t)?t:gn(t,.075,.3),easeInOutElastic(t){var e=.1125;return pn(t)?t:t<.5?.5*vn(2*t,e,.45):.5+.5*gn(2*t-1,e,.45)},easeInBack(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-mn.easeOutBounce(1-t),easeOutBounce(t){var e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*mn.easeInBounce(2*t):.5*mn.easeOutBounce(2*t-1)+.5};function bn(t){if(t&&"object"==typeof t){var e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function xn(t){return bn(t)?t:new ri(t)}function _n(t){return bn(t)?t:new ri(t).saturate(.5).darken(.1).hexString()}var yn=["x","y","borderWidth","radius","tension"],wn=["color","borderColor","backgroundColor"];var kn=new Map;function $n(t,e,i){return function(t,e){e=e||{};var i=t+JSON.stringify(e),n=kn.get(i);return n||(n=new Intl.NumberFormat(t,e),kn.set(i,n)),n}(e,i).format(t)}var Mn={values:t=>ci(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";var n,r=this.chart.options.locale,a=t;if(i.length>1){var s=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(s<1e-4||s>1e15)&&(n="scientific"),a=function(t,e){var i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}var o=Fi(Math.abs(a)),l=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:n,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),$n(t,r,c)},logarithmic(t,e,i){if(0===t)return"0";var n=i[e].significand||t/Math.pow(10,Math.floor(Fi(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?Mn.numeric.call(this,t,e,i):""}};var Cn={formatters:Mn};var Sn=Object.create(null),Tn=Object.create(null);function Pn(t,e){if(!e)return t;for(var i=e.split("."),n=0,r=i.length;nt.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>_n(e.backgroundColor),this.hoverBorderColor=(t,e)=>_n(e.borderColor),this.hoverColor=(t,e)=>_n(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Dn(this,t,e)}get(t){return Pn(this,t)}describe(t,e){return Dn(Tn,t,e)}override(t,e){return Dn(Sn,t,e)}route(t,e,i,n){var r=Pn(this,t),a=Pn(this,i),s="_"+e;Object.defineProperties(r,{[s]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){var t=this[s],e=a[n];return di(t)?Object.assign({},e,t):fi(t,e)},set(t){this[s]=t}}})}apply(t){t.forEach((t=>t(this)))}}var zn=new Ln({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:wn},numbers:{type:"number",properties:yn}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Cn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function On(t,e,i,n,r){var a=e[r];return a||(a=e[r]=t.measureText(r).width,i.push(r)),a>n&&(n=a),n}function An(t,e,i,n){var r=(n=n||{}).data=n.data||{},a=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},a=n.garbageCollect=[],n.font=e),t.save(),t.font=e;var s,o,l,c,d,h=0,u=i.length;for(s=0;si.length){for(s=0;s0&&t.stroke()}}function Fn(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y5&&void 0!==arguments[5]?arguments[5]:{},l=ci(e)?e:[e],c=o.strokeWidth>0&&""!==o.strokeColor;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),li(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),a=0;afi(t[i],t[e[i]]):e=>t[e]:()=>t,l=n(s);try{for(l.s();!(i=l.n()).done;){var c=i.value;r[c]=+o(c)||0}}catch(t){l.e(t)}finally{l.f()}return r}function Jn(t){return Zn(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Qn(t){return Zn(t,["topLeft","topRight","bottomLeft","bottomRight"])}function tr(t){var e=Jn(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function er(t,e){t=t||{},e=e||zn.font;var i=fi(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));var n=fi(t.style,e.style);n&&!(""+n).match(Gn)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);var r={family:fi(t.family,e.family),lineHeight:Kn(fi(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:fi(t.weight,e.weight),string:""};return r.string=function(t){return!t||li(t.size)||li(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function ir(t,e,i,n){var r,a,s;for(r=0,a=t.length;r1&&void 0!==arguments[1]?arguments[1]:[""],i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>t[0],a=(arguments.length>2?arguments[2]:void 0)||t;void 0===i&&(i=vr("_fallback",t));var s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:a,_fallback:i,_getTarget:r,override:n=>rr([n,...t],e,a,i)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,r)=>cr(i,r,(()=>function(t,e,i,r){var a,s,o=n(e);try{for(o.s();!(s=o.n()).done;){var l=s.value;if(void 0!==(a=vr(or(l,t),i)))return lr(t,a)?fr(i,r,t,a):a}}catch(t){o.e(t)}finally{o.f()}}(r,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>gr(t).includes(e),ownKeys:t=>gr(t),set(t,e,i){var n=t._storage||(t._storage=r());return t[e]=n[e]=i,delete t._keys,!0}})}function ar(t,e,i,r){var a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:sr(t,r),setContext:e=>ar(t,e,i,r),override:n=>ar(t.override(n),e,i,r)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>cr(t,e,(()=>function(t,e,i){var r=t._proxy,a=t._context,s=t._subProxy,o=t._descriptors,l=r[e];Pi(l)&&o.isScriptable(e)&&(l=function(t,e,i,n){var r=i._proxy,a=i._context,s=i._subProxy,o=i._stack;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);o.add(t);var l=e(a,s||n);o.delete(t),lr(t,l)&&(l=fr(r._scopes,r,t,l));return l}(e,l,t,i));ci(l)&&l.length&&(l=function(t,e,i,r){var a=i._proxy,s=i._context,o=i._subProxy,l=i._descriptors;if(void 0!==s.index&&r(t))return e[s.index%e.length];if(di(e[0])){var c=e,d=a._scopes.filter((t=>t!==c));e=[];var h,u=n(c);try{for(u.s();!(h=u.n()).done;){var f=fr(d,a,t,h.value);e.push(ar(f,s,o&&o[t],l))}}catch(t){u.e(t)}finally{u.f()}}return e}(e,l,t,o.isIndexable));lr(e,l)&&(l=ar(l,a,s&&s[e],o));return l}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function sr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scriptable:!0,indexable:!0},i=t._scriptable,n=void 0===i?e.scriptable:i,r=t._indexable,a=void 0===r?e.indexable:r,s=t._allKeys;return{allKeys:void 0===s?e.allKeys:s,scriptable:n,indexable:a,isScriptable:Pi(n)?n:()=>n,isIndexable:Pi(a)?a:()=>a}}var or=(t,e)=>t?t+Si(e):e,lr=(t,e)=>di(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function cr(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];var n=i();return t[e]=n,n}function dr(t,e,i){return Pi(t)?t(e,i):t}var hr=(t,e)=>!0===t?e:"string"==typeof t?Ci(e,t):void 0;function ur(t,e,i,r,a){var s,o=n(e);try{for(o.s();!(s=o.n()).done;){var l=s.value,c=hr(i,l);if(c){t.add(c);var d=dr(c._fallback,i,a);if(void 0!==d&&d!==i&&d!==r)return d}else if(!1===c&&void 0!==r&&i!==r)return null}}catch(t){o.e(t)}finally{o.f()}return!1}function fr(t,e,i,n){var r=e._rootScopes,a=dr(e._fallback,i,n),s=[...t,...r],o=new Set;o.add(n);var l=pr(o,s,i,a||i,n);return null!==l&&((void 0===a||a===i||null!==(l=pr(o,s,a,l,n)))&&rr(Array.from(o),[""],r,a,(()=>function(t,e,i){var n=t._getTarget();e in n||(n[e]={});var r=n[e];if(ci(r)&&di(i))return i;return r||{}}(e,i,n))))}function pr(t,e,i,n,r){for(;i;)i=ur(t,e,i,n,r);return i}function vr(t,e){var i,r=n(e);try{for(r.s();!(i=r.n()).done;){var a=i.value;if(a){var s=a[t];if(void 0!==s)return s}}}catch(t){r.e(t)}finally{r.f()}}function gr(t){var e=t._keys;return e||(e=t._keys=function(t){var e,i=new Set,r=n(t);try{for(r.s();!(e=r.n()).done;){var a,s=e.value,o=n(Object.keys(s).filter((t=>!t.startsWith("_"))));try{for(o.s();!(a=o.n()).done;){var l=a.value;i.add(l)}}catch(t){o.e(t)}finally{o.f()}}}catch(t){r.e(t)}finally{r.f()}return Array.from(i)}(t._scopes)),e}function mr(t,e,i,n){var r,a,s,o,l=t.iScale,c=this._parsing.key,d=void 0===c?"r":c,h=new Array(n);for(r=0,a=n;re"x"===t?"y":"x";function yr(t){var e,i,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",a=_r(r),s=t.length,o=Array(s).fill(0),l=Array(s),c=xr(t,0);for(e=0;e2&&void 0!==arguments[2]?arguments[2]:"x",s=_r(a),o=t.length,l=xr(t,0),c=0;c!t.skip))),"monotone"===e.cubicInterpolationMode)yr(t,r);else{var w=n?t[t.length-1]:t[0];for(a=0,s=t.length;at.ownerDocument.defaultView.getComputedStyle(t,null);var Tr=["top","right","bottom","left"];function Pr(t,e,i){var n={};i=i?"-"+i:"";for(var r=0;r<4;r++){var a=Tr[r];n[a]=parseFloat(t[e+"-"+a+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Dr(t,e){if("native"in t)return t;var i=e.canvas,n=e.currentDevicePixelRatio,r=Sr(i),a="border-box"===r.boxSizing,s=Pr(r,"padding"),o=Pr(r,"border","width"),l=function(t,e){var i,n,r=t.touches,a=r&&r.length?r[0]:t,s=a.offsetX,o=a.offsetY,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,o,t.target))i=s,n=o;else{var c=e.getBoundingClientRect();i=a.clientX-c.left,n=a.clientY-c.top,l=!0}return{x:i,y:n,box:l}}(t,i),c=l.x,d=l.y,h=l.box,u=s.left+(h&&o.left),f=s.top+(h&&o.top),p=e.width,v=e.height;return a&&(p-=s.width+o.width,v-=s.height+o.height),{x:Math.round((c-u)/p*i.width/n),y:Math.round((d-f)/v*i.height/n)}}var Lr=t=>Math.round(10*t)/10;function zr(t,e,i,n){var r=Sr(t),a=Pr(r,"margin"),s=Cr(r.maxWidth,t,"clientWidth")||Ai,o=Cr(r.maxHeight,t,"clientHeight")||Ai,l=function(t,e,i){var n,r;if(void 0===e||void 0===i){var a=t&&Mr(t);if(a){var s=a.getBoundingClientRect(),o=Sr(a),l=Pr(o,"border","width"),c=Pr(o,"padding");e=s.width-c.width-l.width,i=s.height-c.height-l.height,n=Cr(o.maxWidth,a,"clientWidth"),r=Cr(o.maxHeight,a,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||Ai,maxHeight:r||Ai}}(t,e,i),c=l.width,d=l.height;if("content-box"===r.boxSizing){var h=Pr(r,"border","width"),u=Pr(r,"padding");c-=u.width+h.width,d-=u.height+h.height}return c=Math.max(0,c-a.width),d=Math.max(0,n?c/n:d-a.height),c=Lr(Math.min(c,s,l.maxWidth)),d=Lr(Math.min(d,o,l.maxHeight)),c&&!d&&(d=Lr(c/2)),(void 0!==e||void 0!==i)&&n&&l.height&&d>l.height&&(d=l.height,c=Lr(Math.floor(d*n))),{width:c,height:d}}function Or(t,e,i){var n=e||1,r=Math.floor(t.height*n),a=Math.floor(t.width*n);t.height=Math.floor(t.height),t.width=Math.floor(t.width);var s=t.canvas;return s.style&&(i||!s.style.height&&!s.style.width)&&(s.style.height="".concat(t.height,"px"),s.style.width="".concat(t.width,"px")),(t.currentDevicePixelRatio!==n||s.height!==r||s.width!==a)&&(t.currentDevicePixelRatio=n,s.height=r,s.width=a,t.ctx.setTransform(n,0,0,n,0,0),!0)}var Ar=function(){var t=!1;try{var e={get passive(){return t=!0,!1}};$r()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Er(t,e){var i=function(t,e){return Sr(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function jr(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ir(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function Rr(t,e,i,n){var r={x:t.cp2x,y:t.cp2y},a={x:e.cp1x,y:e.cp1y},s=jr(t,r,i),o=jr(r,a,i),l=jr(a,e,i),c=jr(s,o,i),d=jr(o,l,i);return jr(c,d,i)}function Fr(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Hr(t,e){var i,n;"ltr"!==e&&"rtl"!==e||(n=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function Nr(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Vr(t){return"angle"===t?{between:Ji,compare:Ki,normalize:Zi}:{between:tn,compare:(t,e)=>t-e,normalize:t=>t}}function Br(t){var e=t.start,i=t.end,n=t.count;return{start:e%n,end:i%n,loop:t.loop&&(i-e+1)%n==0,style:t.style}}function Wr(t,e,i){if(!i)return[t];for(var n,r,a,s=i.property,o=i.start,l=i.end,c=e.length,d=Vr(s),h=d.compare,u=d.between,f=d.normalize,p=function(t,e,i){var n,r,a=i.property,s=i.start,o=i.end,l=Vr(a),c=l.between,d=l.normalize,h=e.length,u=t.start,f=t.end,p=t.loop;if(p){for(u+=h,f+=h,n=0,r=h;n_||u(o,a,n)&&0!==h(o,a),k=()=>!_||0===h(l,n)||u(l,a,n),$=v,M=v;$<=g;++$)(r=e[$%c]).skip||(n=f(r[s]))!==a&&(_=u(n,o,l),null===y&&w()&&(y=0===h(n,o)?$:M),null!==y&&k()&&(x.push(Br({start:y,end:$,loop:m,count:c,style:b})),y=null),M=$,a=n);return null!==y&&x.push(Br({start:y,end:g,loop:m,count:c,style:b})),x}function qr(t,e){for(var i=[],n=t.segments,r=0;rn({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)})))}_refresh(){this._request||(this._running=!0,this._request=ln.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now(),e=0;this._charts.forEach(((i,n)=>{if(i.running&&i.items.length){for(var r,a=i.items,s=a.length-1,o=!1;s>=0;--s)(r=a[s])._active?(r._total>i.duration&&(i.duration=r._total),r.tick(t),o=!0):(a[s]=a[a.length-1],a.pop());o&&(n.draw(),this._notify(n,i,t,"progress")),a.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=a.length}})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){var e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){var e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;var e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){var e=this._charts.get(t);if(e&&e.items.length){for(var i=e.items,n=i.length-1;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}}remove(t){return this._charts.delete(t)}}var Kr=new Gr,Zr="transparent",Jr={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){var n=xn(t||Zr),r=n.valid&&xn(e||Zr);return r&&r.valid?r.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Qr{constructor(t,e,i,n){var r=e[i];n=ir([t.to,n,r,t.from]);var a=ir([t.from,r,n]);this._active=!0,this._fn=t.fn||Jr[t.type||typeof a],this._easing=mn[t.easing]||mn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);var n=this._target[this._prop],r=i-this._start,a=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ir([t.to,e,n,t.from]),this._from=ir([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){var e,i=t-this._start,n=this._duration,r=this._prop,a=this._from,s=this._loop,o=this._to;if(this._active=a!==o&&(s||i1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[r]=this._fn(a,o,e))}wait(){var t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){for(var e=t?"res":"rej",i=this._promises||[],n=0;n{var r=t[n];if(di(r)){for(var a={},s=0,o=e;s{t!==n&&i.has(t)||i.set(t,a)}))}}))}}_animateOptions(t,e){var i=e.options,n=function(t,e){if(!e)return;var i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!n)return[];var r=this._createAnimations(n,i);return i.$shared&&function(t,e){for(var i=[],n=Object.keys(e),r=0;r{t.options=i}),(()=>{})),r}_createAnimations(t,e){var i,n=this._properties,r=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();for(i=s.length-1;i>=0;--i){var l=s[i];if("$"!==l.charAt(0))if("options"!==l){var c=e[l],d=a[l],h=n.get(l);if(d){if(h&&d.active()){d.update(h,c,o);continue}d.cancel()}h&&h.duration?(a[l]=d=new Qr(h,t,l,c),r.push(d)):t[l]=c}else r.push(...this._animateOptions(t,e))}return r}update(t,e){if(0!==this._properties.size){var i=this._createAnimations(t,e);return i.length?(Kr.add(this._chart,i),!0):void 0}Object.assign(t,e)}}function ea(t,e){var i=t&&t.options||{},n=i.reverse,r=void 0===i.min?e:0,a=void 0===i.max?e:0;return{start:n?a:r,end:n?r:a}}function ia(t,e){var i,n,r=[],a=t._getSortedDatasetMetas(e);for(i=0,n=a.length;i3&&void 0!==arguments[3]?arguments[3]:{},l=t.keys,c="single"===o.mode;if(null!==e){var d=!1;for(n=0,r=l.length;n0||!i&&l<0)return o.index}}catch(t){s.e(t)}finally{s.f()}return null}function oa(t,e){for(var i,n=t.chart,r=t._cachedMeta,a=n._stacks||(n._stacks={}),s=r.iScale,o=r.vScale,l=r.index,c=s.axis,d=o.axis,h=function(t,e,i){return"".concat(t.id,".").concat(e.id,".").concat(i.stack||i.type)}(s,o,r),u=e.length,f=0;fi[t].axis===e)).shift()}function ca(t,e){var i=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){var a,s=n(e=e||t._parsed);try{for(s.s();!(a=s.n()).done;){var o=a.value._stacks;if(!o||void 0===o[r]||void 0===o[r][i])return;delete o[r][i],void 0!==o[r]._visualValues&&void 0!==o[r]._visualValues[i]&&delete o[r]._visualValues[i]}}catch(t){s.e(t)}finally{s.f()}}}var da=t=>"reset"===t||"none"===t,ha=(t,e)=>e?t:Object.assign({},t);class ua{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){var t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ra(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ca(this._cachedMeta),this.index=t}linkScales(){var t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,r=e.xAxisID=fi(i.xAxisID,la(t,"x")),a=e.yAxisID=fi(i.yAxisID,la(t,"y")),s=e.rAxisID=fi(i.rAxisID,la(t,"r")),o=e.indexAxis,l=e.iAxisID=n(o,r,a,s),c=e.vAxisID=n(o,a,r,s);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(s),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){var e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){var t=this._cachedMeta;this._data&&sn(this._data,this),t._stacked&&ca(t)}_dataCheck(){var t,e,i=this.getDataset(),n=i.data||(i.data=[]),r=this._data;if(di(n)){var a=this._cachedMeta;this._data=function(t,e){var i,n,r,a=e.iScale,s=e.vScale,o="x"===a.axis?"x":"y",l="x"===s.axis?"x":"y",c=Object.keys(t),d=new Array(c.length);for(i=0,n=c.length;i{var i="_onData"+Si(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(){for(var e=arguments.length,r=new Array(e),a=0;a{"function"==typeof t[i]&&t[i](...r)})),s}})})))),this._syncList=[],this._data=n}}addElements(){var t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){var e=this._cachedMeta,i=this.getDataset(),n=!1;this._dataCheck();var r=e._stacked;e._stacked=ra(e.vScale,e),e.stack!==i.stack&&(n=!0,ca(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&(oa(this,e._parsed),e._stacked=ra(e.vScale,e))}configure(){var t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){var i,n,r,a=this._cachedMeta,s=this._data,o=a.iScale,l=a._stacked,c=o.axis,d=0===t&&e===s.length||a._sorted,h=t>0&&a._parsed[t-1];if(!1===this._parsing)a._parsed=s,a._sorted=!0,r=s;else{r=ci(s[t])?this.parseArrayData(a,s,t,e):di(s[t])?this.parseObjectData(a,s,t,e):this.parsePrimitiveData(a,s,t,e);for(i=0;it&&!e.hidden&&e._stacked&&{keys:ia(i,!0),values:null})(e,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},h=function(t){var e=t.getUserBounds(),i=e.min,n=e.max,r=e.minDefined,a=e.maxDefined;return{min:r?i:Number.NEGATIVE_INFINITY,max:a?n:Number.POSITIVE_INFINITY}}(l),u=h.min,f=h.max;function p(){var e=(n=a[i])[l.axis];return!hi(n[t.axis])||u>e||f=0;--i)if(!p()){this.updateRangeFromParsed(d,t,n,c);break}return d}getAllParsedValues(t){var e,i,n,r=this._cachedMeta._parsed,a=[];for(e=0,i=r.length;e=0&&t1&&void 0!==arguments[1]?arguments[1]:"default",i=arguments.length>2?arguments[2]:void 0,n="active"===e,r=this._cachedDataOpts,a=t+"-"+e,s=r[a],o=this.enableOptionSharing&&Ti(i);if(s)return ha(s,o);var l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),d=n?["".concat(t,"Hover"),"hover",t,""]:[t,""],h=l.getOptionScopes(this.getDataset(),c),u=Object.keys(zn.elements[t]),f=l.resolveNamedOptions(h,u,(()=>this.getContext(i,n,e)),d);return f.$shared&&(f.$shared=o,r[a]=Object.freeze(ha(f,o))),f}_resolveAnimations(t,e,i){var n,r=this.chart,a=this._cachedDataOpts,s="animation-".concat(e),o=a[s];if(o)return o;if(!1!==r.options.animation){var l=this.chart.config,c=l.datasetAnimationScopeKeys(this._type,e),d=l.getOptionScopes(this.getDataset(),c);n=l.createResolver(d,this.getContext(t,i,e))}var h=new ta(r,n&&n.animations);return n&&n._cacheable&&(a[s]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||da(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){var i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),a=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:a}}updateElement(t,e,i,n){da(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!da(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;var r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){var e,i=this._data,r=this._cachedMeta.data,a=n(this._syncList);try{for(a.s();!(e=a.n()).done;){var s=l(e.value,3),o=s[0],c=s[1],d=s[2];this[o](c,d)}}catch(t){a.e(t)}finally{a.f()}this._syncList=[];var h=r.length,u=i.length,f=Math.min(u,h);f&&this.parse(0,f),u>h?this._insertElements(h,u-h,t):u2&&void 0!==arguments[2])||arguments[2],r=this._cachedMeta,a=r.data,s=t+e,o=t=>{for(t.length+=e,i=t.length-1;i>=s;i--)t[i]=t[i-e]};for(o(a),i=t;it-e)))}return t._cache.$bar}(a,t.type),o=a._length,l=()=>{32767!==n&&-32768!==n&&(Ti(r)&&(o=Math.min(o,Math.abs(n-r)||o)),r=n)};for(e=0,i=s.length;eMath.abs(o)&&(l=o,c=s),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:r,end:a,min:s,max:o}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function va(t,e,i,n){var r,a,s,o,l=t.iScale,c=t.vScale,d=l.getLabels(),h=l===c,u=[];for(r=i,a=i+n;rt.x,i="left",n="right"):(e=t.baset.controller.options.grouped)),s=r.options.stacked,o=[],l=this._cachedMeta.controller.getParsed(e),c=l&&l[r.axis],d=t=>{var e=t._parsed.find((t=>t[r.axis]===c)),i=e&&e[t.vScale.axis];if(li(i)||isNaN(i))return!0},h=n(a);try{for(h.s();!(i=h.n()).done;){var u=i.value;if((void 0===e||!d(u))&&((!1===s||-1===o.indexOf(u.stack)||void 0===s&&void 0===u.stack)&&o.push(u.stack),u.index===t))break}}catch(t){h.e(t)}finally{h.f()}return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){var n=this._getStacks(t,i),r=void 0!==e?n.indexOf(e):-1;return-1===r?n.length-1:r}_getRuler(){var t,e,i=this.options,n=this._cachedMeta,r=n.iScale,a=[];for(t=0,e=n.data.length;t=i?1:-1)}(i,r,d)*c,p===d&&(b-=i/2);var x=r.getPixelForDecimal(0),_=r.getPixelForDecimal(1),y=Math.min(x,_),w=Math.max(x,_);e=(b=Math.max(Math.min(b,w),y))+i,a&&!f&&(h._stacks[r.axis]._visualValues[s]=r.getValueForPixel(e)-r.getValueForPixel(b))}if(b===r.getPixelForValue(d)){var k=Hi(i)*r.getLineWidthForValue(d)/2;b+=k,i-=k}return{size:i,base:b,head:e,center:e+i/2}}_calculateBarIndexPixels(t,e){var i,n,r=e.scale,a=this.options,s=a.skipNull,o=fi(a.maxBarThickness,1/0);if(e.grouped){var l=s?this._getStackCount(t):e.stackCount,c="flex"===a.barThickness?function(t,e,i,n){var r=e.pixels,a=r[t],s=t>0?r[t-1]:null,o=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart.data.labels||[],n=e.xScale,r=e.yScale,a=this.getParsed(t),s=n.getLabelForValue(a.x),o=r.getLabelForValue(a.y),l=a._custom;return{label:i[t]||"",value:"("+s+", "+o+(l?", "+l:"")+")"}}update(t){var e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){for(var r="reset"===n,a=this._cachedMeta,s=a.iScale,o=a.vScale,l=this._getSharedOptions(e,n),c=l.sharedOptions,d=l.includeOptions,h=s.axis,u=o.axis,f=e;f+i[t];if(di(i[t])){var o=this._parsing.key,l=void 0===o?"value":o;s=t=>+Ci(i[t],l)}for(r=t,a=t+e;rJi(t,o,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>Ji(t,o,l,!0)?-1:Math.min(e,e*i,n,n*i),v=f(0,c,h),g=f(ji,d,u),m=p(Li,c,h),b=p(Li+ji,d,u);n=(v-m)/2,r=(g-b)/2,a=-(v+m)/2,s=-(g+b)/2}return{ratioX:n,ratioY:r,offsetX:a,offsetY:s}}(d.rotation,h,l),f=u.ratioX,p=u.ratioY,v=u.offsetX,g=u.offsetY,m=(n.width-s)/f,b=(n.height-s)/p,x=Math.max(Math.min(m,b)/2,0),_=pi(this.options.radius,x),y=(_-Math.max(_*l,0))/this._getVisibleDatasetWeightTotal();this.offsetX=v*_,this.offsetY=g*_,r.total=this.calculateTotal(),this.outerRadius=_-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){var i=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/zi)}updateElements(t,e,i,n){var r,a="reset"===n,s=this.chart,o=s.chartArea,l=s.options.animation,c=(o.left+o.right)/2,d=(o.top+o.bottom)/2,h=a&&l.animateScale,u=h?0:this.innerRadius,f=h?0:this.outerRadius,p=this._getSharedOptions(e,n),v=p.sharedOptions,g=p.includeOptions,m=this._getRotation();for(r=0;r0&&!isNaN(t)?zi*(Math.abs(t)/e):0}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=$n(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){var e,i,n,r,a,s=0,o=this.chart;if(!t)for(e=0,i=o.data.datasets.length;e"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),r(ka,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){var e=t.data;if(e.labels.length&&e.datasets.length){var i=t.legend.options.labels,n=i.pointStyle,r=i.color;return e.labels.map(((e,i)=>{var a=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class $a extends ua{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){var e=this._cachedMeta,i=e.dataset,n=e.data,r=void 0===n?[]:n,a=e._dataset,s=this.chart._animationsDisabled,o=un(e,r,s),l=o.start,c=o.count;this._drawStart=l,this._drawCount=c,fn(e)&&(l=0,c=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=r;var d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:d},t),this.updateElements(r,l,c,t)}updateElements(t,e,i,n){for(var r="reset"===n,a=this._cachedMeta,s=a.iScale,o=a.vScale,l=a._stacked,c=a._dataset,d=this._getSharedOptions(e,n),h=d.sharedOptions,u=d.includeOptions,f=s.axis,p=o.axis,v=this.options,g=v.spanGaps,m=v.segment,b=Bi(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||"none"===n,_=e+i,y=t.length,w=e>0&&this.getParsed(e-1),k=0;k=_)M.skip=!0;else{var C=this.getParsed(k),S=li(C[p]),T=M[f]=s.getPixelForValue(C[f],k),P=M[p]=r||S?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,C,l):C[p],k);M.skip=isNaN(T)||isNaN(P)||S,M.stop=k>0&&Math.abs(C[f]-w[f])>b,m&&(M.parsed=C,M.raw=c.data[k]),u&&(M.options=h||this.resolveDataElementOptions(k,$.active?"active":n)),x||this.updateElement($,k,M,n),w=C}}}getMaxOverflow(){var t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;var r=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,a)/2}draw(){var t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}r($a,"id","line"),r($a,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),r($a,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ma extends ua{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=$n(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return mr.bind(this)(t,e,i,n)}update(t){var e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){var t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{var n=this.getParsed(i).r;!isNaN(n)&&this.chart.getDataVisibility(i)&&(ne.max&&(e.max=n))})),e}_updateRadius(){var t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),a=(r-Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,n){var r,a="reset"===n,s=this.chart,o=s.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,d=l.yCenter,h=l.getIndexAngle(0)-.5*Li,u=h,f=360/this.countVisibleElements();for(r=0;r{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?qi(this.resolveDataElementOptions(t,e).angle||i):0}}r(Ma,"id","polarArea"),r(Ma,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),r(Ma,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){var e=t.data;if(e.labels.length&&e.datasets.length){var i=t.legend.options.labels,n=i.pointStyle,r=i.color;return e.labels.map(((e,i)=>{var a=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Ca extends ka{}r(Ca,"id","pie"),r(Ca,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Sa extends ua{getLabelAndValue(t){var e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return mr.bind(this)(t,e,i,n)}update(t){var e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,"resize"!==t){var a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);var s={_loop:!0,_fullLoop:r.length===n.length,options:a};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){for(var r=this._cachedMeta.rScale,a="reset"===n,s=e;s0&&this.getParsed(e-1),y=e;y0&&Math.abs(k[f]-_[f])>b,m&&($.parsed=k,$.raw=c.data[y]),u&&($.options=h||this.resolveDataElementOptions(y,w.active?"active":n)),x||this.updateElement(w,y,$,n),_=k}this.updateSharedOptions(h,n,d)}getMaxOverflow(){var t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){for(var i=0,n=e.length-1;n>=0;--n)i=Math.max(i,e[n].size(this.resolveDataElementOptions(n))/2);return i>0&&i}var r=t.dataset,a=r.options&&r.options.borderWidth||0;if(!e.length)return a;var s=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(a,s,o)/2}}function Pa(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}r(Ta,"id","scatter"),r(Ta,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),r(Ta,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});class Da{static override(t){Object.assign(Da.prototype,t)}constructor(t){r(this,"options",void 0),this.options=t||{}}init(){}formats(){return Pa()}parse(){return Pa()}format(){return Pa()}add(){return Pa()}diff(){return Pa()}startOf(){return Pa()}endOf(){return Pa()}}var La=Da;function za(t,e,i,n){var r=t.controller,a=t.data,s=t._sorted,o=r._cachedMeta.iScale;if(o&&e===o.axis&&"r"!==e&&s&&a.length){var l=o._reversePixels?rn:nn;if(!n)return l(a,e,i);if(r._sharedOptions){var c=a[0],d="function"==typeof c.getRange&&c.getRange(e);if(d){var h=l(a,e,i-d),u=l(a,e,i+d);return{lo:h.lo,hi:u.hi}}}}return{lo:0,hi:a.length-1}}function Oa(t,e,i,n,r){for(var a=t.getSortedVisibleDatasetMetas(),s=i[e],o=0,l=a.length;o{t[s]&&t[s](e[i],r)&&(a.push({element:t,datasetIndex:n,index:l}),o=o||t.inRange(e.x,e.y,r))})),n&&!o?[]:a}var Ra={evaluateInteractionItems:Oa,modes:{index(t,e,i,n){var r=Dr(e,t),a=i.axis||"x",s=i.includeInvisible||!1,o=i.intersect?Aa(t,r,a,n,s):ja(t,r,a,!1,n,s),l=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{var e=o[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,n){var r=Dr(e,t),a=i.axis||"xy",s=i.includeInvisible||!1,o=i.intersect?Aa(t,r,a,n,s):ja(t,r,a,!1,n,s);if(o.length>0){var l=o[0].datasetIndex,c=t.getDatasetMeta(l).data;o=[];for(var d=0;dAa(t,Dr(e,t),i.axis||"xy",n,i.includeInvisible||!1),nearest(t,e,i,n){var r=Dr(e,t),a=i.axis||"xy",s=i.includeInvisible||!1;return ja(t,r,a,i.intersect,n,s)},x:(t,e,i,n)=>Ia(t,Dr(e,t),"x",i.intersect,n),y:(t,e,i,n)=>Ia(t,Dr(e,t),"y",i.intersect,n)}},Fa=["left","top","right","bottom"];function Ha(t,e){return t.filter((t=>t.pos===e))}function Na(t,e){return t.filter((t=>-1===Fa.indexOf(t.pos)&&t.box.axis===e))}function Va(t,e){return t.sort(((t,i)=>{var n=e?i:t,r=e?t:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight}))}function Ba(t,e){var i,r,a,s=function(t){var e,i={},r=n(t);try{for(r.s();!(e=r.n()).done;){var a=e.value,s=a.stack,o=a.pos,l=a.stackWeight;if(s&&Fa.includes(o)){var c=i[s]||(i[s]={count:0,placed:0,weight:0,size:0});c.count++,c.weight+=l}}}catch(t){r.e(t)}finally{r.f()}return i}(t),o=e.vBoxMaxWidth,l=e.hBoxMaxHeight;for(i=0,r=t.length;i{n[t]=Math.max(e[t],i[t])})),n}return n(t?["left","right"]:["top","bottom"])}function Xa(t,e,i,n){var r,a,s,o,l,c,d=[];for(r=0,a=t.length,l=0;rt.box.fullSize)),!0),n=Va(Ha(e,"left"),!0),r=Va(Ha(e,"right")),a=Va(Ha(e,"top"),!0),s=Va(Ha(e,"bottom")),o=Na(e,"x"),l=Na(e,"y");return{fullSize:i,leftAndTop:n.concat(a),rightAndBottom:r.concat(l).concat(s).concat(o),chartArea:Ha(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:a.concat(s).concat(o)}}(t.boxes),l=o.vertical,c=o.horizontal;gi(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));var d=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,h=Object.freeze({outerWidth:e,outerHeight:i,padding:r,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/d,hBoxMaxHeight:s/2}),u=Object.assign({},r);qa(u,tr(n));var f=Object.assign({maxPadding:u,w:a,h:s,x:r.left,y:r.top},r),p=Ba(l.concat(c),h);Xa(o.fullSize,f,h,p),Xa(l,f,h,p),Xa(c,f,h,p)&&Xa(l,f,h,p),function(t){var e=t.maxPadding;function i(i){var n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),Ka(o.leftAndTop,f,h,p),f.x+=f.w,f.y+=f.h,Ka(o.rightAndBottom,f,h,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},gi(o.chartArea,(e=>{var i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}}};class Ja{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class Qa extends Ja{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}var ts="$chartjs",es={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},is=t=>null===t||""===t;var ns=!!Ar&&{passive:!0};function rs(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,ns)}function as(t,e){var i,r=n(t);try{for(r.s();!(i=r.n()).done;){var a=i.value;if(a===e||a.contains(e))return!0}}catch(t){r.e(t)}finally{r.f()}}function ss(t,e,i){var r=t.canvas,a=new MutationObserver((t=>{var e,a=!1,s=n(t);try{for(s.s();!(e=s.n()).done;){var o=e.value;a=(a=a||as(o.addedNodes,r))&&!as(o.removedNodes,r)}}catch(t){s.e(t)}finally{s.f()}a&&i()}));return a.observe(document,{childList:!0,subtree:!0}),a}function os(t,e,i){var r=t.canvas,a=new MutationObserver((t=>{var e,a=!1,s=n(t);try{for(s.s();!(e=s.n()).done;){var o=e.value;a=(a=a||as(o.removedNodes,r))&&!as(o.addedNodes,r)}}catch(t){s.e(t)}finally{s.f()}a&&i()}));return a.observe(document,{childList:!0,subtree:!0}),a}var ls=new Map,cs=0;function ds(){var t=window.devicePixelRatio;t!==cs&&(cs=t,ls.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function hs(t,e,i){var n=t.canvas,r=n&&Mr(n);if(r){var a=cn(((t,e)=>{var n=r.clientWidth;i(t,e),n{var e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||a(i,n)}));return s.observe(r),function(t,e){ls.size||window.addEventListener("resize",ds),ls.set(t,e)}(t,a),s}}function us(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){ls.delete(t),ls.size||window.removeEventListener("resize",ds)}(t)}function fs(t,e,i){var n=t.canvas,r=cn((e=>{null!==t.ctx&&i(function(t,e){var i=es[t.type]||t.type,n=Dr(t,e),r=n.x,a=n.y;return{type:i,chart:e,native:t,x:void 0!==r?r:null,y:void 0!==a?a:null}}(e,t))}),t);return function(t,e,i){t&&t.addEventListener(e,i,ns)}(n,e,r),r}class ps extends Ja{acquireContext(t,e){var i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){var i=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t[ts]={initial:{height:n,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",is(r)){var a=Er(t,"width");void 0!==a&&(t.width=a)}if(is(n))if(""===t.style.height)t.height=t.width/(e||2);else{var s=Er(t,"height");void 0!==s&&(t.height=s)}}(t,e),i):null}releaseContext(t){var e=t.canvas;if(!e[ts])return!1;var i=e[ts].initial;["height","width"].forEach((t=>{var n=i[t];li(n)?e.removeAttribute(t):e.setAttribute(t,n)}));var n=i.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e[ts],!0}addEventListener(t,e,i){this.removeEventListener(t,e);var n=t.$proxies||(t.$proxies={}),r={attach:ss,detach:os,resize:hs}[e]||fs;n[e]=r(t,e,i)}removeEventListener(t,e){var i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:us,detach:us,resize:us}[e]||rs)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return zr(t,e,i,n)}isAttached(t){var e=t&&Mr(t);return!(!e||!e.isConnected)}}class vs{constructor(){r(this,"x",void 0),r(this,"y",void 0),r(this,"active",!1),r(this,"options",void 0),r(this,"$animations",void 0)}tooltipPosition(t){var e=this.getProps(["x","y"],t);return{x:e.x,y:e.y}}hasValue(){return Bi(this.x)&&Bi(this.y)}getProps(t,e){var i=this.$animations;if(!e||!i)return this;var n={};return t.forEach((t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),n}}function gs(t,e){var i=t.options.ticks,n=function(t){var e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),r=t._maxLength/i;return Math.floor(Math.min(n,r))}(t),r=Math.min(i.maxTicksLimit||n,n),a=i.major.enabled?function(t){var e,i,n=[];for(e=0,i=t.length;er)return function(t,e,i,n){var r,a=0,s=i[0];for(n=Math.ceil(n),r=0;rt-e)).pop(),i}(n),s=0,o=a.length-1;sr)return l}return Math.max(r,1)}(a,e,r);if(s>0){var h,u,f=s>1?Math.round((l-o)/(s-1)):null;for(ms(e,c,d,li(f)?0:o-f,o),h=0,u=s-1;h"top"===e||"left"===e?t[e]+i:t[e]-i,xs=(t,e)=>Math.min(e||t,t);function _s(t,e){for(var i=[],n=t.length/e,r=t.length,a=0;ao+l)))return c}function ws(t){return t.drawTicks?t.tickLength:0}function ks(t,e){if(!t.display)return 0;var i=er(t.font,e),n=tr(t.padding);return(ci(t.text)?t.text.length:1)*i.lineHeight+n.height}function $s(t,e,i){var n=dn(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Ms extends vs{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){var t=this._userMin,e=this._userMax,i=this._suggestedMin,n=this._suggestedMax;return t=ui(t,Number.POSITIVE_INFINITY),e=ui(e,Number.NEGATIVE_INFINITY),i=ui(i,Number.POSITIVE_INFINITY),n=ui(n,Number.NEGATIVE_INFINITY),{min:ui(t,i),max:ui(e,n),minDefined:hi(t),maxDefined:hi(e)}}getMinMax(t){var e,i=this.getUserBounds(),n=i.min,r=i.max,a=i.minDefined,s=i.maxDefined;if(a&&s)return{min:n,max:r};for(var o=this.getMatchingVisibleMetas(),l=0,c=o.length;lr?r:n,ui(r=a&&n>r?n:r,n)),max:ui(r,ui(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.chart.chartArea;return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){vi(this.options.beforeUpdate,[this])}update(t,e,i){var n=this.options,r=n.beginAtZero,a=n.grace,s=n.ticks,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){var n=t.min,r=t.max,a=pi(e,(r-n)/2),s=(t,e)=>i&&0===t?0:t+e;return{min:s(n,-Math.abs(a)),max:s(r,a)}}(this,a,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();var l=o=o||a<=1||!this.isHorizontal())this.labelRotation=s;else{var c=this._getLabelSizes(),d=c.widest.width,h=c.highest.height,u=Qi(this.chart.width-d,0,this.maxWidth);d+6>(t=n.offset?this.maxWidth/a:u/(a-1))&&(t=u/(a-(n.offset?.5:1)),e=this.maxHeight-ws(n.grid)-r.padding-ks(n.title,this.chart.options.font),i=Math.sqrt(d*d+h*h),l=Yi(Math.min(Math.asin(Qi((c.highest.height+6)/t,-1,1)),Math.asin(Qi(e/i,-1,1))-Math.asin(Qi(h/i,-1,1)))),l=Math.max(s,Math.min(o,l))),this.labelRotation=l}}afterCalculateLabelRotation(){vi(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){vi(this.options.beforeFit,[this])}fit(){var t={width:0,height:0},e=this.chart,i=this.options,n=i.ticks,r=i.title,a=i.grid,s=this._isVisible(),o=this.isHorizontal();if(s){var l=ks(r,e.options.font);if(o?(t.width=this.maxWidth,t.height=ws(a)+l):(t.height=this.maxHeight,t.width=ws(a)+l),n.display&&this.ticks.length){var c=this._getLabelSizes(),d=c.first,h=c.last,u=c.widest,f=c.highest,p=2*n.padding,v=qi(this.labelRotation),g=Math.cos(v),m=Math.sin(v);if(o){var b=n.mirror?0:m*u.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+b+p)}else{var x=n.mirror?0:g*u.width+m*f.height;t.width=Math.min(this.maxWidth,t.width+x+p)}this._calculatePadding(d,h,m,g)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){var r=this.options,a=r.ticks,s=a.align,o=a.padding,l=r.position,c=0!==this.labelRotation,d="top"!==l&&"x"===this.axis;if(this.isHorizontal()){var h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),f=0,p=0;c?d?(f=n*t.width,p=i*e.height):(f=i*t.height,p=n*e.width):"start"===s?p=e.width:"end"===s?f=t.width:"inner"!==s&&(f=t.width/2,p=e.width/2),this.paddingLeft=Math.max((f-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((p-u+o)*this.width/(this.width-u),0)}else{var v=e.height/2,g=t.height/2;"start"===s?(v=0,g=t.height):"end"===s&&(v=e.height,g=0),this.paddingTop=v+o,this.paddingBottom=g+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){vi(this.options.afterFit,[this])}isHorizontal(){var t=this.options,e=t.axis,i=t.position;return"top"===i||"bottom"===i||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){var e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{var i,n=t.gc,r=n.length/2;if(r>e){for(i=0;i({width:g[t]||0,height:m[t]||0});return{first:k(0),last:k(e-1),widest:k(y),highest:k(w),widths:g,heights:m}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);var e=this._startPixel+t*this._length;return Qi(this._alignToPixels?En(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){var t=this.min,e=this.max;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){var e=this.ticks||[];if(t>=0&&ts*n?s/i:o/n:o*n0}_computeGridLineItems(t){var e,i,n,r,a,s,o,l,c,d,h,u,f=this.axis,p=this.chart,v=this.options,g=v.grid,m=v.position,b=v.border,x=g.offset,_=this.isHorizontal(),y=this.ticks.length+(x?1:0),w=ws(g),k=[],$=b.setContext(this.getContext()),M=$.display?$.width:0,C=M/2,S=function(t){return En(p,t,M)};if("top"===m)e=S(this.bottom),s=this.bottom-w,l=e-C,d=S(t.top)+C,u=t.bottom;else if("bottom"===m)e=S(this.top),d=t.top,u=S(t.bottom)-C,s=e+C,l=this.top+w;else if("left"===m)e=S(this.right),a=this.right-w,o=e-C,c=S(t.left)+C,h=t.right;else if("right"===m)e=S(this.left),c=t.left,h=S(t.right)-C,a=e+C,o=this.left+w;else if("x"===f){if("center"===m)e=S((t.top+t.bottom)/2+.5);else if(di(m)){var T=Object.keys(m)[0],P=m[T];e=S(this.chart.scales[T].getPixelForValue(P))}d=t.top,u=t.bottom,l=(s=e+C)+w}else if("y"===f){if("center"===m)e=S((t.left+t.right)/2);else if(di(m)){var D=Object.keys(m)[0],L=m[D];e=S(this.chart.scales[D].getPixelForValue(L))}o=(a=e-C)-w,c=t.left,h=t.right}var z=fi(v.ticks.maxTicksLimit,y),O=Math.max(1,Math.ceil(y/z));for(i=0;i0&&(Y-=W/2)}N={left:Y,top:q,width:W+V.width,height:B+V.height,color:E.backdropColor}}C.push({label:n,font:l,textOffset:h,options:{rotation:M,color:I,strokeColor:R,strokeWidth:F,textAlign:H,textBaseline:S,translation:[r,a],backdrop:N}})}return C}_getXAxisLabelAlignment(){var t=this.options,e=t.position,i=t.ticks;if(-qi(this.labelRotation))return"top"===e?"left":"right";var n="center";return"start"===i.align?n="left":"end"===i.align?n="right":"inner"===i.align&&(n="inner"),n}_getYAxisLabelAlignment(t){var e,i,n=this.options,r=n.position,a=n.ticks,s=a.crossAlign,o=a.mirror,l=a.padding,c=t+l,d=this._getLabelSizes().widest.width;return"left"===r?o?(i=this.right+l,"near"===s?e="left":"center"===s?(e="center",i+=d/2):(e="right",i+=d)):(i=this.right-c,"near"===s?e="right":"center"===s?(e="center",i-=d/2):(e="left",i=this.left)):"right"===r?o?(i=this.left+l,"near"===s?e="right":"center"===s?(e="center",i-=d/2):(e="left",i-=d)):(i=this.left+c,"near"===s?e="left":"center"===s?(e="center",i+=d/2):(e="right",i=this.right)):e="right",{textAlign:e,x:i}}_computeLabelArea(){if(!this.options.ticks.mirror){var t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}}drawBackground(){var t=this.ctx,e=this.options.backgroundColor,i=this.left,n=this.top,r=this.width,a=this.height;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,r,a),t.restore())}getLineWidthForValue(t){var e=this.options.grid;if(!this._isVisible()||!e.display)return 0;var i=this.ticks.findIndex((e=>e.value===t));return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){var e,i,n=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),s=(t,e,i)=>{i.width&&i.color&&(r.save(),r.lineWidth=i.width,r.strokeStyle=i.color,r.setLineDash(i.borderDash||[]),r.lineDashOffset=i.borderDashOffset,r.beginPath(),r.moveTo(t.x,t.y),r.lineTo(e.x,e.y),r.stroke(),r.restore())};if(n.display)for(e=0,i=a.length;e{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){var e,i,n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];for(e=0,i=n.length;e{var n=i.split("."),r=n.pop(),a=[t].concat(n).join("."),s=e[i].split("."),o=s.pop(),l=s.join(".");zn.route(a,r,l,o)}))}(e,t.defaultRoutes);t.descriptors&&zn.describe(e,t.descriptors)}(t,a,e),this.override&&zn.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){var e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in zn[n]&&(delete zn[n][i],this.override&&delete Sn[i])}}class Ss{constructor(){this.controllers=new Cs(ua,"datasets",!0),this.elements=new Cs(vs,"elements"),this.plugins=new Cs(Object,"plugins"),this.scales=new Cs(Ms,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(){for(var t=arguments.length,e=new Array(t),i=0;i{var n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):gi(e,(e=>{var n=i||this._getRegistryForType(e);this._exec(t,n,e)}))}))}_exec(t,e,i){var n=Si(t);vi(i["before"+n],[],i),e[t](i),vi(i["after"+n],[],i)}_getRegistryForType(t){for(var e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Ds(t,e){return e||!1!==t?!0===t?{}:t:null}function Ls(t,e,i,n){var r=e.plugin,a=e.local,s=t.pluginScopeKeys(r),o=t.getOptionScopes(i,s);return a&&r.defaults&&o.push(r.defaults),t.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function zs(t,e){var i=zn.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Os(t){if("x"===t||"y"===t||"r"===t)return t}function As(t){if(Os(t))return t;for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n1&&Os(t[0].toLowerCase());if(o)return o}var l;throw new Error("Cannot determine type of '".concat(t,"' axis. Please provide 'axis' or 'position' option."))}function Es(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function js(t,e){var i=Sn[t.type]||{scales:{}},n=e.scales||{},r=zs(t.type,e),a=Object.create(null);return Object.keys(n).forEach((e=>{var s=n[e];if(!di(s))return console.error("Invalid scale configuration for scale: ".concat(e));if(s._proxy)return console.warn("Ignoring resolver passed as options for scale: ".concat(e));var o=As(e,s,function(t,e){if(e.data&&e.data.datasets){var i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return Es(t,"x",i[0])||Es(t,"y",i[0])}return{}}(e,t),zn.scales[s.type]),l=function(t,e){return t===e?"_index_":"_value_"}(o,r),c=i.scales||{};a[e]=wi(Object.create(null),[{axis:o},s,c[o],c[l]])})),t.data.datasets.forEach((i=>{var r=i.type||t.type,s=i.indexAxis||zs(r,e),o=(Sn[r]||{}).scales||{};Object.keys(o).forEach((t=>{var e=function(t,e){var i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,s),r=i[e+"AxisID"]||e;a[r]=a[r]||Object.create(null),wi(a[r],[{axis:e},n[r],o[t]])}))})),Object.keys(a).forEach((t=>{var e=a[t];wi(e,[zn.scales[e.type],zn.scale])})),a}function Is(t){var e=t.options||(t.options={});e.plugins=fi(e.plugins,{}),e.scales=js(t,e)}function Rs(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}var Fs=new Map,Hs=new Set;function Ns(t,e){var i=Fs.get(t);return i||(i=e(),Fs.set(t,i),Hs.add(i)),i}var Vs=(t,e,i)=>{var n=Ci(e,i);void 0!==n&&t.add(n)};class Bs{constructor(t){this._config=function(t){return(t=t||{}).data=Rs(t.data),Is(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Rs(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){var t=this._config;this.clearCache(),Is(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ns(t,(()=>[["datasets.".concat(t),""]]))}datasetAnimationScopeKeys(t,e){return Ns("".concat(t,".transition.").concat(e),(()=>[["datasets.".concat(t,".transitions.").concat(e),"transitions.".concat(e)],["datasets.".concat(t),""]]))}datasetElementScopeKeys(t,e){return Ns("".concat(t,"-").concat(e),(()=>[["datasets.".concat(t,".elements.").concat(e),"datasets.".concat(t),"elements.".concat(e),""]]))}pluginScopeKeys(t){var e=t.id,i=this.type;return Ns("".concat(i,"-plugin-").concat(e),(()=>[["plugins.".concat(e),...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){var i=this._scopeCache,n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){var n=this.options,r=this.type,a=this._cachedScopes(t,i),s=a.get(e);if(s)return s;var o=new Set;e.forEach((e=>{t&&(o.add(t),e.forEach((e=>Vs(o,t,e)))),e.forEach((t=>Vs(o,n,t))),e.forEach((t=>Vs(o,Sn[r]||{},t))),e.forEach((t=>Vs(o,zn,t))),e.forEach((t=>Vs(o,Tn,t)))}));var l=Array.from(o);return 0===l.length&&l.push(Object.create(null)),Hs.has(e)&&a.set(e,l),l}chartOptionScopes(){var t=this.options,e=this.type;return[t,Sn[e]||{},zn.datasets[e]||{},{type:e},zn,Tn]}resolveNamedOptions(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[""],a={$shared:!0},s=Ws(this._resolverCache,t,r),o=s.resolver,l=s.subPrefixes,c=o;(function(t,e){var i,r=sr(t),a=r.isScriptable,s=r.isIndexable,o=n(e);try{for(o.s();!(i=o.n()).done;){var l=i.value,c=a(l),d=s(l),h=(d||c)&&t[l];if(c&&(Pi(h)||qs(h))||d&&ci(h))return!0}}catch(t){o.e(t)}finally{o.f()}return!1})(o,e)&&(a.$shared=!1,c=ar(o,i=Pi(i)?i():i,this.createResolver(t,i,l)));var d,h=n(e);try{for(h.s();!(d=h.n()).done;){var u=d.value;a[u]=c[u]}}catch(t){h.e(t)}finally{h.f()}return a}createResolver(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],n=arguments.length>3?arguments[3]:void 0,r=Ws(this._resolverCache,t,i).resolver;return di(e)?ar(r,e,void 0,n):r}}function Ws(t,e,i){var n=t.get(e);n||(n=new Map,t.set(e,n));var r=i.join(),a=n.get(r);a||(a={resolver:rr(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},n.set(r,a));return a}var qs=t=>di(t)&&Object.getOwnPropertyNames(t).some((e=>Pi(t[e])));var Ys=["top","bottom","left","right","chartArea"];function Us(t,e){return"top"===t||"bottom"===t||-1===Ys.indexOf(t)&&"x"===e}function Xs(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Gs(t){var e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),vi(i&&i.onComplete,[t],e)}function Ks(t){var e=t.chart,i=e.options.animation;vi(i&&i.onProgress,[t],e)}function Zs(t){return $r()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}var Js={},Qs=t=>{var e=Zs(t);return Object.values(Js).filter((t=>t.canvas===e)).pop()};function to(t,e,i){for(var n=0,r=Object.keys(t);n=e){var o=t[a];delete t[a],(i>0||s>e)&&(t[s+i]=o)}}}function eo(t,e,i){return t.options.clip?t[i]:e[i]}class io{static register(){Ts.add(...arguments),no()}static unregister(){Ts.remove(...arguments),no()}constructor(t,e){var i=this.config=new Bs(e),n=Zs(t),r=Qs(n);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");var a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!$r()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Qa:ps}(n)),this.platform.updateConfig(i);var s,o,l,c=this.platform.acquireContext(n,a.aspectRatio),d=c&&c.canvas,h=d&&d.height,u=d&&d.width;this.id=oi(),this.ctx=c,this.canvas=d,this.width=u,this.height=h,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ps,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(s=t=>this.update(t),o=a.resizeDelay||0,function(){for(var t=arguments.length,e=new Array(t),i=0;i{t.id=e}))}buildOrUpdateScales(){var t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{}),r=[];e&&(r=r.concat(Object.keys(e).map((t=>{var i=e[t],n=As(t,i),r="r"===n,a="x"===n;return{options:i,dposition:r?"chartArea":a?"bottom":"left",dtype:r?"radialLinear":a?"category":"linear"}})))),gi(r,(e=>{var r=e.options,a=r.id,s=As(a,r),o=fi(r.type,e.dtype);void 0!==r.position&&Us(r.position,s)===Us(e.dposition)||(r.position=e.dposition),n[a]=!0;var l=null;a in i&&i[a].type===o?l=i[a]:(l=new(Ts.getScale(o))({id:a,type:o,ctx:this.ctx,chart:this}),i[l.id]=l);l.init(r,t)})),gi(n,((t,e)=>{t||delete i[e]})),gi(i,(t=>{Za.configure(this,t,t.options),Za.addBox(this,t)}))}_updateMetasets(){var t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(var n=e;ne.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){var t,e,i=[],n=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=n.length;t{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){var e=this.config;e.update();var i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1!==this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})){var r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");for(var a=0,s=0,o=this.data.datasets.length;s{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Xs("z","_idx"));var d=this._active,h=this._lastEvent;h?this._eventHandler(h,!0):d.length&&this._updateHoverStyles(d,d,!0),this.render()}}_updateScales(){gi(this.scales,(t=>{Za.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){var t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Di(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){var t,e=this._hiddenIndices,i=n(this._getUniformDataChanges()||[]);try{for(i.s();!(t=i.n()).done;){var r=t.value,a=r.method,s=r.start,o=r.count;to(e,s,"_removeElements"===a?-o:o)}}catch(t){i.e(t)}finally{i.f()}}_getUniformDataChanges(){var t=this._dataChanges;if(t&&t.length){this._dataChanges=[];for(var e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),n=i(0),r=1;rt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}}_updateLayout(t){if(!1!==this.notifyPlugins("beforeLayout",{cancelable:!0})){Za.update(this,this.width,this.height,t);var e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],gi(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(var e=0,i=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}}_drawDataset(t){var e=this.ctx,i=t._clip,n=!i.disabled,r=function(t,e){var i=t.xScale,n=t.yScale;return i&&n?{left:eo(i,e,"left"),right:eo(i,e,"right"),top:eo(n,e,"top"),bottom:eo(n,e,"bottom")}:e}(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(n&&Hn(e,{left:!1===i.left?0:r.left-i.left,right:!1===i.right?this.width:r.right+i.right,top:!1===i.top?0:r.top-i.top,bottom:!1===i.bottom?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&Nn(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Fn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){var r=Ra.modes[e];return"function"==typeof r?r(this,t,i,n):[]}getDatasetMeta(t){var e=this.data.datasets[t],i=this._metasets,n=i.filter((t=>t&&t._dataset===e)).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=nr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){var e=this.data.datasets[t];if(!e)return!1;var i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){var n=i?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,n);Ti(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(r,{visible:i}),this.update((e=>e.datasetIndex===t?n:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){var e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){var t,e;for(this.stop(),Kr.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};gi(this.options.events,(t=>i(t,n)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});var t,e=this._responsiveListeners,i=this.platform,n=(t,n)=>{i.addEventListener(this,t,n),e[t]=n},r=(t,n)=>{e[t]&&(i.removeEventListener(this,t,n),delete e[t])},a=(t,e)=>{this.canvas&&this.resize(t,e)},s=()=>{r("attach",s),this.attached=!0,this.resize(),n("resize",a),n("detach",t)};t=()=>{this.attached=!1,r("resize",a),this._stop(),this._resize(0,0),n("attach",s)},i.isAttached(this.canvas)?s():t()}unbindEvents(){gi(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},gi(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){var n,r,a,s=i?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+s+"DatasetHoverStyle"](),r=0,a=t.length;r{var e=t.datasetIndex,i=t.index,n=this.getDatasetMeta(e);if(!n)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:n.data[i],index:i}}));!mi(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){var n=this.options.hover,r=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),a=r(e,t),s=i?t:r(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),s.length&&n.mode&&this.updateHoverStyle(s,n.mode,!0)}_eventHandler(t,e){var i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1!==this.notifyPlugins("beforeEvent",i,n)){var r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}}_handleEvent(t,e,i){var n=this._active,r=void 0===n?[]:n,a=this.options,s=e,o=this._getActiveElements(t,r,i,s),l=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),c=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,l);i&&(this._lastEvent=null,vi(a.onHover,[t,o,this],this),l&&vi(a.onClick,[t,o,this],this));var d=!mi(o,r);return(d||e)&&(this._active=o,this._updateHoverStyles(o,r,e)),this._lastEvent=c,d}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;var r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}}function no(){return gi(io.instances,(t=>t._plugins.invalidate()))}function ro(t,e,i,n){var r=Zn(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),a=(i-e)/2,s=Math.min(a,n*e/2),o=t=>{var e=(i-Math.min(a,t))*n/2;return Qi(t,0,Math.min(a,e))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:Qi(r.innerStart,0,s),innerEnd:Qi(r.innerEnd,0,s)}}function ao(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function so(t,e,i,n,r,a){var s=e.x,o=e.y,l=e.startAngle,c=e.pixelMargin,d=e.innerRadius,h=Math.max(e.outerRadius+n+i-c,0),u=d>0?d+n+i+c:0,f=0,p=r-l;if(n){var v=((d>0?d-n:0)+(h>0?h-n:0))/2;f=(p-(0!==v?p*v/(v+n):p))/2}var g=(p-Math.max(.001,p*h-i/Li)/h)/2,m=l+g+f,b=r-g-f,x=ro(e,u,h,b-m),_=x.outerStart,y=x.outerEnd,w=x.innerStart,k=x.innerEnd,$=h-_,M=h-y,C=m+_/$,S=b-y/M,T=u+w,P=u+k,D=m+w/T,L=b-k/P;if(t.beginPath(),a){var z=(C+S)/2;if(t.arc(s,o,h,C,z),t.arc(s,o,h,z,S),y>0){var O=ao(M,S,s,o);t.arc(O.x,O.y,y,S,b+ji)}var A=ao(P,b,s,o);if(t.lineTo(A.x,A.y),k>0){var E=ao(P,L,s,o);t.arc(E.x,E.y,k,b+ji,L+Math.PI)}var j=(b-k/u+(m+w/u))/2;if(t.arc(s,o,u,b-k/u,j,!0),t.arc(s,o,u,j,m+w/u,!0),w>0){var I=ao(T,D,s,o);t.arc(I.x,I.y,w,D+Math.PI,m-ji)}var R=ao($,m,s,o);if(t.lineTo(R.x,R.y),_>0){var F=ao($,C,s,o);t.arc(F.x,F.y,_,m-ji,C)}}else{t.moveTo(s,o);var H=Math.cos(C)*h+s,N=Math.sin(C)*h+o;t.lineTo(H,N);var V=Math.cos(S)*h+s,B=Math.sin(S)*h+o;t.lineTo(V,B)}t.closePath()}function oo(t,e,i,n,r){var a=e.fullCircles,s=e.startAngle,o=e.circumference,l=e.options,c=l.borderWidth,d=l.borderJoinStyle,h=l.borderDash,u=l.borderDashOffset,f="inner"===l.borderAlign;if(c){t.setLineDash(h||[]),t.lineDashOffset=u,f?(t.lineWidth=2*c,t.lineJoin=d||"round"):(t.lineWidth=c,t.lineJoin=d||"bevel");var p=e.endAngle;if(a){so(t,e,i,n,p,r);for(var v=0;vr?(c=r/l,t.arc(a,s,l,i+c,n-c,!0)):t.arc(a,s,r,i+ji,n-ji),t.closePath(),t.clip()}(t,e,p),a||(so(t,e,i,n,p,r),t.stroke())}}r(io,"defaults",zn),r(io,"instances",Js),r(io,"overrides",Sn),r(io,"registry",Ts),r(io,"version","4.4.6"),r(io,"getChart",Qs);class lo extends vs{constructor(t){super(),r(this,"circumference",void 0),r(this,"endAngle",void 0),r(this,"fullCircles",void 0),r(this,"innerRadius",void 0),r(this,"outerRadius",void 0),r(this,"pixelMargin",void 0),r(this,"startAngle",void 0),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){var n=Xi(this.getProps(["x","y"],i),{x:t,y:e}),r=n.angle,a=n.distance,s=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),o=s.startAngle,l=s.endAngle,c=s.innerRadius,d=s.outerRadius,h=s.circumference,u=(this.options.spacing+this.options.borderWidth)/2,f=fi(h,l-o),p=Ji(r,o,l)&&o!==l,v=f>=zi||p,g=tn(a,c+u,d+u);return v&&g}getCenterPoint(t){var e=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),i=e.x,n=e.y,r=e.startAngle,a=e.endAngle,s=e.innerRadius,o=e.outerRadius,l=this.options,c=l.offset,d=(r+a)/2,h=(s+o+l.spacing+c)/2;return{x:i+Math.cos(d)*h,y:n+Math.sin(d)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){var e=this.options,i=this.circumference,n=(e.offset||0)/4,r=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>zi?Math.floor(i/zi):0,!(0===i||this.innerRadius<0||this.outerRadius<0)){t.save();var s=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(s)*n,Math.sin(s)*n);var o=n*(1-Math.sin(Math.min(Li,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,r){var a=e.fullCircles,s=e.startAngle,o=e.circumference,l=e.endAngle;if(a){so(t,e,i,n,l,r);for(var c=0;c2&&void 0!==arguments[2]?arguments[2]:e;t.lineCap=fi(i.borderCapStyle,e.borderCapStyle),t.setLineDash(fi(i.borderDash,e.borderDash)),t.lineDashOffset=fi(i.borderDashOffset,e.borderDashOffset),t.lineJoin=fi(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=fi(i.borderWidth,e.borderWidth),t.strokeStyle=fi(i.borderColor,e.borderColor)}function ho(t,e,i){t.lineTo(i.x,i.y)}function uo(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.length,r=i.start,a=void 0===r?0:r,s=i.end,o=void 0===s?n-1:s,l=e.start,c=e.end,d=Math.max(a,l),h=Math.min(o,c),u=ac&&o>c;return{count:n,start:d,loop:e.loop,ilen:h(f+(b?p-t:t))%u,w=()=>{o!==l&&(t.lineTo(x,l),t.lineTo(x,o),t.lineTo(x,c))};for(m&&(a=d[y(0)],t.moveTo(a.x,a.y)),r=0;r<=p;++r)if(!(a=d[y(r)]).skip){var k=a.x,$=a.y,M=0|k;M===s?($l&&(l=$),x=(_*x+k)/++_):(w(),t.lineTo(k,$),s=M,_=0,o=l=$),c=$}w()}function vo(t){var e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?po:fo}r(lo,"id","arc"),r(lo,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),r(lo,"defaultRoutes",{backgroundColor:"backgroundColor"}),r(lo,"descriptors",{_scriptable:!0,_indexable:t=>"borderDash"!==t});var go="function"==typeof Path2D;function mo(t,e,i,r){go&&!e.options.segment?function(t,e,i,n){var r=e._path;r||(r=e._path=new Path2D,e.path(r,i,n)&&r.closePath()),co(t,e.options),t.stroke(r)}(t,e,i,r):function(t,e,i,r){var a,s=e.segments,o=e.options,l=vo(e),c=n(s);try{for(c.s();!(a=c.n()).done;){var d=a.value;co(t,o,d.style),t.beginPath(),l(t,e,d,{start:i,end:i+r-1})&&t.closePath(),t.stroke()}}catch(t){c.e(t)}finally{c.f()}}(t,e,i,r)}class bo extends vs{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){var i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){var n=i.spanGaps?this._loop:this._fullLoop;kr(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){var i=t.points,n=t.options.spanGaps,r=i.length;if(!r)return[];var a=!!t._loop,s=function(t,e,i,n){var r=0,a=e-1;if(i&&!n)for(;rr&&t[a%e].skip;)a--;return{start:r,end:a%=e}}(i,r,a,n),o=s.start,l=s.end;return Yr(t,!0===n?[{start:o,end:l,loop:a}]:function(t,e,i,n){var r,a=t.length,s=[],o=e,l=t[e];for(r=e+1;r<=i;++r){var c=t[r%a];c.skip||c.stop?l.skip||(n=!1,s.push({start:e%a,end:(r-1)%a,loop:n}),e=o=c.stop?r:null):(o=r,l.skip&&(e=r)),l=c}return null!==o&&s.push({start:e%a,end:o%a,loop:n}),s}(i,o,l"borderDash"!==t&&"fill"!==t});class _o extends vs{constructor(t){super(),r(this,"parsed",void 0),r(this,"skip",void 0),r(this,"stop",void 0),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){var n=this.options,r=this.getProps(["x","y"],i),a=r.x,s=r.y;return Math.pow(t-a,2)+Math.pow(e-s,2)2&&void 0!==arguments[2]?arguments[2]:{},n=t.x!==i.x?-e:0,r=t.y!==i.y?-e:0,a=(t.x+t.w!==i.x+i.w?e:0)-n,s=(t.y+t.h!==i.y+i.h?e:0)-r;return{x:t.x+n,y:t.y+r,w:t.w+a,h:t.h+s,radius:t.radius}}r(_o,"id","point"),r(_o,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),r(_o,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});class So extends vs{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){var e,i=this.inflateAmount,n=this.options,r=n.borderColor,a=n.backgroundColor,s=ko(this),o=s.inner,l=s.outer,c=(e=l.radius).topLeft||e.topRight||e.bottomLeft||e.bottomRight?Un:Mo;t.save(),l.w===o.w&&l.h===o.h||(t.beginPath(),c(t,Co(l,i,o)),t.clip(),c(t,Co(o,-i,l)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),c(t,Co(o,i)),t.fillStyle=a,t.fill(),t.restore()}inRange(t,e,i){return $o(this,t,e,i)}inXRange(t,e){return $o(this,t,null,e)}inYRange(t,e){return $o(this,null,t,e)}getCenterPoint(t){var e=this.getProps(["x","y","base","horizontal"],t),i=e.x,n=e.y,r=e.base,a=e.horizontal;return{x:a?(i+r)/2:i,y:a?n:(n+r)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}function To(t,e,i,n){if(!n){var r=e[t],a=i[t];return"angle"===t&&(r=Zi(r),a=Zi(a)),{property:t,start:r,end:a}}}function Po(t,e,i){for(;e>t;e--){var n=i[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function Do(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Lo(t,e){var i=[],n=!1;return ci(t)?(n=!0,i=t):i=function(t,e){var i=t||{},n=i.x,r=void 0===n?null:n,a=i.y,s=void 0===a?null:a,o=e.points,l=[];return e.segments.forEach((t=>{var e=t.start,i=t.end;i=Po(e,i,o);var n=o[e],a=o[i];null!==s?(l.push({x:n.x,y:s}),l.push({x:a.x,y:s})):null!==r&&(l.push({x:r,y:n.y}),l.push({x:r,y:a.y}))})),l}(t,e),i.length?new bo({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function zo(t){return t&&!1!==t.fill}function Oo(t,e,i){var n,r=t[e].fill,a=[e];if(!i)return r;for(;!1!==r&&-1===a.indexOf(r);){if(!hi(r))return r;if(!(n=t[r]))return!1;if(n.visible)return r;a.push(r),r=n.fill}return!1}function Ao(t,e,i){var n=function(t){var e=t.options,i=e.fill,n=fi(i&&i.target,i);void 0===n&&(n=!!e.backgroundColor);if(!1===n||null===n)return!1;if(!0===n)return"origin";return n}(t);if(di(n))return!isNaN(n.value)&&n;var r=parseFloat(n);return hi(r)&&Math.floor(r)===r?function(t,e,i,n){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=n)return!1;return i}(n[0],e,r,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function Eo(t,e,i){for(var n=[],r=0;r=0;--s){var o=r[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),n&&o.fill&&Fo(t.ctx,o,a))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"===i.drawTime)for(var n=t.getSortedVisibleDatasetMetas(),r=n.length-1;r>=0;--r){var a=n[r].$filler;zo(a)&&Fo(t.ctx,a,t.chartArea)}},beforeDatasetDraw(t,e,i){var n=e.meta.$filler;zo(n)&&"beforeDatasetDraw"===i.drawTime&&Fo(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},qo=(t,e)=>{var i=t.boxHeight,n=void 0===i?e:i,r=t.boxWidth,a=void 0===r?e:r;return t.usePointStyle&&(n=Math.min(n,e),a=t.pointStyleWidth||Math.min(a,e)),{boxWidth:a,boxHeight:n,itemHeight:Math.max(e,n)}};class Yo extends vs{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){var t=this.options.labels||{},e=vi(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){var t=this.options,e=this.ctx;if(t.display){var i,n,r=t.labels,a=er(r.font),s=a.size,o=this._computeTitleHeight(),l=qo(r,s),c=l.boxWidth,d=l.itemHeight;e.font=a.string,this.isHorizontal()?(i=this.maxWidth,n=this._fitRows(o,s,c,d)+10):(n=this.maxHeight,i=this._fitCols(o,a,c,d)+10),this.width=Math.min(i,t.maxWidth||this.maxWidth),this.height=Math.min(n,t.maxHeight||this.maxHeight)}else this.width=this.height=0}_fitRows(t,e,i,n){var r=this.ctx,a=this.maxWidth,s=this.options.labels.padding,o=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+s,d=t;r.textAlign="left",r.textBaseline="middle";var h=-1,u=-c;return this.legendItems.forEach(((t,f)=>{var p=i+e/2+r.measureText(t.text).width;(0===f||l[l.length-1]+p+2*s>a)&&(d+=c,l[l.length-(f>0?0:1)]=0,u+=c,h++),o[f]={left:0,top:u,row:h,width:p,height:n},l[l.length-1]+=p+s})),d}_fitCols(t,e,i,n){var r=this.ctx,a=this.maxHeight,s=this.options.labels.padding,o=this.legendHitBoxes=[],l=this.columnSizes=[],c=a-t,d=s,h=0,u=0,f=0,p=0;return this.legendItems.forEach(((t,a)=>{var v=function(t,e,i,n,r){var a=function(t,e,i,n){var r=t.text;r&&"string"!=typeof r&&(r=r.reduce(((t,e)=>t.length>e.length?t:e)));return e+i.size/2+n.measureText(r).width}(n,t,e,i),s=function(t,e,i){var n=t;"string"!=typeof e.text&&(n=Uo(e,i));return n}(r,n,e.lineHeight);return{itemWidth:a,itemHeight:s}}(i,e,r,t,n),g=v.itemWidth,m=v.itemHeight;a>0&&u+m+2*s>c&&(d+=h+s,l.push({width:h,height:u}),f+=h+s,p++,h=u=0),o[a]={left:f,top:u,col:p,width:g,height:m},h=Math.max(h,g),u+=m+s})),d+=h,l.push({width:h,height:u}),d}adjustHitBoxes(){if(this.options.display){var t=this._computeTitleHeight(),e=this.legendHitBoxes,i=this.options,r=i.align,a=i.labels.padding,s=Fr(i.rtl,this.left,this.width);if(this.isHorizontal()){var o,l=0,c=hn(r,this.left+a,this.right-this.lineWidths[l]),d=n(e);try{for(d.s();!(o=d.n()).done;){var h=o.value;l!==h.row&&(l=h.row,c=hn(r,this.left+a,this.right-this.lineWidths[l])),h.top+=this.top+t+a,h.left=s.leftForLtr(s.x(c),h.width),c+=h.width+a}}catch(t){d.e(t)}finally{d.f()}}else{var u,f=0,p=hn(r,this.top+t+a,this.bottom-this.columnSizes[f].height),v=n(e);try{for(v.s();!(u=v.n()).done;){var g=u.value;g.col!==f&&(f=g.col,p=hn(r,this.top+t+a,this.bottom-this.columnSizes[f].height)),g.top=p,g.left+=this.left+a,g.left=s.leftForLtr(s.x(g.left),g.width),p+=g.height+a}}catch(t){v.e(t)}finally{v.f()}}}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){var t=this.ctx;Hn(t,this),this._draw(),Nn(t)}}_draw(){var t,e=this.options,i=this.columnSizes,n=this.lineWidths,r=this.ctx,a=e.align,s=e.labels,o=zn.color,l=Fr(e.rtl,this.left,this.width),c=er(s.font),d=s.padding,h=c.size,u=h/2;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=c.string;var f=qo(s,h),p=f.boxWidth,v=f.boxHeight,g=f.itemHeight,m=this.isHorizontal(),b=this._computeTitleHeight();t=m?{x:hn(a,this.left+d,this.right-n[0]),y:this.top+d+b,line:0}:{x:this.left+d,y:hn(a,this.top+b+d,this.bottom-i[0].height),line:0},Hr(this.ctx,e.textDirection);var x=g+d;this.legendItems.forEach(((f,_)=>{r.strokeStyle=f.fontColor,r.fillStyle=f.fontColor;var y=r.measureText(f.text).width,w=l.textAlign(f.textAlign||(f.textAlign=s.textAlign)),k=p+u+y,$=t.x,M=t.y;if(l.setWidth(this.width),m?_>0&&$+k+d>this.right&&(M=t.y+=x,t.line++,$=t.x=hn(a,this.left+d,this.right-n[t.line])):_>0&&M+x>this.bottom&&($=t.x=$+i[t.line].width+d,t.line++,M=t.y=hn(a,this.top+b+d,this.bottom-i[t.line].height)),function(t,e,i){if(!(isNaN(p)||p<=0||isNaN(v)||v<0)){r.save();var n=fi(i.lineWidth,1);if(r.fillStyle=fi(i.fillStyle,o),r.lineCap=fi(i.lineCap,"butt"),r.lineDashOffset=fi(i.lineDashOffset,0),r.lineJoin=fi(i.lineJoin,"miter"),r.lineWidth=n,r.strokeStyle=fi(i.strokeStyle,o),r.setLineDash(fi(i.lineDash,[])),s.usePointStyle){var a={radius:v*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},c=l.xPlus(t,p/2);Rn(r,a,c,e+u,s.pointStyleWidth&&p)}else{var d=e+Math.max((h-v)/2,0),f=l.leftForLtr(t,p),g=Qn(i.borderRadius);r.beginPath(),Object.values(g).some((t=>0!==t))?Un(r,{x:f,y:d,w:p,h:v,radius:g}):r.rect(f,d,p,v),r.fill(),0!==n&&r.stroke()}r.restore()}}(l.x($),M,f),$=((t,e,i,n)=>t===(n?"left":"right")?i:"center"===t?(e+i)/2:e)(w,$+p+u,m?$+k:this.right,e.rtl),function(t,e,i){Yn(r,i.text,t,e+g/2,c,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})}(l.x($),M,f),m)t.x+=k+d;else if("string"!=typeof f.text){var C=c.lineHeight;t.y+=Uo(f,C)+d}else t.y+=x})),Nr(this.ctx,e.textDirection)}drawTitle(){var t=this.options,e=t.title,i=er(e.font),n=tr(e.padding);if(e.display){var r,a=Fr(t.rtl,this.left,this.width),s=this.ctx,o=e.position,l=i.size/2,c=n.top+l,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),r=this.top+c,d=hn(t.align,d,this.right-h);else{var u=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);r=c+hn(t.align,this.top,this.bottom-u-t.labels.padding-this._computeTitleHeight())}var f=hn(o,d,d+h);s.textAlign=a.textAlign(dn(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,Yn(s,e.text,f,r,i)}}_computeTitleHeight(){var t=this.options.title,e=er(t.font),i=tr(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){var i,n,r;if(tn(t,this.left,this.right)&&tn(e,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){var e=t.data.datasets,i=t.legend.options.labels,n=i.usePointStyle,r=i.pointStyle,a=i.textAlign,s=i.color,o=i.useBorderRadius,l=i.borderRadius;return t._getSortedDatasetMetas().map((t=>{var i=t.controller.getStyle(n?0:void 0),c=tr(i.borderWidth);return{text:e[t.index].label,fillStyle:i.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:i.borderCapStyle,lineDash:i.borderDash,lineDashOffset:i.borderDashOffset,lineJoin:i.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:i.borderColor,pointStyle:r||i.pointStyle,rotation:i.rotation,textAlign:a||i.textAlign,borderRadius:o&&(l||i.borderRadius),datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}},Go={average(t){if(!t.length)return!1;var e,i,n=new Set,r=0,a=0;for(e=0,i=t.length;et+e))/n.size,y:r/a}},nearest(t,e){if(!t.length)return!1;var i,n,r,a=e.x,s=e.y,o=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i-1?t.split("\n"):t}function Jo(t,e){var i=e.element,n=e.datasetIndex,r=e.index,a=t.getDatasetMeta(n).controller,s=a.getLabelAndValue(r),o=s.label,l=s.value;return{chart:t,label:o,parsed:a.getParsed(r),raw:t.data.datasets[n].data[r],formattedValue:l,dataset:a.getDataset(),dataIndex:r,datasetIndex:n,element:i}}function Qo(t,e){var i=t.chart.ctx,n=t.body,r=t.footer,a=t.title,s=e.boxWidth,o=e.boxHeight,l=er(e.bodyFont),c=er(e.titleFont),d=er(e.footerFont),h=a.length,u=r.length,f=n.length,p=tr(e.padding),v=p.height,g=0,m=n.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);(m+=t.beforeBody.length+t.afterBody.length,h&&(v+=h*c.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),m)&&(v+=f*(e.displayColors?Math.max(o,l.lineHeight):l.lineHeight)+(m-f)*l.lineHeight+(m-1)*e.bodySpacing);u&&(v+=e.footerMarginTop+u*d.lineHeight+(u-1)*e.footerSpacing);var b=0,x=function(t){g=Math.max(g,i.measureText(t).width+b)};return i.save(),i.font=c.string,gi(t.title,x),i.font=l.string,gi(t.beforeBody.concat(t.afterBody),x),b=e.displayColors?s+2+e.boxPadding:0,gi(n,(t=>{gi(t.before,x),gi(t.lines,x),gi(t.after,x)})),b=0,i.font=d.string,gi(t.footer,x),i.restore(),{width:g+=p.width,height:v}}function tl(t,e,i,n){var r=i.x,a=i.width,s=t.width,o=t.chartArea,l=o.left,c=o.right,d="center";return"center"===n?d=r<=(l+c)/2?"left":"right":r<=a/2?d="left":r>=s-a/2&&(d="right"),function(t,e,i,n){var r=n.x,a=n.width,s=i.caretSize+i.caretPadding;return"left"===t&&r+a+s>e.width||"right"===t&&r-a-s<0||void 0}(d,t,e,i)&&(d="center"),d}function el(t,e,i){var n=i.yAlign||e.yAlign||function(t,e){var i=e.y,n=e.height;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||tl(t,e,i,n),yAlign:n}}function il(t,e,i,n){var r=t.caretSize,a=t.caretPadding,s=t.cornerRadius,o=i.xAlign,l=i.yAlign,c=r+a,d=Qn(s),h=d.topLeft,u=d.topRight,f=d.bottomLeft,p=d.bottomRight,v=function(t,e){var i=t.x,n=t.width;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,o),g=function(t,e,i){var n=t.y,r=t.height;return"top"===e?n+=i:n-="bottom"===e?r+i:r/2,n}(e,l,c);return"center"===l?"left"===o?v+=c:"right"===o&&(v-=c):"left"===o?v-=Math.max(h,f)+r:"right"===o&&(v+=Math.max(u,p)+r),{x:Qi(v,0,n.width-e.width),y:Qi(g,0,n.height-e.height)}}function nl(t,e,i){var n=tr(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function rl(t){return Ko([],Zo(t))}function al(t,e){var i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}var sl={beforeTitle:ai,title(t){if(t.length>0){var e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex{var e={before:[],lines:[],after:[]},r=al(i,t);Ko(e.before,Zo(ol(r,"beforeLabel",this,t))),Ko(e.lines,ol(r,"label",this,t)),Ko(e.after,Zo(ol(r,"afterLabel",this,t))),n.push(e)})),n}getAfterBody(t,e){return rl(ol(e.callbacks,"afterBody",this,t))}getFooter(t,e){var i=e.callbacks,n=ol(i,"beforeFooter",this,t),r=ol(i,"footer",this,t),a=ol(i,"afterFooter",this,t),s=[];return s=Ko(s,Zo(n)),s=Ko(s,Zo(r)),s=Ko(s,Zo(a))}_createItems(t){var e,i,n=this._active,r=this.chart.data,a=[],s=[],o=[],l=[];for(e=0,i=n.length;et.filter(e,i,n,r)))),t.itemSort&&(l=l.sort(((e,i)=>t.itemSort(e,i,r)))),gi(l,(e=>{var i=al(t.callbacks,e);a.push(ol(i,"labelColor",this,e)),s.push(ol(i,"labelPointStyle",this,e)),o.push(ol(i,"labelTextColor",this,e))})),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){var i,n=this.options.setContext(this.getContext()),r=this._active,a=[];if(r.length){var s=Go[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);var o=this._size=Qo(this,n),l=Object.assign({},s,o),c=el(this.chart,n,l),d=il(n,l,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,i={opacity:1,x:d.x,y:d.y,width:o.width,height:o.height,caretX:s.x,caretY:s.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){var r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){var n,r,a,s,o,l,c=this.xAlign,d=this.yAlign,h=i.caretSize,u=Qn(i.cornerRadius),f=u.topLeft,p=u.topRight,v=u.bottomLeft,g=u.bottomRight,m=t.x,b=t.y,x=e.width,_=e.height;return"center"===d?(o=b+_/2,"left"===c?(r=(n=m)-h,s=o+h,l=o-h):(r=(n=m+x)+h,s=o-h,l=o+h),a=n):(r="left"===c?m+Math.max(f,v)+h:"right"===c?m+x-Math.max(p,g)-h:this.caretX,"top"===d?(o=(s=b)-h,n=r-h,a=r+h):(o=(s=b+_)+h,n=r+h,a=r-h),l=s),{x1:n,x2:r,x3:a,y1:s,y2:o,y3:l}}drawTitle(t,e,i){var n,r,a,s=this.title,o=s.length;if(o){var l=Fr(i.rtl,this.x,this.width);for(t.x=nl(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",n=er(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=n.string,a=0;a0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Un(t,{x:m,y:f,w:l,h:o,radius:x}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Un(t,{x:b,y:f+1,w:l-2,h:o-2,radius:x}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,f,l,o),t.strokeRect(m,f,l,o),t.fillStyle=a.backgroundColor,t.fillRect(b,f+1,l-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){var n,r,a,s,o,l,c,d=this.body,h=i.bodySpacing,u=i.bodyAlign,f=i.displayColors,p=i.boxHeight,v=i.boxWidth,g=i.boxPadding,m=er(i.bodyFont),b=m.lineHeight,x=0,_=Fr(i.rtl,this.x,this.width),y=function(i){e.fillText(i,_.x(t.x+x),t.y+b/2),t.y+=b+h},w=_.textAlign(u);for(e.textAlign=u,e.textBaseline="middle",e.font=m.string,t.x=nl(this,w,i),e.fillStyle=i.bodyColor,gi(this.beforeBody,y),x=f&&"right"!==w?"center"===u?v/2+g:v+2+g:0,s=0,l=d.length;s0&&e.stroke()}_updateAnimationTarget(t){var e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){var a=Go[t.position].call(this,this._active,this._eventPosition);if(!a)return;var s=this._size=Qo(this,t),o=Object.assign({},a,this._size),l=el(e,t,o),c=il(t,o,l,e);n._to===c.x&&r._to===c.y||(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){var e=this.options.setContext(this.getContext()),i=this.opacity;if(i){this._updateAnimationTarget(e);var n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;var a=tr(e.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&s&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,n,e),Hr(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Nr(t,e.textDirection),t.restore())}}getActiveElements(){return this._active||[]}setActiveElements(t,e){var i=this._active,n=t.map((t=>{var e=t.datasetIndex,i=t.index,n=this.chart.getDatasetMeta(e);if(!n)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:n.data[i],index:i}})),r=!mi(i,n),a=this._positionChanged(n,e);(r||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;var n=this.options,r=this._active||[],a=this._getActiveElements(t,r,e,i),s=this._positionChanged(a,t),o=e||!mi(a,r)||s;return o&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_getActiveElements(t,e,i,n){var r=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter((t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)));var a=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&a.reverse(),a}_positionChanged(t,e){var i=this.caretX,n=this.caretY,r=this.options,a=Go[r.position].call(this,t,e);return!1!==a&&(i!==a.x||n!==a.y)}}r(ll,"positioners",Go);var cl={id:"tooltip",_element:ll,positioners:Go,afterInit(t,e,i){i&&(t.tooltip=new ll({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){var e=t.tooltip;if(e&&e._willRender()){var i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",s(s({},i),{},{cancelable:!0})))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){var i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:sl},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function dl(t,e,i,n){var r=t.indexOf(e);return-1===r?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):r!==t.lastIndexOf(e)?i:r}function hl(t){var e=this.getLabels();return t>=0&&tnull===t?null:Qi(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:dl(i,t,fi(e,t),this._addedLabels),i.length-1)}determineDataLimits(){var t=this.getUserBounds(),e=t.minDefined,i=t.maxDefined,n=this.getMinMax(!0),r=n.min,a=n.max;"ticks"===this.options.bounds&&(e||(r=0),i||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){var t=this.min,e=this.max,i=this.options.offset,n=[],r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(var a=t;a<=e;a++)n.push({value:a});return n}getLabelForValue(t){return hl.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function fl(t,e){var i,n,r,a,s,o,l,c=[],d=t.bounds,h=t.step,u=t.min,f=t.max,p=t.precision,v=t.count,g=t.maxTicks,m=t.maxDigits,b=t.includeBounds,x=h||1,_=g-1,y=e.min,w=e.max,k=!li(u),$=!li(f),M=!li(v),C=(w-y)/(m+1),S=Vi((w-y)/_/x)*x;if(S<1e-14&&!k&&!$)return[{value:y},{value:w}];(a=Math.ceil(w/S)-Math.floor(y/S))>_&&(S=Vi(a*S/_/x)*x),li(p)||(i=Math.pow(10,p),S=Math.ceil(S*i)/i),"ticks"===d?(n=Math.floor(y/S)*S,r=Math.ceil(w/S)*S):(n=y,r=w),k&&$&&h&&(s=(f-u)/h,o=S/1e3,(l=Math.round(s))-o<=s&&l+o>=s)?(S=(f-u)/(a=Math.round(Math.min((f-u)/S,g))),n=u,r=f):M?S=((r=$?f:r)-(n=k?u:n))/(a=v-1):a=Ni(a=(r-n)/S,Math.round(a),S/1e3)?Math.round(a):Math.ceil(a);var T=Math.max(Ui(S),Ui(n));i=Math.pow(10,li(p)?T:p),n=Math.round(n*i)/i,r=Math.round(r*i)/i;var P=0;for(k&&(b&&n!==u?(c.push({value:u}),nf)break;c.push({value:D})}return $&&b&&r!==f?c.length&&Ni(c[c.length-1].value,f,pl(f,C,t))?c[c.length-1].value=f:c.push({value:f}):$&&r!==f||c.push({value:r}),c}function pl(t,e,i){var n=i.horizontal,r=qi(i.minRotation),a=(n?Math.sin(r):Math.cos(r))||.001,s=.75*e*(""+t).length;return Math.min(e/a,s)}r(ul,"id","category"),r(ul,"defaults",{ticks:{callback:hl}});class vl extends Ms{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return li(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){var t=this.options.beginAtZero,e=this.getUserBounds(),i=e.minDefined,n=e.maxDefined,r=this.min,a=this.max,s=t=>r=i?r:t,o=t=>a=n?a:t;if(t){var l=Hi(r),c=Hi(a);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(r===a){var d=0===a?1:Math.abs(.05*a);o(a+d),t||s(r-d)}this.min=r,this.max=a}getTickLimit(){var t,e=this.options.ticks,i=e.maxTicksLimit,n=e.stepSize;return n?(t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1)>1e3&&(console.warn("scales.".concat(this.id,".ticks.stepSize: ").concat(n," would result generating up to ").concat(t," ticks. Limiting to 1000.")),t=1e3):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){var t=this.options,e=t.ticks,i=this.getTickLimit(),n=fl({maxTicks:i=Math.max(2,i),bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&Wi(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){var t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){var n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return $n(t,this.chart.options.locale,this.options.ticks.format)}}class gl extends vl{determineDataLimits(){var t=this.getMinMax(!0),e=t.min,i=t.max;this.min=hi(e)?e:0,this.max=hi(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){var t=this.isHorizontal(),e=t?this.width:this.height,i=qi(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}r(gl,"id","linear"),r(gl,"defaults",{ticks:{callback:Cn.formatters.numeric}});var ml=t=>Math.floor(Fi(t)),bl=(t,e)=>Math.pow(10,ml(t)+e);function xl(t){return 1===t/Math.pow(10,ml(t))}function _l(t,e,i){var n=Math.pow(10,i),r=Math.floor(t/n);return Math.ceil(e/n)-r}function yl(t,e){var i=e.min,n=e.max;i=ui(t.min,i);for(var r=[],a=ml(i),s=function(t,e){for(var i=ml(e-t);_l(t,e,i)>10;)i++;for(;_l(t,e,i)<10;)i--;return Math.min(i,ml(t))}(i,n),o=s<0?Math.pow(10,Math.abs(s)):1,l=Math.pow(10,s),c=a>s?Math.pow(10,a):0,d=Math.round((i-c)*o)/o,h=Math.floor((i-c)/l/10)*l*10,u=Math.floor((d-h)/Math.pow(10,s)),f=ui(t.min,Math.round((c+h+u*Math.pow(10,s))*o)/o);f=10?u=u<15?15:20:u++,u>=20&&(u=2,o=++s>=0?1:o),f=Math.round((c+h+u*Math.pow(10,s))*o)/o;var p=ui(t.max,f);return r.push({value:p,major:xl(p),significand:u}),r}class wl extends Ms{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){var i=vl.prototype.parse.apply(this,[t,e]);if(0!==i)return hi(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){var t=this.getMinMax(!0),e=t.min,i=t.max;this.min=hi(e)?Math.max(0,e):null,this.max=hi(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!hi(this._userMin)&&(this.min=e===bl(this.min,0)?bl(this.min,-1):bl(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){var t=this.getUserBounds(),e=t.minDefined,i=t.maxDefined,n=this.min,r=this.max,a=t=>n=e?n:t,s=t=>r=i?r:t;n===r&&(n<=0?(a(1),s(10)):(a(bl(n,-1)),s(bl(r,1)))),n<=0&&a(bl(r,-1)),r<=0&&s(bl(n,1)),this.min=n,this.max=r}buildTicks(){var t=this.options,e=yl({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&Wi(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":$n(t,this.chart.options.locale,this.options.ticks.format)}configure(){var t=this.min;super.configure(),this._startValue=Fi(t),this._valueRange=Fi(this.max)-Fi(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Fi(t)-this._startValue)/this._valueRange)}getValueForPixel(t){var e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function kl(t){var e=t.ticks;if(e.display&&t.display){var i=tr(e.backdropPadding);return fi(e.font&&e.font.size,zn.font.size)+i.height}return 0}function $l(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:tr?{start:e-i,end:e}:{start:e,end:e+i}}function Ml(t){for(var e,i,n,r={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},a=Object.assign({},r),s=[],o=[],l=t._pointLabels.length,c=t.options.pointLabels,d=c.centerPointLabels?Li/l:0,h=0;he.r&&(o=(n.end-e.r)/a,t.r=Math.max(t.r,e.r+o)),r.starte.b&&(l=(r.end-e.b)/s,t.b=Math.max(t.b,e.b+l))}function Sl(t,e,i){var n=t.drawingArea,r=i.extra,a=i.additionalAngle,s=i.padding,o=i.size,l=t.getPointPosition(e,n+r+s,a),c=Math.round(Yi(Zi(l.angle+ji))),d=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,o.h,c),h=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(c),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,o.w,h);return{visible:!0,x:l.x,y:d,textAlign:h,left:u,top:d,right:u+o.w,bottom:d+o.h}}function Tl(t,e){if(!e)return!0;var i=t.left,n=t.top,r=t.right,a=t.bottom;return!(Fn({x:i,y:n},e)||Fn({x:i,y:a},e)||Fn({x:r,y:n},e)||Fn({x:r,y:a},e))}function Pl(t,e,i){var n=i.left,r=i.top,a=i.right,s=i.bottom,o=e.backdropColor;if(!li(o)){var l=Qn(e.borderRadius),c=tr(e.backdropPadding);t.fillStyle=o;var d=n-c.left,h=r-c.top,u=a-n+c.width,f=s-r+c.height;Object.values(l).some((t=>0!==t))?(t.beginPath(),Un(t,{x:d,y:h,w:u,h:f,radius:l}),t.fill()):t.fillRect(d,h,u,f)}}function Dl(t,e,i,n){var r=t.ctx;if(i)r.arc(t.xCenter,t.yCenter,e,0,zi);else{var a=t.getPointPosition(0,e);r.moveTo(a.x,a.y);for(var s=1;s{var i=vi(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){var t=this.options;t.display&&t.pointLabels.display?Ml(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){return Zi(t*(zi/(this._pointLabels.length||1))+qi(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(li(t))return NaN;var e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(li(t))return NaN;var e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){var e=this._pointLabels||[];if(t>=0&&t2&&void 0!==arguments[2]?arguments[2]:0,n=this.getIndexAngle(t)-ji+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){var e=this._pointLabelItems[t];return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}drawBackground(){var t=this.options,e=t.backgroundColor,i=t.grid.circular;if(e){var n=this.ctx;n.save(),n.beginPath(),Dl(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){var t,e,i,n=this.ctx,r=this.options,a=r.angleLines,s=r.grid,o=r.border,l=this._pointLabels.length;if(r.pointLabels.display&&function(t,e){for(var i=t.ctx,n=t.options.pointLabels,r=e-1;r>=0;r--){var a=t._pointLabelItems[r];if(a.visible){var s=n.setContext(t.getPointLabelContext(r));Pl(i,s,a);var o=er(s.font),l=a.x,c=a.y,d=a.textAlign;Yn(i,t._pointLabels[r],l,c+o.lineHeight/2,o,{color:s.color,textAlign:d,textBaseline:"middle"})}}}(this,l),s.display&&this.ticks.forEach(((t,i)=>{if(0!==i||0===i&&this.min<0){e=this.getDistanceFromCenterForValue(t.value);var n=this.getContext(i),r=s.setContext(n),a=o.setContext(n);!function(t,e,i,n,r){var a=t.ctx,s=e.circular,o=e.color,l=e.lineWidth;!s&&!n||!o||!l||i<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(r.dash||[]),a.lineDashOffset=r.dashOffset,a.beginPath(),Dl(t,i,s,n),a.closePath(),a.stroke(),a.restore())}(this,r,e,l,a)}})),a.display){for(n.save(),t=l-1;t>=0;t--){var c=a.setContext(this.getPointLabelContext(t)),d=c.color,h=c.lineWidth;h&&d&&(n.lineWidth=h,n.strokeStyle=d,n.setLineDash(c.borderDash),n.lineDashOffset=c.borderDashOffset,e=this.getDistanceFromCenterForValue(r.reverse?this.min:this.max),i=this.getPointPosition(t,e),n.beginPath(),n.moveTo(this.xCenter,this.yCenter),n.lineTo(i.x,i.y),n.stroke())}n.restore()}}drawBorder(){}drawLabels(){var t=this.ctx,e=this.options,i=e.ticks;if(i.display){var n,r,a=this.getIndexAngle(0);t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(a),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((a,s)=>{if(!(0===s&&this.min>=0)||e.reverse){var o=i.setContext(this.getContext(s)),l=er(o.font);if(n=this.getDistanceFromCenterForValue(this.ticks[s].value),o.showLabelBackdrop){t.font=l.string,r=t.measureText(a.label).width,t.fillStyle=o.backdropColor;var c=tr(o.backdropPadding);t.fillRect(-r/2-c.left,-n-l.size/2-c.top,r+c.width,l.size+c.height)}Yn(t,a.label,0,-n,l,{color:o.color,strokeColor:o.textStrokeColor,strokeWidth:o.textStrokeWidth})}})),t.restore()}}drawTitle(){}}r(Ll,"id","radialLinear"),r(Ll,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Cn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}}),r(Ll,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),r(Ll,"descriptors",{angleLines:{_fallback:"grid"}});var zl={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ol=Object.keys(zl);function Al(t,e){return t-e}function El(t,e){if(li(e))return null;var i=t._adapter,n=t._parseOpts,r=n.parser,a=n.round,s=n.isoWeekday,o=e;return"function"==typeof r&&(o=r(o)),hi(o)||(o="string"==typeof r?i.parse(o,r):i.parse(o)),null===o?null:(a&&(o="week"!==a||!Bi(s)&&!0!==s?i.startOf(o,a):i.startOf(o,"isoWeek",s)),+o)}function jl(t,e,i,n){for(var r=Ol.length,a=Ol.indexOf(t);a=e?i[r]:i[a]]=!0}}else t[e]=!0}function Rl(t,e,i){var n,r,a=[],s={},o=e.length;for(n=0;n=0&&(e[a].major=!0);return e}(t,a,s,i):a}class Fl extends Ms{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.time||(t.time={}),n=this._adapter=new La(t.adapters.date);n.init(e),wi(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:El(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){var t=this.options,e=this._adapter,i=t.time.unit||"day",n=this.getUserBounds(),r=n.min,a=n.max,s=n.minDefined,o=n.maxDefined;function l(t){s||isNaN(t.min)||(r=Math.min(r,t.min)),o||isNaN(t.max)||(a=Math.max(a,t.max))}s&&o||(l(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||l(this.getMinMax(!1))),r=hi(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),a=hi(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,a-1),this.max=Math.max(r+1,a)}_getLabelBounds(){var t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){var t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);var r=this.min,a=function(t,e,i){for(var n=0,r=t.length;nn&&t[r-1]>i;)r--;return n>0||r=Ol.indexOf(i);a--){var s=Ol[a];if(zl[s].common&&t._adapter.diff(r,n,s)>=e-1)return s}return Ol[i?Ol.indexOf(i):0]}(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(var e=Ol.indexOf(t)+1,i=Ol.length;e+t.value)))}initOffsets(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=0,r=0;this.options.offset&&i.length&&(t=this.getDecimalForValue(i[0]),n=1===i.length?1-t:(this.getDecimalForValue(i[1])-t)/2,e=this.getDecimalForValue(i[i.length-1]),r=1===i.length?e:(e-this.getDecimalForValue(i[i.length-2]))/2);var a=i.length<3?.5:.25;n=Qi(n,0,a),r=Qi(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){var t,e,i=this._adapter,n=this.min,r=this.max,a=this.options,s=a.time,o=s.unit||jl(s.minUnit,n,r,this._getLabelCapacity(n)),l=fi(a.ticks.stepSize,1),c="week"===o&&s.isoWeekday,d=Bi(c)||!0===c,h={},u=n;if(d&&(u=+i.startOf(u,"isoWeek",c)),u=+i.startOf(u,d?"day":o),i.diff(r,n,o)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+o);var f="data"===a.ticks.source&&this.getDataTimestamps();for(t=u,e=0;t+t))}getLabelForValue(t){var e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){var i=this.options.time.displayFormats,n=this._unit,r=e||i[n];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,n){var r=this.options,a=r.ticks.callback;if(a)return vi(a,[t,e,i],this);var s=r.time.displayFormats,o=this._unit,l=this._majorUnit,c=o&&s[o],d=l&&s[l],h=i[e],u=l&&d&&h&&h.major;return this._adapter.format(t,n||(u?d:c))}generateTickLabels(t){var e,i,n;for(e=0,i=t.length;e0?s:1}getDataTimestamps(){var t,e,i=this._cache.data||[];if(i.length)return i;var n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[o].pos&&e<=t[l].pos){var c=nn(t,"pos",e);o=c.lo,l=c.hi}var d=t[o];n=d.pos,a=d.time;var h=t[l];r=h.pos,s=h.time}else{if(e>=t[o].time&&e<=t[l].time){var u=nn(t,"time",e);o=u.lo,l=u.hi}var f=t[o];n=f.time,a=f.pos;var p=t[l];r=p.time,s=p.pos}var v=r-n;return v?a+(s-a)*(e-n)/v:a}r(Fl,"id","time"),r(Fl,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});class Nl extends Fl{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){var t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Hl(e,this.min),this._tableRange=Hl(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){var e,i,n,r,a,s=this.min,o=this.max,l=[],c=[];for(e=0,i=t.length;e=s&&r<=o&&l.push(r);if(l.length<2)return[{time:s,pos:0},{time:o,pos:1}];for(e=0,i=l.length;et-e))}_getTimestampsForTable(){var t=this._cache.all||[];if(t.length)return t;var e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t}getDecimalForValue(t){return(Hl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){var e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Hl(this._table,i*this._tableRange+this._minPos,!0)}}function Vl(t){A(t,"svelte-1u0al5o",".chart-container.svelte-1u0al5o{position:relative;width:100%}")}function Bl(t){var e,i;return{c(){e=N("div"),i=N("canvas"),G(e,"class","chart-container svelte-1u0al5o"),Q(e,"height",t[0])},m(n,r){R(n,e,r),O(e,i),t[9](i)},p(t,i){1&l(i,1)[0]&&Q(e,"height",t[0])},i:d,o:d,d(i){i&&F(e),t[9](null)}}}function Wl(t,e,i){var n,r;io.register(_o,bo,gl,ul,$a,Wo,cl,Xo);var a=e.data_type,s=void 0===a?"":a,o=e.legend,l=void 0===o||o,c=e.tooltips,d=void 0===c||c,h=e.ticks,u=void 0===h||h,f=e.height,p=void 0===f?"300px":f;return io.defaults.color=Me("body_text_color"),io.defaults.font.size=15,io.defaults.font.family="system-ui, sans-serif",io.defaults.maintainAspectRatio=!1,io.defaults.plugins.tooltip.mode="index",io.defaults.plugins.tooltip.axis="x",io.defaults.plugins.tooltip.intersect=!1,io.defaults.animation.duration=500,io.defaults.animation.easing="linear",dt((()=>{r=new io(n.getContext("2d"),{type:"line",data:{labels:[],datasets:[]},options:{responsive:!0,resizeDelay:100,plugins:{legend:{display:l,labels:{boxWidth:12,boxHeight:12}},tooltip:{enabled:d}},layout:{padding:{left:4,right:4}},scales:{y:{type:"linear",display:!0,position:"left",ticks:{callback(t,e,i){return"bytes"==s?be(t,3):(r=3,(n=t)>=1e6?(n/1e6).toPrecision(r)+"M":n>=1e3?(n/1e3).toPrecision(r)+"k":n.toPrecision(r));var n,r}},beginAtZero:!0,grid:{display:!0,drawBorder:!1,color:Me("separator")}},x:{display:!0,ticks:{display:u,sampleSize:1,padding:4,minRotation:0,maxRotation:0},grid:{display:!1,drawBorder:!1}}}}})})),t.$$set=t=>{"data_type"in t&&i(2,s=t.data_type),"legend"in t&&i(3,l=t.legend),"tooltips"in t&&i(4,d=t.tooltips),"ticks"in t&&i(5,u=t.ticks),"height"in t&&i(0,p=t.height)},[p,n,s,l,d,u,()=>r,()=>r.data,()=>r.update(),function(t){pt[t?"unshift":"push"]((()=>{i(1,n=t)}))}]}r(Nl,"id","timeseries"),r(Nl,"defaults",Fl.defaults);class ql extends Wt{constructor(t){super(),Bt(this,t,Wl,Bl,m,{data_type:2,legend:3,tooltips:4,ticks:5,height:0,chart:6,data:7,update:8},Vl)}get chart(){return this.$$.ctx[6]}get data(){return this.$$.ctx[7]}get update(){return this.$$.ctx[8]}}function Yl(t){A(t,"svelte-1det3o2",".button_bar.svelte-1det3o2.svelte-1det3o2.svelte-1det3o2{display:block;width:100%;text-align:center}.shortcuts.svelte-1det3o2.svelte-1det3o2.svelte-1det3o2{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:5px}.shortcuts.svelte-1det3o2>div.svelte-1det3o2.svelte-1det3o2{flex:0 0 10em;display:flex;flex-direction:column;text-align:center;border-radius:8px;overflow:hidden;border:2px solid var(--card_color)}.shortcuts.svelte-1det3o2>div.svelte-1det3o2>div.svelte-1det3o2:first-child{font-size:1.4em;padding:4px;background:var(--card_color)}")}function Ul(t,e,i){var n=t.slice();return n[11]=e[i],n}function Xl(t){var e;return{c(){(e=N("tr")).innerHTML='The unique download counter only counts downloads once per IP\n\t\t\t\t\t\taddress. So this number shows how many individual people have\n\t\t\t\t\t\tattempted to download the file. The download counter on the\n\t\t\t\t\t\ttoolbar on the other hand shows how many real downloads the file\n\t\t\t\t\t\thas had. Real downloads are counted by dividing the total\n\t\t\t\t\t\tbandwidth usage by the size of the file.'},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Gl(t){var e,i,n,r,a,s=t[0].description+"";return{c(){e=N("tr"),(i=N("td")).textContent="Description",n=W(),r=N("td"),a=B(s)},m(t,s){R(t,e,s),O(e,i),O(e,n),O(e,r),O(r,a)},p(t,e){1&e&&s!==(s=t[0].description+"")&&Z(a,s)},d(t){t&&F(e)}}}function Kl(t){var e,i,n;function r(){return t[7](t[11])}return{c(){(e=N("button")).textContent="".concat(t[11].label," "),tt(e,"button_highlight",t[2]==t[11].span)},m(t,a){R(t,e,a),i||(n=Y(e,"click",r),i=!0)},p(i,n){t=i,20&n&&tt(e,"button_highlight",t[2]==t[11].span)},d(t){t&&F(e),i=!1,n()}}}function Zl(t){for(var e,i,n,r,a,s,o,c,d,h,u,f,p,v,g,m,b,x,_,y,w,k,$,M,C,S,T,P,D,L,z,A,E,j,I,V,q,U,X,K,J,et,it,nt,rt,at,st,ot,lt,ct,dt,ht,ut,ft,pt,vt,gt,mt,bt,xt,_t,yt,wt,kt,$t,Mt,Ct,St,Tt,Pt,Dt,Lt,At,Et,It,Rt,Ft,Bt,Wt,qt,Yt,Ut,Xt,Gt,Kt,Zt,Jt,Qt,te,ee,ie,ne,re,ae,se,oe,le,ce,de,he,ue,fe,pe,ve,ge,xe,_e,ye,we=t[0].name+"",Me=$e()+"",Ce=t[0].id+"",Se=t[0].mime_type+"",Te=t[0].id+"",Pe=be(t[0].size,4)+"",De=me(t[0].size)+"",Le=be(t[0].bandwidth_used,4)+"",ze=me(t[0].bandwidth_used)+"",Oe=(t[0].bandwidth_used/t[0].size).toFixed(1)+"",Ae=be(t[0].bandwidth_used_paid,4)+"",Ee=me(t[0].bandwidth_used_paid)+"",je=(t[0].bandwidth_used_paid/t[0].size).toFixed(1)+"",Ie=me(t[0].downloads)+"",Re=ke(t[0].date_upload,0,0,!0)+"",Fe=t[0].hash_sha256+"",He=t[3]&&Xl(),Ne=t[0].description&&Gl(t),Ve=jt(t[4]),Be=[],We=0;Wehelp',Ct=W(),St=N("td"),Tt=B(Ie),Pt=W(),He&&He.c(),Dt=W(),Lt=N("tr"),(At=N("td")).textContent="Upload Date",Et=W(),It=N("td"),Rt=B(Re),Ft=W(),Ne&&Ne.c(),Bt=W(),Wt=N("tr"),(qt=N("td")).textContent="SHA256 hash",Yt=W(),Ut=N("td"),Xt=B(Fe),Gt=W(),(Kt=N("h2")).textContent="Views and downloads",Zt=W(),Jt=N("div");for(var l=0;lChart.js.',ne=W(),(re=N("h3")).textContent="Keyboard Controls",ae=W(),(se=N("h4")).textContent="Global",oe=W(),(le=N("div")).innerHTML='
c
Copy page URL
s
Download current file
q
Close window
g
Grab file (copy to your account)
i
Show details window
e
Show edit window
m
Show embed window
r
Show abuse report window
',ce=W(),(de=N("h4")).textContent="List",he=W(),(ue=N("div")).innerHTML='
a or ←
Previous file
d or →
Next file
shift + s
Download all files as zip
u
Upload files to album
',fe=W(),(pe=N("h4")).textContent="Video / audio",ve=W(),(ge=N("div")).innerHTML='
space
Pause / resume playback
f
Enter fullscreen
esc
Exit fullscreen
h
Skip 20 seconds backward
j
Skip 5 seconds backward
k
Skip 5 seconds forward
l
Skip 20 seconds forward
,
Skip 40ms backward
.
Skip 40ms forward
',G(v,"href",x="/u/"+t[0].id),G(Mt,"class","button small_button round"),Q(Mt,"margin","0"),tt(Mt,"button_highlight",t[3]),Q(Ut,"word-break","break-all"),G(Jt,"class","button_bar svelte-1det3o2"),Q(ie,"text-align","center"),G(le,"class","shortcuts svelte-1det3o2"),G(ue,"class","shortcuts svelte-1det3o2"),G(ge,"class","shortcuts svelte-1det3o2"),G(e,"class","indent")},m(l,x){R(l,e,x),O(e,i),O(i,n),O(n,r),O(r,a),O(r,s),O(r,o),O(o,c),O(n,d),O(n,h),O(h,u),O(h,f),O(h,p),O(p,v),O(v,g),O(v,m),O(v,b),O(n,_),O(n,y),O(y,w),O(y,k),O(y,$),O($,M),O(n,C),O(n,S),O(S,T),O(S,P),O(S,D),O(D,L),O(n,z),O(n,A),O(A,E),O(A,j),O(A,I),O(I,V),O(I,q),O(I,U),O(I,X),O(n,K),O(n,J),O(J,et),O(J,it),O(J,nt),O(nt,rt),O(nt,at),O(nt,st),O(nt,ot),O(nt,lt),O(nt,ct),O(n,dt),O(n,ht),O(ht,ut),O(ht,ft),O(ht,pt),O(pt,vt),O(pt,gt),O(pt,mt),O(pt,bt),O(pt,xt),O(pt,_t),O(n,yt),O(n,wt),O(wt,kt),O(kt,$t),O(kt,Mt),O(wt,Ct),O(wt,St),O(St,Tt),O(n,Pt),He&&He.m(n,null),O(n,Dt),O(n,Lt),O(Lt,At),O(Lt,Et),O(Lt,It),O(It,Rt),O(n,Ft),Ne&&Ne.m(n,null),O(n,Bt),O(n,Wt),O(Wt,qt),O(Wt,Yt),O(Wt,Ut),O(Ut,Xt),O(e,Gt),O(e,Kt),O(e,Zt),O(e,Jt);for(var F=0;F{if(0===t)for(var r=((new Date).getTime()-Date.parse(a.date_upload))/1e3/60,c=0;cr));c++);i(2,s=t),o=e,console.log("updating graph",s,o);var d=new Date;d.setMinutes(d.getMinutes()-t);var h=new Date;fetch(a.timeseries_href+"?start="+d.toISOString()+"&end="+h.toISOString()+"&interval="+e).then((t=>t.ok?t.json():null)).then((t=>{t.views.timestamps.forEach(((e,i)=>{var n=new Date(e),r=("00"+(n.getMonth()+1)).slice(-2);r+="-"+("00"+n.getDate()).slice(-2),r+=" "+("00"+n.getHours()).slice(-2),r+=":"+("00"+n.getMinutes()).slice(-2),t.views.timestamps[i]=" "+r+" "})),t.bandwidth.amounts.forEach(((e,i)=>{t.bandwidth.amounts[i]=Math.round(e/a.size)})),t.bandwidth_paid.amounts.forEach(((e,i)=>{t.bandwidth.amounts[i]+=Math.round(e/a.size)})),n.data().labels=t.views.timestamps,n.data().datasets[0].data=t.views.amounts,n.data().datasets[1].data=t.bandwidth.amounts,n.update()}))},d=!1;dt((()=>{n.data().datasets=[{label:"Views",borderWidth:2,pointRadius:0,borderColor:Me("highlight_color"),backgroundColor:Me("highlight_color")},{label:"Downloads",borderWidth:2,pointRadius:0,borderColor:Me("danger_color"),backgroundColor:Me("danger_color")}]}));return t.$$set=t=>{"file"in t&&i(0,a=t.file)},t.$$.update=()=>{1&t.$$.dirty&&(t=>{t&&c(0,0)})(a.id)},[a,n,s,d,l,c,()=>i(3,d=!d),t=>{c(t.span,t.interval)},function(t){pt[t?"unshift":"push"]((()=>{i(1,n=t)}))}]}class Ql extends Wt{constructor(t){super(),Bt(this,t,Jl,Zl,m,{file:0},Yl)}}function tc(t){A(t,"svelte-1pco739","svg.svelte-1pco739{color:var(--highlight_color);fill:currentColor}")}function ec(t){var e,i,n;return{c(){e=V("svg"),i=V("path"),G(n=V("animateTransform"),"attributeType","xml"),G(n,"attributeName","transform"),G(n,"type","rotate"),G(n,"from","0 40 40"),G(n,"to","360 40 40"),G(n,"dur","0.6s"),G(n,"repeatCount","indefinite"),G(i,"d","M10,40c0,0,0-0.4,0-1.1c0-0.3,0-0.8,0-1.3c0-0.3,0-0.5,0-0.8c0-0.3,0.1-0.6,0.1-0.9c0.1-0.6,0.1-1.4,0.2-2.1\n\t\tc0.2-0.8,0.3-1.6,0.5-2.5c0.2-0.9,0.6-1.8,0.8-2.8c0.3-1,0.8-1.9,1.2-3c0.5-1,1.1-2,1.7-3.1c0.7-1,1.4-2.1,2.2-3.1\n\t\tc1.6-2.1,3.7-3.9,6-5.6c2.3-1.7,5-3,7.9-4.1c0.7-0.2,1.5-0.4,2.2-0.7c0.7-0.3,1.5-0.3,2.3-0.5c0.8-0.2,1.5-0.3,2.3-0.4l1.2-0.1\n\t\tl0.6-0.1l0.3,0l0.1,0l0.1,0l0,0c0.1,0-0.1,0,0.1,0c1.5,0,2.9-0.1,4.5,0.2c0.8,0.1,1.6,0.1,2.4,0.3c0.8,0.2,1.5,0.3,2.3,0.5\n\t\tc3,0.8,5.9,2,8.5,3.6c2.6,1.6,4.9,3.4,6.8,5.4c1,1,1.8,2.1,2.7,3.1c0.8,1.1,1.5,2.1,2.1,3.2c0.6,1.1,1.2,2.1,1.6,3.1\n\t\tc0.4,1,0.9,2,1.2,3c0.3,1,0.6,1.9,0.8,2.7c0.2,0.9,0.3,1.6,0.5,2.4c0.1,0.4,0.1,0.7,0.2,1c0,0.3,0.1,0.6,0.1,0.9\n\t\tc0.1,0.6,0.1,1,0.1,1.4C74,39.6,74,40,74,40c0.2,2.2-1.5,4.1-3.7,4.3s-4.1-1.5-4.3-3.7c0-0.1,0-0.2,0-0.3l0-0.4c0,0,0-0.3,0-0.9\n\t\tc0-0.3,0-0.7,0-1.1c0-0.2,0-0.5,0-0.7c0-0.2-0.1-0.5-0.1-0.8c-0.1-0.6-0.1-1.2-0.2-1.9c-0.1-0.7-0.3-1.4-0.4-2.2\n\t\tc-0.2-0.8-0.5-1.6-0.7-2.4c-0.3-0.8-0.7-1.7-1.1-2.6c-0.5-0.9-0.9-1.8-1.5-2.7c-0.6-0.9-1.2-1.8-1.9-2.7c-1.4-1.8-3.2-3.4-5.2-4.9\n\t\tc-2-1.5-4.4-2.7-6.9-3.6c-0.6-0.2-1.3-0.4-1.9-0.6c-0.7-0.2-1.3-0.3-1.9-0.4c-1.2-0.3-2.8-0.4-4.2-0.5l-2,0c-0.7,0-1.4,0.1-2.1,0.1\n\t\tc-0.7,0.1-1.4,0.1-2,0.3c-0.7,0.1-1.3,0.3-2,0.4c-2.6,0.7-5.2,1.7-7.5,3.1c-2.2,1.4-4.3,2.9-6,4.7c-0.9,0.8-1.6,1.8-2.4,2.7\n\t\tc-0.7,0.9-1.3,1.9-1.9,2.8c-0.5,1-1,1.9-1.4,2.8c-0.4,0.9-0.8,1.8-1,2.6c-0.3,0.9-0.5,1.6-0.7,2.4c-0.2,0.7-0.3,1.4-0.4,2.1\n\t\tc-0.1,0.3-0.1,0.6-0.2,0.9c0,0.3-0.1,0.6-0.1,0.8c0,0.5-0.1,0.9-0.1,1.3C10,39.6,10,40,10,40z"),G(e,"version","1.1"),G(e,"class","svg_spinner svelte-1pco739"),G(e,"xmlns","http://www.w3.org/2000/svg"),G(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),G(e,"x","0px"),G(e,"y","0px"),G(e,"viewBox","0 0 80 80"),G(e,"xml:space","preserve")},m(t,r){R(t,e,r),O(e,i),O(i,n)},p:d,i:d,o:d,d(t){t&&F(e)}}}class ic extends Wt{constructor(t){super(),Bt(this,t,null,ec,m,{},tc)}}function nc(t){A(t,"svelte-1j18l4r",".block.svelte-1j18l4r{display:block;text-align:initial;max-width:99%;overflow-wrap:anywhere;margin:8px auto;background-color:var(--shaded_background);backdrop-filter:blur(4px);border-radius:8px;padding:8px}.center.svelte-1j18l4r{text-align:center}")}function rc(t){var e,i,n=t[3].default,r=_(n,t,t[2],null);return{c(){e=N("div"),r&&r.c(),G(e,"class","block svelte-1j18l4r"),Q(e,"width",t[0]),tt(e,"center",t[1])},m(t,n){R(t,e,n),r&&r.m(e,null),i=!0},p(t,a){var s=l(a,1)[0];r&&r.p&&(!i||4&s)&&k(r,n,t,t[2],i?w(n,t[2],s,null):$(t[2]),null),(!i||1&s)&&Q(e,"width",t[0]),(!i||2&s)&&tt(e,"center",t[1])},i(t){i||(zt(r,t),i=!0)},o(t){Ot(r,t),i=!1},d(t){t&&F(e),r&&r.d(t)}}}function ac(t,e,i){var n=e.$$slots,r=void 0===n?{}:n,a=e.$$scope,s=e.width,o=void 0===s?"750px":s,l=e.center,c=void 0!==l&&l;return t.$$set=t=>{"width"in t&&i(0,o=t.width),"center"in t&&i(1,c=t.center),"$$scope"in t&&i(2,a=t.$$scope)},[o,c,a,r]}class sc extends Wt{constructor(t){super(),Bt(this,t,ac,rc,m,{width:0,center:1},nc)}}function oc(t){A(t,"svelte-1iu1l04",".progress_bar_outer.svelte-1iu1l04{display:block;background:var(--background_color);width:100%;height:6px;border-radius:6px;overflow:hidden;margin:6px 0}.progress_bar_inner.svelte-1iu1l04{background:var(--highlight_background);height:100%;width:0;border-radius:6px;transition-property:width}.no_animation.svelte-1iu1l04{transition-property:none}")}function lc(t){var e,i;return{c(){e=N("div"),G(i=N("div"),"class","progress_bar_inner svelte-1iu1l04"),Q(i,"width",t[4]+"%"),Q(i,"transition-timing-function",t[0]),Q(i,"transition-duration",t[1]+"ms"),tt(i,"no_animation",t[2]),G(e,"class","progress_bar_outer svelte-1iu1l04"),G(e,"style",t[3])},m(t,n){R(t,e,n),O(e,i)},p(t,n){var r=l(n,1)[0];16&r&&Q(i,"width",t[4]+"%"),1&r&&Q(i,"transition-timing-function",t[0]),2&r&&Q(i,"transition-duration",t[1]+"ms"),4&r&&tt(i,"no_animation",t[2]),8&r&&G(e,"style",t[3])},i:d,o:d,d(t){t&&F(e)}}}function cc(t,e,i){var n=e.total,r=void 0===n?0:n,a=e.used,s=void 0===a?0:a,o=e.animation,l=void 0===o?"ease":o,c=e.speed,d=void 0===c?1e3:c,h=e.no_animation,u=void 0!==h&&h,f=e.style,p=void 0===f?"":f,v=0;return t.$$set=t=>{"total"in t&&i(5,r=t.total),"used"in t&&i(6,s=t.used),"animation"in t&&i(0,l=t.animation),"speed"in t&&i(1,d=t.speed),"no_animation"in t&&i(2,u=t.no_animation),"style"in t&&i(3,p=t.style)},t.$$.update=()=>{96&t.$$.dirty&&(0===r&&i(5,r=1),i(4,v=s/r>1?100:s/r*100))},[l,d,u,p,v,r,s]}class dc extends Wt{constructor(t){super(),Bt(this,t,cc,lc,m,{total:5,used:6,animation:0,speed:1,no_animation:2,style:3},oc)}}var hc=[];function uc(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d,r=new Set;function a(i){if(m(t,i)&&(t=i,e)){var a,s=!hc.length,o=n(r);try{for(o.s();!(a=o.n()).done;){var l=a.value;l[1](),hc.push(l,t)}}catch(t){o.e(t)}finally{o.f()}if(s){for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:d];return r.add(o),1===r.size&&(e=i(a,s)||d),n(t),()=>{r.delete(o),0===r.size&&e&&(e(),e=null)}}}}var fc,pc={connected:!1,file_stats_init:!1,file_stats:{views:0,downloads:0,bandwidth:0,bandwidth_paid:0},limits_init:!1,limits:{download_limit:0,download_limit_used:0,transfer_limit:0,transfer_limit_used:0}},vc=(fc=t=>(mc(t),()=>bc(t)),{subscribe:uc(pc,fc).subscribe}),gc=null,mc=t=>{null===gc&&(console.log("initializing stats socket"),(gc=new WebSocket(location.origin.replace(/^http/,"ws")+"/api/file_stats")).onopen=()=>{pc.connected=!0,t(pc),_c({type:"limits"})},gc.onmessage=e=>{var i=JSON.parse(e.data);console.debug("WS update",i),"file_stats"===i.type?(pc.file_stats=i.file_stats,pc.file_stats_init=!0,t(pc)):"limits"===i.type?(pc.limits=i.limits,pc.limits_init=!0,t(pc)):console.error("Unknown ws message type",i.type,"data",e.data)},gc.onerror=e=>{console.error("socket error",e),bc(t),window.setTimeout((()=>mc(t)),2e3)},gc.onclose=()=>{bc(t),window.setTimeout((()=>mc(t)),2e3)})},bc=t=>{null!==gc&&(gc.onerror=null,gc.onclose=null,gc.close(),gc=null,pc.connected=!1,pc.file_stats_init=!1,pc.limits_init=!1,t(pc))},xc=[],_c=t=>{if(null!==gc&&gc.readyState===WebSocket.OPEN){for(;0!==xc.length;)gc.send(JSON.stringify(xc.shift()));gc.send(JSON.stringify(t))}else null!==t&&(xc.push(t),console.debug("Socket is closed, command",t,"added to queue"))};function yc(t){var e,i;return e=new sc({props:{center:!0,$$slots:{default:[kc]},$$scope:{ctx:t}}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};15&i&&(n.$$scope={dirty:i,ctx:t}),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function wc(t){var e,i,n,r,a,s,o=be(t[2],3)+"",l=be(t[0].size-t[2],3)+"";return{c(){e=N("div"),i=B("This file is too large to download completely with your current\n\t\t\t\ttransfer limit. The first "),n=B(o),r=B("\n\t\t\t\twill download at full speed, but the remaining\n\t\t\t\t"),a=B(l),s=B(" will take\n\t\t\t\tlonger"),G(e,"class","highlight_yellow")},m(t,o){R(t,e,o),O(e,i),O(e,n),O(e,r),O(e,a),O(e,s)},p(t,e){4&e&&o!==(o=be(t[2],3)+"")&&Z(n,o),5&e&&l!==(l=be(t[0].size-t[2],3)+"")&&Z(a,l)},d(t){t&&F(e)}}}function kc(t){var e,i,n,r,a,s,o,l,c,d,h,u,f=be(t[1].limits.transfer_limit_used,3)+"",p=be(t[1].limits.transfer_limit,3)+"",v=t[0].size>t[2]&&wc(t);return h=new dc({props:{total:t[1].limits.transfer_limit,used:t[1].limits.transfer_limit_used}}),{c(){v&&v.c(),e=W(),i=N("p"),n=B("You have used "),r=B(f),a=B(" of\n\t\t\tyour daily "),s=B(p),o=B(" transfer\n\t\t\tlimit. When the transfer limit is exceeded your download speed will\n\t\t\tbe reduced."),l=W(),(c=N("p")).innerHTML='bolt Upgrade your account\n\t\t\t\tto disable the transfer limit',d=W(),Ht(h.$$.fragment)},m(t,f){v&&v.m(t,f),R(t,e,f),R(t,i,f),O(i,n),O(i,r),O(i,a),O(i,s),O(i,o),R(t,l,f),R(t,c,f),R(t,d,f),Nt(h,t,f),u=!0},p(t,i){t[0].size>t[2]?v?v.p(t,i):((v=wc(t)).c(),v.m(e.parentNode,e)):v&&(v.d(1),v=null),(!u||2&i)&&f!==(f=be(t[1].limits.transfer_limit_used,3)+"")&&Z(r,f),(!u||2&i)&&p!==(p=be(t[1].limits.transfer_limit,3)+"")&&Z(s,p);var n={};2&i&&(n.total=t[1].limits.transfer_limit),2&i&&(n.used=t[1].limits.transfer_limit_used),h.$set(n)},i(t){u||(zt(h.$$.fragment,t),u=!0)},o(t){Ot(h.$$.fragment,t),u=!1},d(t){t&&(F(e),F(i),F(l),F(c),F(d)),v&&v.d(t),Vt(h,t)}}}function $c(t){var e,i,n=t[1].limits_init&&yc(t);return{c(){n&&n.c(),e=q()},m(t,r){n&&n.m(t,r),R(t,e,r),i=!0},p(t,i){var r=l(i,1)[0];t[1].limits_init?n?(n.p(t,r),2&r&&zt(n,1)):((n=yc(t)).c(),zt(n,1),n.m(e.parentNode,e)):n&&(Dt(),Ot(n,1,1,(()=>{n=null})),Lt())},i(t){i||(zt(n),i=!0)},o(t){Ot(n),i=!1},d(t){t&&F(e),n&&n.d(t)}}}function Mc(t,e,i){var n,r;x(t,vc,(t=>i(1,r=t)));var a=e.file,s=void 0===a?{size:0}:a;return t.$$set=t=>{"file"in t&&i(0,s=t.file)},t.$$.update=()=>{2&t.$$.dirty&&i(2,n=r.limits.transfer_limit-r.limits.transfer_limit_used)},[s,r,n]}class Cc extends Wt{constructor(t){super(),Bt(this,t,Mc,$c,m,{file:0})}}function Sc(t){A(t,"svelte-40do4p",".block.svelte-40do4p{display:flex;flex-direction:row;margin:8px auto}@media(max-width: 400px){.block.svelte-40do4p{flex-direction:column}}.icon.svelte-40do4p{flex:0 0 auto;margin-right:8px;border-radius:8px;align-self:center;width:128px}.description.svelte-40do4p{flex:1 1 auto;display:inline-block;text-align:initial;padding-left:8px;vertical-align:middle;overflow-wrap:anywhere;background-color:var(--shaded_background);backdrop-filter:blur(4px);border-radius:8px;padding:8px}")}function Tc(t){var e,i,n,r,a,s,o=t[3].default,c=_(o,t,t[2],null);return{c(){e=N("div"),i=N("img"),r=W(),a=N("div"),c&&c.c(),b(i.src,n=t[0])||G(i,"src",n),G(i,"alt","File icon"),G(i,"class","icon svelte-40do4p"),G(a,"class","description svelte-40do4p"),G(e,"class","block svelte-40do4p"),Q(e,"width",t[1]),Q(e,"max-width","100%")},m(t,n){R(t,e,n),O(e,i),O(e,r),O(e,a),c&&c.m(a,null),s=!0},p(t,r){var a=l(r,1)[0];(!s||1&a&&!b(i.src,n=t[0]))&&G(i,"src",n),c&&c.p&&(!s||4&a)&&k(c,o,t,t[2],s?w(o,t[2],a,null):$(t[2]),null),(!s||2&a)&&Q(e,"width",t[1])},i(t){s||(zt(c,t),s=!0)},o(t){Ot(c,t),s=!1},d(t){t&&F(e),c&&c.d(t)}}}function Pc(t,e,i){var n=e.$$slots,r=void 0===n?{}:n,a=e.$$scope,s=e.icon_href,o=void 0===s?"":s,l=e.width,c=void 0===l?"750px":l;return t.$$set=t=>{"icon_href"in t&&i(0,o=t.icon_href),"width"in t&&i(1,c=t.width),"$$scope"in t&&i(2,a=t.$$scope)},[o,c,a,r]}class Dc extends Wt{constructor(t){super(),Bt(this,t,Pc,Tc,m,{icon_href:0,width:1},Sc)}}function Lc(t){A(t,"svelte-1fg9p5f","h1.svelte-1fg9p5f.svelte-1fg9p5f{text-shadow:1px 1px 3px var(--shadow_color);line-break:anywhere}.container.svelte-1fg9p5f.svelte-1fg9p5f{display:flex;flex-direction:column;height:100%;width:100%}.player_and_controls.svelte-1fg9p5f.svelte-1fg9p5f{flex:1 1 0;display:flex;flex-direction:column;overflow:auto;height:100%;width:100%}.player.svelte-1fg9p5f.svelte-1fg9p5f{flex:1 1 auto;display:flex;justify-content:center;text-align:center;overflow:hidden}.controls.svelte-1fg9p5f.svelte-1fg9p5f{flex:0 0 auto;display:flex;flex-direction:row;overflow:auto;background-color:var(--shaded_background);backdrop-filter:blur(4px);padding:0 2px 2px 2px;align-items:center}.controls.svelte-1fg9p5f>.svelte-1fg9p5f{flex:0 0 auto}.controls.svelte-1fg9p5f>.spacer.svelte-1fg9p5f{flex:1 1 auto}@media(max-height: 500px){.player_and_controls.svelte-1fg9p5f.svelte-1fg9p5f{flex-direction:row}.controls.svelte-1fg9p5f.svelte-1fg9p5f{flex-direction:column}}.compatibility_warning.svelte-1fg9p5f.svelte-1fg9p5f{background-color:var(--shaded_background);backdrop-filter:blur(4px);border-bottom:2px solid #6666FF;padding:4px}")}function zc(t){var e,i,n,r,a,s,o,l=t[3].name+"";r=new Dc({props:{icon_href:t[3].icon_href,$$slots:{default:[Ac]},$$scope:{ctx:t}}});var c=t[3].show_ads&&Ec(t);return{c(){e=N("h1"),i=B(l),n=W(),Ht(r.$$.fragment),a=W(),c&&c.c(),s=q(),G(e,"class","svelte-1fg9p5f")},m(t,l){R(t,e,l),O(e,i),R(t,n,l),Nt(r,t,l),R(t,a,l),c&&c.m(t,l),R(t,s,l),o=!0},p(t,e){(!o||8&e)&&l!==(l=t[3].name+"")&&Z(i,l);var n={};8&e&&(n.icon_href=t[3].icon_href),16777216&e&&(n.$$scope={dirty:e,ctx:t}),r.$set(n),t[3].show_ads?c?(c.p(t,e),8&e&&zt(c,1)):((c=Ec(t)).c(),zt(c,1),c.m(s.parentNode,s)):c&&(Dt(),Ot(c,1,1,(()=>{c=null})),Lt())},i(t){o||(zt(r.$$.fragment,t),zt(c),o=!0)},o(t){Ot(r.$$.fragment,t),Ot(c),o=!1},d(t){t&&(F(e),F(n),F(a),F(s)),Vt(r,t),c&&c.d(t)}}}function Oc(t){var e,i=!t[6]&&jc(t);return{c(){i&&i.c(),e=q()},m(t,n){i&&i.m(t,n),R(t,e,n)},p(t,n){t[6]?i&&(i.d(1),i=null):i?i.p(t,n):((i=jc(t)).c(),i.m(e.parentNode,e))},i:d,o:d,d(t){t&&F(e),i&&i.d(t)}}}function Ac(t){var e,i,n,r,a,s,o,l,c,h;return{c(){e=B("The online video player on pixeldrain is only available while logged in\n\t\tto an account, or if the uploading user has verified their e-mail\n\t\taddress. You can still download the video and watch it locally on your\n\t\tcomputer without an account.\n\n\t\t"),i=N("br"),n=W(),(r=N("button")).innerHTML='download Download',a=W(),(s=N("a")).innerHTML='login Log in',o=W(),(l=N("a")).innerHTML='how_to_reg Sign up',G(s,"href","/login"),G(s,"class","button"),G(l,"href","/register"),G(l,"class","button")},m(d,u){R(d,e,u),R(d,i,u),R(d,n,u),R(d,r,u),R(d,a,u),R(d,s,u),R(d,o,u),R(d,l,u),c||(h=Y(r,"click",t[9]),c=!0)},p:d,d(t){t&&(F(e),F(i),F(n),F(r),F(a),F(s),F(o),F(l)),c=!1,h()}}}function Ec(t){var e,i;return(e=new Cc({props:{file:t[3]}})).$on("reload",t[22]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};8&i&&(n.file=t[3]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function jc(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p,g,m,x,_,y,w,k,$,M,C,S,T,P,D,L=("video/x-matroska"===t[3].mime_type||"video/quicktime"===t[3].mime_type||"video/x-ms-asf"===t[3].mime_type)&&Ic(),z=t[0]&&Rc(t);function A(t,e){return t[5]?Hc:Fc}var E=A(t),j=E(t),I=t[0]&&Nc(t);function H(t,e){return t[4]&&t[4].muted?Bc:Vc}var V=H(t),B=V(t);return{c(){e=N("div"),L&&L.c(),i=W(),n=N("div"),r=N("video"),a=N("source"),l=W(),c=N("div"),d=N("div"),h=W(),z&&z.c(),u=W(),(f=N("button")).innerHTML='replay_10',p=W(),g=N("button"),j.c(),m=W(),(x=N("button")).innerHTML='forward_10',_=W(),I&&I.c(),y=W(),w=N("div"),k=W(),$=N("button"),B.c(),M=W(),(C=N("button")).innerHTML='fullscreen',S=W(),T=N("div"),b(a.src,s=t[3].get_href)||G(a,"src",s),G(a,"type",o=t[3].mime_type),r.controls=!0,r.playsInline=!0,r.loop=t[7],G(r,"class","player svelte-1fg9p5f"),G(d,"class","spacer svelte-1fg9p5f"),G(f,"class","svelte-1fg9p5f"),G(g,"class","button_highlight svelte-1fg9p5f"),G(x,"class","svelte-1fg9p5f"),Q(w,"width","16px"),Q(w,"height","8px"),G(w,"class","svelte-1fg9p5f"),G($,"class","svelte-1fg9p5f"),tt($,"button_red",t[4]&&t[4].muted),G(C,"class","svelte-1fg9p5f"),G(T,"class","spacer svelte-1fg9p5f"),G(c,"class","controls svelte-1fg9p5f"),G(n,"class","player_and_controls svelte-1fg9p5f"),G(e,"class","container svelte-1fg9p5f")},m(s,o){R(s,e,o),L&&L.m(e,null),O(e,i),O(e,n),O(n,r),O(r,a),t[14](r),O(n,l),O(n,c),O(c,d),O(c,h),z&&z.m(c,null),O(c,u),O(c,f),O(c,p),O(c,g),j.m(g,null),O(c,m),O(c,x),O(c,_),I&&I.m(c,null),O(c,y),O(c,w),O(c,k),O(c,$),B.m($,null),O(c,M),O(c,C),O(c,S),O(c,T),P||(D=[Y(r,"pause",t[15]),Y(r,"play",t[16]),Y(r,"ended",t[17]),Y(f,"click",t[19]),Y(g,"click",t[1]),Y(x,"click",t[20]),Y($,"click",t[10]),Y(C,"click",t[11])],P=!0)},p(t,n){"video/x-matroska"===t[3].mime_type||"video/quicktime"===t[3].mime_type||"video/x-ms-asf"===t[3].mime_type?L||((L=Ic()).c(),L.m(e,i)):L&&(L.d(1),L=null),8&n&&!b(a.src,s=t[3].get_href)&&G(a,"src",s),8&n&&o!==(o=t[3].mime_type)&&G(a,"type",o),128&n&&(r.loop=t[7]),t[0]?z?z.p(t,n):((z=Rc(t)).c(),z.m(c,u)):z&&(z.d(1),z=null),E!==(E=A(t))&&(j.d(1),(j=E(t))&&(j.c(),j.m(g,null))),t[0]?I?I.p(t,n):((I=Nc(t)).c(),I.m(c,y)):I&&(I.d(1),I=null),V!==(V=H(t))&&(B.d(1),(B=V(t))&&(B.c(),B.m($,null))),16&n&&tt($,"button_red",t[4]&&t[4].muted)},d(i){i&&F(e),L&&L.d(),t[14](null),z&&z.d(),j.d(),I&&I.d(),B.d(),P=!1,v(D)}}}function Ic(t){var e;return{c(){(e=N("div")).textContent="This video file type is not compatible with every web\n\t\t\t\t\tbrowser. If the video fails to play you can try downloading\n\t\t\t\t\tthe video and watching it locally.",G(e,"class","compatibility_warning svelte-1fg9p5f")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Rc(t){var e,i,n;return{c(){(e=N("button")).innerHTML='skip_previous',G(e,"class","svelte-1fg9p5f")},m(r,a){R(r,e,a),i||(n=Y(e,"click",t[18]),i=!0)},p:d,d(t){t&&F(e),i=!1,n()}}}function Fc(t){var e;return{c(){(e=N("i")).textContent="play_arrow",G(e,"class","icon")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Hc(t){var e;return{c(){(e=N("i")).textContent="pause",G(e,"class","icon")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Nc(t){var e,i,n;return{c(){(e=N("button")).innerHTML='skip_next',G(e,"class","svelte-1fg9p5f")},m(r,a){R(r,e,a),i||(n=Y(e,"click",t[21]),i=!0)},p:d,d(t){t&&F(e),i=!1,n()}}}function Vc(t){var e;return{c(){(e=N("i")).textContent="volume_up",G(e,"class","icon")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Bc(t){var e;return{c(){(e=N("i")).textContent="volume_off",G(e,"class","icon")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Wc(t){var e,i,n,r,a,s,o=[Oc,zc],c=[];function d(t,e){return t[3].allow_video_player?0:1}return e=d(t),i=c[e]=o[e](t),{c(){i.c(),n=q()},m(i,o){c[e].m(i,o),R(i,n,o),r=!0,a||(s=Y(window,"keypress",t[12]),a=!0)},p(t,r){var a=l(r,1)[0],s=e;(e=d(t))===s?c[e].p(t,a):(Dt(),Ot(c[s],1,1,(()=>{c[s]=null})),Lt(),(i=c[e])?i.p(t,a):(i=c[e]=o[e](t)).c(),zt(i,1),i.m(n.parentNode,n))},i(t){r||(zt(i),r=!0)},o(t){Ot(i),r=!1},d(t){t&&F(n),c[e].d(t),a=!1,s()}}}function qc(t,e,n){var r,a,s=ht(),l=e.is_list,c=void 0!==l&&l,d={id:"",size:0,name:"",mime_type:"",get_href:"",icon_href:"",allow_video_player:!0,show_ads:!1,download_speed_limit:0},h=!1,u=!1,f=!1,p=function(){var t=i(o().mark((function t(e){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.id==d.id,n(3,d=e),f&&(navigator.mediaSession.metadata=new MediaMetadata({title:d.name,artist:"pixeldrain",album:"unknown"}),console.log("updating media session")),i){t.next=8;break}return n(6,u=!0),t.next=7,_t();case 7:n(6,u=!1);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),v=t=>{a.fastSeek&&t>5?a.fastSeek(a.currentTime+t):n(4,a.currentTime=a.currentTime+t,a)};dt((()=>{"mediaSession"in navigator&&(f=!0,navigator.mediaSession.setActionHandler("play",(()=>a.play())),navigator.mediaSession.setActionHandler("pause",(()=>a.pause())),navigator.mediaSession.setActionHandler("stop",(()=>a.stop())),navigator.mediaSession.setActionHandler("previoustrack",(()=>s("prev",{}))),navigator.mediaSession.setActionHandler("nexttrack",(()=>s("next",{}))))}));var g=()=>{a.requestFullscreen()};return t.$$set=t=>{"is_list"in t&&n(0,c=t.is_list)},t.$$.update=()=>{8&t.$$.dirty&&n(7,r=d.name.includes(".loop."))},[c,()=>{h?a.pause():a.play()},v,d,a,h,u,r,s,()=>{s("download",{})},()=>{a.muted?n(4,a.muted=!1,a):n(4,a.muted=!0,a)},g,t=>{t.ctrlKey||t.altKey||t.metaKey||document.activeElement.type&&("text"===document.activeElement.type||"email"===document.activeElement.type||"textarea"===document.activeElement.type)||"f"===t.key&&g()},p,function(t){pt[t?"unshift":"push"]((()=>{n(4,a=t)}))},()=>n(5,h=!1),()=>n(5,h=!0),()=>s("next",{}),()=>s("prev"),()=>v(-10),()=>v(10),()=>s("next"),function(e){ut.call(this,t,e)}]}class Yc extends Wt{constructor(t){super(),Bt(this,t,qc,Wc,m,{is_list:0,set_file:13,toggle_playback:1,seek:2},Lc)}get set_file(){return this.$$.ctx[13]}get toggle_playback(){return this.$$.ctx[1]}get seek(){return this.$$.ctx[2]}}function Uc(t){A(t,"svelte-xeankq","h1.svelte-xeankq{text-shadow:1px 1px 2px #000000;line-break:anywhere}")}function Xc(t){var e,i;return{c(){e=N("h1"),i=B(t[0]),G(e,"class","svelte-xeankq")},m(t,n){R(t,e,n),O(e,i)},p(t,e){1&l(e,1)[0]&&Z(i,t[0])},i:d,o:d,d(t){t&&F(e)}}}function Gc(t,e,i){var n=e.title,r=void 0===n?"":n;return t.$$set=t=>{"title"in t&&i(0,r=t.title)},[r]}class Kc extends Wt{constructor(t){super(),Bt(this,t,Gc,Xc,m,{title:0},Uc)}}function Zc(t){A(t,"svelte-m3fqwd",".container.svelte-m3fqwd{width:100%;margin:30px 0 0 0;padding:0;text-align:center}.player.svelte-m3fqwd{width:90%}")}function Jc(t){var e,i,n;return{c(){(e=N("button")).innerHTML='skip_previous'},m(r,a){R(r,e,a),i||(n=Y(e,"click",t[10]),i=!0)},p:d,d(t){t&&F(e),i=!1,n()}}}function Qc(t){var e;return{c(){(e=N("i")).textContent="play_arrow",G(e,"class","icon")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function td(t){var e;return{c(){(e=N("i")).textContent="pause",G(e,"class","icon")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function ed(t){var e,i,n;return{c(){(e=N("button")).innerHTML='skip_next'},m(r,a){R(r,e,a),i||(n=Y(e,"click",t[13]),i=!0)},p:d,d(t){t&&F(e),i=!1,n()}}}function id(t){var e,i,n,r,a,s;return{c(){e=N("audio"),b((i=N("source")).src,n=t[2].get_href)||G(i,"src",n),G(i,"type",r=t[2].mime_type),G(e,"class","player svelte-m3fqwd"),e.controls=!0,G(e,"playsinline",""),e.autoplay=!0,e.loop=t[6]},m(n,r){R(n,e,r),O(e,i),t[14](e),a||(s=[Y(e,"pause",t[15]),Y(e,"play",t[16]),Y(e,"ended",t[17])],a=!0)},p(t,a){4&a&&!b(i.src,n=t[2].get_href)&&G(i,"src",n),4&a&&r!==(r=t[2].mime_type)&&G(i,"type",r),64&a&&(e.loop=t[6])},d(i){i&&F(e),t[14](null),a=!1,v(s)}}}function nd(t){var e,i;return(e=new Cc({props:{file:t[2]}})).$on("reload",t[18]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};4&i&&(n.file=t[2]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function rd(t){var e,i,n,r,a,s,o,c,d,h,u,f,p,g,m,b,x,_,y,w,k;i=new Kc({props:{title:t[2].name}});var $=t[0]&&Jc(t);function M(t,e){return t[4]?td:Qc}var C=M(t),S=C(t),T=t[0]&&ed(t),P=t[2].id&&!t[5]&&id(t),D=t[2].show_ads&&nd(t);return{c(){e=N("div"),Ht(i.$$.fragment),n=W(),$&&$.c(),r=W(),(a=N("button")).innerHTML='replay_10',s=W(),o=N("button"),S.c(),c=W(),(d=N("button")).innerHTML='forward_10',h=W(),T&&T.c(),u=W(),f=N("br"),p=N("br"),g=W(),P&&P.c(),m=W(),b=N("br"),x=N("br"),_=W(),D&&D.c(),G(e,"class","container svelte-m3fqwd")},m(l,v){R(l,e,v),Nt(i,e,null),O(e,n),$&&$.m(e,null),O(e,r),O(e,a),O(e,s),O(e,o),S.m(o,null),O(e,c),O(e,d),O(e,h),T&&T.m(e,null),O(e,u),O(e,f),O(e,p),O(e,g),P&&P.m(e,null),O(e,m),O(e,b),O(e,x),O(e,_),D&&D.m(e,null),y=!0,w||(k=[Y(a,"click",t[11]),Y(o,"click",t[1]),Y(d,"click",t[12])],w=!0)},p(t,n){var a=l(n,1)[0],s={};4&a&&(s.title=t[2].name),i.$set(s),t[0]?$?$.p(t,a):(($=Jc(t)).c(),$.m(e,r)):$&&($.d(1),$=null),C!==(C=M(t))&&(S.d(1),(S=C(t))&&(S.c(),S.m(o,null))),t[0]?T?T.p(t,a):((T=ed(t)).c(),T.m(e,u)):T&&(T.d(1),T=null),t[2].id&&!t[5]?P?P.p(t,a):((P=id(t)).c(),P.m(e,m)):P&&(P.d(1),P=null),t[2].show_ads?D?(D.p(t,a),4&a&&zt(D,1)):((D=nd(t)).c(),zt(D,1),D.m(e,null)):D&&(Dt(),Ot(D,1,1,(()=>{D=null})),Lt())},i(t){y||(zt(i.$$.fragment,t),zt(D),y=!0)},o(t){Ot(i.$$.fragment,t),Ot(D),y=!1},d(t){t&&F(e),Vt(i),$&&$.d(),S.d(),T&&T.d(),P&&P.d(),D&&D.d(),w=!1,v(k)}}}function ad(t,e,n){var r,a,s=ht(),l=e.is_list,c=void 0!==l&&l,d={id:"",name:"",mime_type:"",get_href:"",show_ads:!1,download_speed_limit:0},h=!1,u=!1,f=function(){var t=i(o().mark((function t(e){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.id==d.id,n(2,d=e),"mediaSession"in navigator&&(navigator.mediaSession.setActionHandler("play",(()=>a.play())),navigator.mediaSession.setActionHandler("pause",(()=>a.pause())),navigator.mediaSession.setActionHandler("stop",(()=>a.stop())),navigator.mediaSession.setActionHandler("previoustrack",(()=>s("prev",{}))),navigator.mediaSession.setActionHandler("nexttrack",(()=>s("next",{}))),navigator.mediaSession.metadata=new MediaMetadata({title:d.name,artist:"pixeldrain",album:"unknown"}),console.log("updating media session")),i){t.next=8;break}return n(5,u=!0),t.next=7,_t();case 7:n(5,u=!1);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return t.$$set=t=>{"is_list"in t&&n(0,c=t.is_list)},t.$$.update=()=>{4&t.$$.dirty&&n(6,r=d.name.includes(".loop."))},[c,()=>{h?a.pause():a.play()},d,a,h,u,r,s,f,t=>{a.fastSeek&&t>5?a.fastSeek(a.currentTime+t):n(3,a.currentTime=a.currentTime+t,a)},()=>s("prev"),()=>n(3,a.currentTime-=10,a),()=>n(3,a.currentTime+=10,a),()=>s("next"),function(t){pt[t?"unshift":"push"]((()=>{n(3,a=t)}))},()=>n(4,h=!1),()=>n(4,h=!0),()=>{s("next",{})},function(e){ut.call(this,t,e)}]}class sd extends Wt{constructor(t){super(),Bt(this,t,ad,rd,m,{is_list:0,set_file:8,toggle_playback:1,seek:9},Zc)}get set_file(){return this.$$.ctx[8]}get toggle_playback(){return this.$$.ctx[1]}get seek(){return this.$$.ctx[9]}}var od=(t,e)=>{var i=0,n=0,r=0,a=void 0===e.enabled||e.enabled,s=void 0===e.prev||e.prev,o=void 0===e.next||e.next,l=t=>{i=t.touches[0].clientX,n=t.touches[0].clientY,r=0},c=t=>{var e=t.touches[0].clientX-i;if(!(!a||e<0&&!o||e>0&&!s)){var r=Math.abs(e),l=Math.abs(t.touches[0].clientY-n);r>25&&l{a&&(r>75?(h(1e3,!0),t.dispatchEvent(new CustomEvent("prev"))):r<-75?(h(-1e3,!0),t.dispatchEvent(new CustomEvent("next"))):h(0,!0))},h=(e,i)=>{r=e,0===e?(t.style.transform="",t.style.transition=""):(t.style.transform="translateX("+e+"px)",i&&(t.style.transition="transform 400ms"))};t.addEventListener("touchstart",l),t.addEventListener("touchmove",c),t.addEventListener("touchend",d);for(var u=0;uh(0,!1)))}return{update(t){a=void 0===t.enabled||t.enabled,s=void 0===t.prev||t.prev,o=void 0===t.next||t.next,h(0,!1)},destroy(){t.removeEventListener("touchstart",l),t.removeEventListener("touchmove",c),t.removeEventListener("touchend",d)}}};function ld(t){A(t,"svelte-15prjjn",".container.svelte-15prjjn{display:flex;justify-content:center;height:100%;width:100%;overflow:hidden}.container.zoom.svelte-15prjjn{overflow:auto;justify-content:unset}.image.svelte-15prjjn{position:relative;display:block;margin:auto;max-width:100%;max-height:100%;cursor:pointer}.image.zoom.svelte-15prjjn{max-width:none;max-height:none;cursor:move}")}function cd(t){var e,i,n,r,a,s,o;return{c(){e=N("div"),G(i=N("img"),"class","image svelte-15prjjn"),b(i.src,n=t[1].get_href)||G(i,"src",n),G(i,"alt",r=t[1].name),tt(i,"zoom",t[3]),G(e,"class","container svelte-15prjjn"),tt(e,"zoom",t[3])},m(n,r){R(n,e,r),O(e,i),t[12](e),s||(o=[Y(window,"mousemove",t[6]),Y(window,"mouseup",t[7]),Y(i,"load",t[8]),Y(i,"error",t[8]),Y(i,"dblclick",t[4]),Y(i,"doubletap",t[4]),Y(i,"mousedown",t[5]),M(a=od.call(null,e,{enabled:!t[3]&&t[0]})),Y(e,"prev",t[10]),Y(e,"next",t[11])],s=!0)},p(t,s){var o=l(s,1)[0];2&o&&!b(i.src,n=t[1].get_href)&&G(i,"src",n),2&o&&r!==(r=t[1].name)&&G(i,"alt",r),8&o&&tt(i,"zoom",t[3]),a&&g(a.update)&&9&o&&a.update.call(null,{enabled:!t[3]&&t[0]}),8&o&&tt(e,"zoom",t[3])},i:d,o:d,d(i){i&&F(e),t[12](null),s=!1,v(o)}}}function dd(t,e,i){var n,r,a=ht(),s={id:"",name:"",mime_type:"",get_href:""},o=e.is_list,l=void 0!==o&&o,c=!1,d=0,h=!1,u=0;return t.$$set=t=>{"is_list"in t&&i(0,l=t.is_list)},[l,s,n,c,t=>{var e=Date.now();e-u>500&&i(3,c=!c),u=e},t=>{if(!h&&1===t.which&&c)return r=t.pageX,d=t.pageY,h=!0,t.preventDefault(),t.stopPropagation(),!1},t=>{if(h)return i(2,n.scrollLeft=n.scrollLeft-(t.pageX-r),n),i(2,n.scrollTop=n.scrollTop-(t.pageY-d),n),r=t.pageX,d=t.pageY,t.preventDefault(),t.stopPropagation(),!1},t=>{if(h)return h=!1,t.preventDefault(),t.stopPropagation(),!1},()=>a("loading",!1),t=>{i(1,s=t),a("loading",!0)},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(t){pt[t?"unshift":"push"]((()=>{i(2,n=t)}))}]}class hd extends Wt{constructor(t){super(),Bt(this,t,dd,cd,m,{set_file:9,is_list:0},ld)}get set_file(){return this.$$.ctx[9]}}function ud(t){A(t,"svelte-1dhzsqz",".container.svelte-1dhzsqz{position:relative;display:block;height:100%;width:100%;text-align:center;overflow:hidden;border:none}")}function fd(t){var e,i;return{c(){G(e=N("iframe"),"class","container svelte-1dhzsqz"),b(e.src,i="/res/misc/pdf-viewer/web/viewer.html?file="+encodeURIComponent(t[0].get_href))||G(e,"src",i),G(e,"title","PDF viewer")},m(t,i){R(t,e,i)},p(t,n){1&l(n,1)[0]&&!b(e.src,i="/res/misc/pdf-viewer/web/viewer.html?file="+encodeURIComponent(t[0].get_href))&&G(e,"src",i)},i:d,o:d,d(t){t&&F(e)}}}function pd(t,e,i){var n={get_href:""};return[n,t=>i(0,n=t)]}class vd extends Wt{constructor(t){super(),Bt(this,t,pd,fd,m,{set_file:1},ud)}get set_file(){return this.$$.ctx[1]}}function gd(t){A(t,"svelte-1cdvqtq",".container.svelte-1cdvqtq.svelte-1cdvqtq{background:var(--body_color);text-align:left;height:100%;width:100%;line-height:1.5em;overflow-y:auto;overflow-x:hidden}.container.svelte-1cdvqtq>pre.svelte-1cdvqtq{margin:0;padding:10px;white-space:pre-wrap;overflow:hidden;border:none;font-size:0.9em;word-break:break-word}.container.svelte-1cdvqtq>.md.svelte-1cdvqtq{display:block;padding:10px;margin:auto;text-align:justify}")}function md(t){var e;return{c(){(e=N("pre")).textContent="\t\t\tLoading...\n\t\t",G(e,"class","pre-container prettyprint linenums svelte-1cdvqtq")},m(i,n){R(i,e,n),t[8](e)},p:d,d(i){i&&F(e),t[8](null)}}}function bd(t){var e;return{c(){(e=N("pre")).textContent="\t\t\tLoading...\n\t\t",G(e,"class","svelte-1cdvqtq")},m(i,n){R(i,e,n),t[7](e)},p:d,d(i){i&&F(e),t[7](null)}}}function xd(t){var e;return{c(){(e=N("section")).textContent="Loading...",G(e,"class","md svelte-1cdvqtq")},m(i,n){R(i,e,n),t[6](e)},p:d,d(i){i&&F(e),t[6](null)}}}function _d(t){var e;function i(t,e){return"markdown"===t[1]?xd:"text"===t[1]?bd:"code"===t[1]?md:void 0}var n=i(t),r=n&&n(t);return{c(){e=N("div"),r&&r.c(),G(e,"class","container svelte-1cdvqtq")},m(i,n){R(i,e,n),r&&r.m(e,null),t[9](e)},p(t,a){var s=l(a,1)[0];n===(n=i(t))&&r?r.p(t,s):(r&&r.d(1),(r=n&&n(t))&&(r.c(),r.m(e,null)))},i:d,o:d,d(i){i&&F(e),r&&r.d(),t[9](null)}}}function yd(t,e,n){var r,a,s,l,c="",d=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n(1,c="markdown"),t.next=3,_t();case 3:fetch("/u/"+e.id+"/preview").then((t=>t.ok?t.text():Promise.reject(t.status))).then((t=>{n(2,a.innerHTML=t,a)})).catch((t=>{n(2,a.innerText="Error loading file: "+t,a)}));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),h=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n(1,c="text"),t.next=3,_t();case 3:if(!(e.size>1<<22)){t.next=6;break}return n(3,s.innerText="File is too large to view online.\nPlease download and view it locally.",s),t.abrupt("return");case 6:fetch(e.get_href).then((t=>t.ok?t.text():Promise.reject(t.status))).then((t=>{n(3,s.innerText=t,s)})).catch((t=>{n(3,s.innerText="Error loading file: "+t,s)}));case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),u=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n(1,c="code"),t.next=3,_t();case 3:if(!(e.size>1<<22)){t.next=6;break}return n(4,l.innerText="File is too large to view online.\nPlease download and view it locally.",l),t.abrupt("return");case 6:fetch(e.get_href).then((t=>t.ok?t.text():Promise.reject(t.status))).then((t=>{n(4,l.innerText=t,l);var e=document.createElement("script");e.src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js?skin=desert",r.appendChild(e),e=!0})).catch((t=>{n(4,l.innerText="Error loading file: "+t,l)}));case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return[r,c,a,s,l,t=>{console.log("loading text file",t.id),t.name.endsWith(".md")||t.name.endsWith(".markdown")?d(t):t.name.endsWith(".txt")||t.size>524288?h(t):u(t)},function(t){pt[t?"unshift":"push"]((()=>{n(2,a=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(3,s=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(4,l=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(0,r=t)}))}]}class wd extends Wt{constructor(t){super(),Bt(this,t,yd,_d,m,{set_file:5},gd)}get set_file(){return this.$$.ctx[5]}}function kd(t){var e,i,n,r,a,s,o,l,c,d,h,u,f=t[0].mime_type+"",p=be(t[0].size,3)+"";return{c(){e=B("Type: "),i=B(f),n=N("br"),r=B("\n\tSize: "),a=B(p),s=N("br"),o=B("\n\tNo preview is available for this file type. Download to view it locally.\n\t"),l=N("br"),c=W(),(d=N("button")).innerHTML='download Download',G(d,"class","button_highlight")},m(f,p){R(f,e,p),R(f,i,p),R(f,n,p),R(f,r,p),R(f,a,p),R(f,s,p),R(f,o,p),R(f,l,p),R(f,c,p),R(f,d,p),h||(u=Y(d,"click",t[3]),h=!0)},p(t,e){1&e&&f!==(f=t[0].mime_type+"")&&Z(i,f),1&e&&p!==(p=be(t[0].size,3)+"")&&Z(a,p)},d(t){t&&(F(e),F(i),F(n),F(r),F(a),F(s),F(o),F(l),F(c),F(d)),h=!1,u()}}}function $d(t){var e,i;return(e=new Cc({props:{file:t[0]}})).$on("reload",t[4]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};1&i&&(n.file=t[0]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function Md(t){var e,i,n,r,a,s;e=new Kc({props:{title:t[0].name}}),n=new Dc({props:{icon_href:t[0].icon_href,$$slots:{default:[kd]},$$scope:{ctx:t}}});var o=t[0].show_ads&&$d(t);return{c(){Ht(e.$$.fragment),i=W(),Ht(n.$$.fragment),r=W(),o&&o.c(),a=q()},m(t,l){Nt(e,t,l),R(t,i,l),Nt(n,t,l),R(t,r,l),o&&o.m(t,l),R(t,a,l),s=!0},p(t,i){var r=l(i,1)[0],s={};1&r&&(s.title=t[0].name),e.$set(s);var c={};1&r&&(c.icon_href=t[0].icon_href),33&r&&(c.$$scope={dirty:r,ctx:t}),n.$set(c),t[0].show_ads?o?(o.p(t,r),1&r&&zt(o,1)):((o=$d(t)).c(),zt(o,1),o.m(a.parentNode,a)):o&&(Dt(),Ot(o,1,1,(()=>{o=null})),Lt())},i(t){s||(zt(e.$$.fragment,t),zt(n.$$.fragment,t),zt(o),s=!0)},o(t){Ot(e.$$.fragment,t),Ot(n.$$.fragment,t),Ot(o),s=!1},d(t){t&&(F(i),F(r),F(a)),Vt(e,t),Vt(n,t),o&&o.d(t)}}}function Cd(t,e,i){var n=ht(),r={id:"",size:0,name:"",mime_type:"",icon_href:"",show_ads:!1,download_speed_limit:0};return[r,n,t=>i(0,r=t),()=>{n("download")},function(e){ut.call(this,t,e)}]}class Sd extends Wt{constructor(t){super(),Bt(this,t,Cd,Md,m,{set_file:2})}get set_file(){return this.$$.ctx[2]}}function Td(t){var e;return{c(){e=B("The file was reported through pixeldrain's abuse e-mail address.")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Pd(t){var e;return{c(){e=B("The file was reported by users of pixeldrain with the report button\n\t\t\tin the toolbar.")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Dd(t){var e,i,n,r,a,s,o,l,c,d,h,u,f=t[0].abuse_type+"";function p(t,e){return"User submitted reports"===t[0].abuse_reporter_name?Pd:Td}var v=p(t),g=v(t);return{c(){(e=N("h2")).textContent="Unavailable for legal reasons",i=W(),n=N("p"),r=B("This file has been removed for violating pixeldrain's\n\t\t"),(a=N("a")).textContent="content policy",s=B(". Type of abuse: "),o=B(f),l=B("."),c=W(),d=N("p"),g.c(),h=W(),(u=N("p")).textContent="Pixeldrain has zero tolerance towards abuse. The IP address this file\n\t\toriginated from has been banned and is no longer able to upload files to\n\t\tpixeldrain.",G(a,"href","/abuse")},m(t,f){R(t,e,f),R(t,i,f),R(t,n,f),O(n,r),O(n,a),O(n,s),O(n,o),O(n,l),R(t,c,f),R(t,d,f),g.m(d,null),R(t,h,f),R(t,u,f)},p(t,e){1&e&&f!==(f=t[0].abuse_type+"")&&Z(o,f),v!==(v=p(t))&&(g.d(1),(g=v(t))&&(g.c(),g.m(d,null)))},d(t){t&&(F(e),F(i),F(n),F(c),F(d),F(h),F(u)),g.d()}}}function Ld(t){var e,i;return e=new Dc({props:{icon_href:t[0].icon_href,$$slots:{default:[zd]},$$scope:{ctx:t}}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};1&i&&(n.icon_href=t[0].icon_href),16&i&&(n.$$scope={dirty:i,ctx:t}),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function zd(t){var e,i,n,r,a,s;return{c(){e=B("This file cannot be shared, but since you are the uploader of the file\n\t\tyou can still download it.\n\t\t"),i=N("br"),n=W(),(r=N("button")).innerHTML='download Download',G(r,"class","button_highlight")},m(o,l){R(o,e,l),R(o,i,l),R(o,n,l),R(o,r,l),a||(s=Y(r,"click",t[3]),a=!0)},p:d,d(t){t&&(F(e),F(i),F(n),F(r)),a=!1,s()}}}function Od(t){var e,i,n,r,a,s;e=new Kc({props:{title:t[0].name}}),n=new sc({props:{$$slots:{default:[Dd]},$$scope:{ctx:t}}});var o=t[0].can_download&&Ld(t);return{c(){Ht(e.$$.fragment),i=W(),Ht(n.$$.fragment),r=W(),o&&o.c(),a=q()},m(t,l){Nt(e,t,l),R(t,i,l),Nt(n,t,l),R(t,r,l),o&&o.m(t,l),R(t,a,l),s=!0},p(t,i){var r=l(i,1)[0],s={};1&r&&(s.title=t[0].name),e.$set(s);var c={};17&r&&(c.$$scope={dirty:r,ctx:t}),n.$set(c),t[0].can_download?o?(o.p(t,r),1&r&&zt(o,1)):((o=Ld(t)).c(),zt(o,1),o.m(a.parentNode,a)):o&&(Dt(),Ot(o,1,1,(()=>{o=null})),Lt())},i(t){s||(zt(e.$$.fragment,t),zt(n.$$.fragment,t),zt(o),s=!0)},o(t){Ot(e.$$.fragment,t),Ot(n.$$.fragment,t),Ot(o),s=!1},d(t){t&&(F(i),F(r),F(a)),Vt(e,t),Vt(n,t),o&&o.d(t)}}}function Ad(t,e,i){var n=ht(),r={id:"",name:"",abuse_type:"",abuse_reporter_name:"",can_download:!1,icon_href:""};return[r,n,t=>i(0,r=t),()=>{n("download")}]}class Ed extends Wt{constructor(t){super(),Bt(this,t,Ad,Od,m,{set_file:2})}get set_file(){return this.$$.ctx[2]}}function jd(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p,v,g=t[1].limits.download_limit+"",m=be(t[1].limits.transfer_limit,3)+"",b=t[1].limits.download_limit_used+"",x=be(t[1].limits.transfer_limit_used,3)+"";return{c(){(e=N("h1")).innerHTML='file_download_off\n\t\t\tDownload limit reached',i=W(),n=N("p"),r=B("You have reached your download limit for today. Without a pixeldrain\n\t\t\taccount you are limited to downloading "),a=B(g),s=B(" files\n\t\t\tor "),o=B(m),l=B(" per 48 hours. This limit\n\t\t\tis counted per IP address, so if you're on a shared network it's\n\t\t\tpossible that others have also contributed to this limit."),c=W(),d=N("p"),h=B("In the last 24 hours you have downloaded\n\t\t\t"),u=B(b),f=B(" files and used\n\t\t\t"),p=B(x),v=B(" bandwidth.")},m(t,g){R(t,e,g),R(t,i,g),R(t,n,g),O(n,r),O(n,a),O(n,s),O(n,o),O(n,l),R(t,c,g),R(t,d,g),O(d,h),O(d,u),O(d,f),O(d,p),O(d,v)},p(t,e){2&e&&g!==(g=t[1].limits.download_limit+"")&&Z(a,g),2&e&&m!==(m=be(t[1].limits.transfer_limit,3)+"")&&Z(o,m),2&e&&b!==(b=t[1].limits.download_limit_used+"")&&Z(u,b),2&e&&x!==(x=be(t[1].limits.transfer_limit_used,3)+"")&&Z(p,x)},d(t){t&&(F(e),F(i),F(n),F(c),F(d))}}}function Id(t){var e,i,n;return{c(){(e=N("h1")).innerHTML='file_download_off\n\t\t\tHotlink protection enabled',i=W(),(n=N("p")).innerHTML='Hotlinking protection has been enabled for this file. This happens when\n\t\t\ta file is downloaded many times outside of our file viewer page (this\n\t\t\tpage). Usually this means people are using download managers like\n\t\t\tJDownloader 2, Aria2 or wget. Using a download manager circumvents\n\t\t\tpixeldrain's advertisements and we lose money because of that. More\n\t\t\tinformation about this protection mechanism can be found on the home page.'},m(t,r){R(t,e,r),R(t,i,r),R(t,n,r)},p:d,d(t){t&&(F(e),F(i),F(n))}}}function Rd(t){var e,i,n,r,a,s;function o(t,e){return"file_rate_limited_captcha_required"===t[0].availability?Id:"ip_download_limited_captcha_required"===t[0].availability?jd:void 0}var l=o(t),c=l&&l(t);return{c(){c&&c.c(),e=W(),(i=N("p")).innerHTML='This warning disappears when you have a\n\t\tpremium account\n\t\tor when the uploader of the file enables\n\t\tbandwidth sharing on their Pro account\n\t\t(and their data cap has not been used up). Using a download manager with\n\t\ta Pro account is allowed, it will not trigger this warning for other\n\t\tfiles.',n=W(),(r=N("h2")).textContent="Continue downloading",a=W(),(s=N("p")).textContent="The file can be downloaded like usual by clicking the download button.\n\t\tYou will have to complete a CAPTCHA test to prove that you're not a\n\t\trobot."},m(t,o){c&&c.m(t,o),R(t,e,o),R(t,i,o),R(t,n,o),R(t,r,o),R(t,a,o),R(t,s,o)},p(t,i){l===(l=o(t))&&c?c.p(t,i):(c&&c.d(1),(c=l&&l(t))&&(c.c(),c.m(e.parentNode,e)))},d(t){t&&(F(e),F(i),F(n),F(r),F(a),F(s)),c&&c.d(t)}}}function Fd(t){var e,i,n,r,a,s,o,l,c,d,h,u,f=t[0].name+"",p=t[0].mime_type+"";return{c(){e=B("Name: "),i=B(f),n=N("br"),r=B("\n\tType: "),a=B(p),s=N("br"),o=W(),(l=N("button")).innerHTML='download Download',c=W(),(d=N("a")).innerHTML='bolt Upgrade your account',G(d,"href","/#pro"),G(d,"target","_blank"),G(d,"class","button button_highlight")},m(f,p){R(f,e,p),R(f,i,p),R(f,n,p),R(f,r,p),R(f,a,p),R(f,s,p),R(f,o,p),R(f,l,p),R(f,c,p),R(f,d,p),h||(u=Y(l,"click",t[4]),h=!0)},p(t,e){1&e&&f!==(f=t[0].name+"")&&Z(i,f),1&e&&p!==(p=t[0].mime_type+"")&&Z(a,p)},d(t){t&&(F(e),F(i),F(n),F(r),F(a),F(s),F(o),F(l),F(c),F(d)),h=!1,u()}}}function Hd(t){var e,i,n,r;return e=new sc({props:{$$slots:{default:[Rd]},$$scope:{ctx:t}}}),n=new Dc({props:{icon_href:t[0].icon_href,$$slots:{default:[Fd]},$$scope:{ctx:t}}}),{c(){Ht(e.$$.fragment),i=W(),Ht(n.$$.fragment)},m(t,a){Nt(e,t,a),R(t,i,a),Nt(n,t,a),r=!0},p(t,i){var r=l(i,1)[0],a={};35&r&&(a.$$scope={dirty:r,ctx:t}),e.$set(a);var s={};1&r&&(s.icon_href=t[0].icon_href),33&r&&(s.$$scope={dirty:r,ctx:t}),n.$set(s)},i(t){r||(zt(e.$$.fragment,t),zt(n.$$.fragment,t),r=!0)},o(t){Ot(e.$$.fragment,t),Ot(n.$$.fragment,t),r=!1},d(t){t&&F(i),Vt(e,t),Vt(n,t)}}}function Nd(t,e,i){var n;x(t,vc,(t=>i(1,n=t)));var r=ht(),a={name:"",mime_type:"",availability:""};return[a,n,r,t=>i(0,a=t),()=>{r("download")}]}class Vd extends Wt{constructor(t){super(),Bt(this,t,Nd,Hd,m,{set_file:3})}get set_file(){return this.$$.ctx[3]}}function Bd(t){var e,i,n,r;return{c(){e=V("svg"),i=V("path"),n=V("path"),r=V("path"),G(i,"fill","currentColor"),G(i,"d","M132.138,855.425c43,43,93.2,76.301,149.3,99.101c54.1,21.899,111.1,33,169.6,33s115.601-11.101,169.601-33\n\t\tc56-22.7,106.199-56,149.3-99.101l60.899-60.899l-176.8-176.8l-60.899,60.899c-38,38-88.4,58.9-142.101,58.9\n\t\ts-104.2-20.9-142.1-58.9c-78.4-78.399-78.4-205.899,0-284.3l60.899-60.899l-176.8-176.7l-60.9,60.899\n\t\tc-43,43-76.3,93.2-99.1,149.301c-21.9,54.1-33,111.1-33,169.6s11.1,115.6,33,169.6C55.738,762.226,89.038,812.425,132.138,855.425z\n\t\t"),G(n,"fill","currentColor"),G(n,"d","M878.038,478.625c-23.399-23.399-61.399-23.399-84.899,0l-82.601,82.601l176.8,176.8l82.601-82.601\n\t\tc23.399-23.399,23.399-61.399,0-84.899L878.038,478.625z"),G(r,"fill","currentColor"),G(r,"d","M332.139,17.625l-82.601,82.601l176.8,176.8l82.601-82.6c23.399-23.4,23.399-61.4,0-84.9l-91.9-91.9\n\t\tC393.538-5.875,355.639-5.875,332.139,17.625z"),G(e,"style",t[0]),G(e,"xmlns","http://www.w3.org/2000/svg"),G(e,"version","1.1"),G(e,"width","24"),G(e,"height","24"),G(e,"viewBox","0 0 987.525 987.525")},m(t,a){R(t,e,a),O(e,i),O(e,n),O(e,r)},p(t,i){1&l(i,1)[0]&&G(e,"style",t[0])},i:d,o:d,d(t){t&&F(e)}}}function Wd(t,e,i){var n=e.style,r=void 0===n?"":n;return t.$$set=t=>{"style"in t&&i(0,r=t.style)},[r]}class qd extends Wt{constructor(t){super(),Bt(this,t,Wd,Bd,m,{style:0})}}function Yd(t){A(t,"svelte-19u39jq",".list_open.svelte-19u39jq{list-style-type:disclosure-open}.list_closed.svelte-19u39jq{list-style-type:disc}")}function Ud(t,e,i){var n=t.slice();return n[1]=e[i][0],n[2]=e[i][1],n}function Xd(t){var e,i;return e=new Jd({props:{item:t[2]}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};1&i&&(n.item=t[2]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function Gd(t){var e,i,n,r,a,s,o,l,c,d=t[1]+"",h=be(t[2].size,3)+"",u=t[2].children&&Xd(t);return{c(){e=N("li"),i=B(d),n=B(" ("),r=B(h),a=B(")"),s=N("br"),o=W(),u&&u.c(),l=W(),G(e,"class","svelte-19u39jq"),tt(e,"list_closed",!t[2].children)},m(t,d){R(t,e,d),O(e,i),O(e,n),O(e,r),O(e,a),O(e,s),O(e,o),u&&u.m(e,null),O(e,l),c=!0},p(t,n){(!c||1&n)&&d!==(d=t[1]+"")&&Z(i,d),(!c||1&n)&&h!==(h=be(t[2].size,3)+"")&&Z(r,h),t[2].children?u?(u.p(t,n),1&n&&zt(u,1)):((u=Xd(t)).c(),zt(u,1),u.m(e,l)):u&&(Dt(),Ot(u,1,1,(()=>{u=null})),Lt()),(!c||1&n)&&tt(e,"list_closed",!t[2].children)},i(t){c||(zt(u),c=!0)},o(t){Ot(u),c=!1},d(t){t&&F(e),u&&u.d()}}}function Kd(t){for(var e,i,n=jt(Object.entries(t[0].children)),r=[],a=0;aOt(r[t],1,1,(()=>{r[t]=null}));return{c(){e=N("ul");for(var t=0;t{"item"in t&&i(0,r=t.item)},[r]}class Jd extends Wt{constructor(t){super(),Bt(this,t,Zd,Kd,m,{item:0},Yd)}}function Qd(t){A(t,"svelte-9kehex",".large_icon.svelte-9kehex.svelte-9kehex{flex-direction:column;min-width:5em}.large_icon.svelte-9kehex>.icon.svelte-9kehex{font-size:40px;display:block}")}function th(t){var e,i=t[7].default,n=_(i,t,t[6],null);return{c(){n&&n.c()},m(t,i){n&&n.m(t,i),e=!0},p(t,r){n&&n.p&&(!e||64&r)&&k(n,i,t,t[6],e?w(i,t[6],r,null):$(t[6]),null)},i(t){e||(zt(n,t),e=!0)},o(t){Ot(n,t),e=!1},d(t){n&&n.d(t)}}}function eh(t){var e;return{c(){e=B("Copy failed")},m(t,i){R(t,e,i)},p:d,i:d,o:d,d(t){t&&F(e)}}}function ih(t){var e;return{c(){e=B("Copied!")},m(t,i){R(t,e,i)},p:d,i:d,o:d,d(t){t&&F(e)}}}function nh(t){var e,i,n,r,a,s,o,c,d,h,u=[ih,eh,th],f=[];function p(t,e){return t[5]?0:t[4]?1:2}return a=p(t),s=f[a]=u[a](t),{c(){e=N("button"),(i=N("i")).textContent="content_copy",n=W(),r=N("span"),s.c(),G(i,"class","icon svelte-9kehex"),G(e,"style",t[1]),G(e,"class","button svelte-9kehex"),G(e,"title","Copy text to clipboard"),e.disabled=o=""===t[0],tt(e,"button_highlight",t[5]),tt(e,"button_red",t[4]),tt(e,"large_icon",t[2])},m(s,o){R(s,e,o),O(e,i),O(e,n),O(e,r),f[a].m(r,null),c=!0,d||(h=Y(e,"click",t[3]),d=!0)},p(t,i){var n=l(i,1)[0],d=a;(a=p(t))===d?f[a].p(t,n):(Dt(),Ot(f[d],1,1,(()=>{f[d]=null})),Lt(),(s=f[a])?s.p(t,n):(s=f[a]=u[a](t)).c(),zt(s,1),s.m(r,null)),(!c||2&n)&&G(e,"style",t[1]),(!c||1&n&&o!==(o=""===t[0]))&&(e.disabled=o),(!c||32&n)&&tt(e,"button_highlight",t[5]),(!c||16&n)&&tt(e,"button_red",t[4]),(!c||4&n)&&tt(e,"large_icon",t[2])},i(t){c||(zt(s),c=!0)},o(t){Ot(s),c=!1},d(t){t&&F(e),f[a].d(),d=!1,h()}}}function rh(t,e,i){var n=e.$$slots,r=void 0===n?{}:n,a=e.$$scope,s=e.text,o=void 0===s?"":s,l=e.style,c=void 0===l?"":l,d=e.large_icon,h=void 0!==d&&d,u=!1,f=!1;return t.$$set=t=>{"text"in t&&i(0,o=t.text),"style"in t&&i(1,c=t.style),"large_icon"in t&&i(2,h=t.large_icon),"$$scope"in t&&i(6,a=t.$$scope)},[o,c,h,()=>{try{!function(t){try{navigator.clipboard.writeText(t)}catch(t){return!1}}(o),i(5,f=!0)}catch(t){console.error("Failed to copy text",t),i(4,u=!0)}setTimeout((()=>{i(5,f=!1),i(4,u=!1)}),1e4)},u,f,a,r]}class ah extends Wt{constructor(t){super(),Bt(this,t,rh,nh,m,{text:0,style:1,large_icon:2,copy:3},Qd)}get copy(){return this.$$.ctx[3]}}function sh(t){A(t,"svelte-b5yk0p","summary.svelte-b5yk0p{cursor:pointer;border-bottom:1px solid var(--separator)}")}function oh(t){var e;return{c(){(e=N("p")).textContent="Torrent file could not be parsed. It may be corrupted."},m(t,i){R(t,e,i)},p:d,i:d,o:d,d(t){t&&F(e)}}}function lh(t){var e;return{c(){(e=N("p")).textContent="Torrent file is too large to parse. Please download the file and\n\t\t\tadd it to your torrent client locally."},m(t,i){R(t,e,i)},p:d,i:d,o:d,d(t){t&&F(e)}}}function ch(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p,v,g,m,b,x,_,y=t[2].created_by+"",w=t[2].comment+"",k=ke(new Date(t[2].created_at),0,0,!0)+"",$=t[2].info_hash+"";return v=new qd({}),x=new ah({props:{text:t[3],$$slots:{default:[dh]},$$scope:{ctx:t}}}),{c(){e=B("Created by: "),i=B(y),n=N("br"),r=B("\n\t\tComment: "),a=B(w),s=N("br"),o=B("\n\t\tCreated at: "),l=B(k),c=N("br"),d=B("\n\t\tInfo hash: "),h=B($),u=N("br"),f=W(),p=N("a"),Ht(v.$$.fragment),g=W(),(m=N("span")).textContent="Open magnet link",b=W(),Ht(x.$$.fragment),G(p,"href",t[3]),G(p,"class","button button_highlight")},m(t,y){R(t,e,y),R(t,i,y),R(t,n,y),R(t,r,y),R(t,a,y),R(t,s,y),R(t,o,y),R(t,l,y),R(t,c,y),R(t,d,y),R(t,h,y),R(t,u,y),R(t,f,y),R(t,p,y),Nt(v,p,null),O(p,g),O(p,m),R(t,b,y),Nt(x,t,y),_=!0},p(t,e){(!_||4&e)&&y!==(y=t[2].created_by+"")&&Z(i,y),(!_||4&e)&&w!==(w=t[2].comment+"")&&Z(a,w),(!_||4&e)&&k!==(k=ke(new Date(t[2].created_at),0,0,!0)+"")&&Z(l,k),(!_||4&e)&&$!==($=t[2].info_hash+"")&&Z(h,$),(!_||8&e)&&G(p,"href",t[3]);var n={};8&e&&(n.text=t[3]),128&e&&(n.$$scope={dirty:e,ctx:t}),x.$set(n)},i(t){_||(zt(v.$$.fragment,t),zt(x.$$.fragment,t),_=!0)},o(t){Ot(v.$$.fragment,t),Ot(x.$$.fragment,t),_=!1},d(t){t&&(F(e),F(i),F(n),F(r),F(a),F(s),F(o),F(l),F(c),F(d),F(h),F(u),F(f),F(p),F(b)),Vt(v),Vt(x,t)}}}function dh(t){var e;return{c(){e=B("Copy magnet link")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function hh(t){var e,i,n,r,a,s,o,l=[ch,lh,oh],c=[];function d(t,e){return"finished"===t[0]?0:"too_large"===t[0]?1:"parse_failed"===t[0]?2:-1}return~(e=d(t))&&(i=c[e]=l[e](t)),{c(){i&&i.c(),n=W(),(r=N("button")).innerHTML='download Download torrent file',G(r,"class","button")},m(i,l){~e&&c[e].m(i,l),R(i,n,l),R(i,r,l),a=!0,s||(o=Y(r,"click",t[6]),s=!0)},p(t,r){var a=e;(e=d(t))===a?~e&&c[e].p(t,r):(i&&(Dt(),Ot(c[a],1,1,(()=>{c[a]=null})),Lt()),~e?((i=c[e])?i.p(t,r):(i=c[e]=l[e](t)).c(),zt(i,1),i.m(n.parentNode,n)):i=null)},i(t){a||(zt(i),a=!0)},o(t){Ot(i),a=!1},d(t){t&&(F(n),F(r)),~e&&c[e].d(t),s=!1,o()}}}function uh(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p,v,g,m,b,x,_,y,w,k,$,M,C,S,T,P,D,L,z;return h=new qd({}),{c(){e=N("details"),(i=N("summary")).textContent="How do I download this? (expand for more information)",n=W(),(r=N("p")).textContent="This is a torrent file, which means you will need a torrent client to\n\t\t\tdownload it. Here are some good torrent clients for various platforms:",a=W(),(s=N("ul")).innerHTML='
  • Transmission (Linux, Mac, Windows)
  • qBittorrent (Linux, Mac, Windows)
  • LibreTorrent (Android)
  • ',o=W(),l=N("p"),c=B("After installing your torrent client you will be able to use the\n\t\t\t"),d=N("a"),Ht(h.$$.fragment),u=B(" Open magnet link"),f=B("\n\t\t\tbutton to download the files in your torrent client."),p=W(),(v=N("h3")).textContent="What is a torrent?",g=W(),(m=N("p")).innerHTML='BitTorrent is a\n\t\t\tpeer-to-peer network for sharing files. This torrent file does not\n\t\t\tactually contain the files listed below, instead it contains\n\t\t\tinstructions for your torrent client to download the files from\n\t\t\tother people who happen to be downloading the same files currently.\n\t\t\tThis means that instead of connecting to a single server (like\n\t\t\tpixeldrain), you will be connecting to other people on the internet\n\t\t\tto download these files.',b=W(),(x=N("p")).textContent="Torrents are a highly efficient and free method of transferring\n\t\t\tfiles over the internet. Since the bandwidth is shared directly\n\t\t\tbetween users there is no need for expensive servers to host the\n\t\t\tfiles for you.",_=W(),(y=N("h3")).textContent="Is this safe?",w=W(),(k=N("p")).textContent="Your torrent client will make sure that the files you receive from\n\t\t\tyour peers are actually what they say it is. This makes it just as\n\t\t\tsafe as any other form of downloading. Like always when downloading\n\t\t\tfiles you still need to be aware of what you are downloading. Don't\n\t\t\tjust blindly trust any file anyone sends you.",$=W(),(M=N("h3")).textContent="Is it private?",C=W(),(S=N("p")).textContent="When downloading a torrent file you will be part of the so-called\n\t\t\t'torrent swarm'. Anyone in the swarm can see each other's IP\n\t\t\taddresses. This is not a bad thing on its own, but there a few cases\n\t\t\tin which this can be abused.",T=W(),(P=N("p")).textContent="Anyone in the swarm will be able to see what you are downloading,\n\t\t\teven across different torrents. This is something to keep in mind\n\t\t\twhen downloading torrents. If someone can link your IP address to\n\t\t\tyour identity then there are ways to find out which files you have\n\t\t\tdownloaded in the past (provided that your IP address has not\n\t\t\tchanged since then).",D=W(),(L=N("p")).innerHTML='If you are downloading copyrighted material (which I do not condone)\n\t\t\tthen rightsholders will be able to see your IP address. In most\n\t\t\tcases this is not a problem because your ISP will still protect your\n\t\t\tidentity. But there are some countries (notably the USA) where your\n\t\t\tISP will not respect your right to privacy and the rightsholder will\n\t\t\tbe able to contact you. If this worries you then you should look\n\t\t\tinto VPN services to protect your privacy, like Mullvad.',G(i,"class","svelte-b5yk0p"),G(d,"href",t[3])},m(t,A){R(t,e,A),O(e,i),O(e,n),O(e,r),O(e,a),O(e,s),O(e,o),O(e,l),O(l,c),O(l,d),Nt(h,d,null),O(d,u),O(l,f),O(e,p),O(e,v),O(e,g),O(e,m),O(e,b),O(e,x),O(e,_),O(e,y),O(e,w),O(e,k),O(e,$),O(e,M),O(e,C),O(e,S),O(e,T),O(e,P),O(e,D),O(e,L),z=!0},p(t,e){(!z||8&e)&&G(d,"href",t[3])},i(t){z||(zt(h.$$.fragment,t),z=!0)},o(t){Ot(h.$$.fragment,t),z=!1},d(t){t&&F(e),Vt(h)}}}function fh(t){var e,i;return e=new sc({props:{$$slots:{default:[ph]},$$scope:{ctx:t}}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};132&i&&(n.$$scope={dirty:i,ctx:t}),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function ph(t){var e,i,n,r;return n=new Jd({props:{item:t[2].files}}),{c(){(e=N("h2")).textContent="Files in this torrent",i=W(),Ht(n.$$.fragment)},m(t,a){R(t,e,a),R(t,i,a),Nt(n,t,a),r=!0},p(t,e){var i={};4&e&&(i.item=t[2].files),n.$set(i)},i(t){r||(zt(n.$$.fragment,t),r=!0)},o(t){Ot(n.$$.fragment,t),r=!1},d(t){t&&(F(e),F(i)),Vt(n,t)}}}function vh(t){var e,i,n,r,a,s,o,c;e=new Kc({props:{title:t[1].name}}),n=new Dc({props:{icon_href:t[1].icon_href,$$slots:{default:[hh]},$$scope:{ctx:t}}}),a=new sc({props:{$$slots:{default:[uh]},$$scope:{ctx:t}}});var d="finished"===t[0]&&fh(t);return{c(){Ht(e.$$.fragment),i=W(),Ht(n.$$.fragment),r=W(),Ht(a.$$.fragment),s=W(),d&&d.c(),o=q()},m(t,l){Nt(e,t,l),R(t,i,l),Nt(n,t,l),R(t,r,l),Nt(a,t,l),R(t,s,l),d&&d.m(t,l),R(t,o,l),c=!0},p(t,i){var r=l(i,1)[0],s={};2&r&&(s.title=t[1].name),e.$set(s);var c={};2&r&&(c.icon_href=t[1].icon_href),141&r&&(c.$$scope={dirty:r,ctx:t}),n.$set(c);var h={};136&r&&(h.$$scope={dirty:r,ctx:t}),a.$set(h),"finished"===t[0]?d?(d.p(t,r),1&r&&zt(d,1)):((d=fh(t)).c(),zt(d,1),d.m(o.parentNode,o)):d&&(Dt(),Ot(d,1,1,(()=>{d=null})),Lt())},i(t){c||(zt(e.$$.fragment,t),zt(n.$$.fragment,t),zt(a.$$.fragment,t),zt(d),c=!0)},o(t){Ot(e.$$.fragment,t),Ot(n.$$.fragment,t),Ot(a.$$.fragment,t),Ot(d),c=!1},d(t){t&&(F(i),F(r),F(s),F(o)),Vt(e,t),Vt(n,t),Vt(a,t),d&&d.d(t)}}}function gh(t,e,n){var r=ht(),a="loading",s=function(){var t=i(o().mark((function t(e){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n(1,l=e),r("loading",!0),t.prev=2,t.next=5,fetch(e.info_href+"/torrent");case 5:if(!((i=t.sent).status>=400)){t.next=17;break}return t.next=9,i.json();case 9:if("torrent_too_large"!==t.sent.value){t.next=15;break}return n(0,a="too_large"),t.abrupt("return");case 15:return n(0,a="parse_failed"),t.abrupt("return");case 17:return t.t0=n,t.next=20,i.json();case 20:t.t1=c=t.sent,(0,t.t0)(2,t.t1),n(3,d="magnet:?xt=urn:btih:"+c.info_hash+"&dn="+encodeURIComponent(Object.keys(c.files.children)[0])),c.trackers.forEach((t=>{n(3,d+="&tr="+encodeURIComponent(t))})),t.next=29;break;case 26:t.prev=26,t.t2=t.catch(2),console.error(t.t2);case 29:return t.prev=29,r("loading",!1),t.finish(29);case 32:n(0,a="finished");case 33:case"end":return t.stop()}}),t,null,[[2,26,29,32]])})));return function(e){return t.apply(this,arguments)}}(),l={id:"",size:0,name:"",mime_type:"",icon_href:"",show_ads:!1},c={trackers:[],comment:"",created_by:"",created_at:"",info_hash:"",files:null},d="";return[a,l,c,d,r,s,()=>{r("download")}]}class mh extends Wt{constructor(t){super(),Bt(this,t,gh,vh,m,{set_file:5},sh)}get set_file(){return this.$$.ctx[5]}}function bh(t){A(t,"svelte-1wkbs7n","details.svelte-1wkbs7n.svelte-1wkbs7n{padding-left:0.5em;border:none;border-left:2px solid var(--separator)}details.svelte-1wkbs7n>summary.svelte-1wkbs7n{list-style-type:none;display:flex}details.svelte-1wkbs7n>summary.svelte-1wkbs7n::before{font-family:'Material Icons';content:'folder'}details[open].svelte-1wkbs7n>summary.svelte-1wkbs7n::before{font-family:'Material Icons';content:'folder_open'}li.svelte-1wkbs7n.svelte-1wkbs7n::before{font-family:'Material Icons';content:'description'}ul.svelte-1wkbs7n.svelte-1wkbs7n{list-style-type:none;padding-left:0.5em;margin:0;border-left:2px solid var(--separator)}.filename.svelte-1wkbs7n.svelte-1wkbs7n{display:inline;margin-left:0.5em}")}function xh(t,e,i){var n=t.slice();return n[2]=e[i][0],n[3]=e[i][1],n}function _h(t,e,i){var n=t.slice();return n[2]=e[i][0],n[3]=e[i][1],n[6]=e,n[7]=i,n}function yh(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p=t[2]+"",v=be(t[3].size,3)+"",g=t[3].download_url&&wh(t),m=t[3].details_open&&kh(t);function b(){t[1].call(e,t[6],t[7])}return{c(){e=N("details"),i=N("summary"),n=N("div"),r=B(p),a=B("\n\t\t\t\t\t(\n\t\t\t\t\t\t"),s=B(v),o=W(),g&&g.c(),l=B("\n\t\t\t\t\t)"),c=W(),m&&m.c(),d=W(),G(n,"class","filename svelte-1wkbs7n"),G(i,"class","svelte-1wkbs7n"),G(e,"class","svelte-1wkbs7n")},m(p,v){R(p,e,v),O(e,i),O(i,n),O(n,r),O(n,a),O(n,s),O(n,o),g&&g.m(n,null),O(n,l),O(e,c),m&&m.m(e,null),O(e,d),e.open=t[3].details_open,h=!0,u||(f=Y(e,"toggle",b),u=!0)},p(i,a){t=i,(!h||1&a)&&p!==(p=t[2]+"")&&Z(r,p),(!h||1&a)&&v!==(v=be(t[3].size,3)+"")&&Z(s,v),t[3].download_url?g?g.p(t,a):((g=wh(t)).c(),g.m(n,l)):g&&(g.d(1),g=null),t[3].details_open?m?(m.p(t,a),1&a&&zt(m,1)):((m=kh(t)).c(),zt(m,1),m.m(e,d)):m&&(Dt(),Ot(m,1,1,(()=>{m=null})),Lt()),1&a&&(e.open=t[3].details_open)},i(t){h||(zt(m),h=!0)},o(t){Ot(m),h=!1},d(t){t&&F(e),g&&g.d(),m&&m.d(),u=!1,f()}}}function wh(t){var e,i,n;return{c(){e=N("a"),i=B("download"),G(e,"href",n=t[3].download_url)},m(t,n){R(t,e,n),O(e,i)},p(t,i){1&i&&n!==(n=t[3].download_url)&&G(e,"href",n)},d(t){t&&F(e)}}}function kh(t){var e,i;return e=new Dh({props:{item:t[3]}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};1&i&&(n.item=t[3]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function $h(t){var e,i,n=t[3].children&&yh(t);return{c(){n&&n.c(),e=q()},m(t,r){n&&n.m(t,r),R(t,e,r),i=!0},p(t,i){t[3].children?n?(n.p(t,i),1&i&&zt(n,1)):((n=yh(t)).c(),zt(n,1),n.m(e.parentNode,e)):n&&(Dt(),Ot(n,1,1,(()=>{n=null})),Lt())},i(t){i||(zt(n),i=!0)},o(t){Ot(n),i=!1},d(t){t&&F(e),n&&n.d(t)}}}function Mh(t){var e,i,n,r,a,s,o,l,c=t[2]+"",d=be(t[3].size,3)+"",h=t[3].download_url&&Ch(t);return{c(){e=N("li"),i=N("div"),n=B(c),r=B("\n\t\t\t\t\t(\n\t\t\t\t\t\t"),a=B(d),s=W(),h&&h.c(),o=B("\n\t\t\t\t\t)"),l=W(),G(i,"class","filename svelte-1wkbs7n"),G(e,"class","svelte-1wkbs7n")},m(t,c){R(t,e,c),O(e,i),O(i,n),O(i,r),O(i,a),O(i,s),h&&h.m(i,null),O(i,o),O(e,l)},p(t,e){1&e&&c!==(c=t[2]+"")&&Z(n,c),1&e&&d!==(d=be(t[3].size,3)+"")&&Z(a,d),t[3].download_url?h?h.p(t,e):((h=Ch(t)).c(),h.m(i,o)):h&&(h.d(1),h=null)},d(t){t&&F(e),h&&h.d()}}}function Ch(t){var e,i,n;return{c(){e=N("a"),i=B("download"),G(e,"href",n=t[3].download_url)},m(t,n){R(t,e,n),O(e,i)},p(t,i){1&i&&n!==(n=t[3].download_url)&&G(e,"href",n)},d(t){t&&F(e)}}}function Sh(t){var e,i=!t[3].children&&Mh(t);return{c(){i&&i.c(),e=q()},m(t,n){i&&i.m(t,n),R(t,e,n)},p(t,n){t[3].children?i&&(i.d(1),i=null):i?i.p(t,n):((i=Mh(t)).c(),i.m(e.parentNode,e))},d(t){t&&F(e),i&&i.d(t)}}}function Th(t){for(var e,i,n,r=jt(Object.entries(t[0].children)),a=[],s=0;sOt(a[t],1,1,(()=>{a[t]=null})),c=jt(Object.entries(t[0].children)),d=[],h=0;h{"item"in t&&i(0,r=t.item)},[r,function(t,e){t[e][1].details_open=this.open,i(0,r)}]}class Dh extends Wt{constructor(t){super(),Bt(this,t,Ph,Th,m,{item:0},bh)}}function Lh(t){var e,i,n,r;return{c(){e=B("This is a 7-zip archive. You will need\n\t\t"),(i=N("a")).textContent="7-zip",n=B(" or compatible software to\n\t\textract it"),r=N("br"),G(i,"href","https://www.7-zip.org/")},m(t,a){R(t,e,a),R(t,i,a),R(t,n,a),R(t,r,a)},d(t){t&&(F(e),F(i),F(n),F(r))}}}function zh(t){var e,i,n,r,a,s,o=be(t[2].size,3)+"",l=t[3].toFixed(2)+"";return{c(){e=B("Uncompressed size: "),i=B(o),n=B(" (Ratio: "),r=B(l),a=B("x)"),s=N("br")},m(t,o){R(t,e,o),R(t,i,o),R(t,n,o),R(t,r,o),R(t,a,o),R(t,s,o)},p(t,e){4&e&&o!==(o=be(t[2].size,3)+"")&&Z(i,o),8&e&&l!==(l=t[3].toFixed(2)+"")&&Z(r,l)},d(t){t&&(F(e),F(i),F(n),F(r),F(a),F(s))}}}function Oh(t){var e,i,n,r,a,s,o,l,c,d,h,u,f=be(t[1].size,3)+"",p=ke(t[1].date_upload,0,0,!0)+"",v="7z"===t[4]&&Lh(),g=!t[5]&&zh(t);return{c(){v&&v.c(),e=B("\n\n\tCompressed size: "),i=B(f),n=N("br"),r=W(),g&&g.c(),a=B("\n\tUploaded on: "),s=B(p),o=W(),l=N("br"),c=W(),(d=N("button")).innerHTML='download Download',G(d,"class","button_highlight")},m(f,p){v&&v.m(f,p),R(f,e,p),R(f,i,p),R(f,n,p),R(f,r,p),g&&g.m(f,p),R(f,a,p),R(f,s,p),R(f,o,p),R(f,l,p),R(f,c,p),R(f,d,p),h||(u=Y(d,"click",t[8]),h=!0)},p(t,n){"7z"===t[4]?v||((v=Lh()).c(),v.m(e.parentNode,e)):v&&(v.d(1),v=null),2&n&&f!==(f=be(t[1].size,3)+"")&&Z(i,f),t[5]?g&&(g.d(1),g=null):g?g.p(t,n):((g=zh(t)).c(),g.m(a.parentNode,a)),2&n&&p!==(p=ke(t[1].date_upload,0,0,!0)+"")&&Z(s,p)},d(t){t&&(F(e),F(i),F(n),F(r),F(a),F(s),F(o),F(l),F(c),F(d)),v&&v.d(t),g&&g.d(t),h=!1,u()}}}function Ah(t){var e,i;return(e=new Cc({props:{file:t[1]}})).$on("reload",t[9]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};2&i&&(n.file=t[1]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function Eh(t){var e,i;return e=new sc({props:{$$slots:{default:[Ih]},$$scope:{ctx:t}}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};2048&i&&(n.$$scope={dirty:i,ctx:t}),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function jh(t){var e,i;return e=new sc({props:{$$slots:{default:[Fh]},$$scope:{ctx:t}}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};2084&i&&(n.$$scope={dirty:i,ctx:t}),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function Ih(t){var e;return{c(){(e=N("p")).textContent="Zip archive could not be parsed. This usually means that the archive\n\t\t\tis encrypted or that it uses an unsupported compression format."},m(t,i){R(t,e,i)},p:d,d(t){t&&F(e)}}}function Rh(t){var e;return{c(){(e=N("div")).textContent="Due to the large size of this archive, the results have been\n\t\t\t\ttruncated. The list below is incomplete!",G(e,"class","highlight_yellow")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Fh(t){var e,i,n,r,a,s=t[5]&&Rh();return r=new Dh({props:{item:t[2]}}),{c(){(e=N("h2")).textContent="Files in this archive",i=W(),s&&s.c(),n=W(),Ht(r.$$.fragment)},m(t,o){R(t,e,o),R(t,i,o),s&&s.m(t,o),R(t,n,o),Nt(r,t,o),a=!0},p(t,e){t[5]?s||((s=Rh()).c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null);var i={};4&e&&(i.item=t[2]),r.$set(i)},i(t){a||(zt(r.$$.fragment,t),a=!0)},o(t){Ot(r.$$.fragment,t),a=!1},d(t){t&&(F(e),F(i),F(n)),s&&s.d(t),Vt(r,t)}}}function Hh(t){var e,i,n,r,a,s,o,c,d;e=new Kc({props:{title:t[1].name}}),n=new Dc({props:{icon_href:t[1].icon_href,$$slots:{default:[Oh]},$$scope:{ctx:t}}});var h=t[1].show_ads&&Ah(t),u=[jh,Eh],f=[];function p(t,e){return"finished"===t[0]?0:"parse_failed"===t[0]?1:-1}return~(s=p(t))&&(o=f[s]=u[s](t)),{c(){Ht(e.$$.fragment),i=W(),Ht(n.$$.fragment),r=W(),h&&h.c(),a=W(),o&&o.c(),c=q()},m(t,o){Nt(e,t,o),R(t,i,o),Nt(n,t,o),R(t,r,o),h&&h.m(t,o),R(t,a,o),~s&&f[s].m(t,o),R(t,c,o),d=!0},p(t,i){var r=l(i,1)[0],d={};2&r&&(d.title=t[1].name),e.$set(d);var v={};2&r&&(v.icon_href=t[1].icon_href),2110&r&&(v.$$scope={dirty:r,ctx:t}),n.$set(v),t[1].show_ads?h?(h.p(t,r),2&r&&zt(h,1)):((h=Ah(t)).c(),zt(h,1),h.m(a.parentNode,a)):h&&(Dt(),Ot(h,1,1,(()=>{h=null})),Lt());var g=s;(s=p(t))===g?~s&&f[s].p(t,r):(o&&(Dt(),Ot(f[g],1,1,(()=>{f[g]=null})),Lt()),~s?((o=f[s])?o.p(t,r):(o=f[s]=u[s](t)).c(),zt(o,1),o.m(c.parentNode,c)):o=null)},i(t){d||(zt(e.$$.fragment,t),zt(n.$$.fragment,t),zt(h),zt(o),d=!0)},o(t){Ot(e.$$.fragment,t),Ot(n.$$.fragment,t),Ot(h),Ot(o),d=!1},d(t){t&&(F(i),F(r),F(a),F(c)),Vt(e,t),Vt(n,t),h&&h.d(t),~s&&f[s].d(t)}}}function Nh(t,e,n){var r=ht(),a="loading",s={name:"",mime_type:"",size:0,date_upload:"",icon_href:""},l={download_url:"",size:0,children:null},c=0,d="",h=!1,u=function(){var t=i(o().mark((function t(e){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n(1,s=e),r("loading",!0),"application/zip"===e.mime_type?n(4,d="zip"):"application/x-7z-compressed"===e.mime_type&&n(4,d="7z"),t.prev=3,t.next=6,fetch(e.info_href+"/zip");case 6:if(!((i=t.sent).status>=400)){t.next=10;break}return n(0,a="parse_failed"),t.abrupt("return");case 10:return t.t0=n,t.next=13,i.json();case 13:t.t1=l=t.sent,(0,t.t0)(2,t.t1),void 0!==l.properties&&(l.properties.includes("read_individual_files")&&f(e.info_href+"/zip",l),n(5,h=l.properties.includes("truncated"))),n(3,c=l.size/s.size),t.next=22;break;case 19:t.prev=19,t.t2=t.catch(3),console.error(t.t2);case 22:return t.prev=22,r("loading",!1),t.finish(22);case 25:n(0,a="finished");case 26:case"end":return t.stop()}}),t,null,[[3,19,22,25]])})));return function(e){return t.apply(this,arguments)}}(),f=(t,e)=>{e.download_url=t,e.children&&Object.entries(e.children).forEach((t=>{f(e.download_url+"/"+t[0],t[1])}))};return[a,s,l,c,d,h,r,u,()=>{r("download")},function(e){ut.call(this,t,e)}]}class Vh extends Wt{constructor(t){super(),Bt(this,t,Nh,Hh,m,{set_file:7})}get set_file(){return this.$$.ctx[7]}}function Bh(t){A(t,"svelte-1qyghoj",".header_image.svelte-1qyghoj{width:100%;border-radius:8px}")}function Wh(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p,v,g,m,x,_,y,w,k=be(t[4].limits.transfer_limit,3)+"",$=be(t[4].limits.transfer_limit_used,3)+"",M=we(t[0]/(1<<20)*1e3,0)+"",C=!window.user_authenticated&&function(){var t,e,i;return{c(){t=B("(you will need a "),(e=N("a")).textContent="pixeldrain account",i=B(" to\n\t\t\t\treceive the benefits)"),G(e,"href","/register")},m(n,r){R(n,t,r),R(n,e,r),R(n,i,r)},d(n){n&&(F(t),F(e),F(i))}}}();return{c(){e=N("img"),i=W(),n=N("p"),r=B("Pixeldrain's free tier is supported by my Patrons. There's only so much\n\t\tthat you can do with the budget they provide.\n\t\t"),a=B(k),s=B(" per day is about the\n\t\tmost I can give away for free while keeping it fair for everyone, and\n\t\taccording to our records you have already downloaded\n\t\t"),o=B($),l=B("."),c=W(),(d=N("p")).textContent="It's not that I want to withold this file from you, it's just that I\n\t\tdon't want pixeldrain to fall into bankruptcy like so many of the\n\t\twebsites that came before me. So if you really want this file you have a\n\t\tfew options:",h=W(),u=N("ul"),(f=N("li")).textContent="Come back tomorrow when your free transfer limit resets",p=W(),v=N("li"),g=B("Download the file at a limited rate of 1 MiB/s. This will take at\n\t\t\tleast "),m=B(M),x=W(),_=N("li"),(y=N("a")).innerHTML='bolt Upgrade your account',w=B("\n\t\t\tand earn my eternal gratitude\n\t\t\t"),C&&C.c(),b(e.src,"/res/img/slow_down.webp")||G(e,"src","/res/img/slow_down.webp"),G(e,"class","header_image svelte-1qyghoj"),G(e,"alt","Yea, I'm gonna need you to slow down a bit"),G(y,"href","/#pro"),G(y,"target","_blank"),G(y,"class","button button_highlight")},m(t,b){R(t,e,b),R(t,i,b),R(t,n,b),O(n,r),O(n,a),O(n,s),O(n,o),O(n,l),R(t,c,b),R(t,d,b),R(t,h,b),R(t,u,b),O(u,f),O(u,p),O(u,v),O(v,g),O(v,m),O(u,x),O(u,_),O(_,y),O(_,w),C&&C.m(_,null)},p(t,e){16&e&&k!==(k=be(t[4].limits.transfer_limit,3)+"")&&Z(a,k),16&e&&$!==($=be(t[4].limits.transfer_limit_used,3)+"")&&Z(o,$),1&e&&M!==(M=we(t[0]/(1<<20)*1e3,0)+"")&&Z(m,M)},d(t){t&&(F(e),F(i),F(n),F(c),F(d),F(h),F(u)),C&&C.d()}}}function qh(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p,v,g,m,b,x,_=be(t[0],3)+"";return{c(){e=N("table"),i=N("tbody"),n=N("tr"),r=N("td"),a=B(t[1]),s=W(),o=N("tr"),(l=N("td")).textContent="Type",c=N("td"),d=B(t[2]),h=W(),u=N("tr"),(f=N("td")).textContent="Size",p=N("td"),v=B(_),g=W(),(m=N("button")).innerHTML='download Download',G(r,"colspan","2")},m(_,y){R(_,e,y),O(e,i),O(i,n),O(n,r),O(r,a),O(i,s),O(i,o),O(o,l),O(o,c),O(c,d),O(i,h),O(i,u),O(u,f),O(u,p),O(p,v),R(_,g,y),R(_,m,y),b||(x=Y(m,"click",t[6]),b=!0)},p(t,e){2&e&&Z(a,t[1]),4&e&&Z(d,t[2]),1&e&&_!==(_=be(t[0],3)+"")&&Z(v,_)},d(t){t&&(F(e),F(g),F(m)),b=!1,x()}}}function Yh(t){var e;return{c(){e=B("Also, I believe you have my stapler. Please give it back.")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Uh(t){var e,i,n,r,a,s;return e=new sc({props:{$$slots:{default:[Wh]},$$scope:{ctx:t}}}),n=new Dc({props:{icon_href:t[3],$$slots:{default:[qh]},$$scope:{ctx:t}}}),a=new sc({props:{$$slots:{default:[Yh]},$$scope:{ctx:t}}}),{c(){Ht(e.$$.fragment),i=W(),Ht(n.$$.fragment),r=W(),Ht(a.$$.fragment)},m(t,o){Nt(e,t,o),R(t,i,o),Nt(n,t,o),R(t,r,o),Nt(a,t,o),s=!0},p(t,i){var r=l(i,1)[0],s={};145&r&&(s.$$scope={dirty:r,ctx:t}),e.$set(s);var o={};8&r&&(o.icon_href=t[3]),135&r&&(o.$$scope={dirty:r,ctx:t}),n.$set(o);var c={};128&r&&(c.$$scope={dirty:r,ctx:t}),a.$set(c)},i(t){s||(zt(e.$$.fragment,t),zt(n.$$.fragment,t),zt(a.$$.fragment,t),s=!0)},o(t){Ot(e.$$.fragment,t),Ot(n.$$.fragment,t),Ot(a.$$.fragment,t),s=!1},d(t){t&&(F(i),F(r)),Vt(e,t),Vt(n,t),Vt(a,t)}}}function Xh(t,e,i){var n;x(t,vc,(t=>i(4,n=t)));var r=ht(),a=e.file_size,s=void 0===a?0:a,o=e.file_name,l=void 0===o?"":o,c=e.file_type,d=void 0===c?"":c,h=e.icon_href,u=void 0===h?"":h;return t.$$set=t=>{"file_size"in t&&i(0,s=t.file_size),"file_name"in t&&i(1,l=t.file_name),"file_type"in t&&i(2,d=t.file_type),"icon_href"in t&&i(3,u=t.icon_href)},[s,l,d,u,n,r,()=>{r("download")}]}class Gh extends Wt{constructor(t){super(),Bt(this,t,Xh,Uh,m,{file_size:0,file_name:1,file_type:2,icon_href:3},Bh)}}function Kh(t){A(t,"svelte-t7evd5",".center.svelte-t7evd5{position:relative;display:block;margin:auto;width:100px;max-width:100%;height:100px;max-height:100%;top:50%;transform:translateY(-50%)}")}function Zh(t){var e,i;return e=new Sd({props:{}}),t[37](e),e.$on("download",t[38]),e.$on("reload",t[39]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){e.$set({})},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[37](null),Vt(e,i)}}}function Jh(t){var e,i;return e=new Vh({props:{}}),t[34](e),e.$on("loading",t[35]),e.$on("download",t[36]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){e.$set({})},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[34](null),Vt(e,i)}}}function Qh(t){var e,i;return e=new mh({props:{}}),t[31](e),e.$on("loading",t[32]),e.$on("download",t[33]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){e.$set({})},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[31](null),Vt(e,i)}}}function tu(t){var e,i;return e=new wd({props:{}}),t[30](e),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){e.$set({})},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[30](null),Vt(e,i)}}}function eu(t){var e,i;return e=new vd({props:{}}),t[29](e),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){e.$set({})},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[29](null),Vt(e,i)}}}function iu(t){var e,i,n={is_list:t[0]};return e=new sd({props:n}),t[24](e),e.$on("loading",t[25]),e.$on("prev",t[26]),e.$on("next",t[27]),e.$on("reload",t[28]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};1&i[0]&&(n.is_list=t[0]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[24](null),Vt(e,i)}}}function nu(t){var e,i,n={is_list:t[0]};return e=new Yc({props:n}),t[18](e),e.$on("loading",t[19]),e.$on("download",t[20]),e.$on("prev",t[21]),e.$on("next",t[22]),e.$on("reload",t[23]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};1&i[0]&&(n.is_list=t[0]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[18](null),Vt(e,i)}}}function ru(t){var e,i,n={is_list:t[0]};return e=new hd({props:n}),t[14](e),e.$on("prev",t[15]),e.$on("next",t[16]),e.$on("loading",t[17]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};1&i[0]&&(n.is_list=t[0]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[14](null),Vt(e,i)}}}function au(t){var e,i;return e=new Vd({props:{}}),t[12](e),e.$on("download",t[13]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){e.$set({})},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[12](null),Vt(e,i)}}}function su(t){var e,i;return(e=new Gh({props:{file_size:t[3].size,file_name:t[3].name,file_type:t[3].mime_type,icon_href:t[3].icon_href}})).$on("download",t[11]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};8&i[0]&&(n.file_size=t[3].size),8&i[0]&&(n.file_name=t[3].name),8&i[0]&&(n.file_type=t[3].mime_type),8&i[0]&&(n.icon_href=t[3].icon_href),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function ou(t){var e,i;return e=new Ed({props:{}}),t[9](e),e.$on("download",t[10]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){e.$set({})},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[9](null),Vt(e,i)}}}function lu(t){var e,i,n;return i=new ic({}),{c(){e=N("div"),Ht(i.$$.fragment),G(e,"class","center svelte-t7evd5")},m(t,r){R(t,e,r),Nt(i,e,null),n=!0},p:d,i(t){n||(zt(i.$$.fragment,t),n=!0)},o(t){Ot(i.$$.fragment,t),n=!1},d(t){t&&F(e),Vt(i)}}}function cu(t){var e,i,n,r,a=[lu,ou,su,au,ru,nu,iu,eu,tu,Qh,Jh,Zh],s=[];function o(t,e){return"loading"===t[2]?0:"abuse"===t[2]?1:!t[4]&&t[5].limits.transfer_limit_used>t[5].limits.transfer_limit?2:"rate_limit"===t[2]?3:"image"===t[2]?4:"video"===t[2]?5:"audio"===t[2]?6:"pdf"===t[2]?7:"text"===t[2]?8:"torrent"===t[2]?9:"zip"===t[2]?10:"file"===t[2]?11:-1}return~(e=o(t))&&(i=s[e]=a[e](t)),{c(){i&&i.c(),n=q()},m(t,i){~e&&s[e].m(t,i),R(t,n,i),r=!0},p(t,r){var l=e;(e=o(t))===l?~e&&s[e].p(t,r):(i&&(Dt(),Ot(s[l],1,1,(()=>{s[l]=null})),Lt()),~e?((i=s[e])?i.p(t,r):(i=s[e]=a[e](t)).c(),zt(i,1),i.m(n.parentNode,n)):i=null)},i(t){r||(zt(i),r=!0)},o(t){Ot(i),r=!1},d(t){t&&F(n),~e&&s[e].d(t)}}}function du(t,e,n){var r,a;x(t,vc,(t=>n(5,r=t)));var s,l="loading",c=e.is_list,d=void 0!==c&&c,h=!1,u=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(""!==e.id){t.next=5;break}return n(2,l="loading"),t.abrupt("return");case 5:""!==e.abuse_type?n(2,l="abuse"):"file_rate_limited_captcha_required"===e.availability||"ip_download_limited_captcha_required"===e.availability?n(2,l="rate_limit"):n(2,l=Xt(e));case 6:return console.log("opening file",e),n(3,s=e),n(4,h=!e.show_ads),t.next=11,_t();case 11:a&&a.set_file(e);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return t.$$set=t=>{"is_list"in t&&n(0,d=t.is_list)},[d,a,l,s,h,r,u,()=>{a&&a.toggle_playback&&a.toggle_playback()},t=>{a&&a.seek&&a.seek(t)},function(t){pt[t?"unshift":"push"]((()=>{n(1,a=t)}))},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(t){pt[t?"unshift":"push"]((()=>{n(1,a=t)}))},function(e){ut.call(this,t,e)},function(t){pt[t?"unshift":"push"]((()=>{n(1,a=t)}))},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(t){pt[t?"unshift":"push"]((()=>{n(1,a=t)}))},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(t){pt[t?"unshift":"push"]((()=>{n(1,a=t)}))},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(t){pt[t?"unshift":"push"]((()=>{n(1,a=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(1,a=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(1,a=t)}))},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(t){pt[t?"unshift":"push"]((()=>{n(1,a=t)}))},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},function(t){pt[t?"unshift":"push"]((()=>{n(1,a=t)}))},function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)}]}class hu extends Wt{constructor(t){super(),Bt(this,t,du,cu,m,{is_list:0,set_file:6,toggle_playback:7,seek:8},Kh,[-1,-1])}get set_file(){return this.$$.ctx[6]}get toggle_playback(){return this.$$.ctx[7]}get seek(){return this.$$.ctx[8]}}function uu(t){A(t,"svelte-xbrph3",".nav_container.svelte-xbrph3.svelte-xbrph3{flex-grow:0;flex-shrink:0;display:flex;position:relative;width:100%;border-top:2px solid var(--separator);text-align:center;line-height:1em}.nav_button.svelte-xbrph3.svelte-xbrph3{flex-grow:0;flex-shrink:0}.list_navigator.svelte-xbrph3.svelte-xbrph3{flex-grow:1;flex-shrink:1;overflow-x:auto;overflow-y:hidden;white-space:nowrap}.file_button.svelte-xbrph3.svelte-xbrph3{position:relative;height:2.6em;width:220px;margin:2px;padding:0;overflow:hidden;border-radius:6px;background:var(--input_background);color:var(--body_text_color);word-break:break-all;text-align:left;line-height:1.2em;display:inline-block;transition:background 0.2s;white-space:normal;text-decoration:none;vertical-align:top;cursor:pointer;border-width:1px;border-style:solid;border-color:var(--input_background);box-shadow:1px 1px 0px 0px var(--shadow_color)}.file_button.svelte-xbrph3.svelte-xbrph3:hover{text-decoration:none;background:var(--input_hover_background)}.file_button.svelte-xbrph3>img.svelte-xbrph3{height:100%;margin-right:5px;float:left;display:block}.file_selected.svelte-xbrph3.svelte-xbrph3{text-decoration:none;border-color:var(--highlight_color)}")}function fu(t,e,i){var n=t.slice();return n[11]=e[i],n[13]=i,n}function pu(t,e){var i,n,r,a,s,o,l,c,d,h=e[11].name+"";return{key:t,first:null,c(){i=N("a"),n=N("img"),s=W(),o=B(h),l=W(),b(n.src,r=e[11].icon_href+"?width=64&height=64")||G(n,"src",r),G(n,"alt",a=e[11].name),G(n,"class","list_item_thumbnail svelte-xbrph3"),G(n,"loading","lazy"),G(i,"href",c="#item="+e[13]),G(i,"title",d="Open "+e[11].name),G(i,"class","file_button svelte-xbrph3"),tt(i,"file_selected",e[11].selected),this.first=i},m(t,e){R(t,i,e),O(i,n),O(i,s),O(i,o),O(i,l)},p(t,s){e=t,1&s&&!b(n.src,r=e[11].icon_href+"?width=64&height=64")&&G(n,"src",r),1&s&&a!==(a=e[11].name)&&G(n,"alt",a),1&s&&h!==(h=e[11].name+"")&&Z(o,h),1&s&&c!==(c="#item="+e[13])&&G(i,"href",c),1&s&&d!==(d="Open "+e[11].name)&&G(i,"title",d),1&s&&tt(i,"file_selected",e[11].selected)},d(t){t&&F(i)}}}function vu(t){for(var e,i,n,r,a,s,o=[],c=new Map,h=jt(t[0]),u=t=>t[11],f=0;fphoto_library\n\t\tGallery',n=W(),r=N("div");for(var t=0;t{"files"in t&&i(0,s=t.files)},[s,()=>r("toggle_gallery"),n,()=>r("set_file",o+1),()=>r("set_file",o-1),()=>{var t;do{t=Math.floor(Math.random()*s.length),console.log("rand is "+t)}while(l.indexOf(t)>-1);r("set_file",t)},t=>{o=t,s.forEach(((t,e)=>{t.selected=o===e})),i(0,s),l.length>=s.length-6&&l.shift(),l.push(t);var e=n.children[t],r=window.getComputedStyle(e),a=e.offsetWidth+parseInt(r.marginLeft)+parseInt(r.marginRight),c=n.scrollLeft,d=t*a+a/2-n.clientWidth/2,h=(d-c)/30,u=(t,e)=>{i(2,n.scrollLeft=t,n),e<30&&requestAnimationFrame((()=>{u(t+h,e+1)}))};u(c,0)},function(t){pt[t?"unshift":"push"]((()=>{i(2,n=t)}))}]}class mu extends Wt{constructor(t){super(),Bt(this,t,gu,vu,m,{files:0,next:3,prev:4,toggle_gallery:1,rand_item:5,set_item:6},uu)}get next(){return this.$$.ctx[3]}get prev(){return this.$$.ctx[4]}get toggle_gallery(){return this.$$.ctx[1]}get rand_item(){return this.$$.ctx[5]}get set_item(){return this.$$.ctx[6]}}function bu(t){A(t,"svelte-15dc38",".label.svelte-15dc38{text-align:left;padding-left:10px;font-size:0.8em;line-height:0.7em;margin-top:0.5em}.stat.svelte-15dc38{text-align:center}")}function xu(t){var e,i,n,r,a,s,o,c,h,u,f,p,v,g,m,b=me(t[0])+"",x=me(t[1])+"",_=be(t[2],3)+"";return{c(){e=N("div"),(i=N("div")).textContent="Views",n=W(),r=N("div"),a=B(b),s=W(),(o=N("div")).textContent="Downloads",c=W(),h=N("div"),u=B(x),f=W(),(p=N("div")).textContent="Size",v=W(),g=N("div"),m=B(_),G(i,"class","label svelte-15dc38"),G(r,"class","stat svelte-15dc38"),G(o,"class","label svelte-15dc38"),G(h,"class","stat svelte-15dc38"),G(p,"class","label svelte-15dc38"),G(g,"class","stat svelte-15dc38")},m(t,l){R(t,e,l),O(e,i),O(e,n),O(e,r),O(r,a),O(e,s),O(e,o),O(e,c),O(e,h),O(h,u),O(e,f),O(e,p),O(e,v),O(e,g),O(g,m)},p(t,e){var i=l(e,1)[0];1&i&&b!==(b=me(t[0])+"")&&Z(a,b),2&i&&x!==(x=me(t[1])+"")&&Z(u,x),4&i&&_!==(_=be(t[2],3)+"")&&Z(m,_)},i:d,o:d,d(t){t&&F(e)}}}function _u(t,e,i){var n;x(t,vc,(t=>i(4,n=t)));var r=e.file,a=void 0===r?{id:"",views:0,size:0,downloads:0,bandwidth_used:0,bandwidth_used_paid:0}:r,s=0,o=0,l=0;return t.$$set=t=>{"file"in t&&i(3,a=t.file)},t.$$.update=()=>{var e;24&t.$$.dirty&&(i(2,l=a.size),n.file_stats_init?(i(0,s=n.file_stats.views),0===a.size?i(1,o=n.file_stats.downloads):i(1,o=Math.round((n.file_stats.bandwidth+n.file_stats.bandwidth_paid)/a.size))):(i(0,s=a.views),0===a.size?i(1,o=a.downloads):i(1,o=Math.round((a.bandwidth_used+a.bandwidth_used_paid)/a.size)))),8&t.$$.dirty&&(e=a.id,_c({type:"file_stats",data:{file_id:e}}))},[s,o,l,a,n]}class yu extends Wt{constructor(t){super(),Bt(this,t,_u,xu,m,{file:3},bu)}}function wu(t){A(t,"svelte-1tbkcsz",".spinner_container.svelte-1tbkcsz{position:absolute;top:10px;left:10px;height:100px;width:100px}")}function ku(t){var e,i,n;return i=new ic({}),{c(){e=N("div"),Ht(i.$$.fragment),G(e,"class","spinner_container svelte-1tbkcsz")},m(t,r){R(t,e,r),Nt(i,e,null),n=!0},i(t){n||(zt(i.$$.fragment,t),n=!0)},o(t){Ot(i.$$.fragment,t),n=!1},d(t){t&&F(e),Vt(i)}}}function $u(t){var e,i;return{c(){e=N("div"),i=B(t[4]),tt(e,"highlight_green",t[3]),tt(e,"highligt_red",!t[3])},m(t,n){R(t,e,n),O(e,i)},p(t,n){16&n&&Z(i,t[4]),8&n&&tt(e,"highlight_green",t[3]),8&n&&tt(e,"highligt_red",!t[3])},d(t){t&&F(e)}}}function Mu(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p,g,m;return{c(){(e=N("h3")).textContent="Edit album",i=B("\n\t\tName:"),n=N("br"),r=W(),a=N("form"),s=N("input"),o=W(),(l=N("button")).innerHTML='save Save',c=W(),(d=N("h4")).textContent="Delete",h=W(),(u=N("p")).textContent="When you delete an album the files in the album will not be deleted,\n\t\t\tonly the album itself.",f=W(),(p=N("button")).innerHTML='delete Delete album',G(s,"type","text"),Q(s,"flex","1 1 auto"),G(l,"type","submit"),Q(l,"flex","0 0 auto"),G(l,"class","button_highlight"),Q(a,"display","flex"),G(p,"class","button_red")},m(v,b){R(v,e,b),R(v,i,b),R(v,n,b),R(v,r,b),R(v,a,b),O(a,s),J(s,t[6]),O(a,o),O(a,l),R(v,c,b),R(v,d,b),R(v,h,b),R(v,u,b),R(v,f,b),R(v,p,b),g||(m=[Y(s,"input",t[11]),Y(a,"submit",t[9]),Y(p,"click",t[10])],g=!0)},p(t,e){64&e&&s.value!==t[6]&&J(s,t[6])},d(t){t&&(F(e),F(i),F(n),F(r),F(a),F(c),F(d),F(h),F(u),F(f),F(p)),g=!1,v(m)}}}function Cu(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p,g,m;return{c(){(e=N("h3")).textContent="Edit file",i=B("\n\t\tName:"),n=N("br"),r=W(),a=N("form"),s=N("input"),o=W(),(l=N("button")).innerHTML='save Save',c=W(),(d=N("h4")).textContent="Delete",h=W(),(u=N("p")).textContent="When you delete a file it cannot be recovered.\n\t\t\tNobody will be able to download it and the link will\n\t\t\tstop working. The file will also disappear from any\n\t\t\tlists it's contained in.",f=W(),(p=N("button")).innerHTML='delete Delete file',G(s,"type","text"),Q(s,"flex","1 1 auto"),G(l,"type","submit"),Q(l,"flex","0 0 auto"),G(l,"class","button_highlight"),Q(a,"display","flex"),G(p,"class","button_red")},m(v,b){R(v,e,b),R(v,i,b),R(v,n,b),R(v,r,b),R(v,a,b),O(a,s),J(s,t[5]),O(a,o),O(a,l),R(v,c,b),R(v,d,b),R(v,h,b),R(v,u,b),R(v,f,b),R(v,p,b),g||(m=[Y(s,"input",t[12]),Y(a,"submit",t[7]),Y(p,"click",t[8])],g=!0)},p(t,e){32&e&&s.value!==t[5]&&J(s,t[5])},d(t){t&&(F(e),F(i),F(n),F(r),F(a),F(c),F(d),F(h),F(u),F(f),F(p)),g=!1,v(m)}}}function Su(t){var e,i,n,r,a,s=t[2]&&ku(),o=""!==t[4]&&$u(t),c=t[1].can_edit&&Mu(t),d=t[0].can_edit&&Cu(t);return{c(){e=N("div"),s&&s.c(),i=W(),o&&o.c(),n=W(),c&&c.c(),r=W(),d&&d.c(),G(e,"class","indent")},m(t,l){R(t,e,l),s&&s.m(e,null),O(e,i),o&&o.m(e,null),O(e,n),c&&c.m(e,null),O(e,r),d&&d.m(e,null),a=!0},p(t,a){var h=l(a,1)[0];t[2]?s?4&h&&zt(s,1):((s=ku()).c(),zt(s,1),s.m(e,i)):s&&(Dt(),Ot(s,1,1,(()=>{s=null})),Lt()),""!==t[4]?o?o.p(t,h):((o=$u(t)).c(),o.m(e,n)):o&&(o.d(1),o=null),t[1].can_edit?c?c.p(t,h):((c=Mu(t)).c(),c.m(e,r)):c&&(c.d(1),c=null),t[0].can_edit?d?d.p(t,h):((d=Cu(t)).c(),d.m(e,null)):d&&(d.d(1),d=null)},i(t){a||(zt(s),a=!0)},o(t){Ot(s),a=!1},d(t){t&&F(e),s&&s.d(),o&&o.d(),c&&c.d(),d&&d.d()}}}function Tu(t,e,n){var r=ht(),a=e.file,s=void 0===a?{id:"",name:"",get_href:"",can_edit:!1}:a,l=e.list,c=void 0===l?{id:"",title:"",files:[],can_edit:!1,info_href:""}:l,d=!1,h=!1,u="",f="",p="",v=function(){var t=i(o().mark((function t(e){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.preventDefault(),n(2,d=!0),(i=new FormData).append("action","rename"),i.append("name",f),t.prev=5,t.next=8,fetch(s.get_href,{method:"POST",body:i});case 8:if(!((a=t.sent).status>=400)){t.next=13;break}return t.next=12,a.json();case 12:throw t.sent.message;case 13:n(3,h=!0),n(4,u="File name has been changed. Reload the page to see the changes"),t.next=21;break;case 17:t.prev=17,t.t0=t.catch(5),n(3,h=!1),n(4,u="Could not change file name: "+t.t0);case 21:return t.prev=21,n(2,d=!1),r("reload"),t.finish(21);case 25:case"end":return t.stop()}}),t,null,[[5,17,21,25]])})));return function(e){return t.apply(this,arguments)}}(),g=function(){var t=i(o().mark((function t(e){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(confirm("Are you sure you want to delete '"+s.name+"'?")){t.next=2;break}return t.abrupt("return");case 2:return n(2,d=!0),t.prev=3,t.next=6,fetch(s.get_href,{method:"DELETE"});case 6:if(!((i=t.sent).status>=400)){t.next=11;break}return t.next=10,i.json();case 10:throw t.sent.message;case 11:n(3,h=!0),n(4,u="This file has been deleted, you can close the page"),t.next=19;break;case 15:t.prev=15,t.t0=t.catch(3),n(3,h=!1),n(4,u="Could not delete file: "+t.t0);case 19:return t.prev=19,n(2,d=!1),t.finish(19);case 22:case"end":return t.stop()}}),t,null,[[3,15,19,22]])})));return function(e){return t.apply(this,arguments)}}(),m=function(){var t=i(o().mark((function t(e){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.preventDefault(),n(2,d=!0),i={title:p,files:[]},c.files.forEach((t=>{i.files.push({id:t.id})})),t.prev=4,t.next=7,fetch(c.info_href,{method:"PUT",body:JSON.stringify(i)});case 7:if(!((a=t.sent).status>=400)){t.next=12;break}return t.next=11,a.json();case 11:throw t.sent.message;case 12:n(3,h=!0),n(4,u="Album name has been changed. Reload the page to see the changes"),t.next=20;break;case 16:t.prev=16,t.t0=t.catch(4),n(3,h=!1),n(4,u="Could not change album name: "+t.t0);case 20:return t.prev=20,n(2,d=!1),r("reload"),t.finish(20);case 24:case"end":return t.stop()}}),t,null,[[4,16,20,24]])})));return function(e){return t.apply(this,arguments)}}(),b=function(){var t=i(o().mark((function t(e){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(confirm("Are you sure you want to delete '"+c.title+"'?")){t.next=2;break}return t.abrupt("return");case 2:return n(2,d=!0),t.prev=3,t.next=6,fetch(c.info_href,{method:"DELETE"});case 6:if(!((i=t.sent).status>=400)){t.next=11;break}return t.next=10,i.json();case 10:throw t.sent.message;case 11:n(3,h=!0),n(4,u="This album has been deleted, you can close the page"),t.next=19;break;case 15:t.prev=15,t.t0=t.catch(3),n(3,h=!1),n(4,u="Could not delete album: "+t.t0);case 19:return t.prev=19,n(2,d=!1),t.finish(19);case 22:case"end":return t.stop()}}),t,null,[[3,15,19,22]])})));return function(e){return t.apply(this,arguments)}}();return t.$$set=t=>{"file"in t&&n(0,s=t.file),"list"in t&&n(1,c=t.list)},t.$$.update=()=>{1&t.$$.dirty&&(s.id,n(5,f=s.name)),2&t.$$.dirty&&(c.id,n(6,p=c.title))},[s,c,d,h,u,f,p,v,g,m,b,function(){p=this.value,n(6,p)},function(){f=this.value,n(5,f)}]}class Pu extends Wt{constructor(t){super(),Bt(this,t,Tu,Su,m,{file:0,list:1},wu)}}function Du(t){A(t,"svelte-ox9g7q",".center.svelte-ox9g7q{text-align:center}")}function Lu(t){var e,i,n,r,a,s,o,c,h,u,f,p,g,m,b,x,_,y,w,k,$,M,C,S,T,P,D,L,z,A;return{c(){e=N("div"),(i=N("button")).textContent="None",n=W(),(r=N("button")).textContent="Nord",a=W(),(s=N("button")).textContent="dark",o=W(),(c=N("button")).textContent="light",h=W(),(u=N("button")).textContent="Solarized",f=W(),(p=N("button")).textContent="dark",g=W(),(m=N("button")).textContent="light",b=W(),(x=N("button")).textContent="Purple drain",_=W(),(y=N("button")).textContent="Classic",w=W(),(k=N("button")).textContent="Maroon",$=W(),(M=N("button")).textContent="Hacker",C=W(),(S=N("button")).textContent="Canta",T=W(),(P=N("button")).textContent="Skeuos",D=W(),(L=N("button")).textContent="Sweet",tt(i,"button_highlight",""===t[0]),G(r,"class","group_first"),tt(r,"button_highlight","nord"===t[0]),G(s,"class","group_middle"),tt(s,"button_highlight","nord_dark"===t[0]),G(c,"class","group_last"),tt(c,"button_highlight","nord_light"===t[0]),G(u,"class","group_first"),tt(u,"button_highlight","solarized"===t[0]),G(p,"class","group_middle"),tt(p,"button_highlight","solarized_dark"===t[0]),G(m,"class","group_last"),tt(m,"button_highlight","solarized_light"===t[0]),tt(x,"button_highlight","purple_drain"===t[0]),tt(y,"button_highlight","classic"===t[0]),tt(k,"button_highlight","maroon"===t[0]),tt(M,"button_highlight","hacker"===t[0]),tt(S,"button_highlight","canta"===t[0]),tt(P,"button_highlight","skeuos"===t[0]),tt(L,"button_highlight","sweet"===t[0]),G(e,"class","center svelte-ox9g7q")},m(l,d){R(l,e,d),O(e,i),O(e,n),O(e,r),O(e,a),O(e,s),O(e,o),O(e,c),O(e,h),O(e,u),O(e,f),O(e,p),O(e,g),O(e,m),O(e,b),O(e,x),O(e,_),O(e,y),O(e,w),O(e,k),O(e,$),O(e,M),O(e,C),O(e,S),O(e,T),O(e,P),O(e,D),O(e,L),z||(A=[Y(i,"click",t[2]),Y(r,"click",t[3]),Y(s,"click",t[4]),Y(c,"click",t[5]),Y(u,"click",t[6]),Y(p,"click",t[7]),Y(m,"click",t[8]),Y(x,"click",t[9]),Y(y,"click",t[10]),Y(k,"click",t[11]),Y(M,"click",t[12]),Y(S,"click",t[13]),Y(P,"click",t[14]),Y(L,"click",t[15])],z=!0)},p(t,e){var n=l(e,1)[0];1&n&&tt(i,"button_highlight",""===t[0]),1&n&&tt(r,"button_highlight","nord"===t[0]),1&n&&tt(s,"button_highlight","nord_dark"===t[0]),1&n&&tt(c,"button_highlight","nord_light"===t[0]),1&n&&tt(u,"button_highlight","solarized"===t[0]),1&n&&tt(p,"button_highlight","solarized_dark"===t[0]),1&n&&tt(m,"button_highlight","solarized_light"===t[0]),1&n&&tt(x,"button_highlight","purple_drain"===t[0]),1&n&&tt(y,"button_highlight","classic"===t[0]),1&n&&tt(k,"button_highlight","maroon"===t[0]),1&n&&tt(M,"button_highlight","hacker"===t[0]),1&n&&tt(S,"button_highlight","canta"===t[0]),1&n&&tt(P,"button_highlight","skeuos"===t[0]),1&n&&tt(L,"button_highlight","sweet"===t[0])},i:d,o:d,d(t){t&&F(e),z=!1,v(A)}}}function zu(t,e,i){var n=ht(),r=e.theme,a=void 0===r?"":r,s=t=>{i(0,a=t),n("theme_change",a)};return t.$$set=t=>{"theme"in t&&i(0,a=t.theme)},[a,s,()=>{s("")},()=>{s("nord")},()=>{s("nord_dark")},()=>{s("nord_light")},()=>{s("solarized")},()=>{s("solarized_dark")},()=>{s("solarized_light")},()=>{s("purple_drain")},()=>{s("classic")},()=>{s("maroon")},()=>{s("hacker")},()=>{s("canta")},()=>{s("skeuos")},()=>{s("sweet")}]}class Ou extends Wt{constructor(t){super(),Bt(this,t,zu,Lu,m,{theme:0},Du)}}function Au(t){A(t,"svelte-1j8hfe6",".center.svelte-1j8hfe6{text-align:center}.container.svelte-1j8hfe6{width:100%;overflow:hidden}.tab_bar.svelte-1j8hfe6{border-bottom:2px solid var(--separator)}")}function Eu(t){var e,i,n;return{c(){(e=N("button")).innerHTML='code\n\t\t\t\tHotlink',tt(e,"button_highlight","hotlink"===t[1])},m(r,a){R(r,e,a),i||(n=Y(e,"click",t[7]),i=!0)},p(t,i){2&i&&tt(e,"button_highlight","hotlink"===t[1])},d(t){t&&F(e),i=!1,n()}}}function ju(t){var e,i,n,r,a,s,o,l,c,h,u=$e()+"",f=t[0].get_href+"";return{c(){(e=N("h3")).textContent="Direct link",i=W(),(n=N("p")).innerHTML='Hotlinking is only supported on Pro\n\t\t\t\taccounts. If this file was not uploaded with a Pro account the\n\t\t\t\tdownload will be blocked.',r=W(),a=N("p"),s=B("You can directly download the file from this link without using the\n\t\t\t\tfile viewer:\n\t\t\t\t"),o=N("br"),l=W(),c=B(u),h=B(f)},m(t,d){R(t,e,d),R(t,i,d),R(t,n,d),R(t,r,d),R(t,a,d),O(a,s),O(a,o),O(a,l),O(a,c),O(a,h)},p(t,e){1&e&&f!==(f=t[0].get_href+"")&&Z(h,f)},i:d,o:d,d(t){t&&(F(e),F(i),F(n),F(r),F(a))}}}function Iu(t){var e,i,n,r,a,s;return(a=new Ou({})).$on("theme_change",t[10]),{c(){(e=N("h3")).textContent="Appearance",i=W(),(n=N("p")).innerHTML='You can change the pixeldrain theme for your embedded file. Try the\n\t\t\t\tavailable themes here.',r=W(),Ht(a.$$.fragment)},m(t,o){R(t,e,o),R(t,i,o),R(t,n,o),R(t,r,o),Nt(a,t,o),s=!0},p:d,i(t){s||(zt(a.$$.fragment,t),s=!0)},o(t){Ot(a.$$.fragment,t),s=!1},d(t){t&&(F(e),F(i),F(n),F(r)),Vt(a,t)}}}function Ru(t){var e;return{c(){e=B("Copy HTML")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Fu(t){var e,i,n,r,a,s,o,c,d,h,u,f,p,g,m,b,x,_,y,w,k,$,M,C,S,T,P,D,L,z,A=t[0].id&&Eu(t),E=[Iu,ju],j=[];function I(t,e){return"iframe"===t[1]?0:1}return d=I(t),h=j[d]=E[d](t),k=new ah({props:{text:t[2],$$slots:{default:[Ru]},$$scope:{ctx:t}}}),{c(){e=N("div"),(i=N("div")).innerHTML='

    If you have a website you can embed pixeldrain files in your own\n\t\t\twebpages here.

    The IFrame embed gives you a frame with a slightly more minimalistic\n\t\t\tfile viewer in it. The embedded file viewer has a fullscreen button\n\t\t\tand the toolbar is collapsed by default. If you do not have a\n\t\t\tpixeldrain Pro account the frame will also have advertisements in\n\t\t\tit.

    The hotlink embed option only works for single files uploaded with a\n\t\t\tPro account. You can use this to directly embed a video player,\n\t\t\taudio player, photo element or a download button in your site. Make\n\t\t\tsure you have bandwidth sharing enabled on your\n\t\t\tsharing settings page or the\n\t\t\tembed will not work.

    ',n=W(),r=N("div"),(a=N("button")).innerHTML='code\n\t\t\tIFrame',s=W(),A&&A.c(),o=W(),c=N("div"),h.c(),u=W(),(f=N("h3")).textContent="Code",p=W(),(g=N("p")).textContent="Put this code in your website to embed the file.",m=W(),b=N("div"),x=N("textarea"),_=W(),y=N("br"),w=W(),Ht(k.$$.fragment),$=W(),(M=N("button")).innerHTML='visibility Show example',C=W(),(S=N("h3")).textContent="Example",T=W(),P=N("div"),G(i,"class","indent"),tt(a,"button_highlight","iframe"===t[1]),G(r,"class","tab_bar svelte-1j8hfe6"),Q(x,"width","99%"),Q(x,"height","4em"),tt(M,"button_highlight",t[4]),G(b,"class","center svelte-1j8hfe6"),G(c,"class","indent"),Q(P,"text-align","center"),G(e,"class","container svelte-1j8hfe6")},m(l,h){R(l,e,h),O(e,i),O(e,n),O(e,r),O(r,a),O(r,s),A&&A.m(r,null),O(e,o),O(e,c),j[d].m(c,null),O(c,u),O(c,f),O(c,p),O(c,g),O(c,m),O(c,b),O(b,x),J(x,t[2]),O(b,_),O(b,y),O(b,w),Nt(k,b,null),O(b,$),O(b,M),O(c,C),O(c,S),O(e,T),O(e,P),t[12](P),D=!0,L||(z=[Y(a,"click",t[6]),Y(x,"input",t[11]),Y(M,"click",t[8])],L=!0)},p(t,e){var i=l(e,1)[0];(!D||2&i)&&tt(a,"button_highlight","iframe"===t[1]),t[0].id?A?A.p(t,i):((A=Eu(t)).c(),A.m(r,null)):A&&(A.d(1),A=null);var n=d;(d=I(t))===n?j[d].p(t,i):(Dt(),Ot(j[n],1,1,(()=>{j[n]=null})),Lt(),(h=j[d])?h.p(t,i):(h=j[d]=E[d](t)).c(),zt(h,1),h.m(c,u)),4&i&&J(x,t[2]);var s={};4&i&&(s.text=t[2]),131072&i&&(s.$$scope={dirty:i,ctx:t}),k.$set(s),(!D||16&i)&&tt(M,"button_highlight",t[4])},i(t){D||(zt(h),zt(k.$$.fragment,t),D=!0)},o(t){Ot(h),Ot(k.$$.fragment,t),D=!1},d(i){i&&F(e),A&&A.d(),j[d].d(),Vt(k),t[12](null),L=!1,v(z)}}}function Hu(t,e,i){var n,r=e.file,a=void 0===r?{id:"",mime_type:"",get_href:"",download_href:""}:r,s=e.list,o=void 0===s?{id:""}:s,l="iframe",c="",d="",h=t=>{d=t,u(),g()},u=()=>{i(1,l="iframe");var t,e="";d&&(e="&style="+d),t=""===o.id?$e()+"/u/"+a.id+"?embed"+e:$e()+"/l/"+o.id+"?embed"+e+window.location.hash,i(2,c="')},f=()=>{i(1,l="hotlink");var t=Xt(a);i(2,c="video"===t?'":"audio"===t?'":"image"===t?'').concat(p(a.name),''):'')+"Download ".concat(p(a.name)," here")+"")},p=t=>t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),v=!1,g=()=>{i(3,n.innerHTML=v?c:"",n)};return t.$$set=t=>{"file"in t&&i(0,a=t.file),"list"in t&&i(9,o=t.list)},t.$$.update=()=>{513&t.$$.dirty&&(a.id,o.id,n&&i(3,n.innerHTML="",n),"iframe"===l?u():"hotlink"===l&&f())},[a,l,c,n,v,h,u,f,()=>{i(4,v=!v),g()},o,t=>h(t.detail),function(){c=this.value,i(2,c)},function(t){pt[t?"unshift":"push"]((()=>{i(3,n=t)}))}]}class Nu extends Wt{constructor(t){super(),Bt(this,t,Hu,Fu,m,{file:0,list:9},Au)}}function Vu(t){A(t,"svelte-1xjkx8r",'.container.svelte-1xjkx8r.svelte-1xjkx8r{width:100%;padding:10px;overflow:hidden}label.svelte-1xjkx8r.svelte-1xjkx8r{padding:0.2em;display:flex;flex-direction:row}label.svelte-1xjkx8r>input.svelte-1xjkx8r{flex:0 0 auto;margin-right:0.5em}label.svelte-1xjkx8r>div.svelte-1xjkx8r{flex:1 1 auto;padding:0 0.2em;border-radius:6px;border:1px solid var(--separator)}input[type="radio"].svelte-1xjkx8r:checked+div.svelte-1xjkx8r{border-color:var(--highlight_color)}.spinner_container.svelte-1xjkx8r.svelte-1xjkx8r{position:absolute;top:auto;left:10px;height:100px;width:100px;z-index:1000}.report_form.svelte-1xjkx8r.svelte-1xjkx8r{width:100%}.report_form.svelte-1xjkx8r>input[type="text"].svelte-1xjkx8r,.report_form.svelte-1xjkx8r>textarea.svelte-1xjkx8r{width:100%;margin:0 0 0.5em 0}.report_form.svelte-1xjkx8r>textarea.svelte-1xjkx8r{height:5em}')}function Bu(t,e,i){var n=t.slice();return n[21]=e[i],n}function Wu(t,e,i){var n=t.slice();return n[24]=e[i],n}function qu(t){var e,i,n,r,a,s,o,l,c,d,h,u=t[24].desc+"";return c=K(t[11][1]),{c(){e=N("label"),i=N("input"),n=W(),r=N("div"),(a=N("b")).textContent="".concat(t[24].name),s=N("br"),o=W(),l=B(u),G(i,"type","radio"),G(i,"id","type_"+t[24].type),G(i,"name","abuse_type"),i.__value=t[24].type,J(i,i.__value),G(i,"class","svelte-1xjkx8r"),G(r,"class","svelte-1xjkx8r"),G(e,"for","type_"+t[24].type),G(e,"class","svelte-1xjkx8r"),c.p(i)},m(c,u){R(c,e,u),O(e,i),i.checked=i.__value===t[2],O(e,n),O(e,r),O(r,a),O(r,s),O(r,o),O(r,l),d||(h=Y(i,"change",t[10]),d=!0)},p(t,e){4&e&&(i.checked=i.__value===t[2])},d(t){t&&F(e),c.r(),d=!1,h()}}}function Yu(t){var e,i=void 0===t[24].filter||t[24].filter(t[0].mime_type),n=i&&qu(t);return{c(){n&&n.c(),e=q()},m(t,i){n&&n.m(t,i),R(t,e,i)},p(t,r){1&r&&(i=void 0===t[24].filter||t[24].filter(t[0].mime_type)),i?n?n.p(t,r):((n=qu(t)).c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(t){t&&F(e),n&&n.d(t)}}}function Uu(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p,g,m,b,x,_,y,w=t[0].name+"",k=t[1].files.length+"";return x=K(t[11][0]),{c(){(e=N("h3")).textContent="Report multiple files?",i=W(),n=N("label"),r=N("input"),a=W(),s=N("div"),o=B("Report only the selected file ("),l=B(w),c=B(")"),d=W(),h=N("label"),u=N("input"),f=W(),p=N("div"),g=B("Report all "),m=B(k),b=B(" files in this album"),G(r,"type","radio"),G(r,"id","report_single"),G(r,"name","single_or_all"),r.__value="single",J(r,r.__value),G(r,"class","svelte-1xjkx8r"),G(s,"class","svelte-1xjkx8r"),G(n,"for","report_single"),G(n,"class","svelte-1xjkx8r"),G(u,"type","radio"),G(u,"id","report_all"),G(u,"name","single_or_all"),u.__value="all",J(u,u.__value),G(u,"class","svelte-1xjkx8r"),G(p,"class","svelte-1xjkx8r"),G(h,"for","report_all"),Q(h,"border-bottom","none"),G(h,"class","svelte-1xjkx8r"),x.p(r,u)},m(v,x){R(v,e,x),R(v,i,x),R(v,n,x),O(n,r),r.checked=r.__value===t[3],O(n,a),O(n,s),O(s,o),O(s,l),O(s,c),R(v,d,x),R(v,h,x),O(h,u),u.checked=u.__value===t[3],O(h,f),O(h,p),O(p,g),O(p,m),O(p,b),_||(y=[Y(r,"change",t[12]),Y(u,"change",t[13])],_=!0)},p(t,e){8&e&&(r.checked=r.__value===t[3]),1&e&&w!==(w=t[0].name+"")&&Z(l,w),8&e&&(u.checked=u.__value===t[3]),2&e&&k!==(k=t[1].files.length+"")&&Z(m,k)},d(t){t&&(F(e),F(i),F(n),F(d),F(h)),x.r(),_=!1,v(y)}}}function Xu(t){var e,i,n;return{c(){(e=N("div")).innerHTML="

    The revenge porn category is for blackmail content and\n\t\t\t\t\tnon-consensual deepfake porn. If you use this category for\n\t\t\t\t\tcopyright violations then your report will be ignored.

    ",i=W(),n=N("br"),G(e,"class","highlight_yellow"),Q(e,"text-align","initial")},m(t,r){R(t,e,r),R(t,i,r),R(t,n,r)},p:d,d(t){t&&(F(e),F(i),F(n))}}}function Gu(t){var e,i,n,r,a,s,o,l,c;return{c(){(e=N("div")).innerHTML="

    The child abuse category is only for cases where real\n\t\t\t\t\tchildren were abused. This is not for fictional works.

    ",i=W(),n=N("br"),r=W(),(a=N("div")).textContent="If this file is an encrypted archive, please provide the password so we can verify the contents",s=W(),o=N("input"),G(e,"class","highlight_yellow"),Q(e,"text-align","initial"),G(o,"type","text"),G(o,"placeholder","Password..."),G(o,"class","svelte-1xjkx8r")},m(d,h){R(d,e,h),R(d,i,h),R(d,n,h),R(d,r,h),R(d,a,h),R(d,s,h),R(d,o,h),J(o,t[7]),l||(c=Y(o,"input",t[14]),l=!0)},p(t,e){128&e&&o.value!==t[7]&&J(o,t[7])},d(t){t&&(F(e),F(i),F(n),F(r),F(a),F(s),F(o)),l=!1,c()}}}function Ku(t){var e,i,n;return i=new ic({}),{c(){e=N("div"),Ht(i.$$.fragment),G(e,"class","spinner_container svelte-1xjkx8r")},m(t,r){R(t,e,r),Nt(i,e,null),n=!0},i(t){n||(zt(i.$$.fragment,t),n=!0)},o(t){Ot(i.$$.fragment,t),n=!1},d(t){t&&F(e),Vt(i)}}}function Zu(t){var e,i,n=t[21].text+"";return{c(){e=N("div"),i=B(n),tt(e,"highlight_green",t[21].success),tt(e,"highlight_red",!t[21].success)},m(t,n){R(t,e,n),O(e,i)},p(t,r){32&r&&n!==(n=t[21].text+"")&&Z(i,n),32&r&&tt(e,"highlight_green",t[21].success),32&r&&tt(e,"highlight_red",!t[21].success)},d(t){t&&F(e)}}}function Ju(t){for(var e,i,n,r,a,s,o,c,d,h,u,f,p,g,m,b,x,_,y,w,k,$,M,C,S,T,P,D,L,z,A,E,j,I,V=t[6].length+"",q=jt(t[8]),U=[],X=0;Xcontent policy you can report it for moderation\n\t\twith this form. Please submit copyright infringement notices through our\n\t\tabuse e-mail address.',n=W(),r=N("form"),(a=N("h3")).textContent="Abuse type",s=W(),(o=N("p")).textContent="Which type of abuse is shown in this file? Pick the most\n\t\t\tappropriate one.",c=W();for(var t=0;tsend Submit report',G(y,"placeholder","Context here..."),y.required=!0,G(y,"class","svelte-1xjkx8r"),Q(A,"text-align","center"),Q(r,"width","100%"),G(r,"class","report_form svelte-1xjkx8r"),G(e,"class","container svelte-1xjkx8r")},m(l,v){R(l,e,v),O(e,i),O(e,n),O(e,r),O(r,a),O(r,s),O(r,o),O(r,c);for(var F=0;F{nt=null})),Lt()),32&i){var s;for(rt=jt(t[5]),s=0;st.startsWith("image/")||t.startsWith("video/")||"application/pdf"===t,d=[{type:"terrorism",name:"Terrorism",desc:"Videos, images or audio fragments showing or promoting the use\n\t\t\tof intentional violence to achieve political aims",filter:t=>c(t)||(t=>t.startsWith("audio/"))(t)},{type:"gore",name:"Gore",desc:"Graphic and shocking videos or images depicting severe harm to\n\t\t\thumans (or animals)",filter:c},{type:"child_abuse",name:"Child abuse",desc:"Videos or images depicting inappropriate touching or nudity of\n\t\t\tchildren under 18 years old"},{type:"zoophilia",name:"Zoophilia",desc:"Videos or images depicting of sexual acts being performed on\n\t\t\tanimals"},{type:"revenge_porn",name:"Revenge porn",desc:"Sexually explicit images or videos of individuals without their\n\t\t\tconsent and blackmail content"},{type:"doxing",name:"Doxing",desc:"Personally identifiable information being shared without the\n\t\t\tconsent of the owner. This includes things like passport scans,\n\t\t\te-mail addresses, telephone numbers and passwords"},{type:"malware",name:"Malware",desc:"Software programs designed to cause harm to computer systems",filter:t=>t.startsWith("application/")||t.startsWith("text/")}],h="",u="single",f=!1,p=[],v=function(){var t=i(o().mark((function t(e){var i,r,s,c,d,v,m;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.preventDefault(),""!==h){t.next=6;break}return n(5,p=[{success:!1,text:"Please select an abuse type"}]),t.abrupt("return");case 6:if(!(g.length>500)){t.next=9;break}return n(5,p=[{success:!1,text:"Description is too long"}]),t.abrupt("return");case 9:n(4,f=!0),i=[],""===a.id?n(3,u="all"):""===l.id&&n(3,u="single"),"all"===u?l.files.forEach((t=>{""===t.abuse_type&&i.push(t.id)})):i.push(a.id),(r=new FormData).append("type",h),r.append("description",b()),n(5,p=[]),s=0,c=i;case 18:if(!(s=400)){t.next=39;break}return t.next=27,v.json();case 27:if("resource_already_exists"!==(m=t.sent).value){t.next=32;break}throw"You have already reported this file";case 32:if("file_already_blocked"!==m.value){t.next=36;break}throw"This file has already been blocked";case 36:if("multiple_errors"!==m.value){t.next=38;break}throw m.errors[0].message;case 38:throw m.message;case 39:p.push({success:!0,text:"Report has been sent"}),t.next=45;break;case 42:t.prev=42,t.t0=t.catch(20),p.push({success:!1,text:"Failed to send report: "+t.t0});case 45:n(5,p);case 46:s++,t.next=18;break;case 49:n(4,f=!1);case 50:case"end":return t.stop()}}),t,null,[[20,42]])})));return function(e){return t.apply(this,arguments)}}(),g="",m="",b=()=>"child_abuse"===h?"Password: "+m+"\nDescription:\n"+g:g;return t.$$set=t=>{"file"in t&&n(0,a=t.file),"list"in t&&n(1,l=t.list)},[a,l,h,u,f,p,g,m,d,v,function(){h=this.__value,n(2,h)},[[],[]],function(){u=this.__value,n(3,u)},function(){u=this.__value,n(3,u)},function(){m=this.value,n(7,m)},function(){g=this.value,n(6,g)}]}class tf extends Wt{constructor(t){super(),Bt(this,t,Qu,Ju,m,{file:0,list:1},Vu)}}function ef(t){A(t,"svelte-1s8xgdt",".banner.svelte-1s8xgdt{display:block;margin:auto;transform-origin:0 0;font-size:1.2em;line-height:1.2em}.center.svelte-1s8xgdt{text-align:center}.support_banner.svelte-1s8xgdt{text-align:center;padding:2px}.socials.svelte-1s8xgdt{display:inline-block;text-align:center;margin:0 5px}@media(max-width: 600px){.banner.svelte-1s8xgdt{font-size:1em}.socials.svelte-1s8xgdt{font-size:0.9em}}")}function nf(t){var e;return{c(){(e=N("div")).textContent="Pixeldrain's server host is having network problems. In order to\n\t\tensure stability for our paying customers the free download limit\n\t\thas been temporarily reduced to 1 GB",G(e,"class","highlight_yellow"),Q(e,"margin","3px")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function rf(t){var e;return{c(){(e=N("div")).innerHTML='Protect your privacy, protect your sanity. Get an ad blocker! security\n\t\t\tGet uBlock Origin',G(e,"class","banner support_banner svelte-1s8xgdt")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function af(t){var e;return{c(){(e=N("div")).innerHTML='Are you liking pixeldrain? Write a review! It really helps rate_review\n\t\t\tAlternativeTo rate_review\n\t\t\tTrustpilot',G(e,"class","banner support_banner svelte-1s8xgdt")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function sf(t){var e;return{c(){(e=N("div")).innerHTML='
    Pixeldrain is on the fediverse!
    people\n\t\t\t\tMastodon people\n\t\t\t\tLemmy
    ',G(e,"class","banner center svelte-1s8xgdt")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function of(t){var e;return{c(){(e=N("div")).innerHTML='No ads today. Pixeldrain is currently funded by our subscribers! bolt\n\t\t\tSupport Pixeldrain to help keep the project going',G(e,"class","banner support_banner svelte-1s8xgdt")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function lf(t){var e;function i(t,e){return"patreon_support"===t[0]?of:"socials"===t[0]?sf:"reviews"===t[0]?af:"ad_block"===t[0]?rf:"overload"===t[0]?nf:void 0}var n=i(t),r=n&&n(t);return{c(){r&&r.c(),e=q()},m(t,i){r&&r.m(t,i),R(t,e,i)},p(t,a){l(a,1)[0],n!==(n=i(t))&&(r&&r.d(1),(r=n&&n(t))&&(r.c(),r.m(e.parentNode,e)))},i:d,o:d,d(t){t&&F(e),r&&r.d(t)}}}function cf(t,e,i){var n="";return dt((()=>{var t=Math.random();i(0,n=t<.4?"socials":t<.5?"reviews":"patreon_support")})),[n]}class df extends Wt{constructor(t){super(),Bt(this,t,cf,lf,m,{},ef)}}function hf(t){A(t,"svelte-15cbknj",".sharebar.svelte-15cbknj.svelte-15cbknj{position:absolute;width:7em;left:-8em;bottom:0;top:0;overflow-y:scroll;overflow-x:hidden;background:var(--shaded_background);backdrop-filter:blur(4px);border-top-left-radius:16px;border-bottom-left-radius:16px;text-align:center;overflow:hidden;opacity:0;transition:left 0.4s, opacity 0.4s}.visible.svelte-15cbknj.svelte-15cbknj{left:calc(8em + 2px);opacity:1}.button_full_width.svelte-15cbknj.svelte-15cbknj{flex-direction:column;width:calc(100% - 6px)}.button_full_width.svelte-15cbknj>svg.svelte-15cbknj{height:3em;width:3em;fill:currentColor}")}function uf(t){var e,i,n,r,a,s,o,c,h,u,f,p,g,m,b;return{c(){e=N("div"),i=B("Share on:"),n=N("br"),r=W(),(a=N("button")).innerHTML='\n\t\tE-Mail',s=W(),(o=N("button")).innerHTML='\n\t\tReddit',c=W(),(h=N("button")).innerHTML='\n\t\tTwitter',u=W(),(f=N("button")).innerHTML='\n\t\tFacebook',p=W(),(g=N("button")).innerHTML='\n\t\tTumblr',G(a,"class","button_full_width svelte-15cbknj"),G(o,"class","button_full_width svelte-15cbknj"),G(h,"class","button_full_width svelte-15cbknj"),G(f,"class","button_full_width svelte-15cbknj"),G(g,"class","button_full_width svelte-15cbknj"),G(e,"class","sharebar svelte-15cbknj"),tt(e,"visible",t[0])},m(l,d){R(l,e,d),O(e,i),O(e,n),O(e,r),O(e,a),O(e,s),O(e,o),O(e,c),O(e,h),O(e,u),O(e,f),O(e,p),O(e,g),m||(b=[Y(a,"click",t[1]),Y(o,"click",t[2]),Y(h,"click",t[3]),Y(f,"click",t[4]),Y(g,"click",t[5])],m=!0)},p(t,i){1&l(i,1)[0]&&tt(e,"visible",t[0])},i:d,o:d,d(t){t&&F(e),m=!1,v(b)}}}function ff(t,e,i){var n=e.visible,r=void 0!==n&&n;return t.$$set=t=>{"visible"in t&&i(0,r=t.visible)},[r,()=>{window.open("mailto:please@set.address?subject=File%20on%20pixeldrain&body="+encodeURIComponent(window.location.href))},()=>{window.open("https://www.reddit.com/submit?url="+encodeURIComponent(window.location.href))},()=>{window.open("https://twitter.com/share?url="+encodeURIComponent(window.location.href))},()=>{window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(window.location.href))},()=>{window.open("http://www.tumblr.com/share/link?url="+encodeURIComponent(window.location.href))},()=>{i(0,r=!0)},()=>{i(0,r=!1)}]}class pf extends Wt{constructor(t){super(),Bt(this,t,ff,uf,m,{visible:0,show:6,hide:7},hf)}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}}function vf(t,e){var i=e.from,n=e.to,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=getComputedStyle(t),s="none"===a.transform?"":a.transform,o=l(a.transformOrigin.split(" ").map(parseFloat),2),c=o[0],d=o[1],h=i.left+i.width*c/n.width-(n.left+c),u=i.top+i.height*d/n.height-(n.top+d),f=r.delay,p=void 0===f?0:f,v=r.duration,m=void 0===v?t=>120*Math.sqrt(t):v,b=r.easing,x=void 0===b?Gt:b;return{delay:p,duration:g(m)?m(Math.sqrt(h*h+u*u)):m,easing:x,css:(t,e)=>{var r=e*h,a=e*u,o=t+e*i.width/n.width,l=t+e*i.height/n.height;return"transform: ".concat(s," translate(").concat(r,"px, ").concat(a,"px) scale(").concat(o,", ").concat(l,");")}}}var gf=z.window;function mf(t){A(t,"svelte-1cha9u3","#directory_element.svelte-1cha9u3.svelte-1cha9u3.svelte-1cha9u3{flex:1 1 auto;display:flex;flex-direction:column;overflow:auto;text-align:left}.directory_sorters.svelte-1cha9u3.svelte-1cha9u3.svelte-1cha9u3{flex:0 0 auto;display:flex;flex-direction:row;overflow:hidden;background:var(--body_background);min-width:850px;border-top-left-radius:8px;border-top-right-radius:8px;border-bottom:1px solid var(--separator)}.sorter_button.svelte-1cha9u3.svelte-1cha9u3.svelte-1cha9u3{display:inline-block;margin:4px 10px;text-align:initial;background:none;box-shadow:none}.sorter_button.svelte-1cha9u3.svelte-1cha9u3.svelte-1cha9u3:hover{background:var(--input_hover_background)}.directory_sorters.svelte-1cha9u3>.svelte-1cha9u3.svelte-1cha9u3:first-child,.node.svelte-1cha9u3>.svelte-1cha9u3.svelte-1cha9u3:first-child{flex-shrink:1;flex-grow:1}.directory_sorters.svelte-1cha9u3>.svelte-1cha9u3.svelte-1cha9u3:not(:first-child),.node.svelte-1cha9u3>.svelte-1cha9u3.svelte-1cha9u3:not(:first-child){flex-shrink:0;flex-grow:0}#directory_area.svelte-1cha9u3.svelte-1cha9u3.svelte-1cha9u3{flex:1 1 auto;margin:0;padding:0;overflow-x:auto;background:var(--body_background);border-bottom-left-radius:8px;border-bottom-right-radius:8px}#node_container.svelte-1cha9u3.svelte-1cha9u3.svelte-1cha9u3{display:block;min-width:850px}#footer.svelte-1cha9u3.svelte-1cha9u3.svelte-1cha9u3{flex-shrink:0;color:var(--background_text_color);padding:4px}.node.svelte-1cha9u3.svelte-1cha9u3.svelte-1cha9u3{display:flex;flex-direction:row;position:static;height:40px;overflow:hidden;margin:0;color:var(--body_text_color);text-decoration:none;transition:background 0.2s}.node.svelte-1cha9u3.svelte-1cha9u3.svelte-1cha9u3:hover:not(.node_selected){background:var(--input_hover_background);color:var(--input_text);text-decoration:none}.node_selected.svelte-1cha9u3.svelte-1cha9u3.svelte-1cha9u3{background:var(--highlight_background);color:var(--highlight_text_color)}.node.svelte-1cha9u3>div.svelte-1cha9u3.svelte-1cha9u3{height:100%;overflow:hidden;margin:auto 10px;padding:4px;display:inline-block;text-overflow:ellipsis;white-space:nowrap}.node.svelte-1cha9u3>div.svelte-1cha9u3>span.svelte-1cha9u3{margin:auto;display:block;text-overflow:ellipsis;white-space:nowrap}.node.svelte-1cha9u3>div.svelte-1cha9u3>img.svelte-1cha9u3{max-height:100%;margin-right:6px;width:auto;min-width:auto;float:left;display:block}")}function bf(t,e,i){var n=t.slice();return n[28]=e[i],n[30]=i,n}function xf(t,e,i){var n=t.slice();return n[31]=e[i],n}function _f(t){var e,i,n,r,a,s=t[31].name+"";return{c(){e=N("button"),i=B(s),n=W(),Q(e,"min-width",t[31].width),G(e,"class","sorter_button svelte-1cha9u3")},m(s,o){R(s,e,o),O(e,i),O(e,n),r||(a=Y(e,"click",(function(){g(t[5](t[31].field))&&t[5](t[31].field).apply(this,arguments)})),r=!0)},p(n,r){t=n,16&r[0]&&s!==(s=t[31].name+"")&&Z(i,s),16&r[0]&&Q(e,"min-width",t[31].width)},d(t){t&&F(e),r=!1,a()}}}function yf(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p,v,g,m,x,_,y,w,k,$,M,C=t[28].name+"",S=ke(new Date(t[28].dateCreated),0,0,!1)+"",T=t[28].sizeLabel+"",P=t[28].type+"";function D(){return t[17](t[30])}return{c(){e=N("a"),i=N("div"),n=N("img"),a=W(),s=N("span"),o=B(C),l=W(),c=N("div"),d=N("span"),h=B(S),u=W(),f=N("div"),p=N("span"),v=B(T),g=W(),m=N("div"),x=N("span"),_=B(P),y=W(),b(n.src,r=t[28].icon)||G(n,"src",r),G(n,"alt","thumbnail"),G(n,"class","svelte-1cha9u3"),G(s,"class","svelte-1cha9u3"),G(i,"class","svelte-1cha9u3"),G(d,"class","svelte-1cha9u3"),Q(c,"width",t[4][1].width),G(c,"class","svelte-1cha9u3"),G(p,"class","svelte-1cha9u3"),Q(f,"width",t[4][2].width),G(f,"class","svelte-1cha9u3"),G(x,"class","svelte-1cha9u3"),Q(m,"width",t[4][3].width),G(m,"class","svelte-1cha9u3"),G(e,"class","node svelte-1cha9u3"),G(e,"href",w=t[28].href),G(e,"target","_blank"),G(e,"rel","noreferrer"),G(e,"title",k=t[28].name),tt(e,"node_selected",t[28].selected)},m(t,r){R(t,e,r),O(e,i),O(i,n),O(i,a),O(i,s),O(s,o),O(e,l),O(e,c),O(c,d),O(d,h),O(e,u),O(e,f),O(f,p),O(p,v),O(e,g),O(e,m),O(m,x),O(x,_),O(e,y),$||(M=Y(e,"click",U(D)),$=!0)},p(i,a){t=i,8&a[0]&&!b(n.src,r=t[28].icon)&&G(n,"src",r),8&a[0]&&C!==(C=t[28].name+"")&&Z(o,C),8&a[0]&&S!==(S=ke(new Date(t[28].dateCreated),0,0,!1)+"")&&Z(h,S),16&a[0]&&Q(c,"width",t[4][1].width),8&a[0]&&T!==(T=t[28].sizeLabel+"")&&Z(v,T),16&a[0]&&Q(f,"width",t[4][2].width),8&a[0]&&P!==(P=t[28].type+"")&&Z(_,P),16&a[0]&&Q(m,"width",t[4][3].width),8&a[0]&&w!==(w=t[28].href)&&G(e,"href",w),8&a[0]&&k!==(k=t[28].name)&&G(e,"title",k),8&a[0]&&tt(e,"node_selected",t[28].selected)},d(t){t&&F(e),$=!1,M()}}}function wf(t){var e,i=t[28].visible&&!t[28].filtered&&yf(t);return{c(){i&&i.c(),e=q()},m(t,n){i&&i.m(t,n),R(t,e,n)},p(t,n){t[28].visible&&!t[28].filtered?i?i.p(t,n):((i=yf(t)).c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null)},d(t){t&&F(e),i&&i.d(t)}}}function kf(t){for(var e,i,n,r,a,s,o,l,c,h,u=jt(t[4]),f=[],p=0;p{if(t=t.toLowerCase(),o=t,""===t){for(var e in s)i(3,s[e].filtered=!1,s);return u(""),void p()}for(var n in s)s[n].name.toLowerCase().includes(t)?i(3,s[n].filtered=!1,s):i(3,s[n].filtered=!0,s);u(""),p()},c="dateCreated",d=!1,h=[{name:"Name",field:"name",width:""},{name:"Creation date",field:"dateCreated",width:"160px"},{name:"Size",field:"size",width:"90px"},{name:"Type",field:"type",width:"200px"}],u=t=>{""===t?t=c:c!==t?(d=!0,c=t):c===t&&(d=!d);var e,n,r=0;for(var a in h)h[a].field==t&&(r=a),i(4,h[a].name=h[a].name.replace("▲ ","").replace("▼ ",""),h);i(4,h[r].name=d?"▼ "+h[r].name:"▲ "+h[r].name,h),i(4,h),s.sort(((t,i)=>(e=t[c],n=i[c],"number"==typeof e?d?e-n:n-e:d?e.localeCompare(n,void 0,{numeric:!0}):n.localeCompare(e,void 0,{numeric:!0})))),p()},f=!1,p=()=>{var t=n.scrollTop-n.scrollTop%40,e=Math.floor(t/40)-5;e<0&&(e=0);var o=Math.ceil((t+n.clientHeight)/40)+5;o>s.length&&(o=s.length-1),i(1,r.style.paddingTop=40*e+"px",r);var l=0,c=0,d=0,h=0;for(var u in s)l>=e&&l<=o&&!s[u].filtered?i(3,s[u].visible=!0,s):i(3,s[u].visible=!1,s),s[u].filtered||(l++,c+=s[u].size,s[u].selected&&(d++,h+=s[u].size));i(1,r.style.height=40*l+"px",r),i(2,a=l+" items ("+be(c,4)+")"),0!==d&&i(2,a+=", "+d+" selected ("+be(h,4)+")")},v=!1,g=!1,m=e.multi_select,b=void 0===m||m,x=-1,_=t=>{if(v){if(b&&g&&-1!=x){var e=x,n=x;x{"multi_select"in t&&i(16,b=t.multi_select)},[n,r,a,s,h,u,t=>{f||(f=!0,setTimeout((()=>{p(),f=!1}),100))},t=>{"Shift"===t.key&&(g="keydown"===t.type)},_,()=>{i(3,s=[])},(t,e,i,n,r,a,o,l)=>{s.push({id:t,icon:e,name:i,href:n,type:r,size:a,sizeLabel:o,dateCreated:l,selected:!1,filtered:!1,visible:!1})},()=>{l(o)},()=>{var t=[];for(var e in s)s[e].selected&&t.push(s[e]);return t},l,()=>{for(var t in s)if(s[t].visible&&!s[t].filtered){window.open(s[t].href,"_blank");break}},t=>{if(v=t,!t){for(var e in s)i(3,s[e].selected=!1,s);p()}},b,t=>{_(t)},function(t){pt[t?"unshift":"push"]((()=>{i(1,r=t)}))},function(t){pt[t?"unshift":"push"]((()=>{i(0,n=t)}))}]}class Mf extends Wt{constructor(t){super(),Bt(this,t,$f,kf,m,{reset:9,addFile:10,renderFiles:11,getSelectedFiles:12,search:13,searchSubmit:14,setSelectionMode:15,multi_select:16},mf,[-1,-1])}get reset(){return this.$$.ctx[9]}get addFile(){return this.$$.ctx[10]}get renderFiles(){return this.$$.ctx[11]}get getSelectedFiles(){return this.$$.ctx[12]}get search(){return this.$$.ctx[13]}get searchSubmit(){return this.$$.ctx[14]}get setSelectionMode(){return this.$$.ctx[15]}}var Cf=z.window;function Sf(t){A(t,"svelte-wksniz",".dir_container.svelte-wksniz{height:100%;width:100%;display:flex;flex-direction:column;overflow:hidden}.header.svelte-wksniz{flex-grow:1;flex-shrink:1;display:flex;flex-direction:row;align-items:center;justify-content:center;font-size:1em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title.svelte-wksniz{flex-grow:1;flex-shrink:1;text-align:center;font-size:1.2em}.search.svelte-wksniz{min-width:100px;max-width:300px;flex-grow:1;flex-shrink:1;align-self:stretch}@media(max-width: 700px){.title.svelte-wksniz{display:none}.search.svelte-wksniz{max-width:none}}.button.svelte-wksniz{flex-grow:0;flex-shrink:0}")}function Tf(t){var e,i,n,r={multi_select:t[0]};return i=new Mf({props:r}),t[10](i),{c(){e=N("div"),Ht(i.$$.fragment),G(e,"class","dir_container svelte-wksniz")},m(t,r){R(t,e,r),Nt(i,e,null),n=!0},p(t,e){var n={};1&e&&(n.multi_select=t[0]),i.$set(n)},i(t){n||(zt(i.$$.fragment,t),n=!0)},o(t){Ot(i.$$.fragment,t),n=!1},d(n){n&&F(e),t[10](null),Vt(i)}}}function Pf(t){var e,i,n,r,a,s,o,l,c,d,h;return{c(){e=N("div"),(i=N("button")).innerHTML='close Cancel',n=W(),r=N("div"),a=B(t[1]),s=W(),o=N("input"),l=W(),(c=N("button")).innerHTML='done Add',G(i,"class","button round svelte-wksniz"),G(r,"class","title svelte-wksniz"),G(o,"class","search svelte-wksniz"),G(o,"type","text"),G(o,"placeholder","press / to search"),G(c,"class","button button_highlight round svelte-wksniz"),G(e,"class","header svelte-wksniz"),G(e,"slot","title")},m(u,f){R(u,e,f),O(e,i),O(e,n),O(e,r),O(r,a),O(e,s),O(e,o),t[9](o),O(e,l),O(e,c),d||(h=[Y(i,"click",(function(){g(t[2].hide)&&t[2].hide.apply(this,arguments)})),Y(o,"keyup",t[5]),Y(c,"click",t[6])],d=!0)},p(e,i){t=e,2&i&&Z(a,t[1])},d(i){i&&F(e),t[9](null),d=!1,v(h)}}}function Df(t){var e,i,n,r;return e=new ge({props:{width:"1400px",height:"1200px",$$slots:{title:[Pf],default:[Tf]},$$scope:{ctx:t}}}),t[11](e),{c(){Ht(e.$$.fragment)},m(a,s){Nt(e,a,s),i=!0,n||(r=Y(Cf,"keydown",t[7]),n=!0)},p(t,i){var n=l(i,1)[0],r={};16415&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[11](null),Vt(e,i),n=!1,r()}}}function Lf(t,e,n){var r,a,s,l=ht(),c=e.multi_select,d=void 0===c||c,h=e.title,u=void 0===h?"":h,f=function(){var t=i(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.show(),t.next=3,_t();case 3:a.setSelectionMode(!0),p();case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),p=()=>{fetch(window.api_endpoint+"/user/files").then((t=>(t.ok||Promise.reject("yo"),t.json()))).then((t=>{for(var e in a.reset(),t.files)a.addFile(t.files[e].id,window.api_endpoint+"/file/"+t.files[e].id+"/thumbnail?width=32&height=32",t.files[e].name,"/u/"+t.files[e].id,t.files[e].mime_type,t.files[e].size,be(t.files[e].size,4),t.files[e].date_upload);a.renderFiles()})).catch((t=>{throw t}))};return t.$$set=t=>{"multi_select"in t&&n(0,d=t.multi_select),"title"in t&&n(1,u=t.title)},[d,u,r,a,s,t=>{27===t.keyCode&&(t.preventDefault(),n(4,s.value="",s),s.blur()),requestAnimationFrame((()=>{a.search(s.value)}))},()=>{var t=a.getSelectedFiles();t.length>0&&l("files",t),r.hide()},t=>{r.is_visible()&&(t.ctrlKey||t.altKey||t.metaKey||document.activeElement.type&&"text"===document.activeElement.type||"/"===t.key&&(t.preventDefault(),s.focus()))},f,function(t){pt[t?"unshift":"push"]((()=>{n(4,s=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(3,a=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(2,r=t)}))}]}class zf extends Wt{constructor(t){super(),Bt(this,t,Lf,Df,m,{multi_select:0,title:1,open:8},Sf)}get open(){return this.$$.ctx[8]}}function Of(t){A(t,"svelte-85yow",".gallery.svelte-85yow.svelte-85yow{width:100%;max-height:100%;overflow:auto;display:flex;flex-wrap:wrap;justify-content:center}.file.svelte-85yow.svelte-85yow{width:200px;max-width:42%;height:200px;margin:8px;overflow:hidden;border-radius:8px;background:var(--input_background);word-break:break-all;text-align:center;line-height:1.2em;display:inline-block;text-overflow:ellipsis;text-decoration:none;vertical-align:top;color:var(--body_text_color);transition:background 0.2s, padding 0.2s, box-shadow 0.2s;box-shadow:1px 1px 0px 0px var(--shadow_color)}.file.svelte-85yow.svelte-85yow:hover{background:var(--input_hover_background)}.highlight.svelte-85yow.svelte-85yow{box-shadow:0 0 0px 2px var(--highlight_color);text-decoration:none}.icon_container.svelte-85yow.svelte-85yow{margin:3px;height:148px;border-radius:6px;background-position:center;background-size:contain;background-repeat:no-repeat;font-size:22px;text-align:left}.icon_container.editing.svelte-85yow.svelte-85yow{box-shadow:inset 0 60px 40px -20px var(--body_color)}.icon_container.wide.svelte-85yow.svelte-85yow{background-size:cover}.button_row.svelte-85yow.svelte-85yow{display:flex;flex-direction:row}.button_row.svelte-85yow>.icon.svelte-85yow{flex:0 0 auto;color:var(--body_text_color)}.button_row.svelte-85yow>button.svelte-85yow{flex:0 0 auto;padding:0}.button_row.svelte-85yow>.separator.svelte-85yow{flex:1 1 auto}.add_button.svelte-85yow.svelte-85yow{width:200px;max-width:42%;height:200px;margin:8px;border-radius:8px;background:var(--body_color);text-align:center;line-height:1.2em;display:inline-block;vertical-align:top;color:var(--body_text_color);display:flex;flex-direction:column}.add_button.svelte-85yow>.svelte-85yow{flex:1 1 auto;font-size:1.5em;cursor:pointer;flex-direction:column;justify-content:center}")}function Af(t,e,i){var n=t.slice();return n[26]=e[i],n[28]=i,n}function Ef(t){var e,i,n,r,a,s;return{c(){e=N("div"),(i=N("button")).innerHTML='cloud_upload\n\t\t\t\tUpload files',n=W(),(r=N("button")).innerHTML='add\n\t\t\t\tAdd files',G(i,"class","add_button_part svelte-85yow"),G(r,"class","add_button_part svelte-85yow"),G(e,"class","add_button svelte-85yow"),G(e,"role","listitem"),tt(e,"highlight",!t[3]&&-2===t[2])},m(o,l){R(o,e,l),O(e,i),O(e,n),O(e,r),a||(s=[Y(i,"click",t[13]),Y(r,"click",(function(){g(t[1].open)&&t[1].open.apply(this,arguments)})),Y(e,"drop",U(t[14])),Y(e,"dragover",X(U(t[12]))),Y(e,"dragenter",t[15]),Y(e,"dragend",t[16])],a=!0)},p(i,n){t=i,12&n&&tt(e,"highlight",!t[3]&&-2===t[2])},d(t){t&&F(e),a=!1,v(s)}}}function jf(t){var e,i,n,r,a,s,o,l,c,d,h,u;function f(){return t[17](t[28])}function p(){return t[18](t[28])}function g(){return t[19](t[28])}return{c(){e=N("div"),(i=N("i")).textContent="drag_indicator",n=W(),r=N("div"),a=W(),(s=N("button")).textContent="chevron_left",o=W(),(l=N("button")).textContent="chevron_right",c=W(),(d=N("button")).textContent="delete",G(i,"class","icon svelte-85yow"),Q(i,"cursor","grab"),G(r,"class","separator svelte-85yow"),G(s,"class","icon svelte-85yow"),G(l,"class","icon svelte-85yow"),G(d,"class","icon svelte-85yow"),G(e,"class","button_row svelte-85yow")},m(t,v){R(t,e,v),O(e,i),O(e,n),O(e,r),O(e,a),O(e,s),O(e,o),O(e,l),O(e,c),O(e,d),h||(u=[Y(s,"click",X(U(f))),Y(l,"click",X(U(p))),Y(d,"click",X(U(g)))],h=!0)},p(e,i){t=e},d(t){t&&F(e),h=!1,v(u)}}}function If(t,e){var i,n,r,a,s,o,l,c,h,f,p=e[26].name+"",g=d,m=e[0].can_edit&&jf(e);function b(){for(var t=arguments.length,i=new Array(t),n=0;n{if(!k&&t>=g&&(k=!0),k&&t>=b&&(_(1,0),$()),!w)return!1;if(k){var e=0+1*p((t-g)/h);_(e,1-e)}return!0})),y&&(a=at(t,0,1,h,l,p,y)),l||(k=!0),_(0,1),$}(i,c,vf,{duration:400})},d(t){t&&F(i),m&&m.d(),h=!1,v(f)}}}function Rf(t){for(var e,i,n,r,a,s=[],o=new Map,c=t[0].can_edit&&Ef(t),d=jt(t[0].files),h=t=>t[26],u=0;u{i.push(t)})),a("update_list",i);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),d=function(){var t=i(o().mark((function t(e){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(i=l.files).splice(e,1),n(0,l.files=i,l),a("update_list",i);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),h=function(){var t=i(o().mark((function t(e){var i,r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==e){t.next=2;break}return t.abrupt("return");case 2:i=l.files,r=[i[e-1],i[e]],i[e]=r[0],i[e-1]=r[1],n(0,l.files=i,l),a("update_list",i);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),u=function(){var t=i(o().mark((function t(e){var i,r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e>=l.files.length-1)){t.next=2;break}return t.abrupt("return");case 2:i=l.files,r=[i[e+1],i[e]],i[e]=r[0],i[e+1]=r[1],n(0,l.files=i,l),a("update_list",i);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),f=-1,p=!1,v=(t,e)=>{n(3,p=!0),t.dataTransfer.effectAllowed="move",t.dataTransfer.dropEffect="move",t.dataTransfer.setData("text/plain",e)},g=(t,e)=>{if(n(2,f=-1),n(3,p=!1),0===t.dataTransfer.files.length){if(-2!==e){t.dataTransfer.dropEffect="move";var i=parseInt(t.dataTransfer.getData("text/plain")),r=l.files;if(ie))return;r.splice(e,0,r[i]),r.splice(i+1,1)}a("update_list",r)}}else a("upload_files",t.dataTransfer.files)};return t.$$set=t=>{"list"in t&&n(0,l=t.list)},[l,r,f,p,a,c,d,h,u,v,g,function(e){ut.call(this,t,e)},function(e){ut.call(this,t,e)},t=>a("pick_files"),t=>g(t,-2),()=>n(2,f=-2),()=>{n(2,f=-1)},t=>{h(t)},t=>{u(t)},t=>{d(t)},(t,e)=>v(e,t),(t,e)=>g(e,t),t=>n(2,f=t),()=>{n(2,f=-1),n(3,p=!1)},function(t){pt[t?"unshift":"push"]((()=>{n(1,r=t)}))},t=>{c(t.detail)}]}class Hf extends Wt{constructor(t){super(),Bt(this,t,Ff,Rf,m,{list:0},Of)}}function Nf(t){A(t,"svelte-cqjgl6",".download_frame.svelte-cqjgl6{position:absolute;display:none;width:1px;height:1px}.captcha_container.svelte-cqjgl6{text-align:center}.captcha_container.svelte-cqjgl6>div{display:inline-block}")}function Vf(t){var e;return{c(){(e=N("script")).innerHTML="",b(e.src,"https://www.google.com/recaptcha/api.js?onload=captcha_script_loaded&render=explicit")||G(e,"src","https://www.google.com/recaptcha/api.js?onload=captcha_script_loaded&render=explicit")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function Bf(t){var e,i,n,r,a,s;return{c(){e=N("p"),i=B(t[8]),n=W(),r=N("p"),a=B("Reponse code: "),s=B(t[7]),G(e,"class","indent"),G(r,"class","indent")},m(t,o){R(t,e,o),O(e,i),R(t,n,o),R(t,r,o),O(r,a),O(r,s)},p(t,e){256&e&&Z(i,t[8]),128&e&&Z(s,t[7])},d(t){t&&(F(e),F(n),F(r))}}}function Wf(t){var e;return{c(){(e=N("p")).textContent="A lot of downloads have originated from this IP address lately.\n\t\t\tPlease prove that you are not a robot:",G(e,"class","indent")},m(t,i){R(t,e,i)},p:d,d(t){t&&F(e)}}}function qf(t){var e;return{c(){(e=N("p")).textContent="According to our scanning systems this file may contain a virus.\n\t\t\tYou can continue downloading this file at your own risk, but you\n\t\t\twill have to prove that you're a human first.",G(e,"class","indent")},m(t,i){R(t,e,i)},p:d,d(t){t&&F(e)}}}function Yf(t){var e;return{c(){(e=N("p")).textContent="This file is using a suspicious amount of bandwidth relative to\n\t\t\tits popularity. To continue downloading this file you will have\n\t\t\tto prove that you're a human first.",G(e,"class","indent")},m(t,i){R(t,e,i)},p:d,d(t){t&&F(e)}}}function Uf(t){var e,i,n,r;function a(t,e){return"rate_limit"===t[3]?Yf:"malware"===t[3]?qf:"ip_rate_limit"===t[3]?Wf:Bf}var s=a(t),o=s(t);return{c(){o.c(),e=W(),i=N("br"),n=W(),G(r=N("div"),"class","captcha_container svelte-cqjgl6")},m(a,s){o.m(a,s),R(a,e,s),R(a,i,s),R(a,n,s),R(a,r,s),t[14](r)},p(t,i){s===(s=a(t))&&o?o.p(t,i):(o.d(1),(o=s(t))&&(o.c(),o.m(e.parentNode,e)))},d(a){a&&(F(e),F(i),F(n),F(r)),o.d(a),t[14](null)}}}function Xf(t){var e,i,n,r,a,s;return{c(){e=N("p"),i=B("Can't download file: "),n=B(t[7]),r=W(),a=N("p"),s=B(t[8])},m(t,o){R(t,e,o),O(e,i),O(e,n),R(t,r,o),R(t,a,o),O(a,s)},p(t,e){128&e&&Z(n,t[7]),256&e&&Z(s,t[8])},d(t){t&&(F(e),F(r),F(a))}}}function Gf(t){var e,i,n,r,a,s,o,c,d=t[1]&&Vf(),h={title:t[4],width:"500px",$$slots:{default:[Uf]},$$scope:{ctx:t}};return a=new ge({props:h}),t[15](a),o=new ge({props:{title:"Download error",width:"500px",padding:!0,$$slots:{default:[Xf]},$$scope:{ctx:t}}}),t[16](o),{c(){d&&d.c(),e=q(),i=W(),n=N("iframe"),r=W(),Ht(a.$$.fragment),s=W(),Ht(o.$$.fragment),G(n,"class","download_frame svelte-cqjgl6"),G(n,"title","File download frame")},m(l,h){d&&d.m(document.head,null),O(document.head,e),R(l,i,h),R(l,n,h),t[13](n),R(l,r,h),Nt(a,l,h),R(l,s,h),Nt(o,l,h),c=!0},p(t,i){var n=l(i,1)[0];t[1]?d||((d=Vf()).c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null);var r={};16&n&&(r.title=t[4]),131496&n&&(r.$$scope={dirty:n,ctx:t}),a.$set(r);var s={};131456&n&&(s.$$scope={dirty:n,ctx:t}),o.$set(s)},i(t){c||(zt(a.$$.fragment,t),zt(o.$$.fragment,t),c=!0)},o(t){Ot(a.$$.fragment,t),Ot(o.$$.fragment,t),c=!1},d(l){l&&(F(i),F(n),F(r),F(s)),d&&d.d(l),F(e),t[13](null),t[15](null),Vt(a,l),t[16](null),Vt(o,l)}}}function Kf(t,e,n){var r,a,s,l=e.file,c=void 0===l?{id:"",availability:"",download_href:""}:l,d=e.list,h=void 0===d?{id:"",download_href:""}:d,u=!1,f="",p="",v=null,g="",m="";return t.$$set=t=>{"file"in t&&n(9,c=t.file),"list"in t&&n(10,h=t.list)},[r,u,a,f,p,s,v,g,m,c,h,()=>{if(!window.viewer_data.captcha_key)return console.debug("Server doesn't support captcha, starting download"),void n(0,r.src=c.download_href,r);if(""===c.availability)return console.debug("File is available, starting download"),void n(0,r.src=c.download_href,r);if(!c.availability.endsWith("_captcha_required"))return n(7,g=c.availability),n(8,m=c.availability_message),v.show(),void console.debug("File is unavailable, showing error message");console.debug("File is not readily available, showing captcha dialog");var t=t=>{n(0,r.src=c.download_href+"&recaptcha_response="+t,r),a.hide()};window.captcha_script_loaded=i(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a.show(),e.next=3,_t();case 3:grecaptcha.render(s,{sitekey:window.viewer_data.captcha_key,theme:"dark",callback:t});case 4:case"end":return e.stop()}}),e)}))),"file_rate_limited_captcha_required"===c.availability?(n(3,f="rate_limit"),n(4,p="Rate limiting enabled!")):"virus_detected_captcha_required"===c.availability?(n(3,f="malware"),n(4,p="Malware warning!")):"ip_download_limited_captcha_required"===c.availability||"ip_transfer_limited_captcha_required"===c.availability?(n(3,f="ip_rate_limit"),n(4,p="IP address rate limited")):(n(4,p="CAPTCHA required"),n(7,g=c.availability),n(8,m=c.availability_message)),u?(console.debug("Captcha script is already loaded. Show the modal"),captcha_script_loaded()):(console.debug("Captcha script has not been loaded yet. Embedding now"),n(1,u=!0))},()=>{""!==h.id&&n(0,r.src=h.download_href,r)},function(t){pt[t?"unshift":"push"]((()=>{n(0,r=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(5,s=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(2,a=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(6,v=t)}))}]}class Zf extends Wt{constructor(t){super(),Bt(this,t,Kf,Gf,m,{file:9,list:10,download_file:11,download_list:12},Nf)}get download_file(){return this.$$.ctx[11]}get download_list(){return this.$$.ctx[12]}}function Jf(t){A(t,"svelte-1bp6kn9",".border_top.svelte-1bp6kn9{border-top:solid 2px var(--separator)}.image.svelte-1bp6kn9{display:block;margin:auto;max-height:90px;max-width:100%}@media(max-height: 600px){.image.svelte-1bp6kn9{max-height:60px}}")}function Qf(t){var e;function i(t,e){return t[1]?ep:tp}var n=i(t),r=n(t);return{c(){e=N("div"),r.c(),G(e,"class","svelte-1bp6kn9"),tt(e,"border_top",t[2])},m(t,i){R(t,e,i),r.m(e,null)},p(t,a){n===(n=i(t))&&r?r.p(t,a):(r.d(1),(r=n(t))&&(r.c(),r.m(e,null))),4&a&&tt(e,"border_top",t[2])},d(t){t&&F(e),r.d()}}}function tp(t){var e,i;return{c(){G(e=N("img"),"class","image svelte-1bp6kn9"),b(e.src,i=t[0])||G(e,"src",i),G(e,"alt","User-provided banner")},m(t,i){R(t,e,i)},p(t,n){1&n&&!b(e.src,i=t[0])&&G(e,"src",i)},d(t){t&&F(e)}}}function ep(t){var e,i,n;return{c(){e=N("a"),G(i=N("img"),"class","image svelte-1bp6kn9"),b(i.src,n=t[0])||G(i,"src",n),G(i,"alt","User-provided banner"),G(e,"href",t[1]),G(e,"target","_blank"),G(e,"rel","noreferrer")},m(t,n){R(t,e,n),O(e,i)},p(t,r){1&r&&!b(i.src,n=t[0])&&G(i,"src",n),2&r&&G(e,"href",t[1])},d(t){t&&F(e)}}}function ip(t){var e,i=t[0]&&Qf(t);return{c(){i&&i.c(),e=q()},m(t,n){i&&i.m(t,n),R(t,e,n)},p(t,n){var r=l(n,1)[0];t[0]?i?i.p(t,r):((i=Qf(t)).c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null)},i:d,o:d,d(t){t&&F(e),i&&i.d(t)}}}function np(t,e,i){var n=e.src,r=void 0===n?"":n,a=e.link,s=void 0===a?"":a,o=e.border_top,l=void 0!==o&&o;return t.$$set=t=>{"src"in t&&i(0,r=t.src),"link"in t&&i(1,s=t.link),"border_top"in t&&i(2,l=t.border_top)},[r,s,l]}class rp extends Wt{constructor(t){super(),Bt(this,t,np,ip,m,{src:0,link:1,border_top:2},Jf)}}function ap(t){A(t,"svelte-1xodoj",".container.svelte-1xodoj{position:fixed;top:10px;right:10px;height:120px;width:120px}")}function sp(t){var e,i,n;return i=new ic({}),{c(){e=N("div"),Ht(i.$$.fragment),G(e,"class","container svelte-1xodoj")},m(t,r){R(t,e,r),Nt(i,e,null),n=!0},i(t){n||(zt(i.$$.fragment,t),n=!0)},o(t){Ot(i.$$.fragment,t),n=!1},d(t){t&&F(e),Vt(i)}}}function op(t){var e,i,n=t[0]&&sp();return{c(){n&&n.c(),e=q()},m(t,r){n&&n.m(t,r),R(t,e,r),i=!0},p(t,i){var r=l(i,1)[0];t[0]?n?1&r&&zt(n,1):((n=sp()).c(),zt(n,1),n.m(e.parentNode,e)):n&&(Dt(),Ot(n,1,1,(()=>{n=null})),Lt())},i(t){i||(zt(n),i=!0)},o(t){Ot(n),i=!1},d(t){t&&F(e),n&&n.d(t)}}}function lp(t,e,i){var n=e.loading,r=void 0!==n&&n;return t.$$set=t=>{"loading"in t&&i(0,r=t.loading)},[r]}class cp extends Wt{constructor(t){super(),Bt(this,t,lp,op,m,{loading:0},ap)}}function dp(t){A(t,"svelte-14gguks",".progress_bar_outer.svelte-14gguks{position:relative;display:block;width:100%;height:16px;font-size:14px;line-height:15px;overflow:hidden}.progress_bar_inner.svelte-14gguks{position:absolute;display:block;background:var(--highlight_background);height:100%;width:0;transition:width 5s linear;text-align:right;overflow:hidden;white-space:nowrap;color:var(--highlight_text_color);padding-right:4px;padding-left:4px;z-index:2}.progress_bar_text.svelte-14gguks{position:absolute;display:block;top:0;left:4px;z-index:1}")}function hp(t){var e,i,n,r,a;return{c(){e=N("div"),i=B(t[2]),n=W(),r=N("div"),a=B(t[2]),G(e,"class","progress_bar_text svelte-14gguks"),G(r,"class","progress_bar_inner svelte-14gguks"),Q(r,"width",t[1]+"%")},m(t,s){R(t,e,s),O(e,i),R(t,n,s),R(t,r,s),O(r,a)},p(t,e){4&e&&Z(i,t[2]),4&e&&Z(a,t[2]),2&e&&Q(r,"width",t[1]+"%")},d(t){t&&(F(e),F(n),F(r))}}}function up(t){var e,i=t[0].limits_init&&hp(t);return{c(){e=N("div"),i&&i.c(),G(e,"class","progress_bar_outer svelte-14gguks"),G(e,"title",t[2])},m(t,n){R(t,e,n),i&&i.m(e,null)},p(t,n){var r=l(n,1)[0];t[0].limits_init?i?i.p(t,r):((i=hp(t)).c(),i.m(e,null)):i&&(i.d(1),i=null),4&r&&G(e,"title",t[2])},i:d,o:d,d(t){t&&F(e),i&&i.d()}}}function fp(t,e,i){var n;x(t,vc,(t=>i(0,n=t)));var r=0,a="";return t.$$.update=()=>{1&t.$$.dirty&&(0===n.limits.transfer_limit?i(1,r=0):n.limits.transfer_limit_used/n.limits.transfer_limit>1?i(1,r=100):i(1,r=n.limits.transfer_limit_used/n.limits.transfer_limit*100),i(2,a="Download limit used: "+be(n.limits.transfer_limit_used,3)+" of "+be(n.limits.transfer_limit,3)))},[n,r,a]}class pp extends Wt{constructor(t){super(),Bt(this,t,fp,up,m,{},dp)}}function vp(t){A(t,"svelte-15dc38",".label.svelte-15dc38{text-align:left;padding-left:10px;font-size:0.8em;line-height:0.7em;margin-top:0.5em}.stat.svelte-15dc38{text-align:center}")}function gp(t){var e,i,n,r,a,s,o,c,h,u,f,p,v,g,m,b,x,_,y,w,k=t[0].files.length+"",$=me(t[2])+"",M=me(t[1])+"",C=be(t[3],3)+"";return{c(){e=N("div"),(i=N("div")).textContent="Files",n=W(),r=N("div"),a=B(k),s=W(),(o=N("div")).textContent="Views",c=W(),h=N("div"),u=B($),f=W(),(p=N("div")).textContent="Downloads",v=W(),g=N("div"),m=B(M),b=W(),(x=N("div")).textContent="Size",_=W(),y=N("div"),w=B(C),G(i,"class","label svelte-15dc38"),G(r,"class","stat svelte-15dc38"),G(o,"class","label svelte-15dc38"),G(h,"class","stat svelte-15dc38"),G(p,"class","label svelte-15dc38"),G(g,"class","stat svelte-15dc38"),G(x,"class","label svelte-15dc38"),G(y,"class","stat svelte-15dc38")},m(t,l){R(t,e,l),O(e,i),O(e,n),O(e,r),O(r,a),O(e,s),O(e,o),O(e,c),O(e,h),O(h,u),O(e,f),O(e,p),O(e,v),O(e,g),O(g,m),O(e,b),O(e,x),O(e,_),O(e,y),O(y,w)},p(t,e){var i=l(e,1)[0];1&i&&k!==(k=t[0].files.length+"")&&Z(a,k),4&i&&$!==($=me(t[2])+"")&&Z(u,$),2&i&&M!==(M=me(t[1])+"")&&Z(m,M),8&i&&C!==(C=be(t[3],3)+"")&&Z(w,C)},i:d,o:d,d(t){t&&F(e)}}}function mp(t,e,i){var n,r,a,s=e.list,o=void 0===s?{files:[]}:s;return t.$$set=t=>{"list"in t&&i(0,o=t.list)},t.$$.update=()=>{1&t.$$.dirty&&i(3,n=o.files.reduce(((t,e)=>t+e.size),0)),1&t.$$.dirty&&i(2,r=o.files.reduce(((t,e)=>t+e.views),0)),1&t.$$.dirty&&i(1,a=o.files.reduce(((t,e)=>(0===e.size?t+=e.downloads:t+=Math.round((e.bandwidth_used+e.bandwidth_used_paid)/e.size),t)),0))},[o,a,r,n]}class bp extends Wt{constructor(t){super(),Bt(this,t,mp,gp,m,{list:0},vp)}}function xp(t){A(t,"svelte-1ynjlv4",".drag_target.svelte-1ynjlv4{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:50px;font-size:2em;background-color:rgba(0, 0, 0, 0.5);border-radius:100px;box-shadow:0 0 10px 10px rgba(0, 0, 0, 0.5)}")}function _p(t){var e,i,n;return{c(){(e=N("div")).textContent="Drop files here to upload them",G(e,"class","drag_target svelte-1ynjlv4")},m(t,i){R(t,e,i),n=!0},i(t){n||(t&&yt((()=>{n&&(i||(i=Et(e,Kt,{duration:200},!0)),i.run(1))})),n=!0)},o(t){t&&(i||(i=Et(e,Kt,{duration:200},!1)),i.run(0)),n=!1},d(t){t&&F(e),t&&i&&i.end()}}}function yp(t){var e,i,n,r=t[0]&&_p();return{c(){r&&r.c(),e=q()},m(a,s){r&&r.m(a,s),R(a,e,s),i||(n=[Y(window,"dragover",X(U(t[3]))),Y(window,"dragenter",X(U(t[4]))),Y(window,"dragleave",X(U(t[5]))),Y(window,"drop",t[1]),Y(window,"paste",t[2])],i=!0)},p(t,i){var n=l(i,1)[0];t[0]?r?1&n&&zt(r,1):((r=_p()).c(),zt(r,1),r.m(e.parentNode,e)):r&&(Dt(),Ot(r,1,1,(()=>{r=null})),Lt())},i(t){zt(r)},o(t){Ot(r)},d(t){t&&F(e),r&&r.d(t),i=!1,v(n)}}}function wp(t,e,i){var n=ht(),r=!1;return[r,t=>{i(0,r=!1),t.dataTransfer&&t.dataTransfer.items.length>0&&(t.preventDefault(),t.stopPropagation(),n("upload",t.dataTransfer.files))},t=>{0!==t.clipboardData.files.length&&(t.preventDefault(),t.stopPropagation(),n("upload",t.clipboardData.files))},()=>{i(0,r=!0)},()=>{i(0,r=!0)},()=>{i(0,r=!1)}]}class kp extends Wt{constructor(t){super(),Bt(this,t,wp,yp,m,{},xp)}}function $p(t){A(t,"svelte-1204y2u",".upload_progress.svelte-1204y2u{display:block;padding:2px 4px 1px 4px;margin:4px;border-radius:4px}.error.svelte-1204y2u{background:var(--danger_color);color:var(--highlight_text_color)}")}function Mp(t){var e,i,n,r,a;return{c(){e=B(t[4]),i=N("br"),n=W(),r=B(t[3]),a=N("br")},m(t,s){R(t,e,s),R(t,i,s),R(t,n,s),R(t,r,s),R(t,a,s)},p(t,i){16&i&&Z(e,t[4]),8&i&&Z(r,t[3])},d(t){t&&(F(e),F(i),F(n),F(r),F(a))}}}function Cp(t){var e,i,n,r,a,s,o,c,d=t[0].name+"",h=""!==t[3]&&Mp(t);return s=new dc({props:{total:t[1],used:t[2]}}),{c(){e=N("div"),i=B(d),n=N("br"),r=W(),h&&h.c(),a=W(),Ht(s.$$.fragment),G(e,"class","upload_progress svelte-1204y2u"),tt(e,"error","error"===t[0].status)},m(t,o){R(t,e,o),O(e,i),O(e,n),O(e,r),h&&h.m(e,null),O(e,a),Nt(s,e,null),c=!0},p(t,n){var r=l(n,1)[0];(!c||1&r)&&d!==(d=t[0].name+"")&&Z(i,d),""!==t[3]?h?h.p(t,r):((h=Mp(t)).c(),h.m(e,a)):h&&(h.d(1),h=null);var o={};2&r&&(o.total=t[1]),4&r&&(o.used=t[2]),s.$set(o),(!c||1&r)&&tt(e,"error","error"===t[0].status)},i(t){c||(zt(s.$$.fragment,t),t&&yt((()=>{c&&(o||(o=Et(e,Kt,{duration:200},!0)),o.run(1))})),c=!0)},o(t){Ot(s.$$.fragment,t),t&&(o||(o=Et(e,Kt,{duration:200},!1)),o.run(0)),c=!1},d(t){t&&F(e),h&&h.d(),Vt(s),t&&o&&o.end()}}}function Sp(t,e,n){var r=ht(),a=e.job,s=void 0===a?{file:null,name:"",id:"",status:""}:a,l=e.total,c=void 0===l?0:l,d=e.loaded,h=void 0===d?0:d,u="",f="";return t.$$set=t=>{"job"in t&&n(0,s=t.job),"total"in t&&n(1,c=t.total),"loaded"in t&&n(2,h=t.loaded)},[s,c,h,u,f,()=>{((t,e,i,n,r)=>{if(0===window.user.subscription.file_size_limit&&(window.user.subscription.file_size_limit=2e10),t.size>window.user.subscription.file_size_limit)on_failure("file_too_large","This file is too large. Check out the Pro subscription to increase the file size limit");else{var a=new XMLHttpRequest;a.open("PUT",window.api_endpoint+"/file/"+encodeURIComponent(e),!0),a.timeout=864e5,a.upload.addEventListener("progress",(t=>{i&&t.lengthComputable&&i(t.loaded,t.total)})),a.onreadystatechange=()=>{if(4===a.readyState)if(a.status>=100&&a.status<400)n(JSON.parse(a.response).id);else if(a.status>=400){var t;console.log("Upload error. status: "+a.status+" response: "+a.response),t=429===a.status?{value:"too_many_requests",message:"Too many requests. Please wait a few seconds"}:JSON.parse(a.response),r(t.value,t.message)}else 0===a.status?r("request_failed","Your request did not arrive, check your network connection"):r(a.responseText,a.responseText)},a.send(t)}})(s.file,s.name,((t,e)=>{n(2,h=t),n(1,c=e)}),function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:console.log("finsished",e),n(0,s.status="finished",s),n(0,s.id=e,s),r("finished");case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),((t,e)=>{console.log("error",t,e),n(3,u=t),n(4,f=e),n(0,s.status="error",s),r("finished")})),n(0,s.status="uploading",s)}]}class Tp extends Wt{constructor(t){super(),Bt(this,t,Sp,Cp,m,{job:0,total:1,loaded:2,start:5},$p)}get start(){return this.$$.ctx[5]}}function Pp(t){A(t,"svelte-1nv7phm",".upload_input.svelte-1nv7phm{visibility:hidden;position:fixed;width:0;height:0}.upload_widget.svelte-1nv7phm{position:fixed;display:flex;flex-direction:column;width:500px;max-width:80%;height:auto;max-height:50%;right:20px;bottom:20px;border-radius:20px 20px 8px 8px;overflow:hidden;box-shadow:1px 1px 8px var(--shadow_color)}.header.svelte-1nv7phm{flex:0 0 auto;background:var(--background_color);color:var(--background_text_color);text-align:center;font-size:1.2em;padding:4px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.body.svelte-1nv7phm{flex:1 1 auto;background:var(--body_color);color:var(--body_text_color);overflow-y:auto;text-align:left}")}function Dp(t,e,i){var n=t.slice();return n[17]=e[i],n[18]=e,n[19]=i,n}function Lp(t){var e,i,n,r,a,s;function o(t,e){return"idle"===t[5]?Ap:"uploading"===t[5]?Op:"finished"===t[5]?zp:void 0}for(var l=o(t),c=l&&l(t),d=jt(t[4]),h=[],u=0;uOt(h[t],1,1,(()=>{h[t]=null}));return{c(){e=N("div"),i=N("div"),c&&c.c(),n=W(),r=N("div");for(var t=0;t{s&&(a||(a=Et(e,Kt,{duration:200},!0)),a.run(1))})),s=!0}},o(t){h=h.filter(Boolean);for(var i=0;it[11](e,n,r),s=()=>t[11](null,n,r),o={job:t[17]};return e=new Tp({props:o}),a(),e.$on("finished",t[7]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){n===t[18]&&r===t[19]||(s(),n=t[18],r=t[19],a());var o={};16&i&&(o.job=t[17]),e.$set(o)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){s(),Vt(e,t)}}}function jp(t){var e,i,n="finished"!==t[17].status&&Ep(t);return{c(){n&&n.c(),e=q()},m(t,r){n&&n.m(t,r),R(t,e,r),i=!0},p(t,i){"finished"!==t[17].status?n?(n.p(t,i),16&i&&zt(n,1)):((n=Ep(t)).c(),zt(n,1),n.m(e.parentNode,e)):n&&(Dt(),Ot(n,1,1,(()=>{n=null})),Lt())},i(t){i||(zt(n),i=!0)},o(t){Ot(n),i=!1},d(t){t&&F(e),n&&n.d(t)}}}function Ip(t){var e,i;return(e=new kp({})).$on("upload",t[12]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p:d,i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function Rp(t){var e,i,n,r,a,s,o,c=t[3]&&Lp(t),d=t[0]&&Ip(t);return{c(){e=N("input"),i=W(),c&&c.c(),n=W(),d&&d.c(),r=q(),G(e,"class","upload_input svelte-1nv7phm"),G(e,"type","file"),G(e,"name","file"),e.multiple="multiple"},m(l,h){R(l,e,h),t[10](e),R(l,i,h),c&&c.m(l,h),R(l,n,h),d&&d.m(l,h),R(l,r,h),a=!0,s||(o=[Y(window,"beforeunload",t[8]),Y(e,"change",t[6])],s=!0)},p(t,e){var i=l(e,1)[0];t[3]?c?(c.p(t,i),8&i&&zt(c,1)):((c=Lp(t)).c(),zt(c,1),c.m(n.parentNode,n)):c&&(Dt(),Ot(c,1,1,(()=>{c=null})),Lt()),t[0]?d?(d.p(t,i),1&i&&zt(d,1)):((d=Ip(t)).c(),zt(d,1),d.m(r.parentNode,r)):d&&(Dt(),Ot(d,1,1,(()=>{d=null})),Lt())},i(t){a||(zt(c),zt(d),a=!0)},o(t){Ot(c),Ot(d),a=!1},d(a){a&&(F(e),F(i),F(n),F(r)),t[10](null),c&&c.d(a),d&&d.d(a),s=!1,v(o)}}}function Fp(t,e,n){var r,a=ht(),s=e.drop_upload,l=void 0!==s&&s,c=!1,d=[],h=0,u=function(){var t=i(o().mark((function t(e){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==e.length){t.next=2;break}return t.abrupt("return");case 2:i=0;case 3:if(!(i{for(var t=0;t{"finished"===t.status&&""!==t.id&&e.push(t.id)})),a("uploads_finished",e),n(4,d=[]),n(3,c=!1)}else n(5,p="uploading")};return t.$$set=t=>{"drop_upload"in t&&n(0,l=t.drop_upload)},[l,u,r,c,d,p,t=>{u(t.target.files),n(2,r.nodeValue="",r)},t=>{f--,n(4,d),v()},t=>"uploading"===p?(t.preventDefault(),t.returnValue="If you close this page your files will stop uploading. Do you want to continue?",t.returnValue):null,()=>{r.click()},function(t){pt[t?"unshift":"push"]((()=>{n(2,r=t)}))},function(t,e,i){pt[t?"unshift":"push"]((()=>{e[i].component=t,n(4,d)}))},t=>u(t.detail)]}class Hp extends Wt{constructor(t){super(),Bt(this,t,Fp,Rp,m,{pick_files:9,drop_upload:0,upload_files:1},Pp)}get pick_files(){return this.$$.ctx[9]}get upload_files(){return this.$$.ctx[1]}}var Np=z.window;function Vp(t){var e,i,n,r;return e=new Hp({props:{}}),t[7](e),e.$on("uploads_finished",t[8]),{c(){Ht(e.$$.fragment)},m(a,s){Nt(e,a,s),i=!0,n||(r=Y(Np,"paste",t[2]),n=!0)},p(t,i){l(i,1)[0];e.$set({})},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[7](null),Vt(e,i),n=!1,r()}}}function Bp(t,e,n){var r,a=ht(),s=e.list,l=void 0===s?{title:"",files:[],info_href:""}:s,c=function(){var t=i(o().mark((function t(e){var i,n,r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a("loading",!0),0!==l.files.length){t.next=20;break}return t.prev=2,t.next=5,fetch(l.info_href,{method:"DELETE"});case 5:if(!((i=t.sent).status>=400)){t.next=10;break}return t.next=9,i.json();case 9:throw t.sent.message;case 10:window.close(),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(2),alert("Failed to delete album: "+t.t0);case 16:return t.prev=16,a("loading",!1),t.finish(16);case 19:return t.abrupt("return");case 20:return n={title:l.title,files:[]},e.forEach((t=>{n.files.push({id:t.id})})),t.prev=22,t.next=25,fetch(l.info_href,{method:"PUT",body:JSON.stringify(n)});case 25:if(!((r=t.sent).status>=400)){t.next=30;break}return t.next=29,r.json();case 29:throw t.sent.message;case 30:t.next=35;break;case 32:t.prev=32,t.t1=t.catch(22),alert("Failed to update album: "+t.t1);case 35:return t.prev=35,a("loading",!1),a("reload"),t.finish(35);case 39:case"end":return t.stop()}}),t,null,[[2,13,16,19],[22,32,35,39]])})));return function(e){return t.apply(this,arguments)}}(),d=function(){var t=i(o().mark((function t(e){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.files,e.forEach((t=>{i.push({id:t})})),t.next=4,c(i);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return t.$$set=t=>{"list"in t&&n(3,l=t.list)},[r,d,t=>{0!==t.clipboardData.files.length&&(t.preventDefault(),t.stopPropagation(),r.upload_files(t.clipboardData.files))},l,c,()=>r.pick_files(),t=>r.upload_files(t),function(t){pt[t?"unshift":"push"]((()=>{n(0,r=t)}))},t=>d(t.detail)]}class Wp extends Wt{constructor(t){super(),Bt(this,t,Bp,Vp,m,{list:3,update:4,pick_files:5,upload_files:6})}get update(){return this.$$.ctx[4]}get pick_files(){return this.$$.ctx[5]}get upload_files(){return this.$$.ctx[6]}}function qp(t){A(t,"svelte-1x1207","svg.svelte-1x1207{fill:currentColor;animation:svelte-1x1207-rotation 20s infinite linear}@keyframes svelte-1x1207-rotation{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}")}function Yp(t){var e,i;return{c(){e=V("svg"),G(i=V("path"),"d","m142 2.23c-77 0-139 62.5-139 140 0 77 62.5 139 139 139 77 0 139-62.5 139-139 1e-3 -77-62.5-140-139-140zm0 258c-65.7 0-119-53.2-119-119s53.2-119 119-119c65.7 0 119 53.2 119 119 0 65.7-53.2 119-119 119zm0-219c-55.1 0-99.8 44.7-99.8 99.8 0 55.1 44.7 99.8 99.8 99.8s99.8-44.7 99.8-99.8c0-55.1-44.7-99.8-99.8-99.8zm49.3 36c8.69 0 15.7 7.04 15.7 15.7 0 8.69-7.04 15.7-15.7 15.7s-15.7-7.04-15.7-15.7c0-8.69 7.04-15.7 15.7-15.7zm-49.3-20c8.69 0 15.7 7.04 15.7 15.7 0 8.69-7.04 15.7-15.7 15.7s-15.7-7.04-15.7-15.7c0-8.69 7.04-15.7 15.7-15.7zm-48.7 20c8.69 0 15.7 7.04 15.7 15.7 0 8.69-7.04 15.7-15.7 15.7s-15.7-7.04-15.7-15.7c-1e-3 -8.69 7.04-15.7 15.7-15.7zm-35 63.8c0-8.69 7.04-15.7 15.7-15.7s15.7 7.04 15.7 15.7c0 8.69-7.04 15.7-15.7 15.7-8.69 0-15.7-7.04-15.7-15.7zm35 65.6c-8.69 0-15.7-7.04-15.7-15.7s7.04-15.7 15.7-15.7 15.7 7.04 15.7 15.7-7.04 15.7-15.7 15.7zm48.7 20.7c-8.69 0-15.7-7.04-15.7-15.7 0-8.69 7.04-15.7 15.7-15.7 8.69 0 15.7 7.04 15.7 15.7 1e-3 8.68-7.04 15.7-15.7 15.7zm2e-3 -47c-21.2 0-38.5-17.2-38.5-38.5 0-21.2 17.2-38.5 38.5-38.5 21.2 0 38.5 17.2 38.5 38.5 0 21.2-17.2 38.5-38.5 38.5zm49.3 26.3c-8.69 0-15.7-7.04-15.7-15.7s7.04-15.7 15.7-15.7 15.7 7.04 15.7 15.7-7.04 15.7-15.7 15.7zm18.6-49.9c-8.69 0-15.7-7.04-15.7-15.7 0-8.69 7.04-15.7 15.7-15.7s15.7 7.04 15.7 15.7c0 8.69-7.04 15.7-15.7 15.7z"),G(e,"style",t[0]),G(e,"enable-background","new 0 0 283.46 283.46"),G(e,"version","1.1"),G(e,"viewBox","0 0 288 288"),G(e,"xmlns","http://www.w3.org/2000/svg"),G(e,"class","svelte-1x1207")},m(t,n){R(t,e,n),O(e,i)},p(t,i){1&l(i,1)[0]&&G(e,"style",t[0])},i:d,o:d,d(t){t&&F(e)}}}function Up(t,e,i){var n=e.style;return t.$$set=t=>{"style"in t&&i(0,n=t.style)},[n]}class Xp extends Wt{constructor(t){super(),Bt(this,t,Up,Yp,m,{style:0},qp)}}function Gp(t){A(t,"svelte-5rfe5m",".red.svelte-5rfe5m{color:var(--danger_color)}.green.svelte-5rfe5m{color:var(--highlight_color)}")}function Kp(t){var e,i,n,r,a=(t[0]/1e6).toFixed(t[1])+"";return{c(){e=N("span"),i=B("€\n\t"),n=N("span"),r=B(a),G(n,"class","svelte-5rfe5m"),tt(n,"red",t[0]<0),tt(n,"green",t[0]>0)},m(t,a){R(t,e,a),O(e,i),O(e,n),O(n,r)},p(t,e){var i=l(e,1)[0];3&i&&a!==(a=(t[0]/1e6).toFixed(t[1])+"")&&Z(r,a),1&i&&tt(n,"red",t[0]<0),1&i&&tt(n,"green",t[0]>0)},i:d,o:d,d(t){t&&F(e)}}}function Zp(t,e,i){var n=e.amount,r=void 0===n?0:n,a=e.precision,s=void 0===a?2:a;return t.$$set=t=>{"amount"in t&&i(0,r=t.amount),"precision"in t&&i(1,s=t.precision)},[r,s]}class Jp extends Wt{constructor(t){super(),Bt(this,t,Zp,Kp,m,{amount:0,precision:1},Gp)}}function Qp(t){A(t,"svelte-1p6dr1d",".wrapper.svelte-1p6dr1d{flex-grow:0;flex-shrink:0;display:inline-flex;align-self:center}.button.svelte-1p6dr1d{flex:0 0 content;box-shadow:none}.button_username.svelte-1p6dr1d{margin:0 4px}dialog.svelte-1p6dr1d{background-color:var(--card_color);color:var(--body_text_color);border-radius:8px;border:none;padding:4px;margin:0;box-shadow:2px 2px 10px var(--shadow_color)}.menu.svelte-1p6dr1d{display:flex;flex-direction:column;max-width:15em}.separator.svelte-1p6dr1d{height:1px;margin:2px 0;width:100%;background-color:var(--separator)}.stats_table.svelte-1p6dr1d{display:grid;grid-template-columns:auto auto;gap:0.2em 1em;margin:3px}@media(max-width: 800px){.hide_name.svelte-1p6dr1d{display:none}}")}function tv(t){var e,i;return e=new Xp({props:{style:"height: 1.6em; width: 1.6em;"}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function ev(t){var e,i,n,r,a,s,o,l;return e=new se({props:{link_href:"/",link_target:t[6],icon:"home",label:"Home"}}),n=new se({props:{link_href:"/#pro",link_target:t[6],icon:"star",label:"Get Premium"}}),a=new se({props:{link_href:"/login",link_target:t[6],icon:"person",label:"Log in"}}),o=new se({props:{link_href:"/register",link_target:t[6],icon:"person",label:"Register"}}),{c(){Ht(e.$$.fragment),i=W(),Ht(n.$$.fragment),r=W(),Ht(a.$$.fragment),s=W(),Ht(o.$$.fragment)},m(t,c){Nt(e,t,c),R(t,i,c),Nt(n,t,c),R(t,r,c),Nt(a,t,c),R(t,s,c),Nt(o,t,c),l=!0},p(t,i){var r={};64&i&&(r.link_target=t[6]),e.$set(r);var s={};64&i&&(s.link_target=t[6]),n.$set(s);var l={};64&i&&(l.link_target=t[6]),a.$set(l);var c={};64&i&&(c.link_target=t[6]),o.$set(c)},i(t){l||(zt(e.$$.fragment,t),zt(n.$$.fragment,t),zt(a.$$.fragment,t),zt(o.$$.fragment,t),l=!0)},o(t){Ot(e.$$.fragment,t),Ot(n.$$.fragment,t),Ot(a.$$.fragment,t),Ot(o.$$.fragment,t),l=!1},d(t){t&&(F(i),F(r),F(s)),Vt(e,t),Vt(n,t),Vt(a,t),Vt(o,t)}}}function iv(t){var e,i,n,r,a,s,o,l,c,h,u,f,p,v,g,m,b,x,_,y,w,k,$,M,C,S,T,P,D,L,z,A,E,j,I,H,V,B,Y,U,X;e=new se({props:{link_href:"/user",link_target:t[6],icon:"person",label:window.user.username}});var K="prepaid"===window.user.subscription.type&&function(){var t,e,i,n,r;return n=new Jp({props:{amount:window.user.balance_micro_eur}}),{c(){(t=N("div")).textContent="Credit",e=W(),i=N("div"),Ht(n.$$.fragment)},m(a,s){R(a,t,s),R(a,e,s),R(a,i,s),Nt(n,i,null),r=!0},p:d,i(t){r||(zt(n.$$.fragment,t),r=!0)},o(t){Ot(n.$$.fragment,t),r=!1},d(r){r&&(F(t),F(e),F(i)),Vt(n)}}}(),Z=[rv,nv],J=[];w=window.user.subscription.filesystem_access?0:1,k=J[w]=Z[w](t),M=new se({props:{link_href:"/filesystem",link_target:t[6],icon:"description",label:"Filesystem Guide"}}),P=new se({props:{link_href:"/user/filemanager#files",link_target:t[6],icon:"image",label:"My Files"}}),L=new se({props:{link_href:"/user/filemanager#lists",link_target:t[6],icon:"photo_library",label:"My Albums"}}),j=new se({props:{link_href:"/user/settings",link_target:t[6],icon:"settings",label:"Account Settings"}}),H=new se({props:{link_href:"/user/subscription",link_target:t[6],icon:"shopping_cart",label:"Subscription"}}),B=new se({props:{link_href:"/user/prepaid/transactions",link_target:t[6],icon:"receipt",label:"Transactions"}});var Q=window.user.is_admin&&function(t){var e,i,n,r;return n=new se({props:{link_href:"/admin",link_target:t[6],icon:"admin_panel_settings",label:"Admin Panel"}}),{c(){e=N("div"),i=W(),Ht(n.$$.fragment),G(e,"class","separator svelte-1p6dr1d")},m(t,a){R(t,e,a),R(t,i,a),Nt(n,t,a),r=!0},p(t,e){var i={};64&e&&(i.link_target=t[6]),n.$set(i)},i(t){r||(zt(n.$$.fragment,t),r=!0)},o(t){Ot(n.$$.fragment,t),r=!1},d(t){t&&(F(e),F(i)),Vt(n,t)}}}(t);return{c(){Ht(e.$$.fragment),i=W(),n=N("div"),r=W(),a=N("div"),(s=N("div")).textContent="Subscription",o=W(),(l=N("div")).textContent="".concat(window.user.subscription.name),c=W(),K&&K.c(),h=W(),(u=N("div")).textContent="Storage used",f=W(),(p=N("div")).textContent="".concat(be(window.user.filesystem_storage_used,3)),v=W(),(g=N("div")).textContent="Transfer used",m=W(),(b=N("div")).textContent="".concat(be(window.user.monthly_transfer_used,3)),x=W(),_=N("div"),y=W(),k.c(),$=W(),Ht(M.$$.fragment),C=W(),S=N("div"),T=W(),Ht(P.$$.fragment),D=W(),Ht(L.$$.fragment),z=W(),A=N("div"),E=W(),Ht(j.$$.fragment),I=W(),Ht(H.$$.fragment),V=W(),Ht(B.$$.fragment),Y=W(),Q&&Q.c(),U=q(),G(n,"class","separator svelte-1p6dr1d"),G(a,"class","stats_table svelte-1p6dr1d"),G(_,"class","separator svelte-1p6dr1d"),G(S,"class","separator svelte-1p6dr1d"),G(A,"class","separator svelte-1p6dr1d")},m(t,d){Nt(e,t,d),R(t,i,d),R(t,n,d),R(t,r,d),R(t,a,d),O(a,s),O(a,o),O(a,l),O(a,c),K&&K.m(a,null),O(a,h),O(a,u),O(a,f),O(a,p),O(a,v),O(a,g),O(a,m),O(a,b),R(t,x,d),R(t,_,d),R(t,y,d),J[w].m(t,d),R(t,$,d),Nt(M,t,d),R(t,C,d),R(t,S,d),R(t,T,d),Nt(P,t,d),R(t,D,d),Nt(L,t,d),R(t,z,d),R(t,A,d),R(t,E,d),Nt(j,t,d),R(t,I,d),Nt(H,t,d),R(t,V,d),Nt(B,t,d),R(t,Y,d),Q&&Q.m(t,d),R(t,U,d),X=!0},p(t,i){var n={};64&i&&(n.link_target=t[6]),e.$set(n),"prepaid"===window.user.subscription.type&&K.p(t,i),k.p(t,i);var r={};64&i&&(r.link_target=t[6]),M.$set(r);var a={};64&i&&(a.link_target=t[6]),P.$set(a);var s={};64&i&&(s.link_target=t[6]),L.$set(s);var o={};64&i&&(o.link_target=t[6]),j.$set(o);var l={};64&i&&(l.link_target=t[6]),H.$set(l);var c={};64&i&&(c.link_target=t[6]),B.$set(c),window.user.is_admin&&Q.p(t,i)},i(t){X||(zt(e.$$.fragment,t),zt(K),zt(k),zt(M.$$.fragment,t),zt(P.$$.fragment,t),zt(L.$$.fragment,t),zt(j.$$.fragment,t),zt(H.$$.fragment,t),zt(B.$$.fragment,t),zt(Q),X=!0)},o(t){Ot(e.$$.fragment,t),Ot(K),Ot(k),Ot(M.$$.fragment,t),Ot(P.$$.fragment,t),Ot(L.$$.fragment,t),Ot(j.$$.fragment,t),Ot(H.$$.fragment,t),Ot(B.$$.fragment,t),Ot(Q),X=!1},d(t){t&&(F(i),F(n),F(r),F(a),F(x),F(_),F(y),F($),F(C),F(S),F(T),F(D),F(z),F(A),F(E),F(I),F(V),F(Y),F(U)),Vt(e,t),K&&K.d(),J[w].d(t),Vt(M,t),Vt(P,t),Vt(L,t),Vt(j,t),Vt(H,t),Vt(B,t),Q&&Q.d(t)}}}function nv(t){var e,i;return e=new se({props:{link_href:"/#pro",link_target:t[6],icon:"star",label:"Get Premium"}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};64&i&&(n.link_target=t[6]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function rv(t){var e,i;return e=new se({props:{link_href:"/d/me",link_target:t[6],icon:"folder",label:"My Filesystem"}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};64&i&&(n.link_target=t[6]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function av(t){var e,i,n,r,a,s,o,c,d,h,u,f,p,g=(""===window.user.username?t[0]:window.user.username)+"",m=!t[2]&&tv(),b=[iv,ev],x=[];return d=""!==window.user.username?0:1,h=x[d]=b[d](t),{c(){e=N("div"),i=N("button"),m&&m.c(),n=W(),r=N("span"),a=B(g),s=W(),o=N("dialog"),c=N("div"),h.c(),G(r,"class","button_username svelte-1p6dr1d"),tt(r,"hide_name",t[1]),G(i,"class","button round svelte-1p6dr1d"),G(i,"title","Menu"),G(i,"style",t[3]),G(e,"class","wrapper svelte-1p6dr1d"),G(c,"class","menu svelte-1p6dr1d"),G(o,"class","svelte-1p6dr1d")},m(l,h){R(l,e,h),O(e,i),m&&m.m(i,null),O(i,n),O(i,r),O(r,a),t[10](i),R(l,s,h),R(l,o,h),O(o,c),x[d].m(c,null),t[11](o),u=!0,f||(p=[Y(i,"click",t[7]),Y(o,"click",t[8])],f=!0)},p(t,e){var s=l(e,1)[0];t[2]?m&&(Dt(),Ot(m,1,1,(()=>{m=null})),Lt()):m?4&s&&zt(m,1):((m=tv()).c(),zt(m,1),m.m(i,n)),(!u||1&s)&&g!==(g=(""===window.user.username?t[0]:window.user.username)+"")&&Z(a,g),(!u||2&s)&&tt(r,"hide_name",t[1]),(!u||8&s)&&G(i,"style",t[3]),h.p(t,s)},i(t){u||(zt(m),zt(h),u=!0)},o(t){Ot(m),Ot(h),u=!1},d(i){i&&(F(e),F(s),F(o)),m&&m.d(),t[10](null),x[d].d(),t[11](null),f=!1,v(p)}}}function sv(t,e,i){var n,r,a,s=e.no_login_label,o=void 0===s?"Pixeldrain":s,l=e.hide_name,c=void 0===l||l,d=e.hide_logo,h=void 0!==d&&d,u=e.style,f=void 0===u?"":u,p=e.embedded,v=void 0!==p&&p;return t.$$set=t=>{"no_login_label"in t&&i(0,o=t.no_login_label),"hide_name"in t&&i(1,c=t.hide_name),"hide_logo"in t&&i(2,h=t.hide_logo),"style"in t&&i(3,f=t.style),"embedded"in t&&i(9,v=t.embedded)},t.$$.update=()=>{512&t.$$.dirty&&i(6,n=v?"_blank":"_self")},[o,c,h,f,r,a,n,()=>{a.showModal();var t=a.getBoundingClientRect(),e=window.innerWidth-t.width-5,n=window.innerHeight-t.height-5,s=r.getBoundingClientRect(),o=Math.max(s.left,5),l=Math.max(s.bottom,5);i(5,a.style.left=Math.round(Math.min(o,e))+"px",a),i(5,a.style.top=Math.round(Math.min(l,n))+"px",a)},t=>{t.target===a&&a.close()},v,function(t){pt[t?"unshift":"push"]((()=>{i(4,r=t)}))},function(t){pt[t?"unshift":"push"]((()=>{i(5,a=t)}))}]}class ov extends Wt{constructor(t){super(),Bt(this,t,sv,av,m,{no_login_label:0,hide_name:1,hide_logo:2,style:3,embedded:9},Qp)}}var lv=z.window;function cv(t){A(t,"svelte-jngqwx",".file_viewer.svelte-jngqwx.svelte-jngqwx.svelte-jngqwx{position:absolute;display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden;background:var(--body_background)}.headerbar.svelte-jngqwx.svelte-jngqwx.svelte-jngqwx{flex-grow:0;flex-shrink:0;display:flex;flex-direction:row;text-align:left;align-items:center}@media(max-height: 600px){.headerbar.svelte-jngqwx.svelte-jngqwx.svelte-jngqwx{padding:1px}}.headerbar.svelte-jngqwx>.svelte-jngqwx.svelte-jngqwx{flex-grow:0;flex-shrink:0;margin:3px}.headerbar.svelte-jngqwx>.file_viewer_headerbar_title.svelte-jngqwx.svelte-jngqwx{flex-grow:1;flex-shrink:1;display:flex;flex-direction:column;overflow:hidden;line-height:1.2em;white-space:nowrap;text-overflow:ellipsis;justify-content:center}.headerbar.svelte-jngqwx>button.svelte-jngqwx>.icon.svelte-jngqwx{font-size:1.6em}.file_preview_row.svelte-jngqwx.svelte-jngqwx.svelte-jngqwx{flex-grow:1;flex-shrink:1;position:relative;display:block}.file_preview.svelte-jngqwx.svelte-jngqwx.svelte-jngqwx{position:absolute;left:0;right:0;top:0;bottom:0;display:block;min-height:100px;min-width:100px;transition:left 0.5s;overflow:auto;text-align:center;border-radius:8px;border:2px solid var(--separator)}.file_preview.toolbar_visible.svelte-jngqwx.svelte-jngqwx.svelte-jngqwx{left:8.2em}.file_preview.custom_background.svelte-jngqwx.svelte-jngqwx.svelte-jngqwx{background-size:cover;background-position:center}.toolbar.svelte-jngqwx.svelte-jngqwx.svelte-jngqwx{position:absolute;width:8.2em;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;left:-8.2em;bottom:0;top:0;padding:0;text-align:left;transition:left 0.5s, right 0.5s;z-index:1}.toolbar.svelte-jngqwx.svelte-jngqwx.svelte-jngqwx::-webkit-scrollbar{display:none}.toolbar.toolbar_visible.svelte-jngqwx.svelte-jngqwx.svelte-jngqwx{left:0}.toolbar_button.svelte-jngqwx.svelte-jngqwx.svelte-jngqwx{width:calc(100% - 4px)}.toolbar_button.svelte-jngqwx>span.svelte-jngqwx.svelte-jngqwx{vertical-align:middle}.toolbar.svelte-jngqwx>.separator.svelte-jngqwx.svelte-jngqwx{height:2px;width:100%;margin:4px 0;background-color:var(--separator)}")}function dv(t){var e,i,n=t[5].title+"";return{c(){e=B(n),i=N("br")},m(t,n){R(t,e,n),R(t,i,n)},p(t,i){32&i[0]&&n!==(n=t[5].title+"")&&Z(e,n)},d(t){t&&(F(e),F(i))}}}function hv(t){var e,i=t[4].name+"";return{c(){e=B(i)},m(t,i){R(t,e,i)},p(t,n){16&n[0]&&i!==(i=t[4].name+"")&&Z(e,i)},d(t){t&&F(e)}}}function uv(t){var e,i;return{c(){e=N("a"),(i=N("i")).textContent="open_in_new",G(i,"class","icon"),G(i,"id","btn_fullscreen_icon"),G(e,"href",window.location.pathname),G(e,"target","_blank"),G(e,"class","button round svelte-jngqwx"),G(e,"title","Open this page in a new tab"),G(e,"rel","noreferrer")},m(t,n){R(t,e,n),O(e,i)},p:d,d(t){t&&F(e)}}}function fv(t){var e,i,n={files:t[5].files};return e=new mu({props:n}),t[45](e),e.$on("set_file",t[46]),e.$on("toggle_gallery",t[41]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};32&i[0]&&(n.files=t[5].files),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[45](null),Vt(e,i)}}}function pv(t){var e,i;return e=new bp({props:{list:t[5]}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};32&i[0]&&(n.list=t[5]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function vv(t){var e,i;return e=new yu({props:{file:t[4]}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};16&i[0]&&(n.file=t[4]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function gv(t){var e,i,n;return{c(){(e=N("button")).innerHTML='download Download',G(e,"class","toolbar_button svelte-jngqwx"),G(e,"title","Save this file to your computer"),tt(e,"button_red",!1===t[4].can_download)},m(r,a){R(r,e,a),i||(n=Y(e,"click",(function(){g(t[15].download_file)&&t[15].download_file.apply(this,arguments)})),i=!0)},p(i,n){t=i,16&n[0]&&tt(e,"button_red",!1===t[4].can_download)},d(t){t&&F(e),i=!1,n()}}}function mv(t){var e,i,n;return{c(){(e=N("button")).innerHTML='download DL all files',G(e,"class","toolbar_button svelte-jngqwx"),G(e,"title","Download all files in this album as a zip archive")},m(r,a){R(r,e,a),i||(n=Y(e,"click",(function(){g(t[15].download_list)&&t[15].download_list.apply(this,arguments)})),i=!0)},p(e,i){t=e},d(t){t&&F(e),i=!1,n()}}}function bv(t){var e,i;return{c(){(e=N("u")).textContent="C",i=B("opy link")},m(t,n){R(t,e,n),R(t,i,n)},p:d,d(t){t&&(F(e),F(i))}}}function xv(t){var e,i,n;return{c(){(e=N("button")).innerHTML='share Share',G(e,"class","toolbar_button svelte-jngqwx"),G(e,"title","Share this file on social media"),tt(e,"button_highlight",t[12])},m(r,a){R(r,e,a),i||(n=Y(e,"click",t[36]),i=!0)},p(t,i){4096&i[0]&&tt(e,"button_highlight",t[12])},d(t){t&&F(e),i=!1,n()}}}function _v(t){var e;return{c(){(e=N("i")).textContent="fullscreen",G(e,"class","icon")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function yv(t){var e;return{c(){(e=N("i")).textContent="fullscreen_exit",G(e,"class","icon")},m(t,i){R(t,e,i)},d(t){t&&F(e)}}}function wv(t){var e,i,n;return{c(){(e=N("button")).innerHTML='help Details',G(e,"class","toolbar_button svelte-jngqwx"),G(e,"title","Information and statistics about this file"),tt(e,"button_highlight",t[18])},m(r,a){R(r,e,a),i||(n=Y(e,"click",(function(){g(t[17].toggle)&&t[17].toggle.apply(this,arguments)})),i=!0)},p(i,n){t=i,262144&n[0]&&tt(e,"button_highlight",t[18])},d(t){t&&F(e),i=!1,n()}}}function kv(t){var e,i,n;return{c(){(e=N("button")).innerHTML='edit Edit',G(e,"class","toolbar_button svelte-jngqwx"),G(e,"title","Edit or delete this file or album"),tt(e,"button_highlight",t[22])},m(r,a){R(r,e,a),i||(n=Y(e,"click",(function(){g(t[21].toggle)&&t[21].toggle.apply(this,arguments)})),i=!0)},p(i,n){t=i,4194304&n[0]&&tt(e,"button_highlight",t[22])},d(t){t&&F(e),i=!1,n()}}}function $v(t){var e,i,n;return{c(){(e=N("button")).innerHTML='save_alt Grab file',G(e,"class","toolbar_button svelte-jngqwx"),G(e,"title","Copy this file to your own pixeldrain account")},m(r,a){R(r,e,a),i||(n=Y(e,"click",t[43]),i=!0)},p:d,d(t){t&&F(e),i=!1,n()}}}function Mv(t){var e,i,n;return{c(){(e=N("button")).innerHTML='code Embed',G(e,"class","toolbar_button svelte-jngqwx"),G(e,"title","Include this file in your own webpages"),tt(e,"button_highlight",t[26])},m(r,a){R(r,e,a),i||(n=Y(e,"click",(function(){g(t[25].toggle)&&t[25].toggle.apply(this,arguments)})),i=!0)},p(i,n){t=i,67108864&n[0]&&tt(e,"button_highlight",t[26])},d(t){t&&F(e),i=!1,n()}}}function Cv(t){var e,i;return(e=new Hf({props:{list:t[5]}})).$on("reload",t[38]),e.$on("update_list",t[52]),e.$on("pick_files",t[53]),e.$on("upload_files",t[54]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};32&i[0]&&(n.list=t[5]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function Sv(t){var e,i,n={is_list:t[6]};return e=new hu({props:n}),t[48](e),e.$on("download",(function(){g(t[15].download_file)&&t[15].download_file.apply(this,arguments)})),e.$on("prev",t[49]),e.$on("next",t[50]),e.$on("loading",t[51]),e.$on("reload",t[38]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(i,n){t=i;var r={};64&n[0]&&(r.is_list=t[6]),e.$set(r)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[48](null),Vt(e,i)}}}function Tv(t){var e,i;return e=new rp({props:{src:t[31],link:t[32]}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};1&i[1]&&(n.src=t[31]),2&i[1]&&(n.link=t[32]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function Pv(t){var e,i,n,r;return e=new df({}),n=new pp({}),{c(){Ht(e.$$.fragment),i=W(),Ht(n.$$.fragment)},m(t,a){Nt(e,t,a),R(t,i,a),Nt(n,t,a),r=!0},p:d,i(t){r||(zt(e.$$.fragment,t),zt(n.$$.fragment,t),r=!0)},o(t){Ot(e.$$.fragment,t),Ot(n.$$.fragment,t),r=!1},d(t){t&&F(i),Vt(e,t),Vt(n,t)}}}function Dv(t){var e,i;return e=new Ql({props:{file:t[4]}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};16&i[0]&&(n.file=t[4]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function Lv(t){var e,i;return{c(){b((e=N("img")).src,i=window.api_endpoint+"/misc/qr?text="+encodeURIComponent(window.location.href))||G(e,"src",i),G(e,"alt","QR code"),Q(e,"display","block"),Q(e,"width","100%")},m(t,i){R(t,e,i)},p:d,d(t){t&&F(e)}}}function zv(t){var e,i;return(e=new Pu({props:{file:t[4],list:t[5]}})).$on("reload",t[38]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};16&i[0]&&(n.file=t[4]),32&i[0]&&(n.list=t[5]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function Ov(t){var e,i;return e=new Nu({props:{file:t[4],list:t[5]}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};16&i[0]&&(n.file=t[4]),32&i[0]&&(n.list=t[5]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function Av(t){var e,i;return e=new tf({props:{file:t[4],list:t[5]}}),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};16&i[0]&&(n.file=t[4]),32&i[0]&&(n.list=t[5]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(t){Vt(e,t)}}}function Ev(t){var e,i,n={list:t[5]};return e=new Wp({props:n}),t[68](e),e.$on("reload",t[38]),e.$on("loading",t[69]),{c(){Ht(e.$$.fragment)},m(t,n){Nt(e,t,n),i=!0},p(t,i){var n={};32&i[0]&&(n.list=t[5]),e.$set(n)},i(t){i||(zt(e.$$.fragment,t),i=!0)},o(t){Ot(e.$$.fragment,t),i=!1},d(i){t[68](null),Vt(e,i)}}}function jv(t){var e,i,n,r,a,s,o,l,c,d,h,u,f,p,m,b,x,_,y,w,k,$,M,C,S,T,P,D,L,z,A,E,j,I,H,V,B,q,U,X,K,Z,J,et,it,nt,rt,at,st,ot,lt,ct,dt,ht,ut,ft,pt,vt,gt,mt,bt,xt,_t,yt,wt;a=new ov({props:{embedded:t[1]}});var kt=""!==t[5].title&&dv(t),$t=""!==t[4].name&&hv(t),Mt=t[1]&&uv(),Ct=t[6]&&"file"===t[3]&&fv(t);u=new rp({props:{src:t[28],link:t[29],border_top:!0}});var St=[vv,pv],Tt=[];function Pt(t,e){return"file"===t[3]?0:"gallery"===t[3]?1:-1}~(b=Pt(t))&&(x=Tt[b]=St[b](t));var At="file"===t[3]&&!t[33]&&gv(t),Et=t[6]&&t[7]&&!t[33]&&mv(t),jt={text:window.location.href,style:"width: calc(100% - 4px)",$$slots:{default:[bv]},$$scope:{ctx:t}};M=new ah({props:jt}),t[47](M);var It=!t[34]&&xv(t);function Rt(t,e){return t[13]?yv:_v}var Ft=Rt(t),Bt=Ft(t),Wt="file"===t[3]&&wv(t),qt=(t[4].can_edit||t[5].can_edit)&&kv(t),Yt="file"===t[3]&&window.user_authenticated&&!t[33]&&$v(t),Ut=!t[33]&&Mv(t),Xt=[Sv,Cv],Gt=[];function Kt(t,e){return"file"===t[3]?0:"gallery"===t[3]?1:-1}~(K=Kt(t))&&(Z=Gt[K]=Xt[K](t));et=new pf({props:{}}),t[56](et);var Zt=[Pv,Tv],Jt=[];function Qt(t,e){return t[2]?0:t[31]?1:-1}~(nt=Qt(t))&&(rt=Jt[nt]=Zt[nt](t)),st=new ge({props:{title:"File details",width:"1000px",$$slots:{default:[Dv]},$$scope:{ctx:t}}}),t[57](st),st.$on("is_visible",t[58]),lt=new ge({props:{title:"QR code",width:"500px",$$slots:{default:[Lv]},$$scope:{ctx:t}}}),t[59](lt),lt.$on("is_visible",t[60]);var te={title:"Editing "+t[4].name,$$slots:{default:[zv]},$$scope:{ctx:t}};dt=new ge({props:te}),t[61](dt),dt.$on("is_visible",t[62]),ut=new ge({props:{title:"Embed file",width:"820px",$$slots:{default:[Ov]},$$scope:{ctx:t}}}),t[63](ut),ut.$on("is_visible",t[64]),pt=new ge({props:{title:"Report abuse",width:"800px",$$slots:{default:[Av]},$$scope:{ctx:t}}}),t[65](pt),pt.$on("is_visible",t[66]);var ee={file:t[4],list:t[5]};gt=new Zf({props:ee}),t[67](gt);var ie=t[6]&&t[5].can_edit&&Ev(t);return xt=new cp({props:{loading:t[0]}}),{c(){e=N("div"),i=N("div"),(n=N("button")).innerHTML='menu',r=W(),Ht(a.$$.fragment),s=W(),o=N("div"),kt&&kt.c(),l=W(),$t&&$t.c(),c=W(),Mt&&Mt.c(),d=W(),Ct&&Ct.c(),h=W(),Ht(u.$$.fragment),f=W(),p=N("div"),m=N("div"),x&&x.c(),_=W(),y=N("div"),w=W(),At&&At.c(),k=W(),Et&&Et.c(),$=W(),Ht(M.$$.fragment),C=W(),It&&It.c(),S=W(),(T=N("button")).innerHTML='qr_code QR code',P=W(),D=N("button"),Bt.c(),L=W(),(z=N("span")).textContent="Fullscreen",A=W(),Wt&&Wt.c(),E=W(),j=N("div"),I=W(),qt&&qt.c(),H=W(),Yt&&Yt.c(),V=W(),(B=N("button")).innerHTML='flag Report',q=W(),Ut&&Ut.c(),U=W(),X=N("div"),Z&&Z.c(),J=W(),Ht(et.$$.fragment),it=W(),rt&&rt.c(),at=W(),Ht(st.$$.fragment),ot=W(),Ht(lt.$$.fragment),ct=W(),Ht(dt.$$.fragment),ht=W(),Ht(ut.$$.fragment),ft=W(),Ht(pt.$$.fragment),vt=W(),Ht(gt.$$.fragment),mt=W(),ie&&ie.c(),bt=W(),Ht(xt.$$.fragment),G(n,"class","round svelte-jngqwx"),Q(n,"line-height","1em"),G(n,"title","Open or close the toolbar"),tt(n,"button_highlight",t[14]),G(o,"class","file_viewer_headerbar_title svelte-jngqwx"),G(i,"class","headerbar svelte-jngqwx"),G(y,"class","separator svelte-jngqwx"),G(T,"class","toolbar_button svelte-jngqwx"),G(T,"title","Show a QR code with a link to this page. Useful for sharing files in-person"),tt(T,"button_highlight",t[20]),G(z,"class","svelte-jngqwx"),G(D,"class","toolbar_button svelte-jngqwx"),G(D,"title","Open page in full screen mode"),tt(D,"button_highlight",t[13]),G(j,"class","separator svelte-jngqwx"),G(B,"class","toolbar_button svelte-jngqwx"),G(B,"title","Report this file as abusive"),tt(B,"button_highlight",t[24]),G(m,"class","toolbar svelte-jngqwx"),tt(m,"toolbar_visible",t[14]),G(X,"class","file_preview svelte-jngqwx"),tt(X,"checkers",!t[30]),tt(X,"custom_background",!!t[30]),tt(X,"toolbar_visible",t[14]),G(p,"class","file_preview_row svelte-jngqwx"),G(e,"class","file_viewer svelte-jngqwx")},m(v,x){R(v,e,x),O(e,i),O(i,n),O(i,r),Nt(a,i,null),O(i,s),O(i,o),kt&&kt.m(o,null),O(o,l),$t&&$t.m(o,null),O(i,c),Mt&&Mt.m(i,null),O(e,d),Ct&&Ct.m(e,null),O(e,h),Nt(u,e,null),O(e,f),O(e,p),O(p,m),~b&&Tt[b].m(m,null),O(m,_),O(m,y),O(m,w),At&&At.m(m,null),O(m,k),Et&&Et.m(m,null),O(m,$),Nt(M,m,null),O(m,C),It&&It.m(m,null),O(m,S),O(m,T),O(m,P),O(m,D),Bt.m(D,null),O(D,L),O(D,z),O(m,A),Wt&&Wt.m(m,null),O(m,E),O(m,j),O(m,I),qt&&qt.m(m,null),O(m,H),Yt&&Yt.m(m,null),O(m,V),O(m,B),O(m,q),Ut&&Ut.m(m,null),O(p,U),O(p,X),~K&&Gt[K].m(X,null),t[55](X),O(p,J),Nt(et,p,null),O(e,it),~nt&&Jt[nt].m(e,null),O(e,at),Nt(st,e,null),O(e,ot),Nt(lt,e,null),O(e,ct),Nt(dt,e,null),O(e,ht),Nt(ut,e,null),O(e,ft),Nt(pt,e,null),O(e,vt),Nt(gt,e,null),O(e,mt),ie&&ie.m(e,null),O(e,bt),Nt(xt,e,null),t[70](e),_t=!0,yt||(wt=[Y(lv,"keydown",t[44]),Y(lv,"hashchange",t[39]),Y(n,"click",t[37]),Y(T,"click",(function(){g(t[19].toggle)&&t[19].toggle.apply(this,arguments)})),Y(D,"click",t[42]),Y(B,"click",(function(){g(t[23].toggle)&&t[23].toggle.apply(this,arguments)}))],yt=!0)},p(r,s){t=r,(!_t||16384&s[0])&&tt(n,"button_highlight",t[14]);var c={};2&s[0]&&(c.embedded=t[1]),a.$set(c),""!==t[5].title?kt?kt.p(t,s):((kt=dv(t)).c(),kt.m(o,l)):kt&&(kt.d(1),kt=null),""!==t[4].name?$t?$t.p(t,s):(($t=hv(t)).c(),$t.m(o,null)):$t&&($t.d(1),$t=null),t[1]?Mt?Mt.p(t,s):((Mt=uv()).c(),Mt.m(i,null)):Mt&&(Mt.d(1),Mt=null),t[6]&&"file"===t[3]?Ct?(Ct.p(t,s),72&s[0]&&zt(Ct,1)):((Ct=fv(t)).c(),zt(Ct,1),Ct.m(e,h)):Ct&&(Dt(),Ot(Ct,1,1,(()=>{Ct=null})),Lt());var d={};268435456&s[0]&&(d.src=t[28]),536870912&s[0]&&(d.link=t[29]),u.$set(d);var f=b;(b=Pt(t))===f?~b&&Tt[b].p(t,s):(x&&(Dt(),Ot(Tt[f],1,1,(()=>{Tt[f]=null})),Lt()),~b?((x=Tt[b])?x.p(t,s):(x=Tt[b]=St[b](t)).c(),zt(x,1),x.m(m,_)):x=null),"file"!==t[3]||t[33]?At&&(At.d(1),At=null):At?At.p(t,s):((At=gv(t)).c(),At.m(m,k)),t[6]&&t[7]&&!t[33]?Et?Et.p(t,s):((Et=mv(t)).c(),Et.m(m,$)):Et&&(Et.d(1),Et=null);var p={};2048&s[2]&&(p.$$scope={dirty:s,ctx:t}),M.$set(p),t[34]?It&&(It.d(1),It=null):It?It.p(t,s):((It=xv(t)).c(),It.m(m,S)),(!_t||1048576&s[0])&&tt(T,"button_highlight",t[20]),Ft!==(Ft=Rt(t))&&(Bt.d(1),(Bt=Ft(t))&&(Bt.c(),Bt.m(D,L))),(!_t||8192&s[0])&&tt(D,"button_highlight",t[13]),"file"===t[3]?Wt?Wt.p(t,s):((Wt=wv(t)).c(),Wt.m(m,E)):Wt&&(Wt.d(1),Wt=null),t[4].can_edit||t[5].can_edit?qt?qt.p(t,s):((qt=kv(t)).c(),qt.m(m,H)):qt&&(qt.d(1),qt=null),"file"===t[3]&&window.user_authenticated&&!t[33]?Yt?Yt.p(t,s):((Yt=$v(t)).c(),Yt.m(m,V)):Yt&&(Yt.d(1),Yt=null),(!_t||16777216&s[0])&&tt(B,"button_highlight",t[24]),t[33]?Ut&&(Ut.d(1),Ut=null):Ut?Ut.p(t,s):((Ut=Mv(t)).c(),Ut.m(m,null)),(!_t||16384&s[0])&&tt(m,"toolbar_visible",t[14]);var v=K;(K=Kt(t))===v?~K&&Gt[K].p(t,s):(Z&&(Dt(),Ot(Gt[v],1,1,(()=>{Gt[v]=null})),Lt()),~K?((Z=Gt[K])?Z.p(t,s):(Z=Gt[K]=Xt[K](t)).c(),zt(Z,1),Z.m(X,null)):Z=null),(!_t||1073741824&s[0])&&tt(X,"checkers",!t[30]),(!_t||1073741824&s[0])&&tt(X,"custom_background",!!t[30]),(!_t||16384&s[0])&&tt(X,"toolbar_visible",t[14]);et.$set({});var g=nt;(nt=Qt(t))===g?~nt&&Jt[nt].p(t,s):(rt&&(Dt(),Ot(Jt[g],1,1,(()=>{Jt[g]=null})),Lt()),~nt?((rt=Jt[nt])?rt.p(t,s):(rt=Jt[nt]=Zt[nt](t)).c(),zt(rt,1),rt.m(e,at)):rt=null);var y={};16&s[0]|2048&s[2]&&(y.$$scope={dirty:s,ctx:t}),st.$set(y);var w={};2048&s[2]&&(w.$$scope={dirty:s,ctx:t}),lt.$set(w);var C={};16&s[0]&&(C.title="Editing "+t[4].name),48&s[0]|2048&s[2]&&(C.$$scope={dirty:s,ctx:t}),dt.$set(C);var P={};48&s[0]|2048&s[2]&&(P.$$scope={dirty:s,ctx:t}),ut.$set(P);var z={};48&s[0]|2048&s[2]&&(z.$$scope={dirty:s,ctx:t}),pt.$set(z);var O={};16&s[0]&&(O.file=t[4]),32&s[0]&&(O.list=t[5]),gt.$set(O),t[6]&&t[5].can_edit?ie?(ie.p(t,s),96&s[0]&&zt(ie,1)):((ie=Ev(t)).c(),zt(ie,1),ie.m(e,bt)):ie&&(Dt(),Ot(ie,1,1,(()=>{ie=null})),Lt());var A={};1&s[0]&&(A.loading=t[0]),xt.$set(A)},i(t){_t||(zt(a.$$.fragment,t),zt(Ct),zt(u.$$.fragment,t),zt(x),zt(M.$$.fragment,t),zt(Z),zt(et.$$.fragment,t),zt(rt),zt(st.$$.fragment,t),zt(lt.$$.fragment,t),zt(dt.$$.fragment,t),zt(ut.$$.fragment,t),zt(pt.$$.fragment,t),zt(gt.$$.fragment,t),zt(ie),zt(xt.$$.fragment,t),_t=!0)},o(t){Ot(a.$$.fragment,t),Ot(Ct),Ot(u.$$.fragment,t),Ot(x),Ot(M.$$.fragment,t),Ot(Z),Ot(et.$$.fragment,t),Ot(rt),Ot(st.$$.fragment,t),Ot(lt.$$.fragment,t),Ot(dt.$$.fragment,t),Ot(ut.$$.fragment,t),Ot(pt.$$.fragment,t),Ot(gt.$$.fragment,t),Ot(ie),Ot(xt.$$.fragment,t),_t=!1},d(i){i&&F(e),Vt(a),kt&&kt.d(),$t&&$t.d(),Mt&&Mt.d(),Ct&&Ct.d(),Vt(u),~b&&Tt[b].d(),At&&At.d(),Et&&Et.d(),t[47](null),Vt(M),It&&It.d(),Bt.d(),Wt&&Wt.d(),qt&&qt.d(),Yt&&Yt.d(),Ut&&Ut.d(),~K&&Gt[K].d(),t[55](null),t[56](null),Vt(et),~nt&&Jt[nt].d(),t[57](null),Vt(st),t[59](null),Vt(lt),t[61](null),Vt(dt),t[63](null),Vt(ut),t[65](null),Vt(pt),t[67](null),Vt(gt),ie&&ie.d(),Vt(xt),t[70](null),yt=!1,v(wt)}}}function Iv(t,e,n){var r,a,s,l,c,d,h,u,f,p,v,g=!0,m=!1,b=!1,x="",_=qt,y=Yt,w=!1,k=!1,$=!1,M=!1,C=()=>{if(navigator.share){var t=_.name;return w&&(t=y.title),void navigator.share({title:t,text:"I would like to share '"+t+"' with you",url:window.location.href})}n(12,$=!$),$?l.show():l.hide()},S=window.innerWidth>600,T=!1,P=!1,D=!1,L=!1,z=!1;dt((()=>{var t=window.viewer_data;n(1,m=t.embedded),m&&n(14,S=!1),"list"===t.type?j(t.api_response):(n(5,y.files=[t.api_response],y),R(0)),n(2,b=y.files[0].show_ads),n(0,g=!1)}));var O,A,E=function(){var t=i(o().mark((function t(){var e,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n(0,g=!0),!w){t.next=22;break}return t.prev=2,t.next=5,fetch(y.info_href);case 5:if(!((e=t.sent).status>=400)){t.next=10;break}return t.next=9,e.json();case 9:throw t.sent.message;case 10:return t.t0=j,t.next=13,e.json();case 13:t.t1=t.sent,(0,t.t0)(t.t1),t.next=20;break;case 17:t.prev=17,t.t2=t.catch(2),alert(t.t2);case 20:t.next=43;break;case 22:return t.prev=22,t.next=25,fetch(_.info_href);case 25:if(!((i=t.sent).status>=400)){t.next=30;break}return t.next=29,i.json();case 29:throw t.sent.message;case 30:return t.t3=n,t.next=33,i.json();case 33:t.t4=t.sent,t.t5=y.files=[t.t4],t.t6=y,(0,t.t3)(5,t.t5,t.t6),R(0),t.next=43;break;case 40:t.prev=40,t.t7=t.catch(22),alert(t.t7);case 43:n(0,g=!1);case 44:case"end":return t.stop()}}),t,null,[[2,17],[22,40]])})));return function(){return t.apply(this,arguments)}}(),j=t=>{t.download_href=window.api_endpoint+"/list/"+t.id+"/zip",t.info_href=window.api_endpoint+"/list/"+t.id,n(7,k=!0),t.files.forEach((t=>{Ut(t),t.can_download||n(7,k=!1)})),n(5,y=t),n(6,w=!0),0!==t.files.length&&Y(t.files[0]),I()},I=()=>{var t=location.hash.match(/item=([\d]+)/),e=parseInt(t?t[1]:null);Number.isInteger(e)?R(e):"gallery"!==x&&(n(3,x="gallery"),n(4,_=qt),document.title=y.title+" ~ pixeldrain")},R=function(){var t=i(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e>=y.files.length?e=0:e<0&&(e=y.files.length-1),y.files[e]!==_){t.next=4;break}return console.debug("ignoring request to load the same file that is currently loaded"),t.abrupt("return");case 4:if(console.debug("received request to open file",e),Ut(y.files[e]),n(4,_=y.files[e]),"file"===x){t.next=11;break}return n(3,x="file"),t.next=11,_t();case 11:a.set_file(_),w?(window.location.hash="#item="+e,document.title=_.name+" ~ "+y.title+" ~ pixeldrain",s.set_item(e)):document.title=_.name+" ~ pixeldrain",Y(_);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),F="",H="",N="",V="",B="",W=!1,q=!1,Y=t=>{t.branding&&(t.branding.header_image&&n(28,F=window.api_endpoint+"/file/"+t.branding.header_image),t.branding.header_link&&n(29,H=t.branding.header_link),t.branding.footer_image&&n(31,V=window.api_endpoint+"/file/"+t.branding.footer_image),t.branding.footer_link&&n(32,B=t.branding.footer_link),t.branding.disable_download_button&&!t.can_edit&&n(33,W=!0),t.branding.disable_share_button&&!t.can_edit&&n(34,q=!0),t.branding.background_image?(n(30,N=window.api_endpoint+"/file/"+t.branding.background_image),n(27,O.style.backgroundImage="url('"+N+"')",O)):n(27,O.style.backgroundImage="",O))},U=function(){var t=i(o().mark((function t(){var e,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(window.user_authenticated){t.next=2;break}return t.abrupt("return");case 2:return(e=new FormData).append("grab_file",_.id),t.prev=4,t.next=7,fetch(window.api_endpoint+"/file",{method:"POST",body:e});case 7:if(!((i=t.sent).status>=400)){t.next=12;break}return t.next=11,i.json();case 11:throw t.sent.message;case 12:return t.t0=window,t.next=15,i.json();case 15:t.t1=t.sent.id,t.t2="/u/"+t.t1,t.t0.open.call(t.t0,t.t2,"_blank"),t.next=24;break;case 20:return t.prev=20,t.t3=t.catch(4),alert("Failed to grab file: "+t.t3),t.abrupt("return");case 24:case"end":return t.stop()}}),t,null,[[4,20]])})));return function(){return t.apply(this,arguments)}}();return[g,m,b,x,_,y,w,k,r,a,s,l,$,M,S,c,d,h,T,u,P,f,D,p,L,v,z,O,F,H,N,V,B,W,q,A,C,()=>{n(14,S=!S),!S&&$&&C()},E,I,R,()=>{window.location.hash="gallery"===x?"#item=0":""},()=>{if(M||document.fullscreenElement){try{document.exitFullscreen()}catch(t){console.debug("Failed to exit fullscreen",t)}n(13,M=!1)}else r.requestFullscreen(),n(13,M=!0)},U,t=>{if(!(t.ctrlKey||t.altKey||t.metaKey||document.activeElement.type&&("text"===document.activeElement.type||"email"===document.activeElement.type||"textarea"===document.activeElement.type)))switch(console.debug("Key pressed: "+t.key),t.key){case"a":case"ArrowLeft":s&&s.prev();break;case"d":case"ArrowRight":s&&s.next();break;case" ":a.toggle_playback();break;case"h":a.seek(-20);break;case"j":a.seek(-5);break;case"k":a.seek(5);break;case"l":a.seek(20);break;case",":a.seek(-.04);break;case".":a.seek(.04);break;case"s":case"S":t.shiftKey?c.download_list():c.download_file();break;case"r":p.toggle();break;case"c":A.copy();break;case"i":h.toggle();break;case"e":(_.can_edit||y.can_edit)&&f.toggle();break;case"m":v.toggle();break;case"g":U();break;case"q":window.close();break;case"u":d&&d.pick_files()}},function(t){pt[t?"unshift":"push"]((()=>{n(10,s=t)}))},t=>R(t.detail),function(t){pt[t?"unshift":"push"]((()=>{n(35,A=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(9,a=t)}))},()=>{s&&s.prev()},()=>{s&&s.next()},t=>{n(0,g=t.detail)},t=>d.update(t.detail),()=>d.pick_files(),t=>d.upload_files(t.detail),function(t){pt[t?"unshift":"push"]((()=>{n(27,O=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(11,l=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(17,h=t)}))},t=>{n(18,T=t.detail)},function(t){pt[t?"unshift":"push"]((()=>{n(19,u=t)}))},t=>{n(20,P=t.detail)},function(t){pt[t?"unshift":"push"]((()=>{n(21,f=t)}))},t=>{n(22,D=t.detail)},function(t){pt[t?"unshift":"push"]((()=>{n(25,v=t)}))},t=>{n(26,z=t.detail)},function(t){pt[t?"unshift":"push"]((()=>{n(23,p=t)}))},t=>{n(24,L=t.detail)},function(t){pt[t?"unshift":"push"]((()=>{n(15,c=t)}))},function(t){pt[t?"unshift":"push"]((()=>{n(16,d=t)}))},t=>{n(0,g=t.detail)},function(t){pt[t?"unshift":"push"]((()=>{n(8,r=t)}))}]}return new class extends Wt{constructor(t){super(),Bt(this,t,Iv,jv,m,{},cv,[-1,-1,-1])}}({target:document.getElementById("body"),props:{}})}(); //# sourceMappingURL=file_viewer.js.map