// An UI change targeting on 5/18/2018 will show relying party's privacy // policy URL and terms of service URL inside the one-tap UI for new users. // If enabled, SHOW_RP_TOS can be found in GOOGLE_ONETAP_EXPERIMENTAL_FEATURES array. // There is another UI change that moves the two URLs into a popup confirmation // dialog. If enabled, DISPLAY_CLICKJACKING_POPUP can be found in the experimental // feature array. var GOOGLE_ONETAP_EXPERIMENTAL_FEATURES = ['DISPLAY_RP_TOS']; var PROVIDER_URL_BASE = 'https://smartlock.google.com/iframe/request'; (function(){/* @license OpenYOLO for Web Copyright 2017 The OpenYOLO for Web Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ----------------------------------------------------------------------------- This file also contains code imported from tslib https://github.com/Microsoft/tslib Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. *****************************************************************************/ var w="function"==typeof Object.defineProperties?Object.defineProperty:function(g,d,f){g!=Array.prototype&&g!=Object.prototype&&(g[d]=f.value)},D="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function F(g,d){if(d){for(var f=D,h=g.split("."),r=0;r=c}}); (function(g){function d(a,b){function e(){this.constructor=a}Z(a,b);a.prototype=null===b?Object.create(b):(e.prototype=b.prototype,new e)}function f(a,b){var e=void 0;return new (e||(e=Promise))(function(l,k){function u(a){try{c(b.next(a))}catch(H){k(H)}}function d(a){try{c(b["throw"](a))}catch(H){k(H)}}function c(b){b.done?l(b.value):(new e(function(a){a(b.value)})).then(u,d)}c((b=b.apply(a,[])).next())})}function h(a,b){function e(b){return function(a){return l([b,a])}}function l(e){if(u)throw new TypeError("Generator is already executing."); for(;k;)try{if(u=1,d&&(c=d[e[0]&2?"return":e[0]?"throw":"next"])&&!(c=c.call(d,e[1])).done)return c;if(d=0,c)e=[0,c.value];switch(e[0]){case 0:case 1:c=e;break;case 4:return k.label++,{value:e[1],done:!1};case 5:k.label++;d=e[1];e=[0];continue;case 7:e=k.la.pop();k.g.pop();continue;default:if(!(c=k.g,c=0c[0]&&e[1]b?null:a.W.substring(b));return b?!1:!0}function G(a){var b;!(b=!(a&&"object"===typeof a)||!n(a.id)||!A(a.authMethod)||"authDomain"in a&&!A(a.authDomain)||"password"in a&&!n(a.password)||"displayName"in a&&!n(a.displayName))&&(b="profilePicture"in a)&&(b=a.profilePicture, n(b)?(b=r(b),b=!b||"http"!==b.scheme&&"https"!==b.scheme||!b.W.startsWith("//")?!1:!!b):b=!1,b=!b);return b||"exchangeToken"in a&&!n(a.exchangeToken)||"idToken"in a&&!n(a.idToken)||"generatedPassword"in a&&!n(a.generatedPassword)||"proxiedAuthRequired"in a&&!v(a.proxiedAuthRequired)?!1:!0}function O(){return!0}function N(){return!0}function t(a){return function(b){return!!b&&"object"===typeof b&&"id"in b&&"string"===typeof b.id&&a(b.args)}}function z(a,b,e){return{type:a,data:{id:b,args:e,ack:!1}}} function x(a,b){function e(e){var k=e.data;if(!(k&&"object"===typeof k&&"type"in k&&"data"in k&&e.data.type===a&&(0,ca[a])(e.data.data)))return!1;b(e.data.data,e.data.type,e);return!0}e.toString=function(){return a+" message listener"};return e}function P(){var a=new Uint32Array(2);window.crypto.getRandomValues(a);return a[0].toString(16)+a[1].toString(16)}function Q(a){return f(this,function(){var b,e;return h(this,function(l){switch(l.label){case 0:if(!I)return[2,Promise.resolve(a)];if("undefined"!== typeof TextEncoder)var k=(new TextEncoder("utf-8")).encode(a);else{k=[];for(var c=0,d=0;df?k[c++]=f:2048>f?(k[c++]=f>>6|192,k[c++]=f&63|128):55296===(f&64512)&&d+1>18|240,k[c++]=f>>12&63|128,k[c++]=f>>6&63|128,k[c++]=f&63|128):(k[c++]=f>>12|224,k[c++]=f>>6&63|128,k[c++]=f&63|128)}k=new Uint8Array(k)}b=k;l.label=1;case 1:return l.g.push([1,3,,4]),[4,I.digest("SHA-256", b)];case 2:e=l.a();l=[];k=new DataView(e);for(c=0;ca)throw Error("Invalid timeout. It must be a number greater than or equal to 0. Setting it to 0 disable timeouts.");var b=this.T!==a&&!a;this.T=a;b&&this.reset()}};a.prototype.reset=function(){if(this.H){var a=this.H;this.H=null;a.then(function(a){a.dispose()})}};a.prototype.I=function(b,c){var d=this;this.H|| (this.H=a.c(b,this.za,this.ta,this.X,c));this.H["catch"](function(){d.reset()});return this.H};a.prototype.L=function(a){a=null!==this.T?this.T:a;return 0>=a?new S:new ga(a)};a.prototype.C=function(a){return f(this,function(){var b,c,d;return h(this,function(e){switch(e.label){case 0:return b=this.L(3E3),c={type:"hint",options:a},[4,this.I(b,c)];case 1:return d=e.a(),[4,d.C(a,b)];case 2:return[2,e.a()]}})})};a.prototype.hint=function(a){return f(this,function(){var b,c,d;return h(this,function(e){switch(e.label){case 0:return b= {type:"hint",options:a},c=this.L(3E3),[4,this.I(c,b)];case 1:return d=e.a(),[4,d.hint(a,c)];case 2:return[2,e.a()]}})})};a.prototype.j=function(a){return f(this,function(){var b,c,d;return h(this,function(e){switch(e.label){case 0:return b={type:"retrieve",options:a},c=this.L(3E3),[4,this.I(c,b)];case 1:return d=e.a(),[2,d.j(a,c)]}})})};a.prototype.save=function(a){return f(this,function(){var b,c;return h(this,function(d){switch(d.label){case 0:return b=this.L(3E3),[4,this.I(b)];case 1:return c= d.a(),[2,c.save(a,b)]}})})};a.prototype.A=function(){return f(this,function(){var a,c;return h(this,function(b){switch(b.label){case 0:return a=this.L(3E3),[4,this.I(a)];case 1:return c=b.a(),[2,c.A(a)]}})})};a.prototype.F=function(a){return f(this,function(){var b,c;return h(this,function(d){switch(d.label){case 0:return b=this.L(1E4),[4,this.I(b)];case 1:return c=d.a(),[2,c.F(a,b)]}})})};a.prototype.m=function(){return f(this,function(){var a,c;return h(this,function(b){switch(b.label){case 0:return a= this.L(3E3),[4,this.I(a)];case 1:return c=b.a(),[2,c.m(a)]}})})};return a}(),p=function(){function a(){this.M=Promise.reject(q.cb().h())}a.prototype.pa=function(){};a.prototype.oa=function(){};a.prototype.qa=function(){};a.prototype.ra=function(){};a.prototype.reset=function(){};a.prototype.C=function(){return this.M};a.prototype.hint=function(){return this.M};a.prototype.j=function(){return this.M};a.prototype.save=function(){return this.M};a.prototype.A=function(){return this.M};a.prototype.m=function(){return this.M}; a.prototype.F=function(){return this.M};return a}(),wa=function(a){var b=a.hasOwnProperty("crypto")&&"getRandomValues"in a.crypto;b||console.warn("The current browser does not provide window.crypto.getRandomValues. This is required by the API to work. This is likely due to an old browser.");(a=a.hasOwnProperty("crypto")&&("subtle"in a.crypto||"webkitSubtle"in a.crypto))||console.warn("The current environment does not provide window.crypto.subtle. This is required by the API to work. This is likely due to an old browser, or running the API in an unsecure origin - only secure origins (https: and localhost) provide crypto.subtle."); return b&&a}(window)?new m:new p,V=window;V.openyolo=wa;m.prototype.setProviderUrlBase=m.prototype.pa;m.prototype.setFeatureConfig=m.prototype.oa;m.prototype.setRenderMode=m.prototype.qa;m.prototype.setTimeouts=m.prototype.ra;m.prototype.hintsAvailable=m.prototype.C;m.prototype.hint=m.prototype.hint;m.prototype.retrieve=m.prototype.j;m.prototype.save=m.prototype.save;m.prototype.disableAutoSignIn=m.prototype.A;m.prototype.proxyLogin=m.prototype.F;m.prototype.cancelLastOperation=m.prototype.m;p.prototype.setProviderUrlBase= p.prototype.pa;p.prototype.setFeatureConfig=p.prototype.oa;p.prototype.setRenderMode=p.prototype.qa;p.prototype.setTimeouts=p.prototype.ra;p.prototype.hintsAvailable=p.prototype.C;p.prototype.hint=p.prototype.hint;p.prototype.retrieve=p.prototype.j;p.prototype.save=p.prototype.save;p.prototype.disableAutoSignIn=p.prototype.A;p.prototype.proxyLogin=p.prototype.F;p.prototype.cancelLastOperation=p.prototype.m;V.OpenYoloError=y;y.prototype.type=y.prototype.type;y.prototype.message=y.prototype.message; g.jb=q;g.gb=C;g.lb=na})(this.Ra=this.Ra||{});}).call(this); (function(){'use strict';var n,p=function(a){var b=0;return function(){return bk||k>=I.length)throw Error("Argument validator received an unsupported number of arguments."); c=I[k];b=(g?"":c+" argument ")+'"'+b[k].name+'" '+e.message+".";break a}b=null}}b&&window.console&&"function"===typeof window.console.warn&&window.console.warn(a+" failed: "+b)}function H(a,b,c){c=void 0===c?"":c;if(!(a.optional&&void 0===b||a.h(b)))throw Error(c+a.g);}var I="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function J(a,b){return{name:a,g:"a valid string",optional:void 0===b?!1:b,h:C}} function K(){var a=[J("renderMode"),{name:"renderMode",g:"null",optional:!1,h:F}];var b=void 0===b?!1:b;return{name:"renderMode",g:a.map(function(c){return c.g}).join(" or "),optional:b,h:function(c){return a.some(function(g){return g.h(c)})}}} function L(a){var b=a.g;0===b.indexOf("a ")?b=b.substr(2):0===b.indexOf("an ")&&(b=b.substr(3));return{name:"supportedIdTokenProviders",g:"list of "+b,optional:!1,h:function(c){if(!c||"array"!=E(c))return!1;c=q(c);for(var g=c.next();!g.done;g=c.next())if(!a.h(g.value))return!1;return!0}}} function M(a){var b=void 0===b?!1:b;var c=new Set(a);return{name:"supportedAuthMethods",g:"list of values from ("+a.map(function(g){return g?g.toString():"undefined"}).join(", ")+")",optional:b,h:function(g){if("array"!=E(g))return!1;g=q(g);for(var k=g.next();!k.done;k=g.next())if(!c.has(k.value))return!1;return!0}}} function N(a,b){var c=void 0===c?!1:c;var g=Object.keys(a),k=new Set(g.map(function(h){return a[h].name}));return{name:b,g:"a valid object",optional:c,h:function(h){var m;(m=!h)||(m=typeof h,m=!("object"==m&&null!=h||"function"==m));if(m)return!1;m=q(g);for(var d=m.next();!d.done;d=m.next()){d=a[d.value];var e=d.name;try{H(d,h[e])}catch(f){throw Error('must have a "'+e+'" property '+(0===f.message.indexOf("must")?"which":"as")+" "+f.message);}}h=q(Object.keys(h));for(d=h.next();!d.done;d=h.next())if(m= d.value,!k.has(m))throw Error('must not contain a "'+m+'" property');return!0}}};var O=/^openyolo:\/\//,P=!1,Q=function(a){this.o=a;this.s=new RegExp("^"+a);var b={uri:J("uri"),clientId:J("clientId")};this.l={u:M(["https://accounts.google.com",a+"id-and-password"]),v:L(N(b,"supportedIdTokenProviders")),context:J("context",!0)}},R=function(a,b){return b.map(function(c){return c.replace(a.s,"openyolo://")})},S=function(a,b){a={supportedAuthMethods:R(a,b.supportedAuthMethods)};b.supportedIdTokenProviders&&(a.supportedIdTokenProviders=b.supportedIdTokenProviders);b.context&&(a.context= b.context);return a},T=function(a,b){a={id:b.id,authMethod:b.authMethod.replace(O,a.o)};b.password&&(a.password=b.password);b.authDomain&&(a.authDomain=b.authDomain);b.displayName&&(a.displayName=b.displayName);b.profilePicture&&(a.profilePicture=b.profilePicture);b.idToken&&(a.idToken=b.idToken);b.newGrant&&(a.newGrant=b.newGrant);return a};n=Q.prototype;n.hintsAvailable=function(a){G("hintsAvailable",[N(this.l,"options")],[a]);a=S(this,a);return openyolo.hintsAvailable(a)}; n.hint=function(a){var b=this;G("hint",[N(this.l,"options")],[a]);a=S(this,a);return openyolo.hint(a).then(function(c){return T(b,c)})};n.retrieve=function(a){var b=this;G("retrieve",[N(this.l,"options")],[a]);a=S(this,a);return openyolo.retrieve(a).then(function(c){return T(b,c)})};n.disableAutoSignIn=function(){return openyolo.disableAutoSignIn()};n.cancelLastOperation=function(){return openyolo.cancelLastOperation()}; n.setTimeouts=function(a){G("setTimeouts",[{name:"timeoutMs",g:"a valid number",optional:!1,h:D}],[a]);openyolo.setTimeouts(a)};n.setRenderMode=function(a){G("setRenderMode",[K()],[a]);openyolo.setRenderMode(a)};Q.prototype.setRenderMode=Q.prototype.setRenderMode;Q.prototype.setTimeouts=Q.prototype.setTimeouts;Q.prototype.cancelLastOperation=Q.prototype.cancelLastOperation;Q.prototype.disableAutoSignIn=Q.prototype.disableAutoSignIn;Q.prototype.retrieve=Q.prototype.retrieve;Q.prototype.hint=Q.prototype.hint; Q.prototype.hintsAvailable=Q.prototype.hintsAvailable;var U=window;U.PROVIDER_URL_BASE&&openyolo.setProviderUrlBase(U.PROVIDER_URL_BASE);U.GOOGLE_ONETAP_EXPERIMENTAL_FEATURES&&openyolo.setFeatureConfig(U.GOOGLE_ONETAP_EXPERIMENTAL_FEATURES);var V=new Q("smartlock://"),W=new Q("googleyolo://"),X=window;X.smartlock=V;X.googleyolo=W;U.smartlock=V;U.googleyolo=W;X.onSmartLockLoad&&(P=!0,X.onSmartLockLoad(V));X.onGoogleYoloLoad&&(P=!0,X.onGoogleYoloLoad(W)); document.addEventListener("DOMContentLoaded",function(){P||(X.onGoogleYoloLoad&&(P=!0,X.onGoogleYoloLoad(W)),X.onSmartLockLoad&&(P=!0,X.onSmartLockLoad(V)))});}).call(this);