0% found this document useful (0 votes)
26 views

F

This document provides code for implementing promises in JavaScript. It defines a Promise constructor and various Promise methods like resolve, reject, then, catch, and race. The code uses closures, prototypes, and other techniques to enable asynchronous programming in JS.

Uploaded by

Maria Yousaf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

F

This document provides code for implementing promises in JavaScript. It defines a Promise constructor and various Promise methods like resolve, reject, then, catch, and race. The code uses closures, prototypes, and other techniques to enable asynchronous programming in JS.

Uploaded by

Maria Yousaf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

(function(){/*

Copyright The Closure Library Authors.


SPDX-License-Identifier: Apache-2.0
*/
function ba(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:
{done:!0}}}var ca="function"==typeof Object.defineProperties?
Object.defineProperty:function(a,b,c){if(a==Array.prototype||
a==Object.prototype)return a;a[b]=c.value;return a};
function da(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof
window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var
b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find
global object");}var p=da(this);function ea(a,b){if(b)a:{var
c=p;a=a.split(".");for(var d=0;d<a.length-1;d++){var g=a[d];if(!(g in c))break
a;c=c[g]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ca(c,a,{configurable:!
0,writable:!0,value:b})}}
function fa(a){var b="undefined"!=typeof
Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:ba(a)}}var
ha="function"==typeof Object.create?Object.create:function(a){function b()
{}b.prototype=a;return new b},ia;if("function"==typeof
Object.setPrototypeOf)ia=Object.setPrototypeOf;else{var ja;a:{var ka={a:!
0},la={};try{la.__proto__=ka;ja=la.a;break a}catch(a){}ja=!1}ia=ja?function(a,b)
{a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not
extensible");return a}:null}
var ma=ia;function na(a,b)
{a.prototype=ha(b.prototype);a.prototype.constructor=a;if(ma)ma(a,b);else for(var c
in b)if("prototype"!=c)if(Object.defineProperties){var
d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else
a[c]=b[c];a.Y=b.prototype}function oa(){for(var
a=Number(this),b=[],c=a;c<arguments.length;c++)b[c-a]=arguments[c];return b}
ea("Promise",function(a){function b(e){this.h=0;this.i=void 0;this.g=[];this.o=!
1;var f=this.j();try{e(f.resolve,f.reject)}catch(h){f.reject(h)}}function c()
{this.g=null}function d(e){return e instanceof b?e:new b(function(f)
{f(e)})}if(a)return a;c.prototype.h=function(e){if(null==this.g){this.g=[];var
f=this;this.i(function(){f.l()})}this.g.push(e)};var
g=p.setTimeout;c.prototype.i=function(e){g(e,0)};c.prototype.l=function()
{for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var f=0;f<e.length;++f)
{var h=
e[f];e[f]=null;try{h()}catch(l){this.j(l)}}}this.g=null};c.prototype.j=function(e)
{this.i(function(){throw e;})};b.prototype.j=function(){function e(l){return
function(m){h||(h=!0,l.call(f,m))}}var f=this,h=!
1;return{resolve:e(this.B),reject:e(this.l)}};b.prototype.B=function(e)
{if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e
instanceof b)this.D(e);else{a:switch(typeof e){case "object":var f=null!=e;break
a;case "function":f=!0;break a;default:f=!1}f?this.A(e):this.m(e)}};
b.prototype.A=function(e){var f=void 0;try{f=e.then}catch(h)
{this.l(h);return}"function"==typeof f?
this.F(f,e):this.m(e)};b.prototype.l=function(e)
{this.s(2,e)};b.prototype.m=function(e){this.s(1,e)};b.prototype.s=function(e,f)
{if(0!=this.h)throw Error("Cannot settle("+e+", "+f+"): Promise already settled in
state"+this.h);this.h=e;this.i=f;2===this.h&&this.C();this.u()};b.prototype.C=funct
ion(){var e=this;g(function(){if(e.v()){var f=p.console;"undefined"!==typeof
f&&f.error(e.i)}},1)};b.prototype.v=
function(){if(this.o)return!1;var
e=p.CustomEvent,f=p.Event,h=p.dispatchEvent;if("undefined"===typeof h)return!
0;"function"===typeof e?e=new e("unhandledrejection",{cancelable:!
0}):"function"===typeof f?e=new f("unhandledrejection",{cancelable:!0}):
(e=p.document.createEvent("CustomEvent"),e.initCustomEvent("unhandledrejection",!
1,!0,e));e.promise=this;e.reason=this.i;return h(e)};b.prototype.u=function()
{if(null!=this.g){for(var e=0;e<this.g.length;++e)k.h(this.g[e]);this.g=null}};var
k=new c;b.prototype.D=
function(e){var f=this.j();e.G(f.resolve,f.reject)};b.prototype.F=function(e,f){var
h=this.j();try{e.call(f,h.resolve,h.reject)}catch(l)
{h.reject(l)}};b.prototype.then=function(e,f){function h(n,v)
{return"function"==typeof n?function(u){try{l(n(u))}catch(I){m(I)}}:v}var l,m,t=new
b(function(n,v){l=n;m=v});this.G(h(e,l),h(f,m));return
t};b.prototype.catch=function(e){return this.then(void
0,e)};b.prototype.G=function(e,f){function h(){switch(l.h){case 1:e(l.i);break;case
2:f(l.i);break;default:throw Error("Unexpected state: "+
l.h);}}var l=this;null==this.g?k.h(h):this.g.push(h);this.o=!
0};b.resolve=d;b.reject=function(e){return new b(function(f,h)
{h(e)})};b.race=function(e){return new b(function(f,h){for(var l=fa(e),m=l.next();!
m.done;m=l.next())d(m.value).G(f,h)})};b.all=function(e){var
f=fa(e),h=f.next();return h.done?d([]):new b(function(l,m){function t(u){return
function(I){n[u]=I;v--;0==v&&l(n)}}var n=[],v=0;do n.push(void 0),v+
+,d(h.value).G(t(n.length-1),m),h=f.next();while(!h.done)})};return b});var
q=this||self;
function ra(a){return a};var sa=Array.prototype.indexOf?function(a,b){return
Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof
a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var
c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-
1},ta=Array.prototype.forEach?function(a,b){Array.prototype.forEach.call(a,b,void
0)}:function(a,b){for(var c=a.length,d="string"===typeof a?a.split(""):a,g=0;g<c;g+
+)g in d&&b.call(void 0,d[g],g,a)};function ua(a){ua[" "](a);return a}ua["
"]=function(){};var va={},r=null;var wa="function"===typeof Uint8Array;var
w="function"===typeof Symbol&&"symbol"===typeof Symbol()?Symbol(void 0):void
0;function x(a){Object.isFrozen(a)||(w?a[w]|=1:void 0!==a.g?a.g|
=1:Object.defineProperties(a,{g:{value:1,configurable:!0,writable:!0,enumerable:!
1}}));return a};function xa(a){return null!==a&&"object"===typeof
a&&a.constructor===Object}
function ya(a){switch(typeof a){case "number":return isFinite(a)?a:String(a);case
"object":if(wa&&null!=a&&a instanceof Uint8Array){var b;void 0===b&&(b=0);if(!r)
{r={};for(var
c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),d=["+/
=","+/","-_=","-_.","-_"],g=0;5>g;g++){var
k=c.concat(d[g].split(""));va[g]=k;for(var e=0;e<k.length;e++){var f=k[e];void
0===r[f]&&(r[f]=e)}}}b=va[b];c=Array(Math.floor(a.length/3));d=b[64]||"";for(g=k=0;
k<a.length-2;k+=3){var h=a[k],l=a[k+1];
f=a[k+2];e=b[h>>2];h=b[(h&3)<<4|l>>4];l=b[(l&15)<<2|f>>6];f=b[f&63];c[g+
+]=e+h+l+f}e=0;f=d;switch(a.length-k){case 2:e=a[k+1],f=b[(e&15)<<2]||d;case
1:a=a[k],c[g]=b[a>>2]+b[(a&3)<<4|e>>4]+f+d}a=c.join("")}return a;default:return
a}};function za(a,b){if(null!=a)return Array.isArray(a)||xa(a)?
Aa(a,b):b(a)}function Aa(a,b){if(Array.isArray(a)){for(var
c=Array(a.length),d=0;d<a.length;d++)c[d]=za(a[d],b);if(b=Array.isArray(a)){var
g;w?g=a[w]:g=a.g;b=(null==g?0:g)&1}b&&x(c);return c}g={};for(c in
a)g[c]=za(a[c],b);return g};var Ba;function y(a,b,c){var d=Ba;Ba=null;a||
(a=d);d=this.constructor.X;a||(a=d?[d]:[]);this.j=(d?0:-1)-(this.constructor.W||
0);this.h=null;this.g=a;a:{d=this.g.length;a=d-1;if(d&&(d=this.g[a],xa(d)))
{this.l=a-this.j;this.i=d;break a}void 0!==b&&-1<b?(this.l=Math.max(b,a+1-
this.j),this.i=null):this.l=Number.MAX_VALUE}if(c)for(b=0;b<c.length;b+
+)a=c[b],a<this.l?(a+=this.j,(d=this.g[a])?Array.isArray(d)&&x(d):this.g[a]=Ca):
(d=this.l+this.j,this.g[d]||(this.i=this.g[d]={}),(d=this.i[a])?
Array.isArray(d)&&x(d):
this.i[a]=Ca)}var Ca=Object.freeze(x([]));function z(a,b,c){return-1===b?null:(void
0===c?0:c)||b>=a.l?a.i?a.i[b]:void 0:a.g[b+a.j]}function A(a,b){a=z(a,b);a=null==a?
a:!!a;return null==a?!1:a}function Da(a){var b=Ea;a.h||(a.h={});var
c=a.h[1];if(c)return c;var d=z(a,1,!1);if(null==d)return c;b=new b(d);return
a.h[1]=b}y.prototype.toJSON=function(){var a=Fa(this);return Aa(a,ya)};
function Fa(a){if(a.h)for(var b in a.h){var c=a.h[b];if(Array.isArray(c))for(var
d=0;d<c.length;d++)c[d]&&Fa(c[d]);else c&&Fa(c)}return a.g}function Ga(a,b)
{a=z(a,b);return null==a?0:a}function Ha(a,b){a=z(a,b);return
null==a?"":a};function Ea(a){y.call(this,a,-1,Ia)}na(Ea,y);var Ia=[28];function
Ja(a){y.call(this,a,-1,Ka)}na(Ja,y);var Ka=[21];var B;function C(a,b)
{this.g=b===La?a:""}C.prototype.toString=function(){return this.g+""};var
La={};function Ma(a){if(void 0===B){var b=null;var
c=q.trustedTypes;if(c&&c.createPolicy){try{b=c.createPolicy("goog#html",
{createHTML:ra,createScript:ra,createScriptURL:ra})}catch(d)
{q.console&&q.console.error(d.message)}B=b}else B=b}a=(b=B)?
b.createScriptURL(a):a;return new C(a,La)};/*

SPDX-License-Identifier: Apache-2.0
*/
function Na(a){var b=!1,c;return function(){b||(c=a(),b=!0);return c}};var
Oa={passive:!0},Pa=Na(function(){var a=!1;try{var
b=Object.defineProperty({},"passive",{get:function(){a=!
0}});q.addEventListener("test",null,b)}catch(c){}return a});function D(a,b,c,d)
{if(a.addEventListener){var g=a.addEventListener;d=d?d.passive&&Pa()?d:d.capture||!
1:!1;g.call(a,b,c,d)}};function F(a){var b=document;return"string"===typeof a?
b.getElementById(a):a}function Qa(a){var b=document;b.getElementsByClassName?
a=b.getElementsByClassName(a)[0]:
(b=document,a=b.querySelectorAll&&b.querySelector&&a?
b.querySelector(a?"."+a:""):Ra(b,a)[0]||null);return a||null}
function Ra(a,b){var c,d;if(a.querySelectorAll&&a.querySelector&&b)return
a.querySelectorAll(b?"."+b:"");if(b&&a.getElementsByClassName){var
g=a.getElementsByClassName(b);return g}g=a.getElementsByTagName("*");if(b){var
k={};for(c=d=0;a=g[c];c++){var e=a.className,f;if(f="function"==typeof
e.split)f=0<=sa(e.split(/\s+/),b);f&&(k[d++]=a)}k.length=d;return k}return
g}function Sa(a){a&&a.parentNode&&a.parentNode.removeChild(a)};var Ta=RegExp("^(?:
([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?
([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function G(a){try{var b;if(b=!!
a&&null!=a.location.href)a:{try{ua(a.foo);b=!0;break a}catch(c){}b=!1}return
b}catch(c){return!1}}function H(a,b){if(a)for(var c in
a)Object.prototype.hasOwnProperty.call(a,c)&&b.call(void 0,a[c],c,a)}function J(a)
{a.preventDefault?a.preventDefault():a.returnValue=!1}function Ua(a,b){b=void
0===b?document:b;return b.createElement(String(a).toLowerCase())};function K(a,b)
{a.google_image_requests||(a.google_image_requests=[]);var
c=Ua("IMG",a.document);c.src=b;a.google_image_requests.push(c)}function Va(){var
a="https://pagead2.googlesyndication.com/pagead/gen_204?
id=badpubwin";H({stack:Error().stack},function(b,c)
{b&&(a+="&"+c+"="+encodeURIComponent(b))});Wa(a)}function Wa(a){var
b=window;b.fetch?b.fetch(a,{keepalive:!
0,credentials:"include",redirect:"follow",method:"get",mode:"no-cors"}):K(b,a)};var
Xa=0;function Ya(a){var b=document.currentScript;return(a=(b=void 0===b?
null:b)&&b.getAttribute("data-jc")===String(a)?b:document.querySelector('[data-
jc="'+a+'"]'))&&a.getAttribute("data-jc-version")||"unknown"}
function Za(){var a=void 0===a?.01:a;if(!(Math.random()>a))
{a="https://pagead2.googlesyndication.com/pagead/gen_204?
id=jca&jc=60&version="+Ya(60)+"&sample="+a;var
b=window,c;if(c=b.navigator)c=b.navigator.userAgent,c=/Chrome/.test(c)&&!/Edge/.tes
t(c)?!0:!1;c&&b.navigator.sendBeacon?b.navigator.sendBeacon(a):K(b,a)}};var
L=document,M=window;function db(a){return"string"==typeof a.className?
a.className:a.getAttribute&&a.getAttribute("class")||""}function eb(a,b)
{a.classList?b=a.classList.contains(b):(a=a.classList?
a.classList:db(a).match(/\S+/g)||[],b=0<=sa(a,b));return b}function N(a,b)
{if(a.classList)a.classList.add(b);else if(!eb(a,b)){var c=db(a);b=c+(0<c.length?"
"+b:b);"string"==typeof a.className?
a.className=b:a.setAttribute&&a.setAttribute("class",b)}};function fb(a)
{this.g=(this.serializedAttributionData=a)?new
Ja(a):null;this.isMutableImpression=null!=z(this.g,1)&&!!A(Da(this.g),33);this.T=!!
A(this.g,11);this.hasUserFeedbackData=!!this.g&&null!=z(this.g,1);this.L=!!
A(this.g,4);this.O=!!A(this.g,6);this.K=!!
A(this.g,13);this.creativeIndexSuffix=1<Ga(this.g,8)?
Ga(this.g,7).toString():"";this.U=!!A(this.g,17);this.R=!!A(this.g,18);this.J=!!
A(this.g,14);this.enableMultiplexThirdPartyAttribution=!!A(this.g,32);this.B=!!
A(this.g,15);this.V=!!A(this.g,
31);this.P=1==A(this.g,9);this.openAttributionInline=1==A(this.g,10);this.isMobileD
evice=!!A(this.g,12);this.S=null;this.N=(a=L.querySelector("[data-
slide]"))?"true"===a.getAttribute("data-slide"):!1;(this.D=""!
==this.creativeIndexSuffix)&&void
0===M.goog_multislot_cache&&(M.goog_multislot_cache={});if(this.D&&!this.N)
{if(a=M.goog_multislot_cache.hd,void 0===a){a=!1;var b=L.querySelector("[data-
dim]");if(b)if(b=b.getBoundingClientRect(),150<=b.right-b.left&&150<=b.bottom-
b.top)a=!1;else{var c=document.body.getBoundingClientRect();
150>(1>=Math.abs(c.left-b.left)&&1>=Math.abs(c.right-b.right)?b.bottom-
b.top:b.right-b.left)&&(a=!0)}else a=!1;window.goog_multislot_cache.hd=a}}else a=!
1;this.C=a;this.u=F("abgcp"+this.creativeIndexSuffix);this.s=F("abgc"+this.creative
IndexSuffix);this.h=F("abgs"+this.creativeIndexSuffix);F("abgl"+this.creativeIndexS
uffix);this.o=F("abgb"+this.creativeIndexSuffix);this.A=F("abgac"+this.creativeInde
xSuffix);F("mute_panel"+this.creativeIndexSuffix);this.v=Qa("goog_delegate_attribut
ion"+this.creativeIndexSuffix);
this.isDelegateAttributionActive=!!this.v&&!!this.J&&!
Qa("goog_delegate_disabled")&&!this.B;if(this.h)a:
{a=this.h;b="A";c=a.childNodes;for(var d=0;d<c.length;d++){var
g=c.item(d);if("undefined"!=typeof g.tagName&&g.tagName.toUpperCase()==b){a=g;break
a}}}else a=null;this.l=a;this.j=this.isDelegateAttributionActive?
this.v:F("cbb"+this.creativeIndexSuffix);this.M=this.C?"0"===this.creativeIndexSuff
ix:!0;this.enableDelegateDismissableMenu=!!
this.j&&eb(this.j,"goog_dismissable_menu");this.m=null;this.F=
0;this.i=this.isDelegateAttributionActive?this.v:this.O&&this.u?
this.u:this.s;this.I=!!A(this.g,19);this.adbadgeEnabled=!!
A(this.g,24);this.enableNativeJakeUi=!!A(this.g,27)};function gb(a,b){if(!a)throw
Error("bad conv util ctor args");this.h=a;this.g=b};var hb=!!
window.google_async_iframe_id,O=hb&&window.parent||window;function P(a,b)
{a&&H(b,function(c,d){a.style[d]=c})};function ib(a,b){var c=void 0===c?
{}:c;this.error=a;this.context=b.context;this.msg=b.message||"";this.id=b.id||"jser
ror";this.meta=c};var jb=RegExp("^https?://(\\w|-)+\\.cdn\\.ampproject\\.(net|org)
(\\?|/|$)");function kb(a,b){this.g=a;this.h=b}function lb(a,b)
{this.url=a;this.H=!!b;this.depth=null};function mb()
{this.i="&";this.h={};this.j=0;this.g=[]}function Q(a,b){var
c={};c[a]=b;return[c]}function nb(a,b,c,d,g){var k=[];H(a,function(e,f)
{(e=ob(e,b,c,d,g))&&k.push(f+"="+e)});return k.join(b)}
function ob(a,b,c,d,g){if(null==a)return"";b=b||"&";c=c||",$";"string"==typeof
c&&(c=c.split(""));if(a instanceof Array){if(d=d||0,d<c.length){for(var
k=[],e=0;e<a.length;e++)k.push(ob(a[e],b,c,d+1,g));return k.join(c[d])}}else
if("object"==typeof a)return g=g||0,2>g?
encodeURIComponent(nb(a,b,c,d,g+1)):"...";return encodeURIComponent(String(a))}
function pb(a,b,c){b=b+"//pagead2.googlesyndication.com"+c;var d=qb(a)-
c.length;if(0>d)return"";a.g.sort(function(m,t){return m-t});c=null;for(var
g="",k=0;k<a.g.length;k++)for(var e=a.g[k],f=a.h[e],h=0;h<f.length;h++){if(!d)
{c=null==c?e:c;break}var l=nb(f[h],a.i,",$");if(l){l=g+l;if(d>=l.length){d-
=l.length;b+=l;g=a.i;break}c=null==c?e:c}}a="";null!=c&&(a=g+"trn="+c);return
b+a}function qb(a){var b=1,c;for(c in a.h)b=c.length>b?c.length:b;return 3997-b-
a.i.length-1};function rb(){var a=void 0===a?
M:a;this.h="http:"===a.location.protocol?"http:":"https:";this.g=Math.random()}func
tion sb(){var a=tb,b=R.google_srt;0<=b&&1>=b&&(a.g=b)}function ub(a,b,c,d,g){if((d?
a.g:Math.random())<(g||.01))try{if(c instanceof mb)var k=c;else k=new
mb,H(c,function(f,h){var l=k,m=l.j++;f=Q(h,f);l.g.push(m);l.h[m]=f});var
e=pb(k,a.h,"/pagead/gen_204?id="+b+"&");e&&K(q,e)}catch(f){}};var S=null;function
vb(){var a=q.performance;return a&&a.now&&a.timing?Math.floor(a.now()
+a.timing.navigationStart):Date.now()}function wb(){var a=void 0===a?
q:a;return(a=a.performance)&&a.now?a.now():null};function xb(a,b){var c=wb()||
vb();this.label=a;this.type=b;this.value=c;this.duration=0;this.uniqueId=Math.rando
m();this.slotId=void 0};var T=q.performance,yb=!!
(T&&T.mark&&T.measure&&T.clearMarks),U=Na(function(){var a;if(a=yb){var
b;if(null===S){S="";try{a="";try{a=q.top.location.hash}catch(c)
{a=q.location.hash}a&&(S=(b=a.match(/\bdeid=([\d,]+)/))?b[1]:"")}catch(c)
{}}b=S;a=!!b.indexOf&&0<=b.indexOf("1337")}return a});
function zb(){var a=R;this.h=[];this.i=a||q;var
b=null;a&&(a.google_js_reporting_queue=a.google_js_reporting_queue||
[],this.h=a.google_js_reporting_queue,b=a.google_measure_js_timing);this.g=U()||
(null!=b?b:1>Math.random())}function Ab(a)
{a&&T&&U()&&(T.clearMarks("goog_"+a.label+"_"+a.uniqueId+"_start"),T.clearMarks("go
og_"+a.label+"_"+a.uniqueId+"_end"))}zb.prototype.start=function(a,b){if(!
this.g)return null;a=new
xb(a,b);b="goog_"+a.label+"_"+a.uniqueId+"_start";T&&U()&&T.mark(b);return a};
zb.prototype.end=function(a){if(this.g&&"number"===typeof a.value)
{a.duration=(wb()||vb())-a.value;var
b="goog_"+a.label+"_"+a.uniqueId+"_end";T&&U()&&T.mark(b);!this.g||
2048<this.h.length||this.h.push(a)}};function Bb(){var
a=Cb;this.l=tb;this.h=null;this.m=this.j;this.g=void 0===a?null:a;this.i=!
1}function Db(a,b,c){try{if(a.g&&a.g.g){var d=a.g.start(b.toString(),3);var
g=c();a.g.end(d)}else g=c()}catch(f){c=!0;try{Ab(d),c=a.m(b,new ib(f,
{message:Eb(f)}),void 0,void 0)}catch(h){a.j(217,h)}if(c){var
k,e;null==(k=window.console)||null==(e=k.error)||e.call(k,f)}else throw f;}return
g}
function Fb(a,b){var c=V;return function(){var d=oa.apply(0,arguments);return
Db(c,a,function(){return b.apply(void 0,d)})}}
Bb.prototype.j=function(a,b,c,d,g){g=g||"jserror";try{var k=new
mb;k.g.push(1);k.h[1]=Q("context",a);b.error&&b.meta&&b.id||(b=new ib(b,
{message:Eb(b)}));if(b.msg){var
e=b.msg.substring(0,512);k.g.push(2);k.h[2]=Q("msg",e)}var f=b.meta||
{};if(this.h)try{this.h(f)}catch(aa){}if(d)try{d(f)}catch(aa)
{}b=[f];k.g.push(3);k.h[3]=b;d=q;b=[];e=null;do{var h=d;if(G(h)){var
l=h.location.href;e=h.document&&h.document.referrer||null}else
l=e,e=null;b.push(new lb(l||""));try{d=h.parent}catch(aa){d=null}}while(d&&
h!=d);l=0;for(var m=b.length-1;l<=m;++l)b[l].depth=m-
l;h=q;if(h.location&&h.location.ancestorOrigins&&h.location.ancestorOrigins.length=
=b.length-1)for(m=1;m<b.length;++m){var t=b[m];t.url||
(t.url=h.location.ancestorOrigins[m-1]||"",t.H=!0)}var n=new lb(q.location.href,!
1);h=null;var v=b.length-1;for(t=v;0<=t;--t){var u=b[t];!
h&&jb.test(u.url)&&(h=u);if(u.url&&!u.H){n=u;break}}u=null;var
I=b.length&&b[v].url;0!=n.depth&&I&&(u=b[v]);var E=new kb(n,u);if(E.h){var
Ob=E.h.url||"";k.g.push(4);k.h[4]=Q("top",
Ob)}var pa={url:E.g.url||""};if(E.g.url){var qa=E.g.url.match(Ta),
$a=qa[1],ab=qa[3],bb=qa[4];n="";
$a&&(n+=$a+":");ab&&(n+="//",n+=ab,bb&&(n+=":"+bb));var cb=n}else cb="";pa=[pa,
{url:cb}];k.g.push(5);k.h[5]=pa;ub(this.l,g,k,this.i,c)}catch(aa){try{ub(this.l,g,
{context:"ecmserr",rctx:a,msg:Eb(aa),url:E&&E.g.url},this.i,c)}catch(Zb){}}return!
0};
function Eb(a){var b=a.toString();a.name&&-1==b.indexOf(a.name)&&(b+=":
"+a.name);a.message&&-1==b.indexOf(a.message)&&(b+=": "+a.message);if(a.stack)
{a=a.stack;try{-1==a.indexOf(b)&&(a=b+"\n"+a);for(var
c;a!=c;)c=a,a=a.replace(/((https?:\/..*\/)[^\/:]*:\d+
(?:.|\n)*)\2/,"$1");b=a.replace(/\n */g,"\n")}catch(d){}}return b};var
tb,V;if(hb&&!G(O)){.01>Math.random()&&Va();var
Gb="."+L.domain;try{for(;2<Gb.split(".").length&&!
G(O);)L.domain=Gb=Gb.substr(Gb.indexOf(".")+1),O=window.parent}catch(a){}G(O)||
(O=window)}var R=O,Cb=new zb;function Hb(){if(!R.google_measure_js_timing){var
a=Cb;a.g=!1;a.h!=a.i.google_js_reporting_queue&&(U()&&ta(a.h,Ab),a.h.length=0)}}
(function(a){tb=null!=a?a:new rb;"number"!==typeof
R.google_srt&&(R.google_srt=Math.random());sb();V=new Bb;V.h=function(b){var
c=Xa;0!==c&&(b.jc=String(c),b.shv=Ya(c))};V.i=!0;"complete"==R.document.readyState?
Hb():Cb.g&&D(R,"load",function(){Hb()})})();function W(a,b){return
Fb(a,b)};function Ib(a,b){var c=this;this.g=a;this.h=b;this.g.U||(this.j=!
1,this.i=null,!this.g.C||this.g.adbadgeEnabled||this.g.M?Jb(this):
(a={display:"none"},b={width:"15px",height:"15px"},this.g.isMobileDevice?
(P(this.g.o,a),P(this.g.h,a),P(this.g.u,b),P(this.g.s,b)):P(this.g.s,a)),Kb(this),t
his.g.enableNativeJakeUi&&N(this.g.A,"abgnac"),this.g.isDelegateAttributionActive?
(N(document.body,"goog_delegate_active"),N(document.body,"jaa")):(!
this.g.isMutableImpression&&this.g.j&&Sa(this.g.j),setTimeout(function()
{N(document.body,
"jar")},this.g.K?
750:100)),this.g.B&&N(document.body,"goog_delegate_disabled"),this.g.I&&M.addEventL
istener("load",function(){return c.h()}))}
function Kb(a){if(a.g.T)D(a.g.i,"click",W(365,function(c){var
d=M.goog_interstitial_display;d&&(d(c),c&&(c.stopPropagation(),c.preventDefault()))
}));else if(a.g.isMutableImpression&&a.g.isMobileDevice)D(a.g.i,"click",function()
{return a.h()});else if(a.g.isMutableImpression&&!
a.g.isMobileDevice&&(a.g.j&&(D(a.g.j,"click",function(){return
a.h()}),D(a.g.j,"keydown",function(c){"Enter"!==c.code&&"Space"!==c.code||
a.h()})),a.g.V&&a.g.h&&D(a.g.h,"click",function(){return
a.h()})),a.g.L)Lb(a);else{D(a.g.i,
"mouseover",W(367,function(){return Lb(a)}));D(a.g.i,"mouseout",W(369,function()
{return Mb(a,500)}));D(a.g.i,"touchstart",W(368,function(){return Lb(a)}),Oa);var
b=W(370,function(){return
Mb(a,4E3)});D(a.g.i,"mouseup",b);D(a.g.i,"touchend",b);D(a.g.i,"touchcancel",b);a.g
.l&&D(a.g.l,"click",W(371,function(c){return a.preventDefault(c)}))}}
function Jb(a){if(a.g.l&&a.g.R){var b=Da(a.g.g);b&&null!=z(b,5)&&null!
=z(b,6)&&(a.i=new gb(Ha(b,5),Ha(b,19)));D(a.g.l,"click",W(452,function(){if(!
a.j&&(a.j=!0,a.i)){var
c=a.i,d=c.h+"&label=closebutton_whythisad_click";d+="&label_instance=1";c.g&&(d+="&
cid="+c.g);K(window,d)}}))}}function Nb(a){var
b=a.g.A;b.style.display="block";a.g.enableNativeJakeUi&&window.requestAnimationFram
e(function(){N(b,"abgacfo")})}
function Lb(a)
{window.clearTimeout(a.g.m);a.g.m=null;a.g.h&&"block"==a.g.h.style.display||
(a.g.F=Date.now(),a.g.o&&a.g.h&&(a.g.o.style.display="none",a.g.h.style.display="bl
ock"))}function Mb(a,b)
{window.clearTimeout(a.g.m);a.g.m=window.setTimeout(function(){return
Pb(a)},b)}function Pb(a)
{window.clearTimeout(a.g.m);a.g.m=null;a.g.o&&a.g.h&&(a.g.o.style.display="block",a
.g.h.style.display="none")}
Ib.prototype.preventDefault=function(a)
{if(this.g.h&&"block"==this.g.h.style.display&&500>Date.now()-this.g.F)J(a);else
if(this.g.openAttributionInline){var b=this.g.l.getAttribute("href");window.adSlot?
window.adSlot.openAttribution(b)&&J(a):window.openAttribution&&(window.openAttribut
ion(b),J(a))}else this.g.P&&(b=this.g.l.getAttribute("href"),window.adSlot?
window.adSlot.openSystemBrowser(b)&&J(a):window.openSystemBrowser&&(window.openSyst
emBrowser(b),J(a)))};function Qb(a){var b=Rb,c=this;if(!b)throw Error("bad
ctor");this.i=b;this.h=a;this.g=!1;Qa("goog_delegate_deferred")?void 0!
==M.goog_delegate_deferred_token?Sb(this):(a=function()
{Sb(c)},M.goog_delegate_deferred_token=a,setTimeout(a,5E3)):Sb(this)}function Sb(a)
{if(!a.g&&(a.g=!0,M.goog_delegate_deferred_token=void 0,a.h)){var b=a.i;a=a.h;if(!
a)throw Error("bad attrdata");a=new fb(a);new b(a)}};function Tb(){var
a=this;this.promise=new Promise(function(b,c){a.resolve=b;a.reject=c})};function
Ub(){var a=new Tb;this.promise=a.promise;this.resolve=a.resolve}function Vb(a,b)
{a.google_llp||(a.google_llp={});a=a.google_llp;a[5]||(a[5]=new Ub,b&&b());return
a[5]}
function Wb(a,b){return Vb(a,function(){var c=a.document,d=Ua("SCRIPT",c);d.src=b
instanceof C&&b.constructor===C?b.g:"type_error:TrustedResourceUrl";var
g,k=(d.ownerDocument&&d.ownerDocument.defaultView||
window).document,e=null===(g=k.querySelector)||void 0===g?void
0:g.call(k,"script[nonce]");(g=e?e.nonce||
e.getAttribute("nonce")||"":"")&&d.setAttribute("nonce",g);
(c=c.getElementsByTagName("script")
[0])&&c.parentNode&&c.parentNode.insertBefore(d,c)}).promise};function Rb(a){var
b=this;this.g=a;this.h=new Ib(this.g,W(359,function(){return Xb(b)}))}function
Xb(a){Db(V,373,function()
{Pb(a.h);Nb(a.h)});Wb(window,Ma("https://pagead2.googlesyndication.com/pagead/js/"+
(Ha(a.g.g,33)+"/abg_survey.js"))).then(function(b)
{b.createAttributionCard(a.g);a.g.S=b;b.expandAttributionCard()});Za()};Xa=60;funct
ion Yb(a){var b=[a];b=void 0===b?[]:b;q.google_logging_queue||
(q.google_logging_queue=[]);q.google_logging_queue.push([11,b]);new Qb(a)}var
X=["buildAttribution"],Y=q;X[0]in Y||"undefined"==typeof Y.execScript||
Y.execScript("var "+X[0]);for(var Z;X.length&&(Z=X.shift());)X.length||void 0===Yb?
Y[Z]&&Y[Z]!==Object.prototype[Z]?Y=Y[Z]:Y=Y[Z]={}:Y[Z]=Yb;}).call(this);

You might also like