/** * @id5io/id5-api.js * @version v1.0.22 * @link https://id5.io/ * @license Apache-2.0 */ !function(n){var i={};function r(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=n,r.c=i,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,n){"use strict";function s(){return(s=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n>>16,2246822507)^i(a^a>>>13,3266489909),(4294967296*(2097151&(a=i(a^a>>>16,2246822507)^i(r^r>>>13,3266489909)))+(r>>>0)).toString()},t.f=function(e){var t=/[()-.:;=?_/]/g;w(e.brands)&&(e.brands=T(e.brands,function(e){return S(e.brand)&&e.brand.search(t)<0}));w(e.fullVersionList)&&(e.fullVersionList=T(e.fullVersionList,function(e){return S(e.brand)&&e.brand.search(t)<0}));return e},t.e=function(e,t,n,i,r){for(t=t.split?t.split("."):t,i=0;ie.length)&&(t=e.length);for(var n=0,i=new Array(t);n1e3*l.refreshInSeconds,u=r.clientStore.getNb(l.partnerId),f=!r.clientStore.storedPdMatchesPd(l.partnerId,l.pd),h=!r.clientStore.storedSegmentsMatchesSegments(l.partnerId,l.segments)),c||(Object(v.s)(r.invocationId,"No cached ID found"),c=r.clientStore.getResponseFromLegacyCookie(),d=!0),c&&c.universal_uid&&!f&&!h?(Object(v.s)(r.invocationId,"ID5 User ID available from cache:",{storedResponse:c,storedDateTime:e,refreshNeeded:d}),e<=0||12096e5= 0 and <= 1");break;case"control":this._isExposed=!1,this.info("User is in control group!")}e=this._userId!==i||this._linkType!==r;this._userIdAvailable=!0,this._userId=i,this._linkType=r,this._fromCache=t,this.info("User id updated, hasChanged: ".concat(e,", fromCache: ").concat(t)),Object(o.l)(this._availableCallback)&&!1===this._availableCallbackFired&&(this._availableCallbackTimerId&&(this.info("Cancelling pending onAvailableCallback watchdog"),clearTimeout(this._availableCallbackTimerId),this._availableCallbackTimerId=void 0),this._availableCallbackTimerId=setTimeout(function(){return a.doFireOnAvailableCallBack(n)},0)),this._isRefreshing&&Object(o.l)(this._refreshCallback)&&!1===this._refreshCallbackFired&&(!1!==t&&!1!==this._isRefreshingWithFetch||(this._refreshCallbackTimerId&&(this.info("Cancelling pending onRefreshCallback watchdog"),clearTimeout(this._refreshCallbackTimerId),this._refreshCallbackTimerId=void 0),this._refreshCallbackTimerId=setTimeout(function(){return a.doFireOnRefreshCallBack(n)},0))),e&&Object(o.l)(this._updateCallback)&&setTimeout(function(){return a.doFireOnUpdateCallBack(n)},0)}},{key:"getUserId",value:function(){return!1===this._isExposed?"0":this._userId}},{key:"getLinkType",value:function(){return!1===this._isExposed?0:this._linkType}},{key:"isFromCache",value:function(){return this._fromCache}},{key:"exposeUserId",value:function(){return this._isExposed}},{key:"getUserIdAsEid",value:function(){return{source:i.a.ID5_EIDS_SOURCE,uids:[{atype:1,id:this.getUserId(),ext:{linkType:this.getLinkType(),abTestingControlGroup:!this.exposeUserId()}}]}}},{key:"onAvailable",value:function(e,t){if(!Object(o.l)(e))throw new Error("onAvailable expect a function");var n;return Object(o.l)(this._availableCallback)?this.info("onAvailable was already called, ignoring"):(this._availableCallback=e,(n=this)._userIdAvailable?(this.info("User id already available firing callback immediately"),this._availableCallbackTimerId=setTimeout(function(){return a.doFireOnAvailableCallBack(n)},0)):0