tweb/public/4.43a375490205f285598d.chunk.js
wang chenyu 0a61727f1b Check isComposing for send shortcut for IME users (#11)
* Check isComposing for send shortcut
2021-05-01 20:47:43 +03:00

2 lines
24 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[4,23],{15:function(t,e,s){"use strict";s.r(e),s.d(e,"STATE_INIT",(function(){return u})),s.d(e,"AppStateManager",(function(){return m}));var i=s(38),n=s(9),r=s(45),a=s(22),o=s(16),h=s(2),l=s(10),c=s(62);const d=h.a.version,u={allDialogsLoaded:{},pinnedOrders:{},contactsList:[],updates:{},filters:{},maxSeenMsgId:0,stateCreatedTime:Date.now(),recentEmoji:[],topPeers:[],recentSearch:[],version:d,authState:{_:"authStateSignQr"},hiddenPinnedMessages:{},settings:{messagesTextSize:16,sendShortcut:"enter",animationsEnabled:!0,autoDownload:{contacts:!0,private:!0,groups:!0,channels:!0},autoPlay:{gifs:!0,videos:!0},stickers:{suggest:!0,loop:!0},themes:[{name:"day",background:{type:"image",blur:!1,slug:"ByxGo2lrMFAIAAAAmkJxZabh8eM",highlightningColor:"hsla(85.5319, 36.9171%, 40.402%, 0.4)"}},{name:"night",background:{type:"color",blur:!1,color:"#0f0f0f",highlightningColor:"hsla(0, 0%, 3.82353%, 0.4)"}}],theme:"system",notifications:{sound:!1}},keepSigned:!0},p=Object.keys(u),f=["dialogs","allDialogsLoaded","messages","contactsList","stateCreatedTime","updates","maxSeenMsgId","filters","topPeers","pinnedOrders"];class m extends i.a{constructor(){super(),this.log=Object(a.b)("STATE"),this.neededPeers=new Map,this.singlePeerMap=new Map,this.storages={users:new c.a({storeName:"users"}),chats:new c.a({storeName:"chats"}),dialogs:new c.a({storeName:"dialogs"})},this.storagesResults={},this.loadSavedState()}loadSavedState(){return this.loaded||(console.time("load state"),this.loaded=new Promise(t=>{const e=Object.keys(this.storages),s=e.map(t=>this.storages[t].getAll()),i=p.concat("user_auth").map(t=>r.a.get(t)).concat(s);Promise.all(i).then(s=>{let i=this.state={};for(let t=0,e=p.length;t<e;++t){const e=p[t],n=s[t];void 0!==n?i[e]=n:this.pushToState(e,Object(o.a)(u[e]))}s.splice(0,p.length);const r=s.shift();r&&(i.authState={_:"authStateSignedIn"},n.default.broadcast("user_auth","number"!=typeof r?r.id:r));for(let t=0,i=e.length;t<i;++t)this.storagesResults[e[t]]=s[t];s.splice(0,e.length);const a=Date.now();if(i.stateCreatedTime+864e5<a&&(l.b&&this.log("will refresh state",i.stateCreatedTime,a),f.forEach(t=>{this.pushToState(t,Object(o.a)(u[t]));const e=this.storagesResults[t];e&&e.length&&(e.length=0)})),!i.settings.hasOwnProperty("theme")&&i.settings.hasOwnProperty("nightTheme")&&(i.settings.theme=i.settings.nightTheme?"night":"day",this.pushToState("settings",i.settings)),!i.settings.hasOwnProperty("themes")&&i.settings.background){i.settings.themes=Object(o.a)(u.settings.themes);const t=i.settings.themes.find(t=>t.name===i.settings.theme);t&&(t.background=i.settings.background,this.pushToState("settings",i.settings))}Object(o.k)(u,i,t=>{this.pushToState(t,i[t])}),i.version!==d&&this.pushToState("version",d),n.default.settings=i.settings,l.b&&this.log("state res",i,Object(o.a)(i)),console.timeEnd("load state"),t(i)}).catch(t)})),this.loaded}getState(){return void 0===this.state?this.loadSavedState():Promise.resolve(this.state)}setByKey(t,e){Object(o.j)(this.state,t,e),n.default.broadcast("settings_updated",{key:t,value:e});const s=t.split(".")[0];this.pushToState(s,this.state[s])}pushToState(t,e,s=!0){s&&(this.state[t]=e),r.a.set({[t]:e})}requestPeer(t,e,s){let i=this.neededPeers.get(t);i&&i.has(e)||(i||(i=new Set,this.neededPeers.set(t,i)),i.add(e),this.dispatchEvent("peerNeeded",t),void 0!==s&&this.keepPeerSingle(t,e))}isPeerNeeded(t){return this.neededPeers.has(t)}keepPeerSingle(t,e){const s=this.singlePeerMap.get(e);if(s&&s!==t){const t=this.neededPeers.get(s);t.delete(e),t.size||(this.neededPeers.delete(s),this.dispatchEvent("peerUnneeded",s))}this.singlePeerMap.set(e,t)}}m.STATE_INIT=u;const g=new m;l.a.appStateManager=g,e.default=g},25:function(t,e,s){"use strict";s.d(e,"a",(function(){return g}));var i=s(73),n=s.n(i),r=s(34),a=s(10),o=s(38),h=s(24),l=s(43),c=s(11),d=s(0),u=s(22),p=s(12),f=function(t,e,s,i){return new(s||(s=Promise))((function(n,r){function a(t){try{h(i.next(t))}catch(t){r(t)}}function o(t){try{h(i.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(a,o)}h((i=i.apply(t,e||[])).next())}))};let m=t=>Math.round(255*Math.min(Math.max(t,0),1));class g extends o.a{constructor({el:t,worker:e,options:s}){super(!0),this.reqId=0,this.width=0,this.height=0,this.paused=!0,this.direction=1,this.speed=1,this.autoplay=!0,this.loop=!0,this.group="",this.frames={},this.cachingDelta=0,this.reqId=++g.reqId,this.el=t,this.worker=e;for(let t in s)this.hasOwnProperty(t)&&(this[t]=s[t]);let i;this._loop=this.loop,this._autoplay=this.autoplay,void 0!==s.skipRatio?i=s.skipRatio:(d.isAndroid||d.isAppleMobile||d.isApple&&!d.isSafari)&&this.width<100&&this.height<100&&(i=.5),this.skipDelta=void 0!==i?1/i|0:1;const n=Object(l.a)(window.devicePixelRatio,1,2);n>1&&(s.needUpscale?(this.width=Math.round(this.width*n),this.height=Math.round(this.height*n)):n>1&&(this.width>100&&this.height>100?d.isApple||!h.b.isMobile?(this.width=Math.round(this.width*n),this.height=Math.round(this.height*n)):n>2.5&&(this.width=Math.round(this.width*(n-1.5)),this.height=Math.round(this.height*(n-1.5))):(this.width=Math.round(this.width*Math.max(1.5,n-1.5)),this.height=Math.round(this.height*Math.max(1.5,n-1.5))))),s.noCache||(d.isApple&&this.width>100&&this.height>100?this.cachingDelta=2:this.width<100&&this.height<100?this.cachingDelta=1/0:this.cachingDelta=4),this.canvas=document.createElement("canvas"),this.canvas.classList.add("rlottie"),this.canvas.width=this.width,this.canvas.height=this.height,this.context=this.canvas.getContext("2d"),this.clamped=new Uint8ClampedArray(this.width*this.height*4),this.imageData=new ImageData(this.width,this.height)}clearCache(){this.frames={}}sendQuery(t,...e){this.worker.sendQuery(t,this.reqId,...e)}loadFromData(t){this.sendQuery("loadFromData",t,this.width,this.height)}play(){this.paused&&(this.paused=!1,this.setMainLoop())}pause(t=!0){this.paused||(this.paused=!0,t&&clearTimeout(this.rafId))}stop(t=!0){this.pause(),this.curFrame=1===this.direction?0:this.frameCount,t&&this.requestFrame(this.curFrame)}restart(){this.stop(!1),this.play()}setSpeed(t){this.speed=t,this.paused||this.setMainLoop()}setDirection(t){this.direction=t,this.paused||this.setMainLoop()}remove(){b.onDestroy(this.reqId),this.pause(),this.sendQuery("destroy")}renderFrame2(t,e){try{this.imageData.data.set(t),this.context.putImageData(this.imageData,0,0)}catch(t){return console.error("RLottiePlayer renderFrame error:",t,this.width,this.height),this.autoplay=!1,void this.pause()}this.dispatchEvent("enterFrame",e)}renderFrame(t,e){if(this.cachingDelta&&(e%this.cachingDelta||!e)&&!this.frames[e]&&(this.frames[e]=new Uint8ClampedArray(t)),this.frInterval){const s=Date.now()-this.frThen;if(s<0)return this.rafId&&clearTimeout(this.rafId),this.rafId=window.setTimeout(()=>{this.renderFrame2(t,e)},this.frInterval>-s?-s%this.frInterval:this.frInterval)}this.renderFrame2(t,e)}requestFrame(t){this.frames[t]?this.renderFrame(this.frames[t],t):d.isSafari?this.sendQuery("renderFrame",t):(this.clamped.length||(this.clamped=new Uint8ClampedArray(this.width*this.height*4)),this.sendQuery("renderFrame",t,this.clamped))}mainLoopForwards(){const t=this.curFrame+this.skipDelta>=this.frameCount?this.curFrame=0:this.curFrame+=this.skipDelta;return this.requestFrame(t),!(t+this.skipDelta>=this.frameCount&&!this.loop)||(this.pause(!1),!1)}mainLoopBackwards(){const t=this.curFrame-this.skipDelta<0?this.curFrame=this.frameCount-1:this.curFrame-=this.skipDelta;return this.requestFrame(t),!(t-this.skipDelta<0&&!this.loop)||(this.pause(!1),!1)}setMainLoop(){clearTimeout(this.rafId),this.frInterval=1e3/this.fps/this.speed*this.skipDelta,this.frThen=Date.now()-this.frInterval;const t=(1===this.direction?this.mainLoopForwards:this.mainLoopBackwards).bind(this);this.currentMethod=t,this.frameListener&&this.listenerResults.hasOwnProperty("enterFrame")&&this.frameListener()}onLoad(t,e){return f(this,void 0,void 0,(function*(){if(this.curFrame=1===this.direction?0:t-1,this.frameCount=t,this.fps=e,this.fps<60&&1!==this.skipDelta){const t=60/e;this.skipDelta=this.skipDelta/t|0}this.frInterval=1e3/this.fps/this.speed*this.skipDelta,this.frThen=Date.now()-this.frInterval,this.requestFrame(0),this.dispatchEvent("ready"),this.addEventListener("enterFrame",()=>{this.dispatchEvent("firstFrame"),this.el.appendChild(this.canvas),this.frameListener=()=>{if(this.paused)return;const t=Date.now();this.frThen=t+this.frInterval;this.currentMethod()||this.loop||!this.autoplay||(this.autoplay=!1)},this.addEventListener("enterFrame",this.frameListener)},!0)}))}}g.reqId=0;class y extends o.a{constructor(t,e=(()=>{}),s){super(),this.worker=t,this.defaultListener=e,s&&(this.worker.onerror=s),this.worker.onmessage=t=>{t.data instanceof Object&&t.data.hasOwnProperty("queryMethodListener")&&t.data.hasOwnProperty("queryMethodArguments")?this.dispatchEvent(t.data.queryMethodListener,...t.data.queryMethodArguments):this.defaultListener.call(this,t.data)}}postMessage(t){this.worker.postMessage(t)}terminate(){this.worker.terminate()}sendQuery(t,...e){if(d.isSafari)this.worker.postMessage({queryMethod:t,queryMethodArguments:e});else{const s=[];e.forEach(t=>{t instanceof ArrayBuffer&&s.push(t),t.buffer&&t.buffer instanceof ArrayBuffer&&s.push(t.buffer)}),this.worker.postMessage({queryMethod:t,queryMethodArguments:e},s)}}}class v{constructor(){this.isWebAssemblySupported="undefined"!=typeof WebAssembly,this.loadPromise=this.isWebAssemblySupported?void 0:Promise.reject(),this.loaded=!1,this.workersLimit=4,this.players={},this.workers=[],this.curWorkerNum=0,this.log=Object(u.b)("LOTTIE",u.a.Error),this.onPlayerLoaded=(t,e,s)=>{const i=this.players[t];i?(this.log.debug("onPlayerLoaded"),i.onLoad(e,s)):this.log.warn("onPlayerLoaded on destroyed player:",t,e)},this.onFrame=(t,e,s)=>{const i=this.players[t];i?(i.clamped=s,i.renderFrame(s,e)):this.log.warn("onFrame on destroyed player:",t,e)},this.onPlayerError=(t,e)=>{const s=this.players[t];if(s){r.a.getAnimations(s.el).forEach(t=>{r.a.checkAnimation(t,!0,!0)})}}}getAnimation(t){for(const e in this.players)if(this.players[e].el===t)return this.players[e];return null}setLoop(t){for(const e in this.players){const s=this.players[e];s.loop=t,s.autoplay=s._autoplay}}loadLottieWorkers(){return this.loadPromise?this.loadPromise:this.loadPromise=new Promise((t,e)=>{let s=this.workersLimit;for(let e=0;e<this.workersLimit;++e){const i=this.workers[e]=new y(new n.a);i.addEventListener("ready",()=>{this.log("worker #"+e+" ready"),i.addEventListener("frame",this.onFrame),i.addEventListener("loaded",this.onPlayerLoaded),i.addEventListener("error",this.onPlayerError),--s,s||(this.log("workers ready"),t(),this.loaded=!0)})}})}applyReplacements(t,e){const s=v.COLORREPLACEMENTS[Math.max(e-1,0)],i=t=>{switch(t.ty){case"st":case"fl":(t=>{const e=t.c.k,i=m(e[2])|m(e[1])<<8|m(e[0])<<16,n=s.find(t=>t[0]===i);n&&(e[0]=(n[1]>>16&255)/255,e[1]=(n[1]>>8&255)/255,e[2]=(255&n[1])/255)})(t)}t.hasOwnProperty("it")&&n(t.it)},n=t=>{for(const e of t)i(e)};try{for(const e of t.layers)if(e.shapes)for(const t of e.shapes)t.it?n(t.it):i(t)}catch(s){this.log.warn("cant apply replacements",s,t,e)}}loadAnimationFromURL(t,e){return this.isWebAssemblySupported?(this.loaded||this.loadLottieWorkers(),fetch(e).then(t=>t.arrayBuffer()).then(t=>p.a.gzipUncompress(t,!0)).then(e=>this.loadAnimationWorker(Object.assign(t,{animationData:e,needUpscale:!0})))):this.loadPromise}waitForFirstFrame(t){return Promise.race([new Promise(e=>{t.addEventListener("firstFrame",e,!0)}),Object(c.d)(2500)])}loadAnimationWorker(t,e="",s=-1){return f(this,void 0,void 0,(function*(){if(!this.isWebAssemblySupported)return this.loadPromise;if(s>=1&&s<=5){const e=JSON.parse(t.animationData);this.applyReplacements(e,s),t.animationData=JSON.stringify(e)}if(this.loaded||(yield this.loadLottieWorkers()),t.width&&t.height||(t.width=parseInt(t.container.style.width),t.height=parseInt(t.container.style.height)),!t.width||!t.height)throw new Error("No size for sticker!");t.group=e;const i=this.initPlayer(t.container,t);return r.a.addAnimation(i,e),i}))}onDestroy(t){delete this.players[t]}destroyWorkers(){this.workers.forEach((t,e)=>{t.terminate(),this.log("worker #"+e+" terminated")}),this.log("workers destroyed"),this.workers.length=0}initPlayer(t,e){const s=new g({el:t,worker:this.workers[this.curWorkerNum++],options:e});return this.players[s.reqId]=s,this.curWorkerNum>=this.workers.length&&(this.curWorkerNum=0),s.loadFromData(e.animationData),s}}v.COLORREPLACEMENTS=[[[16219713,13335381],[16757049,16168585],[16765248,16764327],[16768889,16768965]],[[16219713,10771e3],[16757049,14653547],[16765248,15577475],[16768889,16040864]],[[16219713,7354903],[16757049,11233085],[16765248,12812110],[16768889,14194279]],[[16219713,4858889],[16757049,8207886],[16765248,9852201],[16768889,11100983]],[[16219713,2101002],[16757049,4270372],[16765248,5848375],[16768889,6505791]]];const b=new v;a.a.lottieLoader=b,e.b=b},28:function(t,e,s){"use strict";s.d(e,"a",(function(){return d}));var i=s(7),n=s(25),r=s(64),a=s(10),o=s(35);const h=new class{constructor(){this.pageId=-1,this.pagesDiv=document.getElementById("auth-pages"),this.scrollableDiv=this.pagesDiv.querySelector(".scrollable"),this.selectTab=Object(r.a)(null,this.scrollableDiv.querySelector(".tabs-container"),null,()=>{var t;(null===(t=this.page)||void 0===t?void 0:t.onShown)&&this.page.onShown()})}setPage(t){if(t.isAuthPage){this.pagesDiv.style.display="";let e=Object(i.B)(t.pageEl);if(this.pageId===e)return;this.selectTab(e),-1!==this.pageId&&e>1&&n.b.loadLottieWorkers(),this.pageId=e,this.scrollableDiv&&Object(o.b)(this.scrollableDiv,this.scrollableDiv.firstElementChild,"start")}else this.pagesDiv.style.display="none",t.pageEl.style.display="",this.pageId=-1;this.page=t}};a.a.pagesManager=h;var l=h,c=function(t,e,s,i){return new(s||(s=Promise))((function(n,r){function a(t){try{h(i.next(t))}catch(t){r(t)}}function o(t){try{h(i.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(a,o)}h((i=i.apply(t,e||[])).next())}))};class d{constructor(t,e,s,i,n){this.isAuthPage=e,this.onFirstMount=s,this.onMount=i,this.onShown=n,this.installed=!1,this.pageEl=document.body.querySelector("."+t)}mount(...t){return c(this,void 0,void 0,(function*(){if(this.onMount&&this.onMount(...t),!this.installed){if(this.onFirstMount)try{const e=this.onFirstMount(...t);e instanceof Promise&&(yield e)}catch(t){console.error("PAGE MOUNT ERROR:",t)}this.installed=!0}l.setPage(this)}))}}},33:function(t,e,s){"use strict";s.d(e,"b",(function(){return d})),s.d(e,"c",(function(){return u}));var i=s(21),n=s(11),r=s(9),a=s(10);let o=!1,h=Promise.resolve(),l=0;const c=console.log.bind(console.log,"[HEAVY-ANIMATION]:"),d=(t,e)=>{o||(h=Object(i.a)(),r.default.broadcast("event-heavy-animation-start"),o=!0,a.b&&c("start")),++l,a.b&&c("attach promise, length:",l,e);const s=[void 0!==e?Object(n.d)(e):void 0,t.finally(()=>{})].filter(Boolean),d=performance.now();return Promise.race(s).then(()=>{--l,a.b&&c("promise end, length:",l,performance.now()-d),l||(o=!1,l=0,r.default.broadcast("event-heavy-animation-end"),h.resolve(),a.b&&c("end"))}),h},u=()=>h;e.a=(t,e,s)=>{o&&t();const i=s?s.add.bind(s,r.default):r.default.addEventListener.bind(r.default),n=s?s.removeManual.bind(s,r.default):r.default.removeEventListener.bind(r.default);return i("event-heavy-animation-start",t),i("event-heavy-animation-end",e),()=>{n("event-heavy-animation-end",e),n("event-heavy-animation-start",t)}}},34:function(t,e,s){"use strict";var i=s(7),n=s(25),r=s(9),a=s(0),o=s(10);const h=new class{constructor(){this.visible=new Set,this.byGroups={},this.lockedGroups={},this.onlyOnePlayableGroup="",this.intersectionLockedGroups={},this.videosLocked=!1,this.observer=new IntersectionObserver(t=>{if(!r.default.idle.isIDLE)for(const e of t){const t=e.target;for(const s in this.byGroups){if(this.intersectionLockedGroups[s])continue;const i=this.byGroups[s].find(e=>e.el===t);if(i){e.isIntersecting?(this.visible.add(i),this.checkAnimation(i,!1)):(this.visible.delete(i),this.checkAnimation(i,!0),i.animation instanceof n.a&&i.animation.clearCache());break}}}}),r.default.on("audio_play",({doc:t})=>{"round"===t.type&&(this.videosLocked=!0,this.checkAnimations())}),r.default.on("audio_pause",()=>{this.videosLocked&&(this.videosLocked=!1,this.checkAnimations())})}getAnimations(t){const e=[];for(const s in this.byGroups)for(const i of this.byGroups[s])i.el===t&&e.push(i);return e}removeAnimation(t){const{el:e,animation:s}=t;s.remove(),s instanceof HTMLVideoElement&&a.isSafari&&setTimeout(()=>{s.src="",s.load()},1e3);for(const e in this.byGroups)this.byGroups[e].findAndSplice(e=>e===t);this.observer.unobserve(e),this.visible.delete(t)}addAnimation(t,e=""){var s;const i={el:t instanceof n.a?t.el:t,animation:t,group:e};t instanceof n.a&&!r.default.settings.stickers.loop&&t.loop&&(t.loop=r.default.settings.stickers.loop),(null!==(s=this.byGroups[e])&&void 0!==s?s:this.byGroups[e]=[]).push(i),this.observer.observe(i.el)}checkAnimations(t,e,s=!1){if(r.default.idle.isIDLE)return;const i=e?[e]:Object.keys(this.byGroups);if(!e||this.byGroups[e])for(const e of i){this.byGroups[e].forEach(e=>{this.checkAnimation(e,t,s)})}else this.byGroups[e]=[]}checkAnimation(t,e=!1,s=!1){const{el:n,animation:r,group:a}=t;s||!Object(i.r)(n)&&!this.lockedGroups[a]?this.removeAnimation(t):e||this.onlyOnePlayableGroup&&this.onlyOnePlayableGroup!==a||r instanceof HTMLVideoElement&&this.videosLocked?r.paused||r.pause():r.paused&&this.visible.has(t)&&r.autoplay&&(!this.onlyOnePlayableGroup||this.onlyOnePlayableGroup===a)&&r.play()}setOnlyOnePlayableGroup(t){this.onlyOnePlayableGroup=t}lockGroup(t){this.lockedGroups[t]=!0}unlockGroup(t){delete this.lockedGroups[t],this.checkAnimations(void 0,t)}refreshGroup(t){const e=this.byGroups[t];e&&e.length&&(e.forEach(t=>{this.observer.unobserve(t.el)}),window.requestAnimationFrame(()=>{e.forEach(t=>{this.observer.observe(t.el)})}))}lockIntersectionGroup(t){this.intersectionLockedGroups[t]=!0}unlockIntersectionGroup(t){delete this.intersectionLockedGroups[t],this.refreshGroup(t)}};o.a&&(o.a.animationIntersector=h),e.a=h},35:function(t,e,s){"use strict";s.d(e,"a",(function(){return h})),s.d(e,"b",(function(){return l}));var i=s(33),n=s(11),r=s(68),a=s(9),o=s(7);var h;function l(t,e,s,r=0,l=1500,d,u,p="y"){if(a.default.settings.animationsEnabled||(d=h.Static),d===h.Static)return c(t,e,s,r,u=0,p);if("y"===p&&e!==t&&Object(o.r)(e)&&t.getBoundingClientRect){const s=e.getBoundingClientRect(),i=t.getBoundingClientRect(),n=s.top-i.top;void 0===d?n<-l?t.scrollTop+=n+l:n>l&&(t.scrollTop+=n-l):d===h.Up?t.scrollTop=n+t.scrollTop+l:d===h.Down&&(t.scrollTop=Math.max(0,n+t.scrollTop-l))}const f=new Promise(i=>{Object(n.c)(()=>{c(t,e,s,r,u,p).then(i)})});return"y"===p?Object(i.b)(f):f}function c(t,e,s,i=0,n,a="y"){if(!Object(o.r)(e))return Object(r.b)(t),Promise.resolve();const h="y"===a?"top":"left",l="y"===a?"bottom":"right",c="y"===a?"height":"width",d="y"===a?"scrollHeight":"scrollWidth",u="y"===a?"scrollTop":"scrollLeft",p=e.getBoundingClientRect(),f=t.getBoundingClientRect?t.getBoundingClientRect():document.body.getBoundingClientRect(),m=p[h]-f[h],g=e[d],y=f[c],v=t[u],b=t[d];let w;switch(s){case"start":w=m-i;break;case"end":w=p[l]+(g-p[c])-f[l];break;case"nearest":case"center":w=g<y?m+g/2-y/2:m-i}if(w<0){const t=-v;w=Math.max(w,t)}else if(w>0){const t=b-(v+y);w=Math.min(w,t)}const k=t[u]+w,L=null!=n?n:250+Math.abs(w)/1500*350,M=Date.now(),P=()=>{const e=L?Math.min((Date.now()-M)/L,1):1,s=w*(1-function(t){return 1-Math.pow(1-t,3.5)}(e));return t[u]=Math.round(k-s),e<1};return L&&w?Object(r.a)(P,t):(Object(r.b)(t),P(),Promise.resolve())}!function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Static=2]="Static"}(h||(h={}))},43:function(t,e,s){"use strict";function i(t,e=" "){const s=t.toString().split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,e),s.join(".")}function n(t,e=2){if(0===t)return"0 Bytes";const s=e<0?0:e,i=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,i)).toFixed(s))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][i]}function r(t,e=2){if(0===t)return"0";const s=e<0?0:e,i=Math.floor(Math.log(t)/Math.log(1e3));return parseFloat((t/Math.pow(1e3,i)).toFixed(s))+["","K","M","B","T"][i]}function a(t,e,s){return t<e?e:t>s?s:t}s.d(e,"d",(function(){return i})),s.d(e,"b",(function(){return n})),s.d(e,"c",(function(){return r})),s.d(e,"a",(function(){return a}))},58:function(t,e,s){"use strict";s.d(e,"a",(function(){return l}));var i=s(7),n=s(9),r=s(21),a=s(33);function o(t,e,s){const i=e.getBoundingClientRect().width,n=[t,e];return s&&n.reverse(),n[0].style.filter="brightness(80%)",n[0].style.transform=`translate3d(${.25*-i}px, 0, 0)`,n[1].style.transform=`translate3d(${i}px, 0, 0)`,t.classList.add("active"),t.offsetWidth,t.style.transform="",t.style.filter="",()=>{e.style.transform=e.style.filter=""}}function h(t,e,s){const i=e.getBoundingClientRect().width,n=[t,e];return s&&n.reverse(),n[0].style.transform=`translate3d(${-i}px, 0, 0)`,n[1].style.transform=`translate3d(${i}px, 0, 0)`,t.classList.add("active"),t.offsetWidth,t.style.transform="",()=>{e.style.transform=""}}const l=(t,e,s,i,n=!0)=>{let r=null;switch(e){case"tabs":r=h;break;case"navigation":r=o}return t.dataset.animation=e,c(t,r,s,i,n)},c=(t,e,s,o,h=!0)=>{const l=new Map;let c,d=0,u=null;function p(f,m=!0){const g=p;f instanceof HTMLElement&&(f=Object(i.B)(f));const y=g.prevId();if(f===y)return!1;const v=u,b=t.children[f];if(n.default.settings.animationsEnabled&&-1!==y||(m=!1),!m)return v&&v.classList.remove("active","to","from"),b&&(b.classList.remove("to","from"),b.classList.add("active")),t.classList.remove("animating","backwards","disable-hover"),u=b,void(o&&o(f));u&&(u.classList.remove("to"),u.classList.add("from")),t.classList.add("animating","disable-hover");const w=y<f;let k;if(t.classList.toggle("backwards",!w),b&&(e?k=e(b,u,w):b.classList.add("active"),b.classList.remove("from"),b.classList.add("to")),b&&l.set(b,()=>{b.classList.remove("to"),l.delete(b)}),v){const t=()=>{v.classList.remove("active","from"),k&&k(),l.delete(v)};if(b)l.set(v,t);else{const e=window.setTimeout(t,s);l.set(v,()=>{clearTimeout(e)})}h&&(c||(c=Object(r.a)(),d=performance.now()),Object(a.b)(c,2*s))}u=b}return t.addEventListener(e?"transitionend":"animationend",e=>{if(e.target.parentElement!==t)return;const s=l.get(e.target);s&&s(),e.target===u&&(!c&&h||(c&&(c.resolve(),c=void 0),o&&o(p.prevId()),t.classList.remove("animating","backwards","disable-hover")))}),p.prevId=()=>u?Object(i.B)(u):-1,p}},64:function(t,e,s){"use strict";s.d(e,"a",(function(){return h}));var i=s(7),n=s(58),r=s(9),a=s(11),o=s(35);function h(t,e,s,h,l=250,c){const d=Object(n.a)(e,t||"tabs"===e.dataset.animation?"tabs":"navigation",l,h);if(t){const n=new Proxy(d,{apply:(e,s,i)=>{const n=+i[0],r=void 0===i[1]||i[1],a=t.querySelector(`[data-tab="${n}"]`)||t.children[n];h(a,n,r)}}),h=(i,n,h=!0)=>{const f=e.children[n];if(s){const t=s(n,f,h);if(void 0!==t&&!t)return}c&&c.scrollIntoViewNew(i.parentElement.children[n],"center",void 0,void 0,h?void 0:o.a.Static,l,"x"),r.default.settings.animationsEnabled||(h=!1);const m=d.prevId();if(i.classList.contains("active")||n===m)return!1;const g=t.querySelector(p.toLowerCase()+".active");Object(a.c)(()=>{g&&g.classList.remove("active")}),u&&-1!==m&&h&&Object(a.c)(()=>{const t=i.querySelector("i"),e=i.parentElement.children[m].querySelector("i");e.classList.remove("animate"),t.classList.remove("animate");const s=e.parentElement.parentElement.offsetLeft-t.parentElement.parentElement.offsetLeft,n=e.clientWidth/t.clientWidth;t.style.transform=`translate3d(${s}px, 0, 0) scale3d(${n}, 1, 1)`,requestAnimationFrame(()=>{t.classList.add("animate"),t.style.transform="none"})}),Object(a.c)(()=>{i.classList.add("active")}),d(n,h)},u=!t.classList.contains("no-stripe"),p=t.firstElementChild.tagName;return t.addEventListener("click",(function(e){let s,n=e.target;if(n=function(t,e){if(t.parentElement===e)return t;for(;t.parentElement;)if((t=t.parentElement).parentElement===e)return t;return null}(n,t),!n)return!1;if(n.dataset.tab){if(s=+n.dataset.tab,-1===s)return!1}else s=Object(i.B)(n);h(n,s)})),n}return d}},68:function(t,e,s){"use strict";s.d(e,"b",(function(){return a})),s.d(e,"a",(function(){return o}));var i=s(11),n=s(21);const r=new Map;function a(t){const e=function(t){return r.get(t)}(t);e&&(e.isCancelled=!0,e.deferred.resolve())}function o(t,e,s){return s||(s=function(t){a(t);const e={isCancelled:!1,deferred:Object(n.a)()};return r.set(t,e),e.deferred.then(()=>{r.delete(t)}),e}(e)),Object(i.c)(()=>{s.isCancelled||(t()?o(t,e,s):s.deferred.resolve())}),s.deferred}},73:function(t,e,s){t.exports=function(){return new Worker(s.p+"61a189906246e6afbe78.worker.js")}}}]);
//# sourceMappingURL=4.43a375490205f285598d.chunk.js.map