You are on page 1of 2

(function(){/*

Copyright The Closure Library Authors.


SPDX-License-Identifier: Apache-2.0
*/
'use strict';function g(){return new h(a=>a(void 0))}function l(a,b){if(!a.b)if(b
instanceof h)b.then(c=>{l(a,c)});else{a.b=!0;a.c=b;for(b=0;b<a.a.length;+
+b)m(a,a.a[b]);a.a=[]}}function m(a,b){a.b?b(a.c):a.a.push(b)}class
h{constructor(a){this.b=!1;this.a=[];a(b=>{l(this,b)})}then(a){return new
h(b=>{m(this,c=>{b(a(c))})})}};function n(a){if(!a)throw Error("functionToExecute
must not be truthy.");};function p(){return/\d+\.\d+\.\d+(-.*)?/.test("1.3.2-
google_20200415")}function q(){const a=["1","3","2"],b=["1","0","3"];for(let
c=0;3>c;c++){const e=parseInt(a[c],10),d=parseInt(b[c],10);if(e>d)break;else
if(e<d)return!1}return!0};function r(a){return!!a&&void 0!
==a.omid_message_guid&&void 0!==a.omid_message_method&&void 0!
==a.omid_message_version&&"string"===typeof a.omid_message_guid&&"string"===typeof
a.omid_message_method&&"string"===typeof a.omid_message_version&&(void
0===a.omid_message_args||void 0!==a.omid_message_args)}function t(a){return new
u(a.omid_message_guid,a.omid_message_method,a.omid_message_version,a.omid_message_a
rgs)}
function v(a){const b={["omid_message_guid"]:a.b,["omid_message_method"]:a.method,
["omid_message_version"]:a.version};void 0!==a.a&&(b.omid_message_args=a.a);return
b}class u{constructor(a,b,c,e)
{this.b=a;this.method=b;this.version=c;this.a=e}};class w{constructor(a)
{this.b=a}};function x(a,b){return a&&(a[b]||(a[b]={}))};function y()
{return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{{let
b=16*Math.random()|0;a="y"===a?(b&3|8).toString(16):b.toString(16)}return
a})};function z(...a){A(()=>{throw Error("Could not complete the test successfully
- ",...a);},()=>console.error(...a))}function A(a,b){"undefined"!==typeof
jasmine&&jasmine?a():"undefined"!==typeof
console&&console&&console.error&&b()};const B=eval("this");var C=function()
{if("undefined"!==typeof omidGlobal&&omidGlobal)return omidGlobal;if("undefined"!
==typeof global&&global)return global;if("undefined"!==typeof window&&window)return
window;if("undefined"!==typeof B&&B)return B;throw Error("Could not determine
global object context.");}();function D(a){try{return a.frames?!!
a.frames.omid_v1_present:!1}catch(b){return!1}};class E extends w{constructor(a)
{super(a);this.handleExportedMessage=E.prototype.c.bind(this)}sendMessage(a,b=this.
b){if(!b)throw Error("Message destination must be defined at construction time or
when sending the message.");b.handleExportedMessage(v(a),this)}c(a,b)
{r(a)&&this.a&&this.a(t(a),b)}};function F(a){return null!=a&&"undefined"!==typeof
a.top&&null!=a.top}function G(a){if(a===C)return!1;try{if("undefined"===typeof
a.location.hostname)return!0}catch(b){return!0}return!1};class H extends
w{constructor(a,b=C){super(b);a.addEventListener("message",c=>{if("object"===typeof
c.data){var
e=c.data;r(e)&&c.source&&this.a&&this.a(t(e),c.source)}})}sendMessage(a,b=this.b)
{if(!b)throw Error("Message destination must be defined at construction time or
when sending the message.");b.postMessage(v(a),"*")}};const
I=["omid","v1_VerificationServiceCommunication"],J=["omidVerificationProperties","s
erviceWindow"];function K(a,b){return b.reduce((c,e)=>c&&c[e],a)};function
L(a,b,c,...e){if(a.a){var d=y();c&&(a.c[d]=c);c=p()&&q()?
e:JSON.stringify(e);a.a.sendMessage(new u(d,`VerificationService.${b}`,"1.3.2-
google_20200415",c))}}function M(a,b){n(b);a.b?a.b.registerSessionObserver(b,void
0,a.f):L(a,"addSessionListener",b,void 0,a.f)}function N(a,b){n(b);a.b?
a.b.addEventListener("geometryChange",b):L(a,"addEventListener",b,"geometryChange")
}
class O{constructor(a){if(!a){var b;"undefined"===typeof b&&"undefined"!==typeof
window&&window&&(b=window);b=F(b)?b:C;a=[];var c=K(b,J);c&&a.push(c);a.push(F(b)?
b.top:C);a:{for(const f of a){b:{a=b;c=f;var e=D;if(!G(c))try{const k=K(c,I);if(k)
{var d=new E(k);break b}}catch(k){}d=e(c)?new H(a,c):null}if(a=d)break
a}a=null}}if(this.a=a)this.a.a=this.g.bind(this);else
if(d=(d=C.omid3p)&&"function"===typeof
d.registerSessionObserver&&"function"===typeof d.addEventListener?
d:null)this.b=d;this.c={};this.f=
(d=C.omidVerificationProperties)?d.injectionId:void 0}g(a){const
b=a.method,c=a.b;a=a.a;if("response"===b&&this.c[c]){var e=p()&&q()?a?a:
[]:a&&"string"===typeof a?JSON.parse(a):
[];this.c[c].apply(this,e)}"error"===b&&window.console&&z(a)}}
(function(a,b,c="undefined"===typeof omidExports?null:omidExports)
{c&&(a=a.split("."),a.slice(0,a.length-1).reduce(x,c)[a[a.length-1]]=b)})
("OmidVerificationClient",O);function P(a){a.c?(a.a=new h(b=>{const c=new
h(d=>{M(a.b,f=>{"sessionStart"==f.type&&d("app"==f.data.context.environment)})}),e=
new h(d=>{N(a.b,f=>{f=f.data;const k=f.adView.reasons;k&&-1!=k.indexOf("hidden")||
(f=f.adView,f=f.onScreenContainerGeometry||f.onScreenGeometry,(f=!!
(f&&f.width&&f.height))&&d())})});c.then(d=>{d?
e.then(()=>{b()}):b()})}),a.a.then(()=>{a.c=!1})):a.a=g()}class Q{constructor(a)
{a=this.b=a||new O;this.f=!(!a.a&&!
a.b);this.a=null;this.c=this.f}};window.omrhp=function(a){var b=new Q;b.a||
P(b);b.a.then(a)};}).call(this);

You might also like