telegram-tt/dist/4.33211d65baae941a99ec.js

1 line
26 KiB
JavaScript
Raw Normal View History

2021-04-12 16:56:48 +02:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{105:function(e,t,n){"use strict";var r=n(0),a=n(7),o=n(9),c=n(8),l=n(43);let i,u;async function s(){return i||(i=n.e(7).then(n.bind(null,305)),u=(await i).default),i}setTimeout(s,5e3);t.a=Object(r.h)(({className:e,id:t,animationData:n,play:i,playSegment:d,speed:f,noLoop:m,size:h,quality:b,isLowPriority:v,onLoad:p})=>{const[g,E]=Object(r.r)(),j=Object(r.q)(null),O=Object(r.q)(!1),y=Object(r.q)(!1),w=Object(r.q)();w.current=i;const k=Object(r.q)();k.current=d,Object(r.n)(()=>{if(g||!n)return;const e=()=>{if(!j.current)return;const e=new u(t,j.current,n,{noLoop:m,size:h,quality:b,isLowPriority:v},p);f&&e.setSpeed(f),E(e)};u?e():s().then(()=>{Object(o.b)(()=>{j.current&&e()})})},[g,n,t,v,m,p,b,h,f]),Object(r.n)(()=>()=>{g&&g.destroy()},[g]);const N=Object(r.m)((e=!1)=>{g&&(w.current||k.current)&&(k.current?g.playSegment(k.current):e?g.goToAndPlay(0):g.play())},[g]),C=Object(r.m)(()=>{g&&g.pause()},[g]),L=Object(r.m)(()=>{y.current=!0,g&&(O.current||(O.current=g.isPlaying()),C())},[g,C]),A=Object(r.m)(()=>{O.current&&N(),O.current=!1,y.current=!1},[N]),M=Object(r.m)(()=>{Object(o.b)(A)},[A]);var P,T;Object(r.n)(()=>{g&&(i||d?y.current?O.current=!0:N(m):y.current?O.current=!1:C())},[g,i,d,m,N,C]),Object(l.a)(L,A),P=L,T=M,Object(r.n)(()=>(document.hasFocus()||P(),window.addEventListener("blur",P),window.addEventListener("focus",T),()=>{window.removeEventListener("focus",T),window.removeEventListener("blur",P)}),[P,T]);const S=Object(c.a)("AnimatedSticker",e,a.d&&i&&"is-playing"),x=h?`width: ${h}px; height: ${h}px;`:void 0;return r.a.createElement("div",{ref:j,className:S,style:x})})},114:function(e,t,n){"use strict";var r=n(0),a=n(57);t.a=({containerId:e,className:t,children:n})=>{const o=Object(r.q)(document.createElement("div"));return Object(r.o)(()=>{const n=document.querySelector(e||"#portals");if(!n)return;const r=o.current;return t&&r.classList.add(t),n.appendChild(r),()=>{a.a.render(void 0,r),n.removeChild(r)}},[t,e]),a.a.render(n,o.current)}},116:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(5),a=n(48);const o={MonkeyIdle:n.p+"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab778dc8a3f0cd.tgs",MonkeyTracking:n.p+"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12e6248561fb58.tgs",MonkeyClose:n.p+"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3ea19bef058241.tgs",MonkeyPeek:n.p+"TwoFactorSetupMonkeyPeek.1905436b042520363d7e59f5d7f903ab.tgs",FoldersAll:n.p+"FoldersAll.3f9f9e243d19f0fbf9aaaff11cbd4572.tgs",FoldersNew:n.p+"FoldersNew.9a40d71c0c8be70f5bd14ff2d7bc1593.tgs",DiscussionGroups:n.p+"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a992f8e587485.tgs"};function c(e){const t=o[e].replace(window.location.origin,"");return a.b("file"+t,r.ApiMediaFormat.Lottie)}},120:function(e,t,n){"use strict";var r=n(0),a=n(8),o=n(1),c=n(14),l=n(93),i=n(31),u=n(98),s=n(16);n(140);const d={type:"blob",quality:.8,format:"jpeg",circle:!1};let f,m,h;var b=Object(r.h)(({file:e,onChange:t,onClose:a})=>{const[b,v]=Object(r.r)(!1);Object(r.n)(()=>{e&&(b?async function(e){try{const t=document.getElementById("avatar-crop");if(!t)return;const{offsetWidth:n,offsetHeight:r}=t;h=new f(t,{enableZoom:!0,boundary:{width:n,height:r},viewport:{width:n-16,height:r-16,type:"circle"}});const a=await Object(c.a)(e);await h.bind({url:a})}catch(e){o.l&&console.error(e)}}(e):async function(){return m||(m=Promise.all([n.e(5),n.e(8)]).then(n.bind(null,301)),f=(await m).default),m}().then(()=>v(!0)))},[e,b]);const p=Object(l.a)();return r.a.createElement(u.a,{isOpen:Boolean(e),onClose:a,title:"Drag to reposition",className:"CropModal",hasCloseButton:!0},b?r.a.createElement("div",{id:"avatar-crop"}):r.a.createElement(s.a,null),r.a.createElement(i.a,{className:"confirm-button",round:!0,color:"primary",onClick:async function(){if(!h)return;const e=await h.result(d),n="string"==typeof e?e:Object(c.b)(e,"avatar.jpg");t(n)},ariaLabel:p("CropImage")},r.a.createElement("i",{className:"icon-check"})))});n(141);t.a=Object(r.h)(({title:e="Change your profile picture",disabled:t,currentAvatarBlobUrl:n,onChan