tweb/public/main.92546832052cf8ce5c56.bundle.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
8.6 KiB
JavaScript

!function(e){function t(t){for(var n,i,r=t[0],a=t[1],d=0,s=[];d<r.length;d++)i=r[d],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&s.push(o[i][0]),o[i]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(c&&c(t);s.length;)s.shift()()}var n={},o={7:0};function i(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.e=function(e){var t=[],n=o[e];if(0!==n)if(n)t.push(n[2]);else{var r=new Promise((function(t,i){n=o[e]=[t,i]}));t.push(n[2]=r);var a,d=document.createElement("script");d.charset="utf-8",d.timeout=120,i.nc&&d.setAttribute("nonce",i.nc),d.src=function(e){return i.p+""+({8:"npm.qr-code-styling"}[e]||e)+"."+{0:"3d9eac3dc07991c7e203",1:"6b06887d7a7bc5deb490",2:"9e86487de3e08531d918",3:"3af758bd9ac72b2ca915",4:"43a375490205f285598d",5:"21398fefb9ec9731d31f",6:"eeb1bb4868cede6a151c",8:"748a7ab0345a6b83dd8d",9:"12764672c309bba985be",10:"bc4f486ad464de65a8da",11:"dba80637d0a6be3cbc0f",12:"dfbf26f5d499178dd630",13:"0d575028abb6856e51a0",14:"27ef35a05fe37a04aab1",15:"c829d14ad8adc970387a",16:"fa4e68f293816176a158",17:"c22e013acf6f97b9ed9e",18:"1bea5879062281d6db9a",19:"48eb54d8ddb289c4b1a9",20:"de097d8b8de55902b4d8",21:"7314867527a83d26076d",22:"8b4081d63f757fe5c7c2",23:"e7c0570a309233c94860",24:"50e4a53ee45316319224",25:"005b926487017198ee91",26:"b3b2fb5a552a3b230266"}[e]+".chunk.js"}(e);var c=new Error;a=function(t){d.onerror=d.onload=null,clearTimeout(s);var n=o[e];if(0!==n){if(n){var i=t&&("load"===t.type?"missing":t.type),r=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+i+": "+r+")",c.name="ChunkLoadError",c.type=i,c.request=r,n[1](c)}o[e]=void 0}};var s=setTimeout((function(){a({type:"timeout",target:d})}),12e4);d.onerror=d.onload=a,document.head.appendChild(d)}return Promise.all(t)},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var r=this.webpackJsonp=this.webpackJsonp||[],a=r.push.bind(r);r.push=t,r=r.slice();for(var d=0;d<r.length;d++)t(r[d]);var c=a;i(i.s=6)}([function(e,t,n){"use strict";n.r(t),n.d(t,"userAgent",(function(){return o})),n.d(t,"isApple",(function(){return i})),n.d(t,"isAndroid",(function(){return r})),n.d(t,"isChromium",(function(){return a})),n.d(t,"ctx",(function(){return d})),n.d(t,"isAppleMobile",(function(){return c})),n.d(t,"isSafari",(function(){return s})),n.d(t,"isFirefox",(function(){return u})),n.d(t,"isMobileSafari",(function(){return l})),n.d(t,"isMobile",(function(){return f}));const o=navigator?navigator.userAgent:null,i=-1!==navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i),r=-1!==navigator.userAgent.toLowerCase().indexOf("android"),a=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),d="undefined"!=typeof window?window:self,c=(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!d.MSStream,s=!!("safari"in d)||!(!o||!(/\b(iPad|iPhone|iPod)\b/.test(o)||o.match("Safari")&&!o.match("Chrome"))),u=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,l=s&&c,f=-1!=navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i)},function(e,t,n){"use strict";function o(e,t){return e.closest("."+t)}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";t.a={id:1025907,hash:"452b0359b988148995f22ff0f4229750",version:"0.4.3",langPackVersion:"0.1.6",langPack:"macos",langPackCode:"en",domains:[],baseDcId:2}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var o=n(2),i=n(1);function r(e){e.style.transform="translateY(-99999px)",e.focus(),setTimeout(()=>{e.style.transform=""},0)}var a=n(0),d=(n(3),n(4),n(5),function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{c(o.next(e))}catch(e){r(e)}}function d(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,d)}c((o=o.apply(e,t||[])).next())}))});document.addEventListener("DOMContentLoaded",()=>d(void 0,void 0,void 0,(function*(){Element.prototype.toggleAttribute||(Element.prototype.toggleAttribute=function(e,t){return void 0!==t&&(t=!!t),this.hasAttribute(e)?!!t||(this.removeAttribute(e),!1):!1!==t&&(this.setAttribute(e,""),!0)});const e=window.visualViewport||window;let t,d=!1;const c=()=>{const n=.01*(d&&!m.default.overlayIsActive?e.height||e.innerHeight:window.innerHeight);t!==n&&(t=n,document.documentElement.style.setProperty("--vh",n+"px"))};window.addEventListener("resize",c),c();const s=new Proxy(Worker,{construct:(e,t)=>new e(t[0]+location.search)});Worker=s;const[u,l,f,m,h,b]=yield Promise.all([n.e(20).then(n.bind(null,105)),n.e(22).then(n.bind(null,20)),Promise.resolve().then(n.bind(null,0)),n.e(19).then(n.bind(null,9)),Promise.all([n.e(0),n.e(23)]).then(n.bind(null,15)),Promise.all([n.e(0),n.e(2),n.e(21)]).then(n.bind(null,8))]),p=()=>{d=1===v&&f.isSafari&&l.isTouchSupported&&!m.default.overlayIsActive,c(),e!==window&&(d?(window.removeEventListener("resize",c),e.addEventListener("resize",c)):(e.removeEventListener("resize",c),window.addEventListener("resize",c)))};let v;if(m.default.on("im_tab_change",e=>{const t=void 0!==v;v=e,(t||1===v)&&p()}),m.default.on("overlay_toggle",()=>{p()}),f.isApple){if(f.isSafari&&(document.documentElement.classList.add("is-safari"),f.isMobile&&l.isTouchSupported)){let e="clientY",t=0;const n={capture:!0,passive:!1},o=n=>{const o=n.touches[0],r=Object(i.a)(o.target,"scrollable-y");if(r){const i=o[e],a=t-i,d=r.scrollTop,c=r.scrollHeight,s=r.clientHeight,u=d?Math.round(d+r.clientHeight+a):d+a;(c===s||u>=c||u<=0)&&n.preventDefault()}else n.preventDefault()};document.addEventListener("focusin",i=>{d&&(r(i.target),document.addEventListener("touchmove",o,n),document.addEventListener("touchstart",n=>{if(n.touches.length>1)return;const o=n.touches[0];t=o[e]}))}),document.addEventListener("focusout",()=>{document.removeEventListener("touchmove",o,n)}),document.addEventListener("visibilitychange",()=>{d&&document.activeElement&&document.activeElement.blur&&r(document.activeElement)})}document.documentElement.classList.add("is-mac","emoji-supported"),f.isAppleMobile&&document.documentElement.classList.add("is-ios")}else f.isAndroid&&document.documentElement.classList.add("is-android");l.isTouchSupported?document.documentElement.classList.add("is-touch"):document.documentElement.classList.add("no-touch");const g=performance.now(),y=b.default.getCacheLangPack(),[P,w]=yield Promise.all([h.default.getState(),y]);m.default.setThemeListener(),w.appVersion!==o.a.langPackVersion&&b.default.getLangPack(w.lang_code),console.log("got state, time:",performance.now()-g);const S=P.authState;if("authStateSignedIn"!==S._){console.log("Will mount auth page:",S._,Date.now()/1e3);const e=document.getElementById("auth-pages");if(e){const t=e.querySelector(".scrollable");l.isTouchSupported&&!a.isMobileSafari||t.classList.add("no-scrollbar");const n=document.createElement("div");n.classList.add("auth-placeholder"),t.prepend(n),t.append(n.cloneNode())}switch(S._){case"authStateSignIn":(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(4),n.e(13)]).then(n.bind(null,72))).default.mount();break;case"authStateSignQr":(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(4),n.e(15)]).then(n.bind(null,79))).default.mount();break;case"authStateAuthCode":(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(3),n.e(9)]).then(n.bind(null,82))).default.mount(S.sentCode);break;case"authStatePassword":(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(3),n.e(10)]).then(n.bind(null,70))).default.mount();break;case"authStateSignUp":(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(3),n.e(11)]).then(n.bind(null,86))).default.mount(S.authCode)}}else console.log("Will mount IM page:",Date.now()/1e3),(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(4),n.e(25)]).then(n.bind(null,40))).default.mount();const E=(yield Promise.all([n.e(1),n.e(17)]).then(n.bind(null,19))).ripple;Array.from(document.getElementsByClassName("rp")).forEach(e=>E(e))})))}]);
//# sourceMappingURL=main.92546832052cf8ce5c56.bundle.js.map