tweb/public/12.baab8418093ca242b164.chu...

2 lines
37 KiB
JavaScript
Raw Normal View History

2022-03-25 16:07:29 +01:00
(this.webpackJsonp=this.webpackJsonp||[]).push([[12,6,13,20,23,25],{106:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var i=n(5),a=n(29),s=n(9),o=n(16),r=n(32),l=n(15),c=n(34),d=n(35);let u,h=!1;function p(e){h||(u||(u=r.a.getConfig().then(e=>e.suggested_lang_code!==o.default.lastRequestedLangCode?Promise.all([e,o.default.getStrings(e.suggested_lang_code,["Login.ContinueOnLanguage"]),o.default.getCacheLangPack()]):[]))).then(([t,n])=>{if(!t)return;const r=[];n.forEach(e=>{const t=o.default.strings.get(e.key);t&&(r.push(t),o.default.strings.set(e.key,e))});const u=Object(c.a)("btn-primary btn-secondary btn-primary-transparent primary",{text:"Login.ContinueOnLanguage"});u.lastElementChild.classList.remove("i18n"),Object(s.a)().then(()=>{window.requestAnimationFrame(()=>{e.append(u)})}),l.default.addEventListener("language_change",()=>{u.remove()},{once:!0}),r.forEach(e=>{o.default.strings.set(e.key,e)}),Object(a.b)(u,e=>{Object(i.a)(e),h=!0,u.disabled=!0,Object(d.f)(u),o.default.getLangPack(t.suggested_lang_code)})})}},112:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var i=n(75),a=n(93),s=n(97);function o(e){return function(e){return Object(s.a)(e,"readAsArrayBuffer")}(e).then(e=>new Uint8Array(e))}var r=function(e,t,n,i){return new(n||(n=Promise))((function(a,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function r(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,r)}l((i=i.apply(e,t||[])).next())}))};var l=new class{constructor(){this.blobSupported=!0;try{Object(a.a)([],"")}catch(e){this.blobSupported=!1}}isAvailable(){return this.blobSupported}write(e,t){return t instanceof Blob?o(t).then(t=>e.write(t)):e.write(t)}getFakeFileWriter(e,t){const n=[];return{write:e=>r(this,void 0,void 0,(function*(){if(!this.blobSupported)throw!1;n.push(e)})),truncate:()=>{n.length=0},finalize:(i=!0)=>{const s=Object(a.a)(n,e);return i&&t&&t(s),s}}}},c=function(e,t,n,i){return new(n||(n=Promise))((function(a,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function r(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,r)}l((i=i.apply(e,t||[])).next())}))};class d{constructor(e){this.dbName=e,this.useStorage=!0,i.a.test&&(this.dbName+="_test"),d.STORAGES.length&&(this.useStorage=d.STORAGES[0].useStorage),this.openDatabase(),d.STORAGES.push(this)}openDatabase(){var e;return null!==(e=this.openDbPromise)&&void 0!==e?e:this.openDbPromise=caches.open(this.dbName)}delete(e){return this.timeoutOperation(t=>t.delete("/"+e))}deleteAll(){return caches.delete(this.dbName)}get(e){return this.timeoutOperation(t=>t.match("/"+e))}save(e,t){return this.timeoutOperation(n=>n.put("/"+e,t))}getFile(e,t="blob"){return this.get(e).then(e=>{if(!e)throw"NO_ENTRY_FOUND";return e[t]()})}saveFile(e,t){t instanceof Blob||(t=Object(a.a)(t));const n=new Response(t,{headers:{"Content-Length":""+t.size}});return this.save(e,n).then(()=>t)}timeoutOperation(e){return this.useStorage?new Promise((t,n)=>c(this,void 0,void 0,(function*(){let i=!1;const a=setTimeout(()=>{n(),i=!0},15e3);try{const n=yield this.openDatabase();if(!n)throw this.useStorage=!1,this.openDbPromise=void 0,"no cache?";const a=yield e(n);if(i)return;t(a)}catch(e){n(e)}clearTimeout(a)}))):Promise.reject("STORAGE_OFFLINE")}getFileWriter(e,t){const n=l.getFakeFileWriter(t,t=>this.saveFile(e,t).catch(()=>t));return Promise.resolve(n)}static toggleStorage(e){return Promise.all(this.STORAGES.map(t=>{if(t.useStorage=e,!e)return t.deleteAll()}))}}d.STORAGES=[]},115:function(e,t,n){"use strict";function i(e,t){return t?e.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=+$/,""):e.replace(/-/g,"+").replace(/_/g,"/")}n.d(t,"a",(function(){return i}))},116:function(e,t,n){"use strict";function i(e,t){const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;++i)if(e[i]!==t[i])return!1;return!0}n.d(t,"a",(function(){return i}))},121:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(87),a=n
//# sourceMappingURL=12.baab8418093ca242b164.chunk.js.map