znajua.top-js-metrics.top.my.ua
Open in
urlscan Pro
138.201.61.243
Public Scan
Submitted URL: http://znajua.top-js-metrics.top.my.ua/
Effective URL: https://znajua.top-js-metrics.top.my.ua/
Submission: On December 28 via manual from UA — Scanned from DE
Effective URL: https://znajua.top-js-metrics.top.my.ua/
Submission: On December 28 via manual from UA — Scanned from DE
Form analysis
0 forms found in the DOMText Content
!function(){function e(e){if(!window.context||!s.get("isAmp")||!e.clientHeight)return;let t=!1,n=!1;const r={frameWidth:window.context.initialLayoutRect.width||window.context.data.width||600,frameHeight:window.context.initialLayoutRect.height||window.context.data.height||600,informerHeight:e.clientHeight,informerWidth:e.clientWidth},i=()=>{e.style.height=`${t?r.informerHeight:r.frameHeight}px`,e.style.width=`${t?r.informerWidth:r.frameWidth}px`,e.style.overflowY="auto"},o=()=>{t=!0,i()},c=()=>{n||(n=!0,i(),(()=>{let e=0;const n=setInterval(()=>{t?clearInterval(n):(e+=100,l())},100)})(),async function(){const e=`https://www.google-analytics.com/r/collect?v=1&tid=UA-151122118-1&cid=648755132.1636979654&t=event&${`ec=top_informer-${a}`}&ea=resize&el=resizeError`;await fetch(e,{method:"POST"})}())},l=()=>window.context.requestResize(r.informerWidth,r.informerHeight,!0).then(o).catch(c);setTimeout(()=>{(()=>window.context.renderStart({width:r.informerWidth,height:r.informerHeight}))(),l()},100)}const t="https://api.top.my.ua/api/v1",n="https://landing.top.my.ua/frame/index.html",r="Default",i="https://thumbor.top.my.ua",o="g2Bd47DTBC9U6B8629s4",a="prod";document.createEvent("Event").initEvent("changeStore",!0,!0);const s={store:{},get:function(e){return this.store[e]},set:function(t,n){this.store[t]=n,function(t){if("definedUserInIframe"===t.key){document.querySelectorAll(`[${E}]`).forEach(t=>{const n={informer_id:parseInt(t.getAttribute(E)),site_id:parseInt(s.get("siteId")),referer:s.get("documentReferrer"),device_type:s.get("deviceType"),is_amp:s.get("isAmp")};A(n).then(i=>{if(i.styles&&!1===i.styles.isVisible)return;!function({container:t,array:n,stylesParams:i,urlParams:o,rotator:a,paramsForABTestings:c}){if(0===n.length)return;const l=["Roboto"],d=i.mobile.general.triggerMobile>=window.innerWidth?"mobile":"desktop",p=function({desktop:e,mobile:t}){const n=window.innerWidth,i="vertical"===t.block.viewType,o=t.general.triggerMobile,a=n<=o,s=a?t:e,{general:c,font:l,block:d,image:p,title:u}=s,f=1/c.countCalls*100,g=2*c.paddingHorizontal,h={col:"",image:"",link:"display: block;",row:"",text:"",textWrapper:"",title:""},m={col:"",image:`\n height: ${t.image.height}px;\n width: ${i?"100%":`${t.image.height}px`};\n max-width: 100%;\n `.replace(/\s+/g," "),link:`\n display: -webkit-box; \n display: -moz-box;\n display: -ms-flexbox;\n display: -webkit-flex; \n display: flex;\n ${i?"-webkit-flex-direction: column;\n -moz-flex-direction: column;\n -ms-flex-direction: column;\n -o-flex-direction: column;\n flex-direction: column;":"-webkit-flex-direction: row;\n -moz-flex-direction: row;\n -ms-flex-direction: row;\n -o-flex-direction: row;\n flex-direction: row;"}\n `.replace(/\s+/g," "),row:"\n display: -webkit-box; \n display: -moz-box;\n display: -ms-flexbox;\n display: -webkit-flex; \n display: flex;\n -webkit-flex-wrap: wrap;\n -moz-flex-wrap: wrap;\n -ms-flex-wrap: wrap;\n -o-flex-wrap: wrap;\n flex-wrap: wrap;\n margin: auto;\n ".replace(/\s+/g," "),text:"",title:""},w=a?m:h;return{blocksWrapper:"\n display: -webkit-box; \n display: -moz-box;\n display: -ms-flexbox;\n display: -webkit-flex; \n display: flex;\n -webkit-flex-wrap: wrap;\n -moz-flex-wrap: wrap;\n -ms-flex-wrap: wrap;\n -o-flex-wrap: wrap;\n flex-wrap: wrap;\n ".replace(/\s+/g," "),col:`\n box-sizing: border-box;\n margin-bottom: ${c.marginBottom}px;\n margin-left: ${c.paddingHorizontal}px;\n margin-right: ${c.paddingHorizontal}px;\n background-color: ${d.backgroundColor};\n border-radius: ${d.radius}px;\n overflow: hidden;\n justify-content: ${d.justifyContent};\n display: flex;\n width: calc(${f}% - ${g}px);\n flex-basis: calc(${f}% - ${g}px);\n ${w.col}\n `.replace(/\s+/g," "),image:`\n display: block;\n overflow: hidden;\n flex-grow: 0;\n flex-shrink: 0;\n height: ${p.height}px;\n border: ${p.widthBorder}px ${p.borderType} ${p.color};\n border-radius: ${p.radius}px;\n width: 100%;\n object-fit: cover;\n ${w.image}\n `.replace(/\s+/g," "),link:`\n flex-basis: ${d.flexBasis};\n box-sizing: border-box;\n text-align: left;\n text-decoration: none;\n border: ${d.widthBorder}px ${d.borderType} ${d.color};\n padding: ${d.paddingTop}px ${d.paddingRight}px ${d.paddingBottom}px ${d.paddingLeft}px;\n margin: ${d.marginTop}px ${d.marginRight}px ${d.marginBottom}px ${d.marginLeft}px;\n position: ${d.position};\n max-width: ${d.maxWidth};\n ${w.link}\n `.replace(/\s+/g," "),row:`\n display: -webkit-box; \n display: -moz-box;\n display: -ms-flexbox;\n display: -webkit-flex; \n display: flex;\n -webkit-flex-wrap: wrap;\n -moz-flex-wrap: wrap;\n -ms-flex-wrap: wrap;\n -o-flex-wrap: wrap;\n flex-wrap: wrap;\n margin: 0 -${c.paddingHorizontal}px;\n ${w.row}\n `.replace(/\s+/g," "),tag:u.tag,text:`\n display: -webkit-box;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n text-align: ${l.textAlign};\n font-size: ${l.size}px;\n line-height: ${l.height}px;\n font-weight: ${l.fontWeight};\n ${l.name!==r?`font-family: '${l.name}';`:""}\n `.replace(/\s+/g," "),textWrapper:`\n display: block;\n line-height: ${l.height}px;\n color: ${l.color};\n padding: ${l.paddingTop}px ${l.paddingRight}px ${l.paddingBottom}px ${l.paddingLeft}px;\n margin: ${l.marginTop}px ${l.marginRight}px ${l.marginBottom}px ${l.marginLeft}px;\n word-break: break-word;\n position: ${l.position};\n bottom: ${l.bottom};\n left: ${l.left};\n background: ${"absolute"===l.position?"transparent linear-gradient(180deg,transparent 0,rgba(0,0,0,.7)) repeat scroll 0 0":"none"};\n ${w.text}\n `.replace(/\s+/g," "),title:`\n display: block;\n width: 100%;\n color: ${u.color};\n line-height: ${u.height}px;\n ${u.fontName!==r?`font-family: "${u.fontName}";`:""}\n text-align: ${u.textAlign};\n padding-bottom: ${u.paddingBottom}px;\n padding-left: ${u.paddingLeft}px;\n padding-right: ${u.paddingRight}px;\n padding-top: ${u.paddingTop}px;\n font-size: ${u.size}px;\n font-weight: ${u.fontWeight};\n margin: 0;\n ${w.title}\n `.replace(/\s+/g," "),titleName:u.name}}(i),h=i[d].font.name,m=i[d].title.fontName;h!==r&&l.includes(h)&&g(`https://fonts.googleapis.com/css?family=${h}&display=swap`);m!==h&&m!==r&&l.includes(h)&&g(`https://fonts.googleapis.com/css?family=${m}&display=swap`);const w=`<div class='block-wrapper block-wrapper-${o.informer_id}' style='${p.blocksWrapper}'></div>`;t.setAttribute("style",p.row),t.innerHTML=u(p),t.innerHTML+=w;const y=document.getElementsByClassName(`block-wrapper-${o.informer_id}`)[0],b=t.clientWidth,x=i[d],$=i[d].general.countCalls,v=i[d].general.countRows;for(let e=0;e<$*v&&n[e];e++){n[e].url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n\?\=]+)/im);const t=c[Math.floor(Math.random()*c.length)],r=`&utm_source=${window.location.host}`+"&utm_medium=referral"+`&utm_campaign=${n[e].site_id}`+`&utm_content=${n[e].news_id}`+`&utm_term=${o.view_news_id}`+`&a_b_c=${t}`;y.innerHTML+=f({link:`${a}/?top_payload=${window.btoa(unescape(encodeURIComponent(JSON.stringify(Object.assign(o,{click_news_id:n[e].news_id,click_news_url:n[e].url,click_signature:n[e].click_signature,click_uuid:n[e].click_uuid})))))+r}`,imagePath:n[e].img,text:n[e].title,containerWidth:b,stylesObject:x,columnsCount:$,position:e+1,id:n[e].news_id,mode:d},p)}s.set("informerRef",y.parentElement),e(y.parentElement)}({container:t,array:i.content,stylesParams:i.styles,urlParams:{...n,view_news_id:i.news_id,timestamp:Date.now(),user:s.get("user")},rotator:i.rotator,paramsForABTestings:S}),p({type:"post",key:"news_ids",value:i.news_id}),function({container:e,params:t,content:n}){if(0===n.length||!e)return;const r=[],i=e.querySelectorAll(`[${_}]`);let o={observe:()=>{}};if(!i.length)return;"IntersectionObserver"in window&&(o=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){let a=[];const{newsId:c,newsPosition:l}=e.target.dataset,d=n.find(e=>String(e.news_id)===String(c));try{a=JSON.parse(sessionStorage.getItem("observed_news"))||a}finally{}if(Array.isArray(a)&&!a.includes(c)){v({news_id:c,informer_id:t.informer_id,position:l,referer:s.get("documentReferrer"),device_type:s.get("deviceType"),view_signature:d.view_signature,view_uuid:d.view_uuid}),a.push(c),sessionStorage.setItem("observed_news",JSON.stringify(a))}r.push(c),r.length===i.length&&A(t,!0),o.unobserve(e.target)}})}));i.forEach((e,r)=>{o.observe(e),e.addEventListener("click",()=>{const{newsId:r,newsPosition:i}=e.dataset,o=n.find(e=>String(e.news_id)===String(r));v({news_id:r,informer_id:t.informer_id,position:i,referer:s.get("documentReferrer"),device_type:s.get("deviceType"),action:"click",click_signature:o.click_signature,click_uuid:o.click_uuid})})})}({container:t,content:i.content,params:{...n,news_id:i.news_id},referer:s.get("documentReferrer"),device_type:s.get("deviceType")}),function(){const e=document.querySelectorAll(".js-observable-image");if("IntersectionObserver"in window){const t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const n=e.target;t.unobserve(n),n.dataset.src&&(n.srcset=n.dataset.srcset,n.src=n.dataset.src,n.removeAttribute("data-src"),n.removeAttribute("data-srcset"))}})},{rootMargin:"0px 0px 800px 0px"});e.forEach(e=>t.observe(e))}else e.forEach(e=>{e.dataset.src&&(e.srcset=e.dataset.srcset,e.src=e.dataset.src,e.removeAttribute("data-src"),e.removeAttribute("data-srcset"))})}()})})}}({key:t,value:n})}};function c(){let e=window.location.href;const t=window.context&&window.context.location&&window.context.location.href||"",n=document.referrer,r=(e,t)=>{const n=new RegExp(t,"g");return n.test(e)?e.replace(n,""):e};e=r(e,"(www)?.?google.com\\/\\w{1,3}\\/\\w{1}/");try{if(t){e=r(t.match(new RegExp("(!(my(.|-)ua)|\\d{10,20}.ampproject.net\\/\\d{10,})","g"))?n:t,"(amp-((\\w{1,})-)?my-ua.cdn.ampproject.org\\/\\w{1}\\/\\w{1}\\/)")}}catch(e){}return e}function l(){const e=c(),t=new URL(e).searchParams.get("top_payload"),n=t||location.search.substring(1),r=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,i=function(e){let t=null;const n=/^[\],:{}\s]*$/,i=/\\["\\\/bfnrtu]/g,o=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,a=/(?:^|:|,)(?:\s*\[)+/g;if(r.test(e)){const r=window.atob(decodeURIComponent(escape(e))),s=r.replace(i,"@").replace(o,"]").replace(a,""),c=n.test(s)&&r;t=c?JSON.parse(r):t}return t}(n),o=i&&t,a=o?"our":"another",l=e.split("?")[0];s.set("cleanUrl",l),s.set("type",a),o&&s.set("news_id",i.news_id)}const d="iframeMyUa";function p({type:e,key:t,value:n}){const r=document.getElementById(d);if(r)return r.contentWindow.postMessage(JSON.stringify({type:e,key:t,value:n,messageSource:"mypagestats"}),"*")}window.addEventListener("message",e=>(function(e,t){if("https://landing.top.my.ua"!==e.origin&&"https://landing.top.dev.my.ua"!==e.origin&&"https://landing.top.stage.my.ua"!==e.origin)return;let n={};try{n=JSON.parse(e.data?e.data:"{}")}catch(e){}const r=Object.keys(n)[0];s.set(r,n[r]),"user"!==r||s.get("init")||s.get("definedUserInIframe")||t().then(()=>{s.set("definedUserInIframe",!!n.user)})})(e,H),!1);const u=e=>`<${e.tag} style='${e.title}'>${e.titleName}</${e.tag}>`,f=({link:e,imagePath:t,text:n,containerWidth:r,stylesObject:i,columnsCount:o,mode:a,id:s,position:c},l)=>{const{width:d,height:p}=function(e,t,n,r){if("mobile"===r)return{width:n.image.width,height:n.image.height};const{general:i,block:o}=n,{widthBorder:a,paddingLeft:s,paddingRight:c}=o;return{width:Math.ceil(e/t-2*i.paddingHorizontal-2*a-s-c),height:n.image.height}}(r,o,i,a),u=t.includes("?")?t.split("?")[0]:t,f=C(u,d,p),g=C(u,d,p,2);return`<div style="${l.col}" data-news-id="${s}" data-news-position="${c}">\n <a href="${e}" style="${l.link}" target="_blank">\n <img class="js-observable-image" style="${l.image}" \n src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=" \n data-srcset='${`${f} 1x, ${g} 2x`}' \n data-src='${f}'\n alt='${n}' \n width="${d}"\n height="${p}"\n loading="lazy"\n />\n <span style="${l.textWrapper}">\n <span style="${l.text}">\n ${n}\n </span>\n </span>\n </a>\n </div>\n `};function g(e){if(!e)return;const t=document.getElementsByTagName("head")[0],n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),t.appendChild(n,t)}async function h(){await function(){let e=null;const t=null===document.currentScript?document.querySelector(`[${k}]`):document.currentScript;try{e=t.getAttribute(k)}catch(e){}s.set("siteId",e),s.set("currentScript",t)}(),await l(),await function(){let e=!1;try{e=!!c().match(/(https:\/\/amp|ampproject|amp.|amp$)/g)}catch(e){}s.set("isAmp",e)}(),await m(),await s.set("documentReferrer",window.document.referrer),await function(){const e=s.get("user"),t=/^([0-9a-fA-F]{8})-(([0-9a-fA-F]{4}\-){3})([0-9a-fA-F]{12})$/i;let n=!1;try{n=e&&null!==e.match(t)}catch(e){}s.set("user",n?e:""),s.set("isDefinedUser",n)}()}const m=()=>{const e={width:1920,height:1080,type:R};try{const{width:t,height:n}=window.screen;e.width=t,e.height=n,e.type=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})()?T:R}catch(e){}s.set("deviceType",e)},w=`${t}/statistic`,y=`${w}/n/view`,b=`${w}/i/view`,x=`${t}/analytics/action`;function $(e,t){return fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}function v(e){const t={section:"informer",action:"view",block:"main",user:s.get("user"),...e};return $(x,t)}function A(e,t){return t&&s.set("type",s.get("type").includes("views_")?s.get("type"):"views_"+s.get("type")+"_real"),$(`${b}${t?"/real":""}`,function(e){const t={screen_width:window.innerWidth,news_ids:s.get("news_ids"),news_id:s.get("news_id"),user:s.get("user"),type:s.get("type"),url:s.get("cleanUrl"),referer:s.get("documentReferrer"),device_type:s.get("deviceType")};return{...e,...Object.keys(t).reduce((e,n)=>({...e,...t[n]?{[n]:t[n]}:{}}),{})}}(e)).then(e=>e.json())}const k="data-top-sid",E="data-top-iid",_="data-news-id",R="desktop",T="mobile";!function(e,t){const n=document.createElement("iframe");n.src=e,n.id=d,n.name="frame",n.width="100%",n.height="0",n.style="border-width: 0",document.body.appendChild(n),frames.frame.location.host,new Promise(e=>{const n=document.getElementById(d);n.addEventListener("load",()=>{t(n),e()})})}(n,(function(e){p({iframe:e,type:"get",key:"isStatsSent"}),p({iframe:e,type:"get",key:"news_ids"}),p({iframe:e,type:"get",key:"user"}),B()})),document.querySelectorAll(`[${E}]`).forEach(e=>e.innerHTML="Загрузка информера...");const S=function(){const e={};for(let t=67;t<87;t++)e[t]=1;const t=[];return Object.entries(e).map(([e,n])=>t.push(...Array(n).fill(e))),t}();let U;function B(){U?clearTimeout(U):U=setTimeout(()=>H().then(()=>s.set("definedUserInIframe",!0)),6e3)}async function H(){return B(),await h(),(!s.get("isAmp")||"true"!==s.get("isStatsSent"))&&$(y,{url:s.get("cleanUrl"),site_id:s.get("siteId"),type:s.get("type"),referer:s.get("documentReferrer"),device_type:s.get("deviceType"),is_amp:s.get("isAmp"),...s.get("isDefinedUser")?{user:s.get("user")}:{}}).then(e=>e.json()).then(e=>{s.get("isDefinedUser")||(s.set("user",e.user),p({type:"post",key:"user",value:e.user}))}).then(()=>{p({type:"post",key:"isStatsSent",value:"true"}),window.addEventListener("beforeunload",(function(){p({type:"post",key:"isStatsSent",value:"false"})}))}).then(()=>{s.set("init",!0)})}function C(e,t=100,n=100,r=1){const a=`${t*r}x${n*r}/smart/${encodeURIComponent(e)}`,s=new jsSHA("SHA-1","TEXT");s.setHMACKey(o,"TEXT"),s.update(a);const c=s.getHMAC("B64").replace(/\+/g,"-").replace(/\//g,"_");return`${i}/${c}/${a}`}!function(e){function t(e,t,c){var l,d,g,h,m,w,y,b,x,$=0,v=[],A=0,k=!1,E=[],_=[],R=!1;if(l=(c=c||{}).encoding||"UTF8",(x=c.numRounds||1)!==parseInt(x,10)||1>x)throw Error("numRounds must a integer >= 1");if("SHA-1"!==e)throw Error("Chosen SHA variant is not supported");m=512,w=u,y=f,h=160,b=function(e){return e.slice()},g=s(t,l),d=p(e),this.setHMACKey=function(t,n,r){var i;if(!0===k)throw Error("HMAC key already set");if(!0===R)throw Error("Cannot set HMAC key after calling update");if(t=(n=s(n,l=(r||{}).encoding||"UTF8")(t)).binLen,n=n.value,r=(i=m>>>3)/4-1,i<t/8){for(n=y(n,t,0,p(e),h);n.length<=r;)n.push(0);n[r]&=4294967040}else if(i>t/8){for(;n.length<=r;)n.push(0);n[r]&=4294967040}for(t=0;t<=r;t+=1)E[t]=909522486^n[t],_[t]=1549556828^n[t];d=w(E,d),$=m,k=!0},this.update=function(e){var t,n,r,i=0,o=m>>>5;for(e=(t=g(e,v,A)).binLen,n=t.value,t=e>>>5,r=0;r<t;r+=o)i+m<=e&&(d=w(n.slice(r,r+o),d),i+=m);$+=i,v=n.slice(i>>>5),A=e%m,R=!0},this.getHash=function(t,s){var c,l,u,f;if(!0===k)throw Error("Cannot call getHash after setting HMAC key");switch(u=a(s),t){case"HEX":c=function(e){return n(e,h,u)};break;case"B64":c=function(e){return r(e,h,u)};break;case"BYTES":c=function(e){return i(e,h)};break;case"ARRAYBUFFER":try{l=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}c=function(e){return o(e,h)};break;default:throw Error("format must be HEX, B64, BYTES, or ARRAYBUFFER")}for(f=y(v.slice(),A,$,b(d),h),l=1;l<x;l+=1)f=y(f,h,0,p(e),h);return c(f)},this.getHMAC=function(t,s){var c,l,u,f;if(!1===k)throw Error("Cannot call getHMAC without first setting HMAC key");switch(u=a(s),t){case"HEX":c=function(e){return n(e,h,u)};break;case"B64":c=function(e){return r(e,h,u)};break;case"BYTES":c=function(e){return i(e,h)};break;case"ARRAYBUFFER":try{c=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}c=function(e){return o(e,h)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, or ARRAYBUFFER")}return l=y(v.slice(),A,$,b(d),h),f=w(_,p(e)),c(f=y(l,h,m,f,h))}}function n(e,t,n){var r,i,o="";for(t/=8,r=0;r<t;r+=1)i=e[r>>>2]>>>8*(3+r%4*-1),o+="0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i);return n.outputUpper?o.toUpperCase():o}function r(e,t,n){var r,i,o,a="",s=t/8;for(r=0;r<s;r+=3)for(i=r+1<s?e[r+1>>>2]:0,o=r+2<s?e[r+2>>>2]:0,o=(e[r>>>2]>>>8*(3+r%4*-1)&255)<<16|(i>>>8*(3+(r+1)%4*-1)&255)<<8|o>>>8*(3+(r+2)%4*-1)&255,i=0;4>i;i+=1)a+=8*r+6*i<=t?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-i)&63):n.b64Pad;return a}function i(e,t){var n,r,i="",o=t/8;for(n=0;n<o;n+=1)r=e[n>>>2]>>>8*(3+n%4*-1)&255,i+=String.fromCharCode(r);return i}function o(e,t){var n,r,i=t/8,o=new ArrayBuffer(i);for(r=new Uint8Array(o),n=0;n<i;n+=1)r[n]=e[n>>>2]>>>8*(3+n%4*-1)&255;return o}function a(e){var t={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(e=e||{},t.outputUpper=e.outputUpper||!1,!0===e.hasOwnProperty("b64Pad")&&(t.b64Pad=e.b64Pad),"boolean"!=typeof t.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw Error("Invalid b64Pad formatting option");return t}function s(e,t){var n;switch(t){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":n=function(e,t,n){var r,i,o,a,s,c=e.length;if(0!=c%2)throw Error("String of HEX type must be in byte increments");for(t=t||[0],s=(n=n||0)>>>3,r=0;r<c;r+=2){if(i=parseInt(e.substr(r,2),16),isNaN(i))throw Error("String of HEX type contains invalid characters");for(o=(a=(r>>>1)+s)>>>2;t.length<=o;)t.push(0);t[o]|=i<<8*(3+a%4*-1)}return{value:t,binLen:4*c+n}};break;case"TEXT":n=function(e,n,r){var i,o,a,s,c,l,d,p,u=0;if(n=n||[0],c=(r=r||0)>>>3,"UTF8"===t)for(p=3,a=0;a<e.length;a+=1)for(o=[],128>(i=e.charCodeAt(a))?o.push(i):2048>i?(o.push(192|i>>>6),o.push(128|63&i)):55296>i||57344<=i?o.push(224|i>>>12,128|i>>>6&63,128|63&i):(a+=1,i=65536+((1023&i)<<10|1023&e.charCodeAt(a)),o.push(240|i>>>18,128|i>>>12&63,128|i>>>6&63,128|63&i)),s=0;s<o.length;s+=1){for(l=(d=u+c)>>>2;n.length<=l;)n.push(0);n[l]|=o[s]<<8*(p+d%4*-1),u+=1}else if("UTF16BE"===t||"UTF16LE"===t)for(p=2,o="UTF16LE"===t||"UTF16LE"!==t&&!1,a=0;a<e.length;a+=1){for(i=e.charCodeAt(a),!0===o&&(i=(s=255&i)<<8|i>>>8),l=(d=u+c)>>>2;n.length<=l;)n.push(0);n[l]|=i<<8*(p+d%4*-1),u+=2}return{value:n,binLen:8*u+r}};break;case"B64":n=function(e,t,n){var r,i,o,a,s,c,l,d=0;if(-1===e.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(i=e.indexOf("="),e=e.replace(/\=/g,""),-1!==i&&i<e.length)throw Error("Invalid '=' found in base-64 string");for(t=t||[0],c=(n=n||0)>>>3,i=0;i<e.length;i+=4){for(s=e.substr(i,4),o=a=0;o<s.length;o+=1)a|=(r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(s[o]))<<18-6*o;for(o=0;o<s.length-1;o+=1){for(r=(l=d+c)>>>2;t.length<=r;)t.push(0);t[r]|=(a>>>16-8*o&255)<<8*(3+l%4*-1),d+=1}}return{value:t,binLen:8*d+n}};break;case"BYTES":n=function(e,t,n){var r,i,o,a,s;for(t=t||[0],o=(n=n||0)>>>3,i=0;i<e.length;i+=1)r=e.charCodeAt(i),a=(s=i+o)>>>2,t.length<=a&&t.push(0),t[a]|=r<<8*(3+s%4*-1);return{value:t,binLen:8*e.length+n}};break;case"ARRAYBUFFER":try{n=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}n=function(e,t,n){var r,i,o,a,s;for(t=t||[0],i=(n=n||0)>>>3,s=new Uint8Array(e),r=0;r<e.byteLength;r+=1)o=(a=r+i)>>>2,t.length<=o&&t.push(0),t[o]|=s[r]<<8*(3+a%4*-1);return{value:t,binLen:8*e.byteLength+n}};break;default:throw Error("format must be HEX, TEXT, B64, BYTES, or ARRAYBUFFER")}return n}function c(e,t){return e<<t|e>>>32-t}function l(e,t){var n=(65535&e)+(65535&t);return((e>>>16)+(t>>>16)+(n>>>16)&65535)<<16|65535&n}function d(e,t,n,r,i){var o=(65535&e)+(65535&t)+(65535&n)+(65535&r)+(65535&i);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(i>>>16)+(o>>>16)&65535)<<16|65535&o}function p(e){if("SHA-1"!==e)throw Error("No SHA variants supported");return[1732584193,4023233417,2562383102,271733878,3285377520]}function u(e,t){var n,r,i,o,a,s,p,u=[];for(n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],p=0;80>p;p+=1)u[p]=16>p?e[p]:c(u[p-3]^u[p-8]^u[p-14]^u[p-16],1),s=20>p?d(c(n,5),r&i^~r&o,a,1518500249,u[p]):40>p?d(c(n,5),r^i^o,a,1859775393,u[p]):60>p?d(c(n,5),r&i^r&o^i&o,a,2400959708,u[p]):d(c(n,5),r^i^o,a,3395469782,u[p]),a=o,o=i,i=c(r,30),r=n,n=s;return t[0]=l(n,t[0]),t[1]=l(r,t[1]),t[2]=l(i,t[2]),t[3]=l(o,t[3]),t[4]=l(a,t[4]),t}function f(e,t,n,r){var i;for(i=15+(t+65>>>9<<4);e.length<=i;)e.push(0);for(e[t>>>5]|=128<<24-t%32,t+=n,e[i]=4294967295&t,e[i-1]=t/4294967296|0,t=e.length,i=0;i<t;i+=16)r=u(e.slice(i,i+16),r);return r}"function"==typeof define&&define.amd?define((function(){return t})):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(module.exports=t),exports=t):e.jsSHA=t}(this)}();