!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e
;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(t){return e[t]}.bind(null,i));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return{}.hasOwnProperty.call(e,t)},t.p="",t(t.s=70)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{
value:!0}),t.normalizeLocale=t.I18N=void 0;const r=n(3),i=n(14),s=n(2),o=window.rea,a="en";let l={},c={},A=null;const d=[],u=(e,...t)=>{const n=[],r=e=>{for(let t=0;t<e.length;t++)Array.isArray(e[t])?r(e[t]):n.push(String(e[t]))};return r(t),o.i18n.getMessage(e,n)},p=e=>new Promise((t,n)=>{const r=`_locales/${e}/messages.json`;i.getRaw(r,r=>{try{if(r)return t(JSON.parse(r))}catch(t){s.logger.log("i18n: parsing locale "+e+" failed!")}n()})}),h=async e=>{e=e.concat(a);let t=-1,n=null
;const r=async()=>{if(t++,t<e.length){const i=e[t];if(!i||!_.includes(i))return r();try{const e=await p(i);n=i,l=e}catch(e){return r()}if(!b&&i!=a)try{const e=await p(a);c=e||{}}catch(e){}}};return await r(),n},f=e=>e?e.replace(/-/g,"_").split("_").map((e,t)=>t?e.toUpperCase():e.toLowerCase()).join("_"):e;t.normalizeLocale=f;const g=(e,t)=>{let n,i;return t=t||(A?[A,A.split("_")[0]].concat(d).filter(e=>e):d),r.each(t,(t,s)=>{const o=Number(s);if(r.each(e,(e,r)=>{
const s=Number(r),a=f(e),l=a.split(/_/)[0];if(a==t)return i=s,!1;l==t&&(void 0===n||o<n)&&(i=s,n=o)}),void 0!==i)return!1}),void 0===i?i:e[i]},m=[{name:"Arabic - ‎‫العربية‬‎",value:"ar"},{name:"Chinese (Simplified) - 中文（简体中文）",value:"zh_CN"},{name:"Chinese (Traditional) - 中文（繁體）",value:"zh_TW"},{name:"Croatian - hrvatski",value:"hr"},{name:"Czech - čeština",value:"cs"},{name:"Danish - dansk",value:"da"},{name:"English",value:"en"},{name:"French - français",value:"fr"},{name:"German - Deutsch",
value:"de"},{name:"Hindi - हिन्दी",value:"hi"},{name:"Hungarian - magyar",value:"hu"},{name:"Indonesian - Indonesia",value:"id"},{name:"Italian - italiano",value:"it"},{name:"Japanese - 日本語",value:"ja"},{name:"Korean - 한국어",value:"ko"},{name:"Norwegian - norsk",value:"nb"},{name:"Polish - polski",value:"pl"},{name:"Portuguese (Brazil) - português (Brasil)",value:"pt_BR"},{name:"Portuguese (Portugal) - português (Portugal)",value:"pt_PT"},{name:"Russian - русский",value:"ru"},{
name:"Serbian - српски",value:"sr"},{name:"Slovak - slovenčina",value:"sk"},{name:"Spanish - español",value:"es"},{name:"Turkish - Türkçe",value:"tr"},{name:"Ukrainian - українська",value:"uk"},{name:"Vietnamese - Tiếng Việt",value:"vi"}],_=m.map(e=>e.value),b=!(void 0===o)&&o.i18n.native_support,v={init:async()=>{const e=async()=>{A||b||(A=await h(d))},t=f(b?o.i18n.getUILanguage():navigator.language);if(t){const e=[t],n=t.split(/_/);n[0]!==t&&e.push(n[0]),e.forEach(e=>{d.unshift(e)})}await e(),
b&&(await new Promise(e=>{o.i18n.getAcceptLanguages(t=>{t.forEach(e=>{d.push(f(e))}),e()})}),await e())},getMessage:(e,...t)=>{let n;return A&&(n=l[e]||c[e])?((e,t)=>{let n,r=e.message;return n=1==t.length&&Array.isArray(t[0])?t[0]:t,e.placeholders&&Object.entries(e.placeholders).forEach(([e,t])=>{try{const i=Number(t.content.replace(/^\$/,""))-1;let o;i<n.length?(o=n[i],r=r.replace("$"+e+"$",o)):s.logger.log('i18n: invalid argument count on processing "'+r+'" with args '+JSON.stringify(n))
}catch(e){s.logger.log('i18n: error processing "'+r+'" with args '+JSON.stringify(n))}}),r})(n,t):(b&&(n=u(e,...t))||(n=function(e,...t){let n=e;1==t.length&&Array.isArray(t[0])&&(t=t[0]);const r=new RegExp("(^|_)0[a-zA-Z]+0(_|$)");for(let e=0;e<t.length;e++){const i=n.match(r);if(!i){s.logger.log("i18n: getMessage(): wrong argument count!!!");break}n=n.replace(r,(i[1]?" ":"")+t[e]+(i[2]?" ":""))}return n.replace(/_/g," ")}(e,...t),s.logger.warn("i18n: missing translation"+n)),n)},
getOriginalMessage:u,normalizeLocale:f,getTranslation:(e,t)=>{let n,r;if(e&&(r=e[t+"_i18n"]||{})){e[t]&&(r={...r,en:e[t]});const i=g(Object.keys(r));void 0!==i&&(n=r[i])}return n||e[t]},setLocale:async e=>{let t=e;if("null"===e&&(t=null),t&&(t=f(t)),!t&&b)A=t;else if(t!==A)return h([t,...d,A].filter(e=>e)).then(t=>{A=t,A!=e&&s.logger.log("i18n: retrieving locale "+t+" failed!")})},getLocale:()=>A,getUiLocale:()=>f(A||b?o.i18n.getUILanguage():d[0]||navigator.language||a),getBestLocale:g,
supported:m};t.I18N=v},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0;const n=e=>{const t=(()=>{let e,t;const r=[],i=[],s=e=>{i.push(e),o()},o=()=>{if(void 0!==e){let n;for(;i.length;)n=i.shift(),void 0!==n.state&&n.state!==e||(t=("function"==typeof n.f?n.f.call(a,t):n.f)||t)}},a={promise:()=>a,done:e=>(s({state:!0,f:e}),a),fail:e=>(s({state:!1,f:e}),a),always:e=>(s({f:e}),a),progress:e=>(e&&r.push(e),a),then:(e,r,i)=>n(n=>{[{fn:"done",
forward:"resolve",f:e},{fn:"fail",forward:"reject",f:r},{fn:"progress",forward:"notify",f:i}].forEach(e=>{a[e.fn]((...r)=>{const i=e.f?e.f(t):void 0,s=i&&"function"==typeof i.promise?i.promise():null,o=i&&"function"==typeof i.then?i:null;if(s)s.done(n.resolve).fail(n.reject).progress(n.notify);else if(o)o.then(n.resolve,n.reject);else{const t=e.f?[i]:r;n[e.forward](t[0])}})})}).promise(),each:e=>{const t=n();return a.then(r=>{const i=Array.isArray(r)?r:[r];n.when(i.map(t=>e(t))).then(t.resolve)
}),t.promise()},iterate:e=>{const t=n();return a.then(r=>{const i=(Array.isArray(r)?r:[r]).map(t=>()=>e(t));n.onebyone(i,!0).done(e=>{t.resolve(e)}).fail(t.reject)}),t.promise()}};return{get:()=>a,try_resolve:n=>(void 0===e&&(e=!0,t=n),o(),a),try_reject:function(n){return void 0===e&&(e=!1,t=n),o(),a},do_notify:function(e){(e=>{r.forEach(t=>t(e))})(e)}}})(),r={promise:function(){return t.get()},resolve:function(e){return t.try_resolve(e)},reject:function(e){return t.try_reject(e)},
notify:function(e){return t.do_notify(e)},consume:function(e){return e.promise().done(r.resolve).fail(r.reject).progress(r.notify),r.promise()}};return e&&e(r),r};t.Deferred=n,n.Pledge=e=>{const t=n();return t.resolve(e),t.promise()},n.Breach=e=>{const t=n();return t.reject(e),t.promise()},n.onebyone=(e,t=!0)=>{const r=[],i=n();let s=0;const o=()=>{if(s<e.length){const n=(0,e[s++])();n&&n.promise?n.promise().done(e=>{r.push(e),o()}).fail(()=>{if(r.push(null),t)return i.reject();o()}):(r.push(n),
o())}else i.resolve(r)};return o(),i.promise()},n.or=e=>{let t;const r=n(),i=()=>{e.length?(t=e.shift(),t&&n.Pledge().then(t).done(r.resolve).fail(i)):r.reject()};return i(),r.promise()},n.sidebyside=e=>{e=Array.isArray(e)?e:[e];const t=n();let r=e.length;return r?e.forEach(e=>{e&&e.promise&&e.promise().always(()=>{0==--r&&t.resolve()})}):t.resolve(),t.promise()},n.when=e=>{e=Array.isArray(e)?e:[e];const t=n();let r=e.length;const i=[];return r?e.forEach(e=>{let n
;if(e&&e.promise)n=e.promise();else{if(!e.then)return void console.warn("promise: incompatible object given to when()",e);n=e}n.fail(e=>{t.reject(e),r=-1}).done(e=>{i.push(e),0==--r&&t.resolve(i)})}):t.resolve(i),t.promise()},n.sleep=e=>{const t=n();return window.setTimeout(t.resolve,e),t.promise()}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERBOSE=t.DEBUG=t.WARN=t.ERROR=t.logger=void 0,t.ERROR=0,t.WARN=30,t.DEBUG=60,t.VERBOSE=80;let n=0;const r=[],i=()=>{
const e=["debug"],t=["log"],r=["warn","info"],i=["error"],o=[...e,...t,...r,...i],a=i;n>=80&&a.push(...e),n>=60&&a.push(...t),n>=30&&a.push(...r),o.forEach(e=>s[e]=a.includes(e)?console[e].bind(console):()=>{})},s={set:e=>{n=e,r.forEach(e=>{e(s,n)}),i()},get:()=>n,verbose:(console.debug||(()=>{})).bind(console),debug:()=>{},log:()=>{},warn:()=>{},info:()=>{},error:()=>{},addChangeListener:e=>{r.push(e)}};t.logger=s,i()},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){
return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.staticVars=t.safeFileName=t.encodeHtml=t.decodeHtml=t.createUUID=t.getDebouncer=t.adiff=t.copy=t.insert=t.each=t.splitSlice=t.toType=t.filterString=t.cPrompt=t.cConfirm=t.cAlert=t.getSource=t.getUrlArgs=t.isLocalImage=t.escapeForRegExp=t.escapeForRegExpURL=t.getStringBetweenTags=t.createUniqueId=void 0;const i=r(n(6)),s=window.rea
;t.createUniqueId=(e,t)=>i.default.Base64.encode(e+"_"+t).replace(/[^0-9a-zA-Z_\-]/g,""),t.getStringBetweenTags=(e,t,n)=>{const r=e.indexOf(t);if(-1==r)return"";if(!n)return e.substr(r+t.length);const i=e.substr(r+t.length).indexOf(n);return-1==i?"":e.substr(r+t.length,i)};const o=(e,t)=>{null==t&&(t=[]);const n=new RegExp("(\\"+["/",".","+","?","|","(",")","[","]","{","}","\\"].concat(t).join("|\\")+")","g");return e.replace(n,"\\$1")};t.escapeForRegExpURL=o,t.escapeForRegExp=e=>o(e,["*"]),
t.isLocalImage=e=>{const t="background.js";let n=s.extension.getURL(t);return n=n.replace(t,"")+"images/",e.length>=n.length&&n==e.substr(0,n.length)},t.getUrlArgs=e=>{const t={};let n=window.location.search.replace(/^\?/,"");const r=window.location.hash.replace(/^#/,"");n?e&&r&&(n=n+"&"+r):n=r;const i=n.split("&");let s;for(let e=0;e<i.length;e++){if(s=i[e].split("="),2!=s.length){const e=s[0],t=s.slice(1).join("=");s=[e,t]}t[s[0]]=decodeURIComponent(s[1])}return t},t.cAlert=e=>{
window.setTimeout(()=>{alert(e)},1)},t.cConfirm=(e,t)=>{window.setTimeout(()=>{const n=confirm(e);t&&t(n)},1)},t.cPrompt=(e,t,n)=>{window.setTimeout(()=>{const r=prompt(e,t);n&&n(r)},1)};const a=e=>(({}.toString.apply(e).match(/\s([a-z|A-Z]+)/)||[])[1]);t.toType=a;const l=(e,t)=>{const n=a(e);if("Array"===n||"NodeList"===n){for(let n=0;n<e.length;n++)if(!1===t(e[n],n))return}else if("XPathResult"===n){let n=e.iterateNext(),r=0;for(;n;){if(!1===t(n,r++))return;n=e.iterateNext()}
}else for(const n in e)if(e.hasOwnProperty(n)&&!1===t(e[n],n))return};t.each=l,t.insert=(e,t,n,r)=>e.slice(0,t)+r+e.slice(t+Math.abs(n));const c=(e,t,n,r)=>{let i;if(Array.isArray(n)){const e={};n.forEach(t=>{e[t]=!0}),i=e}else i=n;return l(i||e,(n,s)=>{if(!i||i.hasOwnProperty(s)){let n;const o=e[s],l=a(o);if("Undefined"==l)return;if(i&&r&&(n=a(i[s]))&&n!==l&&("Array"===n||"Object"===n))return;"Object"==l?(t[s]={},c(o,t[s],i?i[s]:null)):"Array"==l?(t[s]=[],c(o,t[s])):t[s]=o}}),t};t.copy=c,
t.decodeHtml=e=>e.replace(/(?:&#x([a-fA-F0-9]+);|&#([0-9]+);)/g,(e,t,n)=>t?String.fromCharCode(parseInt(t,16)):String.fromCharCode(parseInt(n,10))),t.encodeHtml=e=>e.replace(/[\u00A0-\u2666<>]/g,e=>"&#"+e.charCodeAt(0)+";");const A=e=>document.body?document.body.innerText:e.childNodes.length>0?A(e.childNodes[e.childNodes.length-1]):e.innerText;t.getSource=A,t.getDebouncer=e=>(()=>{let t={};const n=e||1e3,r={clear:()=>{l(t,e=>window.clearTimeout(e)),t={}},is:(e,n)=>{const i=void 0!==t[e]
;return n&&r.add(e),i},add:(e,i)=>{r.is(e)&&window.clearTimeout(t[e]),t[e]=window.setTimeout(()=>{delete t[e]},i||n)}};return r})(),t.filterString=(e,t)=>e&&t?(e.match(t)||[]).join(""):"",t.adiff=(e,t,n)=>{const r=[];return"both"==(n=n||"both")?e.concat(t).forEach(n=>{e.includes(n)&&t.includes(n)||r.push(n)}):"notinfirst"==n&&t.forEach(t=>{e.includes(t)||r.push(t)}),r},t.safeFileName=(e,t,n)=>{void 0===n&&(n="-")
;const r=t?/[:<>|~?*\x00-\x1F\uFDD0-\uFDEF"]/g:/[:<>|~?*\x00-\x1F\uFDD0-\uFDEF"\/\\]|^[.]|[.]$/g;return!t&&/^((CON|PRN|AUX|NUL|CLOCK\$|COM[1-9]|LPT[1-9])(\..*)?|device(\..*)?|desktop.ini|thumbs.db)$/i.test(e)?(n||"_")+e.replace(r,n):e.replace(r,n)},t.createUUID=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),t.splitSlice=(e,t)=>{const n=[];for(let r=0,i=e.length;r<i;r+=t)n.push(e.slice(r,t+r));return n}
;t.staticVars={visible:void 0,invisible:"display: none;",visible_move:void 0,invisible_move:"position:absolute; left: -20000px; top: -200000px; width: 1px; height: 1px;"}},function(e,t,n){"use strict";n.r(t);var r=n(2),i=n(3),s=n(10)
;const o="de.net|gb.net|uk.net|dk.org|eu.org|asn.au|conf.au|csiro.au|edu.au|gov.au|id.au|info.au|net.au|org.au|otc.au|oz.au|telememo.au|ac.cn|ah.cn|bj.cn|cq.cn|edu.cn|gd.cn|gov.cn|gs.cn|gx.cn|gz.cn|hb.cn|he.cn|hi.cn|hk.cn|hl.cn|hn.cn|jl.cn|js.cn|ln.cn|mo.cn|net.cn|nm.cn|nx.cn|org.cn|qh.cn|sc.cn|sh.cn|sn.cn|sx.cn|tj.cn|tw.cn|xj.cn|xz.cn|yn.cn|zj.cn|ac.jp|ad.jp|aichi.jp|akita.jp|aomori.jp|chiba.jp|co.jp|ed.jp|ehime.jp|fukui.jp|fukuoka.jp|fukushima.jp|gifu.jp|go.jp|gov.jp|gr.jp|gunma.jp|hiroshima.jp|hokkaido.jp|hyogo.jp|ibaraki.jp|ishikawa.jp|iwate.jp|kagawa.jp|kagoshima.jp|kanagawa.jp|kanazawa.jp|kawasaki.jp|kitakyushu.jp|kobe.jp|kochi.jp|kumamoto.jp|kyoto.jp|lg.jp|matsuyama.jp|mie.jp|miyagi.jp|miyazaki.jp|nagano.jp|nagasaki.jp|nagoya.jp|nara.jp|ne.jp|net.jp|niigata.jp|oita.jp|okayama.jp|okinawa.jp|or.jp|org.jp|osaka.jp|saga.jp|saitama.jp|sapporo.jp|sendai.jp|shiga.jp|shimane.jp|shizuoka.jp|takamatsu.jp|tochigi.jp|tokushima.jp|tokyo.jp|tottori.jp|toyama.jp|utsunomiya.jp|wakayama.jp|yamagata.jp|yamaguchi.jp|yamanashi.jp|yokohama.jp|ac.uk|co.uk|edu.uk|gov.uk|ltd.uk|me.uk|mod.uk|net.uk|nhs.uk|nic.uk|org.uk|plc.uk|police.uk|sch.uk|co.tv|co.th|co.nz|co.za|com.ac|com.af|com.ag|com.ai|com.al|com.ar|com.au|com.aw|com.az|com.ba|com.bb|com.bh|com.bi|com.bm|com.bo|com.br|com.bs|com.bt|com.by|com.bz|com.ci|com.cm|com.cn|com.co|com.cu|com.cw|com.cy|com.dm|com.do|com.dz|com.ec|com.ee|com.eg|com.es|com.et|com.fr|com.ge|com.gh|com.gi|com.gl|com.gn|com.gp|com.gr|com.gt|com.gu|com.gy|com.hk|com.hn|com.hr|com.ht|com.im|com.io|com.iq|com.is|com.jo|com.kg|com.ki|com.km|com.kp|com.ky|com.kz|com.la|com.lb|com.lc|com.lk|com.lr|com.lv|com.ly|com.mg|com.mk|com.ml|com.mo|com.ms|com.mt|com.mu|com.mv|com.mw|com.mx|com.my|com.na|com.nf|com.ng|com.ni|com.nr|com.om|com.pa|com.pe|com.pf|com.ph|com.pk|com.pl|com.pr|com.ps|com.pt|com.py|com.qa|com.re|com.ro|com.rw|com.sa|com.sb|com.sc|com.sd|com.sg|com.sh|com.sl|com.sn|com.so|com.st|com.sv|com.sy|com.tj|com.tm|com.tn|com.to|com.tr|com.tt|com.tw|com.ua|com.ug|com.uy|com.uz|com.vc|com.ve|com.vi|com.vn|com.vu|com.ws|com.zm|com.de|com.se|com.ru",a=(".("+["aaa|aarp|abb|abbott|abogado|ac|academy|accenture|accountant|accountants|aco|active|actor|ad|adac|ads|adult|ae|aeg|aero|af|afl|ag|agency|ai|aig|airforce|airtel|al|alibaba|alipay|allfinanz|alsace|am|amica|amsterdam|an|analytics|android|ao|apartments|app|apple|aq|aquarelle|ar|aramco|archi|army|arpa|arte|as|asia|associates|at|attorney|au|auction|audi|audio|author|auto|autos|aw|ax|axa|az|azure|ba|baidu|band|bank|bar|barcelona|barclaycard|barclays|bargains|bauhaus|bayern|bb|bbc|bbva|bcn|bd|be|beats|beer|bentley|berlin|best|bet|bf|bg|bh|bharti|bi|bible|bid|bike|bing|bingo|bio|biz|bj|bl|black|blackfriday|bloomberg|blue|bm|bms|bmw|bn|bnl|bnpparibas|bo|boats|boehringer|bom|bond|boo|book|boots|bosch|bostik|bot|boutique|bq|br|bradesco|bridgestone|broadway|broker|brother|brussels|bs|bt|budapest|bugatti|build|builders|business|buy|buzz|bv|bw|by|bz|bzh|ca|cab|cafe|cal|call|camera|camp|cancerresearch|canon|capetown|capital|car|caravan|cards|care|career|careers|cars|cartier|casa|cash|casino|cat|catering|cba|cbn|cc|cd|ceb|center|ceo|cern|cf|cfa|cfd|cg|ch|chanel|channel|chat|cheap|chloe|christmas|chrome|church|ci|cipriani|circle|cisco|citic|city|cityeats|ck|cl|claims|cleaning|click|clinic|clinique|clothing|cloud|club|clubmed|cm|cn|co|coach|codes|coffee|college|cologne|com|commbank|community|company|compare|computer|comsec|condos|construction|consulting|contact|contractors|cooking|cool|coop|corsica|country|coupons|courses|cr|credit|creditcard|creditunion|cricket|crown|crs|cruises|csc|cu|cuisinella|cv|cw|cx|cy|cymru|cyou|cz|dabur|dad|dance|date|dating|datsun|day|dclk|de|dealer|deals|degree|delivery|dell|deloitte|delta|democrat|dental|dentist|desi|design|dev|diamonds|diet|digital|direct|directory|discount|dj|dk|dm|dnp|do|docs|dog|doha|domains|doosan|download|drive|dubai|durban|dvag|dz|earth|eat|ec|edeka|edu|education|ee|eg|eh|email|emerck|energy|engineer|engineering|enterprises|epson|equipment|er|erni|es|esq|estate|et|eu|eurovision|eus|events|everbank|exchange|expert|exposed|express|fage|fail|fairwinds|faith|family|fan|fans|farm|fashion|fast|feedback|ferrero|fi|film|final|finance|financial|firestone|firmdale|fish|fishing|fit|fitness|fj|fk|flickr|flights|florist|flowers|flsmidth|fly|fm|fo|foo|football|ford|forex|forsale|forum|foundation|fox|fr|fresenius|frl|frogans|frontier|fund|furniture|futbol|fyi|ga|gal|gallery|gallup|game|garden|gb|gbiz|gd|gdn|ge|gea|gent|genting|gf|gg|ggee|gh|gi|gift|gifts|gives|giving|gl|glass|gle|global|globo|gm|gmail|gmo|gmx|gn|gold|goldpoint|golf|goo|goog|google|gop|got|gov|gp|gq|gr|grainger|graphics|gratis|green|gripe|group|gs|gt|gu|gucci|guge|guide|guitars|guru|gw|gy|hamburg|hangout|haus|hdfcbank|health|healthcare|help|helsinki|here|hermes|hiphop|hitachi|hiv|hk|hm|hn|hockey|holdings|holiday|homedepot|homes|honda|horse|host|hosting|hoteles|hotmail|house|how|hr|hsbc|ht|hu|hyundai|ibm|icbc|ice|icu|id|ie|ifm|iinet|il|im|immo|immobilien|in|industries|infiniti|info|ing|ink|institute|insurance|insure|int|international|investments|io|ipiranga|iq|ir|irish|is|iselect|ist|istanbul|it|itau|iwc|jaguar|java|jcb|je|jetzt|jewelry|jlc|jll|jm|jmp|jo|jobs|joburg|jot|joy|jp|jprs|juegos|kaufen|kddi|ke|kfh|kg|kh|ki|kia|kim|kinder|kitchen|kiwi|km|kn|koeln|komatsu|kp|kpn|kr|krd|kred|kw|ky|kyoto|kz|la|lacaixa|lamborghini|lamer|lancaster|land|landrover|lanxess|lasalle|lat|latrobe|law|lawyer|lb|lc|lds|lease|leclerc|legal|lexus|lgbt|li|liaison|lidl|life|lifeinsurance|lifestyle|lighting|like|limited|limo|lincoln|linde|link|live|living|lixil|lk|loan|loans|lol|london|lotte|lotto|love|lr|ls|lt|ltd|ltda|lu|lupin|luxe|luxury|lv|ly|ma|madrid|maif|maison|makeup|man|management|mango|market|marketing|markets|marriott|mba|mc|md|me|med|media|meet|melbourne|meme|memorial|men|menu|meo|mf|mg|mh|miami|microsoft|mil|mini|mk|ml|mm|mma|mn|mo|mobi|mobily|moda|moe|moi|mom|monash|money|montblanc|mormon|mortgage|moscow|motorcycles|mov|movie|movistar|mp|mq|mr|ms|mt|mtn|mtpc|mtr|mu|museum|mutuelle|mv|mw|mx|my|mz|na|nadex|nagoya|name|natura|navy|nc|ne|nec|net|netbank|network|neustar|new|news|nexus|nf|ng|ngo|nhk|ni|nico|nikon|ninja|nissan|nl|no|nokia|norton|nowruz|np|nr|nra|nrw|ntt|nu|nyc|nz|obi|office|okinawa|om|omega|one|ong|onl|online|ooo|oracle|orange|org|organic|origins|osaka|otsuka|ovh|pa|page|pamperedchef|panerai|paris|pars|partners|parts|party|pe|pet|pf|pg|ph|pharmacy|philips|photo|photography|photos|physio|piaget|pics|pictet|pictures|pid|pin|ping|pink|pizza|pk|pl|place|play|playstation|plumbing|plus|pm|pn|pohl|poker|porn|post|pr|praxi|press|pro|prod|productions|prof|promo|properties|property|protection|ps|pt|pub|pw|pwc|py|qa|qpon|quebec|quest|racing|re|read|realtor|realty|recipes|red|redstone|redumbrella|rehab|reise|reisen|reit|ren|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rexroth|rich|ricoh|rio|rip|ro|rocher|rocks|rodeo|room|rs|rsvp|ru|ruhr|run|rw|rwe|ryukyu|sa|saarland|safe|safety|sakura|sale|salon|samsung|sandvik|sandvikcoromant|sanofi|sap|sapo|sarl|sas|saxo|sb|sbs|sc|sca|scb|schaeffler|schmidt|scholarships|school|schule|schwarz|science|scor|scot|sd|se|seat|security|seek|select|sener|services|seven|sew|sex|sexy|sfr|sg|sh|sharp|shell|shia|shiksha|shoes|show|shriram|si|singles|site|sj|sk|ski|skin|sky|skype|sl|sm|smile|sn|sncf|so|soccer|social|softbank|software|sohu|solar|solutions|sony|soy|space|spiegel|spreadbetting|sr|srl|ss|st|stada|star|starhub|statefarm|statoil|stc|stcgroup|stockholm|storage|studio|study|style|su|sucks|supplies|supply|support|surf|surgery|suzuki|sv|swatch|swiss|sx|sy|sydney|symantec|systems|sz|tab|taipei|taobao|tatamotors|tatar|tattoo|tax|taxi|tc|tci|td|team|tech|technology|tel|telefonica|temasek|tennis|tf|tg|th|thd|theater|theatre|tickets|tienda|tiffany|tips|tires|tirol|tj|tk|tl|tm|tmall|tn|to|today|tokyo|tools|top|toray|toshiba|tours|town|toyota|toys|tp|tr|trade|trading|training|travel|travelers|travelersinsurance|trust|trv|tt|tube|tui|tushu|tv|tvs|tw|tz|ua|ubs|ug|uk|um|unicom|university|uno|uol|us|uy|uz|va|vacations|vana|vc|ve|vegas|ventures|verisign|versicherung|vet|vg|vi|viajes|video|villas|vin|vip|virgin|vision|vista|vistaprint|viva|vlaanderen|vn|vodka|volkswagen|vote|voting|voto|voyage|vu|wales|walter|wang|wanggou|watch|watches|weather|weatherchannel|webcam|weber|website|wed|wedding|weir|wf|whoswho|wien|wiki|williamhill|win|windows|wine|wme|wolterskluwer|work|works|world|ws|wtc|wtf|xbox|xerox|xin|测试|कॉम|परीक्षा|佛山|慈善|集团|在线|한국|点看|คอม|ভারত|八卦|‏موقع‎|বাংলা|公益|公司|移动|我爱你|москва|испытание|қаз|онлайн|сайт|联通|срб|бел|‏קום‎|时尚|테스트|淡马锡|орг|नेट|삼성|சிங்கப்பூர்|商标|商店|商城|дети|мкд|‏טעסט‎|ею|ポイント|新闻|工行|‏كوم‎|中文网|中信|中国|中國|娱乐|谷歌|భారత్|ලංකා|购物|測試|ભારત|भारत|‏آزمایشی‎|பரிட்சை|网店|संगठन|餐厅|网络|ком|укр|香港|诺基亚|δοκιμή|飞利浦|‏إختبار‎|台湾|台灣|手表|手机|мон|‏الجزائر‎|‏عمان‎|‏ارامكو‎|‏ایران‎|‏امارات‎|‏بازار‎|‏پاکستان‎|‏الاردن‎|‏موبايلي‎|‏بھارت‎|‏المغرب‎|‏السعودية‎|‏سودان‎|‏همراه‎|‏عراق‎|‏مليسيا‎|澳門|닷컴|政府|‏شبكة‎|‏بيتك‎|გე|机构|组织机构|健康|ไทย|‏سورية‎|рус|рф|珠宝|‏تونس‎|大拿|みんな|グーグル|ελ|世界|ਭਾਰਤ|网址|닷넷|コム|游戏|vermögensberater|vermögensberatung|企业|信息|‏مصر‎|‏قطر‎|广东|இலங்கை|இந்தியா|հայ|新加坡|‏فلسطين‎|テスト|政务|xperia|xxx|xyz|yachts|yahoo|yamaxun|yandex|ye|yodobashi|yoga|yokohama|youtube|yt|za|zara|zero|zip|zm|zone|zuerich|zw",o].join("|")+")").replace(/\./gi,"\\."),l=Object(s.createCache)({
timeout:180,check_interval:120,retimeout_on_get:!0}).init(),c=(()=>{const e=e=>e.split("").map(e=>{const t=e.toLowerCase(),n=e.toUpperCase();return t!=n?"["+t+n+"]":e}).join(""),t=["protocol","hostname","port","origin"],n=["pathname"],s=["search","hash"],c=t.concat(n).concat(s);let A;const d=(e,r)=>{const i={};if(null==e)c.forEach(e=>{i[e]=""});else if(["data:","view-source:"].some(t=>e.startsWith(t))){i.origin="null";const t=e.indexOf(":");i.protocol=e.substr(0,t+1),i.pathname=e.substr(t+1)
}else{const o=document.createElement("a");o.href=e;const a=document.body||document.documentElement||document;if(a.appendChild(o),c.forEach(e=>{i[e]=o[e]}),a.removeChild(o),!r&&i.protocol){if(0!==e.toLowerCase().indexOf(i.protocol))if(e.startsWith("//"))i.origin="",i.protocol="";else{if(!["/","?","#"].includes(e[0]))return d("/"+e);A||(A=d("",!0)),s.concat(n).forEach(e=>{A[e]===i[e]&&(i[e]="")}),t.forEach(e=>{i[e]=""})}
["tampermonkey:"].includes(i.protocol)&&(i.pathname=((i.hostname?"/"+i.hostname:"")+(i.pathname||"")).replace(/^\/+/,"/"),i.hostname="")}}return"0"===i.port&&(i.port=""),Object.defineProperties(i,{domain:{get:function(){const e=i.hostname.split("."),t=e.pop();let n=`${e.pop()}.${t}`;return f.isSecondLevelDomain(n)&&(n=`${e.pop()}.${n}`),n}}}),i
},u=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,p=/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/
;let h;const f={isIp:function(e){return e.match(u)||e.match(p)},isIpOrHostname:function(e){return f.isIp(e)||!e.includes(".")},isSecondLevelDomain:function(e){return h=h||new RegExp("^("+o.replace(/\./g,"\\.")+")$"),e.match(h)},sanitize:function(e,t,n){let r=!1;const i=f.parse(e);if(i)return"tampermonkey:"==i.protocol?i.pathname.includes("..")?r=!0:e=rea.extension.getURL(e.replace(/^tampermonkey:\/\//,"")):i.protocol||t&&(e=f.rel2abs(e,t,n||["http:","https:"]))||(r=!0),r?null:e},
parse:function(e){if(null==e)return;let t=l.get(e);return t||(t=d(e),l.set(e,t),t)},rel2abs:function(e,t,n){let r,i,s;if(e&&t&&(r=f.parse(e))&&(i=f.parse(t))&&r&&i&&i.protocol&&(!n||n.includes(i.protocol)||!e.includes("..")))return e.startsWith("//")?i.protocol+"//"+r.hostname+(r.port?":"+r.port:"")+r.pathname+r.search:("/"===e[0]?s=r.pathname:(t=f.woParams(i),i=f.parse(t+("/"===t[t.length-1]?"":"/")+e),s=i.pathname),i.protocol+"//"+i.hostname+(i.port?":"+i.port:"")+s+r.search)},
toUrl:function(e,t){return t=t||{},(["about:"].includes(e.protocol)?e.protocol:e.protocol+"//")+e.hostname+(e.port&&e.port>0?":"+e.port:"")+(t.nopath?"":e.pathname+(t.nosearch?"":e.search))},woPath:function(e){const t="string"==typeof e?f.parse(e):e;return f.toUrl(t,{nopath:!0})},woParams:function(e){const t="string"==typeof e?f.parse(e):e;return f.toUrl(t,{nosearch:!0})},woHash:function(e){const t="string"==typeof e?f.parse(e):e;return f.toUrl(t)},hash2params:function(e){
return Object.keys(e).map(t=>void 0===e[t]?null:encodeURIComponent(t)+"="+encodeURIComponent(e[t])).filter(e=>e).join("&")},params2hash:function(e){return"string"!=typeof e&&(e=e.search?e.search.substring(1):e.hash?e.hash.substring(1):""),e.split("&").reduce((e,t)=>{const n=t.split("=");return e[decodeURIComponent(n[0])]=decodeURIComponent(n[1]),e},{})},getRegExpFromInclude:e=>{let t;return"*"==e?t="^(https?|file)://.*":(t=e.includes(".*/")?e.replace(".*/",".tld/"):e,
t="^"+Object(i.escapeForRegExpURL)(t),t=t.replace(/\*/gi,".*"),t=t.replace(Object(i.escapeForRegExpURL)(".tld/"),a+"/"),t=t.replace(/(\^|:\/\/)\.\*/,"$1([^\\?#])*"),t=t.replace(/<1>/g,"([^\\/#\\?]*\\.)?"),t=t.replace(/<2>/g,"[^#\\?]*"),t=t.replace(/<3>/g,"([^\\?#]*\\.)*")),"("+t+")"},getRegExpFromMatch:(t,n)=>{let s,o,l,c,A,d;const u="://",p="/";if(s=t.replace(/\$$/,"").split(u),s.length<2?(o="",l=t):(o=s[0].replace(/^\^/,""),l=s.slice(1).join(u)),c=l.split(p),
d=c.length<2?"/":p+c.slice(1).join(p),A=c[0],"http*"===o?o="https<1>":o.match(/\*|http|https|file|ftp/)||(r.logger.warn('uri: override scheme "'+o+'" with "*"'),o="*"),"file"===o)A="";else{const e=A,t=A.match(/\*$|(\*\.)?[^\/\*]+/);A=(t?t[0]:"").replace(/:[0-9]*$/,""),A!==e&&r.logger.warn('uri: override host "'+e+'" with "'+A+'"')}return d&&d.substr(0,1)===p||(r.logger.warn('uri: prefix path "'+d+'" with "/"'),d=p+d),o=Object(i.escapeForRegExpURL)(o).replace(/\*/gi,"[^:\\/#\\?]*"),
A=Object(i.escapeForRegExpURL)(A).replace(/\*\\\./gi,"(*\\.)?").replace(/\*/gi,"[^#\\?\\/]*"),d=Object(i.escapeForRegExpURL)(d).replace(/\*/gi,".*"),o=o.replace(/<1>/g,"?"),A=A.replace(new RegExp(Object(i.escapeForRegExpURL)(".tld")+"$"),a),n||(o=e(o),A=e(A)),A+="(:[0-9]{1,5})?","(^"+o+Object(i.escapeForRegExpURL)(u)+A+d+"$)"}};return f})();t.default=c},,function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={encode:e=>window.unescape(window.encodeURIComponent(e)),
decode:e=>window.decodeURIComponent(window.escape(e))},r=(e,t)=>{try{let r;r="object"==typeof t?t.encoding:t,r&&"utf-8"==r.toLowerCase()&&(e=n.encode(e));const i=new window.Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=255&e.charCodeAt(t);return i.buffer}catch(e){window.console.warn(e)}return new window.Uint8Array(0).buffer},i={UTF8:n,Base64:{encode:e=>{let t="";for(let n=0;n<e.length;n++)t+=window.String.fromCharCode(255&e.charCodeAt(n));return window.btoa(t)},decode:e=>window.atob(e)},
encode:e=>window.escape(e),decode:e=>window.unescape(e),encodeR:e=>e,decodeR:e=>e,encodeS:e=>window.btoa(n.encode(e)),decodeS:e=>n.decode(window.atob(e)),MD5:(e,t)=>{const r=(e,t)=>e<<t|e>>>32-t,i=(e,t)=>{const n=2147483648&e,r=2147483648&t,i=1073741824&e,s=1073741824&t,o=(1073741823&e)+(1073741823&t);return i&s?2147483648^o^n^r:i|s?1073741824&o?3221225472^o^n^r:1073741824^o^n^r:o^n^r},s=(e,t,n,s,o,a,l)=>(e=i(e,i(i(((e,t,n)=>e&t|~e&n)(t,n,s),o),l)),
i(r(e,a),t)),o=(e,t,n,s,o,a,l)=>(e=i(e,i(i(((e,t,n)=>e&n|t&~n)(t,n,s),o),l)),i(r(e,a),t)),a=(e,t,n,s,o,a,l)=>(e=i(e,i(i(((e,t,n)=>e^t^n)(t,n,s),o),l)),i(r(e,a),t)),l=(e,t,n,s,o,a,l)=>(e=i(e,i(i(((e,t,n)=>t^(e|~n))(t,n,s),o),l)),i(r(e,a),t)),c=e=>{let t,n,r="",i="";for(n=0;n<=3;n++)t=e>>>8*n&255,i="0"+t.toString(16),r+=i.substr(i.length-2,2);return r};let A,d,u,p,h,f,g,m,_,b=[];for(t&&"utf-8"==t.toLowerCase()&&(e=n.encode(e)),b=(e=>{let t;const n=e.length,r=n+8,i=16*((r-r%64)/64+1),s=Array(i-1)
;let o=0,a=0;for(;a<n;)t=(a-a%4)/4,o=a%4*8,s[t]=s[t]|e.charCodeAt(a)<<o,a++;return t=(a-a%4)/4,o=a%4*8,s[t]=s[t]|128<<o,s[i-2]=n<<3,s[i-1]=n>>>29,s})(e),f=1732584193,g=4023233417,m=2562383102,_=271733878,A=0;A<b.length;A+=16)d=f,u=g,p=m,h=_,f=s(f,g,m,_,b[A+0],7,3614090360),_=s(_,f,g,m,b[A+1],12,3905402710),m=s(m,_,f,g,b[A+2],17,606105819),g=s(g,m,_,f,b[A+3],22,3250441966),f=s(f,g,m,_,b[A+4],7,4118548399),_=s(_,f,g,m,b[A+5],12,1200080426),m=s(m,_,f,g,b[A+6],17,2821735955),
g=s(g,m,_,f,b[A+7],22,4249261313),f=s(f,g,m,_,b[A+8],7,1770035416),_=s(_,f,g,m,b[A+9],12,2336552879),m=s(m,_,f,g,b[A+10],17,4294925233),g=s(g,m,_,f,b[A+11],22,2304563134),f=s(f,g,m,_,b[A+12],7,1804603682),_=s(_,f,g,m,b[A+13],12,4254626195),m=s(m,_,f,g,b[A+14],17,2792965006),g=s(g,m,_,f,b[A+15],22,1236535329),f=o(f,g,m,_,b[A+1],5,4129170786),_=o(_,f,g,m,b[A+6],9,3225465664),m=o(m,_,f,g,b[A+11],14,643717713),g=o(g,m,_,f,b[A+0],20,3921069994),f=o(f,g,m,_,b[A+5],5,3593408605),
_=o(_,f,g,m,b[A+10],9,38016083),m=o(m,_,f,g,b[A+15],14,3634488961),g=o(g,m,_,f,b[A+4],20,3889429448),f=o(f,g,m,_,b[A+9],5,568446438),_=o(_,f,g,m,b[A+14],9,3275163606),m=o(m,_,f,g,b[A+3],14,4107603335),g=o(g,m,_,f,b[A+8],20,1163531501),f=o(f,g,m,_,b[A+13],5,2850285829),_=o(_,f,g,m,b[A+2],9,4243563512),m=o(m,_,f,g,b[A+7],14,1735328473),g=o(g,m,_,f,b[A+12],20,2368359562),f=a(f,g,m,_,b[A+5],4,4294588738),_=a(_,f,g,m,b[A+8],11,2272392833),m=a(m,_,f,g,b[A+11],16,1839030562),
g=a(g,m,_,f,b[A+14],23,4259657740),f=a(f,g,m,_,b[A+1],4,2763975236),_=a(_,f,g,m,b[A+4],11,1272893353),m=a(m,_,f,g,b[A+7],16,4139469664),g=a(g,m,_,f,b[A+10],23,3200236656),f=a(f,g,m,_,b[A+13],4,681279174),_=a(_,f,g,m,b[A+0],11,3936430074),m=a(m,_,f,g,b[A+3],16,3572445317),g=a(g,m,_,f,b[A+6],23,76029189),f=a(f,g,m,_,b[A+9],4,3654602809),_=a(_,f,g,m,b[A+12],11,3873151461),m=a(m,_,f,g,b[A+15],16,530742520),g=a(g,m,_,f,b[A+2],23,3299628645),f=l(f,g,m,_,b[A+0],6,4096336452),
_=l(_,f,g,m,b[A+7],10,1126891415),m=l(m,_,f,g,b[A+14],15,2878612391),g=l(g,m,_,f,b[A+5],21,4237533241),f=l(f,g,m,_,b[A+12],6,1700485571),_=l(_,f,g,m,b[A+3],10,2399980690),m=l(m,_,f,g,b[A+10],15,4293915773),g=l(g,m,_,f,b[A+1],21,2240044497),f=l(f,g,m,_,b[A+8],6,1873313359),_=l(_,f,g,m,b[A+15],10,4264355552),m=l(m,_,f,g,b[A+6],15,2734768916),g=l(g,m,_,f,b[A+13],21,1309151649),f=l(f,g,m,_,b[A+4],6,4149444226),_=l(_,f,g,m,b[A+11],10,3174756917),m=l(m,_,f,g,b[A+2],15,718787259),
g=l(g,m,_,f,b[A+9],21,3951481745),f=i(f,d),g=i(g,u),m=i(m,p),_=i(_,h);return(c(f)+c(g)+c(m)+c(_)).toLowerCase()},ab2strSync:(e,t)=>{try{let r,i;if("object"==typeof t?(r=t.encoding,i=t.array):r=t,window.TextDecoder&&!i&&r)return new window.TextDecoder(r).decode(e);{let t=0;const i=[],s=e.byteLength;for(;t<s;t+=16384)i.push(window.String.fromCharCode.apply(null,new Uint8Array(e,t,Math.min(16384,s-t))));let o=i.join("");return r&&"utf-8"==r.toLowerCase()&&(o=n.decode(o)),o}}catch(e){
window.console.warn(e)}return null},str2abSync:r,ab2str:(e,t)=>new Promise((n,r)=>{const i=t&&t.encoding?"text/plain":"binary/octet-stream",s=new Blob([e],{type:i}),o=new FileReader;o.onload=e=>{e.target?n(e.target.result):r(new Error("Could not convert array to string!"))},t&&t.encoding?o.readAsText(s,t.encoding):o.readAsBinaryString(s)}),str2ab:(e,t)=>new Promise(n=>{n(r(e,t))}),dataUri2Blob:e=>{let t
;t=e.split(",")[0].includes("base64")?window.atob(e.split(",")[1]):window.unescape(e.split(",")[1]);const n=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return new window.Blob([r],{type:n})},blob2dataUri:(e,t)=>{const n=new window.FileReader;n.onload=e=>{var n;t((null===(n=e.target)||void 0===n?void 0:n.result)||null)},n.readAsDataURL(e)},blob2str:async(e,t)=>new Promise(n=>{const r=new FileReader;r.onload=()=>{
n(r.result||"")},r.onerror=e=>{console.warn("unable to decode data "+e),n("")},t?r.readAsText(e,t):r.readAsBinaryString(e)})};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.determineOriginOfUrl=t.HEADER_STOP=t.HEADER_START=t.versionCmp=t.createScriptFromSrc=t.processHeader=t.processMetaHeader=t.createScript=t.init=void 0;const r=n(3),i=n(10),s=n(0),o=n(2);let a;const l={},c=e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>[],
set:(e,t)=>(e.push(t),e)};return(null==t?void 0:t.length)&&t.forEach(e=>l[e]=n),n},A=e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>null,set:(t,n)=>{const r=(null==e?void 0:e.convert)?e.convert(n):n;return null===t?r:t}};return(null==t?void 0:t.length)&&t.forEach(e=>l[e]=n),n},d=e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>({}),set:(t,n,r)=>{r=r?s.normalizeLocale(r):"default";const i=(null==e?void 0:e.convert)?e.convert(n):n;return t[r]=t[r]||i,t}}
;return(null==t?void 0:t.length)&&t.forEach(e=>l[e]=n),n},u={name:d({convert:e=>null==e?void 0:e.replace(/\s\s+/g," ")}),version:A({convert:e=>(null==e?void 0:e.replace(/\s/g,""))||e}),grants:c({keys:["grant"]}),icon:A({keys:["icon","iconURL","iconUrl","defaulticon"]}),icon64:A({keys:["icon64","iconURL64"]}),supportURL:A({keys:["supportURL","supportUrl"]}),fileURL:A(),downloadURL:A({keys:["downloadURL","downloadUrl"]}),updateURL:A({keys:["updateURL","updateUrl"]}),namespace:A({
convert:e=>""===e?null:e}),author:A(),copyright:A(),homepage:A({keys:["homepage","homepageURL","homepageUrl","website","source"]}),description:d(),includes:c({keys:["include"]}),excludes:c({keys:["exclude"]}),matches:c({keys:["match"]}),requires:c({keys:["require"]}),resources:(e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>({}),set:(t,n)=>{const r=n.match(/^(\S*)\s+(.*)/);if(r&&void 0===t[r[1]]){const n=(null==e?void 0:e.convert)?e.convert(r[2]):r[2];t[r[1]]=n}return t}}
;return(null==t?void 0:t.length)&&t.forEach(e=>l[e]=n),n})({keys:["resource"]}),noframes:(()=>{const e=void 0,t={default:()=>null,set:()=>!0};return(null==e?void 0:e.length)&&e.forEach(e=>l[e]=t),t})(),connects:c({keys:["connect","connect-src","domain"]}),webRequest:c(),"run-at":A(),antifeatures:(e=>{const t=null==e?void 0:e.keys,n={keys:t,default:()=>({}),set:(t,n,r)=>{var i;r=r?s.normalizeLocale(r):"default";const o=n.match(/^(\S*)\s+(.*)/);if(o){
const n=t[i=o[1]]||(t[i]={}),s=(null==e?void 0:e.convert)?e.convert(o[2]):o[2];n[r]=s}return t}};return(null==t?void 0:t.length)&&t.forEach(e=>l[e]=n),n})({keys:["antifeature"]})},p={};Object.entries(u).forEach(([e,t])=>{t.keys?t.keys.forEach(t=>{p[t]=e}):p[e]=e});const h="==UserScript==";t.HEADER_START=h;const f="==/UserScript==";t.HEADER_STOP=f;const g=/(?:^|\n)\s*\/\/\x20*==UserScript==([\s\S]*?\n)\s*\/\/\x20*==\/UserScript==|$/,m=()=>({...{
...Object.fromEntries(Object.keys(u).map(e=>[e,u[e].default()]))}}),_=e=>{const t=e.match(g),n=(t?t[1]:"")||"",r={};return n.replace(/(?:^|\n)\s*\/\/\s*(@\S+)(.*)/g,(e,t,n)=>{const[i,s]=t.slice(1).split(":"),o=p[i],a=l[o]||u[o]||void 0;if(a){const e=n.trim();let t=r[o];void 0===t&&(t=a.default()),r[o]=a.set(t,e,s)}else(null==r?void 0:r.name)&&(null==r?void 0:r.name).default;return""}),{...m(),...r}},b=e=>{
const{name:t,description:n,version:r,grants:i,fileURL:s,requires:o,resources:a,webRequest:l,namespace:c,noframes:A,author:d,copyright:u,antifeatures:p}=e;let{icon:h,icon64:f,updateURL:g,downloadURL:m,supportURL:_,homepage:b,includes:v,matches:w,excludes:k,connects:y}=e;const R=e["run-at"]||null,x=(e,{[e]:t,...n})=>n,C=i.filter(e=>e);h=h||null,f=f||null,g=g||null,m=m||null,_=_||null,b=b||null;const E=t.default,I=n.default,M=x("default",t),G=x("default",n);v=v.filter(e=>e),w=w.filter(e=>e),
k=k.filter(e=>e),y=y.filter(e=>e);const Z=Object.entries(a).map(([e,t])=>({name:e,url:t,loaded:!1})).filter(e=>e.url);return{name:E,description:I,version:r||"0.0",grant:C,icon:h,icon64:f,supportURL:_,fileURL:s,downloadURL:m,updateURL:g,namespace:c,requires:o.filter(e=>e).map(e=>({url:e,loaded:!1,textContent:""})),includes:v,matches:w,excludes:k,homepage:b,resources:Z,connects:y,webRequest:l.map(e=>{const t=JSON.parse(e);return Array.isArray(t)?t:[t]}).reduce((e,t)=>e.concat(t),[]),author:d,
copyright:u,antifeatures:p,name_i18n:M,description_i18n:G,uuid:null,system:!1,enabled:!0,position:0,blockers:[],lastModified:0,sync:{imported:!1},options:{check_for_updates:!0,comment:null,compatopts_for_requires:!0,compat_wrappedjsobject:!1,compat_metadata:!1,compat_foreach:!1,compat_prototypes:!1,noframes:A,run_at:R,override:{use_includes:[],orig_includes:[],merge_includes:!0,use_matches:[],orig_matches:[],merge_matches:!0,use_excludes:[],orig_excludes:[],merge_excludes:!0,use_connects:[],
merge_connects:!0,use_blockers:[],orig_run_at:null,orig_noframes:null}},textContent:null,header:null}},v=(()=>{const e=e=>{const t=e.split(".");return t.slice(0,3).concat([t.slice(3).join(".")]).concat([0,0,0,0]).slice(0,4).map(e=>{const t=e.toString().match(/((?:\-?[0-9]+)?)([^0-9\-]*)((?:\-?[0-9]+)?)(.*)/);return t?[Number(t[1]),t[2],Number(t[3]),t[4]]:[]}).reduce((e,t)=>e.concat(t))},t=(n,r)=>{const i=Array.isArray(n)?n:e(n),s=Array.isArray(r)?r:e(r);for(let e=0;e<16;e++){const n=i[e],r=s[e]
;if(e%2==1){if(!n&&r)return t.eNEWER;if(n&&!r)return t.eOLDER;const e=n.match(/\w/g)||[],i=r.match(/\w/g)||[];for(let n=0;n<Math.min(e.length,i.length);n++){if(e[n].charCodeAt(0)>i[n].charCodeAt(0))return t.eNEWER;if(e[n].charCodeAt(0)<i[n].charCodeAt(0))return t.eOLDER}if(e.length>i.length)return t.eNEWER;if(e.length<i.length)return t.eOLDER}else{if(Number(n)>Number(r))return t.eNEWER;if(Number(n)<Number(r))return t.eOLDER}}return t.eEQUAL};return t.eERROR=-2,t.eOLDER=-1,t.eEQUAL=0,t.eNEWER=1,t
})();t.versionCmp=v,t.createScriptFromSrc=e=>{const t=(e=>{const t=r.getStringBetweenTags(e,h,f);if(!t)return null;const n=e.indexOf(h),i=e.indexOf("<html>"),s=e.indexOf("<body>");return i>0&&i<n||s>0&&s<n?null:["// ",h,t,f].join("")})(e);if(!t)return null;const n=w(t);return n?(n.textContent=e,n.header=t,n.options.compat_wrappedjsobject=e!=a.unWrappedJsObjectify(e),n.options.compat_metadata=e!=a.unMetaDataify(e),n):null};const w=e=>{
const t=(e=>_(e))(e=(e=(e=(e=(e||"").replace(/(\r\n|\n|\r)/gm,"\n")).replace(/\t/g,"    ")).replace(/\n\n+/g,"\n")).replace(/[^|\n][ \t]+\/\//g,"//"));if(t)return b(t)};t.processHeader=w,t.processMetaHeader=e=>_(e),t.createScript=()=>b(m())||{},t.init=e=>{a=e};const k="try to take over the world!",y="This script was deleted from Greasy Fork, and due to its negative effects, it has been automatically removed from your browser.",R=i.createCache({timeout:600,retimeout_on_get:!0})
;t.determineOriginOfUrl=e=>{if(e){let t;const n=e.match(new RegExp("https?://userscripts\\.org/scripts/(source|version)/([0-9]{1,9})\\.user\\.js"))||e.match(new RegExp("https?://userscripts-mirror\\.org/scripts/(source|version)/([0-9]{1,9})\\.user\\.js"));if(n&&3==n.length)return{id:n[2],token:"uso",updates:!1,meta_url:!0,url:"http://userscripts-mirror.org/scripts/show/"+n[2],code_url:"http://userscripts-mirror.org/scripts/review/"+n[2],issue_url:"http://contactbyweb.com/userscripts-mirror"}
;const r=e.match(new RegExp("https?://greasyfork\\.org/(?:[^/]+/)?scripts/([^/-]+).*/code.*\\.user\\.js"));if(r&&2==r.length)return t=r[1],{id:t,token:"gf",updates:!0,meta_url:!0,url:"https://greasyfork.org/scripts/"+t,issue_url:"https://greasyfork.org/scripts/"+t+"/feedback",code_url:"https://greasyfork.org/scripts/"+t+"/code",updates_allowed:function(e){return!e.match(new RegExp("https?://greasyfork\\.org/scripts/([^/]+)/code/.*\\.user\\.js.*version=[0-9]+.*"))},convert:async e=>{var t
;let n,r=e;if(r){const i=null===(t=e.description)||void 0===t?void 0:t.trim();i===k?r.description="":i===y&&(r=null,n="deleted by hoster")}return{script:r,warning:n}}};const i=e.match(new RegExp("https?://sleazyfork\\.org/(?:[^/]+/)?scripts/([^/-]+).*/code.*\\.user\\.js"));if(i&&2==i.length)return t=i[1],{id:t,token:"sf",updates:!0,meta_url:!0,url:"https://sleazyfork.org/scripts/"+t,issue_url:"https://sleazyfork.org/scripts/"+t+"/feedback",code_url:"https://sleazyfork.org/scripts/"+t+"/code",
updates_allowed:function(e){return!e.match(new RegExp("https?://sleazyfork\\.org/scripts/([^/]+)/code/.*\\.user\\.js.*version=[0-9]+.*"))},convert:async e=>{var t;let n,r=e;if(r){const i=null===(t=e.description)||void 0===t?void 0:t.trim();i===k?r.description="":i===y&&(r=null,n="deleted by hoster")}return{script:r,warning:n}}};const s=e.match(new RegExp("https?://openuserjs\\.org/install/([^/]+)+/(.+?)(?:\\.min)?\\.user\\.js"));if(s&&3==s.length)return s.shift(),{id:s.join("/"),token:"ouj",
updates:!0,meta_header:!0,url:"https://openuserjs.org/scripts/"+s[0]+"/"+s[1],issue_url:"https://openuserjs.org/scripts/"+s[0]+"/"+s[1]+"/issues",code_url:"https://openuserjs.org/scripts/"+s[0]+"/"+s[1]+"/source",convert:async e=>{var t;const n=e;return n&&(null===(t=e.description)||void 0===t?void 0:t.trim())===k&&(n.description=""),{script:n,warning:void 0}}}
;const a=e.match(new RegExp("https?://raw\\.githubusercontent\\.com/([^/]+)/([^/]+)/[^/]+/(.*)\\.user\\.js"))||e.match(new RegExp("https?://github\\.com/([^/]+)/([^/]+)/raw/[^/]+/(.*)\\.user\\.js"))||e.match(new RegExp("https?://raw.github\\.com/([^/]+)/([^/]+)/[^/]+/(.*)\\.user\\.js"))||e.match(new RegExp("https?://github\\.com/([^/]+)/([^/]+)/releases/download/[^/]+/(.*)\\.user\\.js")),l=e.match(new RegExp("https?://(([^\\.]+).github\\.io)/(.*)\\.user\\.js"))
;if(a&&4==a.length||l&&4==l.length){let e;if(a){a.shift();const[n,r,i]=a;e=[n,r].join("/"),t=[n,r].concat(r==i?[]:i).join("/")}else{if(!l)throw new Error("Should never happen!");{l.shift();const[n,r,i]=l;e=[r,n].join("/"),t=[r,n].concat(n==i?[]:i).join("/")}}return{id:t,token:"gh",updates:!0,url:"https://github.com/"+e,issue_url:"https://github.com/"+e+"/issues"}}
const c=e.match(new RegExp("https?://gist\\.github\\.com/([^/]+)/([^/]+)/raw/(.*/)?.*\\.user\\.js"))||e.match(new RegExp("https?://gist\\.githubusercontent\\.com/([^/]+)/([^/]+)/raw/(.*/)?.*\\.user\\.js"));if(c&&(3==c.length||4==c.length)){const e=c[1],n=c[2];return t=`${e}/${n}`,{id:t,token:"gst",updates:4==c.length,url:"https://gist.github.com/"+t,issue_url:`https://gist.github.com/${t}#new_comment_field`,code_url:"https://gist.github.com/"+t,precheck:async()=>{const t=R.get(e);let r;if(t){
if(r=t.json,!r)return"cache error"}else{const t=await fetch(`https://api.github.com/users/${e}/gists`,{method:"GET",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{Accept:"application/vnd.github.v3+json"},redirect:"follow",referrerPolicy:"no-referrer"});if(200!==t.status){o.logger.warn(`Unable to load gists of "${e}" -> SKIPPING`);const t="unable to load gists of user";return R.set(e,{error:t}),t}r=await t.json(),R.set(e,{error:null,json:r})}
return r?r.reduce((e,t)=>(e[t.id]=t.public,e),{})[n]?null:"secret gist":"unable to decode gists of user"}}}const A=e.match(new RegExp("https?://gitlab\\.com/([^/]+)/([^/]+)/(?:-/)?(?:raw|blob)/[^/]+/(.*)\\.user\\.js"));if(A&&4==A.length){A.shift();const[e,n,r]=A;t=[e,n].concat(n==r?[]:r).join("/");const i=[e,n].join("/");return{id:t,token:"gl",updates:!0,url:"https://gitlab.com/"+i,issue_url:"https://gitlab.com/"+i+"/issues"}}
const d=e.match(new RegExp("https?://bitbucket\\.org/([^/]+)/([^/]+)/raw/[^/]+/(.*)\\.user\\.js"))||e.match(new RegExp("https?://bitbucket\\.org/([^/]+)/([^/]+)/downloads/(.*)\\.user\\.js"));if(d&&4==d.length){d.shift();const[e,n,r]=d;t=[e,n].concat(n==r?[]:r).join("/");const i=[e,n].join("/");return{id:t,token:"bb",updates:!0,url:"https://bitbucket.org/"+i,issue_url:"https://bitbucket.org/"+i+"/issues"}}
const u=e.match(new RegExp("https?://userstyles\\.org/styles/userjs/([^/]+)/.*\\.user\\.js"));if(u&&2==u.length)return u.shift(),{id:u[0],token:"usty",updates:!0,url:"https://userstyles.org/styles/"+u[0],issue_url:"https://forum.userstyles.org/post/discussion?Discussion/StyleID="+u[0],convert:async e=>{let t,n,r,i;const s=[{tag:"includes",re:/(?: \|\| \(new RegExp\("\^)([^$]+)(?:\$"\)\)\.test\(document\.location\.href\))/g,idx:1,value:e=>"/^"+e.replace(/\\\\(.)/g,"\\$1")+"$/"},{tag:"includes",
re:/(?: \|\| \(document\.location\.href\.indexOf\(")([^\"]+)"(?:\) == 0\))/g,idx:1,value:e=>e+"*"},{tag:"matches",re:/(?: \|\| \(document\.domain == ")([^\"]+)"(?: \|\| document\.domain\.substring\(document\.domain\.indexOf\("[^\"]+"\) \+ 1\) == "[^\"]+"\))/g,idx:1,value:e=>"*."+e}],o=new RegExp("(?:if \\(false)("+s.map(e=>"(?:"+e.re.source+")").join("|")+")+","g")
;return e.textContent&&0===e.includes.length&&0===e.matches.length&&0===e.excludes.length&&e.options&&e.options.override&&e.options.override.orig_includes&&0===e.options.override.orig_includes.length&&e.options.override.orig_matches&&0===e.options.override.orig_matches.length&&(n=e.textContent.match(o))&&(n.forEach(t=>{s.forEach(n=>{for(;r=n.re.exec(t);)if(r.length>n.idx){const t=n.value(r[n.idx]);e.options.override["orig_"+n.tag].push(t),e[n.tag].push(t),i=!0}})}),i&&(t="includes added")),{
script:e,info:t}}};const p=e.match(new RegExp("https://static\\.iitc\\.me/build/release/(plugins/)?(.*)\\.user\\.js"));if(p&&3===p.length){p.shift();const[e,n]=p,r="iitc-project/ingress-intel-total-conversion";return t=[r].concat(e?[e,n]:[]).join("/").replace(/\/\//g,"/"),{id:t,token:"gh",updates:!0,url:"https://github.com/"+r,issue_url:"https://github.com/"+r+"/issues"}}const h=e.match(new RegExp("https://iitc\\.app/build/release/(plugins/)?(.*)\\.user\\.js"));if(h&&3===h.length){h.shift()
;const[e,n]=h,r="IITC-CE/ingress-intel-total-conversion";return t=[r].concat(e?[e,n]:[]).join("/").replace(/\/\//g,"/"),{id:t,token:"gh",updates:!0,url:"https://github.com/"+r,issue_url:"https://github.com/"+r+"/issues"}}if(e.match(new RegExp("https?://socialfixer\\.com/socialfixer\\.user\\.js")))return{id:"socialfixer",token:"web",updates:!0,url:"http://socialfixer.com",issue_url:"https://www.facebook.com/groups/SocialFixerUsersSupport/"}
;if(e.match(new RegExp("https?://www\\.fbpurity\\.com/.*\\.user\\.js")))return{id:"fbpurity",token:"web",updates:!0,url:"https://www.fbpurity.com/",issue_url:"https://www.facebook.com/fluffbustingpurity"}}}},,function(e,t,n){"use strict";const r=rea.FEATURES;let i=null,s=r.PINGPONG.RETRIES;const o=(e,t)=>{const n=()=>{null!=i&&window.clearTimeout(i),i=null},r=t=>{t?(n(),e&&(e(t),e=null)):console.log("pp: Warn: got pseudo response!")};i=window.setTimeout(()=>{if(n(),s-- >0)return o(e,t),
void(e=t=null);t&&t()},5e3);const a={method:"ping"};try{rea.extension.sendMessage(a,r)}catch(e){}};var a=o,l=n(0);const c=rea.FEATURES;var A=[];let d=null;const u=(()=>{const e=c.HTML5.LOCALSTORAGE;let t,n;return{cache:function(){const t=document.documentElement,n=location.pathname;if(e&&t&&n)try{const r=JSON.parse(e.getItem("background")||"{}");r[n]={class:t.getAttribute("class")},e.setItem("background",JSON.stringify(r))}catch(e){}},reset:function(){n=!0;const e=document.documentElement
;"string"==typeof t&&e&&e.setAttribute("class",t)},restore:function(){if(n)return;const r=location.pathname;if(e&&r)try{let n;const i=e.getItem("background");if(i&&(n=JSON.parse(i))&&(n=n[r])&&n.class){const e=document.documentElement;if(!e)return;t=e.getAttribute("class")||"",e.setAttribute("class",t+" "+n.class)}}catch(e){}}}})(),p=e=>{const t=()=>{e(),u.restore()};_?document.body?t():window.addEventListener("DOMContentLoaded",t):(m=m||[]).push(()=>{p(e)}),d&&(window.clearTimeout(d),d=null)}
;A=[{name:l.I18N.getMessage("Default"),layout:"default"},{name:l.I18N.getMessage("Default_Light"),layout:"default",theme:"light"},{name:l.I18N.getMessage("Default_Dark"),layout:"default",theme:"dark"},{name:l.I18N.getMessage("Default_Darker"),layout:"default",theme:"darker",footer:'Theme by <a href="https://github.com/narcolepticinsomniac" target="blank">narcolepticinsomniac</a> from the <a href="https://github.com/openstyles/stylus" target="blank">Stylus</a> project.'}];let h=!1;const f={
default:l.I18N.getMessage("Default"),monokai:"Monokai",solarized:"Solarized","mdn-like":"MDN-like",eclipse:"Eclipse",railscasts:"RailsCasts",zenburn:"ZenBurn"},g=()=>(h||(A=A.map(e=>(e.value=e.theme?[e.layout,e.theme].join("#"):e.layout,e)),h=!0),A);var m,_=!1;const b={init:e=>{_=!0,m&&(m.forEach(e=>{e()}),m=null),u.restore(),a(t=>{let n,r,i;var s;t&&(n=t.config)&&(r=n.layout)&&(n.dark&&!r.includes("#")&&(r+="#dark"),(s=(e=>{let t;return g().some(n=>{if(n.value===e)return t=n,!0}),t
})(r)).theme&&"light"!==s.theme?(s.footer&&$(".footer").html(s.footer),i=s.theme):i="default",u.reset(),$(document.documentElement).addClass([rea.FEATURES.RUNTIME.MOBILE?"mobile":"desktop",i].join(" ")),window.setTimeout(u.cache,500)),e.suc&&e.suc()},e.fail)},images:{origin:function(e){return"gst"==e&&(e="gh"),{
unknown:"data:image/png;base64, ",
uso:"data:image/png;base64, ",
gf:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggEBCQHM3fXsAAAAVdJREFUOMudkz2qwkAUhc/goBaGJBgUtBCZyj0ILkpwAW7Bws4yO3AHLiCtEFD8KVREkoiFxZzX5A2KGfN4F04zMN+ce+5c4LMUgDmANYBnrnV+plBSi+FwyHq9TgA2LQpvCiEiABwMBtzv95RSfoNEHy8DYBzHrNVqVEr9BWKcqNFoxF6vx3a7zc1mYyC73a4MogBg7vs+z+czO50OW60Wt9stK5UKp9Mpj8cjq9WqDTBHnjAdxzGQZrPJw+HA31oulzbAWgLoA0CWZVBKIY5jzGYzdLtdE9DlcrFNrY98zobqOA6TJKHW2jg4nU5sNBpFDp6mhVe5rsvVasUwDHm9Xqm15u12o+/7Hy0gD8KatOd5vN/v1FozTVN6nkchxFuI6hsAAIMg4OPxMJCXdtTbR7JJCMEgCJhlGUlyPB4XfumozInrupxMJpRSRtZlKoNYl+m/6/wDuWAjtPfsQuwAAAAASUVORK5CYII=",
gh:"data:image/png;base64, ",
gl:"data:image/png;base64, ",
bb:"data:image/png;base64, ",
ouj:"data:image/x-icon;base64, ",
usty:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PHRpdGxlPjlDMzAwNDI3LTg4Q0QtNDI2RC05QkZELUFEMUU2RUI2RjRDNjwvdGl0bGU+PGRlZnM+PHBhdGggZD0iTTAgNS42MjNBNS42MjMgNS42MjMgMCAwIDEgNS42MjMgMGgxMi43NTRBNS42MjMgNS42MjMgMCAwIDEgMjQgNS42MjN2MTIuNzU0QTUuNjIzIDUuNjIzIDAgMCAxIDE4LjM3NyAyNEg1LjYyM0E1LjYyMyA1LjYyMyAwIDAgMSAwIDE4LjM3N1Y1LjYyM3oiIGlkPSJhIi8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PHVzZSBmaWxsLW9wYWNpdHk9IjAiIGZpbGw9IiNGRkYiIHhsaW5rOmhyZWY9IiNhIi8+PHBhdGggZmlsbD0iIzJFQ0M3MSIgbWFzaz0idXJsKCNiKSIgZD0iTTExLjI1IDB2MTQuNjI1SDBWMHoiLz48cGF0aCBmaWxsPSIjRTc0QzNDIiBtYXNrPSJ1cmwoI2IpIiBkPSJNMjQgMHY3Ljg3NUgxMi43NVYweiIvPjxwYXRoIGZpbGw9IiNGMzlDMTIiIG1hc2s9InVybCgjYikiIGQ9Ik0xMS4yNSAxNi4xMjVWMjRIMHYtNy44NzV6Ii8+PHBhdGggZmlsbD0iIzM0OThEQiIgbWFzaz0idXJsKCNiKSIgZD0iTTI0IDkuNTYzdjE0LjYyNEgxMi43NVY5LjU2M3oiLz48L2c+PC9zdmc+"
}[e]},brand:function(e){return"data:image/svg+xml,"+encodeURI({
tampermonkey:"<?xml version='1.0' encoding='utf-8'?><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><g id='XMLID_273_'><g id='XMLID_78_'><path id='XMLID_83_' class='st0' d='M304.8,0H95.2C42.6,0,0,42.6,0,95.2v209.6C0,357.4,42.6,400,95.2,400h209.6 c52.6,0,95.2-42.6,95.2-95.2V95.2C400,42.6,357.4,0,304.8,0z M106.3,375C61.4,375,25,338.6,25,293.8c0-44.9,36.4-81.3,81.3-81.3 c44.9,0,81.3,36.4,81.3,81.3C187.5,338.6,151.1,375,106.3,375z M293.8,375c-44.9,0-81.3-36.4-81.3-81.3 c0-44.9,36.4-81.3,81.3-81.3c44.9,0,81.3,36.4,81.3,81.3C375,338.6,338.6,375,293.8,375z'/></g><g id='XMLID_67_' class='st2'><path id='XMLID_74_' class='st3' d='M304.8,0H95.2C42.6,0,0,42.6,0,95.2v209.6C0,357.4,42.6,400,95.2,400h209.6 c52.6,0,95.2-42.6,95.2-95.2V95.2C400,42.6,357.4,0,304.8,0z M106.3,375C61.4,375,25,338.6,25,293.8c0-44.9,36.4-81.3,81.3-81.3 c44.9,0,81.3,36.4,81.3,81.3C187.5,338.6,151.1,375,106.3,375z M293.8,375c-44.9,0-81.3-36.4-81.3-81.3 c0-44.9,36.4-81.3,81.3-81.3c44.9,0,81.3,36.4,81.3,81.3C375,338.6,338.6,375,293.8,375z'/></g></g></svg>",
webdav:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'><path d='M537.585 226.56C541.725 215.836 544 204.184 544 192c0-53.019-42.981-96-96-96-19.729 0-38.065 5.954-53.316 16.159C367.042 64.248 315.288 32 256 32c-88.366 0-160 71.634-160 160 0 2.728.07 5.439.204 8.133C40.171 219.845 0 273.227 0 336c0 79.529 64.471 144 144 144h368c70.692 0 128-57.308 128-128 0-61.93-43.983-113.586-102.415-125.44z'/></svg>",
yandex:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 512'><path d='M153.1 315.8L65.7 512H2l96-209.8c-45.1-22.9-75.2-64.4-75.2-141.1C22.7 53.7 90.8 0 171.7 0H254v512h-55.1V315.8h-45.8zm45.8-269.3h-29.4c-44.4 0-87.4 29.4-87.4 114.6 0 82.3 39.4 108.8 87.4 108.8h29.4V46.5z'/></svg>",
firefox:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 496 512'><path d='M496 262.5C497.6 380.8 388.9 504 248 504c-106.7 0-190.9-62.5-229.8-151.7-43-97.7-5.7-251.6 70.3-320.3l-2.7 69.7c3.9-5 32.5-6.4 37.1 0C139 71 190.7 48 232.1 47.2c-15.8 13.3-52.2 61.6-49.2 86.2 20.2 6.4 51.1 6.6 67.4 7.7 5 2.8 4.1 19.6-5.8 33.4 0 0-13 18-48.1 24.3l2.7 41.1-37-7.4c-12.4 31.5 17.4 59.4 48.4 54.2 34.3-5.8 45.9-32 70-30.6 23.8 1.4 33.2 14.6 30.1 27.1 0 0-3.9 14.9-29.6 12.4-21.8 34.5-50.4 53.5-97.3 49.4 71.3 59.1 168.3 5.5 192.6-42.8 24.3-48.1 8-122.1-16.3-142.3 28.7 12.4 43.7 27.6 54.2 55.5 5.5-61.9-22.9-132.1-73.8-173.3C436 70.1 494.3 144.2 496 262.5z'/></svg>",
chrome:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 496 512'><path d='M131.5 217.5L55.1 100.1c47.6-59.2 119-91.8 192-92.1 42.3-.3 85.5 10.5 124.8 33.2 43.4 25.2 76.4 61.4 97.4 103L264 133.4c-58.1-3.4-113.4 29.3-132.5 84.1zm32.9 38.5c0 46.2 37.4 83.6 83.6 83.6s83.6-37.4 83.6-83.6-37.4-83.6-83.6-83.6-83.6 37.3-83.6 83.6zm314.9-89.2L339.6 174c37.9 44.3 38.5 108.2 6.6 157.2L234.1 503.6c46.5 2.5 94.4-7.7 137.8-32.9 107.4-62 150.9-192 107.4-303.9zM133.7 303.6L40.4 120.1C14.9 159.1 0 205.9 0 256c0 124 90.8 226.7 209.5 244.9l63.7-124.8c-57.6 10.8-113.2-20.8-139.5-72.5z'/></svg>",
onedrive:"<svg xmlns='http://www.w3.org/2000/svg' id='Layer_1' data-name='Layer 1' viewBox='0 0 24 24'><title>Artboard 1</title><g id='Templates'><path d='M17,10.57a3,3,0,0,1,1.18.23,3.11,3.11,0,0,1,1,.64,2.82,2.82,0,0,1,.65,1,3,3,0,0,1-1.6,3.95,3.08,3.08,0,0,1-1.16.23H8a4,4,0,0,1-1.56-.31,4,4,0,0,1,0-7.38A4,4,0,0,1,8,8.57a3.54,3.54,0,0,1,.73.07,4.63,4.63,0,0,1,.72-.87,4.72,4.72,0,0,1,.89-.65,4.58,4.58,0,0,1,1-.41,4.79,4.79,0,0,1,1.13-.14,4.37,4.37,0,0,1,1.64.3,4.55,4.55,0,0,1,1.36.84,4.39,4.39,0,0,1,1,1.27A4.66,4.66,0,0,1,17,10.57Z'/></g></svg>",
gdrive:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M339 314.9L175.4 32h161.2l163.6 282.9H339zm-137.5 23.6L120.9 480h310.5L512 338.5H201.5zM154.1 67.4L0 338.5 80.6 480 237 208.8 154.1 67.4z'/></svg>",
dropbox:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 87.2l-151.9 93.9L0 97.5 150.6 0 256 87.2zM0 265.3l150.6 98.3 105.4-88L104.1 181 0 265.3zm256 10.3l105.4 88L512 265.3l-104.1-84.2L256 275.6zM512 97.5L361.4 0 256 87.2l151.9 93.9L512 97.5zM256.3 294.6l-105.7 87.7-45.2-29.5V385l150.9 90.5L407.2 385v-32.2L362 382.3l-105.7-87.7z'/></svg>",
instagram:"<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='5 4 44 44' style='enable-background:new 5 4 44 44;' xml:space='preserve'><style type='text/css'>.st0{fill:none;}</style><g><rect x='-0.2' y='0.1' class='st0' width='53.8' height='53.4'/><path d='M48.1,26.3c0,4.3,0,7.2-0.1,8.8c-0.2,3.9-1.3,6.9-3.5,9s-5.1,3.3-9,3.5c-1.6,0.1-4.6,0.1-8.8,0.1c-4.3,0-7.2,0-8.8-0.1 c-3.9-0.2-6.9-1.3-9-3.5c-2.1-2.1-3.3-5.1-3.5-9c-0.1-1.6-0.1-4.6-0.1-8.8s0-7.2,0.1-8.8c0.2-3.9,1.3-6.9,3.5-9 c2.1-2.1,5.1-3.3,9-3.5c1.6-0.1,4.6-0.1,8.8-0.1c4.3,0,7.2,0,8.8,0.1c3.9,0.2,6.9,1.3,9,3.5s3.3,5.1,3.5,9 C48,19.1,48.1,22,48.1,26.3z M28.8,8.7c-1.3,0-2,0-2.1,0c-0.1,0-0.8,0-2.1,0c-1.3,0-2.3,0-2.9,0c-0.7,0-1.6,0-2.7,0.1 c-1.1,0-2.1,0.1-2.9,0.3c-0.8,0.1-1.5,0.3-2,0.5c-0.9,0.4-1.7,0.9-2.5,1.6c-0.7,0.7-1.2,1.5-1.6,2.5c-0.2,0.5-0.4,1.2-0.5,2 s-0.2,1.7-0.3,2.9c0,1.1-0.1,2-0.1,2.7c0,0.7,0,1.7,0,2.9c0,1.3,0,2,0,2.1s0,0.8,0,2.1c0,1.3,0,2.3,0,2.9c0,0.7,0,1.6,0.1,2.7 c0,1.1,0.1,2.1,0.3,2.9s0.3,1.5,0.5,2c0.4,0.9,0.9,1.7,1.6,2.5c0.7,0.7,1.5,1.2,2.5,1.6c0.5,0.2,1.2,0.4,2,0.5 c0.8,0.1,1.7,0.2,2.9,0.3s2,0.1,2.7,0.1c0.7,0,1.7,0,2.9,0c1.3,0,2,0,2.1,0c0.1,0,0.8,0,2.1,0c1.3,0,2.3,0,2.9,0 c0.7,0,1.6,0,2.7-0.1c1.1,0,2.1-0.1,2.9-0.3c0.8-0.1,1.5-0.3,2-0.5c0.9-0.4,1.7-0.9,2.5-1.6c0.7-0.7,1.2-1.5,1.6-2.5 c0.2-0.5,0.4-1.2,0.5-2c0.1-0.8,0.2-1.7,0.3-2.9c0-1.1,0.1-2,0.1-2.7c0-0.7,0-1.7,0-2.9c0-1.3,0-2,0-2.1s0-0.8,0-2.1 c0-1.3,0-2.3,0-2.9c0-0.7,0-1.6-0.1-2.7c0-1.1-0.1-2.1-0.3-2.9c-0.1-0.8-0.3-1.5-0.5-2c-0.4-0.9-0.9-1.7-1.6-2.5 c-0.7-0.7-1.5-1.2-2.5-1.6c-0.5-0.2-1.2-0.4-2-0.5c-0.8-0.1-1.7-0.2-2.9-0.3c-1.1,0-2-0.1-2.7-0.1C31.1,8.7,30.1,8.7,28.8,8.7z  M34.4,18.5c2.1,2.1,3.2,4.7,3.2,7.8s-1.1,5.6-3.2,7.8c-2.1,2.1-4.7,3.2-7.8,3.2c-3.1,0-5.6-1.1-7.8-3.2c-2.1-2.1-3.2-4.7-3.2-7.8 s1.1-5.6,3.2-7.8c2.1-2.1,4.7-3.2,7.8-3.2C29.7,15.3,32.3,16.3,34.4,18.5z M31.7,31.3c1.4-1.4,2.1-3.1,2.1-5s-0.7-3.7-2.1-5.1 c-1.4-1.4-3.1-2.1-5.1-2.1c-2,0-3.7,0.7-5.1,2.1s-2.1,3.1-2.1,5.1s0.7,3.7,2.1,5c1.4,1.4,3.1,2.1,5.1,2.1 C28.6,33.4,30.3,32.7,31.7,31.3z M39.9,13c0.5,0.5,0.8,1.1,0.8,1.8c0,0.7-0.3,1.3-0.8,1.8c-0.5,0.5-1.1,0.8-1.8,0.8 s-1.3-0.3-1.8-0.8c-0.5-0.5-0.8-1.1-0.8-1.8c0-0.7,0.3-1.3,0.8-1.8c0.5-0.5,1.1-0.8,1.8-0.8S39.4,12.5,39.9,13z'/></g></svg>",
facebook:"<svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 30 30' style='enable-background:new 0 0 30 30;' xml:space='preserve'><style type='text/css'>.f{}.c{fill:none;}</style><g><circle class='c' cx='15' cy='15' r='13' stroke='black' stroke-width='3'/><path class='f' d='M16.4,23.9v-8.1h2.7l0.4-3.2h-3.1v-2c0-0.9,0.3-1.5,1.6-1.5l1.7,0V6.2c-0.3,0-1.3-0.1-2.4-0.1c-2.4,0-4.1,1.5-4.1,4.2v2.3h-2.7v3.2h2.7v8.1H16.4z'/></g></svg>"
}[e]).replace(/%20/g," ")},empty:"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="},render:p,getLayouts:g,getEditorThemes:()=>Object.keys(f).map(e=>({name:f[e]||e,value:e}))};t.a=b},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createQueue=t.createCache=t.sleepEvery=t.sleep=void 0;const i=n(1),s=r(n(18));t.sleep=e=>new s.default(t=>setTimeout(t,e))
;let o=0;t.sleepEvery=(e,t)=>{const n=Date.now();if(o+e<n)return new s.default(e=>window.setTimeout(()=>{o=Date.now(),e()},t||0))},t.createQueue=e=>{const t=[],n=[],r=()=>{let s;if(n.length<e.threads&&t.length&&(s=t.shift())){const e=s.fn();let t;if(void 0!==e.catch){const n=i.Deferred();e.then(n.resolve).catch(n.reject),t=n.promise()}else t=e;n.push(t),t.always(()=>{let e;(e=n.indexOf(t))>-1&&n.splice(e,1),r()}),s.p.consume(t)}};return{add:function(e){const n=i.Deferred();return t.push({fn:e,
p:n}),r(),n.promise()}}},t.createCache=e=>{let t={};const n=(null==e?void 0:e.retimeout_on_get)||!1,r=(null==e?void 0:e.timeout)||300,i=(null==e?void 0:e.check_interval)||120;let s;const o=()=>{s&&clearInterval(s),s=null},a=e=>{delete t[e]},l=()=>{const e=Date.now()-1e3*r;Object.entries(t).forEach(([t,n])=>{n.ts<e&&setTimeout(()=>a(t),1)})},c={init:()=>(s||(o(),s=setInterval(l,1e3*i)),c),set:(e,n)=>{t[e]={value:n,ts:Date.now()}},get:(e,r)=>{let i=r;return t[e]&&(n&&(t[e].ts=Date.now()),
i=t[e].value),i},remove:a,removeAll:()=>{t={}}};return c}},function(e,t,n){"use strict";n.r(t);var r=n(3),i=n(10),s=n(2),o=n(6),a=n.n(o);let l
;const c=e=>["https:","http:","data:","blob"].some(t=>e.startsWith(t)),A=["internal","user-agent","accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],d={"cache-control":"no-cache",pragma:"no-cache"},u={"cache-control":"max-age=0, must-revalidate"},p=e=>{if(e){const t={}
;return Object.keys(e).forEach(n=>{let r=n,i=e[n];if(l.prefix)s=n.toLowerCase(),(A.includes(s)||0===s.indexOf("proxy-")||0===s.indexOf("sec-"))&&(r=l.prefix+n,i=null===i?"":a.a.encodeS(i));else if(null===i)return;var s;t[r]=i}),t}},h=e=>({responseXML:"",responseText:"",response:null,readyState:4,responseHeaders:"",status:0,statusText:"",error:e=e||"Forbidden"}),f=e=>{if("Blob"===e.type)return new Blob([a.a.str2abSync(e.value)])
;if("File"===e.type)return new File([a.a.str2abSync(e.value)],e.name,{type:e.meta,lastModified:e.lastModified||Date.now()});if("FormData"==e.type){const t=new FormData;return Object.keys(e.value).forEach(n=>{const r="Array"===e.value[n].type,i=f(e.value[n]),s=r?i:[i];s.forEach((e,r)=>{t.append(n,s[r])})}),t}if("Array"===e.type||"Object"===e.type){let t,n,r;"Object"===e?(r=Object.keys(e.value),n=e=>e<r.length?r[e]:null,t={}):(n=t=>t<e.value.length?t:null,t=[])
;for(let r,i=0;null!==(r=n(i));i++)t[r]=f(e.value[r]);return t}return e.value},g=e=>{const t={};return e&&e.split("\n").forEach(e=>{const n=e.match(/^([^:]+): ?(.*)/);if(n){const e=n[1].toLowerCase();t[e]=(void 0!==t[e]?", ":"")+(n[2]||"").replace(/,/g,"%2C")}}),t},m="tm-finalurl"+rea.runtime.short_id.toLowerCase(),_="tm-setcookie"+rea.runtime.short_id.toLowerCase();var b=(e,t,n,i,o)=>{const l=e.responseType?e.responseType.toLowerCase():"",c=e=>{const t=[];let n,r
;return e.headers&&(n=e.headers.get(m)||e.url,e.headers.forEach((e,n)=>{const r=n.toLowerCase();[m,_].includes(r)||t.push(r+":"+e)}),(r=e.headers.get(_))&&t.push("set-cookie:"+r)),{readyState:4,responseHeaders:t.join("\n"),finalUrl:n,status:e.status,statusText:e.statusText}};let A=!1;let d,v,w;const k=e=>{e&&(w=!0),R?R.abort():w?y():y({name:"AbortError",message:"Aborted by user"})},y=e=>{let t;v||(w?(t=c({status:408,statusText:"Request Timeout"}),
i("ontimeout")):"AbortError"==e.name?(t=h("aborted"),i("onabort")):(t=c({status:408,statusText:e.message||"Request Timeout"}),i("onerror",t)),v=!0,i("ondone",t))};try{const h={};let m;h.method=e.method||"GET",h.redirect="follow",e.headers&&(m=p(e.headers)),e.nocache?h.cache="reload":e.revalidate&&(h.cache="default",m=m||{},m={...m,...u}),e.anonymous?h.credentials="omit":h.credentials="include",e.user&&e.password&&(m=m||{},m.Authorization="Basic "+btoa(e.user+":"+e.password)),
m&&(h.headers=new window.Headers(m)),void 0!==e.data&&("typified"===e.data_type?h.body=f(e.data):"string"==typeof e.data?h.body=e.data:h.body=JSON.stringify(e.data));var R=window.AbortController?new window.AbortController:null;R&&(h.signal=R.signal),window.fetch(e.url,h).then(u=>{if(d&&(window.clearTimeout(d),d=null),v)return;let p=c(u);if((0!==p.status||p.status<200||p.status>=300)&&e.retries>0)return e.retries--,void b(e,t,n,i,o);(async()=>{if(u.ok)if(e.partialSize){let t
;["arraybuffer","blob"].includes(l)||void 0!==e.overrideMimeType?(p.response=await u.blob(),t=!1):(p.response=await u.text(),t=!0),p=await(async(t,i)=>{if(e.partialSize){const s=t.response;["response","responseText","responseXML"].forEach(e=>{delete t[e]}),!A&&s&&(A=!0,await(async(t,i)=>{if(!i){if(rea.FEATURES.RUNTIME.SHARED_OBJECT_URLS&&!n.foreign_context){const e={url:URL.createObjectURL(t),type:t.type};return o("onpartial",{objurl:e}),void window.setTimeout(()=>URL.revokeObjectURL(e.url),3e5)
}t=await a.a.blob2str(t)}const s=Object(r.splitSlice)(t,parseInt(e.partialSize));s.forEach((e,t)=>{o("onpartial",{partial:e,index:t,length:s.length})})})(s,i))}return t})(p,t)}else if(void 0!==e.responseType){let e;if("arraybuffer"==l)p.response=await u.arrayBuffer();else if("blob"==l)p.response=await u.blob();else if("document"==l){e=(g(p.responseHeaders)["content-type"]||"text/xml").split(";")[0];const t=new window.DOMParser;p.response=t.parseFromString(await u.text(),e)}else if("json"==l){
const e=await u.text();p.response=JSON.parse(e)}else s.logger.warn("xhr: responseType",l," is not implemented!"),p.response=await u.text()}else if(void 0!==e.overrideMimeType&&window.TextDecoder){const t=await u.arrayBuffer(),n=e.overrideMimeType.toLowerCase().match(/charset=([^;]+)/)[1];p.response=new window.TextDecoder(n).decode(t)}else{const e=await u.text();p.response=e}else p.responseXML=null,p.responseText="",p.response=null})().then(()=>{i("onload",p),i("ondone",p)})}).catch(y),
void 0!==e.timeout&&(d=setTimeout(()=>{d=null,k(!0)},e.timeout))}catch(e){s.logger.error(e.stack);const t=h(e.message);i("onerror",t),i("ondone",t)}return{abort:()=>k()}},v=(e,t,n,o,A)=>{const _=e.responseType?e.responseType.toLowerCase():"";let b,w,k;e.anonymous&&(b=l.mozAnon?{mozAnon:!0}:{anonymous:!0});const y=new XMLHttpRequest(b),R=t=>{let n="",r=e.url;if(y.readyState>=2){let e;n=y.getAllResponseHeaders(),n&&(n=n.replace(/tm-finalurl[0-9a-zA-Z]*\: .*[\r\n]{1,2}/i,""),
n=n.replace(/tm-setcookie[0-9a-zA-Z]*\:/i,"set-cookie:")),(e=y.getResponseHeader(m)||y.responseURL)&&(r=e)}const i={readyState:y.readyState,responseHeaders:n,finalUrl:r,status:y.readyState>=2?y.status:0,statusText:y.readyState>=2?y.statusText:""};return t&&4==y.readyState?y.responseType?(i.responseXML=null,i.responseText=null,i.responseType=y.responseType,i.response=y.response):(i.responseXML=y.responseXML,i.responseText=y.responseText,i.response=y.response):(i.responseXML=null,
i.responseText="",i.response=null),i};let x=!1;const C=async t=>{if(e.partialSize){const i=t.response,s=!["arraybuffer","blob"].includes(_);["response","responseText","responseXML"].forEach(e=>{delete t[e]}),!x&&i&&(x=!0,await(async(t,i)=>{if(!i){if(rea.FEATURES.RUNTIME.SHARED_OBJECT_URLS&&!n.foreign_context){const e={url:URL.createObjectURL(t),type:t.type};return A("onpartial",{objurl:e}),void window.setTimeout(()=>URL.revokeObjectURL(e.url),3e5)}t=await a.a.blob2str(t)}
const s=Object(r.splitSlice)(t,parseInt(e.partialSize));s.forEach((e,t)=>{A("onpartial",{partial:e,index:t,length:s.length})})})(i,s))}return t},E=Object(i.createQueue)({threads:1}),I=e=>(...t)=>E.add(async()=>e(...t)),M={onload:I(async()=>{let r=R(!0);if((0!==r.status||r.status<200||r.status>=300)&&e.retries>0)return e.retries--,void v(e,t,n,o,A);e.partialSize&&(r=await C(r)),await o("onload",r),4==r.readyState&&await o("ondone",r)}),onerror:I(async()=>{const r=R()
;if(4==r.readyState&&200!=r.status&&0!=r.status&&e.retries>0)return e.retries--,void v(e,t,n,o,A);await o("onerror",r),await o("ondone",r)}),onloadstart:I(async()=>{await A("onloadstart",()=>R())}),onreadystatechange:I(async()=>{await A("onreadystatechange",async()=>{let e=R();return e=await C(e),e})}),onprogress:I(async e=>{await A("onprogress",async()=>{let t=R();return t=await C(t),Z(e,t,t)})}),ontimeout:I(async()=>{const e=R();await o("ontimeout"),await o("ondone",e)}),onabort:I(async()=>{
const e=h("aborted");await o("onabort"),await o("ondone",e)})},G=0==Object.keys(M).concat(["ondone"]).filter(e=>!!t[e]).length;if(G)throw new Error("Synchronous XHR is not supported anymore");var Z=(e,t,n)=>{void 0===n&&(n={});try{let r=null,i=null;if(e.lengthComputable||e.total>0)r=e.loaded,i=e.total;else{const n=!y.responseType||["","text"].includes(y.responseType)?y.responseText:null;let s=Number(g(t.responseHeaders)["content-length"]||"");const o=t.readyState>2&&n?n.length:0;0==s&&(s=-1),
r=e.loaded||o,i=e.total||s}n.lengthComputable=e.lengthComputable,n.loaded=r,n.done=r,n.position=r,n.total=i,n.totalSize=i}catch(e){}return n};Object.keys(M).forEach(e=>{(t[e]||["ontimeout","onload","onerror","onabort"].includes(e))&&(y[e]=M[e])});try{if(!n.internal&&!c(e.url))throw new Error("Invalid scheme of url: "+e.url);y.open(e.method||"GET",e.url,!G,e.user,e.password);let r=p(e.headers);(e.nocache||e.revalidate)&&(r=r||{},e.nocache?r={...r,...d}:e.revalidate&&(r={...r,...u})),
r&&Object.keys(r).forEach(e=>{try{y.setRequestHeader(e,r[e])}catch(t){s.logger.warn("xhr: rejected header",e,r[e])}}),void 0!==e.overrideMimeType&&y.overrideMimeType(e.overrideMimeType),e.partialSize?["arraybuffer","blob"].includes(_)?y.responseType=e.responseType="blob":delete e.responseType:void 0!==e.responseType&&(w=e.responseType.toLowerCase(),["document","json"].includes(w)||(y.responseType=w)),void 0!==e.timeout&&(y.timeout=e.timeout),
void 0!==e.data?("typified"===e.data_type?y.send(f(e.data)):"string"==typeof e.data?y.send(e.data):y.send(JSON.stringify(e.data)),t.onprogress&&y.upload&&(y.upload.onprogress=M.onprogress)):y.send()}catch(e){s.logger.error(e.stack);const t=h(e.message);o("onerror",t),o("ondone",t)}return k=k||{},Object(r.copy)({abort:function(){y.abort()}},k)};const w={run:(e,t,n)=>{const r={...t||{}},i=async(e,t)=>{r[e]&&await r[e]("function"==typeof t?await t():t)},o=async(e,t)=>{r[e]&&(await i(e,t),r[e]=null)
};if(!(n=n||{}).internal&&!c(e.url)){s.logger.warn("xhr: invalid scheme of url:",e.url);const t=h("Invalid scheme");return o("onerror",t),void o("ondone",t)}const a=window.fetch&&e.url&&"http"==e.url.substr(0,4),A=!l.mozAnon&&e.anonymous,d=e.fetch;return a&&(A||d)?b(e,r,n,o,i):v(e,r,n,o,i)},setConfig:function(e){l=e},getConfig:function(){return l},makeErrorResponse:h,parseCookie:e=>{
const t=e.split(";").filter(e=>"string"==typeof e&&!!e.trim()),n=t.shift().split("="),r=n.shift(),i=n.join("="),s={name:r,value:decodeURIComponent(i)};return t.forEach((function(e){var t=e.split("="),n=t.shift().trimLeft().toLowerCase(),r=t.join("=");if("expires"===n){const e=new Date(decodeURIComponent(r));isNaN(e.getTime())||(s.expires=e)}else"max-age"===n?s.maxAge=parseInt(r,10):"secure"===n?s.secure=!0:"httponly"===n?s.httpOnly=!0:"samesite"===n?s.sameSite=r:s[n]=r})),s},parseHeaders:g}
;t.default=w},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(4)),s=(n(2),"mtm_visitor"),o="default",a="pageview",l="script_update",c="script",A="cloud",d="event",u="pageview",p="ping",h="https://a.tampermonkey.net/matomo.php",f=window.rea,g=f.FEATURES.HTML5.LOCALSTORAGE;let m,_,b,v=!1,w=!1;const k=()=>({url:h,siteId:5,tracker:{[o]:{enabled:T(5,10)},[c]:{enabled:!0},[l]:{
enabled:T(5,10)},[A]:{enabled:T(5,.001)}}}),y=()=>({url:h,siteId:6,tracker:{[o]:{enabled:T(6,50)},[c]:{enabled:!0},[l]:{enabled:T(6,10)},[A]:{enabled:T(6,.01)}}}),R={default:k,gcal:k,iikm:()=>({url:h,siteId:4,tracker:{[o]:{enabled:T(4,1)},[c]:{enabled:!0},[l]:{enabled:T(4,10)},[A]:{enabled:T(4,5e-4)}}}),saap:()=>({url:h,siteId:7,tracker:{[o]:{enabled:!0},[c]:{enabled:!0},[l]:{enabled:T(7,10)},[A]:{enabled:T(7,.01)}}}),fire:y,firb:y,dhdg:()=>({url:h,siteId:3,tracker:{[o]:{enabled:T(3,1)},[c]:{
enabled:!0},[l]:{enabled:T(3,10)},[A]:{enabled:T(3,5e-4)}}}),mfdh:k,heif:()=>({url:"http://a.userscript.grobilan:8081/matomo.php",siteId:2,tracker:{[o]:{enabled:!0}}})};let x;const C=[{msg:"a disconnected port"},{msg:"Function.prototype.apply: Arguments list has wrong type",url:"event_bindings"},{msg:"Script error."}],E=e=>[...Array(e)].map(()=>Math.floor(16*Math.random()).toString(16)).join(""),I=e=>{if(!g)return;const t=[e.uuid,e.createTs,e.visitCount,e.currentVisitTs,e.lastVisitTs].join(".")
;g.setItem(s,t)},M=e=>{const t=e||o,n=x.tracker[t]||x.tracker.default;return n.enabled?{url:x.url,siteId:x.siteId,options:n}:null},G=E(6),Z=async(e,t,n)=>{if(!e)return;const r=(()=>{if(!g)return;const e=g.getItem(s);if(!e)return;const t=e.split(".");if(t.length>=5){t.unshift("0");const[e,n,r,i,s,o]=t;return{createdNow:!1,newVisitor:e,uuid:n,createTs:r,visitCount:i,currentVisitTs:s,lastVisitTs:o}}})()||(()=>{const e=Math.floor(Date.now()/1e3).toString(),t={createdNow:!0,newVisitor:"1",uuid:E(16),
createTs:e,visitCount:"0",currentVisitTs:e,lastVisitTs:""};return I(t),t})();let o;const a=new Date,l={idsite:e.siteId,rec:1,action_name:document.title||f.runtime.short_id,url:location.href,_id:r.uuid,rand:E(4),apiv:1,h:a.getHours(),m:a.getMinutes(),s:a.getSeconds(),cookie:1,pv_id:G},c={...l,_idts:Number(r.createTs),_idvc:Number(r.visitCount),_viewts:Number(r.lastVisitTs),res:`${screen.width}x${screen.height}`};if(t==u){const e=_?{gt_ms:_}:{},t={...l,...c,...e,new_visit:1};I((e=>{
const t=Math.floor(Date.now()/1e3).toString();return e.newVisitor="0",e.visitCount=(Number(e.visitCount)+1).toString(),e.lastVisitTs=e.currentVisitTs,e.currentVisitTs=t,e})(r)),o=t}else if(t==d){if(!n)return;o={...l,ca:1,e_c:n.category,e_a:n.action,e_n:n.name,e_v:n.value}}else{if(t!=p)return;o={...l,...c,ping:1}}o=Object.assign(l,o);const A=`${e.url}?${i.default.hash2params(o)}`,h=document.createElement("img");h.src=A,h.onload=()=>{var e;null===(e=h.parentNode)||void 0===e||e.removeChild(h)},
h.onerror=()=>{var e;null===(e=h.parentNode)||void 0===e||e.removeChild(h)},(document.body||document.head||document.documentElement).appendChild(h)},T=(e,t)=>{let n=100*Math.random()<t;if(g)try{let r,i;const s=["wsr",e,t].join("_"),o=Date.now(),a=864e7;if(r=g.getItem(s)){try{i=JSON.parse(r)}catch(e){}(!i||i.ts+a<o)&&(i={ts:o,w:n})}else i={ts:o,w:n};n=i.w,g.setItem(s,JSON.stringify(i))}catch(e){}return n},N=e=>{v&&(w=e,w?m&&S&&(S(),S=void 0):b&&(clearInterval(b),b=void 0))};let S=()=>{Z(M(a),u),
b=window.setInterval(()=>Z(M(a),p),864e5)};const U=(e,t,n)=>{if(!w||!e.search)return;void 0===t&&(t=""),void 0===n&&(t+=" "+window.location.href,n="");let r=!1;C.forEach(n=>{(n.msg||n.url)&&(n.msg&&-1==e.indexOf(n.msg)||n.url&&-1==t.indexOf(n.url)||(r=!0))}),r||Z(M("error"),d,{category:"Error",action:e,name:t+":"+n})},B={init:(e,t,n)=>{const r=((null==n?void 0:n.version)||"")+" ",i=f.runtime.short_id;x=(R[i]||R.default)(),window.onerror=(t,n,i,s,o)=>{let a="";if(o)try{a=o.stack||""}catch(e){}
U(t.toString(),r+e+"@"+f.extension.urls.prepareForReport(n||""),[i+":"+s,a].join(";"))},document.onsecuritypolicyviolation=t=>{let n="";if(t)try{n=t.stack}catch(e){}U("CSP violation of "+t.effectiveDirective,r+e+"@"+f.extension.urls.prepareForReport(t.documentURI),[t.sourceFile," -> ",t.lineNumber+":"+t.columnNumber,n].join(";"))},(null==n?void 0:n.started)&&(_=Date.now()-n.started.getTime()),v=!0,m=!!(null==n?void 0:n.trackView),N(t)},setEnabled:N,isActive:function(e){return w&&!!M(e)},
tC:(e,t,n)=>{if(!w)return;let r="",i="";"init"===t?(i="Initialized",r=e):"error"===t&&(i="Error",r=e+" -> "+n),Z(M(A),d,{category:"Cloud",action:i,name:r})},tS:(e,t,n)=>{if(!w)return;const r=`${e}${n?` <${n}> `:""}`;let i="",s=null;if("i"===t)i="Installed";else if("u"===t)i="Updated",s=M(l);else if("m"===t)i="Revealed";else{if("r"!==t)return;i="Removed"}Z(s||M(c),d,{category:"Script",action:i,name:r})},tE:U,tG:(e,t,n)=>{if(!w)return;let r="",i="";"clicked"===e?(i="Click",
r=t+":"+n):"button"===e?(i="Button",r=t):"dialog"===e&&(i="Dialog"),Z(M("begging"),d,{category:"Begging",action:i,name:r})}};t.default=B},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return g}));var r=n(1),i=n(2),s=n(15),o=n.n(s);let a=0;const l={ePASTEBIN:1,eCHROMESYNC:2,eSYNCFS:3,eGDRIVE:4,eDROPBOX:5,eWEBDAV:6,eYANDEX:7,eONEDRIVE:8};let c=[],A=!1;const d=e=>{const t=Object(r.Deferred)(),n=new FileReader;return n.onloadend=function(){
t.resolve(this.result)},n.onerror=t.reject,n.onabort=t.reject,n.readAsText(e),t.promise()},u=(()=>{const e=e=>{const t=e.type,n=e.id,s=".meta.json",l=".user.js";let A,u=null;const p=e=>{let t;return r.Deferred.Pledge().then(()=>{if(!u)return t=!0,h()}).then(()=>{if(u&&void 0===u[e]&&!t)return h()}).then(()=>u?(u[e]=u[e]||null,u[e]):(i.logger.warn("si: unable to list remote list!"),r.Deferred.Breach()))},h=e=>A.list(e).then(e=>{u={};const t={},n={};let r,s;const o=Date.now();return e.forEach(e=>{
u[e.name]=e;const a=new RegExp(".meta.json$"),l=new RegExp(".user.js$");var c;e.modified>o?i.logger.log("si: ignore future list item",o,e):((r=e.name.match(a))||(s=e.name.match(l)))&&(r?(e.uuid=c=e.name.replace(a,""),e.lastModified=e.modified,t[c]=e):s&&(c=e.name.replace(l,""),n[c]=e))}),Object.keys(t).map(e=>{let r;if(r=t[e])return r.source=n[e],r.options=r.options||{},r}).filter(e=>e)});let f;return{init:function(e){return A=o.a[t]({...e,path:"sync"}),r.Deferred.Pledge().then(()=>{
if(!A.credentials&&!e.basic_auth)return A.list()}).then(()=>(f||(f=A.changes.listen(),f.progress(e=>{((e,t)=>{if(t!=a)return;const n=e.name,r=new RegExp(".meta.json$"),s=new RegExp(".user.js$");i.logger.log("si: cloud file changed",n,e),(n.match(r)||n.match(s))&&c.forEach(e=>{e(n)})})(e,n)})),!0))},list:h,setSource:(e,t)=>{const n=e+l;return p(n).then(e=>{let s;return r.Deferred.Pledge(!1).then(()=>{if(e&&A.compare)return A.compare(e,t)
}).then(o=>o?(i.logger.log("si: remote source data matches, skip upload of",n),r.Deferred.Pledge()):(s=new Blob([t],{type:"text/plain"}),delete u[n],A.put(e||n,s)))})},getSource:(e,t)=>{const n=e+l;return p(n).then(s=>s?r.Deferred.Pledge(!1).then(()=>{if(t&&A.compare)return A.compare(s,t)}).then(e=>e?(i.logger.log("si: remote source data matches, skip download of",n),r.Deferred.Pledge(t)):A.get(s).then(d)):(i.logger.warn("si: list cache does not contain this UUID",e),r.Deferred.Breach()))},
getMeta:e=>p(e+s).then(t=>t?A.get(t).then(d).then(n=>{let r;if((r=(e=>{let t=null;try{t=JSON.parse(e)}catch(e){}return t&&t.uuid?t:(i.logger.log("si: unable to parse extended info of "+void 0),null)})(n))&&(r.uuid=e))return r.lastModified=t.modified||r.lastModified,r.precision=t.precision,r.options=r.options||{},r}):r.Deferred.Breach()),setMeta:(e,t)=>{const n=new Blob([JSON.stringify(e)],{type:"text/plain"}),r=e.uuid+s;return p(r).then(e=>A.put(e||r,n,t))},remove:e=>{const t=e.uuid+s
;e.options.removed=!0;const n=new Blob([JSON.stringify(e)],{type:"text/plain"});return A.put(t,n).then(()=>{const t=e.uuid+l;return p(t).then(e=>{if(e)return delete u[t],A.delete(e)})})},reset:()=>A.list(!0).then(e=>e.filter(e=>{const t=new RegExp(".meta.json$"),n=new RegExp(".user.js$");return e.name.match(t)||e.name.match(n)})).then(e=>{const t=[];return e.forEach(e=>{t.push((()=>{const t=Object(r.Deferred)();return A.delete(e).always(()=>{t.resolve()}),t.promise()})())}),
r.Deferred.when(t).always(()=>{u=null})}),getRemoteUrl:function(e){if(A.getRemoteUrl)return A.getRemoteUrl(e.uuid+l)},getRemoteDomains:function(){if(A.getRemoteDomains)return A.getRemoteDomains()}}},t=e({type:"drive",id:l.eGDRIVE}),n=e({type:"dropbox",id:l.eDROPBOX}),s=e({type:"onedrive",id:l.eONEDRIVE}),A=e({type:"webdav",id:l.eWEBDAV}),u=e({type:"yandex",id:l.eYANDEX}),h=(()=>{let e,t=!1;const n=(t,n)=>{a==l.eCHROMESYNC&&"sync"==n&&r.Deferred.Pledge().then(()=>{const r=new RegExp(e+"$")
;t&&Object.keys(t).forEach(e=>{const s=t[e];if(i.logger.log('si: storage key "%s" in namespace "%s" changed. Old value was "%s", new value is "%s".',e,n,s.oldValue,s.newValue),-1!=e.search(r))for(let t=0;t<c.length;t++)if(h[e]);else{const n=A(s.newValue,e);n&&c[t](e,n)}})})},s=e=>{const t=Object(r.Deferred)();let n=[];return e?o().done(r=>{n=r.filter(t=>t.item&&t.item.uuis==e),t.resolve(n)}).fail(e=>{t.reject(e)}):t.resolve(n),t.promise()};var o=()=>p(()=>{
const t=Object(r.Deferred)(),n=new RegExp(e+"$");return rea.storage.sync.get(null,e=>{const r=[];e&&Object.keys(e).forEach(t=>{-1!=t.search(n)&&r.push({key:t,item:A(e[t],t)})}),t.resolve(r)}),t.promise()}),A=(e,t)=>{let n=null;try{n=JSON.parse(e)}catch(e){}return n&&(n.url||n.options)?n:(i.logger.log("si: unable to parse extended info of "+t),null)};const d=e=>e.then(e=>{const t={};if((e=e.filter(e=>{if(!t[e.key])return t[e.key]=!0,!0})).length>1){const t=Object(r.Deferred)(),n=[],i=e.pop()
;return e.forEach(e=>{n.push(f(e.key))}),r.Deferred.when(n).done(()=>{t.resolve(i)}),t.promise()}return r.Deferred.Pledge(e[0])});let u=null;var h={},f=e=>{const t=Object(r.Deferred)();return rea.storage.sync.remove(e,()=>{const e=rea.runtime.lastError;e?t.reject(e):t.resolve()}),t.promise()},g=()=>{const e=Object(r.Deferred)();return rea.storage.sync.set(h,()=>{const t=rea.runtime.lastError;t?e.reject(t):(h={},e.resolve())}),e.promise()};return{init:function(){let s=!0;if(!t)try{
rea.storage.onChanged.addListener(n),t=!0}catch(e){i.logger.warn("si: error registering sync callback: "+e.message),s=!1}return e="@v2",r.Deferred.Pledge(s)},list:()=>r.Deferred.Pledge().then(()=>o()).then(t=>{const n=new RegExp(e+"$"),i=[];return t.forEach(e=>{const t=e.key,r=e.item,s=t.replace(n,"");let o=null;if(o=h[t]?A(h[t],t):r,!o)return;const a=o.options||{},l=!!a.removed;i.push({id:s,uuid:l?s:o.uuid,lastModified:l?a.removed:o.lastModified,url:o.url,options:a})}),r.Deferred.Pledge(i)}),
setMeta:(t,n)=>{const i=Object(r.Deferred)();return d(s(t.uuid)).done(r=>{let s,o;r?(s=r.key,o=r.item):(s=t.uuid+e,o={}),o.url=t.url,o.options=t.options||{},o.uuid=t.uuid,n.lastModified&&(o.lastModified=n.lastModified),h[s]=JSON.stringify(o),u&&window.clearTimeout(u),u=window.setTimeout(g,3e3),i.resolve()}),i.promise()},remove:t=>{const n=Object(r.Deferred)();return d(s(t.uuid)).done(r=>{let i,s;r?(i=r.key,s=r.item):(i=t.uuid+e,s={}),s.options=s.options||{},s.options.removed=!0,
h[i]=JSON.stringify(s),u&&window.clearTimeout(u),u=window.setTimeout(g,3e3),n.resolve()}),n.promise()},reset:()=>p(()=>{const e=Object(r.Deferred)();return rea.storage.sync.clear(()=>{h={},e.resolve()}),e.promise()})}})(),f={};return rea.storage.sync.supported&&(f[l.eCHROMESYNC]=h),f[l.eGDRIVE]=t,f[l.eDROPBOX]=n,f[l.eONEDRIVE]=s,f[l.eWEBDAV]=A,f[l.eYANDEX]=u,f})();var p=(e,t)=>{const n=Object(r.Deferred)();void 0===t&&(t=3);const s=()=>{if(A)window.setTimeout(s,500);else{A=!0;try{
e().always(()=>{A=!1}).done((function(){n.resolve.apply(this,arguments)})).fail(()=>{--t>0?(i.logger.log("si: some retries left, wait for",6e4,"ms"),window.setTimeout(s,6e4)):(i.logger.warn("si: no retries left, skipping this sync request!"),n.reject("no retries left"))})}catch(e){i.logger.warn(e),A=!1,n.reject(e)}}};return s(),n.promise()};const h={init:(e,t)=>(c=[],a=e,u[a]?u[a].init(t):r.Deferred.Breach()),debug:function(){},addChangeListener:function(e){c.push(e)},getRemoteUrl:function(e){
if(u[a]&&u[a].getRemoteUrl)return u[a].getRemoteUrl(e)},getRemoteDomains:function(){if(u[a]&&u[a].getRemoteDomains)return u[a].getRemoteDomains()},caps:(()=>{const e={};return Object.defineProperties(e,{specialMeta:{get:function(){return u[a]&&!!u[a].getMeta},enumerable:!0},syncsSource:{get:function(){return u[a]&&!!u[a].getSource},enumerable:!0}}),e})(),types:l};["list","setMeta","getMeta","setSource","getSource","reset","remove"].forEach(e=>{h[e]=function(){
return u[a]&&u[a][e]?u[a][e].apply(this,arguments):r.Deferred.Pledge()}});const f=e=>(o.a.init(t=>{let n=Object(r.Deferred)();const i=e.openAndWatch({url:t.url},e=>{e?n&&n.notify(e):n&&(n.resolve("tab closed"),n=null)});return{promise:n.promise(),close:function(){i.cancel()}}}),h),g=l},function(e,t,n){"use strict";n.r(t),n.d(t,"vendor",(function(){return u})),n.d(t,"getRaw",(function(){return h})),n.d(t,"require",(function(){return p})),n.d(t,"get",(function(){return g}));let r=[]
;const i={},s={},o=(e,t,n)=>{var o=()=>{e.every(e=>!!a[e])?n():r.push(o)};(e="string"==typeof e?[e]:e).forEach(e=>{if(void 0===a[e]&&void 0===i[e]){const n=window.setTimeout(()=>{s[e]||(delete i[e],A(e),f(rea.extension.getURL(e+".js"),()=>{t?d(e,null,{}):console.log("registry: finished loading "+e+".js ")}))},0);i[e]=()=>{window.clearTimeout(n),delete i[e]}}}),o()};var a={};const l={},c={},A=e=>{s[e]=!0},d=(e,t,n,o)=>{if(!a[e]||o){let o;l[e]=t,a[e]=n,delete s[e],(o=i[e])&&o(),(()=>{const e=r
;for(r=[];e.length;)e.pop()()})()}},u=(e,t)=>o(e,!0,t),p=(e,t)=>o(e,!1,t),h=(e,t)=>{let n;if(void 0!==(n=c[e]))t&&t(n);else{const r=rea.extension.getURL(e);try{const i=new XMLHttpRequest;if(XMLHttpRequest.onlyasync){if(!t)return void console.warn("registry: async xhr without a callback!");i.open("GET",r),i.onload=()=>{t(i.responseText)},i.onerror=()=>{t()},i.send(null)}else i.open("GET",r,!1),i.send(null),n=i.responseText,n||console.warn("registry: content of "+e+" is null!"),t&&t(n)}catch(e){
console.log("getRawContent "+e)}}return n},f=(e,t)=>{let n=1;const r=()=>{0==--n&&t&&t()};(e="string"==typeof e?[e]:e).forEach(e=>{n++;try{rea.page.addScript(e,t=>{t||console.warn("registry: self.load "+e+" failed! "),r()})}catch(t){console.warn("registry: self.load "+e+" failed! ",t),r()}}),r()},g=(e,...t)=>{let n;const r=a[e];return"function"==typeof r?n=r.apply(void 0,t):r&&(n=r),n}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e
}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(1),s=r(n(4)),o=n(3),a=n(2),l=r(n(6)),c=r(n(12)),A=r(n(11)),d=n(10),u=window.rea,p=window.forge_sha256,h=u.FEATURES,f=A.default;let g,m;const _=d.createQueue({threads:1}),b=(e,t)=>{const n=(e?e.split("/"):[]).concat(t?[t]:[]).join("/");return n?("/"==n.substr(0,1)?"":"/")+n:""},v=e=>{const t={type:e,request:e=>{const t=()=>{const t=i.Deferred(),n=e=>{a.logger.log("rest service: request failed",e),t.reject(e)
},r="xml"===e.responseType,s="headers"===e.responseType;return(r||s)&&delete e.responseType,g(e,{onload:i=>{if([200,201,204,207].includes(i.status)){let n;n=r?e.anonymous||e.fetch?(new window.DOMParser).parseFromString(i.responseText||"","text/xml"):i.responseXML:s?f.parseHeaders(i.responseHeaders):i.response,t.resolve({result:n})}else n(i)},onerror:n,ontimeout:n,onprogress:e=>t.notify(e)},{internal:!0}),t.promise()};return e.no_queue?t():_.add(t)},error:t=>{const n=t;let r
;if(void 0!==n.status){r=n.status.toString();try{r=r+" | "+n.responseText}catch(e){}}else r=t;c.default.tC(e,"error","request: "+r)},wait:e=>(...t)=>e(...t).then(e=>e,e=>(e=>i.Deferred.Breach(e?e.responseText||e.statusText:void 0))(e)),changes:(()=>{let e;return{listen:()=>(e||(e=i.Deferred(),t.watch&&t.watch.start()),e.promise()),notify:t=>{e.notify(t)}}})()};return t},w=e=>{const t=Object.assign({},e),n=t.type;if(void 0===n)throw new Error("Internal error");let r,a=[];const l=Object.assign(e,{
...t,config:{...t.config,auth_prefix:"Bearer",storage_key:""},credentials:{},request:e=>(e.no_auth||(e.headers=e.headers||{},e.headers.Authorization=l.config.auth_prefix+" "+l.credentials.access_token),t.request(e)),oauth:(()=>{let e;const t={run:()=>{if(r)return r;let s=i.Deferred();const a=r=s.promise();e="!!"+n+"-"+o.createUUID();let A=l.credentials?l.credentials.refresh_token:null;const d=(e,t)=>{l.credentials=t,null==s||s.resolve(),s=void 0,e&&e.close()};return(()=>{
if(!l.config.refresh_supported||!A)return i.Deferred.Pledge();const e=i.Deferred(),r=()=>{A=null,delete l.credentials.refresh_token};return g({url:t.getRefreshUrl(A),fetch:!h.RUNTIME.SAFARI},{onload:e=>{if(!e.finalUrl)return c.default.tC(n,"error","auth refresh token: !finalUrl"),void r();const i=t.onUrl(e.finalUrl);i&&(i.error||!i.access_token?(c.default.tC(n,"error","auth refresh token: "+(i.error||"!access_token")),r()):d(null,i))},onerror:r,ondone:()=>e.resolve()}),e.promise()})().then(()=>{
if(!s)return;if(!l.config.refresh_supported)return i.Deferred.Pledge();const e=i.Deferred(),r=m({url:t.getRefreshUrl()});return r.promise.progress(e=>{let i;s&&(i=t.onUrl(e.url))&&(i.error||!i.access_token?(c.default.tC(n,"error","auth refresh: "+(i.error||"!access_token")),l.config.refresh_supported=!1):d(r,i))}).always(e.resolve),e.promise()}).then(()=>{if(!s)return;const e=i.Deferred(),r=m({url:t.getAuthUrl()});return r.promise.progress(e=>{let i
;s&&(i=t.onUrl(e.url))&&(i.error||!i.access_token?c.default.tC(n,"error","auth: "+(i.error||"!access_token")):d(r,i))}).always(e.resolve),e.promise()}).done(()=>{r=void 0,s&&s.reject("auth_failed")}),a},getAuthUrl:()=>l.config.request_uri+"?"+s.default.hash2params({response_type:l.config.response_type,client_id:l.config.client_id,redirect_uri:l.config.redirect_uri,state:e,scope:l.config.scope}),getRefreshUrl:t=>{const n={client_id:l.config.client_id,redirect_uri:l.config.redirect_uri,state:e,
scope:l.config.scope,refresh_token:t};return l.config.redirect_uri+"?"+s.default.hash2params(n)},onUrl:t=>{let n,r;if(t&&0===t.indexOf(l.config.redirect_uri)&&(r=s.default.parse(t))&&(n=s.default.params2hash(r))&&(n.access_token||n.error)&&n.state===e)return{uid:n.uid,access_token:n.access_token,refresh_token:n.refresh_token,error:n.error}}};return t})(),wait:e=>t.wait((...t)=>{if(l.credentials.access_token)return e(...t);{const n=i.Deferred();return a.push(()=>n.consume(e(...t))),
l.oauth.run().done(()=>{a.forEach(e=>e()),a=[]}).fail(e=>{n.reject(e)}),n.promise()}})}),A=h.HTML5.LOCALSTORAGE;let d;return Object.defineProperty(l,"credentials",{get:()=>{if(void 0===d){if(c.default.tC(n,"init"),A)try{const e=JSON.parse(A.getItem(l.config.storage_key)||"");d={uid:e.uid,access_token:e.access_token,refresh_token:e.refresh_token}}catch(e){}d=d||{}}return d},set:e=>{if(A)try{A.setItem(l.config.storage_key,JSON.stringify({uid:e.uid,access_token:e.access_token,
refresh_token:e.refresh_token}))}catch(e){}d=e},enumerable:!1}),l},k=e=>{let t,n,r,l,c,A,u,p,h,f=null,g=null;const m=Object.assign({},e),_=e=>{var t;let n;return e&&(n=(null===(t=e.firstChild)||void 0===t?void 0:t.nextSibling)?e.firstChild.nextSibling:e.firstChild),n},v=e=>m.wait((...t)=>x.init().then(()=>e(...t))),w=(e,t)=>{let n,r;if((n=e.getElementsByTagNameNS("*",t)[0])&&(r=n.firstChild))return r.nodeValue||void 0},k=e=>{const i=[],s=e.getElementsByTagNameNS("*","response")
;for(let e=0;e<s.length;e++){const a=s[e];let l=w(a,"href");if(null==l)continue;l=l.replace(/\/$/,"");const c=a.getElementsByTagNameNS("*","propstat")[0].getElementsByTagNameNS("*","prop")[0],A=w(c,"getlastmodified"),d=w(c,"getetag"),u=parseInt(w(c,"getcontentlength")||""),p=c.getElementsByTagNameNS("*","resourcetype")[0].getElementsByTagNameNS("*","collection")[0],h=l.replace(new RegExp("^("+[o.escapeForRegExpURL(n+t)+"/?",o.escapeForRegExpURL(r+t)+"/?"].join("|")+")"),"");if(p);else{const e={
etag:d,name:h,modifiedTime:new Date(A||0).getTime(),size:u>=0?u:void 0,removed:-1==u};i.push(e)}}return i},y=e=>w(e,"td:cursor"),R=(e,t)=>{const n=t||{};return n.set_current_list&&(c={}),x.request({method:"PROPFIND",url:e,headers:{"Content-Type":"text/xml; charset=UTF-8",Depth:void 0!==n.depth?n.depth:1},responseType:"xml"}).then(e=>{const t=e.result;let r;if(null===t||!(r=_(t))||!r.childNodes)return i.Deferred.Breach();const s=k(r);if(n.set_current_list){const e=y(r);e&&(A=e),s.forEach(e=>{
c[e.name]=e})}return s})},x=Object.assign(e,{...e,config:{...e.config,watch_interval:36e5,root:void 0,path:void 0},request:e=>(e.headers=e.headers||{},e.headers["User-Agent"]="Tampermonkey",e.headers.Cookie="",m.request(e).then(e=>e,t=>{const n=t;return!n||[403,500].includes(n.status)?(e.backoff=2*(e.backoff||1e3),d.sleep(e.backoff).then(()=>x.request(e))):404==n.status?i.Deferred.Pledge(n):(x.error(n),i.Deferred.Breach(n))})),init:()=>{if(l)return l;t=b(x.config.root,x.config.path),
n=x.config.url||"","/"==n.slice(-1)&&(n=n.slice(0,-1)),r=s.default.parse(n).pathname,"/"==r.slice(-1)&&(r=r.slice(0,-1));const e=i.Deferred();l=e.promise();const o=n+t;return x.request({method:"OPTIONS",url:n,responseType:"headers"}).done(e=>{const t=e.result;let n;t&&(n=t["access-control-allow-methods"])&&n.includes("EDITOR")&&(h=!0)}).always(()=>{R(o,{depth:0}).done(()=>e.resolve()).fail(()=>{const r=[];i.Deferred.onebyone(t.split("/").filter(e=>e).map(e=>{r.push(e);const t=r.join("/")
;return()=>x.request({method:"MKCOL",url:n+"/"+t,headers:{"Content-Type":"text/xml; charset=UTF-8"},responseType:"xml"})})).done(()=>e.resolve()).fail(e.reject)})}),l},list:v(e=>R(n+t,{set_current_list:!0}).then(t=>{const n={};return t.map(t=>{if(!e){if(n[t.name])return;n[t.name]=!0}return{name:t.name,size:t.size||0,etag:t.etag,modified:t.modifiedTime,precision:1e3,removed:t.removed}}).filter(e=>e)})),get:v(e=>{const r=e.name||e;return x.request({method:"GET",url:n+b(t,r),headers:{
"Content-Type":"text/xml; charset=UTF-8"},responseType:"arraybuffer"}).then(e=>{const t=e.result;return new Blob([t])})}),put:v((e,r,i)=>{const s=e.name||e;let o,l,c;const A={"Content-Type":"application/octet-stream"},d=null===g;return i&&i.lastModified&&(o=i.lastModified,c=new Date(i.lastModified).toISOString(),l=i.lastModified/1e3,(g||d)&&(A["X-OC-Mtime"]=l)),x.request({method:"PUT",url:n+b(t,s),headers:A,data_type:"typified",data:{type:"raw",value:r},responseType:"headers"}).then(e=>{
const r=e.result;if(r&&d){let e;g=!("accepted"!=r["x-oc-mtime"]&&(!r.date||!(e=new Date(r.date).getTime())||e!=o&&e!=Math.floor(l)))}if(!g&&!f&&c)return x.request({method:"PROPPATCH",url:n+b(t,s),headers:{"Content-Type":"text/xml; charset=UTF-8"},responseType:"xml",
data:[`<?xml version="1.0"?>\n                            <d:propertyupdate xmlns:d="DAV:">\n                                <d:set>\n                                    <d:prop>\n                                        <d:getlastmodified>${c}</d:getlastmodified>\n                                    </d:prop>\n                                </d:set>\n                            </d:propertyupdate>`].join("")}).then(e=>{var t;const n=e.result;let r,i,s
;n&&(r=n.childNodes[0])&&(i=r.getElementsByTagNameNS("*","status")[0])&&(s=null===(t=i.firstChild)||void 0===t?void 0:t.nodeValue)&&-1!=s.search(/HTTP\/[0-9\.]+ 403/)&&(a.logger.warn("WebDAV: no way to set file modification date! This might cause redundant up and downloads."),f=!0)},()=>{a.logger.warn("WebDAV: no way to set file modification date! This might cause redundant up and downloads."),f=!0})})}),delete:v(e=>{const r=e.name||e;return x.request({method:"DELETE",url:n+b(t,r),headers:{
"Content-Type":"text/xml; charset=UTF-8"}})}),watch:{start:()=>{if(u)return;u=!0;let e=null;const r=()=>{if(p=void 0,u)if(!1===e){const e=c;R(n+t,{set_current_list:!0}).then(()=>{e&&(Object.keys(e).forEach(t=>{const n=c[t],r=e[t];n?r.modifiedTime!=n.modifiedTime&&m.changes.notify({time:n.modifiedTime,name:n.name}):m.changes.notify({time:Date.now(),name:r.name,removed:!0})}),Object.keys(c).forEach(t=>{if(!e[t]){const e=c[t];m.changes.notify({time:e.modifiedTime,name:e.name})}}))}).fail(e=>{
a.logger.warn("WebDAV: file changes check failed",e)}).always(()=>{p=window.setTimeout(r,x.config.watch_interval)})}else{let s=100;((e,t)=>{const n={"Content-Type":"text/xml; charset=UTF-8",Depth:1,Timeout:90};return t&&(n.Cursor=t),x.request({method:"SUBSCRIBE",url:e,headers:n,responseType:"xml",no_queue:!0}).then(e=>{const t=e.result;let n;return null===t?i.Deferred.Pledge({changes:[],cursor:A}):(n=_(t))&&n.childNodes?{changes:k(n),cursor:y(n)}:i.Deferred.Breach()})})(n+t,A).then(e=>{
const t=e.changes;A=e.cursor,s=1,t.forEach(e=>{m.changes.notify({time:e.modifiedTime,name:e.name,removed:e.removed})})},()=>{if(null!==e)return s*=2,d.sleep(s);e=!1}).always(r)}};v(()=>u?(r(),i.Deferred.Pledge()):i.Deferred.Breach())()},stop:()=>{u=!1,p&&(window.clearTimeout(p),p=void 0)}},getRemoteUrl:e=>{if(h)return n+b(t,e)+"?method=editor#bypass=true"},getRemoteDomains:()=>[s.default.parse(n).origin.replace(/^.*:\/\//,"")]});return x},y={init:e=>{m=e,g=f.run},drive:()=>{let e,t
;(e=h.HTML5.LOCALSTORAGE)&&(t=parseInt(e.getItem("dropbox_poll_interval")||""))||(t=18e5);const n=w(v("drive")),r=Object.assign({},n),c="appDataFolder";let A,u;const p=Object.assign(n,{...n,config:{...n.config,redirect_uri:"https://auth.tampermonkey.net/oauth.php",refresh_supported:!0,request_uri:"https://accounts.google.com/o/oauth2/v2/auth",client_id:"408438522028-3cgn3t3jas3fak7isbnfod1q4h15g2fv.apps.googleusercontent.com",storage_key:"gd_config",
scope:"https://www.googleapis.com/auth/drive.appdata",response_type:"token",watch_interval:t},request:e=>r.request(e).then(e=>e,t=>{if(!t||[403,500].includes(t.status))return e.backoff=2*(e.backoff||1e3),d.sleep(e.backoff).then(()=>p.request(e));if([400,401].includes(t.status)){if(a.logger.warn("Google Drive: authentication error",t),delete p.credentials.access_token,!e.retry_auth)return e.retry_auth=!0,p.oauth.run().then(()=>p.request(e))}else if(404==t.status)return i.Deferred.Pledge(t)
;return p.error(t),i.Deferred.Breach(t)}),list:r.wait(e=>{let t=[];const n=i.Deferred(),r=e=>"https://www.googleapis.com/drive/v3/files?"+s.default.hash2params({spaces:c,pageToken:e,orderBy:"modifiedTime desc",fields:"nextPageToken, files(id, size, name, modifiedTime, md5Checksum)",pageSize:500}),o=e=>{p.request({method:"GET",url:e,headers:{"Content-Type":"application/json"}}).then(e=>{const i=e.result,s=i?JSON.parse(i):{files:[]};if(t=t.concat(s.files),
s.nextPageToken)return o(r(s.nextPageToken));n.resolve(t)})};return o(r()),n.promise().then(t=>{const n={};return t.map(t=>{if(!e){if(n[t.name])return;n[t.name]=!0}return{name:t.name,size:t.size||0,id:t.id,md5:t.md5Checksum,modified:new Date(t.modifiedTime).getTime()}}).filter(e=>e)})}),get:r.wait(e=>{const t=e.id||e;return p.request({method:"GET",url:"https://www.googleapis.com/drive/v3/files/"+t+"?"+s.default.hash2params({spaces:c,alt:"media"}),responseType:"arraybuffer"}).then(e=>{
const t=e.result;return new Blob([t])})}),put:r.wait((e,t,n)=>{const r=e,a=r.name||e,A=r.id,d=o.createUUID();return i.Deferred.Pledge().then(()=>{if(t)return l.default.blob2str(t)}).then(e=>{const t=n&&n.lastModified?new Date(n.lastModified).toISOString():void 0,r=[];return r.push("--"+d),r.push("Content-Type: application/json"),r.push(""),r.push(JSON.stringify({name:a,parents:A?void 0:[c],modifiedTime:t})),r.push("--"+d),e&&(r.push("Content-Type: application/octet-stream"),
r.push("Content-Transfer-Encoding: base64"),r.push(""),r.push(l.default.Base64.encode(e)),r.push("--"+d+"--")),r.push(""),p.request({method:A||!e?"PATCH":"POST",url:"https://www.googleapis.com/"+(e?"upload/":"")+"drive/v3/files"+(A?"/"+A:"")+"?"+s.default.hash2params({uploadType:"multipart"}),headers:{"Content-Type":"multipart/related; boundary="+d},data:r.join("\r\n")})})}),delete:r.wait(e=>{const t=e.id||e;return p.request({method:"DELETE",
url:"https://www.googleapis.com/drive/v3/files/"+t+"?"+s.default.hash2params({spaces:c}),headers:{"Content-Type":" application/json"}})}),revoke:r.wait(()=>{const e=p.credentials.access_token;return e?r.request({method:"GET",url:"https://accounts.google.com/o/oauth2/revoke?"+s.default.hash2params({token:e})}):i.Deferred.Breach()}),compare:(e,t)=>{const n=i.Deferred();let r;return(r=e.md5)&&r==l.default.MD5(t,"utf-8")?n.resolve(!0):n.resolve(!1),n.promise()},watch:{start:()=>{if(A)return;let e
;A=!0;const t=()=>{u=null,A&&p.request({method:"GET",url:"https://www.googleapis.com/drive/v3/changes/?"+s.default.hash2params({pageToken:e,spaces:"appDataFolder",pageSize:1e3,includeRemoved:!0}),headers:{"Content-Type":" application/json"}}).then(t=>{const n=t.result;if(!A)return i.Deferred.Breach();const r=n?JSON.parse(n):{};if(!(e=r.newStartPageToken))return a.logger.warn("Google Drive: watch token error",n),p.watch.stop();r.nextPageToken&&a.logger.warn("Google Drive: too much changes",n),
(r.changes||[]).forEach(e=>{let t;const n=e.file;"file"===e.type&&n&&(t=Date.parse(e.time),isNaN(t)&&(t=Date.now()),p.changes.notify({id:n.id,time:t,name:n.name,removed:e.removed}))})}).fail(e=>{a.logger.warn("Google Drive: file changes check failed",e)}).always(()=>{u=window.setTimeout(t,p.config.watch_interval)})};r.wait(()=>A?p.request({method:"GET",url:"https://www.googleapis.com/drive/v3/changes/startPageToken",headers:{"Content-Type":" application/json"}}).then(n=>{
const r=n.result,i=r?JSON.parse(r):{};if(!(e=i.startPageToken))return a.logger.warn("Google Drive: watch token error",r),p.watch.stop();t()}):i.Deferred.Breach())()},stop:()=>{A=!1,u&&(window.clearTimeout(u),u=null)}}});return p},dropbox:e=>{const t=e.path||"",n=h.HTML5.LOCALSTORAGE;let r;n&&(r=parseInt(n.getItem("dropbox_poll_interval")||""))||(r=18e5);const s=w(v("dropbox")),o=Object.assign({},s);let c,A,p,f,g=!0;const m=e=>{let n=[];const r=i.Deferred(),s=e=>{_.request({method:"POST",
url:"https://api.dropboxapi.com/2/files/list_folder"+(e?"/continue":""),headers:{"Content-Type":" application/json"},data:{path:e?void 0:b(t),cursor:e}}).then(e=>{const t=e.result,i=t?JSON.parse(t):{entries:[]};if(n=n.concat(i.entries),i.has_more&&i.cursor)return s(i.cursor);r.resolve({list:n,cursor:i.cursor})}).fail(r.reject)};return g?(g=!1,_.put(".version",new Blob([u.extension.manifest.version])).then(()=>{s(e)}).fail(r.reject)):s(e),r.promise()},_=Object.assign(s,{...s,config:{...s.config,
redirect_uri:"https://auth.tampermonkey.net/oauth.php",request_uri:"https://www.dropbox.com/oauth2/authorize",client_id:"gq3auc9yym0e21y",storage_key:"db_config",response_type:"token",watch_interval:r?Number(r):0},request:e=>o.request(e).then(e=>e,t=>!t||[500,429].includes(t.status)?(e.backoff=2*(e.backoff||1e3),d.sleep(e.backoff).then(()=>_.request(e))):[401].includes(t.status)&&(a.logger.warn("Dropbox: authentication error",t),delete _.credentials.access_token,!e.retry_auth)?(e.retry_auth=!0,
_.oauth.run().then(()=>_.request(e))):(_.error(t),i.Deferred.Breach(t))),list:o.wait(e=>m().then(t=>{const n={};return A=t.cursor,t.list.map(t=>{if(!e){if(n[t.name])return;n[t.name]=!0}return{name:t.name,size:t.size,dropbox_hash:t.content_hash,modified:new Date(t.client_modified).getTime(),precision:1e3}}).filter(e=>e)}).always(()=>{c&&A&&(c(),c=null)})),get:o.wait(e=>{const n=e.name||e;return _.request({method:"POST",url:"https://content.dropboxapi.com/2/files/download",headers:{
"Dropbox-API-Arg":JSON.stringify({path:b(t,n)})},responseType:"arraybuffer"}).then(e=>{const t=e.result;return new Blob([t])})}),put:o.wait((e,n,r)=>{const i=e.name||e,s=r&&r.lastModified?(new Date(r.lastModified).toISOString().match(/[^:]*:[^:]*:[^:.a-zA_Z]*/)||"")[0]+"Z":void 0;return _.request({method:"POST",url:"https://content.dropboxapi.com/2/files/upload",headers:{"Dropbox-API-Arg":JSON.stringify({path:b(t,i),client_modified:s,mode:"overwrite"}),"Content-Type":"application/octet-stream"},
data_type:"typified",data:{type:"raw",value:n}})}),delete:o.wait(e=>{const n=e.name||e;return _.request({method:"POST",url:"https://api.dropboxapi.com/2/files/delete",headers:{"Content-Type":" application/json"},data:{path:b(t,n)}})}),compare:(e,t)=>{const n=i.Deferred();if(window.crypto&&window.ArrayBuffer){const r=4194304,i=l.default.str2abSync(t,{encoding:"utf-8"}),s=[],o=i.byteLength;let c=1;const A=(e,t)=>{const n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),
n.set(new Uint8Array(t),e.byteLength),n.buffer},d=()=>{if(0==--c){let t=new window.ArrayBuffer(s.map(e=>(null==e?void 0:e.byteLength)||0).reduce((e,t)=>e+t,0));s.forEach(e=>{e&&(t=A(t,e))}),window.crypto.subtle.digest("SHA-256",t).then(t=>{const r=Array.from(new Uint8Array(t)).map(e=>("00"+e.toString(16)).slice(-2)).join("");n.resolve(r==e.dropbox_hash)})}};for(let e=0,t=0;t<o;t+=r,e++)(e=>{s.push(null),c++,window.crypto.subtle.digest("SHA-256",i.slice(t,t+Math.min(r,o-t))).then(t=>{s[e]=t,d()
},()=>{a.logger.warn("Dropbox: unable to calculate SHA-256 hashes"),n.reject()})})(e);d()}else a.logger.warn("Dropbox: unable to calculate SHA-256 hashes"),n.reject();return n.promise()},watch:{start:()=>{if(p)return;p=!0;let e=0;const t=()=>{if(f=null,e=0,p)return A?void _.request({method:"POST",url:"https://notify.dropboxapi.com/2/files/list_folder/longpoll",headers:{"Content-Type":" application/json"},no_auth:!0,no_queue:!0,data:{cursor:A,timeout:180}}).then(t=>{const n=t.result
;if(!p)return i.Deferred.Breach();const r=n?JSON.parse(n):{};return r.backoff&&(e=1e3*r.backoff),r.changes?d.sleep(6e4).then(()=>m(A)).then(e=>(A=e.cursor)?e.list:(a.logger.warn("Dropbox: watch token error",n),_.watch.stop())):null}).then(e=>{e&&e.forEach(e=>{let t;const n=e[".tag"];["file","deleted"].includes(n)&&(t=Date.parse(e.server_modified),_.changes.notify({id:e.id,time:t,name:e.name,removed:"deleted"==n}))})}).fail(e=>{a.logger.warn("Dropbox: file changes check failed",e)}).always(()=>{
f=window.setTimeout(t,e+_.config.watch_interval)}):(a.logger.warn("Dropbox: watch token error",A),_.watch.stop())};o.wait(()=>p?(A?t():c=t,i.Deferred.Pledge()):i.Deferred.Breach())()},stop:()=>{p=!1,f&&(window.clearTimeout(f),f=null)}},getRemoteDomains:()=>["dropbox.com","dropboxapi.com"]});return _},onedrive:e=>{const t=e.path||"";let n,r,s;(n=h.HTML5.LOCALSTORAGE)&&(r=parseInt(n.getItem("onedrive_poll_interval")||""))||(r=18e5);const o=w(v("onedrive")),l=Object.assign({},o);let c,A
;const u=e=>{const n=i.Deferred();let r=[];const o=i=>{p.request({method:"GET",url:i||"https://api.onedrive.com/v1.0/drive/special/approot:"+b(t)+":/children",headers:{"Content-Type":" application/json"}}).then(t=>{const i=t.result,a=i?JSON.parse(i):{value:[]};if(r=r.concat(a.value.map(e=>{var t,n,r
;const i=(null===(t=null==e?void 0:e.fileSystemInfo)||void 0===t?void 0:t.lastModifiedDateTime)||0,s=(null===(r=null===(n=null==e?void 0:e.file)||void 0===n?void 0:n.hashes)||void 0===r?void 0:r.sha1Hash)||void 0;return{id:e.id,name:e.name,size:e.size,sha1:s,modified:new Date(i).getTime()}})),a["@odata.nextLink"])return o(a["@odata.nextLink"]);e.set_current_list&&(s=r),n.resolve(r)})};return o(),n.promise()},p=Object.assign(o,{...o,config:{...o.config,
redirect_uri:"https://auth.tampermonkey.net/oauth.php",request_uri:"https://login.live.com/oauth20_authorize.srf",client_id:"000000004C1A3122",storage_key:"od_config",response_type:"token",scope:"onedrive.appfolder",watch_interval:r},getRemoteDomains:()=>["onedrive.live.com"],request:e=>l.request(e).then(e=>e,t=>{if(!t||[403,500].includes(t.status))return e.backoff=2*(e.backoff||1e3),d.sleep(e.backoff).then(()=>p.request(e));if([401].includes(t.status)){
if(a.logger.warn("OneDrive: authentication error",t),delete p.credentials.access_token,!e.retry_auth)return e.retry_auth=!0,p.oauth.run().then(()=>p.request(e))}else if(404==t.status)return i.Deferred.Pledge(t);return p.error(t),i.Deferred.Breach(t)}),list:l.wait(()=>u({set_current_list:!0})),get:l.wait(e=>{const n=e.name||e;return p.request({method:"GET",url:"https://api.onedrive.com/v1.0/drive/special/approot:"+b(t,encodeURIComponent(n))+":/content",responseType:"arraybuffer"}).then(e=>{
const t=e.result;return new Blob([t])})}),put:l.wait((e,n,r)=>{const i=e.name||e,s=encodeURIComponent(i.replace(/[#%<>:"|\?\*\/\\]/g,"-"));return p.request({method:"PUT",url:"https://api.onedrive.com/v1.0/drive/special/approot:"+b(t,s)+":/content",headers:{"Content-Type":"application/octet-stream"},data_type:"typified",data:{type:"raw",value:n}}).then(e=>{const t=r&&r.lastModified?new Date(r.lastModified).toISOString():void 0;if(!t)return e;const n=e.result,i=JSON.parse(n);return p.request({
method:"PATCH",url:"https://api.onedrive.com/v1.0/drive/items/"+i.id,headers:{"Content-Type":"application/json"},data:JSON.stringify({fileSystemInfo:{lastModifiedDateTime:t}})})})}),delete:l.wait(e=>{const n=e.name||e;return p.request({method:"DELETE",url:"https://api.onedrive.com/v1.0/drive/special/approot:"+b(t,encodeURIComponent(n))})}),watch:{start:()=>{if(c)return;c=!0;const e=()=>{if(A=null,!c)return;const t=s;u({set_current_list:!0}).then(()=>{if(!t)return;const e={},n={};s.forEach(t=>{
e[t.id]=t}),t.forEach(e=>{n[e.id]=e}),Object.keys(n).forEach(t=>{const r=e[t],i=n[t];r?i.modified!=r.modified&&p.changes.notify({time:r.modified,name:r.name}):p.changes.notify({time:Date.now(),name:i.name,removed:!0})}),Object.keys(e).forEach(t=>{if(!n[t]){const n=e[t];p.changes.notify({time:n.modified,name:n.name})}})}).fail(e=>{a.logger.warn("OneDrive: file changes check failed",e)}).always(()=>{A=window.setTimeout(e,p.config.watch_interval)})};l.wait(()=>c?(e(),
i.Deferred.Pledge()):i.Deferred.Breach())()},stop:()=>{c=!1,A&&(window.clearTimeout(A),A=null)}}});return p},yandex:()=>{let e,t;(e=h.HTML5.LOCALSTORAGE)&&(t=parseInt(e.getItem("yandex_poll_interval")||""))||(t=18e5);const n=w(v("yandex")),r=k(n),s=Object.assign({},r);let o;const c=Object.assign(r,{...n,...r,config:{...r.config,root:"/Programs/Tampermonkey",url:"https://webdav.yandex.ru",redirect_uri:"https://auth.tampermonkey.net/oauth.php",refresh_supported:!0,
request_uri:"https://oauth.yandex.com/authorize",client_id:"a591fcd2ccd248f0baa84222898065f4",storage_key:"ya_config",response_type:"token",auth_prefix:"OAuth",watch_interval:t},init:()=>{if(o)return o;const e=i.Deferred();return o=e.promise(),c.request({method:"GET",url:"https://cloud-api.yandex.net/v1/disk/"}).done(e=>{const t=e.result,n=t?JSON.parse(t):{}
;n.total_space&&n.used_space&&(n.used_space+5e7>n.total_space?a.logger.warn("Yandex: low disk space warning, only "+(n.total_space-n.used_space)+" bytes available"):a.logger.log("Yandex: "+(n.total_space-n.used_space)+" bytes on disk available!"))}).always(()=>{e.consume(s.init())}),o},getRemoteDomains:()=>["disk.yandex.com"],list:e=>s.list(e).then(e=>e.map(e=>(e.md5=e.etag,e))),request:e=>(()=>{const t=e.headers=e.headers||{};if(t["X-Requested-With"]="XMLHttpRequest",
p&&"PUT"==e.method&&e.data&&"raw"==e.data.type&&e.data.value){const n=i.Deferred();return l.default.blob2str(e.data.value).then(e=>{t.Etag=l.default.MD5(e),t.Sha256=p(e,"ASCII")}).always(n.resolve),n.promise()}return i.Deferred.Pledge()})().then(()=>s.request(e).then(e=>e,t=>t&&[401].includes(t.status)&&(a.logger.warn("Yandex: authentication error",t),delete c.credentials.access_token,!e.retry_auth)?(e.retry_auth=!0,c.oauth.run().then(()=>s.request(e))):t)),compare:(e,t)=>{const n=i.Deferred()
;let r;return(r=e.md5)&&r==l.default.MD5(t,"utf-8")?n.resolve(!0):n.resolve(!1),n.promise()}});return c},webdav:e=>{let t,n;(t=h.HTML5.LOCALSTORAGE)&&(n=parseInt(t.getItem("webdav_poll_interval")||""))||(n=18e5);const r=e.url;if(r){const t=r.toLowerCase();t.startsWith("webdav")?e.url=r.replace(/^webdav/i,"http"):t.startsWith("http")||(e.url="http://"+r)}const s=k((e=>{const t=Object.assign({},e),n=t.type;if(void 0===n)throw new Error("Internal error");const r=Object.assign(e,{...t,config:{
...t.config},credentials:{},request:e=>r.credentials.basic_auth?(e.no_auth||(e.headers=e.headers||{},e.headers.Authorization="Basic "+r.credentials.basic_auth),t.request(e)):i.Deferred.Breach("Authentication failed"),wait:e=>t.wait((...t)=>e(...t))});let s;return Object.defineProperty(r,"credentials",{get:()=>(void 0===s&&(c.default.tC(n,"init"),s={basic_auth:r.config.basic_auth}),s),set:e=>{s=e},enumerable:!1}),r})(v("webdav")));return Object.assign(s,{...s,config:{...s.config,
root:"Tampermonkey",watch_interval:n,...e}})}};t.default=y},,function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(1),s=n(3),o=r(n(6)),a=r(n(33)),l=n(10),c=n(2),A=(()=>{let e,t,n=!1;const r=()=>{const e=i.Deferred();return t=e,e};return{write:()=>{const t=i.Deferred();return n=!1,e=new a.default,t.resolve(e),t.promise()},open:i=>{const s=r();return n=!0,
a.default.loadAsync(i).then(t=>{e=t,s.resolve(e)},e=>{t&&t.reject(e),s.reject(e)}),s.promise()},entries:()=>{const t=r(),n=e.files,i=Object.keys(n).map(e=>{const t=n[e];if(t&&!t.dir)return{filename:t.name}}).filter(e=>e);return t.resolve(i),t.promise()},get:t=>{const n=r(),i=e.file(t.filename);return i?i.async("arraybuffer").then(e=>{n.resolve(e)}):n.resolve(),n.promise()},put:(t,n,i)=>{const s=r();try{e.file(t,n,{date:i?new Date(i):void 0}),s.resolve()}catch(e){s.reject(e)}return s.promise()},
end:()=>{const t=r();return n?t.resolve():e.generateAsync({type:"blob",compression:"DEFLATE",comment:"Created by Tampermonkey"}).then(e=>{t.resolve(e)},e=>{t.reject(e)}),t.promise()}}})(),d={zip:{create:function(e,t){const n=i.Deferred();let r=0;return i.Deferred.Pledge().then(()=>A.write()).then(()=>{const t=i.Deferred(),s={},a=(e,t)=>{let n=[e,t].join(".");if(s[n]){let r;do{r=e+" ("+s[n]+")",n=[r,t].join("."),s[n]++}while(s[n]);return a(r,t)}return s[n]=1,n},d=e.length,u=()=>{
if(!e.length)return t.resolve();const s=e.shift();if(!s)return t.resolve();const p=s.meta.name.replace(/[\\\/$*?|]/g,"-"),h=a(p,"user.js"),f=a(p,"options.json"),g=a(p,"storage.json"),m=JSON.stringify({options:s.options,settings:s.settings,meta:s.meta}),_=s.storage?JSON.stringify(s.storage):null;r+=s.source.length,c.logger.log("porter: add to zip",h,r),n.notify("Zip: "+Math.floor((d-e.length)/d*100)+"%"),A.put(h,s.source,s.meta.modified).then(()=>(r+=m.length,
c.logger.log("porter: add to zip",f,r),A.put(f,m))).then(()=>_?(r+=_.length,c.logger.log("porter: add to zip",g,r),A.put(g,_)):i.Deferred.Pledge()).then(()=>{if(!s.resources.length&&!s.requires.length)return i.Deferred.Pledge();const e=[];return["resources","requires"].forEach(t=>{s[t].forEach(n=>{if(void 0===n.source)return;const r=n.meta.name.replace(/[\\\/$*?|]/g,"-"),i=o.default.MD5(t+n.meta.url),s=[h,i,r].join("-"),a=JSON.stringify(n.meta),l=o.default.str2abSync(n.source,{
encoding:"resources"==t?void 0:"UTF-8"}),c=A.put(s,l).then(()=>A.put(s+"."+t+".json",a));e.push(c)})}),i.Deferred.when(e)}).fail(e=>{c.logger.log("porter: add to zip failed",e)}).always(async()=>{c.logger.log("porter: add to zip -> next round"),await l.sleepEvery(1e3),u()})};return u(),t.promise()}).then(()=>(c.logger.log("porter: add global props"),t?A.put("Tampermonkey.global.json",JSON.stringify(t)):i.Deferred.Pledge())).then(()=>A.end()).done(e=>{n.resolve(e)}).fail(()=>{n.reject()}),
n.promise()},read:function(e){const t=i.Deferred();let n;return i.Deferred.Pledge().then(()=>A.open(e)).then(()=>A.entries()).then(e=>{const r=i.Deferred(),a={},d={},u=e.length,p=()=>{let i;if(e.length&&(i=e.shift()))c.logger.log("porter: read from zip",i.filename),A.get(i).done(e=>{let t=i.filename.match(/((.*)\.(storage\.json)|(.*)\.(options\.json)|(.*)\.(global\.json)|(.*)\.(user\.js)|(.*)\.user\.js-[0-9a-f]+-.*\.(resources\.json)|(.*)\.user\.js-[0-9a-f]+-.*\.(requires\.json))$/)
;if(t&&(t=t.slice(1).filter(e=>e)),!e||!t||t.length<3)d[i.filename]=e;else try{const r=t[1],s=t[2],l=o.default.ab2strSync(e,"UTF-8");"global.json"==s?n=JSON.parse(l):(a[r]=a[r]||{resources:{},requires:{}},"user.js"==s?a[r].source=l:"options.json"==s?a[r].options=JSON.parse(l):"resources.json"==s?a[r].resources[i.filename]={name:i.filename,data:JSON.parse(l)}:"requires.json"==s?a[r].requires[i.filename]={name:i.filename,data:JSON.parse(l)}:"storage.json"==s&&(a[r].storage=JSON.parse(l)))
}catch(e){c.logger.warn("porter: read from zip failed",e)}}).always(async()=>{t.notify("Zip: "+Math.floor((u-e.length)/u*100)+"%"),await l.sleepEvery(1e3),p()});else{const e=[];s.each(a,t=>{const n=t.options||{};n.source=t.source,n.storage=t.storage,["resources","requires"].forEach(e=>{const r=t[e];r&&s.each(r,t=>{let r,i;const s=t.name.replace("."+e+".json","");(i=d[s])&&(n[e]=r=n[e]||[],r.push({meta:t.data,source:o.default.ab2strSync(i,{encoding:"resources"==e?void 0:"UTF-8"})}))})}),e.push(n)
}),r.resolve({scripts:e,global_settings:n})}};return p(),r.promise()}).done(e=>{t.resolve(e)}).fail(()=>{t.reject()}),t.promise()}},json:{create:function(e,t){const n=i.Deferred(),r={created_by:"Tampermonkey",version:"1",scripts:[],settings:t};return e.forEach(e=>{const t={name:e.meta.name,options:e.options,storage:e.storage,enabled:e.settings.enabled,position:e.settings.position,file_url:e.meta.file_url,uuid:e.meta.uuid,source:o.default.Base64.encode(o.default.UTF8.encode(e.source))}
;["resources","requires"].forEach(n=>{const r=e[n];if(!r||!r.length)return;const i=t[n]=[];r.forEach(e=>{if(void 0===e.source)return;const t=e.meta,n=o.default.Base64.encode(o.default.UTF8.encode(e.source));i.push({meta:t,source:n})})}),r.scripts.push(t)}),n.resolve(JSON.stringify(r)),n.promise()},read:function(e){const t=i.Deferred(),n=e=>{if(e.trim()){let r=null;try{r=JSON.parse(e);const n=e=>{if(e&&e.length)return e.map(e=>({meta:e.meta,
source:o.default.UTF8.decode(o.default.Base64.decode(e.source))}))},i=r.scripts.map(e=>({meta:{uuid:e.uuid,name:e.name,file_url:e.file_url},settings:{enabled:e.enabled,position:e.position},options:e.options,storage:e.storage,source:o.default.UTF8.decode(o.default.Base64.decode(e.source)),resources:n(e.resources)||[],requires:n(e.requires)||[]}));return t.resolve({scripts:i,global_settings:r.settings})}catch(t){const r="<body>",i="</body>";if(-1!=e.indexOf(r)){
const t=e.indexOf(r),s=e.lastIndexOf(i);if(-1!=t&&-1!=s)return e=e.substr(t+r.length,s-(t+r.length)),n(e)}}}t.reject()};return n(e),t.promise()}}};t.default=d},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperties(Promise.prototype,{done:{value:function(e){return this.then((...t)=>e.apply(this,t))}},fail:{value:function(e){return this.then(()=>{},(...t)=>e.apply(this,t))}},always:{value:function(e){
return this.then((...t)=>e.apply(this,t),(...t)=>e.apply(this,t))}}}),t.default=Promise},function(e,t,n){"use strict";var r=n(1),i=n(3),s=n(14);const o=rea.FEATURES;let a;const l=o.RUNTIME.BROWSER_VERSION;let c=!0;a=o.RUNTIME.CHROME?l>=83?2020:l>=64?2018:l>=59?2017:l>=47?2015:5:o.RUNTIME.SAFARI?l>=14?2020:l>=11?2018:l>=10?2017:l>=6?2015:3:o.RUNTIME.EDGE?l>=83?2020:l>=16?2017:2016:o.RUNTIME.FIREFOX?l>=77?2020:l>=58?2018:l>=52?2017:2016:5;const A={};o.RUNTIME.CHROME&&l<77?(c=!1,
console.warn("hint: disable inline ESLint config due to web worker CSP issues","https://bugs.chromium.org/p/chromium/issues/detail?id=777076","https://bugs.chromium.org/p/chromium/issues/detail?id=159303")):o.RUNTIME.EDGE?(c=!1,console.warn("hint: disable inline ESLint config due to web worker CSP issues")):window.Worker||(c=!1,
console.warn("hint: disable inline ESLint config because web workers are unavailable and this extension's CSP doesn't allow unsafe eval, which is required for ESLint's dynamic reconfigration"));const d={env:{es6:a>=2015,browser:!0},parserOptions:{ecmaVersion:a,sourceType:"script",ecmaFeatures:{globalReturn:!0}},rules:{curly:[1,"multi-line"],"dot-location":0,"dot-notation":[1,{allowKeywords:!0}],"no-caller":1,"no-case-declarations":2,"no-div-regex":0,"no-empty-pattern":2,"no-eq-null":0,
"no-eval":1,"no-extra-bind":1,"no-fallthrough":1,"no-implicit-globals":2,"no-implied-eval":1,"no-lone-blocks":1,"no-loop-func":1,"no-multi-spaces":1,"no-multi-str":1,"no-native-reassign":1,"no-octal-escape":2,"no-octal":2,"no-proto":1,"no-redeclare":2,"no-return-assign":1,"no-sequences":1,"no-undef":1,"no-useless-call":1,"no-useless-concat":1,"no-with":1}},u={};let p
;Object(i.each)(["uneval","unsafeWindow","TM_info","GM_info","GM","GM_addStyle","GM_deleteValue","GM_listValues","GM_getValue","GM_download","GM_log","GM_registerMenuCommand","GM_unregisterMenuCommand","GM_openInTab","GM_setValue","GM_addValueChangeListener","GM_removeValueChangeListener","GM_xmlhttpRequest","GM_getTab","GM_setTab","GM_saveTab","GM_getTabs","GM_setClipboard","GM_notification","GM_getResourceText","GM_getResourceURL"],e=>{u[e]="writeable"}),d.globals=u;const h={};let f;const g={
hint:function(e,t,n){const a=Object(r.Deferred)(),l=a.promise(),g=n||A;let m;if(t?(m=t,m.globals={...m.globals||{},...u}):m=d,window.Worker&&!o.RUNTIME.SAFARI){const t=()=>{p=new Worker("worker/lint.js"),p.onmessage=e=>{const t=e.data,n=t.id;let r,i,s;n&&(r=h[n])&&(i=r.d)&&(delete h[n],(s=t.results)?(c||(s=s.map(e=>{let t
;return e.message&&(t=e.message.match(/Configuration for rule "([^"]+)"[\s\S]*evaluate a string as JavaScript[\s\S]*/))&&(e.message='Rule "'+t[1]+'": ESLint inline configuration is not supported by this browser.',e.severity=1),e})),i.resolve(s)):i.reject(t.error||"Unknown error")),_(n)},p.postMessage({method:"base_uri",value:rea.extension.getURL("/")}),f=null};var _=e=>{if(p||t(),e)f=null;else if(f)return;let n,r=Date.now();Object.keys(h).forEach(e=>{h[e].ts<=r&&(n=h[e],r=n.ts)}),n&&(f=n.id,
p.postMessage({method:n.method,id:n.id,config:n.c,options:n.o,text:n.t}))};l.abort=()=>{p&&(p.terminate(),p=null,_())},p||t();const n=Object(i.createUUID)();h[n]={method:"lint",id:n,d:a,t:e,c:m,o:g,ts:Date.now()},_()}else Object(s.vendor)("vendor/eslint/eslint",()=>{try{const t={problem:"error",layout:1,suggestion:1},n=new window.eslint.Linter;m.extends&&m.extends.includes("eslint:recommended")&&(m.rules=m.rules||[],n.getRules().forEach((function(e,n){let r,i,s,o,a
;if(!(e&&(i=e.meta)&&void 0===m.rules[n]&&(r=i.docs)&&r.recommended))return;const l=[(i.type?t[i.type]:null)||1];(s=i.schema)&&(o={},s.forEach(e=>{"object"==e.type&&Object.keys(e.properties).forEach(t=>{const n=e.properties[t].default;void 0!==n&&!1!==n&&(o[t]=e.properties[t].default,a=!0)})}),a&&l.push(o)),m.rules[n]=l})));const r=n.verify(e,m,g);a.resolve(r||[])}catch(e){a.reject(e)}});return l},globals:u,config:d,options:A,autoHintMaxLength:5e4};t.a=g},function(e){var t;t=function(){
return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},,function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Promise=t.fromEntries=void 0;const i=n(23);Object.defineProperty(t,"fromEntries",{enumerable:!0,get:function(){return i.fromEntries}});const s=r(n(18));t.Promise=s.default},function(e,t){"use strict";let n
;Object.defineProperty(t,"__esModule",{value:!0}),t.fromEntries=void 0,t.fromEntries=n,Object.fromEntries?t.fromEntries=n=Object.fromEntries:(t.fromEntries=n=e=>[...e].reduce((e,[t,n])=>(e[t]=n,e),{}),Object.fromEntries=n)},,,,,,,,,,function(e,t,n){(function(t,n,r){e.exports=function e(t,n,r){function i(o){if(!n[o]){if(!t[o]){if(s)return s(o,!0);var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var l=n[o]={exports:{}};t[o][0].call(l.exports,(function(e){
return i(t[o][1][e]||e)}),l,l.exports,e,t,n,r)}return n[o].exports}for(var s=!1,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";var r=e("./utils"),i=e("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(e){for(var t,n,i,o,a,l,c,A=[],d=0,u=e.length,p=u,h="string"!==r.getTypeOf(e);d<e.length;)p=u-d,h?(t=e[d++],n=d<u?e[d++]:0,i=d<u?e[d++]:0):(t=e.charCodeAt(d++),n=d<u?e.charCodeAt(d++):0,i=d<u?e.charCodeAt(d++):0),o=t>>2,
a=(3&t)<<4|n>>4,l=p>1?(15&n)<<2|i>>6:64,c=p>2?63&i:64,A.push(s.charAt(o)+s.charAt(a)+s.charAt(l)+s.charAt(c));return A.join("")},n.decode=function(e){var t,n,r,o,a,l,c=0,A=0,d="data:";if(e.substr(0,d.length)===d)throw new Error("Invalid base64 input, it looks like a data url.");var u,p=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===s.charAt(64)&&p--,e.charAt(e.length-2)===s.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.")
;for(u=i.uint8array?new Uint8Array(0|p):new Array(0|p);c<e.length;)t=s.indexOf(e.charAt(c++))<<2|(o=s.indexOf(e.charAt(c++)))>>4,n=(15&o)<<4|(a=s.indexOf(e.charAt(c++)))>>2,r=(3&a)<<6|(l=s.indexOf(e.charAt(c++))),u[A++]=t,64!==a&&(u[A++]=n),64!==l&&(u[A++]=r);return u}},{"./support":30,"./utils":32}],2:[function(e,t){"use strict";function n(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}
var r=e("./external"),i=e("./stream/DataWorker"),s=e("./stream/DataLengthProbe"),o=e("./stream/Crc32Probe");s=e("./stream/DataLengthProbe"),n.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){
return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},n.createWorkerFrom=function(e,t,n){return e.pipe(new o).pipe(new s("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new s("compressedSize")).withStreamInfo("compression",t)},t.exports=n},{"./external":6,"./stream/Crc32Probe":25,
"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t){"use strict";var n=e("./utils"),r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t
}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,n,i){var s=r,o=i+n;e^=-1;for(var a=i;a<o;a++)e=e>>>8^s[255&(e^t[a])];return-1^e}(0|t,e,e.length,0):function(e,t,n,i){var s=r,o=i+n;e^=-1;for(var a=i;a<o;a++)e=e>>>8^s[255&(e^t.charCodeAt(a))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,
n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t){"use strict";var n;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,n){"use strict";function r(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,s=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),l=i?"uint8array":"array"
;n.magic="\b\0",o.inherits(r,a),r.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(l,e.data),!1)},r.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},r.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},r.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this
;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new r("Deflate",e)},n.uncompressWorker=function(){return new r("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t){"use strict";function n(e,t,n,r){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,
this.entriesCount=0,this.currentFile=null,this._sources=[]}var r=e("../utils"),i=e("../stream/GenericWorker"),s=e("../utf8"),o=e("../crc32"),a=e("../signature"),l=function(e,t){var n,r="";for(n=0;n<t;n++)r+=String.fromCharCode(255&e),e>>>=8;return r},c=function(e,t,n,i,c,A){
var d,u,p=e.file,h=e.compression,f=A!==s.utf8encode,g=r.transformTo("string",A(p.name)),m=r.transformTo("string",s.utf8encode(p.name)),_=p.comment,b=r.transformTo("string",A(_)),v=r.transformTo("string",s.utf8encode(_)),w=m.length!==p.name.length,k=v.length!==_.length,y="",R="",x="",C=p.dir,E=p.date,I={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(I.crc32=e.crc32,I.compressedSize=e.compressedSize,I.uncompressedSize=e.uncompressedSize);var M=0;t&&(M|=8),f||!w&&!k||(M|=2048)
;var G,Z,T,N=0,S=0;C&&(N|=16),"UNIX"===c?(S=798,N|=(G=p.unixPermissions,Z=C,T=G,G||(T=Z?16893:33204),(65535&T)<<16)):(S=20,N|=63&(p.dosPermissions||0)),d=E.getUTCHours(),d<<=6,d|=E.getUTCMinutes(),d<<=5,d|=E.getUTCSeconds()/2,u=E.getUTCFullYear()-1980,u<<=4,u|=E.getUTCMonth()+1,u<<=5,u|=E.getUTCDate(),w&&(R=l(1,1)+l(o(g),4)+m,y+="up"+l(R.length,2)+R),k&&(x=l(1,1)+l(o(b),4)+v,y+="uc"+l(x.length,2)+x);var U="";return U+="\n\0",U+=l(M,2),U+=h.magic,U+=l(d,2),U+=l(u,2),U+=l(I.crc32,4),
U+=l(I.compressedSize,4),U+=l(I.uncompressedSize,4),U+=l(g.length,2),U+=l(y.length,2),{fileRecord:a.LOCAL_FILE_HEADER+U+g+y,dirRecord:a.CENTRAL_FILE_HEADER+l(S,2)+U+l(b.length,2)+"\0\0\0\0"+l(N,4)+l(i,4)+g+y+b}},A=function(e){return a.DATA_DESCRIPTOR+l(e.crc32,4)+l(e.compressedSize,4)+l(e.uncompressedSize,4)};r.inherits(n,i),n.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,
i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=c(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},n.prototype.closedSource=function(e){this.accumulate=!1
;var t=this.streamFiles&&!e.file.dir,n=c(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:A(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}})
;var n=this.bytesWritten-e,i=function(e,t,n,i,s){var o=r.transformTo("string",s(i));return a.CENTRAL_DIRECTORY_END+"\0\0\0\0"+l(e,2)+l(e,2)+l(t,4)+l(n,4)+l(o.length,2)+o}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},n.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},n.prototype.registerPrevious=function(e){
this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},n.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},n.prototype.error=function(e){
var t=this._sources;if(!i.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch(e){}return!0},n.prototype.lock=function(){i.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=n},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){"use strict";var r=e("../compressions"),i=e("./ZipFileWorker");n.generateWorker=function(e,t,n){
var s=new i(t.streamFiles,n,t.platform,t.encodeFileName),o=0;try{e.forEach((function(e,n){o++;var i=function(e,t){var n=e||t,i=r[n];if(!i)throw new Error(n+" is not a valid compression method !");return i}(n.options.compression,t.compression),a=n.options.compressionOptions||t.compressionOptions||{},l=n.dir,c=n.date;n._compressWorker(i,a).withStreamInfo("file",{name:e,dir:l,date:c,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(s)})),s.entriesCount=o
}catch(e){s.error(e)}return s}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}n.prototype=e("./object"),n.prototype.loadAsync=e("./load"),
n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.5.0",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t){"use strict";function n(e){return new i.Promise((function(t,n){var r=e.decompressed.getContentWorker().pipe(new a);r.on("error",(function(e){n(e)})).on("end",(function(){
r.streamInfo.crc32!==e.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}var r=e("./utils"),i=e("./external"),s=e("./utf8"),o=(r=e("./utils"),e("./zipEntries")),a=e("./stream/Crc32Probe"),l=e("./nodejsUtils");t.exports=function(e,t){var a=this;return t=r.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),
l.isNode&&l.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var n=new o(t);return n.load(e),n})).then((function(e){var r=[i.Promise.resolve(e)],s=e.files;if(t.checkCRC32)for(var o=0;o<s.length;o++)r.push(n(s[o]));return i.Promise.all(r)})).then((function(e){for(var n=e.shift(),r=n.files,i=0;i<r.length;i++){var s=r[i];a.file(s.fileNameStr,s.decompressed,{
binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders})}return n.zipComment.length&&(a.comment=n.zipComment),a}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t){"use strict";function n(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,
this._bindStream(t)}var r=e("../utils"),i=e("../stream/GenericWorker");r.inherits(n,i),n.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},n.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},n.prototype.resume=function(){
return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=n},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t){"use strict";function n(e,t,n){r.call(this,t),this._helper=e;var i=this;e.on("data",(function(e,t){i.push(e)||i._helper.pause(),n&&n(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}var r=e("readable-stream").Readable;e("../utils").inherits(n,r),n.prototype._read=function(){
this._helper.resume()},t.exports=n},{"../utils":32,"readable-stream":16}],14:[function(e,n){"use strict";n.exports={isNode:void 0!==t,newBufferFrom:function(e,n){if(t.from&&t.from!==Uint8Array.from)return t.from(e,n);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new t(e,n)},allocBuffer:function(e){if(t.alloc)return t.alloc(e);var n=new t(e);return n.fill(0),n},isBuffer:function(e){return t.isBuffer(e)},isStream:function(e){
return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t){"use strict";function n(e){return"[object RegExp]"==={}.toString.call(e)}var r=e("./utf8"),i=e("./utils"),s=e("./stream/GenericWorker"),o=e("./stream/StreamHelper"),a=e("./defaults"),l=e("./compressedObject"),c=e("./zipObject"),A=e("./generate"),d=e("./nodejsUtils"),u=e("./nodejs/NodejsStreamInputAdapter"),p=function(e,t,n){var r,o=i.getTypeOf(t),A=i.extend(n||{},a)
;A.date=A.date||new Date,null!==A.compression&&(A.compression=A.compression.toUpperCase()),"string"==typeof A.unixPermissions&&(A.unixPermissions=parseInt(A.unixPermissions,8)),A.unixPermissions&&16384&A.unixPermissions&&(A.dir=!0),A.dosPermissions&&16&A.dosPermissions&&(A.dir=!0),A.dir&&(e=f(e)),A.createFolders&&(r=h(e))&&g.call(this,r,!0);var p="string"===o&&!1===A.binary&&!1===A.base64;n&&void 0!==n.binary||(A.binary=!p),
(t instanceof l&&0===t.uncompressedSize||A.dir||!t||0===t.length)&&(A.base64=!1,A.binary=!0,t="",A.compression="STORE",o="string");var m;m=t instanceof l||t instanceof s?t:d.isNode&&d.isStream(t)?new u(e,t):i.prepareContent(e,t,A.binary,A.optimizedBinaryString,A.base64);var _=new c(e,m,A);this.files[e]=_},h=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},f=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){
return t=void 0!==t?t:a.createFolders,e=f(e),this.files[e]||p.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]},m={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,r;for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r))},filter:function(e){var t=[];return this.forEach((function(n,r){
e(n,r)&&t.push(r)})),t},file:function(e,t,r){if(1===arguments.length){if(n(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var s=this.files[this.root+e];return s&&!s.dir?s:null}return e=this.root+e,p.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(n(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,r=g.call(this,t),i=this.clone();return i.root=r.name,i},remove:function(e){e=this.root+e;var t=this.files[e]
;if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter((function(t,n){return n.name.slice(0,e.length)===e})),r=0;r<n.length;r++)delete this.files[n[r].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,n={};try{if((n=i.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",
comment:null,mimeType:"application/zip",encodeFileName:r.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");i.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var a=n.comment||this.comment||"";t=A.generateWorker(this,n,a)}catch(e){
(t=new s("error")).error(e)}return new o(t,n.type||"string",n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=m},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,
"./zipObject":35}],16:[function(e,t){t.exports=e("stream")},{stream:void 0}],17:[function(e,t){"use strict";function n(e){r.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}var r=e("./DataReader");e("../utils").inherits(n,r),n.prototype.byteAt=function(e){return this.data[this.zero+e]},n.prototype.lastIndexOfSignature=function(e){
for(var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),s=this.length-4;s>=0;--s)if(this.data[s]===t&&this.data[s+1]===n&&this.data[s+2]===r&&this.data[s+3]===i)return s-this.zero;return-1},n.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),s=this.readData(4);return t===s[0]&&n===s[1]&&r===s[2]&&i===s[3]},n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[]
;var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./DataReader":18}],18:[function(e,t){"use strict";function n(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}var r=e("../utils");n.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},
setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4)
;return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=n},{"../utils":32}],19:[function(e,t){"use strict";function n(e){r.call(this,e)}var r=e("./Uint8ArrayReader");e("../utils").inherits(n,r),n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t){"use strict";function n(e){
r.call(this,e)}var r=e("./DataReader");e("../utils").inherits(n,r),n.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},n.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},n.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./DataReader":18}],
21:[function(e,t){"use strict";function n(e){r.call(this,e)}var r=e("./ArrayReader");e("../utils").inherits(n,r),n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(e,t){"use strict"
;var n=e("../utils"),r=e("../support"),i=e("./ArrayReader"),s=e("./StringReader"),o=e("./NodeBufferReader"),a=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||r.uint8array?"nodebuffer"===t?new o(e):r.uint8array?new a(n.transformTo("uint8array",e)):new i(n.transformTo("array",e)):new s(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict"
;n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t){"use strict";function n(e){r.call(this,"ConvertWorker to "+e),this.destType=e}var r=e("./GenericWorker"),i=e("../utils");i.inherits(n,r),n.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=n},{"../utils":32,
"./GenericWorker":28}],25:[function(e,t){"use strict";function n(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}var r=e("./GenericWorker"),i=e("../crc32");e("../utils").inherits(n,r),n.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=n},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t){"use strict";function n(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}
var r=e("../utils"),i=e("./GenericWorker");r.inherits(n,i),n.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=n},{"../utils":32,"./GenericWorker":28}],27:[function(e,t){"use strict";function n(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,
t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}var r=e("../utils"),i=e("./GenericWorker");r.inherits(n,i),n.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,
this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}
return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=n},{"../utils":32,"./GenericWorker":28}],28:[function(e,t){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush()
;try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){
if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){
return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){
for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,n){"use strict";function r(e,n){return new A.Promise((function(r,i){
var o=[],a=e._internalType,c=e._outputType,A=e._mimeType;e.on("data",(function(e,t){o.push(e),n&&n(t)})).on("error",(function(e){o=[],i(e)})).on("end",(function(){try{var e=function(e,t,n){switch(e){case"blob":return s.newBlob(s.transformTo("arraybuffer",t),n);case"base64":return l.encode(t);default:return s.transformTo(e,t)}}(c,function(e,n){var r,i=0,s=null,o=0;for(r=0;r<n.length;r++)o+=n[r].length;switch(e){case"string":return n.join("");case"array":return[].concat.apply([],n)
;case"uint8array":for(s=new Uint8Array(o),r=0;r<n.length;r++)s.set(n[r],i),i+=n[r].length;return s;case"nodebuffer":return t.concat(n);default:throw new Error("concat : unsupported type '"+e+"'")}}(a,o),A);r(e)}catch(e){i(e)}o=[]})).resume()}))}function i(e,t,n){var r=t;switch(t){case"blob":case"arraybuffer":r="uint8array";break;case"base64":r="string"}try{this._internalType=r,this._outputType=t,this._mimeType=n,s.checkSupport(r),this._worker=e.pipe(new o(r)),e.lock()}catch(e){
this._worker=new a("error"),this._worker.error(e)}}var s=e("../utils"),o=e("./ConvertWorker"),a=e("./GenericWorker"),l=e("../base64"),c=e("../support"),A=e("../external"),d=null;if(c.nodestream)try{d=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}i.prototype={accumulate:function(e){return r(this,e)},on:function(e,t){var n=this;return"data"===e?this._worker.on(e,(function(e){t.call(n,e.data,e.meta)})):this._worker.on(e,(function(){s.delay(t,arguments,n)})),this},resume:function(){
return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(s.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:"nodebuffer"!==this._outputType},e)}},n.exports=i},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],
30:[function(e,n,r){"use strict";if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer=void 0!==t,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var i=new ArrayBuffer(0);try{r.blob=0===new Blob([i],{type:"application/zip"}).size}catch(e){try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),
r.blob=0===s.getBlob("application/zip").size}catch(e){r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch(e){r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){"use strict";function r(){l.call(this,"utf-8 decode"),this.leftOver=null}function i(){l.call(this,"utf-8 encode")}for(var s=e("./utils"),o=e("./support"),a=e("./nodejsUtils"),l=e("./stream/GenericWorker"),c=new Array(256),A=0;A<256;A++)c[A]=A>=252?6:A>=248?5:A>=240?4:A>=224?3:A>=192?2:1;c[254]=c[254]=1
;n.utf8encode=function(e){return o.nodebuffer?a.newBufferFrom(e,"utf-8"):function(e){var t,n,r,i,s,a=e.length,l=0;for(i=0;i<a;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(r=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=o.uint8array?new Uint8Array(l):new Array(l),s=0,i=0;s<l;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(r=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),
n<128?t[s++]=n:n<2048?(t[s++]=192|n>>>6,t[s++]=128|63&n):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|63&n):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|63&n);return t}(e)},n.utf8decode=function(e){return o.nodebuffer?s.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,r,i,o=e.length,a=new Array(2*o);for(n=0,t=0;t<o;)if((r=e[t++])<128)a[n++]=r;else if((i=c[r])>4)a[n++]=65533,t+=i-1;else{for(r&=2===i?31:3===i?15:7;i>1&&t<o;)r=r<<6|63&e[t++],
i--;i>1?a[n++]=65533:r<65536?a[n++]=r:(r-=65536,a[n++]=55296|r>>10&1023,a[n++]=56320|1023&r)}return a.length!==n&&(a.subarray?a=a.subarray(0,n):a.length=n),s.applyFromCharCode(a)}(e=s.transformTo(o.uint8array?"uint8array":"array",e))},s.inherits(r,l),r.prototype.processChunk=function(e){var t=s.transformTo(o.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),
t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var i=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+c[e[n]]>t?n:t}(t),a=t;i!==t.length&&(o.uint8array?(a=t.subarray(0,i),this.leftOver=t.subarray(i,t.length)):(a=t.slice(0,i),this.leftOver=t.slice(i,t.length))),this.push({data:n.utf8decode(a),meta:e.meta})},r.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({
data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=r,s.inherits(i,l),i.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=i},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";function r(e){return e}function i(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}function s(e){var t=65536,r=n.getTypeOf(e),i=!0
;if("uint8array"===r?i=u.applyCanBeUsed.uint8array:"nodebuffer"===r&&(i=u.applyCanBeUsed.nodebuffer),i)for(;t>1;)try{return u.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t/2)}return u.stringifyByChar(e)}function o(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}var a=e("./support"),l=e("./base64"),c=e("./nodejsUtils"),A=e("set-immediate-shim"),d=e("./external");n.newBlob=function(e,t){n.checkSupport("blob");try{return new Blob([e],{type:t})}catch(n){try{
var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(e),r.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(e,t,n){var r=[],i=0,s=e.length;if(s<=n)return String.fromCharCode.apply(null,e);for(;i<s;)"array"===t||"nodebuffer"===t?r.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+n,s)))):r.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+n,s)))),i+=n;return r.join("")
},stringifyByChar:function(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return a.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return a.nodebuffer&&1===String.fromCharCode.apply(null,c.allocBuffer(1)).length}catch(e){return!1}}()}};n.applyFromCharCode=s;var p={};p.string={string:r,array:function(e){return i(e,new Array(e.length))},
arraybuffer:function(e){return p.string.uint8array(e).buffer},uint8array:function(e){return i(e,new Uint8Array(e.length))},nodebuffer:function(e){return i(e,c.allocBuffer(e.length))}},p.array={string:s,array:r,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return c.newBufferFrom(e)}},p.arraybuffer={string:function(e){return s(new Uint8Array(e))},array:function(e){return o(new Uint8Array(e),new Array(e.byteLength))
},arraybuffer:r,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return c.newBufferFrom(new Uint8Array(e))}},p.uint8array={string:s,array:function(e){return o(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:r,nodebuffer:function(e){return c.newBufferFrom(e)}},p.nodebuffer={string:s,array:function(e){return o(e,new Array(e.length))},arraybuffer:function(e){return p.nodebuffer.uint8array(e).buffer},uint8array:function(e){
return o(e,new Uint8Array(e.length))},nodebuffer:r},n.transformTo=function(e,t){if(t||(t=""),!e)return t;n.checkSupport(e);var r=n.getTypeOf(t);return p[r][e](t)},n.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"==={}.toString.call(e)?"array":a.nodebuffer&&c.isBuffer(e)?"nodebuffer":a.uint8array&&e instanceof Uint8Array?"uint8array":a.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(e){
if(!a[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,r="";for(n=0;n<(e||"").length;n++)r+="\\x"+((t=e.charCodeAt(n))<16?"0":"")+t.toString(16).toUpperCase();return r},n.delay=function(e,t,n){A((function(){e.apply(n||null,t||[])}))},n.inherits=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={}
;for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===n[t]&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,r,s,o){return d.Promise.resolve(t).then((function(e){return a.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf({}.toString.call(e)))&&"undefined"!=typeof FileReader?new d.Promise((function(t,n){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(e){n(e.target.error)},
r.readAsArrayBuffer(e)})):e})).then((function(t){var c,A=n.getTypeOf(t);return A?("arraybuffer"===A?t=n.transformTo("uint8array",t):"string"===A&&(o?t=l.decode(t):r&&!0!==s&&(t=i(c=t,a.uint8array?new Uint8Array(c.length):new Array(c.length)))),t):d.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(e,t){
"use strict";function n(e){this.files=[],this.loadOptions=e}var r=e("./reader/readerFor"),i=e("./utils"),s=e("./signature"),o=e("./zipEntry"),a=(e("./utf8"),e("./support"));n.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e)
;var r=this.reader.readString(4)===t;return this.reader.setIndex(n),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2)
;var e=this.reader.readData(this.zipCommentLength),t=a.uint8array?"uint8array":"array",n=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),
this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,r=this.zip64EndOfCentralSize-44;0<r;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),
this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(e=new o({
zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END)
;if(e<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),
this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),
this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),
this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(r>0)this.isSignature(t,s.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},
t.exports=n},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t){"use strict";function n(e,t){this.options=e,this.loadOptions=t}var r=e("./reader/readerFor"),i=e("./utils"),s=e("./compressedObject"),o=e("./crc32"),a=e("./utf8"),l=e("./compressions"),c=e("./support");n.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),
this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in l)if(l.hasOwnProperty(t)&&l[t].magic===e)return l[t];return null
}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),
this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},
processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value)
;this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),n=e.readInt(2),r=e.readData(n),
this.extraFields[t]={id:t,length:n,value:r};e.setIndex(i)},handleUTF8:function(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var n=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{
var s=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=r(e.value);return 1!==t.readInt(1)||o(this.fileName)!==t.readInt(4)?null:a.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=r(e.value);return 1!==t.readInt(1)||o(this.fileComment)!==t.readInt(4)?null:a.utf8decode(t.readData(e.length-5))}
return null}},t.exports=n},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t){"use strict";var n=e("./stream/StreamHelper"),r=e("./stream/DataWorker"),i=e("./utf8"),s=e("./compressedObject"),o=e("./stream/GenericWorker"),a=function(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,
this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}};a.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var s="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var a=!this._dataBinary;a&&!s&&(t=t.pipe(new i.Utf8EncodeWorker)),!a&&s&&(t=t.pipe(new i.Utf8DecodeWorker))}catch(e){(t=new o("error")).error(e)}
return new n(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new i.Utf8EncodeWorker)),s.createWorkerFrom(n,e,t)},_decompressWorker:function(){
return this._data instanceof s?this._data.getContentWorker():this._data instanceof o?this._data:new r(this._data)}};for(var l=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],c=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},A=0;A<l.length;A++)a.prototype[l[A]]=c;t.exports=a},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t){
(function(e){"use strict";function n(){var e,t;i=!0;for(var n=A.length;n;){for(t=A,A=[],e=-1;++e<n;)t[e]();n=A.length}i=!1}var r,i,s=e.MutationObserver||e.WebKitMutationObserver;if(s){var o=0,a=new s(n),l=e.document.createTextNode("");a.observe(l,{characterData:!0}),r=function(){l.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script")
;t.onreadystatechange=function(){n(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(n,0)};else{var c=new e.MessageChannel;c.port1.onmessage=n,r=function(){c.port2.postMessage(0)}}var A=[];t.exports=function(e){1!==A.push(e)||i||r()}}).call(this,void 0!==n?n:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t){"use strict";function n(){}function r(e){
if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,e!==n&&a(this,e)}function i(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function s(e,t,n){c((function(){var r;try{r=t(n)}catch(t){return A.reject(e,t)}
r===e?A.reject(e,new TypeError("Cannot resolve promise with itself")):A.resolve(e,r)}))}function o(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function a(e,t){function n(t){i||(i=!0,A.reject(e,t))}function r(t){i||(i=!0,A.resolve(e,t))}var i=!1,s=l((function(){t(r,n)}));"error"===s.status&&n(s.value)}function l(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}
var c=e("immediate"),A={},d=["REJECTED"],u=["FULFILLED"],p=["PENDING"];t.exports=r,r.prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){throw n}))}))},r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){if("function"!=typeof e&&this.state===u||"function"!=typeof t&&this.state===d)return this
;var r=new this.constructor(n);return this.state!==p?s(r,this.state===u?e:t,this.outcome):this.queue.push(new i(r,e,t)),r},i.prototype.callFulfilled=function(e){A.resolve(this.promise,e)},i.prototype.otherCallFulfilled=function(e){s(this.promise,this.onFulfilled,e)},i.prototype.callRejected=function(e){A.reject(this.promise,e)},i.prototype.otherCallRejected=function(e){s(this.promise,this.onRejected,e)},A.resolve=function(e,t){var n=l(o,t);if("error"===n.status)return A.reject(e,n.value)
;var r=n.value;if(r)a(e,r);else{e.state=u,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},A.reject=function(e,t){e.state=d,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},r.resolve=function(e){return e instanceof this?e:A.resolve(new this(n),e)},r.reject=function(e){var t=new this(n);return A.reject(t,e)},r.all=function(e){function t(e,t){r.resolve(e).then((function(e){o[t]=e,++a!==i||s||(s=!0,A.resolve(c,o))
}),(function(e){s||(s=!0,A.reject(c,e))}))}var r=this;if("[object Array]"!=={}.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,s=!1;if(!i)return this.resolve([]);for(var o=new Array(i),a=0,l=-1,c=new this(n);++l<i;)t(e[l],l);return c},r.race=function(e){var t=this;if("[object Array]"!=={}.toString.call(e))return this.reject(new TypeError("must be an array"));var r,i=e.length,s=!1;if(!i)return this.resolve([]);for(var o=-1,a=new this(n);++o<i;)r=e[o],
t.resolve(r).then((function(e){s||(s=!0,A.resolve(a,e))}),(function(e){s||(s=!0,A.reject(a,e))}));return a}},{immediate:36}],38:[function(e,t){"use strict";var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);this.options=o.assign({level:u,method:h,
chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=s.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==d)throw new Error(l[n]);if(t.header&&s.deflateSetHeader(this.strm,t.header),t.dictionary){var i
;if(i="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===A.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=s.deflateSetDictionary(this.strm,i))!==d)throw new Error(l[n]);this._dict_set=!0}}function i(e,t){var n=new r(t);if(n.push(e,!0),n.err)throw n.msg||l[n.err];return n.result}var s=e("./zlib/deflate"),o=e("./utils/common"),a=e("./utils/strings"),l=e("./zlib/messages"),c=e("./zlib/zstream"),A={}.toString,d=0,u=-1,p=0,h=8
;r.prototype.push=function(e,t){var n,r,i=this.strm,l=this.options.chunkSize;if(this.ended)return!1;r=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=a.string2buf(e):"[object ArrayBuffer]"===A.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new o.Buf8(l),i.next_out=0,i.avail_out=l),1!==(n=s.deflate(i,r))&&n!==d)return this.onEnd(n),this.ended=!0,!1
;0!==i.avail_out&&(0!==i.avail_in||4!==r&&2!==r)||("string"===this.options.to?this.onData(a.buf2binstring(o.shrinkBuf(i.output,i.next_out))):this.onData(o.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==n);return 4===r?(n=s.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===d):2!==r||(this.onEnd(d),i.avail_out=0,!0)},r.prototype.onData=function(e){this.chunks.push(e)},r.prototype.onEnd=function(e){
e===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=r,n.deflate=i,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,i(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,i(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e)
;this.options=o.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new A,this.strm.avail_out=0;var n=s.inflateInit2(this.strm,t.windowBits)
;if(n!==l.Z_OK)throw new Error(c[n]);this.header=new d,s.inflateGetHeader(this.strm,this.header)}function i(e,t){var n=new r(t);if(n.push(e,!0),n.err)throw n.msg||c[n.err];return n.result}var s=e("./zlib/inflate"),o=e("./utils/common"),a=e("./utils/strings"),l=e("./zlib/constants"),c=e("./zlib/messages"),A=e("./zlib/zstream"),d=e("./zlib/gzheader"),u={}.toString;r.prototype.push=function(e,t){var n,r,i,c,A,d,p=this.strm,h=this.options.chunkSize,f=this.options.dictionary,g=!1
;if(this.ended)return!1;r=t===~~t?t:!0===t?l.Z_FINISH:l.Z_NO_FLUSH,"string"==typeof e?p.input=a.binstring2buf(e):"[object ArrayBuffer]"===u.call(e)?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new o.Buf8(h),p.next_out=0,p.avail_out=h),(n=s.inflate(p,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&f&&(d="string"==typeof f?a.string2buf(f):"[object ArrayBuffer]"===u.call(f)?new Uint8Array(f):f,n=s.inflateSetDictionary(this.strm,d)),
n===l.Z_BUF_ERROR&&!0===g&&(n=l.Z_OK,g=!1),n!==l.Z_STREAM_END&&n!==l.Z_OK)return this.onEnd(n),this.ended=!0,!1;p.next_out&&(0!==p.avail_out&&n!==l.Z_STREAM_END&&(0!==p.avail_in||r!==l.Z_FINISH&&r!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(i=a.utf8border(p.output,p.next_out),c=p.next_out-i,A=a.buf2string(p.output,i),p.next_out=c,p.avail_out=h-c,c&&o.arraySet(p.output,p.output,i,c,0),this.onData(A)):this.onData(o.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(g=!0)
}while((p.avail_in>0||0===p.avail_out)&&n!==l.Z_STREAM_END);return n===l.Z_STREAM_END&&(r=l.Z_FINISH),r===l.Z_FINISH?(n=s.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l.Z_OK):r!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),p.avail_out=0,!0)},r.prototype.onData=function(e){this.chunks.push(e)},r.prototype.onEnd=function(e){e===l.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},
n.Inflate=r,n.inflate=i,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,i(e,t)},n.ungzip=i},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=[].slice.call(arguments,1);t.length;){var n=t.shift();if(n){
if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var s=0;s<r;s++)e[i+s]=t[n+s]},flattenChunks:function(e){var t,n,r,i,s,o;for(r=0,t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)s=e[t],
o.set(s,i),i+=s.length;return o}},s={arraySet:function(e,t,n,r,i){for(var s=0;s<r;s++)e[i+s]=t[n+s]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,s))},n.setTyped(r)},{}],42:[function(e,t,n){"use strict";function r(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(e,t))
;for(var n="",r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}var i=e("./common"),s=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new i.Buf8(256),l=0;l<256;l++)a[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;a[254]=a[254]=1,n.string2buf=function(e){var t,n,r,s,o,a=e.length,l=0
;for(s=0;s<a;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(r-56320),s++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new i.Buf8(l),o=0,s=0;o<l;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(r-56320),s++),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,
t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},n.buf2binstring=function(e){return r(e,e.length)},n.binstring2buf=function(e){for(var t=new i.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,i,s,o,l=t||e.length,c=new Array(2*l);for(i=0,n=0;n<l;)if((s=e[n++])<128)c[i++]=s;else if((o=a[s])>4)c[i++]=65533,n+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&n<l;)s=s<<6|63&e[n++],o--;o>1?c[i++]=65533:s<65536?c[i++]=s:(s-=65536,c[i++]=55296|s>>10&1023,
c[i++]=56320|1023&s)}return r(c,i)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e|0,s=e>>>16&65535|0,o=0;0!==n;){n-=o=n>2e3?2e3:n;do{s=s+(i=i+t[r++]|0)|0}while(--o);i%=65521,s%=65521}return i|s<<16|0}},{}],44:[function(e,t){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,
Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t){"use strict";var n=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}()
;t.exports=function(e,t,r,i){var s=n,o=i+r;e^=-1;for(var a=i;a<o;a++)e=e>>>8^s[255&(e^t[a])];return-1^e}},{}],46:[function(e,t,n){"use strict";function r(e,t){return e.msg=R[t],t}function i(e){return(e<<1)-(e>4?9:0)}function s(e){for(var t=e.length;--t>=0;)e[t]=0}function o(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(v.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,
0===t.pending&&(t.pending_out=0))}function a(e,t){w._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,o(e.strm)}function l(e,t){e.pending_buf[e.pending++]=t}function c(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function A(e,t){
var n,r,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-$?e.strstart-(e.w_size-$):0,c=e.window,A=e.w_mask,d=e.prev,u=e.strstart+K,p=c[s+o-1],h=c[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(n=t)+o]===h&&c[n+o-1]===p&&c[n]===c[s]&&c[++n]===c[s+1]){s+=2,n++;do{}while(c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&s<u);if(r=K-(u-s),
s=u-K,r>o){if(e.match_start=t,o=r,r>=a)break;p=c[s+o-1],h=c[s+o]}}}while((t=d[t&A])>l&&0!=--i);return o<=e.lookahead?o:e.lookahead}function d(e){var t,n,r,i,s,o,a,l,c,A,d=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-$)){v.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=d?r-d:0}while(--n);t=n=d;do{r=e.prev[--t],e.prev[t]=r>=d?r-d:0}while(--n);i+=d}if(0===e.strm.avail_in)break;if(o=e.strm,
a=e.window,l=e.strstart+e.lookahead,c=i,A=void 0,(A=o.avail_in)>c&&(A=c),n=0===A?0:(o.avail_in-=A,v.arraySet(a,o.input,o.next_in,A,l),1===o.state.wrap?o.adler=k(o.adler,a,A,l):2===o.state.wrap&&(o.adler=y(o.adler,a,A,l)),o.next_in+=A,o.total_in+=A,A),e.lookahead+=n,e.lookahead+e.insert>=q)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+q-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],
e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<q)););}while(e.lookahead<$&&0!==e.strm.avail_in)}function u(e,t){for(var n,r;;){if(e.lookahead<$){if(d(e),e.lookahead<$&&t===x)return le;if(0===e.lookahead)break}if(n=0,e.lookahead>=q&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+q-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-$&&(e.match_length=A(e,n)),
e.match_length>=q)if(r=w._tr_tally(e,e.strstart-e.match_start,e.match_length-q),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=q){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+q-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],
e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=w._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(a(e,!1),0===e.strm.avail_out))return le}return e.insert=e.strstart<q-1?e.strstart:q-1,t===I?(a(e,!0),0===e.strm.avail_out?Ae:de):e.last_lit&&(a(e,!1),0===e.strm.avail_out)?le:ce}function p(e,t){for(var n,r,i;;){if(e.lookahead<$){if(d(e),e.lookahead<$&&t===x)return le;if(0===e.lookahead)break}if(n=0,
e.lookahead>=q&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+q-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=q-1,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-$&&(e.match_length=A(e,n),e.match_length<=5&&(e.strategy===B||e.match_length===q&&e.strstart-e.match_start>4096)&&(e.match_length=q-1)),e.prev_length>=q&&e.match_length<=e.prev_length){
i=e.strstart+e.lookahead-q,r=w._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-q),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+q-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=q-1,e.strstart++,r&&(a(e,!1),0===e.strm.avail_out))return le}else if(e.match_available){
if((r=w._tr_tally(e,0,e.window[e.strstart-1]))&&a(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return le}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=w._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<q-1?e.strstart:q-1,t===I?(a(e,!0),0===e.strm.avail_out?Ae:de):e.last_lit&&(a(e,!1),0===e.strm.avail_out)?le:ce}function h(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}
function f(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=P,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,
this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new v.Buf16(2*W),this.dyn_dtree=new v.Buf16(2*(2*Y+1)),this.bl_tree=new v.Buf16(2*(2*X+1)),s(this.dyn_ltree),s(this.dyn_dtree),s(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new v.Buf16(J+1),this.heap=new v.Buf16(2*H+1),s(this.heap),this.heap_len=0,this.heap_max=0,
this.depth=new v.Buf16(2*H+1),s(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function g(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=L,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?te:oe,e.adler=2===t.wrap?0:1,t.last_flush=x,w._tr_init(t),G):r(e,T)}function m(e){var t,n=g(e)
;return n===G&&((t=e.state).window_size=2*t.w_size,s(t.head),t.max_lazy_match=b[t.level].max_lazy,t.good_match=b[t.level].good_length,t.nice_match=b[t.level].nice_length,t.max_chain_length=b[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=q-1,t.match_available=0,t.ins_h=0),n}function _(e,t,n,i,s,o){if(!e)return T;var a=1;if(t===U&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),s<1||s>z||n!==P||i<8||i>15||t<0||t>9||o<0||o>j)return r(e,T);8===i&&(i=9)
;var l=new f;return e.state=l,l.strm=e,l.wrap=a,l.gzhead=null,l.w_bits=i,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=s+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+q-1)/q),l.window=new v.Buf8(2*l.w_size),l.head=new v.Buf16(l.hash_size),l.prev=new v.Buf16(l.w_size),l.lit_bufsize=1<<s+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new v.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=o,l.method=n,m(e)
}var b,v=e("../utils/common"),w=e("./trees"),k=e("./adler32"),y=e("./crc32"),R=e("./messages"),x=0,C=1,E=3,I=4,M=5,G=0,Z=1,T=-2,N=-3,S=-5,U=-1,B=1,O=2,F=3,j=4,D=0,L=2,P=8,z=9,V=15,Q=8,H=286,Y=30,X=19,W=2*H+1,J=15,q=3,K=258,$=K+q+1,ee=32,te=42,ne=69,re=73,ie=91,se=103,oe=113,ae=666,le=1,ce=2,Ae=3,de=4,ue=3;b=[new h(0,0,0,0,(function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(d(e),0===e.lookahead&&t===x)return le;if(0===e.lookahead)break}
e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,a(e,!1),0===e.strm.avail_out))return le;if(e.strstart-e.block_start>=e.w_size-$&&(a(e,!1),0===e.strm.avail_out))return le}return e.insert=0,t===I?(a(e,!0),0===e.strm.avail_out?Ae:de):(e.strstart>e.block_start&&(a(e,!1),e.strm.avail_out),le)
})),new h(4,4,8,4,u),new h(4,5,16,8,u),new h(4,6,32,32,u),new h(4,4,16,16,p),new h(8,16,32,32,p),new h(8,16,128,128,p),new h(8,32,128,256,p),new h(32,128,258,1024,p),new h(32,258,258,4096,p)],n.deflateInit=function(e,t){return _(e,t,P,V,Q,D)},n.deflateInit2=_,n.deflateReset=m,n.deflateResetKeep=g,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?T:(e.state.gzhead=t,G):T},n.deflate=function(e,t){var n,A,u,p;if(!e||!e.state||t>M||t<0)return e?r(e,T):T;if(A=e.state,
!e.output||!e.input&&0!==e.avail_in||A.status===ae&&t!==I)return r(e,0===e.avail_out?S:T);if(A.strm=e,n=A.last_flush,A.last_flush=t,A.status===te)if(2===A.wrap)e.adler=0,l(A,31),l(A,139),l(A,8),A.gzhead?(l(A,(A.gzhead.text?1:0)+(A.gzhead.hcrc?2:0)+(A.gzhead.extra?4:0)+(A.gzhead.name?8:0)+(A.gzhead.comment?16:0)),l(A,255&A.gzhead.time),l(A,A.gzhead.time>>8&255),l(A,A.gzhead.time>>16&255),l(A,A.gzhead.time>>24&255),l(A,9===A.level?2:A.strategy>=O||A.level<2?4:0),l(A,255&A.gzhead.os),
A.gzhead.extra&&A.gzhead.extra.length&&(l(A,255&A.gzhead.extra.length),l(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(e.adler=y(e.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=ne):(l(A,0),l(A,0),l(A,0),l(A,0),l(A,0),l(A,9===A.level?2:A.strategy>=O||A.level<2?4:0),l(A,ue),A.status=oe);else{var h=P+(A.w_bits-8<<4)<<8;h|=(A.strategy>=O||A.level<2?0:A.level<6?1:6===A.level?2:3)<<6,0!==A.strstart&&(h|=ee),h+=31-h%31,A.status=oe,c(A,h),0!==A.strstart&&(c(A,e.adler>>>16),
c(A,65535&e.adler)),e.adler=1}if(A.status===ne)if(A.gzhead.extra){for(u=A.pending;A.gzindex<(65535&A.gzhead.extra.length)&&(A.pending!==A.pending_buf_size||(A.gzhead.hcrc&&A.pending>u&&(e.adler=y(e.adler,A.pending_buf,A.pending-u,u)),o(e),u=A.pending,A.pending!==A.pending_buf_size));)l(A,255&A.gzhead.extra[A.gzindex]),A.gzindex++;A.gzhead.hcrc&&A.pending>u&&(e.adler=y(e.adler,A.pending_buf,A.pending-u,u)),A.gzindex===A.gzhead.extra.length&&(A.gzindex=0,A.status=re)}else A.status=re
;if(A.status===re)if(A.gzhead.name){u=A.pending;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>u&&(e.adler=y(e.adler,A.pending_buf,A.pending-u,u)),o(e),u=A.pending,A.pending===A.pending_buf_size)){p=1;break}p=A.gzindex<A.gzhead.name.length?255&A.gzhead.name.charCodeAt(A.gzindex++):0,l(A,p)}while(0!==p);A.gzhead.hcrc&&A.pending>u&&(e.adler=y(e.adler,A.pending_buf,A.pending-u,u)),0===p&&(A.gzindex=0,A.status=ie)}else A.status=ie;if(A.status===ie)if(A.gzhead.comment){u=A.pending
;do{if(A.pending===A.pending_buf_size&&(A.gzhead.hcrc&&A.pending>u&&(e.adler=y(e.adler,A.pending_buf,A.pending-u,u)),o(e),u=A.pending,A.pending===A.pending_buf_size)){p=1;break}p=A.gzindex<A.gzhead.comment.length?255&A.gzhead.comment.charCodeAt(A.gzindex++):0,l(A,p)}while(0!==p);A.gzhead.hcrc&&A.pending>u&&(e.adler=y(e.adler,A.pending_buf,A.pending-u,u)),0===p&&(A.status=se)}else A.status=se;if(A.status===se&&(A.gzhead.hcrc?(A.pending+2>A.pending_buf_size&&o(e),
A.pending+2<=A.pending_buf_size&&(l(A,255&e.adler),l(A,e.adler>>8&255),e.adler=0,A.status=oe)):A.status=oe),0!==A.pending){if(o(e),0===e.avail_out)return A.last_flush=-1,G}else if(0===e.avail_in&&i(t)<=i(n)&&t!==I)return r(e,S);if(A.status===ae&&0!==e.avail_in)return r(e,S);if(0!==e.avail_in||0!==A.lookahead||t!==x&&A.status!==ae){var f=A.strategy===O?function(e,t){for(var n;;){if(0===e.lookahead&&(d(e),0===e.lookahead)){if(t===x)return le;break}if(e.match_length=0,
n=w._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(a(e,!1),0===e.strm.avail_out))return le}return e.insert=0,t===I?(a(e,!0),0===e.strm.avail_out?Ae:de):e.last_lit&&(a(e,!1),0===e.strm.avail_out)?le:ce}(A,t):A.strategy===F?function(e,t){for(var n,r,i,s,o=e.window;;){if(e.lookahead<=K){if(d(e),e.lookahead<=K&&t===x)return le;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=q&&e.strstart>0&&(r=o[i=e.strstart-1])===o[++i]&&r===o[++i]&&r===o[++i]){s=e.strstart+K
;do{}while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<s);e.match_length=K-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=q?(n=w._tr_tally(e,1,e.match_length-q),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=w._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(a(e,!1),0===e.strm.avail_out))return le}return e.insert=0,t===I?(a(e,!0),
0===e.strm.avail_out?Ae:de):e.last_lit&&(a(e,!1),0===e.strm.avail_out)?le:ce}(A,t):b[A.level].func(A,t);if(f!==Ae&&f!==de||(A.status=ae),f===le||f===Ae)return 0===e.avail_out&&(A.last_flush=-1),G;if(f===ce&&(t===C?w._tr_align(A):t!==M&&(w._tr_stored_block(A,0,0,!1),t===E&&(s(A.head),0===A.lookahead&&(A.strstart=0,A.block_start=0,A.insert=0))),o(e),0===e.avail_out))return A.last_flush=-1,G}return t!==I?G:A.wrap<=0?Z:(2===A.wrap?(l(A,255&e.adler),l(A,e.adler>>8&255),l(A,e.adler>>16&255),
l(A,e.adler>>24&255),l(A,255&e.total_in),l(A,e.total_in>>8&255),l(A,e.total_in>>16&255),l(A,e.total_in>>24&255)):(c(A,e.adler>>>16),c(A,65535&e.adler)),o(e),A.wrap>0&&(A.wrap=-A.wrap),0!==A.pending?G:Z)},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==te&&t!==ne&&t!==re&&t!==ie&&t!==se&&t!==oe&&t!==ae?r(e,T):(e.state=null,t===oe?r(e,N):G):T},n.deflateSetDictionary=function(e,t){var n,r,i,o,a,l,c,A,u=t.length;if(!e||!e.state)return T
;if(2===(o=(n=e.state).wrap)||1===o&&n.status!==te||n.lookahead)return T;for(1===o&&(e.adler=k(e.adler,t,u,0)),n.wrap=0,u>=n.w_size&&(0===o&&(s(n.head),n.strstart=0,n.block_start=0,n.insert=0),A=new v.Buf8(n.w_size),v.arraySet(A,t,u-n.w_size,n.w_size,0),t=A,u=n.w_size),a=e.avail_in,l=e.next_in,c=e.input,e.avail_in=u,e.next_in=0,e.input=t,d(n);n.lookahead>=q;){r=n.strstart,i=n.lookahead-(q-1);do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+q-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],
n.head[n.ins_h]=r,r++}while(--i);n.strstart=r,n.lookahead=q-1,d(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=q-1,n.match_available=0,e.next_in=l,e.input=c,e.avail_in=a,n.wrap=o,G},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,
this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t){"use strict";t.exports=function(e,t){var n,r,i,s,o,a,l,c,A,d,u,p,h,f,g,m,_,b,v,w,k,y,R,x,C;n=e.state,r=e.next_in,x=e.input,i=r+(e.avail_in-5),s=e.next_out,C=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),l=n.dmax,c=n.wsize,A=n.whave,d=n.wnext,u=n.window,p=n.hold,h=n.bits,f=n.lencode,g=n.distcode,m=(1<<n.lenbits)-1,_=(1<<n.distbits)-1;e:do{h<15&&(p+=x[r++]<<h,h+=8,p+=x[r++]<<h,h+=8),
b=f[p&m];t:for(;;){if(p>>>=v=b>>>24,h-=v,0==(v=b>>>16&255))C[s++]=65535&b;else{if(!(16&v)){if(0==(64&v)){b=f[(65535&b)+(p&(1<<v)-1)];continue t}if(32&v){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}w=65535&b,(v&=15)&&(h<v&&(p+=x[r++]<<h,h+=8),w+=p&(1<<v)-1,p>>>=v,h-=v),h<15&&(p+=x[r++]<<h,h+=8,p+=x[r++]<<h,h+=8),b=g[p&_];n:for(;;){if(p>>>=v=b>>>24,h-=v,!(16&(v=b>>>16&255))){if(0==(64&v)){b=g[(65535&b)+(p&(1<<v)-1)];continue n}e.msg="invalid distance code",n.mode=30
;break e}if(k=65535&b,h<(v&=15)&&(p+=x[r++]<<h,(h+=8)<v&&(p+=x[r++]<<h,h+=8)),(k+=p&(1<<v)-1)>l){e.msg="invalid distance too far back",n.mode=30;break e}if(p>>>=v,h-=v,k>(v=s-o)){if((v=k-v)>A&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(y=0,R=u,0===d){if(y+=c-v,v<w){w-=v;do{C[s++]=u[y++]}while(--v);y=s-k,R=C}}else if(d<v){if(y+=c+d-v,(v-=d)<w){w-=v;do{C[s++]=u[y++]}while(--v);if(y=0,d<w){w-=v=d;do{C[s++]=u[y++]}while(--v);y=s-k,R=C}}}else if(y+=d-v,v<w){w-=v;do{
C[s++]=u[y++]}while(--v);y=s-k,R=C}for(;w>2;)C[s++]=R[y++],C[s++]=R[y++],C[s++]=R[y++],w-=3;w&&(C[s++]=R[y++],w>1&&(C[s++]=R[y++]))}else{y=s-k;do{C[s++]=C[y++],C[s++]=C[y++],C[s++]=C[y++],w-=3}while(w>2);w&&(C[s++]=C[y++],w>1&&(C[s++]=C[y++]))}break}}break}}while(r<i&&s<a);r-=w=h>>3,p&=(1<<(h-=w<<3))-1,e.next_in=r,e.next_out=s,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=s<a?a-s+257:257-(s-a),n.hold=p,n.bits=h}},{}],49:[function(e,t,n){"use strict";function r(e){
return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new p.Buf16(320),
this.work=new p.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function s(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=T,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new p.Buf32(Ae),t.distcode=t.distdyn=new p.Buf32(de),t.sane=1,t.back=-1,R):E}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,s(e)):E}function a(e,t){var n,r
;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?E:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,o(e))):E}function l(e,t){var n,r;return e?(r=new i,e.state=r,r.window=null,(n=a(e,t))!==R&&(e.state=null),n):E}function c(e){if(pe){var t;for(d=new p.Buf32(512),u=new p.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(m(b,e.lens,0,288,d,0,e.work,{bits:9}),
t=0;t<32;)e.lens[t++]=5;m(v,e.lens,0,32,u,0,e.work,{bits:5}),pe=!1}e.lencode=d,e.lenbits=9,e.distcode=u,e.distbits=5}function A(e,t,n,r){var i,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new p.Buf8(s.wsize)),r>=s.wsize?(p.arraySet(s.window,t,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((i=s.wsize-s.wnext)>r&&(i=r),p.arraySet(s.window,t,n-r,i,s.wnext),(r-=i)?(p.arraySet(s.window,t,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,
s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0}var d,u,p=e("../utils/common"),h=e("./adler32"),f=e("./crc32"),g=e("./inffast"),m=e("./inftrees"),_=0,b=1,v=2,w=4,k=5,y=6,R=0,x=1,C=2,E=-2,I=-3,M=-4,G=-5,Z=8,T=1,N=2,S=3,U=4,B=5,O=6,F=7,j=8,D=9,L=10,P=11,z=12,V=13,Q=14,H=15,Y=16,X=17,W=18,J=19,q=20,K=21,$=22,ee=23,te=24,ne=25,re=26,ie=27,se=28,oe=29,ae=30,le=31,ce=32,Ae=852,de=592,ue=15,pe=!0;n.inflateReset=o,n.inflateReset2=a,n.inflateResetKeep=s,n.inflateInit=function(e){
return l(e,ue)},n.inflateInit2=l,n.inflate=function(e,t){var n,i,s,o,a,l,d,u,Ae,de,ue,pe,he,fe,ge,me,_e,be,ve,we,ke,ye,Re,xe,Ce=0,Ee=new p.Buf8(4),Ie=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return E;(n=e.state).mode===z&&(n.mode=V),a=e.next_out,s=e.output,d=e.avail_out,o=e.next_in,i=e.input,l=e.avail_in,u=n.hold,Ae=n.bits,de=l,ue=d,ye=R;e:for(;;)switch(n.mode){case T:if(0===n.wrap){n.mode=V;break}for(;Ae<16;){if(0===l)break e;l--,
u+=i[o++]<<Ae,Ae+=8}if(2&n.wrap&&35615===u){n.check=0,Ee[0]=255&u,Ee[1]=u>>>8&255,n.check=f(n.check,Ee,2,0),u=0,Ae=0,n.mode=N;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=ae;break}if((15&u)!==Z){e.msg="unknown compression method",n.mode=ae;break}if(Ae-=4,ke=8+(15&(u>>>=4)),0===n.wbits)n.wbits=ke;else if(ke>n.wbits){e.msg="invalid window size",n.mode=ae;break}n.dmax=1<<ke,e.adler=n.check=1,n.mode=512&u?L:z,u=0,Ae=0;break
;case N:for(;Ae<16;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}if(n.flags=u,(255&n.flags)!==Z){e.msg="unknown compression method",n.mode=ae;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=ae;break}n.head&&(n.head.text=u>>8&1),512&n.flags&&(Ee[0]=255&u,Ee[1]=u>>>8&255,n.check=f(n.check,Ee,2,0)),u=0,Ae=0,n.mode=S;case S:for(;Ae<32;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}n.head&&(n.head.time=u),512&n.flags&&(Ee[0]=255&u,Ee[1]=u>>>8&255,Ee[2]=u>>>16&255,Ee[3]=u>>>24&255,
n.check=f(n.check,Ee,4,0)),u=0,Ae=0,n.mode=U;case U:for(;Ae<16;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}n.head&&(n.head.xflags=255&u,n.head.os=u>>8),512&n.flags&&(Ee[0]=255&u,Ee[1]=u>>>8&255,n.check=f(n.check,Ee,2,0)),u=0,Ae=0,n.mode=B;case B:if(1024&n.flags){for(;Ae<16;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}n.length=u,n.head&&(n.head.extra_len=u),512&n.flags&&(Ee[0]=255&u,Ee[1]=u>>>8&255,n.check=f(n.check,Ee,2,0)),u=0,Ae=0}else n.head&&(n.head.extra=null);n.mode=O;case O:
if(1024&n.flags&&((pe=n.length)>l&&(pe=l),pe&&(n.head&&(ke=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),p.arraySet(n.head.extra,i,o,pe,ke)),512&n.flags&&(n.check=f(n.check,i,pe,o)),l-=pe,o+=pe,n.length-=pe),n.length))break e;n.length=0,n.mode=F;case F:if(2048&n.flags){if(0===l)break e;pe=0;do{ke=i[o+pe++],n.head&&ke&&n.length<65536&&(n.head.name+=String.fromCharCode(ke))}while(ke&&pe<l);if(512&n.flags&&(n.check=f(n.check,i,pe,o)),l-=pe,o+=pe,ke)break e
}else n.head&&(n.head.name=null);n.length=0,n.mode=j;case j:if(4096&n.flags){if(0===l)break e;pe=0;do{ke=i[o+pe++],n.head&&ke&&n.length<65536&&(n.head.comment+=String.fromCharCode(ke))}while(ke&&pe<l);if(512&n.flags&&(n.check=f(n.check,i,pe,o)),l-=pe,o+=pe,ke)break e}else n.head&&(n.head.comment=null);n.mode=D;case D:if(512&n.flags){for(;Ae<16;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}if(u!==(65535&n.check)){e.msg="header crc mismatch",n.mode=ae;break}u=0,Ae=0}n.head&&(n.head.hcrc=n.flags>>9&1,
n.head.done=!0),e.adler=n.check=0,n.mode=z;break;case L:for(;Ae<32;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}e.adler=n.check=r(u),u=0,Ae=0,n.mode=P;case P:if(0===n.havedict)return e.next_out=a,e.avail_out=d,e.next_in=o,e.avail_in=l,n.hold=u,n.bits=Ae,C;e.adler=n.check=1,n.mode=z;case z:if(t===k||t===y)break e;case V:if(n.last){u>>>=7&Ae,Ae-=7&Ae,n.mode=ie;break}for(;Ae<3;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}switch(n.last=1&u,Ae-=1,3&(u>>>=1)){case 0:n.mode=Q;break;case 1:if(c(n),n.mode=q,
t===y){u>>>=2,Ae-=2;break e}break;case 2:n.mode=X;break;case 3:e.msg="invalid block type",n.mode=ae}u>>>=2,Ae-=2;break;case Q:for(u>>>=7&Ae,Ae-=7&Ae;Ae<32;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=ae;break}if(n.length=65535&u,u=0,Ae=0,n.mode=H,t===y)break e;case H:n.mode=Y;case Y:if(pe=n.length){if(pe>l&&(pe=l),pe>d&&(pe=d),0===pe)break e;p.arraySet(s,i,o,pe,a),l-=pe,o+=pe,d-=pe,a+=pe,n.length-=pe;break}n.mode=z;break
;case X:for(;Ae<14;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}if(n.nlen=257+(31&u),u>>>=5,Ae-=5,n.ndist=1+(31&u),u>>>=5,Ae-=5,n.ncode=4+(15&u),u>>>=4,Ae-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=ae;break}n.have=0,n.mode=W;case W:for(;n.have<n.ncode;){for(;Ae<3;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}n.lens[Ie[n.have++]]=7&u,u>>>=3,Ae-=3}for(;n.have<19;)n.lens[Ie[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Re={bits:n.lenbits},
ye=m(_,n.lens,0,19,n.lencode,0,n.work,Re),n.lenbits=Re.bits,ye){e.msg="invalid code lengths set",n.mode=ae;break}n.have=0,n.mode=J;case J:for(;n.have<n.nlen+n.ndist;){for(;me=(Ce=n.lencode[u&(1<<n.lenbits)-1])>>>16&255,_e=65535&Ce,!((ge=Ce>>>24)<=Ae);){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}if(_e<16)u>>>=ge,Ae-=ge,n.lens[n.have++]=_e;else{if(16===_e){for(xe=ge+2;Ae<xe;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}if(u>>>=ge,Ae-=ge,0===n.have){e.msg="invalid bit length repeat",n.mode=ae;break}
ke=n.lens[n.have-1],pe=3+(3&u),u>>>=2,Ae-=2}else if(17===_e){for(xe=ge+3;Ae<xe;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}Ae-=ge,ke=0,pe=3+(7&(u>>>=ge)),u>>>=3,Ae-=3}else{for(xe=ge+7;Ae<xe;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}Ae-=ge,ke=0,pe=11+(127&(u>>>=ge)),u>>>=7,Ae-=7}if(n.have+pe>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=ae;break}for(;pe--;)n.lens[n.have++]=ke}}if(n.mode===ae)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=ae;break}
if(n.lenbits=9,Re={bits:n.lenbits},ye=m(b,n.lens,0,n.nlen,n.lencode,0,n.work,Re),n.lenbits=Re.bits,ye){e.msg="invalid literal/lengths set",n.mode=ae;break}if(n.distbits=6,n.distcode=n.distdyn,Re={bits:n.distbits},ye=m(v,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Re),n.distbits=Re.bits,ye){e.msg="invalid distances set",n.mode=ae;break}if(n.mode=q,t===y)break e;case q:n.mode=K;case K:if(l>=6&&d>=258){e.next_out=a,e.avail_out=d,e.next_in=o,e.avail_in=l,n.hold=u,n.bits=Ae,g(e,ue),a=e.next_out,
s=e.output,d=e.avail_out,o=e.next_in,i=e.input,l=e.avail_in,u=n.hold,Ae=n.bits,n.mode===z&&(n.back=-1);break}for(n.back=0;me=(Ce=n.lencode[u&(1<<n.lenbits)-1])>>>16&255,_e=65535&Ce,!((ge=Ce>>>24)<=Ae);){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}if(me&&0==(240&me)){for(be=ge,ve=me,we=_e;me=(Ce=n.lencode[we+((u&(1<<be+ve)-1)>>be)])>>>16&255,_e=65535&Ce,!(be+(ge=Ce>>>24)<=Ae);){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}u>>>=be,Ae-=be,n.back+=be}if(u>>>=ge,Ae-=ge,n.back+=ge,n.length=_e,0===me){
n.mode=re;break}if(32&me){n.back=-1,n.mode=z;break}if(64&me){e.msg="invalid literal/length code",n.mode=ae;break}n.extra=15&me,n.mode=$;case $:if(n.extra){for(xe=n.extra;Ae<xe;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,Ae-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=ee;case ee:for(;me=(Ce=n.distcode[u&(1<<n.distbits)-1])>>>16&255,_e=65535&Ce,!((ge=Ce>>>24)<=Ae);){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}if(0==(240&me)){for(be=ge,ve=me,
we=_e;me=(Ce=n.distcode[we+((u&(1<<be+ve)-1)>>be)])>>>16&255,_e=65535&Ce,!(be+(ge=Ce>>>24)<=Ae);){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}u>>>=be,Ae-=be,n.back+=be}if(u>>>=ge,Ae-=ge,n.back+=ge,64&me){e.msg="invalid distance code",n.mode=ae;break}n.offset=_e,n.extra=15&me,n.mode=te;case te:if(n.extra){for(xe=n.extra;Ae<xe;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,Ae-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",
n.mode=ae;break}n.mode=ne;case ne:if(0===d)break e;if(pe=ue-d,n.offset>pe){if((pe=n.offset-pe)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=ae;break}pe>n.wnext?(pe-=n.wnext,he=n.wsize-pe):he=n.wnext-pe,pe>n.length&&(pe=n.length),fe=n.window}else fe=s,he=a-n.offset,pe=n.length;pe>d&&(pe=d),d-=pe,n.length-=pe;do{s[a++]=fe[he++]}while(--pe);0===n.length&&(n.mode=K);break;case re:if(0===d)break e;s[a++]=n.length,d--,n.mode=K;break;case ie:if(n.wrap){for(;Ae<32;){if(0===l)break e
;l--,u|=i[o++]<<Ae,Ae+=8}if(ue-=d,e.total_out+=ue,n.total+=ue,ue&&(e.adler=n.check=n.flags?f(n.check,s,ue,a-ue):h(n.check,s,ue,a-ue)),ue=d,(n.flags?u:r(u))!==n.check){e.msg="incorrect data check",n.mode=ae;break}u=0,Ae=0}n.mode=se;case se:if(n.wrap&&n.flags){for(;Ae<32;){if(0===l)break e;l--,u+=i[o++]<<Ae,Ae+=8}if(u!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=ae;break}u=0,Ae=0}n.mode=oe;case oe:ye=x;break e;case ae:ye=I;break e;case le:return M;case ce:default:return E}
return e.next_out=a,e.avail_out=d,e.next_in=o,e.avail_in=l,n.hold=u,n.bits=Ae,(n.wsize||ue!==e.avail_out&&n.mode<ae&&(n.mode<ie||t!==w))&&A(e,e.output,e.next_out,ue-e.avail_out)?(n.mode=le,M):(de-=e.avail_in,ue-=e.avail_out,e.total_in+=de,e.total_out+=ue,n.total+=ue,n.wrap&&ue&&(e.adler=n.check=n.flags?f(n.check,s,ue,e.next_out-ue):h(n.check,s,ue,e.next_out-ue)),e.data_type=n.bits+(n.last?64:0)+(n.mode===z?128:0)+(n.mode===q||n.mode===H?256:0),(0===de&&0===ue||t===w)&&ye===R&&(ye=G),ye)},
n.inflateEnd=function(e){if(!e||!e.state)return E;var t=e.state;return t.window&&(t.window=null),e.state=null,R},n.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?E:(n.head=t,t.done=!1,R):E},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&n.mode!==P?E:n.mode===P&&h(1,t,r,0)!==n.check?I:A(e,t,r,r)?(n.mode=le,M):(n.havedict=1,R):E},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,
"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t){"use strict"
;var n=e("../utils/common"),r=15,i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,l,c,A,d,u,p){
var h,f,g,m,_,b,v,w,k,y=p.bits,R=0,x=0,C=0,E=0,I=0,M=0,G=0,Z=0,T=0,N=0,S=null,U=0,B=new n.Buf16(16),O=new n.Buf16(16),F=null,j=0;for(R=0;R<=r;R++)B[R]=0;for(x=0;x<c;x++)B[t[l+x]]++;for(I=y,E=r;E>=1&&0===B[E];E--);if(I>E&&(I=E),0===E)return A[d++]=20971520,A[d++]=20971520,p.bits=1,0;for(C=1;C<E&&0===B[C];C++);for(I<C&&(I=C),Z=1,R=1;R<=r;R++)if(Z<<=1,(Z-=B[R])<0)return-1;if(Z>0&&(0===e||1!==E))return-1;for(O[1]=0,R=1;R<r;R++)O[R+1]=O[R]+B[R];for(x=0;x<c;x++)0!==t[l+x]&&(u[O[t[l+x]]++]=x)
;if(0===e?(S=F=u,b=19):1===e?(S=i,U-=257,F=s,j-=257,b=256):(S=o,F=a,b=-1),N=0,x=0,R=C,_=d,M=I,G=0,g=-1,m=(T=1<<I)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){v=R-G,u[x]<b?(w=0,k=u[x]):u[x]>b?(w=F[j+u[x]],k=S[U+u[x]]):(w=96,k=0),h=1<<R-G,C=f=1<<M;do{A[_+(N>>G)+(f-=h)]=v<<24|w<<16|k|0}while(0!==f);for(h=1<<R-1;N&h;)h>>=1;if(0!==h?(N&=h-1,N+=h):N=0,x++,0==--B[R]){if(R===E)break;R=t[l+u[x]]}if(R>I&&(N&m)!==g){for(0===G&&(G=I),_+=C,Z=1<<(M=R-G);M+G<E&&!((Z-=B[M+G])<=0);)M++,Z<<=1;if(T+=1<<M,
1===e&&T>852||2===e&&T>592)return 1;A[g=N&m]=I<<24|M<<16|_-d|0}}return 0!==N&&(A[_+N]=R-G<<24|64<<16|0),p.bits=I,0}},{"../utils/common":41}],51:[function(e,t){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){"use strict";function r(e){for(var t=e.length;--t>=0;)e[t]=0}function i(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,
this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function s(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function o(e){return e<256?X[e]:X[256+(e>>>7)]}function a(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function l(e,t,n){e.bi_valid>B-n?(e.bi_buf|=t<<e.bi_valid&65535,a(e,e.bi_buf),e.bi_buf=t>>B-e.bi_valid,e.bi_valid+=n-B):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function c(e,t,n){l(e,n[2*t],n[2*t+1])}function A(e,t){
var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}function d(e,t,n){var r,i,s=new Array(U+1),o=0;for(r=1;r<=U;r++)s[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=A(s[a]++,a))}}function u(e){var t;for(t=0;t<Z;t++)e.dyn_ltree[2*t]=0;for(t=0;t<T;t++)e.dyn_dtree[2*t]=0;for(t=0;t<N;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*F]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function p(e){e.bi_valid>8?a(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,
e.bi_valid=0}function h(e,t,n,r){var i=2*t,s=2*n;return e[i]<e[s]||e[i]===e[s]&&r[t]<=r[n]}function f(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&h(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!h(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function g(e,t,n){var r,i,s,a,A=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*A]<<8|e.pending_buf[e.d_buf+2*A+1],i=e.pending_buf[e.l_buf+A],A++,0===r?c(e,i,t):(c(e,(s=W[i])+G+1,t),0!==(a=P[s])&&l(e,i-=J[s],a),
c(e,s=o(--r),n),0!==(a=z[s])&&l(e,r-=ee[s],a))}while(A<e.last_lit);c(e,F,t)}function m(e,t){var n,r,i,s=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=S,n=0;n<l;n++)0!==s[2*n]?(e.heap[++e.heap_len]=c=n,e.depth[n]=0):s[2*n+1]=0;for(;e.heap_len<2;)s[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,a&&(e.static_len-=o[2*i+1]);for(t.max_code=c,n=e.heap_len>>1;n>=1;n--)f(e,s,n);i=l;do{n=e.heap[1],
e.heap[1]=e.heap[e.heap_len--],f(e,s,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,s[2*i]=s[2*n]+s[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,s[2*n+1]=s[2*r+1]=i,e.heap[1]=i++,f(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,s,o,a,l=t.dyn_tree,c=t.max_code,A=t.stat_desc.static_tree,d=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,h=t.stat_desc.max_length,f=0;for(s=0;s<=U;s++)e.bl_count[s]=0
;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<S;n++)(s=l[2*l[2*(r=e.heap[n])+1]+1]+1)>h&&(s=h,f++),l[2*r+1]=s,r>c||(e.bl_count[s]++,o=0,r>=p&&(o=u[r-p]),a=l[2*r],e.opt_len+=a*(s+o),d&&(e.static_len+=a*(A[2*r+1]+o)));if(0!==f){do{for(s=h-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[h]--,f-=2}while(f>0);for(s=h;0!==s;s--)for(r=e.bl_count[s];0!==r;)(i=e.heap[--n])>c||(l[2*i+1]!==s&&(e.opt_len+=(s-l[2*i+1])*l[2*i],l[2*i+1]=s),r--)}}(e,t),d(s,c,e.bl_count)}
function _(e,t,n){var r,i,s=-1,o=t[1],a=0,l=7,c=4;for(0===o&&(l=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=t[2*(r+1)+1],++a<l&&i===o||(a<c?e.bl_tree[2*i]+=a:0!==i?(i!==s&&e.bl_tree[2*i]++,e.bl_tree[2*j]++):a<=10?e.bl_tree[2*D]++:e.bl_tree[2*L]++,a=0,s=i,0===o?(l=138,c=3):i===o?(l=6,c=3):(l=7,c=4))}function b(e,t,n){var r,i,s=-1,o=t[1],a=0,A=7,d=4;for(0===o&&(A=138,d=3),r=0;r<=n;r++)if(i=o,o=t[2*(r+1)+1],!(++a<A&&i===o)){if(a<d)do{c(e,i,e.bl_tree)
}while(0!=--a);else 0!==i?(i!==s&&(c(e,i,e.bl_tree),a--),c(e,j,e.bl_tree),l(e,a-3,2)):a<=10?(c(e,D,e.bl_tree),l(e,a-3,3)):(c(e,L,e.bl_tree),l(e,a-11,7));a=0,s=i,0===o?(A=138,d=3):i===o?(A=6,d=3):(A=7,d=4)}}function v(e,t,n,r){l(e,(C<<1)+(r?1:0),3),function(e,t,n,r){p(e),r&&(a(e,n),a(e,~n)),w.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}
var w=e("../utils/common"),k=4,y=0,R=1,x=2,C=0,E=1,I=2,M=29,G=256,Z=G+1+M,T=30,N=19,S=2*Z+1,U=15,B=16,O=7,F=256,j=16,D=17,L=18,P=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],z=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],V=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],H=new Array(2*(Z+2));r(H);var Y=new Array(2*T);r(Y);var X=new Array(512);r(X);var W=new Array(256);r(W);var J=new Array(M);r(J)
;var q,K,$,ee=new Array(T);r(ee);var te=!1;n._tr_init=function(e){te||(function(){var e,t,n,r,s,o=new Array(U+1);for(n=0,r=0;r<M-1;r++)for(J[r]=n,e=0;e<1<<P[r];e++)W[n++]=r;for(W[n-1]=r,s=0,r=0;r<16;r++)for(ee[r]=s,e=0;e<1<<z[r];e++)X[s++]=r;for(s>>=7;r<T;r++)for(ee[r]=s<<7,e=0;e<1<<z[r]-7;e++)X[256+s++]=r;for(t=0;t<=U;t++)o[t]=0;for(e=0;e<=143;)H[2*e+1]=8,e++,o[8]++;for(;e<=255;)H[2*e+1]=9,e++,o[9]++;for(;e<=279;)H[2*e+1]=7,e++,o[7]++;for(;e<=287;)H[2*e+1]=8,e++,o[8]++;for(d(H,Z+1,o),
e=0;e<T;e++)Y[2*e+1]=5,Y[2*e]=A(e,5);q=new i(H,P,G+1,Z,U),K=new i(Y,z,0,T,U),$=new i(new Array(0),V,0,N,O)}(),te=!0),e.l_desc=new s(e.dyn_ltree,q),e.d_desc=new s(e.dyn_dtree,K),e.bl_desc=new s(e.bl_tree,$),e.bi_buf=0,e.bi_valid=0,u(e)},n._tr_stored_block=v,n._tr_flush_block=function(e,t,n,r){var i,s,o=0;e.level>0?(e.strm.data_type===x&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return y
;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return R;for(t=32;t<G;t++)if(0!==e.dyn_ltree[2*t])return R;return y}(e)),m(e,e.l_desc),m(e,e.d_desc),o=function(e){var t;for(_(e,e.dyn_ltree,e.l_desc.max_code),_(e,e.dyn_dtree,e.d_desc.max_code),m(e,e.bl_desc),t=N-1;t>=3&&0===e.bl_tree[2*Q[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==t?v(e,t,n,r):e.strategy===k||s===i?(l(e,(E<<1)+(r?1:0),3),
g(e,H,Y)):(l(e,(I<<1)+(r?1:0),3),function(e,t,n,r){var i;for(l(e,t-257,5),l(e,n-1,5),l(e,r-4,4),i=0;i<r;i++)l(e,e.bl_tree[2*Q[i]+1],3);b(e,e.dyn_ltree,t-1),b(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),g(e,e.dyn_ltree,e.dyn_dtree)),u(e),r&&p(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,
e.dyn_ltree[2*(W[n]+G+1)]++,e.dyn_dtree[2*o(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){l(e,E<<1,3),c(e,F,H),function(e){16===e.bi_valid?(a(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,
this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t){"use strict";t.exports="function"==typeof r?r:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)}).call(this,n(34).Buffer,n(20),n(38).setImmediate)},function(e,t,n){"use strict";(function(e){function r(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(r()<t)throw new RangeError("Invalid typed array length")
;return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=s.prototype:(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,n){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return o(this,e,t,n)}function o(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number')
;return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),s.TYPED_ARRAY_SUPPORT?(e=t).__proto__=s.prototype:e=c(e,t),e}(e,t,n,r):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),
!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(t,n),o=(e=i(e,r)).write(t,n);return o!==r&&(e=e.slice(0,o)),e}(e,t,n):function(e,t){if(s.isBuffer(t)){var n=0|A(t.length);return 0===(e=i(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?i(e,0):c(e,t);if("Buffer"===t.type&&D(t.data))return c(e,t.data)}var r
;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(a(t),e=i(e,t<0?0:0|A(t)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function c(e,t){var n=t.length<0?0:0|A(t.length);e=i(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function A(e){
if(e>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function d(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:
return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(e).length;default:if(r)return U(e).length;t=(""+t).toLowerCase(),r=!0}}function u(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return y(this,t,n);case"ascii":return R(this,t,n)
;case"latin1":case"binary":return x(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function p(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function h(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1
;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:f(e,t,n,r,i);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):f(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function f(e,t,n,r,i){function s(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}
var o,a=1,l=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,l/=2,c/=2,n/=2}if(i){var A=-1;for(o=n;o<l;o++)if(s(e,o)===s(t,-1===A?0:o-A)){if(-1===A&&(A=o),o-A+1===c)return A*a}else-1!==A&&(o-=o-A),A=-1}else for(n+c>l&&(n=l-c),o=n;o>=0;o--){for(var d=!0,u=0;u<c;u++)if(s(e,o+u)!==s(t,u)){d=!1;break}if(d)return o}return-1}function g(e,t,n,r){n=Number(n)||0;var i=e.length-n
;r?(r=Number(r))>i&&(r=i):r=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o<r;++o){var a=parseInt(t.substr(2*o,2),16);if(isNaN(a))return o;e[n+o]=a}return o}function m(e,t,n,r){return O(U(t,e.length-n),e,n,r)}function _(e,t,n,r){return O(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function b(e,t,n,r){return _(e,t,n,r)}function v(e,t,n,r){return O(B(t),e,n,r)}function w(e,t,n,r){
return O(function(e,t){for(var n,r,i,s=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i=n%256,s.push(i),s.push(r);return s}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?F.fromByteArray(e):F.fromByteArray(e.slice(t,n))}function y(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var s,o,a,l,c=e[i],A=null,d=c>239?4:c>223?3:c>191?2:1;if(i+d<=n)switch(d){case 1:c<128&&(A=c);break;case 2:128==(192&(s=e[i+1]))&&(l=(31&c)<<6|63&s)>127&&(A=l);break;case 3:s=e[i+1],
o=e[i+2],128==(192&s)&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(A=l);break;case 4:s=e[i+1],o=e[i+2],a=e[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(A=l)}null===A?(A=65533,d=1):A>65535&&(A-=65536,r.push(A>>>10&1023|55296),A=56320|1023&A),r.push(A),i+=d}return function(e){var t=e.length;if(t<=L)return String.fromCharCode.apply(String,e)
;for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=L));return n}(r)}function R(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function x(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function C(e,t,n){var r,i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var s="",o=t;o<n;++o)s+=(r=e[o])<16?"0"+r.toString(16):r.toString(16);return s}function E(e,t,n){
for(var r=e.slice(t,n),i="",s=0;s<r.length;s+=2)i+=String.fromCharCode(r[s]+256*r[s+1]);return i}function I(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}
function G(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(e.length-n,2);i<s;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Z(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(e.length-n,4);i<s;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function T(e,t,n,r){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,i){return i||T(e,0,n,4),j.write(e,t,n,r,23,4),n+4}function S(e,t,n,r,i){return i||T(e,0,n,8),
j.write(e,t,n,r,52,8),n+8}function U(e,t){var n;t=t||1/0;for(var r=e.length,i=null,s=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)
}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function B(e){return F.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <http://feross.org>
 * @license  MIT
 */
var F=n(35),j=n(36),D=n(37);t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},
s.from=function(e,t,n){return o(null,e,t,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,n){return function(e,t,n,r){return a(t),t<=0?i(e,t):void 0!==n?"string"==typeof r?i(e,t).fill(n,r):i(e,t).fill(n):i(e,t)}(null,e,t,n)},s.allocUnsafe=function(e){return l(null,e)},
s.allocUnsafeSlow=function(e){return l(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":
case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!D(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},s.byteLength=d,s.prototype._isBuffer=!0,
s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)p(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits")
;for(var t=0;t<e;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},s.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?y(this,0,e):u.apply(this,arguments)},s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),
this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},s.prototype.compare=function(e,t,n,r,i){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0
;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),l=Math.min(o,a),c=this.slice(r,i),A=e.slice(t,n),d=0;d<l;++d)if(c[d]!==A[d]){o=c[d],a=A[d];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},s.prototype.indexOf=function(e,t,n){return h(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return h(this,e,t,n,!1)},s.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,
t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return m(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":
return b(this,e,t,n);case"base64":return v(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:[].slice.call(this._arr||this,0)}};var L=4096;s.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),
s.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=s.prototype;else{var i=t-e;n=new s(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},s.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],i=1,s=0;++s<t&&(i*=256);)r+=this[e+s]*i;return r},s.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},
s.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length)
;for(var r=this[e],i=1,s=0;++s<t&&(i*=256);)r+=this[e+s]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=t,i=1,s=this[e+--r];r>0&&(i*=256);)s+=this[e+--r]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},s.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n
},s.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),j.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){
return t||I(e,4,this.length),j.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),j.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),j.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,s=0;for(this[t]=255&e;++s<n&&(i*=256);)this[t+s]=e/i&255;return t+n},s.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,
r||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):G(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),
s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):G(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Z(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},
s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s<n&&(o*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var s=n-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+n},s.prototype.writeInt8=function(e,t,n){
return e=+e,t|=0,n||M(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):G(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):G(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,
t|=0,n||M(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Z(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){
return N(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return S(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return S(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds")
;if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},s.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){
var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=s.isBuffer(e)?e:U(new s(e,r).toString()),l=a.length
;for(o=0;o<n-t;++o)this[o+t]=a[o%l]}return this};var P=/[^+\/0-9A-Za-z-_]/g}).call(this,n(20))},function(e,t){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function r(e,t,n){for(var r,s,o=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(i[(s=r)>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}t.byteLength=function(e){
var t=n(e),r=t[0],i=t[1];return 3*(r+i)/4-i},t.toByteArray=function(e){var t,r,i=n(e),a=i[0],l=i[1],c=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,l)),A=0,d=l>0?a-4:a;for(r=0;r<d;r+=4)t=s[e.charCodeAt(r)]<<18|s[e.charCodeAt(r+1)]<<12|s[e.charCodeAt(r+2)]<<6|s[e.charCodeAt(r+3)],c[A++]=t>>16&255,c[A++]=t>>8&255,c[A++]=255&t;return 2===l&&(t=s[e.charCodeAt(r)]<<2|s[e.charCodeAt(r+1)]>>4,c[A++]=255&t),1===l&&(t=s[e.charCodeAt(r)]<<10|s[e.charCodeAt(r+1)]<<4|s[e.charCodeAt(r+2)]>>2,c[A++]=t>>8&255,
c[A++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,s=n%3,o=[],a=16383,l=0,c=n-s;l<c;l+=a)o.push(r(e,l,l+a>c?c:l+a));return 1===s?(t=e[n-1],o.push(i[t>>2]+i[t<<4&63]+"==")):2===s&&(t=(e[n-2]<<8)+e[n-1],o.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"=")),o.join("")};for(var i=[],s=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,c=a.length;l<c;++l)i[l]=a[l],s[a.charCodeAt(l)]=l;s["-".charCodeAt(0)]=62,
s["_".charCodeAt(0)]=63},function(e,t){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.read=function(e,t,n,r,i){var s,o,a=8*i-r-1,l=(1<<a)-1,c=l>>1,A=-7,d=n?i-1:0,u=n?-1:1,p=e[t+d];for(d+=u,s=p&(1<<-A)-1,p>>=-A,A+=a;A>0;s=256*s+e[t+d],d+=u,A-=8);for(o=s&(1<<-A)-1,s>>=-A,A+=r;A>0;o=256*o+e[t+d],d+=u,A-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),s-=c}return(p?-1:1)*o*Math.pow(2,s-r)},t.write=function(e,t,n,r,i,s){var o,a,l,c=8*s-i-1,A=(1<<c)-1,d=A>>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,h=r?1:-1,f=t<0||0===t&&1/t<0?1:0
;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=A):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+d>=1?u/l:u*Math.pow(2,1-d))*l>=2&&(o++,l/=2),o+d>=A?(a=0,o=A):o+d>=1?(a=(t*l-1)*Math.pow(2,i),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+p]=255&a,p+=h,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[n+p]=255&o,p+=h,o/=256,c-=8);e[n+p-h]|=128*f}},function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}
},function(e,t,n){(function(e){function r(e,t){this._id=e,this._clearFn=t}var i=void 0!==e&&e||"undefined"!=typeof self&&self||window,s=function(){}.apply;t.setTimeout=function(){return new r(s.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new r(s.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},
t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(39),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,
t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(20))},function(e,t,n){(function(e,t){!function(e){"use strict";function n(e){delete A[e]}function r(e){if(d)setTimeout(r,0,e);else{var t=A[e];if(t){d=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{n(e),d=!1}}}}
if(!e.setImmediate){var i,s,o,a,l,c=1,A={},d=!1,u=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick((function(){r(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",l=function(t){
t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&r(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",l,!1):e.attachEvent("onmessage",l),i=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){r(e.data)},i=function(e){o.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(s=u.documentElement,i=function(e){var t=u.createElement("script");t.onreadystatechange=function(){r(e),
t.onreadystatechange=null,s.removeChild(t),t=null},s.appendChild(t)}):i=function(e){setTimeout(r,0,e)},p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return A[c]=r,i(c),c++},p.clearImmediate=n}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(20),n(40))},function(e){function t(){throw new Error("setTimeout has not been defined")}function n(){
throw new Error("clearTimeout has not been defined")}function r(e){if(l===setTimeout)return setTimeout(e,0);if((l===t||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(){p&&d&&(p=!1,d.length?u=d.concat(u):h=-1,u.length&&s())}function s(){if(!p){var e=r(i);p=!0;for(var t=u.length;t;){for(d=u,u=[];++h<t;)d&&d[h].run();h=-1,t=u.length}d=null,p=!1,function(e){
if(c===clearTimeout)return clearTimeout(e);if((c===n||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(e);try{c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}(e)}}function o(e,t){this.fun=e,this.array=t}function a(){}var l,c,A=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:t}catch(e){l=t}try{c="function"==typeof clearTimeout?clearTimeout:n}catch(e){c=n}}();var d,u=[],p=!1,h=-1;A.nextTick=function(e){var t=new Array(arguments.length-1)
;if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new o(e,t)),1!==u.length||p||r(s)},o.prototype.run=function(){this.fun.apply(null,this.array)},A.title="browser",A.browser=!0,A.env={},A.argv=[],A.version="",A.versions={},A.on=a,A.addListener=a,A.once=a,A.off=a,A.removeListener=a,A.removeAllListeners=a,A.emit=a,A.prependListener=a,A.prependOnceListener=a,A.listeners=function(){return[]},A.binding=function(){throw new Error("process.binding is not supported")},
A.cwd=function(){return"/"},A.chdir=function(){throw new Error("process.chdir is not supported")},A.umask=function(){return 0}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t),n(22);var r=n(3);const i=(e,t,n,i,s,o)=>{let a;try{let l=e+"_"+Object(r.createUniqueId)(n,i);if(null!=s&&(l+="_"+s),a=document.getElementById(l),a&&o){const t=document.createElement(e);t.setAttribute("id",l);const n=a.parentNode;n.insertBefore(t,a),n.removeChild(a),a=t
}else a?a.inserted=!0:(a=document.createElement(e),a.setAttribute("id",l));t&&a.setAttribute("class",t),a.__removeChild||(a.__removeChild=a.removeChild,a.removeChild=e=>{delete e.inserted,a.__removeChild(e)}),a.__appendChild||(a.__appendChild=a.appendChild,a.appendChild=(e,t)=>{"Array"!==Object(r.toType)(e)&&(e=[e]),e.forEach(e=>{(!e.parentElement&&!e.inserted||t)&&a.__appendChild(e)})}),a.__insertBefore||(a.__insertBefore=a.insertBefore,a.insertBefore=(e,t)=>{
e.parentElement||e.inserted||a.__insertBefore(e,t)})}catch(e){console.log("options: Error:"+e.message)}return a},s=(e,t,n,r,s)=>i(e,null,t,n,r,s);var o=n(0);let a=null,l=null;const c=(e,t)=>{t||(t={});const n="ct",r="0",o=s("div",n,r,"p"),a=i("div","curbg",n,r,"c"),l=i("div",t.fixed?"curmiddle_fixed":"curmiddle_relative",n,r,"d");o.inserted||(o.setAttribute("class","curouter hide"),o.setAttribute("style","z-index: 10000"));const c=((e,t,n,r)=>{r||(r="")
;const s=i("table","curtable",t,n,"table"+r),o=i("tr","",t,n,"tr2"+r),a=i("td","curtableoutertd",t,n,"td1"+r),l=i("td","curtableinner",t,n,"td2"+r),c=i("td","curtableoutertd",t,n,"td3"+r);return o.appendChild(a),o.appendChild(l),o.appendChild(c),s.appendChild(o),e&&l.appendChild(e),s})(e,n,r);return l.appendChild(c),o.appendChild(l),o.appendChild(a),o.show=()=>{o.setAttribute("class","curouter block")},o.hide=()=>{o.setAttribute("class","curouter hide")},o.remove=()=>{
o.parentNode&&o.parentNode.removeChild(o)},o.setText=e=>{o.text=e},o.print=e=>{o.text&&(o.text.textContent=e)},document.body.appendChild(o),o},A=()=>{const e=document.createElement("div");e.setAttribute("class","curcontainer");const t=document.createElement("div");t.setAttribute("class","curwaithead");const n=document.createElement("div");return n.setAttribute("class","curwaitmsg"),e.appendChild(t),e.appendChild(n),{outer:e,inner:n}};var d=e=>{if(document.body){
if(void 0===e&&(e=o.I18N.getMessage("Please_wait___")),null===l){a&&(a.remove(),a=null),l=0;const t=(e=>{const t=A(),n=t.inner,r=document.createElement("div");return r.textContent=e,r.setAttribute("class","curtext"),$(n).append($('<div class="lds-css ng-scope"><div class="lds-dual-ring"><div></div><div></div></div></div>')).append(r),{all:t.outer,text:r}})(e);return a=c(t.all,{fixed:!0}),a.setText(t.text),a.show(),!0}return 0===l&&(void 0===e&&(e=o.I18N.getMessage("Please_wait___")),
a)?(e&&a.print(e),a.show(),!0):void 0}},u=()=>{0===l&&(a&&a.hide(),l=null)},p=e=>{if(!document.body)return;if(1===l)return!1;if(null!==l)return;a&&(a.remove(),a=null),l=1;const t=A();return t.inner.appendChild(e),a=c(t.outer),a.show(),!0},h=()=>{1===l&&(a&&a.hide(),l=null)},f=n(9),g=n(1),m=n(12),_=n.n(m),b=n(4),v=n(13),w=n(6),k=n.n(w),y=n(17),R=n.n(y),x=n(19),C=n(7),E=n(15),I=n.n(E),M=n(10),G=n(11),Z=n(14),T={images:{origin:f.a.images.origin,brand:f.a.images.brand,get:function(e){return{
about:"info-circle blue",bug:"bug",button_ok:"check green",cancel:"times red",check:"badge-check",clock:"clock green",cloud:"cloud",critical:"exclamation-triangle orange",contrib:"heart",db:"database grey",delete:"trash-alt",download:"spinner rotate",edit:"edit",edit_add:"plus-square",editor_cancel:"undo",enabler:"angle-right",enabler_enabled:"angle-down",error:"bell red",exit:"times",filesave:"save",filter:"filter",flag:"flag",encrypted:"lock orange",save_to_disk:"download",
help:"question-square",home:"home",import:"upload",info:"info-square",no_script:"info",lock:"cog",menu_cmd:"cogs",no:"minus-circle red",no_domain:"thumbs-down red",question_mark:"question-circle",resources:"cloud cyan",script_add:"plus-square",script_cancel:"industry-alt",script_download:"file-code cyan",script_search:"search",update:"sync",utilities:"cog",web:"globe blue",windowlist:"window-restore grey",yes_domain:"thumbs-up green"}[e]||""}},formatBytes:(e,t)=>{if(0==e)return"0 Byte"
;const n=t||3,r=Math.floor(Math.log(e)/Math.log(1e3));return parseFloat((e/Math.pow(1e3,r)).toFixed(n))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}};const N=T.images,S=(e,t,n,r)=>{const i=(r.uuid?r.uuid:"")+r.id;t.title=e;const s=j({after:{image:"help"},name:r.name,id:i});s&&n.appendChild(s)},U=(e,t,n,r,s,o)=>{const a=i("i","far fa-"+e,t,n,r,!0);if(s&&(a.title=s),a.key=n,a.name=t,o){const e=a.getAttribute("class")||"";a.setAttribute("class",e+" clickable"),
a.addEventListener("click",o),a.href="#"}return a},B=(e,t,n)=>{const r=(t.uuid?t.uuid:"")+t.id,o=s("div",t.name,r,"input");o.key=t.id;const a=s("input",t.name,r,"input",!0),l=e.split("##");a.name=t.name,a.uuid=t.uuid,a.key=t.id,a.oldvalue=t.value,a.value=null!=t.value?t.value:"",a.type=t.password?"password":"text",a.setAttribute("spellcheck","false"),t.placeholder&&a.setAttribute("placeholder",t.placeholder),n&&!a.inserted&&a.addEventListener("change",n)
;const c=i("span","optiondesc",t.name,r,"s1"),A=s("span",t.name,r,"s2");return c.textContent=l[0]+":",l.length>1&&(A.textContent=l[1]),o.appendChild(c),o.appendChild(a),o.appendChild(A),t.enabledBy&&o.setAttribute("name","enabled_by_"+t.enabledBy),{elem:o,input:a}},O=(e,t,n)=>{const r=(t.uuid?t.uuid:"")+t.id;let s=null;return s=i("input","button",t.name,r,"bu",!0),s.name=t.name,s.uuid=t.uuid,s.key=t.id,s.type="button",s.value=t.name,s.data=t.data,s.reload=t.reload,s.ignore=t.ignore||t.reload,
s.warning=t.warning,t.enabledBy&&s.setAttribute("name","enabled_by_"+t.enabledBy),!s.inserted&&n&&s.addEventListener("click",n),s},F=(e,t,n,r)=>{let s=null;return s=i("input","button",e,t,"bu",!0),s.name=e,s.key=t,s.type="button",s.value=n,!s.inserted&&r&&s.addEventListener("click",r),s},j=(e,t)=>{const n=(e.uuid?e.uuid:"")+e.id;let r,s,o;if(s=e.after||e.validation){if(o=e.validation?"validation":"help",t&&(o+=" clickable"),r=i("span",o,e.name,n,o,!0),s.image){
const e=U(N.get(s.image),n,"after_icon"),t=[];s.opacity&&t.push("opacity: "+s.opacity),e.setAttribute("style",t.join(";")),r.appendChild(e)}r&&(t&&r.addEventListener("click",t),s.msg&&r.setAttribute("title",s.msg))}return r},D=e=>({"&":"&amp;","<":"&lt;",">":"&gt;"}[e]||e);var L={getInfoFromUrl:e=>{let t;if(-1!=e.search(/\/\^?(http(s|s\?|\.\+)?|\.\*):\/\/(\.\*)*\$?\/?$/)||-1!=e.search(/htt(ps|p):\/\/(\*\/\*|\*)*$/)||-1!=e.search(/\*:\/\/(\*\/\*|\*)*$/)||"*"==e)return{dom:"*",tld:"*"}
;0==e.search(/\//)?(t=e,t=t.replace(/\([^\)]*\)[\?|\+|\*|\{[^\}]*]*/g,""),t=t.replace(/\[[^\]]*\][\?|\+|\*|\{[^\}]*]*/g,""),t=t.replace(/^\/|\/$|\^|\$|\\\?.*|#.*|\?|\(|\)|\+|\\|\.\*|/g,"")):t=e,t=t.replace(/^\*:\/\//,"http://"),0!=t.search("http")&&(t="http://"+t);const n=t.split("/");if(n.length<3)return null;const r=n[2].split(".");if(r.length<2)return null;const i=r[r.length-1].split(":")[0];let s=r[r.length-2];"*"!==s&&(s=s.replace(/\*/g,""));const o=[]
;for(let e=r.length-3;e>=0&&-1==r[e].search("\\*");e--)o.push(r[e]);return{tld:i,dom:s,subdom:o.reverse()}},getValue:e=>{let t=e.value;if("native"===e.valtype)if("undefined"===t)t=void 0;else if("null"===t)t=null;else try{t=JSON.parse(t)}catch(e){}return t},safeTagsReplace:e=>e.replace(/[&<>]/g,D),addClass:(e,t)=>{let n=e.getAttribute("class")||"";const r=new RegExp("[ \t]*"+t+"[ \t]*");-1==n.search(r)&&(n=(n?n+" ":"")+t),e.setAttribute("class",n)},toggleClass:(e,t)=>{
let n=e.getAttribute("class")||"";const r=new RegExp("[ \t]*"+t+"[ \t]*");n=-1!=n.search(r)?n.replace(r,""):(n?n+" ":"")+t,e.setAttribute("class",n)},setHelp:S,createAfterIcon:j,createEnabler:(e,t,n,r,s)=>{const o=r.append,a=r.disabled,l=r.title,c=i("div","enabler "+e,t,n+"_enabler",o,"wrap"),A=i("i","far fa-toggle-on on",t,n+"toggle-on"),d=i("i","far fa-toggle-on fa-flip-horizontal off greyed",t,n+"toggle-off");c.appendChild([A,d]),l&&(c.title=l),c.key=n,c.uuid=t;const u="enabler_enabled"
;return a||c.addEventListener("click",()=>{$(c).hasClass(u)?$(c).removeClass(u):$(c).addClass(u),s&&window.setTimeout(()=>{s.call(c)},100)}),c},createImage:(e,t,n,r,s,o)=>{const a=i("img","icon16",t,n,r,!0);if(a.setAttribute("src",e),o){const e=a.getAttribute("class")||"";a.setAttribute("class",e+" clickable")}return s&&(a.title=s),a.key=n,a.name=t,o&&(a.addEventListener("click",o),a.href="#"),a},createIcon:U,createFavicon:(e,t,n,s)=>{
const o=i("img","icon16",t,n,Object(r.filterString)(s,/[a-zA-Z0-9]/g));if(o.inserted)return o;"Array"!==Object(r.toType)(e)&&(e=[e]);const a=()=>{if(0==e.length)return;const r=e.shift();"function"==typeof r?window.setTimeout(()=>{o.parentNode&&(o.parentNode.insertBefore(U(r(),t+"_ico",n,s),o),o.parentNode.removeChild(o))},1):(o.setAttribute("src",r),o.setAttribute("async","true"))};return o.addEventListener("error",a),a(),s&&(o.title=s),o},createFileInput:(e,t,n)=>{
const r=i("input","import","file",null,null,!0);return r.inserted||(r.type="file",n&&r.addEventListener("change",n)),r},createNamedSettings:(e,t,n)=>{const r=(t.uuid?t.uuid:"")+t.id,o=i("div","settingsta",t.name,r,"named_wrapper"),a=i("div","named",t.name,r,"named_settings"),l=[],c=s("span",t.name,r,"s1");return e&&(c.textContent=e+":"),t.desc&&S(t.desc,c,c,t),o.appendChild(c),o.appendChild(a),o.key=t.id,t.value.forEach(e=>{
const o=i("div","",t.name+e.name,r,"named",!0),c=i("div","",t.name+e.name,r,"named_label",!0);c.textContent=e.name,o.appendChild(c);const A=s("textarea",t.name+e.name,r,"textarea",!0);A.setAttribute("spellcheck","false"),A.name=t.name,A.key=t.id,A.named_name=e.name,A.uuid=t.uuid,A.named=!0,A.oldvalue=e.value||"",A.value=e.value||"",n&&!A.inserted&&A.addEventListener("change",n),o.appendChild(A),a.appendChild(o),l.push(A)}),{elem:o,textareas:l,label:c}},createTextarea:(e,t,n)=>{
const r=(t.uuid?t.uuid:"")+t.id,o=s("div",t.name,r,"textarea");o.key=t.id;const a=i("textarea","settingsta",t.name,r,"textarea",!0);a.setAttribute("spellcheck","false"),a.name=t.name,a.key=t.id,a.uuid=t.uuid,a.json=t.json,a.array=t.array,a.oldvalue=t.value,void 0===t.value||null===t.value?a.value="":t.array?a.value=t.value.join("\n"):t.json?a.value=JSON.stringify(t.value,null,4):a.value=t.value,n&&!a.inserted&&a.addEventListener("change",n);const l=s("span",t.name,r,"s1")
;return e&&(l.textContent=e+":"),t.desc&&S(t.desc,l,l,t),o.appendChild(l),o.appendChild(a),{elem:o,textarea:a,label:l}},createFileSelect:(e,t,n)=>{const r=(t.uuid?t.uuid:"")+t.id,i=s("input",t.name,r,"file");if(i.inserted||(i.type="file",i.addEventListener("change",e=>{n(e.target.files)},!1)),e){const n=s("div",t.name,r,"input"),o=s("span",t.name,r,"s1");return o.textContent=e+":",n.appendChild(o),n.appendChild(i),{elem:n,input:i}}return{elem:i}},createInput:B,createColorChooser:(e,t,n)=>{
const r=(t.uuid?t.uuid:"")+t.id,s=B(e,t,n),o=function(){n&&n.apply(this,arguments);const e=(this.value.match(/[a-fA-F0-9]+/)||"")[0];e&&[3,6].includes(e.length)&&a.setAttribute("style","background-color: #"+e+";")};s.input.inserted||s.input.addEventListener("keyup",o);const a=i("span","color_choosed",t.name,r,"col");return s.col=a,s.elem.appendChild(s.col),o.call(s.input),s},createPassword:(e,t,n)=>{const r=B(e,t,n);return r.input.setAttribute("type","password"),r},createCheckbox:(e,t,n)=>{
const r=(t.uuid?t.uuid:"")+t.id,o=i("div","checkbox",t.name,r,"cb1");o.key=t.id;const a=s("input",t.name,r,"cb",!0);a.title=t.desc?t.desc:"",a.name=t.name,a.uuid=t.uuid,a.key=t.id,a.reload=t.reload,a.warning=t.warning,a.oldvalue=t.enabled,a.checked=t.enabled,a.type="checkbox",a.valtype="boolean",n&&!a.inserted&&a.addEventListener("click",n);const l=i("span","checkbox_desc",t.name,r,"cb2");return l.textContent=e,t.desc&&S(t.desc,o,l,t),o.appendChild(a),o.appendChild(l),{elem:o,input:a}},
createDropDown:(e,t,n,o,a)=>{const l=(t.uuid?t.uuid:"")+t.id,c=s("div",t.name,l,"outer_dd");c.key=t.id;const A=s("select",t.name,l,"dd",!0);let d=!1;if(n&&Object.keys(n).forEach(e=>{const i=s("option",t.name,n[e].name,"dd"+l,!0);i.textContent=Object(r.decodeHtml)(n[e].name),i.value=n[e].value,i.warning=n[e].warning,d|=!!n[e].warning,n[e].enabledBy&&i.setAttribute("name","enabled_by_"+n[e].enabledBy),t.enabler&&n[e].enable&&i.setAttribute("enables",JSON.stringify(n[e].enable)),
n[e].value==t.value&&(i.selected=!0),A.appendChild(i)}),A.key=t.id,A.name=t.name,A.uuid=t.uuid,A.reload=t.reload,A.warning=t.warning,A.oldvalue=t.value,A.valtype="native",A.inserted||(o&&A.addEventListener("change",o),d&&a&&A.addEventListener("change",a)),null!==e){const n=i("span","optiondesc",t.name,l,"inner_dd");n.textContent=e+": ",c.appendChild(n)}return c.appendChild(A),t.desc&&S(t.desc,c,c,t),t.enabledBy&&c.setAttribute("name","enabled_by_"+t.enabledBy),{elem:c,select:A}},
createImageButton:(e,t,n,r,s)=>{let o=null,a=null,l=null;return o=i("button","imgbutton button",e,t,"bu",!0),a=i("div","imgbutton_container",e,t,"bu_container"),a.appendChild(o),o.uuid=e,o.key=t,l=i("i","imgbutton_image far fa-"+r,e,t,"bu_img",!0),o.appendChild(l),o.title=l.title=l.alt=n,!o.inserted&&s&&o.addEventListener("click",s),a},createImageTextButton:(e,t,n,r,o)=>{const a=i("button","button imgtextbutton",e,t+n,"itb",!0);if(a.key=t,a.uuid=e,r){const i=U(N.get(r),e,t+n+"itb",r)
;a.appendChild(i)}const l=s("span",e,t+n,"itb");return l.textContent=n,a.appendChild(l),o&&a.addEventListener("click",o),a},createButton:function(e,t){return"Object"===Object(r.toType)(t)?O.apply(this,arguments):F.apply(this,arguments)},createPosition:(e,t,n)=>{const r=(t.uuid?t.uuid:"")+t.id,o=s("div",t.name,r,"pos1"),a=s("select",t.name,r,"pos",!0);for(let e=1;e<=t.posof;e++){const n=s("option",t.name,r,"opt"+e);n.textContent=e,e==t.pos&&(n.selected=!0),a.appendChild(n)}a.key=t.id,
a.uuid=t.uuid,a.name=t.name,n&&!a.inserted&&a.addEventListener("change",n);const l=i("span","optiondesc",t.name,r,"pos2");return l.textContent=e,o.appendChild(l),o.appendChild(a),o},createSearchBox:e=>{const t=i("div","searchbox","search_inner"),n=i("div","searchbox_mv","search_inner_mv"),r=i("input","searchbox_input","search_input"),s=i("input","searchbox_button","search_button");r.type="text",r.setAttribute("spellcheck","false"),r.value=e,s.type="button",s.value="Go";const o=()=>{
const e=r.value;window.location=window.location.origin+window.location.pathname+"?url="+encodeURIComponent(e)};return s.addEventListener("click",o),r.addEventListener("keyup",e=>{e&&13==e.keyCode&&o()}),n.appendChild(r),n.appendChild(s),t.appendChild(n),t},createSocialButtons:()=>{const e=[],t=i("a","","github_link");t.href="https://github.com/derjanb",t.target="_blank";const n=i("img","icon16","github");n.setAttribute("src",N.origin("gh")),t.appendChild(n),e.push(t)
;const r=i("a","","facebook_link");r.href="https://www.facebook.com/tampermonkey",r.target="_blank";const s=i("img","icon16","facebook");s.setAttribute("src",N.brand("facebook")),r.appendChild(s),e.push(r);const o=i("a","","insta_link");o.href="https://www.instagram.com/der_jan_b/",o.target="_blank";const a=i("img","icon16","instagram");return a.setAttribute("src",N.brand("instagram")),o.appendChild(a),e.push(o),e},createGobalHint:(e,t)=>{
const n="global_hint_"+(e.class?e.class:"warning"),r=e.id||Date.now(),o=i("span",["global_hint",n].join(" "),"globalhint",r),a=s("span","globalhint_c",r),l=s("span","globalhint_t",r);e.title&&(l.title=e.title),e.image&&a.appendChild(U(N.get(e.image),"globalhint_"+r,"icon"+r)),l.textContent=e.text,e.onclick&&!l.inserted&&l.addEventListener("click",e.onclick),a.appendChild(l),o.appendChild(a);const c=$(o);e.instant||(c.hide(),window.setTimeout(()=>{c.fadeIn(500)},e.delay?e.delay:1));const A=()=>{
e.instant?(c.hide(),c.remove()):c.fadeOut(500,()=>{c.remove()}),e.done&&e.done(o)};if(e.timeout&&window.setTimeout(A,e.timeout),!e.timeout||e.timeout>18e5){const e=i("span","close","gh_close",r);a.appendChild(e),e.addEventListener("click",()=>A())}return c.appendTo(t||document.body),c},isScrolledIntoView:(e,t)=>{const n=$(e),r=$(window),i=t&&t.padding||0,s=r.scrollTop(),o=s+r.height(),a=n.offset().top;return a+n.height()<=o-i&&a>=s+i}};const P={};var z=(e,t,n,o)=>{const a=(l=e,
Object(r.filterString)(l,/[0-9a-zA-Z]/g));var l;let c=!1;null==n&&(n={tv:"tv",tv_table:"tv_table",tr_tabs:"tr_tabs",tr_content:"tr_content",td_content:"td_content",td_tabs:"td_tabs",tv_tabs_fill:"tv_tabs_fill",tv_tabs_table:"tv_tabs_table",tv_tabs_align:"tv_tabs_align",tv_contents:"tv_contents",tv_tab_selected:"tv_tab tv_selected",tv_tab_close:"tv_tab_close",tv_tab:"tv_tab",tv_content:"tv_content"});const A=i("div",n.tv,"main"+a),d=i("table",n.tv_table+" noborder","main_table"+a)
;d.inserted?c=!0:(P[a]={},P[a].g_entries={},P[a].g_selectedId=null);const u=i("tr",n.tr_tabs,"tabs"+t.id+a),p=i("td",n.td_tabs,"pages"+a),h=i("div",n.tv_tabs_fill,"tv_tabs_fill"+a),f=i("div",n.tv_tabs_table,"tv_tabs_table"+a),m=i("div",n.tv_tabs_align,"tv_tabs_align"+a),_=i("tr",n.tr_content,"content"+t.id+a),b=i("td",n.td_content,"content"+a),v=i("div",n.tv_contents,"tv_content"+a),w=s("tfoot","tv_footer_t"+a),k=s("tr","tv_footer_tr"+a),y=s("td","tv_footer_td"+a);w.appendChild(k),
k.appendChild(y),f.appendChild(m),h.appendChild(f),p.appendChild(h),u.appendChild(p),d.appendChild(u),b.appendChild(v),_.appendChild(b),d.appendChild(_),d.appendChild(w),A.appendChild(d),t.appendChild(A);const R=(e,t,n)=>{t?e.setAttribute("style",n?r.staticVars.visible_move:r.staticVars.visible):e.setAttribute("style",n?r.staticVars.invisible_move:r.staticVars.invisible),e.setAttribute("vis",t.toString())},x=(e,t)=>{const n=e.getId();if(P[a].g_entries[n]){if(t==P[a].g_entries[n].visible)return
;P[a].g_entries[n].visible=t,R(P[a].g_entries[n].tab,t)}},C=(e,t)=>{e&&R(e.content,t,!1)},E=e=>{if(null===e)return null;const t=Object.keys(P[a].g_entries);for(let n,r=0;n=t[r];r++){const t=P[a].g_entries[n];if(t.entry.getId()==e)return t.entry}return null},I=e=>{e.hide();const t=e.getId(),n=P[a].g_entries[t];if(n){n.tab.parentNode.removeChild(n.tab),n.content.parentNode.removeChild(n.content);const e=(e=>{const t=Object.keys(P[a].g_entries)
;for(let n,r=0;n=t[r];r++)if(P[a].g_entries[n].tab.id==e.id)return n;return null})(n.tab);e&&delete P[a].g_entries[e]}else console.log("tv: WARN: tab not part of tabview!")};let M=null;return c?M=P[a].tv:(M={getTabById:E,getSelectedTab:function(){return E(P[a].g_selectedId)},getAllTabs:function(){const e=$(m).find("div[tvid]");let t,n;const r=[];return e.each(i=>{(t=$(e.get(i)).attr("tvid"))&&(n=E(t))&&r.push(n)}),r},getNextTab:function(){const e=$(m).find("div[tvid]");let t
;return P[a].g_selectedId&&e.each((n,r)=>{t||$(r).attr("tvid")===P[a].g_selectedId&&(t=$(e.get(n+1)).attr("tvid"))}),E(t||e.first().attr("tvid"))},getPreviousTab:function(){const e=$(m).find("div[tvid]");let t;return P[a].g_selectedId&&e.each((n,r)=>{t||$(r).attr("tvid")===P[a].g_selectedId&&(t=$(e.get(n-1)).attr("tvid"))}),E(t||e.last().attr("tvid"))},removeTab:I,appendTab:function(e,t,n,r,i){return this.insertTab(void 0,e,t,n,r,i)},insertTab:function(e,t,r,l,c,A){null===e&&(e=m.firstChild)
;const d="tab_"+t,u=s("div",d,"content"+a),p=void 0!==u.inserted&&1==u.inserted,h=s("div",d,"head_text"+a);if(r.appendChild(h),A){const e=i("div",n.tv_tab_close,d,"tv_close"+a,"tab_close");e.inserted||e.addEventListener("click",()=>{A()}),r.appendChild(e)}if(p){const e=(e=>{const t=Object.keys(P[a].g_entries);for(let n,r=0;n=t[r];r++){const t=P[a].g_entries[n];if(t.tab.id==e.id)return t}return null})(u);if(e)return e.entry;console.log("tv: WARN: old tab, but not in tabs collection!")}let f
;const _=t,b=e=>{""!=e.target.className&&e.target.className==n.tv_tab_close||f.select()};return u.setAttribute("tvid",t),u.addEventListener("click",b),r.addEventListener("click",b),u.setAttribute("name","tabview_tab"+a),u.setAttribute("class",n.tv_tab),u.appendChild(r),e?m.insertBefore(u,e):m.appendChild(u),l.setAttribute("name","tabview_content"+a),l.setAttribute("class",n.tv_content),v.appendChild(l),f={getId:function(){return _},isVisible:function(){return"true"==u.getAttribute("vis")},
isSelected:function(){return P[a].g_selectedId==this.getId()},isCloseable:function(){return!!A},modified:function(){return $(r).hasClass("modified")},remove:function(){I(this)},hide:function(){(e=>{const t=e.getId(),n=t==P[a].g_selectedId;if(P[a].g_entries[t]?x(e,!1):console.log("tv: WARN: tab not part of tabview!"),n){let e=null,t=null;for(const n in P[a].g_entries)P[a].g_entries[n].visible&&(e=P[a].g_entries[n],t||e.closable||(t=e));o||e.closable||(e=t),
e?e.entry.select():(P[a].g_selectedId=null,console.log("tv: WARN: selected tab set, but entry collection empty!"))}})(this)},show:function(){(e=>{const t=e.getId();P[a].g_entries[t]?x(e,!0):console.log("tv: WARN: tab not part of tabview!")})(this)},select:function(e){if(!e&&f.isSelected())return;const t=Object(g.Deferred)();c&&c(t.promise()),(e=>{if(e.getId()==P[a].g_selectedId)return;const t=e.getId();P[a].g_selectedId&&C(P[a].g_entries[P[a].g_selectedId],!1),
Object.keys(P[a].g_entries).forEach(e=>{const r=P[a].g_entries[e];r.entry.getId()==t?r.visible?r.selected||(r.tab.setAttribute("class",n.tv_tab_selected),C(r,!0),r.selected=!0):console.log("tv: WARN: tab selected but not visible!"):r.selected&&(r.tab.setAttribute("class",n.tv_tab),C(r,!1),r.selected=!1)}),P[a].g_selectedId=t})(this),t.resolve()},setHeading:function(e,t,n){const i=r.firstChild;if(t&&e.length>t){const r=Math.round(t/2);i.textContent=e.substr(0,r)+"..."+e.substr(r-t),i.title=n||e
}else i.textContent=e},toggleClass:function(e,t){$(r,v).toggleClass(e,t)},close:function(){A&&A()}},P[a].g_entries[_]={entry:f,tab:u,content:l,closable:null!=A},C(P[a].g_entries[_],!1),f.show(),f},setFooter:function(e){y.appendChild(e)}},P[a].tv=M),M};window.requestFileSystem||(window.requestFileSystem=window.webkitRequestFileSystem);const V=rea.FEATURES,Q=T.images,H=window.CodeMirror,Y=window.MirrorFrame;window.Hinter=x.a;var X=()=>{f.a.render(()=>{const e={};let t={};const n=[],a={},l={}
;let c={},A={};const m=(()=>{let e,t,n,r,i,s;if((e=V.HTML5.LOCALSTORAGE)&&(t=e.getItem("export_tm_settings"),n="true"===t,t=e.getItem("export_externals"),r="false"!==t,t=e.getItem("export_script_storage"),s="false"!==t,i=e.getItem("cloud_config")))try{i=JSON.parse(k.a.Base64.decode(i))}catch(e){}return{script_storage:s,add_tm_settings:n,include_externals:r,cloud_config:i}})();let w;const y={},E=function(e,t){let n,r;if((n=y[e])&&(r=n[t]))return r.apply(this,[].slice.call(arguments,2))},N=e=>{
const t=e.msg||e;if(e.once){if(l[t])return!0;l[t]=!0}let n=confirm(t),r={};return n&&e.ok?r=e.ok:!n&&e.cancel&&(r=e.cancel),(e.ok||e.cancel)&&(n=!0),r.url&&sendMessage({method:"newTab",url:r.url},()=>{}),n},S=(e,t)=>{try{const n=()=>{t&&V.OPTIONPAGE.CLOSE_ALLOWED&&window.close()};t?sendMessage({method:"newTab",url:e},n):rea.tabs.getSelected(null,r=>{rea.tabs.sendMessage(r.id,{method:"loadUrl",url:e,newtab:t},n)})}catch(e){console.log("lU: "+e.message)}};let U=!1;const B=e=>{if(U)return
;const t=o.I18N.getLocale(),n=$("<div>").hide(),r=e=>{e?(n.html(""),n.append($('<div class="contrib_iframe" style="font-size: 2.5em;"></div>').append($('<div style="padding-top: 150px;">').text(e))),window.setTimeout(r,1e3)):(n.fadeOut(1e3),window.setTimeout(h,1e3))
},i=$('<iframe src="https://www.tampermonkey.net/contrib.php?embedded=2'+(t?"&locale="+t:"")+"&src="+(e||"e")+rea.runtime.short_id+'" class="contrib_iframe"></iframe>'),s=[$('<button class="contrib_button">').html(o.I18N.getMessage("Remind_me_later")).click(()=>{ce("later"),r(o.I18N.getMessage("Ok"))}),$('<button class="contrib_button">').html(o.I18N.getMessage("I_contributed_already")).click(()=>{ce("contributed"),r(o.I18N.getMessage("Thank_you_very_much_"))
}),$('<button class="contrib_button">').html(o.I18N.getMessage("I_dont_want_to_contribute")).click(()=>{ce("hide"),r(o.I18N.getMessage("Ok"))})],a=()=>{l&&window.clearTimeout(l),s.forEach(e=>{e.prop("disabled",!1)})};s.forEach(e=>{e.prop("disabled",!0)}),n.append(i,s),i.bind("load",a);let l=window.setTimeout(()=>{l=null,a()},15e3);const c=()=>{const e=p(n[0]);!0===e?(n.fadeIn(1e3),ce("dialog")):void 0===e&&window.setTimeout(c,500),U=!0};c(),window.addEventListener("message",e=>{let t
;const i=e.data.clicked||e.data.type,s=e.data.amount,a=e.data.currency,l=e.data.redirect_url;if(i)if(l&&S(l,!0),e.data.success){t=$(".contrib_iframe");const n=t.data("oheight");if(!n||n<0||n>1e3)return;t.animate({height:n},1e3),ce("contributed",i,{id:e.data.id})}else e.data.clicked&&(ce("clicked",i,{amount:s||"?",currency:a||"?"}),$(".contrib_button").remove(),n.append($('<button class="contrib_button">').html(o.I18N.getMessage("Ok")).click(()=>{r()})),e.data.enlarge&&(t=$(".contrib_iframe"),
t.data("oheight",t.height()),t.animate({height:740},1e3)))},!1)},O=e=>{const t=Object(g.Deferred)(),n=new FileReader;return n.onloadend=function(){t.resolve(this.result)},n.onerror=t.reject,n.onabort=t.reject,n.readAsText(e),t.promise()},F=()=>{if(V.HTML5.LOCALSTORAGE)return V.HTML5.LOCALSTORAGE.getItem("sort_key")},j=()=>{if(V.HTML5.LOCALSTORAGE)return V.HTML5.LOCALSTORAGE.getItem("sort_sequence")},D=e=>{if(V.HTML5.LOCALSTORAGE)return V.HTML5.LOCALSTORAGE.setItem("sort_key",e)},P=e=>{
if(V.HTML5.LOCALSTORAGE)return V.HTML5.LOCALSTORAGE.setItem("sort_sequence",e)},X=e=>{const t=(e,n)=>e.tagName==n?e:e.parentNode?t(e.parentNode,n):null;let n="down"==j(),r=null,i=[],s=0;const a=Date.now();Object.keys(c).forEach(e=>{const n=c[e];if(!n)return void console.warn("options: something went wrong!",e);const l=t(n.dom,"TR");if(l){const e=t(l,"TBODY");let c,A;r?e&&r!=e&&console.warn("options: different parents?!?!"):r=e,s++,
(!(c=n.script.lastModified||n.script.lastUpdated)||(A=a-parseInt(c))&&isNaN(A))&&(A=0),i.push({tr:l,sites:J.get(n.script),enabled:n.script.enabled,position:n.script.position?n.script.position:1e3+s,name:o.I18N.getTranslation(n.script,"name").toLowerCase(),homepage:[n.script.origin?b.default.parse(n.script.origin.url).hostname:"z",Se(n.script)?b.default.parse(Se(n.script)).hostname:"z"].join("_"),updated:A,version:n.script.version||""}),l.inserted=!1,l.parentNode&&l.parentNode.removeChild(l)
}else console.log("options: unable to sort script at pos "+n.pos)}),i=(e=>{let t;const r=e=>(t,n)=>t[e]-n[e],i=F();var s,o;return"pos"==i?t=r("position"):"enabled"==i?(s="enabled",o=n,t=(e,t)=>{const n=(o^e[s]?"a":"b")+e.name,r=(o^t[s]?"a":"b")+t.name;return n<r?-1:n>r?1:0},n=null):t="ver"==i?(e=>(t,n)=>Object(C.versionCmp)(String(t[e]),String(n[e])))("version"):"updated"==i?r("updated"):(e=>(t,n)=>t[e]<n[e]?-1:t[e]>n[e]?1:0)(i),e.sort(t),e})(i),n&&(i=i.reverse())
;for(let e=0;e<s;e++)r.appendChild(i[e].tr);$(".sorting").each((e,t)=>{$(t)["pos"==F()&&"up"==j()?"fadeIn":"fadeOut"]()}),e&&e()},W=Object(M.createCache)({timeout:600,check_interval:300,retimeout_on_get:!0}).init(),J=(()=>{let e={};const t=e=>e.toString().length<7?t("0"+e):e,n=e=>{if(e.includes||e.matches){const t={},n=[],r=e.includes.length?e.includes:e.matches;for(let i=0;i<r.length;i++){const s=r[i];if(!s){console.log("o: Warn: script '"+e.name+"' has invalid include (index: "+i+")");continue
}const o=W.get(s),a=(void 0!==o?o:null)||L.getInfoFromUrl(s);void 0===o&&W.set(s,a),a&&a.dom?t[a.dom]||(t[a.dom]=!0,n.push({include:s,info:a})):n.push({include:s})}return n}};return{init:function(t){e={},t.forEach(t=>{const r=n(t);r&&r.length&&r.forEach(t=>{t.info&&(e[t.info.dom]=(e[t.info.dom]||0)+1)})})},get:function(r){const i=n(r);if(!i||!i.length)return t(0);const s=i.map(t=>t.info?{score:1e3*e[t.info.dom]+t.info.dom.charCodeAt(0)||0,dom:t.info.dom}:{score:0,dom:""
}).sort((e,t)=>t.score-e.score)[0];return t(s.score)+s.dom},topIcons:function(t,s){let o;const a=[],l=n(t);if(!l||!l.length)return[];const c=l.map(t=>(t.score=t.info&&e[t.info.dom]||0,t)).sort((e,t)=>t.score-e.score);return Object(r.each)(c,e=>{const n=e.info;if(0==s--){const e=i("span","",t.uuid,"tbc");return e.textContent="...",a.push(e),!1}if(!n)return o=L.createIcon(Q.get("question_mark"),"favicon",t.uuid,e.include,e.include),void a.push(o)
;if("*"==n.tld)return o=L.createIcon(Q.get("web"),"web",t.uuid,e.include,e.include),a.push(o),!1;let r="com",l="";"*"!=n.tld&&"tld"!=n.tld&&(r=n.tld),n.subdom.length&&(l=n.subdom.join(".")+".");const c=(l+n.dom+"."+r).replace(/\*/g,""),[A,d]=Ue(c);o=L.createFavicon([A,d,()=>Q.get("question_mark")].filter(e=>e),"favicon",t.uuid,e.include,e.include),a.push(o)}),a}}})();let q=null;const K=()=>{q&&(window.clearTimeout(q),q=null)},ee=e=>{let t;const n=e.key||"general";(t=$e[n])&&$(t).remove(),
$e[n]=L.createGobalHint(e,$("body > div.status")[0])},te=(e,t,n,r)=>{void 0===r&&(r=3e3),ee({key:"success",text:e,image:t,class:n,delay:500,timeout:r,done:()=>{}})},ne=()=>{te(o.I18N.getMessage("Operation_completed_successfully"),"button_ok","notice")},re=(e,t)=>{void 0===t&&(t="button_ok"),te(e,t,"information",8e3)},ie=(e,t)=>{void 0===t&&(t="error"),te(e,t,"warning",8e3)},se=e=>{q||(q=window.setTimeout(()=>{q=null,d(o.I18N.getMessage("Please_wait___"))},e||500))};let oe=null,ae=null
;const le=(e,t)=>{null!=oe?(window.clearTimeout(oe),oe=null,le(e||ae.items,e?t:ae.with_scripts)):(ae={items:e,with_scripts:t},oe=window.setTimeout(()=>{oe=null,ae.with_scripts&&(c={},A={}),Te(ae.items),ae=null},50))},ce=(e,t,n)=>{const r=Object(g.Deferred)();return sendMessage({method:"begEvent",action:e,type:t,extra:n},e=>{r.resolve(e)}),r.promise()},Ae=(e,t)=>{const n=Object(g.Deferred)();try{se(),sendMessage({method:"installScript",url:e.url,code:e.code,reload:t.reload},e=>{K(),e.items?(ne(),
le(e.items,!1)):u(),e.err?n.reject(e):n.resolve(e)})}catch(e){console.log("sS: "+e.message),n.reject({err:e.message})}return n.promise()},de=(e,t)=>{const n=Object(g.Deferred)();try{se(),sendMessage({method:"importFromJson",json:e,reload:t.reload},e=>{K(),e.reload?window.setTimeout(()=>{rea.page.reload()},500):e.items?(ne(),le(e.items,!0)):u(),e.err?n.reject(e):n.resolve(e)})}catch(e){console.log("sS: "+e.message),n.reject({err:e.message})}return n.promise()},ue=(e,t,n)=>{
const r=Object(g.Deferred)();void 0===n.reload&&(n.reload=!0);try{n.auto_save||se(),sendMessage({method:"saveScript",uuid:e,code:t,clean:n.clean,force:n.force,new_script:n.new_script,auto_save:n.auto_save,restore:n.restore,lastModTime:n.lastModTime,reload:n.reload},e=>{n.auto_save||(ne(),K()),(e=e||{}).items?le(e.items,!0):u(),!t&&n.reload&&u(),r.resolve(e)})}catch(e){console.log("sS: "+e.message),r.reject({err:e.message})}return r.promise()},pe=(e,n,r)=>{const i=Object(g.Deferred)();try{se(),
sendMessage({method:"setOption",name:e,value:n},e=>{K(),ne(),t=e.options||t,!r&&e.items?le(e.items,!1):u(),i.resolve(e)})}catch(e){console.log("sO: "+e.message),i.reject({err:e.message})}return i.promise()},he=(e,t)=>{se(),sendMessage({method:"loadTree",complete:e.complete,uuid:e.uuid,url:e.url,referrer:e.referrer,layout:e.layout,filter:e.filter},e=>{K(),
e.items||(e.error?Object(r.cAlert)(e.error):confirm(o.I18N.getOriginalMessage("An_internal_error_occured_Do_you_want_to_visit_the_forum_"))&&(window.location.href="https://www.tampermonkey.net/bug")),t(e)})},fe=()=>{g.Deferred.onebyone(["options.scripts","options.trash"].map(e=>()=>{const t=Object(g.Deferred)();return he({referrer:e},e=>{t.resolve(e.items||[])}),t.promise()})).then(e=>{const t=e.reduce((e,t)=>e.concat(t),[]).filter(e=>e);t&&t.length?le(t,!0):u()})},ge=(e,n,r)=>{null==r&&(r=!0)
;try{const i={method:"modifyScriptOptions",uuid:e,reload:r};for(const e in n)n.hasOwnProperty(e)&&(i[e]=n[e]);se(),sendMessage(i,e=>{K(),t=e.options||t,e.i18n&&o.I18N.setLocale(e.i18n),ne(),e.items?le(e.items,!0):u()})}catch(e){console.log("mSo: "+e.message)}},me=(e,t,n)=>{try{const r={method:"saveStorageKey",uuid:e,key:t,value:n,id:"options"};se(),sendMessage(r,()=>{K(),ne(),u()})}catch(e){console.log("sSk: "+e.message)}},_e=(e,t,n)=>{try{const r={method:"download",details:{url:e,name:t,
saveAs:!0},id:"options"};se(),sendMessage(r,e=>{K(),e.load?ne():e.error&&ie(o.I18N.getMessage("Action_failed")),u(),n&&n()})}catch(e){console.log("dDU: "+e.message)}},be=window.navigator.userAgent.includes("Mac")?"mac":"other";let ve;window.addEventListener("keydown",e=>{let t,n,r=!1;if("keydown"==e.type&&!e.defaultPrevented){if(27==e.keyCode){if(t=w.getTabById("dashboard"),!t.isSelected())return;if(e.target&&"text"==e.target.type)return void $(e.target).blur();y.multiselect.toggleRow(!1),r=!0
}else("mac"!=be&&39==e.keyCode||"mac"==be&&40==e.keyCode)&&!e.ctrlKey&&e.altKey&&!e.shiftKey?(n=w.getNextTab(),n&&(n.select(),r=!0)):("mac"!=be&&37==e.keyCode||"mac"==be&&38==e.keyCode)&&!e.ctrlKey&&e.altKey&&!e.shiftKey&&(n=w.getPreviousTab(),n&&(n.select(),r=!0));return r?(e.stopPropagation(),e.preventDefault(),!1):void 0}},!0),window.addEventListener("keydown",e=>{let t,n,r=!1;if("keydown"==e.type&&!e.defaultPrevented){if(112==e.keyCode)t=w.getTabById("help"),t&&t.select(),
r=!0;else if(38!=e.keyCode&&40!=e.keyCode||!e.shiftKey){if(70==e.keyCode&&(e.ctrlKey||e.metaKey)){if(t=w.getTabById("dashboard"),!t.isSelected())return;y.multiselect.toggleRow(!0,!0),r=!0}else if(65==e.keyCode&&(e.ctrlKey||e.metaKey)){if(t=w.getTabById("dashboard"),!t.isSelected()||e.target&&"text"==e.target.type)return;y.multiselect.un_selectAll(!0),r=!0}}else{if(t=w.getTabById("dashboard"),!t.isSelected())return;let i=We.length&&We[We.length-1];i&&(i=$(i))&&(()=>{r=!0;const t=i.closest("tr")
;if(!t.length)return;let s,o;if(38==e.keyCode?(n=t.prevAll("tr:visible:first"),s=!0):(n=t.nextAll("tr:visible:first"),s=!1),!n.length)return;const a=n.find('input[name="scriptselectors"]');We.includes(a[0])?(We.pop(),i.prop("checked",!1),i.removeClass("selected"),o=i):a.length&&(a.prop("checked",!0),a.addClass("selected"),We.push(a[0]),void 0===We.direction&&(We.direction=s),o=a),o&&(L.isScrolledIntoView(n,{padding:100})||$("html, body").animate({
scrollTop:s?n.offset().top-100-n.height():n.offset().top-$(window).height()+100+2*n.height()},0),y.multiselect.single_click())})()}return r?(e.stopPropagation(),e.preventDefault(),!1):void 0}},!1);const we=(()=>{const e={},t=()=>{ve=Object(r.getUrlArgs)(!0),Object.keys(e).forEach(t=>{const n=e[t];o.is(n.main,n.sub)&&n.fn()})};let i;t(),window.onhashchange=function(){i||t.apply(this,arguments)};const s=e=>{i=!0,e(),i=!1},o={set:function(e){const n=o.get();let r
;r="object"==typeof e?[e.main,e.sub].filter(e=>e):arguments,n.main===r[0]&&n.sub===r[1]||(!r[0]&&r[1]?o.setSub(r[1]):s(()=>{window.location.hash="nav="+[].join.call(r,"+"),t()}))},setSub:function(e){const n=o.get();n.sub!==e&&s(()=>{window.location.hash="nav="+(n.main?n.main:"")+"+"+e,t()})},get:function(){const e=ve.nav?ve.nav.split("+"):[];return{main:e[0],sub:e[1]}},is:function(e,t){const n=o.get(),r=!e||n.main===e,i=!t||n.sub===t;return r&&i},isSub:function(e){return o.is(null,e)},
registerListener:function(t,n,r){void 0===r&&(r=n,n=null);const i=[t,n].join("+");return e[i]={main:t,sub:n,fn:r},o.is(t,n)&&r(),i},unregisterListener:function(t){delete e[t]},clear:function(){o.set("")}},a=o.get();return n.push(()=>{const e=w.getTabById(a.main);if(e)return e.select(!0);if(a.main){const e=w.getTabById("dashboard");e&&e.select(!0),n.push(()=>{window.setTimeout(()=>{o.set(a)},0)})}else window.onhashchange()}),o})();n.push(()=>{t.statistics_enabled&&_.a.init("opt",!0,{trackView:!1,
version:rea.extension.manifest.version})});const ke=Object(r.getDebouncer)(1e3),ye=()=>{for(;n.length;)try{n.shift()()}catch(e){console.warn("doneListeners:",e)}},Re=(e,t)=>{const n=s("input",e.name,e.id,"Save");return n.inserted||(n.type="button",n.section=e,n.disabled=!0,n.value=o.I18N.getMessage("Save"),n.addEventListener("click",(function(){if(t&&t.warning&&!N(t.warning))return;const e=$(this.section).find("input, select, textarea").toArray(),n=[],i=[];for(let s=0;s<e.length;s++){let a=null
;const l=e[s],c=l.key;if(!i.includes(l)){if("textarea"==l.tagName.toLowerCase())if(l.named){const e=document.getElementsByName(l.name);a=[],Object(r.each)(e,e=>{a.push({name:e.named_name,value:e.value}),i.push(e)})}else if(l.array)a=l.value.split("\n").map(e=>e.trim()).filter(e=>e);else if(l.json){let e;try{a=(e=l.value)&&(e=e.trim())?JSON.parse(e):null}catch(e){return void Object(r.cAlert)(o.I18N.getMessage("Unable_to_parse_0name0",l.name))}
}else a=l.value;else if("checkbox"==l.getAttribute("type"))a=l.checked;else if("select"==l.getAttribute("type")){let e=0;l.selectedIndex>=0&&l.selectedIndex<l.options.length&&(e=l.selectedIndex),a=l[e]?l[e].value:l.options[0].value}else"button"==l.getAttribute("type")||(a=l.value);c&&n.push(pe(c,a,t&&t.reload))}}t&&t.reload&&(d(),g.Deferred.when(n).done(()=>{rea.page.reload()}))}),!1)),n},xe=(a,l,p,h)=>{let f,m,_,b,v,w,k=[];const R=(e,t)=>{if(p)if(p.save_button)$(e).on("change",()=>{
p.save_button.disabled=!1}),$(t).on("input propertychange",()=>{p.save_button.disabled=!1});else{const e="Section needs a save button!";console.error(e,p)}};if(l.divider)return null;if(l.image&&(l.image_id=Q.get(l.image)),l.checkbox)_=function(){let e=!0;const t=this;t.warning&&(e=N(t.warning),e||(t.checked=!t.checked)),e&&pe(this.key,t.checked,t.reload).always(()=>{t.reload&&rea.page.reload(500)})},p&&p.need_save&&(m=null,_=null),f=L.createCheckbox(l.name,l,_),k.push(f.elem),
p&&p.save_button&&R(null,f.input);else if(l.button)_=function(){let e=!0;const t=this;t.warning&&(e=N(t.warning)),e&&((e,t,n)=>{const r=Object(g.Deferred)();try{se(),sendMessage({method:"buttonPress",name:e,data:t},e=>{K(),!n&&e.items?(ne(),le(e.items,!1)):u(),r.resolve(e)})}catch(e){console.log("sO: "+e.message),r.reject({err:e.message})}return r.promise()})(t.key,t.data,t.ignore).always(()=>{t.reload&&rea.page.reload(500)})},f=L.createButton(l.name,l,_),
k.push(f);else if(l.named)f=L.createNamedSettings(l.name,l),k.push({element:f.elem,validation:f.label}),R(null,f.textareas);else if(l.input)f=L.createTextarea(l.name,l),k.push({element:f.elem,validation:f.label}),R(null,f.textarea);else if(l.text)f=L.createInput(l.name,l),k.push(f.elem),R(f.input);else if(l.color)f=L.createColorChooser(l.name,l),k.push(f.elem),R(f.input);else if(l.password)f=L.createPassword(l.name,l),k.push(f.elem),R(f.input);else if(l.select){m=function(){let e=!0;const t=this
;t.warning&&(e=N(t.warning),e||(t.value=t.oldvalue)),e&&pe(t.key,L.getValue(t),t.reload).always(()=>{t.reload&&rea.page.reload(500)})};const e=function(){let e=!0;this.selectedOptions.length&&this.selectedOptions[0].warning&&this.selectedOptions[0].value!==this.oldvalue&&(e=N(this.selectedOptions[0].warning),e||(this.value=this.previousValue||this.oldvalue)),this.previousValue=this.value};p&&p.need_save&&(m=l.enabler?function(){
const e=document.getElementsByName("enabled_by_"+this.key),t=(this.selectedIndex<this.options.length?this.options[this.selectedIndex]:this.options[0]).getAttribute("enables"),n=t?JSON.parse(t):{};Object(r.each)(e,e=>{void 0===n[e.key]||n[e.key]?e.setAttribute("style",r.staticVars.visible):e.setAttribute("style",r.staticVars.invisible)})}:null),f=L.createDropDown(l.name,l,l.select,m,e),k.push(f.elem),p&&p.save_button&&R(f.select),a&&l.enabler&&(()=>{const e=m,t=f;n.push(()=>{e.apply(t.select,[])
})})()}else if(l.url){const e=s("a",l.name,l.id);e.href="#",e.url=l.url,e.newtab=l.newtab,e.inserted||(m=function(){S(this.url,this.newtab)},e.addEventListener("click",m)),e.textContent=l.name,k=Array(13),k[3]=e}else if(l.main_menu_item){v=s("div",l.name,l.id),v.textContent=l.name;const c=s("div",l.name,l.id,"tab_content"),f=((e,a)=>{const l=(e,t,n,r,s)=>{let o;const a=i("th","settingsth",e.name,e.id,t),l=i("a","settingsth_a",e.name,e.id,t+"_a");l.setAttribute("name","settingsth_a"+e.name)
;const c=i("a","settingsth_a_up",e.name,e.id,t+"_a_up");c.setAttribute("name","settingsth_a_up"+e.name);const A=i("a","settingsth_a_down",e.name,e.id,t+"_a_down");A.setAttribute("name","settingsth_a_down"+e.name);const d=()=>{((t,n,r)=>{const i=document.getElementsByName("settingsth_a_up"+e.name),s=document.getElementsByName("settingsth_a_down"+e.name);for(o=0;o<i.length;o++)i[o].style.display="none";for(o=0;o<s.length;o++)s[o].style.display="none";"up"==j()?n.style.display="":r.style.display=""
})(0,c,A)},u=()=>{d()},p=()=>{window.setTimeout(()=>{F()==r?P("down"==j()?"up":"down"):D(r),X(u)},0)};return a.inserted||(a.appendChild(l),a.appendChild(A),a.appendChild(c),l.addEventListener("click",p),c.addEventListener("click",p),A.addEventListener("click",p),l.textContent=n+" ",l.href="#",c.innerHTML="&#x25B4;",c.href="#",A.innerHTML="&#x25BE;",A.href="#"),s&&!F()?(D(r),P("up"),window.setTimeout(d,0)):r==F()&&window.setTimeout(d,0),a};let c,u,p,h,f,g;if(f=s("tbody",e.name,e.id,"body"),
g=s("thead",e.name,e.id,"head"),"dashboard"==e.id){const A=Ke(e),d=Xe(e);c=s("table",e.name,e.id,"main"),c.inserted||c.setAttribute("class","scripttable multiselect");const f=i("th","script_sel",e.name,e.id,"thead_sel");f.appendChild(A.selAllm);const m=i("th","left",e.name,e.id,"thead_multi_action");m.setAttribute("colspan",V.RUNTIME.MOBILE?3:11),m.appendChild(A.actionBox),m.appendChild(d);const _=i("th","right",e.name,e.id,"thead_multi_close");_.appendChild(A.close),
p=i("tr","multiselectrow",e.name,e.id,"filler_multi"),p.appendChild([f,m,_]),h=i("tr","multiselectscrolldummy",e.name,e.id,"scrolldummy");const b=i("th","left",e.name,e.id,"scrolldummyth");b.setAttribute("colspan",V.RUNTIME.MOBILE?3:11),h.appendChild([b]),u=i("tr","scripttr multiselectreplaced",e.name,e.id,"filler");const v=i("th","script_sel",e.name,e.id,"thead_sel");v.appendChild(A.selAll)
;const w=l(e,"thead_pos","#","pos"),k=l(e,"thead_en",o.I18N.getMessage("Enabled"),"enabled"),R=l(e,"thead_name",o.I18N.getMessage("Name"),"name",!0),x=i("th","settingsth",e.name,e.id,"thead_del");if(x.textContent=o.I18N.getMessage("Actions"),V.RUNTIME.MOBILE)Object(r.each)([v,w,k,R,x],e=>{u.appendChild(e)});else{const s=l(e,"thead_ver",o.I18N.getMessage("Version"),"ver"),a=i("th","settingsth ",e.name,e.id,"thead_type"),c=i("span","script_type",e.name,e.id,"thead_type_span")
;c.textContent=o.I18N.getMessage("Type"),a.appendChild(c);const A=i("th","settingsth",e.name,e.id,"thead_sync");A.textContent="";const d=l(e,"thead_sites",o.I18N.getMessage("Sites"),"sites");d.width="25%";const p=i("th","settingsth",e.name,e.id,"thead_features");p.textContent=o.I18N.getMessage("Features")
;const h=l(e,"thead_homepage",o.I18N.getMessage("Homepage"),"homepage"),f=l(e,"thead_updated",o.I18N.getMessage("Last_updated"),"updated"),g=i("th","settingsth",e.name,e.id,"thead_sort"),m=i("span","sorting",e.name,e.id,"thead_sort_span");m.textContent=o.I18N.getMessage("Sort"),"pos"==F()&&"up"==j()||m.setAttribute("style","display: none;"),g.appendChild(m);const _=()=>{t.sync_enabled&&(A.textContent=o.I18N.getMessage("Imported"))};n.push(_),Object(r.each)([v,w,k,R,s,a,A,d,p,h,f,g,x],e=>{
u.appendChild(e)})}g.appendChild([p,h,u]),u.inserted||(y.multiselect.checkScroll=()=>{const e=$(g),t=e.is(":visible")&&$(p).is(":visible")&&$(a).scrollTop()>0;e.toggleClass("multiscrolling",t)},$(a).scroll(y.multiselect.checkScroll))}else if("trash"==e.id){c=i("table","settingstable",e.name,e.id,"main");const t=i("tr","","tr_trash"),n=i("td","","td_trash"),r=i("div","trash_actions","div_trash_actions");n.appendChild(r),t.appendChild(n),c.appendChild(t)
;const s=L.createButton("restore_all",e.uuid+"_delall",o.I18N.getMessage("Restore_all"),()=>{if(confirm(o.I18N.getMessage("Really_restore_all_userscripts_"))){const e=$(c).find('input[name ="restore"]');e.length&&(d(),e.click())}}),a=L.createButton("delete_all",e.uuid+"_delall",o.I18N.getMessage("Delete_all"),()=>{if(confirm(o.I18N.getMessage("Really_delete_all_userscripts_"))){const e=Object.values(A).map(e=>e.script);e.forEach(e=>{y[e.uuid].purgeScript(null,!0)}),e.length&&d()}})
;r.appendChild([s,a])}else c=i("table","settingstable",e.name,e.id,"main");return c.appendChild(g),c.appendChild(f),{table:c,head:g,body:f}})(l,c);c.appendChild(f.table);let g=null;const m=h.appendTab(l.id,v,c,t=>{t.then(()=>{g&&(e.global?g():n.push(g)),we.set(l.id),document.title=l.name})});we.registerListener(l.id,()=>{m.select()}),l.hidden?m.hide():m.show(),l.referrer&&(g=()=>{g=null,se(50),he({referrer:l.referrer},e=>{e.items&&e.items.forEach(e=>{xe(a,e,p,h)}),ye(),K(),u()})}),
l.items&&Ce(f.body,l.items,null,h),!e.global&&l.selected_default&&n.push(()=>{h.getSelectedTab()||m.select()})}else if(l.sub_menu_item)b=i("div","section type_"+l.id,l.name,l.id,"section"),v=i("div","section_head",l.name,l.id,"head"),w=i("table","section_content",l.name,l.id,"content"),v.textContent=l.name,b.appendChild(v),l.desc&&L.setHelp(l.desc,v,v,l),b.appendChild(w),l.need_save&&(l.save_button=Re(w,l)),Ce(w,l.items,l,h),l.save_button&&w.appendChild(l.save_button),
k.push(b);else if(l.userscript)if(l.deleted){A[l.uuid]={dom:a,script:l};const e=i("div","trash_list","deleted_scripts");e.appendChild(Le(l,e,h)),e.inserted||i("td","","td_trash").appendChild(e)}else if(k=Pe(l,a,h),c[l.uuid]={dom:a,script:l},a.setAttribute("class","scripttr"),l.nnew)a.setAttribute("style","display: none;");else{const t="script_refresh";ke.is(t)||(n.push(()=>{J.init(Object.values(c).map(e=>e.script)),y.multiselect.single_click(),X(),e.scripts=!0,ke.clear()}),ke.add(t))
}else if(l.globalhint)ee(Object(r.copy)(l.options,{onclick:l.options.info_url?()=>{S(l.options.info_url,!0)}:null}));else{const e=s("span","",l.uuid||l.id+l.name);e.textContent=l.name,k=Array(13),k[3]=e}return k.forEach(e=>{if(e){if(void 0!==l.level&&(e.element||e).setAttribute("style",l.level>t.configMode?r.staticVars.invisible:r.staticVars.visible||""),l.hint){const t=s("span","",l.uuid||l.id+l.name,"hint");t.textContent=l.hint,e.appendChild(t)}l.validation&&Ee(l,e.validation||e.element||e),
l.width&&e.setAttribute("class","width-172-"+l.width)}}),a&&(w=a.getAttribute("class"),v=" hide",!1===l.visible?w=(w||"")+v:w&&(w=w.replace(v,"")),a.setAttribute("class",w)),k},Ce=(e,t,n,s)=>{Object.keys(t).forEach(o=>{const a=t[o],l=e?i("tr","settingstr",a.uuid||a.id+a.name,"pi"):null,c=xe(l,a,n,s);c&&c.length&&(e&&e.appendChild(l),Object(r.each)(c,(e,t)=>{let n=e,s="";"Object"===Object(r.toType)(e)&&(n=e.element,s=e.style||"");const o=i("td",s+" settingstd","",a.uuid||a.id+a.name,t)
;e&&o.appendChild(n),l&&l.appendChild(o)}))})},Ee=(e,t)=>{let n;if(e.validation){e.validation.url&&(n=function(){S(this.url,!0)});const r=L.createAfterIcon(e,n);r&&(r.url=e.validation?e.validation.url:void 0,t.appendChild(r))}},Ie=e=>{const t=e.meta||{},n=e.settings||{},r=e=>({url:e.meta.url,sri:e.meta.sri,ts:e.meta.ts,mimetype:e.meta.mimetype,modified:e.meta.modified,content:e.source});return{source:e.source,name:t.name,uuid:t.uuid,file_url:t.file_url,options:e.options,storage:e.storage,
lastModified:t.modified,enabled:n.enabled,position:n.position,resources:e.resources?e.resources.map(r):[],requires:e.requires?e.requires.map(r):[]}},Me=(e,t)=>{const n=Object(g.Deferred)(),r=[];return((e,t)=>{const n=[];let r,i=Object(g.Deferred)();const s=e=>{i&&(e&&i.reject(),r&&r.disconnect(),i=null)};try{se(),r=rea.extension.connect("exportToJson"),r.onMessage.addListener(e=>{if(i)if(e.partial&&n.push(e.partial),e.done){const e=n.join("");let t;try{t=JSON.parse(e)}catch(e){}K(),u(),
t?i.resolve(t):i.reject(),s()}else e.error&&s(!0)}),r.onDisconnect.addListener(()=>{s(!0)}),r.postMessage({method:"exportToJson",ids:e,options:t})}catch(e){console.log("eJ: "+e.message),s(!0)}return i.promise()})(e,t).done(e=>{e.scripts.forEach(e=>{e.uuid&&e.userscript&&!e.system&&!e.nnew&&(e.code&&""!=e.code.trim()?r.push((e=>{const t=e=>e.url?{meta:{name:b.default.parse(e.url).pathname.split("/").pop(),url:e.url,sri:e.sri,ts:e.ts,mimetype:e.mimetype,modified:e.modified},source:e.data.content
}:void 0,n=e=>e;return{source:e.code,meta:{name:e.name,uuid:e.uuid,modified:e.lastModified,file_url:e.file_url&&e.file_url.trim()?e.file_url:void 0},storage:e.storage,options:e.options,settings:{enabled:e.enabled,position:e.position},resources:e.resources?e.resources.map(t).filter(n):[],requires:e.requires?e.requires.map(t).filter(n):[]}})(e)):console.log("options: Strange script: "+e.name))}),n.resolve({scripts:r,global_settings:e.global_settings})}).fail(()=>{n.reject()}),n.promise()}
;let Ge=()=>{if(!V.RUNTIME.SHARED_OBJECT_URLS||V.RUNTIME.FIREFOX&&V.RUNTIME.MOBILE){if(V.RUNTIME.SAFARI)return window.saveAs=(e,t)=>{k.a.blob2dataUri(e,e=>_e(e,t))},g.Deferred.Pledge();if(V.RUNTIME.EDGE&&window.navigator&&window.navigator.msSaveBlob)return window.saveAs=(e,t)=>{window.navigator.msSaveBlob(e,t)},g.Deferred.Pledge();{const e=Object(g.Deferred)();return Object(Z.vendor)(["vendor/saveas/filesaver"],()=>{Ge=g.Deferred.Pledge,e.resolve()}),e.promise()}}return window.saveAs=(e,t)=>{
const n=URL.createObjectURL(e);_e(n,t,()=>{URL.revokeObjectURL(n)})},g.Deferred.Pledge()};const Ze=e=>{const a={name:"utils",id:"utils"},l=s("div",a.name,a.id,"tab_util_h"),c=l.textContent=o.I18N.getMessage("Utilities"),A=s("div",a.name,a.id,"tab_util");e.appendTab(a.id,l,A,e=>{e.then(()=>{we.set(a.id),document.title=c})}).show();const f=i("div","tv_util",a.name,a.id,"tab_util_cont");let _=()=>{I.a.init(e=>{let t=Object(g.Deferred)();const n=rea.extension.connect("tabWatch")
;return n.onMessage.addListener(e=>{let r;t&&((r=e.tab)?t.notify(r):(t.resolve(),t=null,n.disconnect()))}),n.onDisconnect.addListener(()=>{t&&t.resolve()}),n.postMessage({method:"tabWatch",url:e.url}),{promise:t.promise(),close:function(){t&&t.resolve(),n.disconnect()}}}),_=null},b={};const v=e=>{let t,n;return t="webdav"==e&&(n=m.cloud_config)?{url:n.url,basic_auth:k.a.Base64.encode(n.user+":"+n.pass)}:{},b[e]=b[e]||I.a[e](t)},w=()=>Me(null,{storage:m.script_storage,
global_settings:m.add_tm_settings,externals:m.include_externals}).then(e=>(d(),R.a.zip.create(e.scripts,e.global_settings).progress(d).done(()=>ne()).fail(()=>ie(o.I18N.getMessage("Action_failed"))))),y=e=>{for(let t,n=0;t=e[n];n++)R.a.zip.read(t).progress(d).then(e=>de({scripts:Object.values(e.scripts).map(e=>Ie(e)),global_settings:e.global_settings},{reload:!0})).done(e=>{e.err&&Object(r.cAlert)(e.err)}).fail(()=>{Object(r.cAlert)(o.I18N.getMessage("Unable_to_parse_this_"))}).always(u)
},x=L.createButton(a.name,a.id+"_i_ta",o.I18N.getMessage("Import"),()=>{R.a.json.read(P.value).then(e=>de({scripts:Object.values(e.scripts).map(e=>Ie(e)),global_settings:e.global_settings},{reload:!0})).done(e=>{e.err&&Object(r.cAlert)(e.err)}).fail(()=>{Object(r.cAlert)(o.I18N.getMessage("Unable_to_parse_this_"))})}),C=L.createFileSelect(o.I18N.getMessage("Import"),{name:"zip",id:a.id},e=>(d(),y(e))),E=L.createFileSelect(o.I18N.getMessage("Import"),{name:"file",id:a.id},e=>{d()
;for(let t,n=0;t=e[n];n++)O(t).then(e=>R.a.json.read(e).then(e=>de({scripts:Object.values(e.scripts).map(e=>Ie(e)),global_settings:e.global_settings},{reload:!0}),(function(){return Ae({code:e},{reload:!0})}))).done(e=>{e.err&&Object(r.cAlert)(e.err)}).fail(()=>{Object(r.cAlert)(o.I18N.getMessage("Unable_to_parse_this_"))}).always(u)}),G=L.createButton(a.name,a.id+"_i_cloud",o.I18N.getMessage("Show_backups"),()=>{d();const e=le.select.value,t=le.select.selectedOptions[0].text;_&&_(),
v(e).list().progress(e=>{e.total>0&&d(t+": "+Math.floor(e.loaded/e.total*100)+"%")}).then(e=>(e=e.filter(e=>e.name.match(/\.zip$/))).length?e:g.Deferred.Breach("empty")).then(t=>{const n=Object(g.Deferred)(),r=$('<table class="nowrap file_select">');$('<thead><tr><th colspan="3">'+o.I18N.getMessage("Please_select_a_file")+":</th></tr></thead>").appendTo(r),t.sort((e,t)=>e.modified-t.modified).forEach(t=>{
const i=$('<input class="button" type="button" value="'+o.I18N.getMessage("Import")+'">').click(()=>{n.resolve(t),h(),d()}),s=$('<input class="button" type="button" value="'+o.I18N.getMessage("Delete")+'">').click(()=>{a.hide(),v(e).delete(t)}),a=$("<tr><td>"+[L.safeTagsReplace(t.name),T.formatBytes(t.size,2),new Date(t.modified).toLocaleString().replace((new Date).toLocaleDateString(),o.I18N.getMessage("Today"))].join("</td><td>")+"</td></tr>");$("<td>").append(i,s).appendTo(a),a.appendTo(r)})
;const i=$('<input class="button" type="button" value="'+o.I18N.getMessage("Cancel")+'">').click(()=>{n.reject("cancel"),h()});return $("<tfoot>").append($("<tr>").append($('<td colspan="3">').append(i))).appendTo(r),u(),p(r[0]),n.promise()}).then(n=>v(e).get(n).progress(e=>{e.total>0&&d(t+": "+Math.floor(e.loaded/e.total*100)+"%")})).then(e=>y([e])).fail(e=>{let t
;"empty"===e?t=o.I18N.getMessage("No_backups_found"):"cancel"==e||("auth_failed"==e?console.warn("cloud: Authentication failed"):t=o.I18N.getMessage("Error")+": "+(e||o.I18N.getMessage("Action_failed"))),t&&Object(r.cAlert)(t),u()})}),Z=L.createButton(a.name,a.id+"_i_url",o.I18N.getMessage("Install"),()=>(d(),Ae({url:ve.value},{reload:!0}).fail(e=>{const t=e.err?e.err:o.I18N.getMessage("Unable_to_parse_this_");Object(r.cAlert)(t)
}).always(u))),N=L.createButton(a.name,a.id+"_e_ta",o.I18N.getMessage("Export"),()=>{d(),Me(null,{storage:m.script_storage,global_settings:m.add_tm_settings,externals:m.include_externals}).then(e=>R.a.json.create(e.scripts,e.global_settings)).done(e=>{P.value=e,ne()}).fail(()=>ie(o.I18N.getMessage("Action_failed"))).always(u)}),S=L.createButton(a.name,a.id+"_e_file",o.I18N.getMessage("Export"),()=>{d(),Me(null,{storage:m.script_storage,global_settings:m.add_tm_settings,
externals:m.include_externals}).then(e=>R.a.json.create(e.scripts,e.global_settings).then(e=>Ge().done(()=>{const t=new Blob([e],{type:"text/plain"});saveAs(t,Object(r.safeFileName)("tampermonkey-backup-"+V.RUNTIME.BROWSER+"-"+(new Date).toISOString().replace(/[.:]/g,"-")+".txt")),ne()}))).fail(()=>ie(o.I18N.getMessage("Action_failed"))).always(u)}),U=L.createButton(a.name,a.id+"_e_zip",o.I18N.getMessage("Export"),()=>w().then(e=>Ge().done(()=>{
saveAs(e,Object(r.safeFileName)("tampermonkey-backup-"+V.RUNTIME.BROWSER+"-"+(new Date).toISOString().replace(/[.:]/g,"-")+".zip"))})).always(u)),B=L.createButton(a.name,a.id+"_e_zip",o.I18N.getMessage("Export"),()=>{const e=Object(g.Deferred)(),t=le.select.value,n=le.select.selectedOptions[0].text;return Object(r.cPrompt)(o.I18N.getMessage("Name"),"backup-"+V.RUNTIME.BROWSER+"-"+(new Date).toISOString().replace(/[.:]/g,"-"),i=>{i?e.consume((e=>w().then(r=>(d(n+"..."),_&&_(),
v(t).put(e+".zip",r).progress(e=>{e.total>0&&d(n+":"+Math.floor(e.loaded/e.total*100)+"%")}))).fail(e=>{Object(r.cAlert)(o.I18N.getMessage("Error")+": "+(e||o.I18N.getMessage("Action_failed")))}).always(u))(i)):e.reject("aborted")}),e.promise()}),F=L.createCheckbox(o.I18N.getMessage("Include_TM_settings"),{id:a.id+"_e_export_tm_settings",enabled:"true"},(function(){m.add_tm_settings=this.checked,V.HTML5.LOCALSTORAGE&&V.HTML5.LOCALSTORAGE.setItem("export_tm_settings",m.add_tm_settings)}))
;F.elem.setAttribute("style","padding-left: 2px"),F.input.checked=m.add_tm_settings;const j=L.createCheckbox(o.I18N.getMessage("Include_script_storage"),{id:a.id+"_e_export_storage",enabled:"true"},(function(){m.script_storage=this.checked,V.HTML5.LOCALSTORAGE&&V.HTML5.LOCALSTORAGE.setItem("export_script_storage",m.script_storage)}));j.elem.setAttribute("style","padding-left: 2px; display: inline"),j.input.checked=m.script_storage
;const D=L.createCheckbox(o.I18N.getMessage("Include_script_externals"),{id:a.id+"_e_export_externals",enabled:"true"},(function(){m.include_externals=this.checked,V.HTML5.LOCALSTORAGE&&V.HTML5.LOCALSTORAGE.setItem("export_externals",m.include_externals)}));D.elem.setAttribute("style","padding-left: 2px"),D.input.checked=m.include_externals;var P=i("textarea","importta",a.name,a.id,"ta");P.setAttribute("spellcheck","false")
;const z=i("div","section",a.name,a.id,"ta"),Q=i("div","section_head",a.name,a.id,"head_ta"),H=i("div","section_content",a.name,a.id,"content_ta");Q.textContent=o.I18N.getMessage("General"),H.appendChild(j.elem),H.appendChild(F.elem),H.appendChild(D.elem),z.appendChild(Q),z.appendChild(H);const Y=i("div","section",a.name,a.id,"ta"),X=i("div","section_head",a.name,a.id,"head_ta"),W=i("div","section_content",a.name,a.id,"content_ta");X.textContent=o.I18N.getMessage("TextArea"),W.appendChild(N),
W.appendChild(x),W.appendChild(P),Y.appendChild(X),Y.appendChild(W);const J=i("div","section",a.name,a.id,"sb"),q=i("div","section_head",a.name,a.id,"head_sb"),K=i("div","section_content",a.name,a.id,"content_sb");q.textContent=o.I18N.getMessage("Zip"),J.appendChild(q),J.appendChild(K),K.appendChild(U),K.appendChild(C.elem)
;const ee=i("div","section",a.name,a.id,"sb"),te=i("div","section_head",a.name,a.id,"head_sb"),re=i("div","section_content",a.name,a.id,"content_sb"),se=V.HTML5.LOCALSTORAGE,oe=function(){$(fe).toggle("webdav"===this.value);const e=v(this.value);$(ge).toggle(e&&!!e.revoke),se&&se.setItem("cloud_type",this.value)};let ae;se&&(ae=se.getItem("cloud_type"));var le=L.createDropDown(o.I18N.getMessage("Type"),{id:"cloud_type",value:ae||("edge"==V.RUNTIME.BROWSER?"onedrive":"drive")},[{
name:o.I18N.getMessage("Google_Drive"),value:"drive"},"safari"==V.RUNTIME.BROWSER?null:{name:o.I18N.getMessage("Dropbox"),value:"dropbox"},{name:o.I18N.getMessage("OneDrive"),value:"onedrive"},"safari"==V.RUNTIME.BROWSER?null:{name:o.I18N.getMessage("Yandex_Disk"),value:"yandex"},"safari"==V.RUNTIME.BROWSER?null:{name:o.I18N.getMessage("WebDAV"),value:"webdav"}].filter(e=>e),oe);const ce=e=>function(){let t;b={},(m.cloud_config=m.cloud_config||{})[e]=this.value,
(t=V.HTML5.LOCALSTORAGE)&&t.setItem("cloud_config",k.a.Base64.encode(JSON.stringify(m.cloud_config)))},ue=L.createInput(o.I18N.getMessage("URL"),{id:"select_cloud_url",uuid:a.uuid,value:(m.cloud_config?m.cloud_config.url:null)||""},ce("url")),pe=L.createInput(o.I18N.getMessage("Login"),{id:"select_cloud_username",uuid:a.uuid,value:(m.cloud_config?m.cloud_config.user:null)||""},ce("user")),he=L.createInput(o.I18N.getMessage("Password"),{id:"select_cloud_password",uuid:a.uuid,password:!0,
value:(m.cloud_config?m.cloud_config.pass:null)||""},ce("pass")),fe=[ue.elem,pe.elem,he.elem];n.push(()=>{oe.apply(le.select,[])}),te.textContent=o.I18N.getMessage("Cloud"),ee.appendChild(te),ee.appendChild(re),re.appendChild([le.elem].concat(fe)),re.appendChild(B),re.appendChild(G);const ge=L.createButton("revoke_token_button",a.uuid,o.I18N.getMessage("Revoke_Access_Token"),()=>{_&&_(),$(ge).prop("disabled",!0);const e=v(le.select.value);d(),
e.revoke().then(()=>Object(M.sleep)(15e3)).done(ne).fail(()=>ie(o.I18N.getMessage("Action_failed"))).always(()=>{u(),$(ge).prop("disabled",!1)})});re.appendChild(ge);const me=i("div","section",a.name,a.id,"fi"),_e=i("div","section_head",a.name,a.id,"head_fi"),be=i("div","section_content",a.name,a.id,"content_fi");_e.textContent=o.I18N.getMessage("File"),me.appendChild(_e),me.appendChild(be),be.appendChild(S),be.appendChild(E.elem);const ve=i("input","updateurl_input",a.name,a.id,"url")
;ve.setAttribute("type","text"),ve.setAttribute("spellcheck","false");const ke=i("div","section",a.name,a.id,"ur"),ye=i("div","section_head",a.name,a.id,"head_ur"),Re=i("div","section_content",a.name,a.id,"content_ur");ye.textContent=o.I18N.getMessage("Install_from_URL"),ke.appendChild(ye),ke.appendChild(Re),Re.appendChild(ve),Re.appendChild(Z),f.appendChild(z),"undefined"!=typeof Blob&&f.appendChild(ee),V.RUNTIME.CAN_SAVEAS_ZIP&&f.appendChild(J),"undefined"!=typeof Blob&&f.appendChild(me),
f.appendChild(Y),f.appendChild(ke),Object(r.each)([Y],e=>{const n=" hide";let r=e.getAttribute("class");t.configMode<50?r+=n:r=r.replace(n,""),e.setAttribute("class",r)}),A.appendChild(f)},Te=e=>{Ce(null,e,null,w),u(),ye()},Ne=(e,t,n,a)=>{void 0===a&&(a={});const l=t.item,c=l.uuid+(a.orig||"")+t.id,A=(a.orig?"orig_":"use_")+t.id,d=e=>"select_"+Object(r.createUniqueId)(e,l.uuid)+"_sel1",u=i("div","cludes",e,c,"cb1"),p=s("span",e,c,"cb2");if(a.orig){const n=function(){if("checkbox"==this.type){
const e={};e[this.key]=this.checked,ge(this.uuid,e)}},r="merge_"+t.id,i=!!(l.options&&l.options.override&&l.options.override[r]),s=L.createCheckbox(e,{id:r,uuid:l.uuid,enabled:i},n);p.appendChild(s.elem)}else p.textContent=e;const h=i("select","cludes",A,l.uuid,"sel1");h.innerHTML="",h.setAttribute("size","6"),h.setAttribute("multiple","true");for(let e=0;e<n.length;e++){const t=document.createElement("option");t.value=t.text=n[e],h.appendChild(t)}u.appendChild(p),
l.desc&&L.setHelp(l.desc,u,p,l),u.appendChild(h);const f=e=>{const t=[],n=e&&e.options;for(let e=0,r=n.length;e<r;e++)n[e].selected&&t.push(n[e]);return t},g=()=>{const e=d("use_"+("excludes"==t.id?"includes":"excludes")),n=document.getElementById(e),r=f(h);let i=!1;const s="matches"==t.id;r.forEach(e=>{const t=s?"/"+b.default.getRegExpFromMatch(e.value,!0)+"/":e.value;let r;e&&!n.querySelector('option[value="'+t+'"]')&&(r=e.cloneNode(!0),s&&(r.value=t,r.textContent=t),n.appendChild(r),i=!0)}),
i&&k()},m=()=>{const e=prompt(o.I18N.getMessage("Enter_the_new_rule"));if(e){const t=document.createElement("option");t.value=t.text=e.trim(),h.appendChild(t),k()}},_=()=>{const e=h.options[h.selectedIndex];if(!e)return;const t=prompt(o.I18N.getMessage("Enter_the_new_rule"),e.value);t&&(e.value=e.text=t.trim(),k())},v=()=>{const e=f(h);let t=!1;e.forEach(e=>{e&&(e.parentNode.removeChild(e),t=!0)}),t&&k()},w=e=>{const t=[];for(let n=0;n<e.options.length;n++)t.push(e.options[n].value);return t}
;var k=()=>{const e={includes:w(document.getElementById(d("use_includes"))),matches:w(document.getElementById(d("use_matches"))),excludes:w(document.getElementById(d("use_excludes"))),connects:w(document.getElementById(d("use_connects"))),temp_connects:w(document.getElementById(d("use_temp_connects"))),blockers:w(document.getElementById(d("use_blockers")))};return ge(l.uuid,e),!0};if(a.other_name){const t=s("button",e,c,"btn1",!0);t.textContent=o.I18N.getMessage("Add_as_0clude0",a.other_name),
t.addEventListener("click",g,!1),u.appendChild(t)}else if(!a.orig){const t=s("button",e,c,"btn2",!0);t.textContent=o.I18N.getMessage("Add")+"...",t.addEventListener("click",m,!1),u.appendChild(t);const n=s("button",e,c,"btn3",!0);n.textContent=o.I18N.getMessage("Edit")+"...",n.addEventListener("click",_,!1),u.appendChild(n);const r=s("button",e,c,"btn4",!0);r.textContent=o.I18N.getMessage("Remove"),r.addEventListener("click",v,!1),u.appendChild(r)}return{elem:u}
},Se=e=>e.homepage?e.homepage:e.namespace&&0==e.namespace.search(/https?:\/\//)?e.namespace:null,Ue=e=>{const n="http://"+e+"/",r=V.RUNTIME.CHROME?"chrome://favicon/"+n:null;let i;return i=0==n.indexOf("http://userscripts.org/")||0==n.indexOf("http://userscripts.com/")?Q.origin("uso"):"native"==t.favicon_service?n+"favicon.ico":"duckduckgo"==t.favicon_service?"https://icons.duckduckgo.com/ip2/"+encodeURIComponent(e)+".ico":"https://www.google.com/s2/favicons?domain="+encodeURIComponent(e),[i,r]
},Be=(e,t)=>{const n=s("div",e.uuid,"script_setting_h"),r=s("div",e.uuid,"script_settings_c");n.textContent=o.I18N.getMessage("Settings");const a=function(){const e={};if("checkbox"==this.type)e[this.key]=!!this.checked,ge(this.uuid,e);else if("button"==this.type)e[this.key]=!this.oldvalue,ge(this.uuid,e);else if("text"==this.type||"textarea"==this.type||"select-one"==this.type){const t=L.getValue(this);e[this.key]=t,ge(this.uuid,e)}},l=L.createCheckbox(o.I18N.getMessage("Enabled"),{
id:"enabled",uuid:e.uuid,name:"upd",enabled:e.enabled},a).elem,c=L.createPosition(o.I18N.getMessage("Position_")+": ",{id:"position",uuid:e.uuid,name:"pos",pos:e.position,posof:e.positionof},a),A=L.createDropDown(o.I18N.getMessage("Run_at"),{id:"run_at",uuid:e.uuid,name:"run-at",value:e.run_at},[{name:"document-start",value:"document-start"},{name:"document-body",value:"document-body"},{name:"document-end",value:"document-end"},{name:"document-idle",value:"document-idle"},{name:"context-menu",
value:"context-menu"},{name:o.I18N.getMessage("Default"),value:null}],a),d=L.createDropDown(o.I18N.getMessage("No_frames"),{id:"noframes",uuid:e.uuid,name:"no_frames",value:e.noframes},[{name:o.I18N.getMessage("Yes"),value:!0},{name:o.I18N.getMessage("No"),value:!1},{name:o.I18N.getMessage("Default"),value:null}],a),u=L.createCheckbox(o.I18N.getMessage("Check_for_Updates"),{id:"check_for_updates",uuid:e.uuid,name:"upd",enabled:e.check_for_updates
}),p=L.createInput(o.I18N.getMessage("Update_URL_"),{id:"file_url",uuid:e.uuid,name:"uu",value:e.file_url});p.input.setAttribute("class","updateurl_input"),p.elem.setAttribute("class","updateurl"),e.is_external&&p.input.setAttribute("readonly","true");const h=t=>(e.options&&e.options.override?e.options.override[t]:null)||[],f=Ne(o.I18N.getMessage("Original_includes"),{id:"includes",item:e},h("orig_includes"),{orig:!0,other_name:o.I18N.getMessage("User_excludes")
}),g=Ne(o.I18N.getMessage("Original_matches"),{id:"matches",item:e},h("orig_matches"),{orig:!0,other_name:o.I18N.getMessage("User_excludes")}),m=Ne(o.I18N.getMessage("Original_excludes"),{id:"excludes",item:e},h("orig_excludes"),{orig:!0,other_name:o.I18N.getMessage("User_includes")}),_=i("div","clear",e.uuid,"clear"),b=Ne(o.I18N.getMessage("User_includes"),{id:"includes",item:e},h("use_includes")),v=Ne(o.I18N.getMessage("User_matches"),{id:"matches",item:e
},h("use_matches")),w=Ne(o.I18N.getMessage("User_excludes"),{id:"excludes",item:e},h("use_excludes")),k=Ne(o.I18N.getMessage("Original_domain_whitelist"),{id:"connects",item:e},e.connects,{orig:!0}),y=Ne(o.I18N.getMessage("Temporary_domain_whitelist"),{id:"temp_connects",item:e},e.temp_connects),R=Ne(o.I18N.getMessage("User_domain_whitelist"),{id:"connects",item:e},h("use_connects")),x=Ne(o.I18N.getMessage("User_domain_blacklist"),{id:"blockers",item:e
},h("use_blockers")),C=[L.createCheckbox(o.I18N.getMessage("Apply_compatibility_options_to_required_script_too"),{id:"compatopts_for_requires",uuid:e.uuid,name:"",enabled:e.compatopts_for_requires},a),L.createCheckbox(o.I18N.getMessage("Fix_wrappedJSObject_property_access"),{id:"compat_wrappedjsobject",uuid:e.uuid,name:"",enabled:e.compat_wrappedjsobject},a),L.createCheckbox(o.I18N.getMessage("Convert_CDATA_sections_into_a_chrome_compatible_format"),{id:"compat_metadata",uuid:e.uuid,name:"",
enabled:e.compat_metadata},a),L.createCheckbox(o.I18N.getMessage("Replace_for_each_statements"),{id:"compat_foreach",uuid:e.uuid,name:"",enabled:e.compat_foreach},a),L.createCheckbox(o.I18N.getMessage("Add_toSource_function_to_Object_Prototype"),{id:"compat_prototypes",uuid:e.uuid,name:"",enabled:e.compat_prototypes},a)],E=i("div","section",e.uuid,"ta_opt"),I=i("div","section_head",e.uuid,"head_ta_opt"),M=i("div","section_content",e.uuid,"content_ta_opt")
;I.textContent=o.I18N.getMessage("Settings"),E.appendChild(I),E.appendChild(M);const G=i("div","section",e.uuid,"ta_upd"),Z=i("div","section_head",e.uuid,"head_ta_upd"),N=i("div","section_content",e.uuid,"content_ta_upd");Z.textContent=o.I18N.getMessage("Updates"),G.appendChild(Z),G.appendChild(N);const S=i("div","section",e.uuid,"ta_cludes"),U=i("div","section_head",e.uuid,"head_ta_cludes"),B=i("div","section_content",e.uuid,"content_ta_cludes")
;U.textContent=o.I18N.getMessage("Includes_Excludes"),S.appendChild(U),S.appendChild(B);const O=i("div","section",e.uuid,"ta_security"),F=i("div","section_head",e.uuid,"head_ta_security"),j=i("div","section_content",e.uuid,"content_ta_security");F.textContent=o.I18N.getMessage("XHR_Security"),O.appendChild(F),O.appendChild(j);const D=i("div","section",e.uuid,"ta_compat"),P=i("div","section_head",e.uuid,"head_ta_compat"),z=i("div","section_content",e.uuid,"content_ta_compat")
;P.textContent=o.I18N.getMessage("GM_compat_options_"),D.appendChild(P),D.appendChild(z),M.appendChild(l),M.appendChild(c),M.appendChild(A.elem),M.appendChild(d.elem);const V=L.createButton("save_update_button",e.uuid,o.I18N.getMessage("Save"),()=>{a.apply(u.input,[]),e.is_external||a.apply(p.input,[])});N.appendChild([u.elem,p.elem,V]),B.appendChild([f.elem,g.elem,m.elem,_,b.elem,v.elem,w.elem]),j.appendChild([k.elem,y.elem,R.elem,x.elem]),r.appendChild([E,G,S,O])
;for(let e=0;e<C.length;e++)z.appendChild(C[e].elem);r.appendChild(D);const Q={name:"",uuid:e.uuid,id:"comment",value:e.options.comment},H=L.createTextarea(null,Q);H.elem.setAttribute("class","script_setting_wrapper");const Y=s("div",e.uuid,"save"),X=L.createButton("save_button",e.uuid,o.I18N.getMessage("Save"),()=>{a.apply(H.textarea,[])});Y.appendChild(X)
;const W=i("div","section",e.uuid,"ta_comment"),J=i("div","section_head",e.uuid,"head_ta_comment"),q=i("div","section_content",e.uuid,"content_ta_comment");J.textContent=o.I18N.getMessage("Comment"),W.appendChild(J),W.appendChild(q),q.appendChild(H.elem),q.appendChild(Y),r.appendChild(W);const K=i("div","section",e.uuid,"ta_det"),$=i("div","section_head",e.uuid,"head_ta_det"),ee=i("div","section_content",e.uuid,"content_ta_det");$.textContent=o.I18N.getMessage("Details"),K.appendChild($),
K.appendChild(ee),$.textContent=o.I18N.getMessage("Details");const te=i("table","script_details",e.uuid,"script_details");[{label:o.I18N.getMessage("Size"),value:T.formatBytes((e.code?e.code:e).length,2)},{label:o.I18N.getMessage("UUID"),value:e.uuid}].forEach(t=>{const n=i("tr","external_desc",e.uuid,t.label,"tr"),r=i("td","external_desc",e.uuid,t.label,"td1"),s=i("td","",e.uuid,t.label,"td2");r.textContent=t.label,s.textContent=t.value,n.appendChild(r),n.appendChild(s),te.appendChild(n)}),
ee.appendChild(te),r.appendChild(K);const ne=t.appendTab("settings",n,r,e=>{e.then(()=>{we.setSub("settings")})});return we.registerListener(e.uuid,"settings",()=>{ne.select()}),{}},Oe=(e,t,n,a)=>{const l=i("table","externals",e.uuid,"outer_req2html",t,!0);let c=0;const A=[{label:o.I18N.getMessage("URL"),prop:"display_url"},{label:o.I18N.getMessage("Size"),prop:"data",fn:function(e){let t="?";return e&&(void 0!==e.length?t=e.length:void 0!==e.content&&(t=e.content.length)),T.formatBytes(t,2)}},{
label:o.I18N.getMessage("MIME_Type"),prop:"mimetype"},{label:o.I18N.getMessage("Subresource_Integrity"),prop:"sri",fn:function(e){return e?e.type+"="+e.value:o.I18N.getMessage("_not_set_")}},{label:o.I18N.getMessage("Last_updated"),prop:"ts",fn:function(e){return e?new Date(e).toString():null}}];if(A.push({label:o.I18N.getMessage("User_modified"),prop:"modified",klass:"validation",
title:o.I18N.getMessage("This_external_resource_will_not_auto_update__Please_delete_it_in_order_to_enable_updates_again_"),icon:Q.get("info"),fn:function(e){return e?o.I18N.getMessage("Yes"):null}}),e[t].forEach(d=>{const p=c+Object(r.createUniqueId)(d.url)+t;A.forEach(t=>{let n;const r=i("tr","",e.uuid,t.prop,"tr"+p),s=i("td","external_label",e.uuid,t.prop,"td1"+p),o=i("td","external_desc",e.uuid,t.prop,"td2"+p);if(s.textContent=t.label,o.textContent=n=(t.fn?t.fn:e=>e)(d[t.prop]),null!==n){
if(t.klass&&$(o).addClass(t.klass),t.title&&o.setAttribute("title",t.title),t.icon){const n=i("span","validation",e.uuid,"validation","span"+p);n.appendChild(L.createIcon(t.icon+" red","warning",e.uuid,p+"no_require_update_warning")),o.appendChild(n)}r.appendChild(s),r.appendChild(o),l.appendChild(r)}});const h=i("tr","external_desc_buttons",e.uuid,d.url,"tr"+p),f=i("td","",e.uuid,"buttons","td"+p);if(h.appendChild(f),l.appendChild(h),d.ts){if("requires"==t||d.editable){
const t=s("span",e.uuid,"edit_external"+p),r=L.createImageTextButton(e.uuid,"edit_external"+p,o.I18N.getMessage("Edit"),"edit",()=>{Fe(n,e.uuid,d,a)});t.appendChild(r),f.appendChild(t)}const r=s("span",e.uuid,"delete_external"+p),i=L.createImageTextButton(e.uuid,"delete_external"+p,o.I18N.getMessage("Delete"),"delete",()=>{((e,t)=>{try{se(),sendMessage({method:"buttonPress",name:"externals_delete",scriptuid:e,safe_url:t},e=>{K(),ne(),e.items?le(e.items,!1):u()})}catch(e){
console.log("dEx: "+e.message)}})(e.uuid,d.url),i.parentNode&&i.parentNode.removeChild(i)});r.appendChild(i),f.appendChild(r)}c++}),!c){const t=i("tr","script_desc",e.uuid,c,"tr"),n=i("td","script_desc",e.uuid,c,"td1");n.textContent=o.I18N.getMessage("No_entry_found"),t.appendChild(n),l.appendChild(t)}return l},Fe=(e,t,n,r)=>{const i="externals-"+t+"-"+n.url;y[i]={};const s=De({uuid:i,script_uuid:t,mimetype:n.mimetype,name:o.I18N.getMessage("Externals")+" - "+n.url,file_url:n.url,
referrer:"options.scripts.userscripts"},e,()=>{r(s.getEditor())},()=>{delete a["tab"+i],delete a["editor"+i],delete y[i]});s.show()},je=(e,n,l)=>{const c=i("tr","editor_container p100100",e.uuid,"container"),A=l.mimetype||"text/javascript",p=!A||/(application|text)\/(?:x-)?(?:java|ecma)script/.test(A);if(!e.nnew&&E(e.uuid,"lastI"))return a["editor"+e.uuid]||{};e.nnew&&(e.code=(e=>{const t=ve.url?k.a.Base64.decode(ve.url):null
;return e.replace("<$URL$>",t||"http://*/*").replace("<$ICON$>",t?Ue(b.default.parse(t).domain)[0]:f.a.images.empty)})(t.script_templates[0].value));const h=s("div",e.uuid,"script_editor_h"),m=h.inserted,_=s("div",e.uuid,"script_editor_c"),v=i("tr","editormenubar",e.uuid,"container_menu"),w=i("tr","editorbuttonbar",e.uuid,"container_button_menu"),R=i("table","editor_container_o p100100 noborder",e.uuid,"container_o");R.appendChild(w),R.appendChild(v),R.appendChild(c),_.appendChild(R)
;const C=()=>{let n=!1;return c.editor&&(t.editor_enabled?n|=c.editor.changed&&c.editor.mirror.historySize().undo:n=c.editor.value!=e.code),n},I=()=>{H.commands.trimTrailingSpacesIfEnabled(c.editor.mirror),E(e.uuid,"saveEm")},M=(e,t,n)=>{l.do_close&&l.do_close(t,n)},G=n=>{(n||confirm(o.I18N.getMessage("Really_reset_all_changes_")))&&c.editor&&(t.editor_enabled?(c.editor.mirror.setValue(e.code),Z(!1)):c.editor.value=e.code)},Z=e=>{
c.editor.changed!=e&&(l.set_tab_class&&l.set_tab_class("modified",e),q.toggleClass("modified",e)),c.editor.changed=e},T=i("td","",e.uuid,"editor_buttonmenu_td");w.appendChild(T);const N=i("ul","editormenu",e.uuid,"editormenu"),S=i("td","",e.uuid,"editormenu_td");let U,B;S.appendChild(N);const O=(e,t)=>{let n,r;e&&(n=$(e),r=!!t&&n.hasClass("visible")),$("ul.editormenu .submenu").removeClass("visible"),e?(n.toggleClass("visible",!r),B=r?null:e):B=null,e&&r||(U=e=>{let t
;U&&(t=$(e.target))&&!t.closest(".editormenu").length&&(O(),document.body.removeEventListener("click",U),U=null)},document.body.addEventListener("click",U))},F=(t,n)=>{const r=i("li","entry",e.uuid,t,"editormenuentry",!0),o=s("label",e.uuid,t,"editormenulabel_id");o.textContent=n;const a=i("table","submenu noborder",e.uuid,"editormenucontent"+t);return r.appendChild([o,a]),r.addEventListener("click",e=>{$(e.target).closest(".entry").hasClass("list")||O(a,!0)}),
r.addEventListener("mousemove",(function(){B&&B!=this&&O(a)})),{elem:r,content:a}},j=e=>()=>{c.editor.mirror.focus(),c.editor.mirror.execCommand(e)},D={file:{text:o.I18N.getMessage("File"),entries:[{text:o.I18N.getMessage("Save"),command:"save",image:Q.get("filesave"),cb:I},{text:o.I18N.getMessage("Save_to_disk"),command:"save_to_disk",image:Q.get("save_to_disk"),cb:()=>{E(e.uuid,"saveToDisk")}},{type:"sep"},{command:"cancel",text:o.I18N.getMessage("Editor_reset"),image:Q.get("editor_cancel"),
cb:G}].concat(e.nnew||e.is_external?[]:[{text:o.I18N.getMessage("Check_for_Updates"),command:"update",image:Q.get("update"),disabled:(!e.options.check_for_updates||!e.file_url||"none"==e.file_url)&&o.I18N.getMessage("Update_check_is_disabled"),cb:()=>{C()&&!confirm(o.I18N.getMessage("Really_reset_all_changes_"))||(G(!0),E(e.uuid,"scriptUpdate"))}},{text:o.I18N.getMessage("Remove"),command:"remove",image:Q.get("delete"),cb:()=>{M(0,!0,!1),y[e.uuid].deleteScript()}}]).concat([{type:"sep"},{
text:o.I18N.getMessage("Close"),command:"close",image:Q.get("exit"),cb:M}])},edit:{text:o.I18N.getMessage("Edit"),entries:[{text:o.I18N.getMessage("Undo"),command:"undo"},{text:o.I18N.getMessage("Redo"),command:"redo"},{type:"sep"},{text:o.I18N.getMessage("Select_All"),command:"selectAll"},{type:"sep"},{text:o.I18N.getMessage("Toggle_Comment"),command:"toggleComment"},{text:o.I18N.getMessage("Toggle_Comment_Indented"),command:"toggleCommentIndented"},{
text:o.I18N.getMessage("Toggle_Block_Comment"),command:"toggleBlockComment",modes:["js"]},{type:"sep"},{id:"edit_lines",text:o.I18N.getMessage("Lines_Menu"),modes:["js"],entries:[{text:o.I18N.getMessage("Indent"),command:"intelligentTab"},{text:o.I18N.getMessage("Indent_Less"),command:"indentLess"},{text:o.I18N.getMessage("Indent_More"),command:"indentMore"},{text:o.I18N.getMessage("Auto_Indent_all"),command:"reindentall"},{type:"sep"},{text:o.I18N.getMessage("Move_Line_Up"),command:"swapLineUp"
},{text:o.I18N.getMessage("Move_Line_Down"),command:"swapLineDown"},{text:o.I18N.getMessage("Duplicate_Lines"),command:"duplicateLine"},{text:o.I18N.getMessage("Delete_Line"),command:"deleteLine"},{text:o.I18N.getMessage("Join_Lines"),command:"joinLines"},{type:"sep"},{text:o.I18N.getMessage("Insert_Line_Before"),command:"insertLineBefore"},{text:o.I18N.getMessage("Insert_Line_After"),command:"insertLineAfter"}]},{id:"edit_text",text:o.I18N.getMessage("Text"),entries:[{
text:o.I18N.getMessage("Upper_Case"),command:"upcaseAtCursor"},{text:o.I18N.getMessage("Lower_Case"),command:"downcaseAtCursor"},{type:"sep"},{text:o.I18N.getMessage("Delete_Line_Left"),command:"delLineLeft"},{text:o.I18N.getMessage("Delete_Line_Right"),command:"delLineRight"},{text:o.I18N.getMessage("Delete_to_Previous_Word_Boundary"),command:"delGroupBefore"},{text:o.I18N.getMessage("Delete_to_Next_Word_Boundary"),command:"delGroupAfter"},{text:o.I18N.getMessage("Delete_Line"),
command:"deleteLine"},{type:"sep"},{text:o.I18N.getMessage("Transpose"),command:"transposeChars"}]},{id:"edit_sort",text:o.I18N.getMessage("Sort"),entries:[{text:o.I18N.getMessage("Lines"),command:"sortLines"},{text:o.I18N.getMessage("Line_Case_Insensitive"),command:"sortLinesInsensitive"}]},{id:"edit_folding",text:o.I18N.getMessage("Folding"),entries:[{text:o.I18N.getMessage("Fold"),command:"fold"},{text:o.I18N.getMessage("Unfold"),command:"unfold"},{text:o.I18N.getMessage("Fold_All"),
command:"foldAll"},{text:o.I18N.getMessage("Unfold_All"),command:"unfoldAll"}]},{id:"edit_sublime_mark",text:o.I18N.getMessage("Sublime_Mark"),entries:[{text:o.I18N.getMessage("Set_Sublime_Mark"),command:"setSublimeMark"},{text:o.I18N.getMessage("Select_to_Sublime_Mark"),command:"selectToSublimeMark"},{text:o.I18N.getMessage("Swap_with_Sublime_Mark"),command:"swapWithSublimeMark"},{text:o.I18N.getMessage("Delete_to_Sublime_Mark"),command:"deleteToSublimeMark"},{
text:o.I18N.getMessage("Yank_Sublime_Mark"),command:"sublimeYank"}]}]},selection:{text:o.I18N.getMessage("Selection"),entries:[{text:o.I18N.getMessage("Incremental_Find"),command:"selectMatchingPartsOfCurrentSelection"},{text:o.I18N.getMessage("Split_into_Lines"),command:"splitSelection"},{type:"sep"},{text:o.I18N.getMessage("Incremental_Find"),command:"selectMatchingPartsOfCurrentSelection"},{type:"sep"},{text:o.I18N.getMessage("Select_Line"),command:"selectLine"},{
text:o.I18N.getMessage("Select_Scope"),command:"selectScope"},{text:o.I18N.getMessage("Select_Bookmarks"),command:"selectBookmarks"},{text:o.I18N.getMessage("Select_between_Brackets"),command:"selectBetweenBrackets"},{text:o.I18N.getMessage("Select_Next_Occurrence"),command:"selectNextOccurrence"}]},find:{text:o.I18N.getMessage("Find"),entries:[{text:o.I18N.getMessage("Find"),command:"find"},{text:o.I18N.getMessage("Replace"),command:"replace"},{text:o.I18N.getMessage("Replace_All"),
command:"replaceAll"},{type:"sep"},{text:o.I18N.getMessage("Find_Next"),command:"findNext"},{text:o.I18N.getMessage("Find_Previous"),command:"findPrev"},{text:o.I18N.getMessage("Find_Under"),command:"findUnder"},{text:o.I18N.getMessage("Find_All_Under"),command:"findAllUnder"},{text:o.I18N.getMessage("Find_Under_Previous"),command:"findUnderPrevious"},{type:"sep"},{text:o.I18N.getMessage("Incremental_Find"),command:"selectMatchingPartsOfCurrentSelection"}]},goto:{text:o.I18N.getMessage("GoTo"),
entries:[{text:o.I18N.getMessage("Jump_to_line"),command:"jump"},{text:o.I18N.getMessage("Document_Start"),command:"goDocStart"},{text:o.I18N.getMessage("Document_End"),command:"goDocEnd"},{text:o.I18N.getMessage("Group_Left"),command:"goGroupLeft"},{text:o.I18N.getMessage("Group_Right"),command:"goGroupRight"},{text:o.I18N.getMessage("Closing_Bracket"),command:"goToBracket"},{text:o.I18N.getMessage("Line_Up"),command:"goLineUp"},{text:o.I18N.getMessage("Line_Down"),command:"goLineDown"},{
type:"sep"},{text:o.I18N.getMessage("Center_Cursor"),command:"showInCenter"},{type:"sep"},{id:"bookmarks",text:o.I18N.getMessage("Bookmarks"),entries:[{text:o.I18N.getMessage("Toggle"),command:"toggleBookmark"},{text:o.I18N.getMessage("Clear_All"),command:"clearBookmarks"},{type:"sep"},{text:o.I18N.getMessage("Next_Bookmark"),command:"nextBookmark"},{text:o.I18N.getMessage("Prev_Bookmark"),command:"prevBookmark"}]}]},dev:{text:o.I18N.getMessage("Developer"),entries:[{command:"macro",
text:o.I18N.getMessage("Insert_constructor"),modes:["js"]}].concat(!e.system&&t.editor_enabled&&p?[{type:"sep"},{text:o.I18N.getMessage("Run_syntax_check"),command:"lint_script",image:Q.get("check"),cb:()=>{window.setTimeout(()=>{let e;t.editor_enabled&&(e=c.editor)&&(d(),window.setTimeout(()=>{(()=>{const t=e.mirror.performLint(!0);return t&&t.then?t:g.Deferred.Pledge(t)})().then(()=>{const t=e.mirror.state.lint?e.mirror.state.lint.marked:null;if(t&&t.length){
1===t.length?ie(o.I18N.getMessage("One_error_or_hint_was_found_")):ie(o.I18N.getMessage("0count0_errors_or_hints_were_found_",t.length));for(let n,r=0;n=t[r];r++){let t,r,i;if(void 0!==n.line&&void 0!==n.column?(r=n.line,i=n.column):n.lines&&n.lines.length&&(t=n.lines[0],r=t.lineNo()+1,i=t.markedSpans&&t.markedSpans.length?t.markedSpans[0].from+1:1),r&&i){e.mirror.setCursor(r-1,i-1),e.mirror.focus();break}}}else re(o.I18N.getMessage("No_syntax_errors_were_found_"));u()})},100))},0)}},{
text:o.I18N.getMessage("Auto_Indent_all"),command:"reindentall"}]:[]).concat(e.nnew||e.is_external?[]:[{type:"sep"},{text:o.I18N.getMessage("Full_reset"),command:"reset",image:Q.get("script_cancel"),cb:()=>{confirm(o.I18N.getMessage("Really_factory_reset_this_script_"))&&y[e.uuid].fullReset(e=>{e.cleaned&&M(0,!0,!1)})}}]).concat(e.nnew?[{type:"sep"},{id:"templates",text:o.I18N.getMessage("Templates"),entries:t.script_templates.map(e=>({text:e.name,command:e.name,image:Q.get("dot"),cb:function(){
if(C()&&!confirm(o.I18N.getMessage("Really_reset_all_changes_")))return;const n=e.value;c.editor&&(t.editor_enabled?(c.editor.mirror.setValue(n),Z(!1)):c.editor.value=n)}}))}]:[])}},P=(e,t)=>{const n=t[0];let r,i;return(r=e[n])?P(r,t.slice(1)):(e.entries&&e.entries.some(e=>e.command==n?(i=e,!0):!(!e.entries||!(i=P(e,t)))||void 0),i)}
;["file.save_to_disk","file.save","file.cancel","dev.reset","find.findNext","find.findPrev","edit.replace","goto.jump","edit.reindentall","dev.lint_script","file.close"].forEach(t=>{const n=P(D,t.split("."));n&&(n.image?T.appendChild(L.createImageButton(e.uuid,n.id||n.command,n.text,n.image,n.cb||j(n.command))):T.appendChild(L.createButton(n.id||n.command,e.uuid,n.text,n.cb||j(n.command))))});const z=(e,n)=>{const r=n||H.keyMap[t.editor_keyMap];let i,s
;return Object.keys(r).every(t=>r[t]!=e||(i=t,!1)),i||(r.fallthrough&&(s=H.keyMap[r.fallthrough])&&s!==r?z(e,s):void 0)},V=(t,n)=>n.map((n,r)=>{if(n.modes&&!n.modes.includes(p?"js":"other"));else{if("sep"==n.type)return(t=>{const n=i("tr","entry sep",e.uuid,"editorsubmenusep_tr"+t),r=s("td",e.uuid,"editorsubmenusep_td"+t),o=s("hr",e.uuid,"editorsubmenusep"+t);return r.setAttribute("colspan",4),n.appendChild(r),r.appendChild(o),n})(t+r);if(n.command)return((t,n,r,o,a,l,c,A)=>{
const d=l||H.commands.hasOwnProperty(n),u=i("tr","entry "+(!c&&d?"":"disabled"),e.uuid,t,"editorsubmenuentry_tr",!0);let p;p=i("i",o?"far fa-"+o:"far",e.uuid,t,"editorsubmenuentry_i",!0);const h=s("td",e.uuid,"editorsubmenuentry_td_i"+t);h.appendChild(p);const f=i("td","label",e.uuid,"editorsubmenuentry_td_l"+t);f.textContent=r;const g=i("td","shortcut",e.uuid,"editorsubmenuentry_td_m"+t);return g.setAttribute("colspan",2),a&&(g.textContent=a),u.appendChild([h,f,g]),
c?"string"==typeof c&&u.setAttribute("title",c):d&&u.addEventListener("click",A),u})(t+"_"+n.command,n.command,n.text,n.image,z(n.command),!!n.cb,n.disabled,n.cb||j(n.command));{const r=t+n.id,o=((t,n,r)=>{const o=i("tr","entry list",e.uuid,t,"editorsubmenulistentry",!0);let a;a=i("i",r?"far fa-"+r:"far",e.uuid,t,"editorsubmenulistentry_i",!0);const l=s("td",e.uuid,"editorsubmenulistentry_td_i"+t);l.appendChild(a);const c=i("td","label",e.uuid,"editorsubmenulistentry_td_l"+t);c.textContent=n
;const A=i("td",e.uuid,"editorsubmenulistentry_td_m"+t),d=s("td",e.uuid,"editorsubmenulistentry_td_s"+t);o.appendChild([l,c,A,d]);const u=i("span","submenulist",e.uuid,"editorsubmenulistcontent"+t),p=i("span","submenumore",e.uuid,"editorsubmenulistmore"+t),h=i("i","more far fa-caret-right",e.uuid,t,"editorsubmenulistentrymore_i",!0);return p.appendChild([h,u]),d.appendChild([h,p]),{elem:o,content:u}})(r,n.text,n.image),a=V(r,n.entries);if(a.length>0)return o.content.appendChild(a),o.elem}}
}).filter(e=>e);Object.keys(D).forEach(e=>{const t=D[e],n=F(e,t.text),r=V(e,t.entries);r.length>0&&(N.appendChild(n.elem),n.content.appendChild(r))});const X=i("textarea","editorta",e.uuid,"editor");X.setAttribute("wrap","off"),X.setAttribute("spellcheck","false");const W=i("td","editor_outer",e.uuid,"edit"),J=i("div","editor_100 editor_border",e.uuid,"edit");W.appendChild(J),v.appendChild(S),c.inserted||(J.appendChild(X),c.appendChild(W)),y[e.uuid].saveToDisk=()=>{if(!c.editor)return
;const n=t.editor_enabled?c.editor.mirror.getValue():c.editor.value;return d(),Ge().done(()=>{const t=new Blob([n],{type:"text/plain"});saveAs(t,Object(r.safeFileName)(e.name+(e.is_external?"":".user.js")))}).always(()=>{u()})},e.system||(e.is_external?y[e.uuid].saveEm=n=>{if(!c.editor)return;const i=t.editor_enabled?c.editor.mirror.getValue():c.editor.value;((e,t,n)=>{const r=Object(g.Deferred)();try{n.auto_save||se(),sendMessage({method:"saveExternal",uuid:e,code:t,mimetype:n.mimetype,
url:n.url,auto_save:n.auto_save},e=>{n.auto_save||(ne(),K()),(e=e||{}).items?le(e.items,!0):u(),r.resolve(e)})}catch(e){console.log("sS: "+e.message),r.reject({err:e.message})}return r.promise()})(e.script_uuid,i,{url:e.file_url,mimetype:e.mimetype,auto_save:n&&n.auto_save}).done(e=>{e.success?Z(!1):e.aborted||n&&n.auto_save||(e.messages&&e.messages.errors&&e.messages.errors.length?Object(r.cAlert)(e.messages.errors.join("\n")):Object(r.cAlert)(o.I18N.getMessage("Unable_to_parse_this_")))})
}:y[e.uuid].saveEm=n=>{if(!c.editor)return;let i=!0;t.showFixedSrc&&(i=confirm(o.I18N.getMessage("Do_you_really_want_to_store_fixed_code_",o.I18N.getMessage("Show_fixed_source"))));const s=t.editor_enabled?c.editor.mirror.getValue():c.editor.value;return i&&ue(e.uuid,s,{clean:!1,new_script:e.nnew,auto_save:n&&n.auto_save,reload:!0,lastModTime:y[e.uuid].saveEm_lastModTime}).done(t=>{t.installed?e.nnew?M(0,!0,!1):(Z(!1),
t.lastModified&&(e.lastModTime=t.lastModified)):t.aborted||n&&n.auto_save||(t.messages&&t.messages.errors&&t.messages.errors.length?Object(r.cAlert)(t.messages.errors.join("\n")):Object(r.cAlert)(o.I18N.getMessage("Unable_to_parse_this_")))}),i});const q=n.insertTab(null,l.navid,h,_,e=>{e.then(()=>{we.setSub(l.navid),l.on_tab_select&&l.on_tab_select()})},l.on_tab_close);if(q.setHeading(l.tab_name||o.I18N.getMessage("Editor"),50),we.registerListener(e.uuid,l.navid,()=>{q.select(),
t.editor_enabled&&c.editor&&(c.editor.refresh(),c.editor.mirror.focus())}),m)return a["editor"+e.uuid];const ee=(e,t,n,r)=>{e=r.getValue();const i=r.getHelper(H.Pos(0,0),"lint")(e,n,r);if(i&&i.then)return i.then(t);t(i)},te=e=>{pe("editor_theme",e,!0).done(()=>{re("Theme switched to "+e)})},oe=()=>{t.editor_autoSave&&C()&&E(e.uuid,"saveEm",{auto_save:!0})},ae={getTab:function(){return q},getEditor:function(){if(c.editor)return t.editor_enabled?c.editor.mirror:{save:I}},onShow:()=>{(()=>{
const t=Object(g.Deferred)();return e.referrer&&void 0===e.code?he(Object(r.copy)(l.tree_opts||{},{referrer:e.referrer+"."+l.treeid,uuid:e.uuid}),n=>{n.items?(e.code=n.items[0],t.resolve()):t.reject(),u()}):window.setTimeout(t.resolve,100),t.promise()})().done(()=>{const n=_.getElementsByTagName("textarea");if(y[e.uuid].lastI=()=>e,n.length&&!c.editor){const r=n[0],i=()=>{c.editor&&Z(!!c.editor.mirror.historySize().undo)};if(t.editor_enabled){const n=r.parentNode;n.removeChild(r),
c.editor=new Y(n,{mode:A,theme:t.editor_theme,fontSize:t.editor_fontSize,themeOptions:{all:f.a.getEditorThemes().map(e=>e.value),onChange:te},value:e.code,indentUnit:Number(t.editor_indentUnit),tabSize:Number(t.editor_tabSize),indentWithTabs:"tabs"==t.editor_indentWithTabs,smartIndent:"classic"!=t.editor_tabMode,indentByTab:"indent"==t.editor_tabMode,electricChars:"true"==t.editor_electricChars.toString(),lineNumbers:!0,lineWrapping:t.editor_lineWrapping,extraKeys:{
Enter:"newlineAndIndentContinueComment"},keyMap:t.editor_keyMap,bookmarkGutter:!0,gutters:["gutter","CodeMirror-linenumbers","CodeMirror-foldgutter","CodeMirror-lint-markers","CodeMirror-bookmarks"],matchBrackets:!0,foldGutter:!0,styleActiveLine:!0,specifyMoreJsTokens:p,styleSelectedText:!0,autoTrimTrailingSpace:"true"==t.editor_trimTrailingSpacesFromModifiedLines.toString(),highlightSelectionMatches:"off"!=t.editor_highlightSelectionMatches?{showToken:/\w/,annotateScrollbar:!0,
cursorOnly:"cursor"==t.editor_highlightSelectionMatches}:void 0,hintOptions:p?{keywords:Object.keys(x.a.globals)}:void 0,lint:p?{lintOnChange:t.editor_autoLint,autoLintMaxLen:t.editor_autoLintMaxLen,async:!0,getAnnotations:ee,hint_config:t.editor_linter_config||x.a.config}:void 0,showTrailingSpace:t.editor_highlightTrailingWhitespace},o.I18N.getMessage,{save:I,close:M},{change:i,blur:oe})}else c.editor=r,r.value=e.code;l.on_editor_load&&l.on_editor_load()}}).fail(()=>{M(0,!1,!0)})},
onClose:function(t){const n=()=>{c.editor=null,delete y[e.uuid].lastI};if(!t&&C()){const e=confirm(o.I18N.getMessage("There_are_unsaved_changed_"));return e&&n(),!e}return n(),!1}};return a["editor"+e.uuid]=ae,ae},De=(e,t,n,r)=>{let i;e.is_external=!0;const s=()=>{i&&!o.onClose()&&(r(),i&&i.remove(),i=null)},o=je(e,t,{tab_name:e.name,navid:e.uuid,treeid:"external",mimetype:e.mimetype,tree_opts:{url:e.file_url,uuid:e.script_uuid},do_close:function(){window.setTimeout(s,100)},on_tab_close:s,
on_tab_select:n,on_editor_load:n});return i=o.getTab(),o.show=()=>{o.onShow(),i.select()},o},Le=e=>{y[e.uuid]||(y[e.uuid]={});const t=(t,n,r,s)=>{const o=i("dt"," "+(s||""),e.name,e.uuid,"dt_mapping"+n),a=i("dd"," "+(s||""),e.name,e.uuid,"dd_mapping"+n);o.textContent=n,"string"==typeof r?(a.textContent=r,a.setAttribute("title",r)):a.appendChild(r),t.appendChild([o,a])
},n=i("dl","trash_script_details",e.name,e.uuid,"script_details_dl"),r=e.icon,s=i("span","name",e.uuid,"sname"),a=i(r?"img":"span","nameNicon16 icon16 "+(r?"nameNicon16":"nameNOicon16"),e.uuid,"sname_img"),l=i("span","nameNname16",e.uuid,"sname_name"),c=o.I18N.getTranslation(e,"name");l.textContent=c,r&&(a.src=e.icon,s.appendChild(a)),s.appendChild(l),t(n,o.I18N.getMessage("Name"),s),t(n,o.I18N.getMessage("Version"),e.version||""),
t(n,o.I18N.getMessage("Deleted_on"),new Date(e.deleted).toISOString().split("T")[0]);const A=L.createButton("restore",e.uuid+"_restore",o.I18N.getMessage("Restore"),()=>{ue(e.uuid,null,{reload:!0,restore:!0}),n.parentNode.removeChild(n)}),d=y[e.uuid].purgeScript=(t,r)=>{1==(r||confirm(o.I18N.getMessage("Really_delete_0name0__",e.name)))&&((e=>{const t=Object(g.Deferred)();try{se(),sendMessage({method:"purgeScript",uuid:e},e=>{K(),e.items?(ne(),le(e.items,!1)):u(),t.resolve(e)})}catch(e){
console.log("sO: "+e.message),t.reject({err:e.message})}t.promise()})(e.uuid),n.parentNode.removeChild(n))},p=L.createButton("delete",e.uuid+"_delete",o.I18N.getMessage("Delete"),d),h=i("span","",e.uuid,"actions");return h.appendChild([A,p]),t(n,o.I18N.getMessage("Actions"),h,"actions"),[n]},Pe=(e,l,A)=>{let p,h;y[e.uuid]||(y[e.uuid]={});const f=e.icon,m=[];m.push("clickable"),(e.blacklisted||e.foisted)&&m.push("crossedout")
;const _=i("span",m.join(" "),e.uuid,"sname"),b=i(f?"img":"span","nameNicon16 icon16 "+(f?"nameNicon16":"nameNOicon16"),e.uuid,"sname_img"),w=i("span","nameNname16 "+(e.enabled?"":"greyed"),e.uuid,"sname_name");_.appendChild(b);const k=Se(e),R=o.I18N.getTranslation(e,"name");w.textContent=R;const x=s("span",e.uuid,"spos");x.textContent=e.position||"";const C=s("span",e.uuid,"sversion");C.textContent=e.version?e.version:"",f&&(b.src=e.icon);const I=[],M=(e,t,n)=>{
const s=i("span",n||"",e.uuid,"wrap");return t&&("Array"===Object(r.toType)(t)?Object(r.each)(t,e=>{s.appendChild(e)}):s.appendChild(t)),s},G=(t,n)=>{void 0===n&&(n=!t),h&&h.onClose&&h.onClose(t)||(e.uuid&&we.is(e.uuid)&&we.clear(),p&&(p.remove(),p=null),delete a["tab"+e.uuid],delete a["editor"+e.uuid],_.parentNode&&_.parentNode.removeChild(_),n&&window.setTimeout(()=>{const t=Object.keys(c);for(let n,r=0;n=t[r];r++){const t=c[n].script;if(t.uuid==e.uuid){Ce(l,[t],null,A);break}}ye()},0))
},Z=e=>{h&&h.onSelect&&h.onSelect(e)},T=()=>{let n=null;e.nnew?(n=i("div","head_icon",e.uuid,"details_h"),n.appendChild(L.createIcon(e.image_id,"",e.uuid,"new_script_head"))):n=s("div",e.uuid,"details_h");const l=s("div",e.uuid,"details_c");if(p=A.insertTab(null,e.uuid,n,l,Z,e.nnew?null:G),!e.nnew){let t;t=e.version?" "+e.version:"";const n=o.I18N.getMessage("Edit")+" - "+o.I18N.getTranslation(e,"name")+t;p.setHeading(n,50)}h=((e,n,l,c,A)=>{
const p=s("div",n.uuid,"script_tab_head"),h=p.inserted,f=i("table","noborder p100100 heading",n.uuid,"h_table"),m=i("tr","",n.uuid,"h_tr1"),_=i("td","nameNicon64",n.uuid,"h_td1"),b=i("td","",n.uuid,"h_td2");f.appendChild(m),m.appendChild(_),m.appendChild(b),b.setAttribute("style","width: 99%");const v=s("img",n.uuid,"heading_icon"),w=n.icon64?n.icon64:n.icon;v.src=w;const k=i("div","nameNname64",n.uuid,"heading_name");k.textContent=o.I18N.getTranslation(n,"name"),w&&_.appendChild(v),
b.appendChild(k);const y=i("div","author",n.uuid,"author");n.author?y.textContent="by "+n.author:n.copyright&&(y.innerHTML="&copy; ",y.textContent+=n.copyright),b.appendChild(y);const R=i("table","noborder p100100",n.uuid,"table"),x=i("tr","script_tab_head",n.uuid,"tr1"),C=i("tr","details",n.uuid,"tr2"),E=i("td","",n.uuid,"td1"),I=i("td","",n.uuid,"td2");p.appendChild(f),E.appendChild(p),x.appendChild(E),C.appendChild(I),R.appendChild(x),R.appendChild(C),c.appendChild(R)
;const M=z("_details"+n.uuid,I,{tv:"tv tv_alt",tv_table:"tv_table tv_table_alt",tr_tabs:"tr_tabs tr_tabs_alt",tr_content:"tr_content tr_content_alt",td_content:"td_content td_content_alt",td_tabs:"td_tabs td_tabs_alt",tv_tabs_align:"tv_tabs_align tv_tabs_align_alt",tv_tabs_fill:"tv_tabs_fill tv_tabs_fill_alt",tv_tabs_table:"tv_tabs_table tv_tabs_table_alt",tv_contents:"tv_contents tv_contents_alt",tv_tab_selected:"tv_tab tv_selected tv_tab_alt tv_selected_alt",tv_tab_close:"tv_tab_close",
tv_tab:"tv_tab tv_tab_alt",tv_content:"tv_content tv_content_alt"},!0),G=((e,t,n,r)=>je(e,t,{do_close:r,set_tab_class:n,navid:"editor",treeid:"source"}))(n,M,(t,n)=>{e.toggleClass(t,n)},A),Z=n.nnew||n.system?{}:Be(n,M),T=n.nnew||n.system||!n.storage_key_count||t.configMode<80?{}:((e,t)=>{const n=s("div","",e.uuid,"script_storage_h");n.textContent=o.I18N.getMessage("Storage")
;const a=s("div","",e.uuid,"script_storages_c"),l=i("div","section",e.uuid,"ta_storage"),c=i("div","section_head",e.uuid,"head_ta_storage"),A=i("div","section_content",e.uuid,"content_ta_storage");let p;c.textContent=o.I18N.getMessage("Storage"),l.appendChild(c),l.appendChild(A);const h=i("textarea","storageta",e.uuid,"storage");h.setAttribute("wrap","off"),h.setAttribute("spellcheck","false"),h.addEventListener("change",()=>p=!0)
;const f=L.createButton("storage_save_button",e.uuid,o.I18N.getMessage("Save"),()=>{let t=null;try{t=JSON.parse(h.value)}catch(e){return void Object(r.cAlert)(o.I18N.getMessage("Unable_to_parse_this_"))}const n=Object.keys(t),i=Object.keys(e.storage);n.concat(i).filter((e,t,n)=>n.lastIndexOf(e)===t).forEach(r=>{n.includes(r)?i.includes(r)&&t[r]===e.storage[r]||me(e.uuid,r,(e=>{const t=(typeof e)[0];switch(t){case"o":try{e=t+JSON.stringify(e)}catch(e){return void console.log(e)}break;default:
e=t+e}return e})(t[r])):me(e.uuid,r)})}),m=L.createButton("storage_reload_button",e.uuid,o.I18N.getMessage("Reload"),()=>{p&&!confirm(o.I18N.getMessage("Really_reset_all_changes_"))||(d(),_(!0).always(()=>{window.setTimeout(u,500),ne()}))}),_=t=>(h.setAttribute("disabled","disabled"),(()=>{if(e.referrer&&void 0===e.storage){const t=Object(g.Deferred)();return he({referrer:e.referrer+".storage",uuid:e.uuid},e=>{if(e.items){const n={},r=e.items[0];Object.keys(r).forEach(e=>{n[e]=((e,t)=>{
if("string"!=typeof e)return t;{const n=e[0];switch(e=e.substr(1),n){case"b":return"true"===e;case"n":return Number(e);case"o":try{return JSON.parse(e)}catch(e){console.log("values: parseValueFromStorage: "+e)}return t;default:return e}}})(r[e])}),t.resolve(n)}else t.reject();u()}),t.promise()}return g.Deferred.Pledge(e.storage)})().done(n=>{!t&&h.value||(h.value=JSON.stringify(n,null,4),p=!1),e.storage=n,h.removeAttribute("disabled")}).fail(()=>{h.setAttribute("disabled",!0)}))
;A.appendChild(h),A.appendChild(f),A.appendChild(m),a.appendChild(l);const b=t.appendTab("storage",n,a,e=>{e.then(()=>{we.setSub("storage")})});return we.registerListener(e.uuid,"storage",()=>{_(),b.select()}),{}})(n,M),N=n.nnew||n.system||!n.requires.length&&!n.resources.length?{}:((e,t)=>{let n;const r=e=>{n=e},a=s("div","",e.uuid,"script_external_h");a.textContent=o.I18N.getMessage("Externals")
;const l=s("div","",e.uuid,"script_externals_c"),c=i("div","section",e.uuid,"ta_requires"),A=i("div","section_head",e.uuid,"head_ta_requires"),d=i("div","section_content",e.uuid,"content_ta_requires");A.textContent=o.I18N.getMessage("Requires"),c.appendChild(A),c.appendChild(d),d.appendChild(Oe(e,"requires",t,r));const u=i("div","section",e.uuid,"ta_resources"),p=i("div","section_head",e.uuid,"head_ta_resources"),h=i("div","section_content",e.uuid,"content_ta_resources")
;p.textContent=o.I18N.getMessage("Resources"),u.appendChild(p),u.appendChild(h),h.appendChild(Oe(e,"resources",t,r)),l.appendChild(c),l.appendChild(u);const f=t.appendTab("externals",a,l,e=>{e.then(()=>{we.setSub("externals")})});return we.registerListener(e.uuid,"externals",()=>{f.select()}),{getEditor:function(){return n}}})(n,M);if(h)return a["tab"+n.uuid];const S=()=>{let e;return(e=M.getSelectedTab())&&e.isCloseable()?N.getEditor():G.getEditor()},U=n=>{let r=!1
;if("keydown"==n.type&&e.isSelected()&&!n.defaultPrevented){if(27==n.keyCode){if(!t.editor_enabled||"vim"!=t.editor_keyMap){let e;(e=M.getSelectedTab())&&e.isCloseable()?e.close():window.setTimeout(A,0),r=!0}}else if(t.editor_enabled){const e={save:!0,find:!0,findNext:!0,findPrev:!0,replace:!0,replaceAll:!0},t=S(),i=H.keyName(n);t&&!t.hasFocus()&&"handled"==H.lookupKey(i,t.getOption("keyMap"),n=>{if(e[n])return t.execCommand(n),!0})&&(r=!0)}else if(83==n.keyCode&&(n.ctrlKey||n.metaKey)){
const e=S();e&&(e.save(),r=!0)}return r?(n.stopPropagation(),n.preventDefault(),!1):void 0}},B={onShow:()=>{Object(r.each)([Z,G,T,N],e=>{e.onShow&&e.onShow()}),window.addEventListener("keydown",U,!1)},onClose:e=>{let t;return Object(r.each)([Z,G,T,N],n=>{if(n.onClose&&n.onClose(e))return t=!0,!1}),t||window.removeEventListener("keydown",U,!1),t},onSelect:e=>{e.then(()=>{if(n.uuid){const e=we.get().sub,t=M.getTabById(e);we.set(n.uuid,(t?e:null)||"editor"),
document.title=o.I18N.getTranslation(n,"name")}}),Object(r.each)([Z,G,N],t=>{t.onSelect&&t.onSelect(e)})}};return a["tab"+n.uuid]=B,B})(p,e,0,l,G)},N=y[e.uuid].scriptClick=(e,t)=>{p||T(),h&&h.onShow&&h.onShow(),p.show(),e&&1==e.button||t||p.select(),w.setAttribute("open","true")};"true"==w.getAttribute("open")&&N(null,!0);const S=s("span","",e.uuid,"last_updated",!0);let U="?";if(e.nnew||e.system)U="";else if(y[e.uuid].scriptUpdate=()=>{const t=S.textContent;S.textContent="",
S.appendChild(L.createIcon(Q.get("download"),"down",e.uuid,"spinner")),((e,t)=>{try{sendMessage({method:"buttonPress",name:"run_script_updates",scriptuid:e},e=>{ne(),t&&t(e.updatable)})}catch(e){console.log("rSu: "+e.message)}})(e.uuid,n=>{S.textContent=t,n?($(S).addClass("green"),S.title=o.I18N.getMessage("There_is_an_update_for_0name0_avaiable_",e.name),G(!0),fe()):($(S).addClass("red"),S.title=o.I18N.getMessage("No_update_found__sry_"))})},
e.options.check_for_updates&&e.file_url&&"none"!=e.file_url?(S.addEventListener("click",()=>{E(e.uuid,"scriptUpdate")}),S.setAttribute("class","clickable"),S.title=o.I18N.getMessage("Check_for_Updates")):(S.setAttribute("class","greyed italic"),S.title=o.I18N.getMessage("Update_check_is_disabled")),e.lastModified||e.lastUpdated)try{U=((e,t)=>{const n=e.getTime(),r=t.getTime(),i=Math.abs(n-r),s=Math.round(i/6e4),o=Math.round(i/36e5),a=Math.round(i/864e5);return s<=60?s+" min":o<=48?o+" h":a+" d"
})(new Date,new Date(e.lastModified||e.lastUpdated))}catch(e){console.log("o: error calculating time "+e.message)}S.textContent=U;let B,O=s("div",e.uuid,"imported"),F="";n.push(()=>{
t.sync_enabled&&(F=e.nnew||e.system?"":e.sync&&e.sync.imported?e.sync.imported==v.b.eCHROMESYNC?V.RUNTIME.FIREFOX?'<img src="'+Q.brand("firefox")+'" class="icon16" title="Firefox Sync"/>':'<img src="'+Q.brand("chrome")+'" class="icon16" title="Google Sync"/>':e.sync.imported==v.b.eGDRIVE?'<img src="'+Q.brand("gdrive")+'" class="icon16" title="Google Drive"/>':e.sync.imported==v.b.eDROPBOX?'<img src="'+Q.brand("dropbox")+'" class="icon16" title="Dropbox"/>':e.sync.imported==v.b.eWEBDAV?'<img src="'+Q.brand("webdav")+'" class="icon16" title="WebDAV"/>':e.sync.imported==v.b.eYANDEX?'<img src="'+Q.brand("yandex")+'" class="icon16" title="Yandex"/>':e.sync.imported==v.b.eONEDRIVE?'<img src="'+Q.brand("onedrive")+'" class="icon16" title="OneDrive"/>':'<i class="icon16 far fa-'+Q.get("question_mark")+'" />':"",
O.innerHTML=F,O=null)});const j=s("span",e.uuid,"hp");if(e.origin){B=s("a",e.uuid,"hp_origin"),B.setAttribute("href",e.origin.url),B.setAttribute("target","_blank");const t=L.createImage(Q.origin(e.origin.token),"",e.uuid,e.origin.token);B.appendChild(t),j.appendChild(B)}if(k&&(!e.origin||e.origin.url!==k)){B=s("a",e.uuid,"hp_script"),B.setAttribute("href",k),B.setAttribute("target","_blank");const t=L.createIcon(Q.get("home"),"",e.uuid,"homepage","");B.appendChild(t),j.appendChild(B)}
y[e.uuid].saveEm_lastModTime=e.lastModified,y[e.uuid].fullReset=t=>{ue(e.uuid,null,{clean:!0,reload:!0}).done(t||(()=>{})),l.parentNode.removeChild(l)},y[e.uuid].reportAnIssue=t=>{((e,t)=>{try{sendMessage({method:"reportAnIssue",uuid:e,to:t},()=>{})}catch(e){console.log("rRi: "+e.message)}})(e.uuid,t)},y[e.uuid].deleteScript=(t,n)=>{const r={reload:!n};ue(e.uuid,null,r),l.parentNode.removeChild(l)};const D=[];if(!e.nnew&&!e.system&&e.origin&&e.origin.abuse_url){
const t=L.createIcon(Q.get("flag"),"",e.uuid,"issue",o.I18N.getMessage("Report_an_issue_to_the_script_hoster_"),()=>{E(e.uuid,"reportAnIssue","hoster")});D.push(t)}if(!e.nnew&&!e.system&&(e.origin||e.supportURL)){const t=L.createIcon(Q.get("bug"),"",e.uuid,"bug",o.I18N.getMessage("Report_a_bug"),()=>{E(e.uuid,"reportAnIssue","author")});D.push(t)}if(!e.nnew&&!e.system){if(e.remote_url){const t=L.createIcon(Q.get("cloud"),"",e.uuid,"cloud_edit",o.I18N.getMessage("Edit"),()=>{sendMessage({
method:"newTab",url:e.remote_url},()=>{})});D.push(t)}const t=L.createIcon(Q.get("edit"),"",e.uuid,"edit",o.I18N.getMessage("Edit"),()=>{E(e.uuid,"scriptClick")});D.push(t)}if(!e.nnew&&!e.system){const t=L.createIcon(Q.get("delete"),"",e.uuid,"delete",o.I18N.getMessage("Delete"),()=>{E(e.uuid,"deleteScript")});D.push(t)}V.RUNTIME.MOBILE?_.inserted||w.addEventListener("click",()=>{$(l).toggleClass("show_details")}):_.inserted||(_.addEventListener("click",N),_.addEventListener("auxclick",N)),
_.appendChild(w);let P=[e.name];if(e.description&&P.push(o.I18N.getTranslation(e,"description")),(e.blacklisted||e.foisted)&&(P=[e.blacklisted||e.foisted]),_.title=P.join("\n\n").replace(/\"/g,'"'),I.push(e.nnew||e.system?null:{element:qe(e),style:"script_sel"}),I.push(x),I.push((()=>{let t=null;t=e.blacklisted||e.foisted?"enabler_warning":e.enabled?e.contexter?"enabler_enabled enabler_later":"enabler_enabled":"enabler_disabled"
;const n=e.blacklisted||e.foisted||(e.enabled?o.I18N.getMessage("Enabled"):o.I18N.getMessage("Disabled")),r=L.createEnabler(t,e.uuid,"enabled",{append:"enabled",disabled:!!e.blacklisted,title:n},()=>{E(e.uuid,"switchEnabled")});return y[e.uuid].switchEnabled=(t,n,r)=>{void 0===n&&(n=!e.enabled),ge(e.uuid,{enabled:n,whitewash:!!e.foisted},r)},r})()),I.push({element:_,style:"script_name"}),V.RUNTIME.MOBILE){const t=(t,n,r,s)=>{
const o=i("dt","script_info "+(s||""),e.name,e.uuid,"dt_mapping"+n),a=i("dd","script_info "+(s||""),e.name,e.uuid,"dd_mapping"+n);o.textContent=n,"string"==typeof r?a.textContent=r:a.appendChild(r),t.appendChild([o,a])},n=i("dl","script_details",e.name,e.uuid,"script_details_dl");let r;_.appendChild(n),t(n,o.I18N.getMessage("Version"),C),t(n,o.I18N.getMessage("Type"),ze(e),"script_type"),t(n,o.I18N.getMessage("Sites"),Ye(e)),(r=Ve(e))&&t(n,o.I18N.getMessage("Features"),r),
k&&t(n,o.I18N.getMessage("Homepage"),j),U&&t(n,o.I18N.getMessage("Last_updated"),S),I.push(M(e,D,"actions"))}else{I.push({element:C,style:"script_version"}),I.push(ze(e)),I.push(O),I.push(Ye(e)),I.push(Ve(e)),I.push(j),I.push(S),I.push(He(e)),I.push(M(e,D,"actions"));for(let e=I.length;e<10;e++)I.push(null)}return we.registerListener(e.uuid,()=>{N()}),e.nnew&&n.push(()=>{N(null,!0)}),I},ze=e=>{let t;const n=i("span","script_type","",e.uuid,"pos_type",!0)
;return e.nnew||e.userscript&&(t=L.createImage(Q.origin("uso"),"",e.uuid,"user_script",o.I18N.getMessage("This_is_a_userscript")),n.appendChild(t)),n},Ve=e=>{let t,n,r,i=null;const a=[];if(e.nnew)return null;e.system&&(t=L.createIcon(Q.get("lock"),"",e.uuid,"lock",o.I18N.getMessage("This_is_a_system_script")),a.push(t)),e.warnings&&e.warnings.forEach((n,r)=>{t=L.createIcon(Q.get("critical"),"compat",e.uuid,"warning_"+r,n),$(t).addClass("flashing"),a.push(t)}),
e.requires.length&&(r=!e.requires.filter(e=>e.modified).length,t=L.createIcon(Q.get("script_download")+(r?"":" red"),"",e.uuid,"requires",e.requires.filter(e=>e&&e.url).map(e=>e.url).join("\n"),()=>{we.set(e.uuid,"externals")}),a.push(t)),e.resources.length&&(r=!e.resources.filter(e=>e.modified).length,t=L.createIcon(Q.get("resources")+(r?"":" red"),"",e.uuid,"resources",e.resources.filter(e=>e&&e.url).map(e=>e.url).join("\n"),()=>{we.set(e.uuid,"externals")}),a.push(t));let l=!1;const c={
includes:!0,matches:!0};for(n in c)if(e[n]){for(let r=0;r<e[n].length;r++)if(e[n][r]&&(0==e[n][r].search(/\/\^?http(s|\.\*?|s\?|\[[^\]]*s[^\]]*\]|\([^\)]*s[^\)]*\))+/)||0==e[n][r].search(/http[s\*]{1,1}|\*/))){t=L.createIcon(Q.get("encrypted"),"",e.uuid,"encrypt",o.I18N.getMessage("This_script_has_access_to_https_pages")),a.push(t),l=!0;break}if(l)break}const A={};for(n in e.grant.forEach(e=>{A[e]=!0}),
A.GM_xmlhttpRequest&&(t=L.createIcon(Q.get("web"),"",e.uuid,"web",o.I18N.getMessage("This_script_has_full_web_access")),a.push(t)),A.GM_setValue&&(t=L.createIcon(Q.get("db"),"",e.uuid,"db",o.I18N.getMessage("This_script_stores_data")),a.push(t)),A.unsafeWindow&&(t=L.createIcon(Q.get("windowlist"),"",e.uuid,"unsafeWindow",o.I18N.getMessage("This_script_has_access_to_webpage_scripts")),a.push(t)),e.options)if(-1!=n.indexOf("compat_")&&e.options[n]){
t=L.createIcon(Q.get("critical"),"compat",e.uuid,"crit",o.I18N.getMessage("One_or_more_compatibility_options_are_set")),a.push(t);break}for(n in e.antifeatures){const r=e.antifeatures[n];let i;i="ads"==n?o.I18N.getMessage("Antifeature_ads"):"miner"==n?o.I18N.getMessage("Antifeature_miner"):"tracking"==n?o.I18N.getMessage("Antifeature_tracking"):o.I18N.getMessage("Antifeature_other");const s=r[o.I18N.getBestLocale(Object.keys(r))]||r.default||r.en||o.I18N.getMessage("Antifeature_no_details")
;t=L.createIcon(Q.get("about"),"compat",e.uuid,"crit",o.I18N.getMessage("Antifeature__0name0__0description0",i,s)),a.push(t)}return a.length&&(i=s("span","",e.uuid,"pos_features",!0),i.appendChild(a,!0)),i},Qe=(()=>{let e=null,t=null,n=null,r=0,i=0,s=0;const o=t=>{const r=n.x+t.pageX,i=n.y+t.pageY;e.style.top=i+"px",e.style.left=r+"px"};let a,l,c;const A=n=>{if(e&&!a){let e,u,p,h,f,g=null;for(o(n),l&&(window.clearTimeout(l),l=null);g!=s;)g=s,u=t.previousSibling,p=t.nextSibling,h=t.parentNode,
f=d(t),n.pageY>f.y+r+i&&p?(h.removeChild(p),h.insertBefore(p,t),s++,e=!1):n.pageY<f.y&&s>1&&(h.removeChild(u),p?h.insertBefore(u,p):h.appendChild(u),s--,e=!0);const m=Math.min(.03*document.documentElement.clientHeight,100);if(void 0!==e){if(p=e?$(u):$(p),p.length&&!L.isScrolledIntoView(p,{padding:m})){const t=e?p.offset().top-m-p.height():p.offset().top-document.documentElement.clientHeight+m+2*p.height();a=!0;const r=t-document.body.scrollTop;$("html, body").animate({scrollTop:t},0,()=>{
window.setTimeout(()=>{a=!1,l=window.setTimeout(()=>{l=null,c===n&&A({pageX:c.pageX,pageY:c.pageY+r})},100)},100)})}return n.stopPropagation&&(n.stopPropagation(),n.preventDefault()),c=n,!1}}},d=e=>{const t=e.getBoundingClientRect();return{x:Math.floor(t.left+window.pageXOffset),y:Math.floor(t.top+window.pageYOffset)}},u=r=>{e.style.position="static";const i={};return i[e.key]=s,ge(e.uuid,i),e=t=n=null,document.removeEventListener("mousemove",A),document.removeEventListener("scroll",A),
document.removeEventListener("mouseup",u),r.stopPropagation(),r.preventDefault(),!1};return{start:function(a,l){return((s,a)=>{const l=s.parentNode.parentNode,c=l.parentNode,A=c.parentNode.parentNode;e=s,t=c,r=t.offsetHeight,i=t.offsetHeight-l.clientHeight,n=d(A),n.x=-n.x-e.offsetWidth/2,n.y=-n.y-t.offsetHeight/2+2*i,e.style.position="absolute",o(a)})(this,a),s=l,document.addEventListener("mousemove",A),document.addEventListener("scroll",A),document.addEventListener("mouseup",u),
a.stopPropagation(),a.preventDefault(),!1}}})(),He=e=>{const t=i("span","sorting","",e.uuid,"pos_images",!0);if(e.nnew)return t;if("pos"==F()&&"up"==j()||t.setAttribute("style","display: none;"),e.position>1||e.position<e.positionof){const n=i("span","clickable movable","position",e.uuid,!0);n.innerHTML="&#9776;",n.title=o.I18N.getMessage("Click_here_to_move_this_script"),n.uuid=e.uuid,n.key="position",n.addEventListener("mousedown",(function(t){Qe.start.apply(this,[t,e.position])})),
t.appendChild(n)}return t},Ye=e=>{let t=s("span","",e.uuid,"site_images"),n=null;return t.inserted&&(n=t,n.setAttribute("id",n.id+"foo"),t=s("span","",e.uuid,"site_images")),J.topIcons(e,7).forEach(e=>{t.appendChild(e,!0)}),n&&n.parentNode.removeChild(n),t},Xe=e=>{const t=i("div","search_filter",e.name,e.id,"filter");if(t.inserted)return t;const s=$(t);let a,l,A,d=null;const p=(e,t)=>{a&&!e||(d&&window.clearTimeout(d),m.show(),d=window.setTimeout(()=>{_=null,l=v,A=h.value
;const e=()=>l!=v||A!=h.value,t=document.getElementsByName("scriptselectors"),n=[];for(let e=0;e<t.length;e++)n.push(t[e]);a=!0,("matching_url"!=l&&"auto"!=l||!A.match(b.matching_url.match)?g.Deferred.Pledge():(w=b.matching_url.update_interval||w,(e=>{const t=Object(g.Deferred)();return sendMessage({method:"determineScriptsToRun",url:e},e=>{t.resolve(e.scripts||[])}),t.promise()})(A))).then(t=>{
const i=new RegExp(Object(r.escapeForRegExp)(A),"i"),o=new RegExp(Object(r.escapeForRegExp)(A)),a=Object(M.createQueue)({threads:32}),d=[],u=n.map(n=>()=>{let r,a,A,u;return(a=c[n.s_id])&&(A=a.script)&&(u=a.dom)&&!e()?(d.push(()=>{$(u).toggle(!!r),n.is_hidden=!r}),(()=>{if(!s.is(":visible"))return g.Deferred.Pledge();if("auto"==l)return g.Deferred.or(Object.keys(b).map(e=>()=>{const n=b[e];return n.check?n.check(A,n.ignore_case?i:o,t):g.Deferred.Breach()}));{const e=b[l]
;if(e.check)return e.check(A,e.ignore_case?i:o,t)}return g.Deferred.Breach()})().done(()=>{r=!0}).fail(()=>{r=!1})):g.Deferred.Breach()});return g.Deferred.sidebyside(u.map(e=>a.add(e))).always(()=>d.forEach(e=>e()))}).always(()=>{a=!1,e()?p(!1,1):m.fadeOut()})},t||w))},h=i("input","filter_text","sms","all",null);h.setAttribute("spellcheck","false");let f="";h.inserted||h.addEventListener("keyup",()=>{f!=h.value&&(f=h.value,p())})
;const m=$(L.createIcon(Q.get("download"),"wait_for_filter",e.uuid));let _;m.attr("style","vertical-align: middle;"),m.hide(),y.filter={onShow:function(e){p(!0),e&&$(h).focus()},onHide:function(){h.value="",p(!0,1)}};const b={auto:{name:o.I18N.getMessage("Auto"),update_interval:500},name:{name:"@name",sync:function(e,t){return-1!=e.name.search(t)},ignore_case:!0},namespace:{name:"@namespace",sync:function(e,t){return e.namespace&&-1!=e.namespace.search(t)},ignore_case:!0},author:{name:"@author",
sync:function(e,t){return e.author&&-1!=e.author.search(t)},ignore_case:!0},grant:{name:"@grant",default:"GM_",sync:function(e,t){return e.grant&&e.grant.filter(e=>-1!=e.search(t)).length>0},ignore_case:!0},includes:{name:"@include/@match",sync:function(e,t){return e.includes&&e.includes.filter(e=>-1!=e.search(t)).length>0||e.matches&&e.matches.filter(e=>-1!=e.search(t)).length>0},ignore_case:!0},code:{name:o.I18N.getMessage("Source_Code"),async:function(e,t){const n=Object(g.Deferred)();if(!_){
const e=Object(g.Deferred)();_=e.promise(),null,r={code:t.toString()},i=t=>{e.resolve(t)},he({referrer:"options.scripts.userscripts.matches",uuid:null,filter:r},e=>{u(),i(e.items)})}var r,i;return _.done(t=>{window.setTimeout(()=>{(t.includes(e.uuid)?n.resolve:n.reject)()},0)}),n.promise()},ignore_case:!0},comment:{name:o.I18N.getMessage("Comment"),sync:function(e,t){return e.comment&&-1!=e.comment.search(t)},ignore_case:!0},url:{name:o.I18N.getMessage("Update_URL_"),default:"https://",
sync:function(e,t){return e.file_url&&-1!=e.file_url.search(t)},ignore_case:!0},matching_url:{name:o.I18N.getMessage("Matching_URL"),update_interval:1500,default:"http://",match:new RegExp("^https?://.*"),sync:function(e,t,n){return n&&n.includes(e.uuid)}}};Object.keys(b).forEach(e=>{const t=b[e];t.check=t.sync||t.async?function(){return t.sync?t.sync.apply(this,arguments)?g.Deferred.Pledge():g.Deferred.Breach():t.async?t.async.apply(this,arguments):void 0}:null})
;let v="auto",w=b.auto.update_interval;const k=L.createDropDown(o.I18N.getMessage("Filter_by"),{value:0,uuid:"sms-filter",name:"select"},Object.keys(b).map(e=>({name:b[e].name,value:e})),(function(){let e,t;const n=this.value;n!=v&&(v=n,e=b[v],w=(e?e.update_interval:null)||b.auto.update_interval,t=(e?e.default:null)||"",h.value=h.value||t,p())}));return k.elem.setAttribute("class","label"),t.appendChild(k.elem),t.appendChild(h),t.appendChild(m[0]),ve.filter&&n.push(()=>{
y.multiselect.toggleRow(!0,!0),h.value=ve.filter}),t};let We=[];const Je=e=>{We=[],e&&We.push(e)},qe=e=>{const t=s("input","",e.uuid,"sel");return t.type="checkbox",t.s_id=e.uuid,t.name="scriptselectors",t.inserted||t.addEventListener("click",e=>{Je(t),e.ctrlKey||e.metaKey?y.multiselect.un_selectAll():y.multiselect.single_click()}),t},Ke=e=>{const t=i("input","multiselectcb","sms","all",null),n=i("div","filter multiselectcb clickable","sms2","all",null);t.inserted||(t.type="checkbox",
t.addEventListener("click",y.multiselect.un_selectAll),n.addEventListener("click",()=>{y.multiselect.toggleRow()}));let r=0,s=[{name:o.I18N.getMessage("__Please_choose__"),value:0},{name:o.I18N.getMessage("Enable"),value:1},{name:o.I18N.getMessage("Disable"),value:2},{name:o.I18N.getMessage("Toggle_Enable"),value:7}];(V.RUNTIME.CAN_SAVEAS_ZIP||"undefined"!=typeof Blob)&&s.push({name:o.I18N.getMessage("Export"),value:3}),s=s.concat([{name:o.I18N.getMessage("Trigger_Update"),value:5},{
name:o.I18N.getMessage("Factory_Reset"),value:8},{name:o.I18N.getMessage("Remove"),value:6}]);const a=L.createDropDown(o.I18N.getMessage("Apply_this_action_to_the_selected_scripts"),{value:0,uuid:"sms-select",name:"select"},s,(function(){0==this.value?l.setAttribute("disabled","true"):l.removeAttribute("disabled"),r=this.value})),l=L.createButton("MultiSelectButton","start_button",o.I18N.getMessage("Start"),()=>{if(0==r)return void console.log("option: ?!?!");let e,t=null
;if(6==r?t=o.I18N.getMessage("Really_delete_the_selected_items_"):8==r&&(t=o.I18N.getMessage("Really_factory_reset_the_selected_items_")),t&&!confirm(t))return;const n=document.getElementsByName("scriptselectors"),i=[];for(e=0;e<n.length;e++)i.push(n[e]);const s={};let a,l=!1,A=100;for(e=0;e<i.length;e++)if(i[e].checked&&!i[e].is_hidden)if(1==r||2==r||7==r){let t;a="switchEnabled";const n=c[i[e].s_id]?c[i[e].s_id].script:null;7==r?n&&(t=!n.enabled||!!n.foisted):2==r&&n&&n.foisted||(t=1==r),
void 0!==t&&(E(i[e].s_id,a,null,t,!1),l=!0)}else 3==r?s[i[e].s_id]=!0:5==r?(a="scriptUpdate",E(i[e].s_id,a)):6==r?(a="deleteScript",E(i[e].s_id,a,null,!0),l=!0,A=1500):8==r&&(a="fullReset",E(i[e].s_id,a),l=!0,A=1500);3==r&&(d(),Me(s,{storage:m.script_storage,externals:m.include_externals}).then(e=>(d(),V.RUNTIME.CAN_SAVEAS_ZIP?R.a.zip.create(e.scripts).progress(d):R.a.json.create(e.scripts).then(e=>new Blob([e],{type:"text/plain"})))).then(e=>Ge().done(()=>{
saveAs(e,"tampermonkey_scripts"+(V.RUNTIME.CAN_SAVEAS_ZIP?".zip":".txt")),ne()})).fail(()=>ie(o.I18N.getMessage("Action_failed"))).always(()=>{u()})),l&&(d(o.I18N.getMessage("Please_wait___")),window.setTimeout(()=>{fe()},A))});l.setAttribute("class","action_button"),l.setAttribute("disabled","true"),a.elem.appendChild(l);const A=i("div","actions",e.name,e.id,"actions");A.appendChild(a.elem);const p=L.createButton("MultiSelectButton","close_button",o.I18N.getMessage("Close"),()=>{
y.multiselect.toggleRow(!1)});return $(p).addClass("close_button"),{selAllm:t,selAll:n,actionBox:A,close:p}};(()=>{let e=0;y.multiselect={};let t=!1;y.multiselect.toggleRow=(e,n)=>{const r=$(".multiselect");void 0===e&&(e=!t),e?(t=!0,r.addClass("multiselectvisible"),y.filter.onShow(n)):(t=!1,r.removeClass("multiselectvisible"),y.filter.onHide(),y.multiselect.un_selectAll(!1))},y.multiselect.single_click=()=>{let t=0;const n=document.getElementsByName("scriptselectors");let r=!0,i=!1,s=!1,o=0
;for(let e=0;e<n.length;e++){s=!0,r=r&&n[e].checked,i=i||n[e].checked;const t=$(n[e]).closest("tr");n[e].checked?(o++,t.addClass("selected")):t.removeClass("selected")}s&&r&&(t+=2),t!=e&&(e=t,$(".multiselectcb").prop("checked",0!=t?"checked":"")),o&&y.multiselect.toggleRow(!0),y.multiselect.checkScroll&&y.multiselect.checkScroll()},y.multiselect.un_selectAll=t=>{++e>3&&(e=0),1==e&&e++;let n=!1,r=0;const i=document.getElementsByName("scriptselectors");Je(),!0===t&&(e=2)
;for(let s=0;s<i.length;s++){const o=$(i[s]).closest("tr");!1===t?(i[s].checked=!1,o.removeClass("selected")):(0==s&&3==e&&(e=0),n=!0,i[s].checked=3==e||2==e,i[s].checked?(r++,o.addClass("selected"),We.push(i[s])):o.removeClass("selected")),r&&y.multiselect.toggleRow(!0)}void 0===t?e>1&&!n&&(e=0):t||(e=0),$(".multiselectcb").prop("checked",0!=e?"checked":"")}})();const $e={};rea.extension.onMessage.addListener((e,n,i)=>{if("updateOptions"==e.method)t=e.options||t,le(e.items,!1),
i({});else if("confirm"==e.method){const t=e=>{i({confirm:e})};Object(r.cConfirm)(e.msg,t)}else if("showMsg"==e.method)Object(r.cAlert)(e.msg),i({});else{if("status"!=e.method)return!1;ee(e.options),i({})}return!0}),(()=>{const r=i("div","content_wrapper","options","main"),a=i("div","options status","options","status");$(document.body).append(r,a).addClass("main")
;const l=i("div","head_container","opt","head_container"),c=i("div","tv_container_fit","opt","tv_container"),A=s("a","head_link","heads","head_link");A.href="https://www.tampermonkey.net",A.target="_blank";const p=i("div","float","heads","head1"),h=i("img","banner","heads");h.src=Q.brand("tampermonkey");const f=i("div","float head","heads","head2"),g=i("div","header_title","heads"),m=i("div","version","version","version");m.textContent="v"+rea.extension.manifest.version
;const _=s("div","search","box",""),b=i("div","footer","footer");g.innerHTML="Tampermonkey<sup>®</sup>";const v=i("div","social","social");v.textContent=" by Jan Biniok",v.appendChild(L.createSocialButtons()),g.appendChild(v),p.appendChild(h),f.appendChild(g),f.appendChild(m),A.appendChild(p),A.appendChild(f),l.appendChild(A),l.appendChild(_),r.appendChild(l),r.appendChild(c),window.tab_view=w=z("_main",c),w.setFooter(b),n.unshift(()=>{Ze(w),(e=>{let n,r
;const a="help",l="help",c=s("div",a,l,"tab_help_h"),A=c.textContent=o.I18N.getMessage("Help"),p=s("div",a,l,"tab_help");e.appendTab(l,c,p,e=>{e.then(()=>{if(we.set(l),document.title=A,!r){d();const e=i("div","section",a,l,"ta"),c=i("div","section_head",a,l,"head_ta"),A=i("div","section_content",a,l,"content_ta");c.textContent=o.I18N.getMessage("Editor"),e.appendChild([c,A]);const h=i("dl","dl-horizontal shortcuts",a,l,"dl");A.appendChild(h);const f=i("dt","keymapping",a,l,"dt_mapping")
;if(n=i("dd","keymapping",a,l,"dd_mapping"),f.textContent=o.I18N.getMessage("Key_Mapping"),n.textContent=t.editor_keyMap,h.appendChild([f,n]),"vim"==t.editor_keyMap)n=i("dd","keymapping",a,l,"dd_unsup"),n.textContent=o.I18N.getMessage("Please_check_the_0editor0_documentation_for_more_details_","VIM"),h.appendChild(n);else if("emacs"==t.editor_keyMap)n=i("dd","keymapping",a,l,"dd_unsup"),n.textContent=o.I18N.getMessage("Please_check_the_0editor0_documentation_for_more_details_","Emacs"),
h.appendChild(n);else{const e=[];r={};const n=e=>{const t=e.split(/-+/),n=t.pop(),r=[];let i="";return-1!=(i=["up","down","left","right"].indexOf(n.toLowerCase()))&&r.push("#cursor"),n.toLowerCase().match(/f[0-9]{1,2}/)&&r.push("#function"),r.length?r.join("-")+t.join("-")+i+n:("0000"+(100-Math.min(n.length,4))).slice(-4)+n+t.join("-")};[{Esc:"backOrClose",..."mac"!=be?{"Alt-Left":"previousTab","Alt-Right":"nextTab"}:{"Alt-Up":"previousTab","Alt-Down":"nextTab"}
},H.keyMap[t.editor_keyMap],"mac"!=be?H.keyMap.pcDefault:H.keyMap.macDefault,H.keyMap.default].forEach(t=>{Object.keys(t).forEach(i=>{r[i]||"fallthrough"==i||(e.push({name:i,fn:t[i].replace?t[i].replace(/([A-Z])/g," $1").replace(/ [A-Z]/g,e=>e.toLowerCase()):t[i],sort:n(i)}),r[i]=!0)})}),e.sort((e,t)=>e.sort<t.sort?-1:e.sort>t.sort?1:0),e.forEach(e=>{const t=s("dt",a,l,"dt_"+e.sort),n=s("dd",a,l,"dd_"+e.sort);t.textContent=e.name,n.textContent=e.fn,h.appendChild([t,n])})}p.appendChild(e),u()}})
})})(w)}),n.push(()=>{void 0!==ve.contribute&&window.setTimeout(()=>{B("f")},100),e.global=!0}),window.onbeforeunload=()=>{let e;return w.getAllTabs().forEach(t=>{e=e||t.modified()}),e?o.I18N.getMessage("There_are_unsaved_changed_"):void 0}})(),he({referrer:"options"},e=>{if(e.options&&e.options.layout_user_css&&"reset"!==ve.layout){const t=document.createElement("style");t.innerHTML=e.options.layout_user_css,(document.head||document.body||document.documentElement||document).appendChild(t)}
t=e.options||t,e.xhr&&G.default.setConfig(e.xhr),e.items?(le(e.items,!1),e.begging&&n.push(()=>{window.setTimeout(()=>{B(e.begging)},100)})):u()})})};window.requestFileSystem||(window.requestFileSystem=window.webkitRequestFileSystem),window.BlobBuilder||(window.BlobBuilder=window.WebKitBlobBuilder);const W=rea.FEATURES,J=T.images,q=window.MirrorFrame;var K=()=>{f.a.render(()=>{let e=null,t={},n="???",a=null;const l=(e,n,i)=>{i=i||{};const s=Object(g.Deferred)();try{const a={aid:e,method:n}
;i.data&&Object(r.each)(i.data,(e,t)=>{a[t]=i.data[t]}),sendMessage({method:"askCom",data:a},e=>{i.bg||u(),t=e.options||t,e.error?(e.please_close&&window.setTimeout(window.close,100),s.reject(e)):s.resolve(e)}),i.bg||d(o.I18N.getMessage("Please_wait___"))}catch(e){console.warn("sS: "+e.message),s.reject()}return s.promise()},c=()=>l(e.aid,"ping",{bg:!0}),A=()=>l(e.aid,"abort"),p=()=>{let e;const t=i("div","content_wrapper","ask","main"),n=i("div","ask status","ask","status")
;$(document.body).append(t,n).addClass("main");const r=i("div","head_container","ask","head_container"),o=i("div","tv_container_fit","ask","tv_container"),a=s("a","head_link","ask","head_link");a.href="https://www.tampermonkey.net",a.target="_blank";const l=i("div","float","ask","head1"),c=i("img","banner","ask");c.src=J.brand("tampermonkey");const A=i("div","float head","ask","head2"),d=i("div","header_title","heading"),p=i("div","version","version","version")
;p.textContent="v"+rea.extension.manifest.version;const f=s("div","search","box","");d.innerHTML="Tampermonkey<sup>&reg;</sup>",l.appendChild(c),A.appendChild(d),A.appendChild(p),a.appendChild(l),a.appendChild(A),r.appendChild(a),r.appendChild(f),t.appendChild(n),t.appendChild(r),t.appendChild(o);const g=z("_main",o);return e=h(g),u(),e},h=e=>{const t="main",i="main",o=s("div",t,i,"tab_content_h");o.textContent=n;const a=s("div",t,i,"tab_content")
;return e.appendTab(Object(r.createUniqueId)(t,i),o,a).select(),a},f=e=>{const n=e.script,r=e.oldscript,a=i("div","viewer_bottom_tab","bottom",""),l={tv:"tv tv_alt",tv_table:"tv_table tv_table_alt",tr_tabs:"tr_tabs tr_tabs_alt",tr_content:"tr_content tr_content_alt",td_content:"td_content td_content_alt",td_tabs:"td_tabs td_tabs_alt",tv_tabs_align:"tv_tabs_align tv_tabs_align_alt",tv_tabs_fill:"tv_tabs_fill tv_tabs_fill_alt",tv_tabs_table:"tv_tabs_table tv_tabs_table_alt",
tv_contents:"tv_contents tv_contents_alt",tv_tab_selected:"tv_tab tv_selected tv_tab_alt tv_selected_alt",tv_tab_close:"",tv_tab:"tv_tab tv_tab_alt",tv_content:"tv_content tv_content_alt"};if(t.editor_enabled){const e=z("_source"+n.uuid,a,l);let c;const A=(e,t)=>{const n=i("div","tv_content tv_content_alt",e.uuid,t+"container_o"),r=i("table","editor_container_o editor_400p_container_o p100100 noborder",e.uuid,t+"container_o"),s=i("tr","editor_container p100100",e.uuid,t+"container")
;n.appendChild(r),r.appendChild(s);const o=i("td","editor_outer editor_400p_outer",e.uuid,t+"edit"),a=i("div","editor_100 editor_border",e.uuid,t+"edit");return s.appendChild(o),o.appendChild(a),{c:n,e:a}};let d=()=>{const e=Object(g.Deferred)();return Object(Z.vendor)(["vendor/jsdiff/diff"],()=>{d=g.Deferred.Pledge,e.resolve()}),e.promise()};(r&&r.textContent!=n.textContent?d().then(()=>{const i=s("div",n.uuid,"diff_h");i.textContent=o.I18N.getMessage("Changes");const l=A(n,"diff")
;a.diff=new q(l.e,{theme:"diff",fontSize:t.editor_fontSize,value:o.I18N.getMessage("Please_wait___"),noButtons:!0,mode:"diff",readOnly:!0},o.I18N.getMessage),c=e.appendTab("diff",i,l.c,()=>{window.setTimeout(()=>{a.diff.refresh(),a.diff.mirror.focus()},1)}),window.setTimeout(()=>{let e;try{e=window.JsDiff.createTwoFilesPatch(o.I18N.getMessage("Current_Version"),o.I18N.getMessage("New_Version"),r.textContent,n.textContent,void 0,void 0,{timeout:4e3})}catch(e){console.warn(e)}
e||(e=o.I18N.getMessage("The_diff_for_this_script_is_too_large_to_render")),a.diff.mirror.setValue(e)},500)}):g.Deferred.Pledge()).then(()=>{const r=s("div",n.uuid,"source_h");r.textContent=o.I18N.getMessage("Source_Code");const i=A(n,"source");a.editor=new q(i.e,{theme:t.editor_theme,fontSize:t.editor_fontSize,tabSize:Number(t.editor_tabSize),styleSelectedText:!0,highlightSelectionMatches:"off"!=t.editor_highlightSelectionMatches?{showToken:/\w/,annotateScrollbar:!0,
cursorOnly:"cursor"==t.editor_highlightSelectionMatches}:void 0,value:n.textContent,noButtons:!0,matchBrackets:!0,readOnly:!0},o.I18N.getMessage);const l=e.appendTab("source",r,i.c,()=>{window.setTimeout(()=>{a.editor.refresh(),a.editor.mirror.focus()},1)});c=c||l}).then(()=>{c.select()})}else{const e=i("div","editor_400p_outer","editor",n.name),t=i("div","editor_400p editor_border","editor",n.name);a.appendChild(e),e.appendChild(t);const r=i("textarea","editorta","editor",n.name)
;r.setAttribute("wrap","off"),t.appendChild(r),r.value=n.textContent}return a},m=(()=>{const e={};return window.addEventListener("keydown",t=>{let n=!1;if("keydown"==t.type)return e[t.keyCode]&&(n=e[t.keyCode](t)),n?(t.stopPropagation(),t.preventDefault(),!1):void 0},!0),{registerListener:function(t,n){e[t]=n}}})(),b=(e,t,n)=>{n.filter(e=>e.label).forEach(n=>{const r=n.icon?L.createImageTextButton(n.id,n.id,n.label,n.icon,n.fn):L.createButton(n.label,n.id,n.label,n.fn),i=$(r);if(i.addClass(t),
n.id&&i.attr("data-btn-id",n.id),e.appendChild(r),n.focus&&window.setTimeout(()=>{i.focus()},300),n.keyDown){const e=n.keyDown.keyCode?n.keyDown.keyCode:n.keyDown,t=n.keyDown.cb?n.keyDown.cb:n.fn;m.registerListener(e,t)}})},v=t=>{const n=t.script,r=i("div","viewer_last","install"),s=i("div","viewer_content","install_content"),a=i("div","ask_action_buttons","install_buttons"),c=[];return c.push({label:t.messages.action,fn:function(){l(e.aid,"install")},focus:!0}),
W.RUNTIME.CHROME&&W.RUNTIME.BROWSER_VERSION<21&&c.push({label:t.messages.flags.install?o.I18N.getMessage("Process_with_Chrome"):null,fn:function(){R(n.fileURL),$(r).hide()}}),c.push({label:o.I18N.getMessage("Cancel"),fn:x,keyDown:27}),b(a,"install",c),s.appendChild(a),r.appendChild(s),r},w=()=>{const e=i("div","viewer_last","ok"),t=i("div","viewer_content","ok_content"),n=i("div","ask_action_buttons","ok_buttons");return b(n,"import",[{label:o.I18N.getMessage("Ok"),fn:x,focus:!0}]),
t.appendChild(n),e.appendChild(t),e},k=(e,t)=>{const n=s("input",e+"_",t,"",!0);return n.setAttribute(`data-${e}-id`,t),n.checked=!0,n.type="checkbox",n.title=o.I18N.getMessage("Press_ctrl_to_toggle_all_checkboxes"),n.addEventListener("click",r=>{(r.ctrlKey||r.metaKey)&&$(`input[type=checkbox][data-${e}-id][data-${e}-id!=${t}]`).prop("checked",n.checked)}),n},y=(e,t)=>{const n=e.preparat,r=e.content,a=n.script||{},l=a.uuid||a.id||a.name;n.short_info||(n.short_info=[])
;const c=i("div","viewer_upper",l),A=i("div","viewer_info "+(t?"viewer_info_wide":"viewer_info_multiple"),"general",l),d=i("div","viewer_content","general_content",l),u=s("h3","install","heading",l);if(e.checkbox&&u.appendChild(k("import",e.key)),a.icon||a.icon64){const e=s("img","version","heading",l);e.src=a.icon||a.icon64,u.appendChild(e)}const p=s("span","name","heading",l);if(p.textContent=n.heading||a.name||"",u.appendChild(p),a.version){const e=i("span","view_version","heading",l)
;e.textContent="v"==a.version[0]?"":"v",e.textContent+=a.version,u.appendChild(e)}A.appendChild(u),e.externals&&n.short_info.unshift({prop:"externals",dom:k("externals",e.key),label:o.I18N.getMessage("Externals")}),e.storage&&n.short_info.unshift({prop:"storage",dom:k("storage",e.key),label:o.I18N.getMessage("Storage")}),t&&n.short_info.unshift({prop:"heading",value:n.messages.heading,label:o.I18N.getMessage("Action")});const h=i("table","script_desc",l);n.short_info.forEach(e=>{
const n=a[e.prop]||e.value,r=e.dom;if(!r&&!n&&t)return;const s=i("tr","script_desc",e.prop,l),c=i("td","script_desc",e.prop,l+"dt"),A=i("td","script_desc",e.prop,l+"dd");c.textContent=e.label?e.label:"",r?A.appendChild(r):A.textContent=n||o.I18N.getMessage("_not_set_"),s.appendChild(c),s.appendChild(A),h.appendChild(s)}),d.appendChild(h);const f=i("div","viewer_info viewer_info_multiple","info",l);let g;if(t)g=d;else{g=i("div","viewer_content","info_content",l)
;const e=s("h4","action","heading",l);document.title=e.textContent=n.messages.heading,g.appendChild(e)}let m=0;["errors","warnings","info"].forEach(e=>{const t=s("table",e,l+m);(n.messages[e]||[]).forEach(n=>{m++;const r=s("tr",e,l+m),i=s("td",e,l+"dt"+m),o=s("td",e,l+"dd"+m);if("info"==e)if(n.label&&n.value)i.textContent=n.label,o.textContent=n.value;else{let e='<i class="far fa-'+J.get("about")+'"></i>&nbsp;';W.RUNTIME.MOBILE||(i.innerHTML=e,e=""),
o.innerHTML=e+L.safeTagsReplace(n).replace(/\n/g,"<br />")}else if("warnings"==e){let e='<i class="far fa-'+J.get("critical")+'"></i>&nbsp;';W.RUNTIME.MOBILE||(i.innerHTML=e,e=""),o.innerHTML=e+L.safeTagsReplace(n).replace(/\n/g,"<br />")}else if("errors"==e){let e='<i class="far fa-'+J.get("error")+'"></i>&nbsp;';W.RUNTIME.MOBILE||(i.innerHTML=e,e=""),o.innerHTML=e+L.safeTagsReplace(n).replace(/\n/g,"<br />")}r.appendChild(i),r.appendChild(o),t.appendChild(r)}),g.appendChild(t)})
;const _=(e,t,n,r)=>{const c=s("table",e,l);let A=0;const d={};if(t.forEach(t=>{if(A>r)return;const s=t;if(d[s])return;d[s]=!0;const o=i("tr",e+"desc",s,l+A),a=i("td",e+"desc",s,l+A+"dt"),u=i("td",e+"desc",s,l+A+"dd");a.innerHTML=0==A?L.safeTagsReplace(n.label):"&nbsp;",u.innerHTML=A==r?'<span title="'+L.safeTagsReplace(n.warning)+'">...!</span>':L.safeTagsReplace(s),o.appendChild(a),o.appendChild(u),c.appendChild(o),A++}),a.options){const t=a.options.override&&a.options.override["use_"+e]
;if(t&&t.length){const t=i("tr",e+"desc","ovverride",l+A),r=i("td",e+"desc","ovverride",l+A+"dt"),s=i("td",e+"desc","ovverride",l+A+"dd");r.innerHTML=0==A?L.safeTagsReplace(n.label):"&nbsp;",s.innerHTML=L.safeTagsReplace(" ("+o.I18N.getMessage("overwritten_by_user")+")"),t.appendChild(r),t.appendChild(s),c.appendChild(t)}}g.appendChild(c)};_("includes",(a.includes||[]).concat(a.matches||[]),{label:o.I18N.getMessage("Include_s__"),
warning:o.I18N.getMessage("Attention_Can_not_display_all_includes_")},5),_("excludes",a.excludes||[],{label:o.I18N.getMessage("Exclude_s__"),warning:o.I18N.getMessage("Attention_Can_not_display_all_excludes_")},3),A.appendChild(d),f.appendChild(g),c.appendChild(A),c.appendChild(f);const b=i("div","section",l,"install_src");b.appendChild(c),e.install&&b.appendChild(e.install(n)),e.editor&&b.appendChild(e.editor(n)),r.appendChild(b)},R=e=>{A(),window.setTimeout(()=>{
window.location=e+"#bypass=true"},10)};var x=()=>{A(),window.setTimeout(()=>{window.close()},3e3)};const C=()=>{l(e.aid,"unload"),a&&(window.clearInterval(a),a=null),window.removeEventListener("unload",C)};window.addEventListener("unload",C);const E=()=>{window.location.search||window.location.hash?(e=Object(r.getUrlArgs)(),e.aid?((e.aid,l(e.aid,"preparat")).done(t=>{if(t.options&&(t.options.statistics_enabled&&_.a.init("ask",!0,{trackView:!1,version:rea.extension.manifest.version}),
t.options.layout_user_css)){const e=document.createElement("style");e.innerHTML=t.options.layout_user_css,(document.head||document.body||document.documentElement||document).appendChild(e)}n=o.I18N.getMessage("Install");let r=null;t.preparat&&("install"==t.type?r=()=>{y({content:p(),preparat:t.preparat,install:v,editor:f})}:"install_error"==t.type?r=()=>{y({content:p(),preparat:t.preparat,install:w},!0)}:"import"==t.type?r=()=>{((t,n)=>{if(document.title=o.I18N.getMessage("Import"),
t.appendChild((t=>{const n=i("div","viewer_last","import"),r=i("div","viewer_content","import_content"),s=i("div","ask_action_buttons import_buttons","import_buttons");b(s,"import",[{label:o.I18N.getMessage("Import"),fn:function(){const n=Object.keys(t.scripts).filter(e=>!!$("input[type=checkbox][data-import-id="+e+"]:checked").val());var r,i,s,o;r=Object.keys(t.scripts).filter(e=>!!$("input[type=checkbox][data-storage-id="+e+"]:checked").val()),
i=Object.keys(t.scripts).filter(e=>!!$("input[type=checkbox][data-externals-id="+e+"]:checked").val()),s=n,o=t.global_settings&&!!$("input[type=checkbox][data-settings-id=global_settings]:checked").val(),l(e.aid,"import",{data:{storage_ids:r,externals_ids:i,import_ids:s,global_settings:o}})},focus:!0},{label:o.I18N.getMessage("Cancel"),fn:x,keyDown:27}]),r.appendChild(s),n.appendChild(r);const a=i("div","section","btn");return a.appendChild(n),a})(n)),n.global_settings){
const e=i("div","viewer_upper","");(e=>{const t=e.key,n=e.content,r=i("div","viewer_upper",t),a=i("div","viewer_info viewer_info_wide","general",t),l=i("div","viewer_content","general_content",t),c=s("h3","install","heading",t);e.checkbox&&c.appendChild(k(e.checkbox,e.key));const A=s("img","version","heading",t);A.src=J.brand("tampermonkey"),c.appendChild(A);const d=s("span","name","heading",t);d.textContent=o.I18N.getMessage("Global_Settings"),c.appendChild(d),a.appendChild(c)
;const u=i("table","script_desc",t);let p=i("tr","settings_desc","action",t),h=i("td","settings_desc","action",t+"dt"),f=i("td","settings_desc","action",t+"dd");h.textContent=o.I18N.getMessage("Action"),f.textContent=o.I18N.getMessage("Global_settings_import"),p.appendChild(h),p.appendChild(f),u.appendChild(p),p=i("tr","settings_desc","warning",t),h=i("td","settings_desc","warning",t+"dt"),f=i("td","settings_desc","warning",t+"dd");let g='<i class="far fa-'+J.get("critical")+'"></i>&nbsp;'
;W.RUNTIME.MOBILE||(h.innerHTML=g,g=""),f.innerHTML=g+L.safeTagsReplace(o.I18N.getMessage("This_will_overwrite_your_global_settings_")),p.appendChild(h),p.appendChild(f),u.appendChild(p),l.appendChild(u),a.appendChild(l),r.appendChild(a);const m=i("div","section","settings_src");m.appendChild(r),n.appendChild(m)})({content:e,checkbox:"settings",key:"global_settings"}),t.appendChild(e)}const r=n.storage_ids||[],a=n.externals_ids||[];n.scripts&&Object.keys(n.scripts).forEach(e=>{
const s=n.scripts[e],o=i("div","viewer_upper",e);y({content:o,preparat:s,checkbox:"import",storage:r.includes(e),externals:a.includes(e),key:e},!0),t.appendChild(o)})})(p(),t.preparat)}:"permission"==t.type?r=()=>{((t,n)=>{const r=i("div","viewer_last","ok"),a=i("div","viewer_content","ok_content"),c=i("div","ask_action_buttons","ok_buttons");b(c,"permission",[{label:o.I18N.getMessage("Ok"),fn:()=>{const t={permissions:n.permissions,origins:n.origins};rea.permissions.request(t,n=>{let r
;rea.runtime.lastError&&(r=rea.runtime.lastError.message,console.warn("notify: error on getting permission",t,"reason:",r)),((t,n,r)=>{l(e.aid,"permission",{data:{granted:t,permissions:n.permissions,origins:n.origins,error:r}})})(n,t,r)})},focus:!0},{label:o.I18N.getMessage("Cancel"),fn:x,keyDown:27}]),a.appendChild(c),r.appendChild(a)
;const A="permission",d=i("div","viewer_upper",A),u=i("div","viewer_info viewer_info_wide","general",A),p=i("div","viewer_content","general_content",A),h=s("h3","install","heading",A),f=s("span","install","heading_span",A),g=i("span","message","heading",A);document.title=f.textContent=n.title,g.innerHTML=L.safeTagsReplace(n.message).replace(/\n/g,"<br>"),h.appendChild(f),p.appendChild(g),u.appendChild(h),u.appendChild(p),d.appendChild(u);const m=i("div","section","perm_src",A);m.appendChild(d),
m.appendChild(r),t.appendChild(m)})(p(),t.preparat)}:"connect"==t.type&&(r=()=>{((t,n)=>{const r=Date.now();let a,c;n.timeout&&(a=window.setTimeout(()=>{x(),d()},n.timeout));const A=()=>$("input[data-btn-id]")[0],d=()=>{let e;c&&window.clearInterval(c),a&&window.clearTimeout(a),c=a=null,(e=A())&&e.parentNode.removeChild(e)
},u=i("div","viewer_last","ok"),p=i("div","viewer_content","ok_content"),h=i("div","ask_action_buttons","ok_buttons"),f=i("div","ask_action_buttons","ok_buttons"),g=i("div","ask_action_buttons","ok_buttons"),m="connect";b(h,"connect",[{label:o.I18N.getMessage("Allow_once"),icon:"button_ok",fn:function(){return l(e.aid,"connect",{data:{ok:!0,allow:!0,once:!0}})},focus:!0},{label:o.I18N.getMessage("Temporarily_allow"),icon:"clock",fn:function(){return l(e.aid,"connect",{data:{ok:!0,allow:!0,
temporary:!0}})}},{label:n.hostname!=n.domain?o.I18N.getMessage("Always_allow"):o.I18N.getMessage("Always_allow_domain"),icon:"yes_domain",fn:function(){return l(e.aid,"connect",{data:{ok:!0,allow:!0}})}},n.domain&&n.hostname!=n.domain?{label:o.I18N.getMessage("Always_allow_domain"),icon:"yes_domain",fn:function(){return l(e.aid,"connect",{data:{ok:!0,allow:!0,whole_domain:!0}})}}:null,n.all_domains?{label:o.I18N.getMessage("Always_allow_all_domains"),icon:"critical",fn:function(){if(d(),
window.confirm(o.I18N.getMessage("This_gives_this_script_the_permission_to_retrieve_and_send_data_from_and_to_every_webpage__This_is_potentially_unsafe__Are_you_sure_you_want_to_continue_")))return l(e.aid,"connect",{data:{ok:!0,allow:!0,all_domains:!0}})}}:null].filter(e=>e)),b(f,"connect",[{label:o.I18N.getMessage("Forbid_once"),icon:"cancel",fn:function(){return l(e.aid,"connect",{data:{ok:!0,deny:!0,once:!0}})},keyDown:27},{
label:n.hostname!=n.domain?o.I18N.getMessage("Always_forbid"):o.I18N.getMessage("Always_forbid_domain"),icon:"no_domain",fn:function(){return l(e.aid,"connect",{data:{ok:!0,deny:!0}})}},n.domain&&n.hostname!=n.domain?{label:o.I18N.getMessage("Always_forbid_domain"),icon:"no",fn:function(){return l(e.aid,"connect",{data:{ok:!0,deny:!0,whole_domain:!0}})}}:null,{label:o.I18N.getMessage("Dont_ask_again"),icon:"no",fn:function(){return l(e.aid,"connect",{data:{ok:!0,deny:!0,all_domains:!0}})}
}].filter(e=>e)),b(g,"connect_misc",[n.tabid?{label:o.I18N.getMessage("Focus_tab"),icon:"windowlist",fn:function(){((e,t)=>{try{sendMessage({method:"buttonPress",name:"focus_tab",...t},()=>{})}catch(e){console.log("button: "+e.message)}})(0,{tabid:n.tabid})}}:null,(()=>{if(n.timeout)return c=window.setInterval(()=>{let e;(e=A())&&$(e).attr("value",o.I18N.getMessage("Skip_timeout__0seconds0_seconds_",Math.round((n.timeout+r-Date.now())/1e3)))},1e3),{
label:o.I18N.getMessage("Skip_timeout__0seconds0_seconds_",Math.round(n.timeout/1e3)),id:"skip_timeout_button",fn:d}})()].filter(e=>e));const _=i("div","viewer_upper",m),v=i("div","viewer_info viewer_info_wide","general",m),w=i("div","viewer_content","general_content",m),k=s("h3","install","heading",m),y=s("span","install","heading_span",m),R=i("span","message","heading",m);if(n.script.icon){const e=s("img","version","heading",m);e.src=n.script.icon,y.appendChild(e)}
document.title=y.textContent=o.I18N.getMessage("A_userscript_wants_to_access_a_cross_origin_resource_");const C=i("div","ask_action_buttons message","help",m),E=s("div","help",m)
;let I=o.I18N.getMessage("A_request_to_a_cross_origin_resource_is_nothing_unusual__You_just_have_to_check_whether_this_script_has_a_good_reason_to_access_this_domain__For_example_there_are_only_a_very_few_reasons_for_a_userscript_to_contact_your_bank__Please_note_that_userscript_authors_can_avoid_this_dialog_by_adding_@connect_tags_to_their_scripts__You_can_change_your_opinion_at_any_time_at_the_scripts_settings_tab_",n.connect_url,n.settings_url)
;I=L.safeTagsReplace(I).replace(/\[url=([^\]]+)\](.*)\[\/url\]/g,'<a target="_blank" href="$1">$2 &#x2B00;</a>').replace(/\n/g,"<br>"),E.innerHTML=I+"<br><br>",C.appendChild(E),k.appendChild(y),p.appendChild([g,C,h,f]),u.appendChild(p);const M=i("table","script_desc",m);[{prop:"name",label:o.I18N.getMessage("Name")},{prop:"src_url",label:o.I18N.getMessage("Tab_URL")},n.domain?{prop:"hostname",label:o.I18N.getMessage("Destination_domain")}:null,{prop:"url",
label:o.I18N.getMessage("Destination_URL")}].forEach(e=>{if(!e)return;const t=n[e.prop]||n.script[e.prop]||e.value,r=i("tr","script_desc",e.prop,m),s=i("td","script_desc",e.prop,m+"dt"),a=i("td","script_desc",e.prop,m+"dd");s.textContent=e.label?e.label:"",a.textContent=t||o.I18N.getMessage("_not_set_"),r.appendChild(s),r.appendChild(a),M.appendChild(r)}),R.appendChild(M),w.appendChild(R),v.appendChild(k),v.appendChild(w),_.appendChild(v);const G=i("div","section","connect_src",m)
;G.appendChild(_),G.appendChild(u),t.appendChild(G)})(p(),t.preparat)}),a=window.setInterval(c,3e3),r&&window.setTimeout(()=>{var e,n;r(),(e=t.preparat)&&(n=e.hints)&&n.length&&n.forEach(e=>{e.globalhint&&L.createGobalHint(e.options,$("body > div.status")[0])})},1))}).fail(()=>{x()}),d(o.I18N.getMessage("Please_wait___"))):x()):window.onhashchange=()=>{E()}};rea.extension.onMessage.addListener((e,n,i)=>{if(t=e.options||t,"confirm"==e.method){const t=e=>{i({confirm:e})}
;Object(r.cConfirm)(e.msg,t)}else{if("showMsg"!=e.method)return!1;Object(r.cAlert)(e.msg),i({})}return!0}),E()})};const ee=rea.FEATURES,te=T.images;let ne=3;if(ee.RUNTIME.MOBILE)try{window.matchMedia("(orientation: portrait)").matches&&(ne=1)}catch(e){}var re=()=>{f.a.render(()=>{let e,t={};const n=(l,h)=>{const _=[];if(h.sub_menu_item){if(h.tabId&&(e=h.tabId),h.items.length){const e=i("table","actiontable at_"+h.id,"actiontable-"+h.id);if(h.more_menu){
const t=i("tr","",h.name,h.id,"mm_outer_tr");e.appendChild(t);const n=i("td","",h.name,h.id,"mm_outer_td1"),r=i("td","",h.name,h.id,"mm_outer_td2");r.setAttribute("colspan",2),t.appendChild([n,r]);const s=i("table","moremenu","mmtable-"+h.id);r.appendChild(s);const o=i("tr","moremenu_toggle",h.name,h.id,"tw_tr1");let l=[o];const c=i("div","clickable",h.name,h.id,"mmname");c.textContent=h.name;const A=i("td","",h.name,h.id,"mm_td2");A.setAttribute("colspan",2),o.appendChild(A),A.appendChild(c)
;const d=i("div","",h.name,h.id,"mmenablercol"),u=i("i","ifdisabled clickable far fa-"+te.get("enabler"),h.name,h.id,"mmenabler"),p=i("i","ifenabled clickable far fa-"+te.get("enabler_enabled"),h.name,h.id,"mmenabler_enabled"),f=i("td","moremenuenabler",h.name,h.id,"tw_td3"),g=$(f);let m;$("body").get(0).addEventListener("click",()=>{m?m=!1:($(s).removeClass("show_moremenu"),g.removeClass("enabled"))},!1),t.addEventListener("click",()=>{g.toggleClass("enabled"),$(s).toggleClass("show_moremenu"),
m=!0},!0),d.appendChild([u,p]),o.appendChild(f),f.appendChild(d),s.appendChild(l),a(s,h.items)}else a(e,h.items);_.push(e)}}else{let e=null;if(h.image?e=L.createIcon(te.get(h.image),h.name,h.id,null,""):h.enabler&&(e=L.createIcon(te.get(t.enabled?"button_ok":"cancel"),h.name,h.uuid,null,"")),e&&_.push(e),h.url||h.urls){const e=s("span",h.name,h.id,"urls"),t=h.urls||[h];for(let n=0;n<t.length;n++){const r=t[n],i=document.createElement("span");let s;r.social?(s=L.createSocialButtons(),
$(i).addClass("social").append(s)):(i.textContent=r.name,s=h.urls?i:l,s.url=r.url,s.url_alt=r.url_alt,s.newtab=r.newtab);const o=function(e){return this.url_alt&&e&&(0!=e.button||e.ctrlKey||e.metaKey)?c(this.url_alt,this.newtab||r.social):c(this.url||this.href,this.newtab||r.social),e.stopPropagation(),e.preventDefault(),!1};if($(s).addClass("clickable").on("click auxclick",o),e.appendChild(i),h.always_visible&&$(l).addClass("always_visible"),n<t.length-1){const t=document.createElement("span")
;t.textContent=" | ",e.appendChild(t)}}_.push(e)}else if(h.globalhint)d(h.options);else if(h.button){const e=function(){let e=!0;this.warning&&(e=A(this.warning)),e&&p(this.key,{reload:this.reload,data:this.data})},t=i("span",h.display||"",h.name,h.id,"bu",!0);t.textContent=h.name,l.key=h.id,l.warning=h.warning,l.reload=h.reload,l.data=h.data,l.addEventListener("click",e),$(l).addClass("clickable"),_.push(t)}else if(h.userscript){
const e=i("table","",h.name,h.uuid,"tw"),t=i("tr","script",h.name,h.uuid,"tw_tr1");let n=[t];const s=i("div","clickable"+(h.active_count?"":" not_executed")+(h.deleted?" was_deleted":""),h.name,h.uuid,"ai");if(h.uuid){const e=[];let n=null;n=h.blacklisted||h.foisted?"enabler_warning":h.enabled?h.contexter?"enabler_enabled enabler_later":"enabler_enabled":"enabler_disabled";const a=h.blacklisted||h.foisted||(h.enabled?o.I18N.getMessage("Enabled"):o.I18N.getMessage("Disabled")),A=function(e){
if(e&&(0!=e.button||e.ctrlKey||e.metaKey))return c(rea.extension.getURL("options.html")+"#nav="+this.key,!0),e.stopPropagation(),e.preventDefault(),!1;h.foisted?v(h.uuid,"whitewash",!0):v(h.uuid,"enabled",!h.enabled)},d=L.createEnabler(n,h.uuid,"enabled",{append:"enabled",disabled:h.blacklisted||h.deleted,title:a},A),p=i("td","",h.name,h.uuid,"tw_td1");t.appendChild(p),p.appendChild(d);const _=i("div","script_name",h.name,h.uuid,"name");if(_.textContent=o.I18N.getTranslation(h,"name"),
s.appendChild(_),s.uuid=h.uuid,s.key=h.uuid,!h.deleted&&!h.blacklisted){$(s).on("click auxclick",A);const t=o.I18N.getMessage("Edit"),n=L.createIcon(te.get("edit"),"",h.uuid,"edit_script",t),r=i("span","clickable",h.name,h.uuid,"edit_script");r.setAttribute("title",t),r.textContent=t,e.push({always_visible:!1,id:"edit_script",img:n,text:r,oc:function(){c(rea.extension.getURL("options.html")+"#nav="+h.uuid,!0)}})}h.blacklisted||h.foisted?(l.setAttribute("title",h.blacklisted||h.foisted),
$(s).addClass("crossedout")):h.active_count?_.title=o.I18N.getMessage("This_script_was_executed_0count0_times",h.active_count):h.all_time_active_count?_.title=o.I18N.getMessage("This_script_was_executed_0count0_times_but_is_not_active_anymore",h.all_time_active_count):_.title=o.I18N.getMessage("This_script_was_not_executed_yet");const w=i("td","",h.name,h.uuid,"tw_td2");let k;if(w.appendChild(s),!h.nnew&&!h.system&&h.abuse){
const t=L.createIcon(te.get("flag"),"",h.uuid,"issue",o.I18N.getMessage("Report_an_issue_to_the_script_hoster_")),n=i("span","clickable",h.name,h.uuid,"action_issue_expl");n.textContent=o.I18N.getMessage("Report_an_issue_to_the_script_hoster_").split(/[\.\(]+/)[0],e.push({always_visible:!1,id:"action_issue_expl",img:t,text:n,oc:function(){u(h.uuid,"hoster")}})}if(!h.nnew&&!h.system&&h.support){
const t=L.createIcon(te.get("bug"),"",h.uuid,"bug",o.I18N.getMessage("Report_a_bug")),n=i("span","clickable",h.name,h.uuid,"action_issue_expl");n.textContent=o.I18N.getMessage("Report_a_bug"),e.push({always_visible:!1,id:"action_issue_expl",img:t,text:n,oc:function(){u(h.uuid,"author")}})}const y={};if(h.active_urls&&h.active_urls.forEach(t=>{const n=b.default.parse(t).hostname;if(y[n])return;y[n]=!0;const r="/"+b.default.getRegExpFromMatch("*://*."+n+"/*",!0)+"/"
;if(h.override&&h.override.use_excludes.includes(r))return;const s=o.I18N.getMessage("Exclude_0domain0",n),a=L.createIcon(te.get("no"),"",h.uuid,"domain"+t,s),l=i("span","clickable",h.name,h.uuid,"action_domain");l.setAttribute("title",s),l.textContent=s,e.push({always_visible:!1,id:"action_domain",img:a,text:l,oc:function(){v(h.uuid,"add_excludes",[r])}})}),!h.deleted&&!h.blacklisted){
const t=o.I18N.getMessage("Delete"),n=L.createIcon(te.get("delete"),"",h.uuid,"delete_script",t),r=i("span","clickable",h.name,h.uuid,"delete_script");r.setAttribute("title",t),r.textContent=t,e.push({always_visible:!1,id:"delete_script",img:n,text:r,oc:function(){m(h.uuid)}})}if(h.menu_cmds){let t;try{t=new RegExp("^"+Object(r.escapeForRegExp)(h.name)+"[ -:+/]*")}catch(e){console.log(e)}h.menu_cmds.forEach(n=>{const r=i("span","clickable",h.name,h.uuid,"menucmd_"+h.id)
;r.setAttribute("title",h.name);const s=t?n.name.replace(t,""):n.name;r.textContent=s;const o=()=>{g(n.id,()=>{ee.ACTIONMENU.CLOSE_ALLOWED&&window.close()})};if(n.accessKey){const e=n.accessKey[0].toUpperCase();if(f(e,o,l)){const t=new RegExp(e,"i");let s=r.textContent.search(t);const o=[];-1==s&&(r.textContent+=" ("+e+")",s=r.textContent.search(t)),o.push({text:r.textContent.substr(0,s)}),o.push({text:r.textContent.substr(s,1),class:"underlined"}),o.push({text:r.textContent.substr(s+1)}),
r.textContent="",o.forEach(e=>{const t=i("span",e.class||"",n.id,e);t.textContent=e.text,r.appendChild(t)})}else console.warn("Registering keyboard shortcut for '"+n.name+"' failed")}e.push({always_visible:!0,id:h.id,img:L.createIcon(te.get(n.image),s,n.id,null,""),text:r,oc:o})})}if(h.deleted||!e.length)t.appendChild(w);else{const n=i("td","",h.name,h.uuid,"mma_outer_td2");n.setAttribute("colspan",2);const r=i("table","moremenu","mmatable-"+h.uuid);n.appendChild(r),t.appendChild(n)
;const s=i("tr","moremenu_toggle",h.name,h.uuid,"mma_n_tr");s.appendChild(w),r.appendChild(s),e.forEach(e=>{const t=h.uuid+e.id,n=i("tr",e.always_visible?" always_visible":"",h.name,h.uuid,"tw_tr1"),s=i("td","clickable",t,"tw_tdn",2,!0);s.setAttribute("colspan","2"),s.addEventListener("click",e.oc),s.appendChild([e.img,e.text]),n.appendChild(s),r.appendChild(n)}),k=i("div","",h.name,h.uuid,"moremenuenabler")
;const o=i("i","ifdisabled clickable far fa-"+te.get("enabler"),h.name,h.uuid,"moremenuenabler"),a=i("i","ifenabled clickable far fa-"+te.get("enabler_enabled"),h.name,h.uuid,"moremenuenabler_enabled"),l=i("td","moremenuenabler",h.name,h.uuid,"tw_td3"),c=$(l);let A;$("body").get(0).addEventListener("click",()=>{A?A=!1:($(r).removeClass("show_moremenu"),c.removeClass("enabled"))},!1),k.addEventListener("click",()=>{c.toggleClass("enabled"),$(r).toggleClass("show_moremenu"),A=!0},!0),
k.appendChild([o,a]),s.appendChild(l),l.appendChild(k)}}e.appendChild(n),_.push(e)}else if(h.referrer){const t=i("span",h.class||"",h.referrer,h.id,"ref",!0);t.textContent=h.name,$(l).addClass("pleasewait"),_.push(t),w(Object(r.copy)(h.data,{referrer:h.referrer}),r=>{$(l).removeClass("pleasewait");const[i,s]=n(l,r.items[0]);let o,a;s?(o=i,a=s):a=i,o&&e.parentNode.replaceChild(o,e),t.parentNode.replaceChild(a,t)})}else{const e=i("span",h.class||"",h.name,h.id,"ai");e.textContent=h.name,_.push(e)}
}return _},a=(e,t,r)=>{Object.keys(t).forEach(i=>{const o=t[i];if(!e){if(!r[o.pos])return void console.warn("Warn(cAm): unknown pos "+o.pos);o.items&&o.items.length&&$(r[o.pos]).show()}const a=e||r[o.pos],l=a?s("tr",o.name,o.uuid||o.id,"outer"):null,c=n(l,o);if(c&&c.length){a.appendChild(l);for(let e,t=0;e=c[t];t++){const n=t==c.length-1?3-t:0,r=s("td","actiontd",o.name,o.uuid||o.id,t);n>0&&r.setAttribute("colspan",n),e&&r.appendChild(e),l.appendChild(r)}}})},l=e=>{let n
;if(n=document.getElementById("action"))n.innerHTML="";else{n=s("div"),n.setAttribute("id","action"),n.setAttribute("class","action");const e=i("div","action status","status","status");e.setAttribute("id","status"),$(document.body).append(e,n)}const r=i("table","actionlayout","actionlayout");n.appendChild(r);const o=i("tr","actionpostr","hor"),l=i("td","actionpostd","hor_west");let c;o.appendChild(l),r.appendChild(o)
;const A=i("table","actionregion noborder ar_top","top"),d=i("table","actionregion noborder ar_right","right");let u;const p=i("table","actionregion noborder ar_left","left"),h=i("table","actionregion noborder ar_bottom","bottom");if(Math.min(t.action_menu_columns,ne)>2){u=i("table","actionregion noborder ar_center","center");const e=i("td","actionpostd","hor_center");c=i("td","actionpostd","hor_east"),e.appendChild(u),o.appendChild(e),o.appendChild(c)
}else Math.min(t.action_menu_columns,ne)>1?(u=d,c=i("td","actionpostd","hor_east"),o.appendChild(c)):(u=p,c=l);$([u,d]).hide(),l.appendChild(A),c.appendChild(d),l.appendChild(p),l.appendChild(h),a(null,e,{top:A,left:p,center:u,right:d,bottom:h})},c=(e,t)=>{try{const n=()=>{t&&ee.ACTIONMENU.CLOSE_ALLOWED&&window.close()};t?sendMessage({method:"newTab",url:e},n):rea.tabs.getSelected(null,r=>{rea.tabs.sendMessage(r.id,{method:"loadUrl",url:e,newtab:t},n)})}catch(e){console.warn("lU:",e)}},A=e=>{
let t=confirm(e.msg),n={};return t&&e.ok?n=e.ok:!t&&e.cancel&&(n=e.cancel),(e.ok||e.cancel)&&(t=!0),n.url&&sendMessage({method:"newTab",url:n.url},()=>null),t},d=e=>{let t;const n=e.key||"general";(t=k[n])&&$(t).remove(),k[n]=L.createGobalHint(Object(r.copy)(e,{instant:!0}),document.getElementById("status"))},u=(e,t,n)=>{try{sendMessage({method:"reportAnIssue",uuid:e,to:t},()=>{n&&n()})}catch(e){console.warn("raI:",e)}},p=(e,t)=>{try{sendMessage({method:"buttonPress",name:e,data:t.data},()=>{
t.reload&&rea.page.reload()})}catch(e){console.warn("rSU:",e)}},h={},f=(e,t,n)=>{const r=e.charCodeAt(0);return h[r]?(console.log("MenuCmdKeyListener: ...failed!"),!1):(h[r]={key:r,cb:t,elem:n},!0)},g=(e,t)=>{try{sendMessage({method:"execMenuCmd",id:e},()=>{t&&t()})}catch(e){console.warn("Error(eMC):",e)}},m=e=>{try{sendMessage({method:"saveScript",uuid:e,code:null},e=>{document.getElementById("action").innerHTML="",e&&e.items&&(e.options&&(t={...t,...e.options}),l(e.items))})}catch(e){
console.warn("Error(sS): "+e.message)}},v=(e,n,r)=>{try{const i={method:"modifyScriptOptions",uuid:e};n&&""!=n&&(i[n]=r),sendMessage(i,e=>{document.getElementById("action").innerHTML="",e&&e.items&&(e.options&&(t={...t,...e.options}),l(e.items))})}catch(e){console.warn("Error(mSo): "+e.message)}},w=(e,n)=>{const r=Date.now(),i=e.referrer,s=e.min_delay,o=e.layout;sendMessage({method:"loadTree",referrer:i,layout:o,url:e.url,available_columns:ne,uuid:e.uuid,tabId:e.tabId},e=>{e.options&&(t={...t,
...e.options},t.statistics_enabled&&_.a.init("act",!0,{trackView:!1,version:rea.extension.manifest.version}));const i=Date.now()-r,o=()=>{n(e)};!s||i>=s?o():window.setTimeout(o,s-i)})},k={};rea.extension.onMessage.addListener((e,t,n)=>{"update"==e.method?y():"status"==e.method?(d(e.options),n({})):console.log('onMessage: Unknown method "'+e.method+'"')});const y=window.main=()=>{w({referrer:"actions",min_delay:ee.ACTIONMENU.MIN_DELAY,layout:!0,tabId:e},e=>{
if(e.options&&e.options.layout_user_css){const t=document.createElement("style");t.innerHTML=e.options.layout_user_css,(document.head||document.body||document.documentElement||document).appendChild(t)}document.body.addEventListener("keydown",e=>{e.altKey||e.ctrlKey||e.shiftKey||Object.keys(h).forEach(t=>{const n=h[t];n&&e.keyCode==n.key&&n.cb.apply(n.elem||window,[])})},!1),l(e.items)})};y()})};if(o.I18N.init(),navigator.serviceWorker){const e=rea.FEATURES.HTML5.LOCALSTORAGE,t=()=>{
["/options.html"].forEach(e=>{navigator.serviceWorker.register("cache.js",{scope:e}).then((function(t){console.debug(`SQ: registration succ'ed for ${e} scope -> ${t.scope}`)})).catch((function(t){console.log(`SQ: registration for ${e} failed -> ${t}`)}))})},n=()=>{navigator.serviceWorker.getRegistrations().then((function(e){for(let t of e)t.unregister()}))};e&&"true"!==e.getItem("no_sw")?t():n()}0===window.location.pathname.indexOf("/action")?(()=>{window.sendMessage=(e,t)=>{e.origin="action"
;const r=e=>{n(),t(e)};rea.extension.sendMessage(e,e=>{if(e&&e.i18n)return o.I18N.setLocale(e.i18n).always(()=>r(e));r(e)})};let e=null,t=null;const n=()=>{e&&(window.clearTimeout(e),e=null),t&&(t.remove(),t=null)};e=window.setTimeout(()=>{t=$('<div id="initialWait" class="lds-css ng-scope"><div class="lds-dual-ring"><div></div><div></div></div></div>'),$("body").append(t)},200),f.a.init({suc:()=>{re()},fail:()=>{n(),
confirm(o.I18N.getMessage("An_internal_error_occured_Do_you_want_to_visit_the_forum_"))&&window.open("https://www.tampermonkey.net/bug")}})})():0===window.location.pathname.indexOf("/options")?(window.sendMessage=(e,t)=>{e.origin="options",rea.extension.sendMessage(e,e=>{if(e&&e.i18n)return o.I18N.setLocale(e.i18n).always(()=>{t(e)});t(e)})},d(o.I18N.getMessage("Please_wait___")),f.a.init({suc:()=>{u(),X()},fail:()=>{
window.confirm(o.I18N.getOriginalMessage("An_internal_error_occured_Do_you_want_to_visit_the_forum_"))&&(window.location.href="https://www.tampermonkey.net/bug")}}),document.title="..."):0===window.location.pathname.indexOf("/ask")?(window.sendMessage=(e,t)=>{e.origin="extension",rea.extension.sendMessage(e,e=>{if(e&&e.i18n)return o.I18N.setLocale(e.i18n).always(()=>{t(e)});t(e)})},f.a.init({suc:()=>{d(o.I18N.getMessage("Please_wait___")),K()},fail:()=>{
window.confirm(o.I18N.getOriginalMessage("An_internal_error_occured_Do_you_want_to_visit_the_forum_"))&&(window.location.href="https://www.tampermonkey.net/bug")}}),document.title="..."):0===window.location.pathname.indexOf("/userscript")&&(()=>{const e=Object(r.getUrlArgs)(!0);e.id&&(window.location.href=rea.extension.getURL("options.html")+"#nav="+e.id+"+editor")})()}]);