diff --git a/taplytics.min.js b/taplytics.min.js index 4adfe06f..69b2f8ab 100644 --- a/taplytics.min.js +++ b/taplytics.min.js @@ -1,2 +1,2 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=22)}([function(e,t){var n=0;function r(e){return void 0!==e&&n>=e}t.LOUD=3,t.DEBUG=2,t.LOG=1,t.USER=0,t.setPriorityLevel=function(e){n=e},t.log=function(e,t,n){r(n)&&(console.log("[Taplytics]",e),t&&console.dir(t))},t.time=function(e,n,i,o){if(r(o)){if(i)e=e+", time: "+((new Date).getTime()-i.getTime())+"ms";t.log(e,n,o)}},t.error=function(e,t,n){r(n)&&(console.error("[Taplytics]",e),t&&console.dir(t))}},function(e,t,n){var r=n(7),i=n(49),o=n(0),s=n(4),a=n(52),u=n(5),c=n(53),l=n(54),f="_tl_csid",p="_tl_duuid",h="_tl_suuid",d="_tl_sid",v="_tl_auid",m="_tl_config",y=function(e,t){return e&&t?`tl_sopts_${e}_${t}`:null};t.config=null,t.hasLoadedData=!1,t.sessionExpirationMin=30,t.start=function(e){return t.updateCookieSession().setDeviceUUID(e)},t.get=function(e,n){if(e){t.tick();var i=t.getCookieSessionID(),s=y(i,e);if(s){if(!(n&&JSON&&JSON.parse))return r.get(s);var a=r.get(s);if(a&&"object"==typeof a)return a;try{return JSON.parse(a)}catch(t){return o.error("Session.get("+e+") failed to parse JSON.",t,o.DEBUG),a}}}},t.tick=function(){return t.updateCookieSession(),t},t.set=function(e,n,i){if(!e||void 0===n||0===(""+n).length)return!1;t.tick();var o=t.getCookieSessionID(),s=y(o,e),a=w(new Date,"minute",t.sessionExpirationMin),u=n;return!!s&&(i&&JSON&&JSON.stringify&&(u=JSON.stringify(n)),r.set(s,u,{expires:a}),!0)},t.unset=function(e){if(!e)return!1;t.tick();var n=t.getCookieSessionID(),i=y(n,e);r.expire(i)},t.updateCookieSession=function(){var e=t.getCookieSessionID();e||(e=i.v4(),t.deleteSessionID());var n=w(new Date,"minute",t.sessionExpirationMin);return r.set(f,e,{expires:n}),o.log("Set cookieSessionID to: "+e,{expires:n},o.LOUD),t},t.setDeviceUUID=function(e){return(e=e||t.getDeviceUUID())||(e=i.v4()),r.set(p,e,{expires:new Date(2147483647e3)}),o.log("Set deviceUUID to: "+e,null,o.DEBUG),t},t.setSessionID=function(e){return r.set(d,e),o.log("Set sessionID to: "+e,null,o.DEBUG),t},t.deleteSessionID=function(){return r.expire(d),t},t.setAppUserID=function(e){return r.set(v,e),o.log("Set appUserID to: "+e,null,o.DEBUG),t},t.deleteAppUserID=function(){return r.expire(v),t},t.deleteSessionUUID=function(){r.expire(h)},t.setCachedConfig=function(e){return r.setJSON(m,{expVarsNamesHistory:e?e.expVarsNamesHistory:{},expVarsNames:e?e.expVarsNames:{},expVarsIds:e?e.expVarsIds:{},dynamicVars:e?e.dynamicVars:{}},null,!0),t},t.getDeviceUUID=function(){var e=r.get(h);if(e)return e;var n=r.get(p);return e===n&&t.deleteSessionUUID(),n},t.getCookieSessionID=function(){return r.get(f)},t.getAppUserID=function(){return r.get(v)},t.getSessionID=function(){return r.get(d)},t.getCachedConfig=function(){return r.getJSON(m,!0)},t.getSessionAttributes=function(e){e=e||{};var t=u.toObject(),n=a();return e.sid=this.getSessionID(),e.ad=this.getDeviceUUID(),e.adt="browser",e.ct="browser",e.lv=s.isProduction()?"0":"1",e.sdk=s.obj().sdkVersion,e.rfr=n.referrer,e.exm=n.search.utm_medium,e.exs=n.search.utm_source,e.exc=n.search.utm_campaign,e.ext=n.search.utm_term,e.exct=n.search.utm_content,e.prms={search:n.search,location:t},navigator&&navigator.userAgent&&(e.prms.userAgent=navigator.userAgent),e},t.saveSessionConfig=function(e,n){n&&!e&&(o.log("Using cached config because of server error",null,o.DEBUG),e=t.getCachedConfig()),t.config=e,_=!0,e&&e.app_user_id&&e.session_id&&(t.hasLoadedData=!0,t.setAppUserID(e.app_user_id),t.setSessionID(e.session_id),t.tick()),e&&t.setCachedConfig(e),l.applyVisualEditsFromConfig(e),b.completePromises(!!e),(n||e&&e.app_user_id&&e.session_id)&&g.completePromises(!!e)};var g=new c({name:"sessionConfigPromises"});t.sessionConfigPromise=function(e){if(e)return t.hasLoadedData&&t.config?e(!0):void g.push(e)};var _=!1,b=new c({name:"configPromises"});function w(e,t,n){var r=new Date(e);switch(t.toLowerCase()){case"year":r.setFullYear(r.getFullYear()+n);break;case"quarter":r.setMonth(r.getMonth()+3*n);break;case"month":r.setMonth(r.getMonth()+n);break;case"week":r.setDate(r.getDate()+7*n);break;case"day":r.setDate(r.getDate()+n);break;case"hour":r.setTime(r.getTime()+36e5*n);break;case"minute":r.setTime(r.getTime()+6e4*n);break;case"second":r.setTime(r.getTime()+1e3*n);break;default:r=void 0}return r}t.configPromise=function(e){if(e)return _&&t.config?e(!0):void b.push(e)},t.resetSession=function(){t.deleteSessionID(),t.deleteAppUserID(),t.config=null,t.hasLoadedData=!1}},function(e,t,n){var r=n(23),i=n(4),o=n(0),s=n(12),a=n(13),u=new s,c=!1;t.publicToken=null,t.setPublicToken=function(e){this.publicToken=e},t.get=f(function(e,n,i){var s=d(n),a=h(e);o.log(`GET request: ${a}`,s,o.LOUD),r.get(a).query(s.query).timeout(t.timeout).end(l(a,i))}),t.getJSON=f(function(e,n){var s=function(e){return i.obj().cdnAPI+(e||"")}(e);o.log(`GET JSON file request: ${s}`,null,o.LOUD),r.get(s).timeout(t.timeout).end(l(s,n))}),t.post=f(function(e,t,n,i){var s=d(t,n),a=h(e);o.log(`POST request: ${a}`,s,o.LOUD),r.post(a).query(s.query).set("Content-Type","application/json").send(s.payload).end(l(a,i))}),t.del=f(function(e,n,i,s){var a=d(n,i),u=h(e);o.log(`DELETE request: ${u}`,a,o.LOUD),r.del(u).query(a.query).set("Content-Type","application/json").timeout(t.timeout).send(a.payload).end(l(u,s))});function l(e,t){return function(n,r){n&&o.error(`Error: ${e}`,n,o.DEBUG),t&&"function"==typeof t&&t(n,r),p()}}function f(e){return function(){u.enqueue({requestFunction:e,args:arguments}),c||p()}}function p(){if(!u.isEmpty()){c=!0;var e=u.dequeue();return o.log("Processing request",e,o.DEBUG),e&&e.requestFunction&&e.requestFunction.apply(t,e.args)}c=!1}function h(e,t){return("events"===e&&i.obj().eventsAPI?i.obj().eventsAPI:i.obj().baseAPI)+(e||"")+function(e){return e?`?${a.stringify(e)}`:""}(t)}function d(e,n){var r={},i={};return e&&"function"==typeof e?r=e():e&&(r=e),n&&"function"==typeof n?i=n():n&&(i=n),r.r_v="0",t.publicToken&&(r.public_token=t.publicToken),{query:r,payload:i}}t.timeout=4e3,t.setTimeout=function(e){var n=1e3*e;n>3e4?(o.error(`Timeout is larger then max timeout! timeout: ${e}s, max timeout: 30s. Using max timeout value.`,null,o.USER),t.timeout=3e4):n<1e3?(o.error(`Timeout is smaller then the min timeout! timeout: ${e}s, min timeout: 1s. Using min timeout value.`,null,o.USER),t.timeout=1e3):(o.log(`Set timeout: ${e}s`,null,o.LOUD),t.timeout=n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"isNumber",function(){return v}),n.d(t,"isString",function(){return m}),n.d(t,"debounce",function(){return y}),n.d(t,"isObjectLike",function(){return g}),n.d(t,"values",function(){return _}),n.d(t,"includes",function(){return b});var r=n(31),i=n.n(r),o=n(33),s=n.n(o),a=n(8),u=n.n(a),c=n(38),l=n.n(c),f=n(40),p=n.n(f),h=n(41),d=n.n(h),v=p.a,m=l.a,y=d.a,g=u.a,_=s.a,b=i.a},function(e,t,n){t.obj=function(){var e=n(6),t={cdnAPI:"https://cdn-config.taplytics.com/js/"};return"production"===e.env?(t.baseAPI="https://api.taplytics.com/public_api/v1/",t.eventsAPI="https://ping.taplytics.com/public_api/v1/"):"dev"===e.env||"development"===e.env?t.baseAPI="https://dev.taplytics.com/public_api/v1/":"stag"===e.env||"staging"===e.env?t.baseAPI="https://staging.taplytics.com/public_api/v1/":"local"===e.env&&(t.baseAPI="http://localhost:3002/public_api/v1/"),t.eventsFlushQueueTimeout=4e3,t.functionFlushQueueTimeout=500,t.sdkVersion="2.5.0",t.cookieDomain=e&&e.api&&e.api.config&&e.api.config.cookieDomain?e.api.config.cookieDomain:null,t},t.isProduction=function(){return"production"===n(6).env}},function(e,t){var n={};function r(e){return n[e]?n[e]:"title"===e?document.title:document.location?document.location[e]:null}t.toObject=function(){return{href:r("href"),hash:r("hash"),search:r("search"),host:r("host"),protocol:r("protocol"),pathname:r("pathname"),title:r("title")}},t.attr=function(e){return r(e)},t.listen=function(e){}},function(e,t,n){e.exports={api:n(10),init:n(59),isReady:n(60),identify:n(61),track:n(62),page:n(63),reset:n(64),propertiesLoaded:n(65),runningExperiments:n(66),variable:n(67),codeBlock:n(69),featureFlagEnabled:n(70),runningFeatureFlags:n(71)}},function(e,t,n){var r=n(0),i=n(3),o=n(4),s=n(48),a=n(9).CookieJar,u=n(9).Cookie,c=n(9).CookieAccessInfo;s.supported()||(r.log("Local Storage not supported",null,r.DEBUG),s=null);var l={cookieSessionID:"_tl_csid",deviceUUID:"_tl_duuid",sessionUUID:"_tl_suuid",sessionID:"_tl_sid",appUserID:"_tl_auid"};t.getJSON=function(e,n){var o=t.get(e,n);if(!o||!i.isString(o))return o;try{return JSON.parse(o)}catch(e){return r.error("JSON parse cookie value",e,r.DEBUG),null}},t.getLS=function(e){if(!s)return null;var t=s.get(e);return r.log("Got local storage key: "+e+" with value: "+t,null,r.LOUD),t},t.get=function(e,n){if(t.getCookieSupport()&&!n){var r=p(),o=new c(t.getCookieDomain()),a=r.getCookie(e,o);return a&&!i.includes(i.values(l),e)&&(a.value=function(e){try{return decodeURIComponent(atob(e))}catch(t){return e}}(a.value)),a?a.value:void 0}return s?t.getLS(e):n?t.get(e):void 0},t.setJSON=function(e,n,o,s){var a=void 0;try{a=i.isString(n)?n:JSON.stringify(n)}catch(e){r.error("JSON stringify cookie value",e,r.DEBUG)}t.set(e,a,o,s)},t.set=function(e,n,o,a){if(e)if(t.getCookieSupport()&&!a){n=n||"",o=o||{};var c=p(),f=function(e,n,r){i.includes(i.values(l),e)||(o=n,n=btoa(encodeURIComponent(o)));var o;var s=new u(e+"="+n);r&&(s.expiration_date=r);return s.domain=t.getCookieDomain(),s}(e,n,o.expires).toString();document.cookie=f,c.setCookie(f),r.log("Setting cookies to:",f,r.LOUD)}else s?t.setLS(e,n,o):a&&t.set(e,n,o)},t.setLS=function(e,t,n){if(s){var i=n&&n.expires?30:null;s.set(e,t,i),r.log(`Setting local storage key: ${e} to value: ${t}`,null,r.LOUD)}},t.expire=function(e,n){t.getCookieSupport()&&!n?t.set(e,"-",{expires:new Date}):s?(r.log("Deleting local storage key: "+e,null,r.LOUD),s.remove(e)):n&&t.expire(e)};var f=void 0;function p(){return f||(f=new a,function(){if(f&&document.cookie&&document.cookie.length)for(var e=document.cookie.split(";"),t=0;t=3&&t[1].match(/^(com|edu|gov|net|mil|org|nom|co|ca|name|info|biz)$/i)?`.${t[2]}.${t[1]}.${t[0]}`:t&&t.length>1?`.${t[1]}.${t[0]}`:null};var h=void 0;t.getCookieSupport=function(){if(void 0!==h)return h;var e=!0;do{var t="gCStest="+Math.floor(1e8*Math.random());if(document.cookie=e?t+"; expires="+new Date("Tue, 01-Jan-2030 00:00:00").toUTCString():t,-1!==document.cookie.indexOf(t))return document.cookie=t+"; expires="+new Date("Sat, 01-Jan-2000 00:00:00 GMT").toUTCString(),h=e,e}while(!(e=!e));return h=null,null}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){!function(){"use strict";function e(t,n,r,i){return this instanceof e?(this.domain=t||void 0,this.path=n||"/",this.secure=!!r,this.script=!!i,this):new e(t,n,r,i)}function n(e,t,r){return e instanceof n?e:this instanceof n?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(r||"/"),this.explicit_path=!1,this.domain=t||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,e&&this.parse(e,t,r),this):new n(e,t,r)}e.All=Object.freeze(Object.create(null)),t.CookieAccessInfo=e,t.Cookie=n,n.prototype.toString=function(){var e=[this.name+"="+this.value];return this.expiration_date!==1/0&&e.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&e.push("domain="+this.domain),this.path&&e.push("path="+this.path),this.secure&&e.push("secure"),this.noscript&&e.push("httponly"),e.join("; ")},n.prototype.toValueString=function(){return this.name+"="+this.value};var r=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;function i(){var e,t;return this instanceof i?(e=Object.create(null),this.setCookie=function(r,i,o){var s,a;if(s=(r=new n(r,i,o)).expiration_date<=Date.now(),void 0!==e[r.name]){for(t=e[r.name],a=0;a0?e[0]:void 0}}},function(e,t,n){"use strict";var r=n(29),i=n(30),o=n(15);e.exports={formats:o,parse:i,stringify:r}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?n+=t.charAt(r):o<128?n+=i[o]:o<2048?n+=i[192|o>>6]+i[128|63&o]:o<55296||o>=57344?n+=i[224|o>>12]+i[128|o>>6&63]+i[128|63&o]:(r+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(r)),n+=i[240|o>>18]+i[128|o>>12&63]+i[128|o>>6&63]+i[128|63&o])}return n},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r>>((3&t)<<3)&255;return i}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,i=n;return i[e[r++]]+i[e[r++]]+i[e[r++]]+i[e[r++]]+"-"+i[e[r++]]+i[e[r++]]+"-"+i[e[r++]]+i[e[r++]]+"-"+i[e[r++]]+i[e[r++]]+"-"+i[e[r++]]+i[e[r++]]+i[e[r++]]+i[e[r++]]+i[e[r++]]+i[e[r++]]}},function(e,t,n){var r=this,i=n(2),o=n(16),s=n(4),a=n(0),u=n(57),c=n(5),l=n(12),f=n(1),p=n(7),h=new l,d={active:"appActive",terminate:"appTerminate",config:"tlClientConfig",fastConfig:"tlFastModeConfig",goal:"goalAchieved",pageView:"viewAppeared",pageClose:"viewDisappeared",timeOnPage:"viewTimeOnPage"};function v(e,t){var n=new Date;return e.val=(n.getTime()-t.getTime())/1e3,h.enqueue(e)}function m(e){return{type:e,date:(new Date).toISOString(),tvKey:c.attr("title"),tvCl:c.attr("href"),prod:s.isProduction()?1:0,data:{_tl_view:c.toObject()}}}function y(){if(a.log("events.flushQueue: tick.",h,a.LOUD),h.isEmpty()||!f.hasLoadedData)return t.scheduleTick();var e=h.flush(),n=f.getSessionID(),r=p.getLS(g);r&&r.length&&(a.log(`Add ${r.length} events from local storage cache`,null,a.DEBUG),e=e.concat(r),p.expire(g,!0)),n||o.post({},"Taplytics::events.flushQueue: failed to create sessions. Events will fail to process."),this.post(e,function(n,r){n&&h.enqueueAll(e),t.scheduleTick()})}t.types=d,t.watchLifecycleEvents=function(){t.appActive();y.bind(r);window.addEventListener("unload",function(){a.log("Window on unload",null,a.DEBUG),t.appTerminate(),function(){if(h.isEmpty()||!f.hasLoadedData)return;var e=h.flush();a.log(`save ${e.length} events to local storage`,h,a.DEBUG),p.setLS(g,e)}()})},t.timeOnPage=function(e,t,n,r,i,o){var s=m(d.timeOnPage);if(o&&o.getTime){var a=(new Date).getTime(),c=o.getTime();s.val=(a-c)/1e3}return s.vKey=t,s.tKey=e,s.tvKey=r,s.tvCl=n,i&&(s.data=u(s.data||{},{_tl_view:i})),h.enqueue(s)},t.scheduleTick=function(){var e=y.bind(r);setTimeout(e,s.obj().eventsFlushQueueTimeout)},t.pageClose=function(e,t,n,r,i){var o=m(d.pageClose);return o.val=(new Date).toISOString(),o.vKey=t,o.tKey=e,o.tvKey=r,o.tvCl=n,i&&(o.data=u(o.data||{},{_tl_view:i})),h.enqueue(o)},t.pageView=function(e,t,n){var r=m(d.pageView);return n&&(r.data=u(r.data,n)),r.val=(new Date).toISOString(),r.vKey=t,r.tKey=e,h.enqueue(r)},t.goalAchieved=function(e,t,n){var r=m(d.goal);return n&&(r.data=u(r.data,n)),t&&(r.val=t),r.gn=e,h.enqueue(r)},t.appActive=function(){return h.enqueue(m(d.active))},t.appTerminate=function(){return h.enqueue(m(d.terminate))},t.clientConfig=function(e){if(e)return v(m(d.config),e)},t.fastModeConfig=function(e){if(e)return v(m(d.fastConfig),e)},t.post=function(e,t){var n=new Date;i.post("events",{},function(t){var n={};return n.sid=f.getSessionID(),{session:n,events:e}},function(e,r){return e?a.error("Taplytics::events.post: failed to log events",e,a.LOG):a.time("Taplytics::events.post: succesfully logged events.",r,n,a.DEBUG),t&&t(e,r)})};var g="_tl_eventsQueue"},function(e,t,n){var r=n(2),i=n(0);n(1);t.post=function(e,t){if(!e)return i.error("No new variable to post to server",null,i.DEBUG);var n=new Date,o={name:e.name,createdAt:new Date,variableType:e.defaultType,defaultVal:e.stringifyValue?e.stringifyValue(e.defaultValue):e.defaultValue};i.log("variable_post",o,i.DEBUG),r.post("variable",{},o,function(e,r){if(e)i.error("Failed to post variable",e,i.DEBUG);else{var o=r.body;o&&o.name&&i.time("Users.post: successfully created new variable.",o,n,i.DEBUG)}return t&&t(e)})}},function(e,t,n){var r=n(6),i=n(0),o=n(4);t.Taplytics=window.Taplytics=e.exports=r,t.flushAppQueue=function(){if(i.log("flushAppQueue tick",window._tlq,i.LOUD),window._tlq&&window._tlq instanceof Array){var e=window._tlq.slice();if(window._tlq=[],Array.prototype.sort&&e.sort(function(e,t){if(e instanceof Array&&t instanceof Array){if("init"===e[0]&&"identify"===t[0])return-1;if("identify"===e[0]&&"init"===t[0])return 1;if("init"===e[0]||"identify"===e[0])return-1}return 2}),e.length>0){i.log("flushAppQueue: "+e.length,e,i.LOUD);for(var n=0;n=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==n){var r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.onprogress=r.bind(null,"download"),t.upload&&(t.upload.onprogress=r.bind(null,"upload"))}catch(e){}try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof n&&!this._isHost(n)){var i=this._header["content-type"],o=this._serializer||l.serialize[i?i.split(";")[0]:""];!o&&v(i)&&(o=l.serialize["application/json"]),o&&(n=o(n))}for(var s in this.header)null!=this.header[s]&&this.header.hasOwnProperty(s)&&t.setRequestHeader(s,this.header[s]);return this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0!==n?n:null),this},l.agent=function(){return new u},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(e){u.prototype[e.toLowerCase()]=function(t,n){var r=new l.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}}),u.prototype.del=u.prototype.delete,l.get=function(e,t,n){var r=l("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},l.head=function(e,t,n){var r=l("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},l.options=function(e,t,n){var r=l("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},l.del=g,l.delete=g,l.patch=function(e,t,n){var r=l("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},l.post=function(e,t,n){var r=l("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},l.put=function(e,t,n){var r=l("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},function(e,t,n){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&t.status>=500&&501!=t.status)return!0;if(e){if(e.code&&~o.indexOf(e.code))return!0;if(e.timeout&&"ECONNABORTED"==e.code)return!0;if(e.crossDomain)return!0}return!1},i.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},i.prototype.then=function(e,t){if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(e,t){n.end(function(n,r){n?t(n):e(r)})})}return this._fullfilledPromise.then(e,t)},i.prototype.catch=function(e){return this.then(void 0,e)},i.prototype.use=function(e){return e(this),this},i.prototype.ok=function(e){if("function"!=typeof e)throw Error("Callback required");return this._okCallback=e,this},i.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},i.prototype.get=function(e){return this._header[e.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(e,t){if(r(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},i.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},i.prototype.field=function(e,t){if(null===e||void 0===e)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),r(e)){for(var n in e)this.field(n,e[n]);return this}if(Array.isArray(t)){for(var i in t)this.field(e,t[i]);return this}if(null===t||void 0===t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=""+t),this._getFormData().append(e,t),this},i.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},i.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization","Basic "+r(e+":"+t));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer "+e)}return this},i.prototype.withCredentials=function(e){return void 0==e&&(e=!0),this._withCredentials=e,this},i.prototype.redirects=function(e){return this._maxRedirects=e,this},i.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw TypeError("Invalid argument");return this._maxResponseSize=e,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(e){var t=r(e),n=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(t&&r(this._data))for(var i in e)this._data[i]=e[i];else"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],this._data="application/x-www-form-urlencoded"==n?this._data?this._data+"&"+e:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)?this:(n||this.type("json"),this)},i.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},i.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var n=this.url.substring(t+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,t)+"?"+n.join("&")}}},i.prototype._appendQueryString=function(){console.trace("Unsupported")},i.prototype._timeoutError=function(e,t,n){if(!this._aborted){var r=new Error(e+t+"ms exceeded");r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.abort(),this.callback(r)}},i.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(e,t,n){"use strict";var r=n(27);function i(e){if(e)return function(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}(e)}e.exports=i,i.prototype.get=function(e){return this.header[e.toLowerCase()]},i.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=r.type(t);var n=r.params(t);for(var i in n)this[i]=n[i];this.links={};try{e.link&&(this.links=r.parseLinks(e.link))}catch(e){}},i.prototype._setStatusProperties=function(e){var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.redirect=3==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.forbidden=403==e,this.notFound=404==e}},function(e,t,n){"use strict";t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){return e.split(/ *; */).reduce(function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e},{})},t.parseLinks=function(e){return e.split(/ *, */).reduce(function(e,t){var n=t.split(/ *; */),r=n[0].slice(1,-1);return e[n[1].split(/ *= */)[1].slice(1,-1)]=r,e},{})},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},function(e,t){function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(e){n.prototype[e]=function(){return this._defaults.push({fn:e,arguments:arguments}),this}}),n.prototype._setDefaults=function(e){this._defaults.forEach(function(t){e[t.fn].apply(e,t.arguments)})},e.exports=n},function(e,t,n){"use strict";var r=n(14),i=n(15),o={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Date.prototype.toISOString,a={delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,serializeDate:function(e){return s.call(e)},skipNulls:!1,strictNullHandling:!1},u=function e(t,n,i,o,s,u,c,l,f,p,h,d){var v=t;if("function"==typeof c)v=c(n,v);else if(v instanceof Date)v=p(v);else if(null===v){if(o)return u&&!d?u(n,a.encoder):n;v=""}if("string"==typeof v||"number"==typeof v||"boolean"==typeof v||r.isBuffer(v))return u?[h(d?n:u(n,a.encoder))+"="+h(u(v,a.encoder))]:[h(n)+"="+h(String(v))];var m,y=[];if(void 0===v)return y;if(Array.isArray(c))m=c;else{var g=Object.keys(v);m=l?g.sort(l):g}for(var _=0;_0?O+T:""}},function(e,t,n){"use strict";var r=n(14),i=Object.prototype.hasOwnProperty,o={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:r.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},s=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,s=/(\[[^[\]]*])/.exec(r),a=s?r.slice(0,s.index):r,u=[];if(a){if(!n.plainObjects&&i.call(Object.prototype,a)&&!n.allowPrototypes)return;u.push(a)}for(var c=0;null!==(s=o.exec(r))&&c=0;--i){var o,s=e[i];if("[]"===s)o=(o=[]).concat(r);else{o=n.plainObjects?Object.create(null):{};var a="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(a,10);!isNaN(u)&&s!==a&&String(u)===a&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(o=[])[u]=r:o[a]=r}r=o}return r}(u,t,n)}};e.exports=function(e,t){var n=t?r.assign({},t):{};if(null!==n.decoder&&void 0!==n.decoder&&"function"!=typeof n.decoder)throw new TypeError("Decoder has to be a function.");if(n.ignoreQueryPrefix=!0===n.ignoreQueryPrefix,n.delimiter="string"==typeof n.delimiter||r.isRegExp(n.delimiter)?n.delimiter:o.delimiter,n.depth="number"==typeof n.depth?n.depth:o.depth,n.arrayLimit="number"==typeof n.arrayLimit?n.arrayLimit:o.arrayLimit,n.parseArrays=!1!==n.parseArrays,n.decoder="function"==typeof n.decoder?n.decoder:o.decoder,n.allowDots="boolean"==typeof n.allowDots?n.allowDots:o.allowDots,n.plainObjects="boolean"==typeof n.plainObjects?n.plainObjects:o.plainObjects,n.allowPrototypes="boolean"==typeof n.allowPrototypes?n.allowPrototypes:o.allowPrototypes,n.parameterLimit="number"==typeof n.parameterLimit?n.parameterLimit:o.parameterLimit,n.strictNullHandling="boolean"==typeof n.strictNullHandling?n.strictNullHandling:o.strictNullHandling,""===e||null===e||void 0===e)return n.plainObjects?Object.create(null):{};for(var a="string"==typeof e?function(e,t){for(var n={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=t.parameterLimit===1/0?void 0:t.parameterLimit,a=r.split(t.delimiter,s),u=0;u-1}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r=t||n<0||y&&e-v>=f}function w(){var e=i();if(b(e))return x(e);h=setTimeout(w,function(e){var n=t-(e-d);return y?u(n,f-(e-v)):n}(e))}function x(e){return h=void 0,g&&c?_(e):(c=l=void 0,p)}function D(){var e=i(),n=b(e);if(c=arguments,l=this,d=e,n){if(void 0===h)return function(e){return v=e,h=setTimeout(w,t),m?_(e):p}(d);if(y)return h=setTimeout(w,t),_(d)}return void 0===h&&(h=setTimeout(w,t)),p}return t=o(t)||0,r(n)&&(m=!!n.leading,f=(y="maxWait"in n)?a(o(n.maxWait)||0,t):f,g="trailing"in n?!!n.trailing:g),D.cancel=function(){void 0!==h&&clearTimeout(h),v=0,c=d=l=h=void 0},D.flush=function(){return void 0===h?p:x(i())},D}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(44);e.exports=function(){return r.Date.now()}},function(e,t,n){var r=n(45),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(t,n(46))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e}},function(e,t){var n,r;n=this,r=function(){var e,t,n="lscache-",r="-cacheexpiration",i=10,o=6e4,s=Math.floor(864e13/o),a="",u=!1;function c(){var t="__lscachetest__";if(void 0!==e)return e;try{if(!localStorage)return!1}catch(e){return!1}try{v(t,"__lscachetest__"),m(t),e=!0}catch(t){e=!(!l(t)||!localStorage.length)}return e}function l(e){return!!(e&&"QUOTA_EXCEEDED_ERR"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name||"QuotaExceededError"===e.name)}function f(){return void 0===t&&(t=null!=window.JSON),t}function p(e){return e+r}function h(){return Math.floor((new Date).getTime()/o)}function d(e){return localStorage.getItem(n+a+e)}function v(e,t){localStorage.removeItem(n+a+e),localStorage.setItem(n+a+e,t)}function m(e){localStorage.removeItem(n+a+e)}function y(e){for(var t=new RegExp("^"+n+a.replace(/[[\]{}()*+?.\\^$|]/g,"\\$&")+"(.*)"),i=localStorage.length-1;i>=0;--i){var o=localStorage.key(i);(o=(o=o&&o.match(t))&&o[1])&&o.indexOf(r)<0&&e(o,p(o))}}function g(e){var t=p(e);m(e),m(t)}function _(e){var t=p(e),n=d(t);if(n){var r=parseInt(n,i);if(h()>=r)return m(e),m(t),!0}}function b(e,t){u&&"console"in window&&"function"==typeof window.console.warn&&(window.console.warn("lscache - "+e),t&&window.console.warn("lscache - The error was: "+t.message))}return{set:function(e,t,n){if(c()){if("string"!=typeof t){if(!f())return;try{t=JSON.stringify(t)}catch(e){return}}try{v(e,t)}catch(n){if(!l(n))return void b("Could not add item with key '"+e+"'",n);var r,o=[];y(function(e,t){var n=d(t);n=n?parseInt(n,i):s,o.push({key:e,size:(d(e)||"").length,expiration:n})}),o.sort(function(e,t){return t.expiration-e.expiration});for(var a=(t||"").length;o.length&&a>0;)r=o.pop(),b("Cache is full, removing item with key '"+e+"'"),g(r.key),a-=r.size;try{v(e,t)}catch(t){return void b("Could not add item with key '"+e+"', perhaps it's too big?",t)}}n?v(p(e),(h()+n).toString(i)):m(p(e))}},get:function(e){if(!c())return null;if(_(e))return null;var t=d(e);if(!t||!f())return t;try{return JSON.parse(t)}catch(e){return t}},remove:function(e){c()&&g(e)},supported:function(){return c()},flush:function(){c()&&y(function(e){g(e)})},flushExpired:function(){c()&&y(function(e){_(e)})},setBucket:function(e){a=e},resetBucket:function(){a=""},enableWarnings:function(e){u=e}}},void 0!==e&&e.exports?e.exports=r():n.lscache=r()},function(e,t,n){var r=n(50),i=n(51),o=i;o.v1=r,o.v4=i,e.exports=o},function(e,t,n){var r,i,o=n(18),s=n(19),a=0,u=0;e.exports=function(e,t,n){var c=t&&n||0,l=t||[],f=(e=e||{}).node||r,p=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==p){var h=o();null==f&&(f=r=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==p&&(p=i=16383&(h[6]<<8|h[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:u+1,m=d-a+(v-u)/1e4;if(m<0&&void 0===e.clockseq&&(p=p+1&16383),(m<0||d>a)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=d,u=v,i=p;var y=(1e4*(268435455&(d+=122192928e5))+v)%4294967296;l[c++]=y>>>24&255,l[c++]=y>>>16&255,l[c++]=y>>>8&255,l[c++]=255&y;var g=d/4294967296*1e4&268435455;l[c++]=g>>>8&255,l[c++]=255&g,l[c++]=g>>>24&15|16,l[c++]=g>>>16&255,l[c++]=p>>>8|128,l[c++]=255&p;for(var _=0;_<6;++_)l[c+_]=f[_];return t||s(l)}},function(e,t,n){var r=n(18),i=n(19);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||i(s)}},function(e,t,n){var r=n(13);e.exports=function(){var e={},t=null;return location&&location.search&&location.search.length&&(e=r.parse(location.search.substr(1))),document&&document.referrer&&(t=document.referrer),{referrer:t,search:e}}},function(e,t,n){var r=n(0),i=n(2);function o(e){this.promises=[],this.name=e?e.name:null}o.prototype.push=function(e){var t=!1,n=this;function o(n){t||e&&(t=!0,e(n))}this.promises.push(o),setTimeout(function(){t||(r.log(n.name+" promise timed out",null,r.LOG),o())},i.timeout)},o.prototype.completePromises=function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this.promises[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value;s&&s(e)}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}this.promises=[]},e.exports=o},function(e,t,n){var r=n(3),i=n(0),o=n(1),s=n(55),a=n(56),u=void 0,c=setInterval(function(){document.body&&(l(),clearInterval(c),c=null)},1);function l(){if("undefined"!=typeof MutationObserver&&!u&&document.body){i.log("start DOM Observer",null,i.DEBUG);var e=function(){i.log("DOM mutation observed",null,i.DEBUG),t.applyVisualEditsFromConfig(o.config)};(u=new MutationObserver(r.debounce(e,50,{leading:!0}))).observe(document.body,{attributes:!0,childList:!0,characterData:!0,subtree:!0,attributeFilter:[],characterDataOldValue:!1,attributeOldValue:!1}),e()}}t.applyVisualEditsFromConfig=function(e){if(e&&e.webModifications&&e.webElements){l(),i.log("Apply visual edits from config",null,i.DEBUG);var t=s.buildUrlFromLocation(window.location);e.webModifications.forEach(function(n){if(n){var r=e.webElements.find(function(e){return e._id===n._element});if(!r)return i.error(`No web element found for _id: ${n._element}, modification: ${n._id}`,null,i.DEBUG);r.hostnameMatch&&!s.matchUrlsByDomain(r.url,t)||(r.hostnameMatch||s.matchUrlsByPath(r.url,t))&&a.applyModificationsToDOM({element:r,modification:n})}})}}},function(e,t){t.buildUrlFromLocation=function(e){return e&&e.origin?e.origin+(e.pathname?e.pathname:""):null},t.matchUrlsByPath=function(e,n){var r=t.getLocationFromUrl(e),i=t.getLocationFromUrl(n);return r&&i&&r.origin.length&&i.origin.length?t.buildUrlFromLocation(r)===t.buildUrlFromLocation(i):(e=e.replace(/^(http(s?):\/\/)?((www\.)?)/,""))===(n=n.replace(/^(http(s?):\/\/)?((www\.)?)/,""))},t.matchUrlsByDomain=function(e,t){return e=e.replace(/^(http(s?):\/\/)?((www\.)?)/,"").split("/")[0],t=t.replace(/^(http(s?):\/\/)?((www\.)?)/,"").split("/")[0],e=e.split(".").slice(-2),t=t.split(".").slice(-2),_.isEqual(e,t)},t.getLocationFromUrl=function(e){var t=document.createElement("a");return t.href=e,t.origin.length?{origin:t.origin,hostname:t.hostname,pathname:t.pathname,href:t.href}:null}},function(e,t,n){var r=n(0);t.applyModificationsToDOM=function(e){var n=e.element,i=e.modification;if(n&&i){var o=t.findElementsBySelector(n.selector),s=o&&o.length?o[0]:null;if(s){r.log(`Apply modification for web element: ${s._id}, modification: ${i._id}`,null,r.LOUD);var a=i.attributes.outerHTML;a&&s.outerHTML!==a&&(s.outerHTML=a)}}},t.findElementsBySelector=function(e){return document.querySelectorAll(e)}},function(e,t){e.exports=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}},function(e,t,n){var r=n(2),i=n(0),o=n(1),s=n(20),a=n(3);function u(e){if(!e||!e.winning_variation)return null;if("baseline"===e.winning_variation)return"b";var t=!0,n=!1,r=void 0;try{for(var i,o=e.variations[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value;if(s&&e.winning_variation===s._id)return s}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}return null}function c(e){if(0===e.variations.length)return"baseline";var t=Math.random(),n=a.isNumber(e.baseline.distributionPercent)?e.baseline.distributionPercent:0;if(n&&t=e}t.LOUD=3,t.DEBUG=2,t.LOG=1,t.USER=0,t.setPriorityLevel=function(e){r=e},t.log=function(e,t,r){n(r)&&(console.log("[Taplytics]",e),t&&console.dir(t))},t.time=function(e,r,i,o){if(n(o)){if(i)e=e+", time: "+((new Date).getTime()-i.getTime())+"ms";t.log(e,r,o)}},t.error=function(e,t,r){n(r)&&(console.error("[Taplytics]",e),t&&console.dir(t))}},function(e,t,r){var n=r(9),i=r(70),o=r(0),s=r(4),a=r(73),u=r(7),c=r(74),l=r(75),f="_tl_csid",p="_tl_duuid",h="_tl_suuid",d="_tl_sid",v="_tl_auid",y="_tl_config",g=function(e,t){return e&&t?`tl_sopts_${e}_${t}`:null};t.config=null,t.hasLoadedData=!1,t.sessionExpirationMin=30,t.start=function(e){return t.updateCookieSession().setDeviceUUID(e)},t.get=function(e,r){if(e){t.tick();var i=t.getCookieSessionID(),s=g(i,e);if(s){if(!(r&&JSON&&JSON.parse))return n.get(s);var a=n.get(s);if(a&&"object"==typeof a)return a;try{return JSON.parse(a)}catch(t){return o.error("Session.get("+e+") failed to parse JSON.",t,o.DEBUG),a}}}},t.tick=function(){return t.updateCookieSession(),t},t.set=function(e,r,i){if(!e||void 0===r||0===(""+r).length)return!1;t.tick();var o=t.getCookieSessionID(),s=g(o,e),a=w(new Date,"minute",t.sessionExpirationMin),u=r;return!!s&&(i&&JSON&&JSON.stringify&&(u=JSON.stringify(r)),n.set(s,u,{expires:a}),!0)},t.unset=function(e){if(!e)return!1;t.tick();var r=t.getCookieSessionID(),i=g(r,e);n.expire(i)},t.updateCookieSession=function(){var e=t.getCookieSessionID();e||(e=i.v4(),t.deleteSessionID());var r=w(new Date,"minute",t.sessionExpirationMin);return n.set(f,e,{expires:r}),o.log("Set cookieSessionID to: "+e,{expires:r},o.LOUD),t},t.setDeviceUUID=function(e){return(e=e||t.getDeviceUUID())||(e=i.v4()),n.set(p,e,{expires:new Date(2147483647e3)}),o.log("Set deviceUUID to: "+e,null,o.DEBUG),t},t.setSessionID=function(e){return n.set(d,e),o.log("Set sessionID to: "+e,null,o.DEBUG),t},t.deleteSessionID=function(){return n.expire(d),t},t.setAppUserID=function(e){return n.set(v,e),o.log("Set appUserID to: "+e,null,o.DEBUG),t},t.deleteAppUserID=function(){return n.expire(v),t},t.deleteSessionUUID=function(){n.expire(h)},t.setCachedConfig=function(e){return n.setJSON(y,{expVarsNamesHistory:e?e.expVarsNamesHistory:{},expVarsNames:e?e.expVarsNames:{},expVarsIds:e?e.expVarsIds:{},dynamicVars:e?e.dynamicVars:{}},null,!0),t},t.getDeviceUUID=function(){var e=n.get(h);if(e)return e;var r=n.get(p);return e===r&&t.deleteSessionUUID(),r},t.getCookieSessionID=function(){return n.get(f)},t.getAppUserID=function(){return n.get(v)},t.getSessionID=function(){return n.get(d)},t.getCachedConfig=function(){return n.getJSON(y,!0)},t.getSessionAttributes=function(e){e=e||{};var t=u.toObject(),r=a();return e.sid=this.getSessionID(),e.ad=this.getDeviceUUID(),e.adt="browser",e.ct="browser",e.lv=s.isProduction()?"0":"1",e.sdk=s.obj().sdkVersion,e.rfr=r.referrer,e.exm=r.search.utm_medium,e.exs=r.search.utm_source,e.exc=r.search.utm_campaign,e.ext=r.search.utm_term,e.exct=r.search.utm_content,e.prms={search:r.search,location:t},navigator&&navigator.userAgent&&(e.prms.userAgent=navigator.userAgent),e},t.saveSessionConfig=function(e,r){r&&!e&&(o.log("Using cached config because of server error",null,o.DEBUG),e=t.getCachedConfig()),t.config=e,_=!0,e&&e.app_user_id&&e.session_id&&(t.hasLoadedData=!0,t.setAppUserID(e.app_user_id),t.setSessionID(e.session_id),t.tick()),e&&t.setCachedConfig(e),l.applyVisualEditsFromConfig(e),b.completePromises(!!e),(r||e&&e.app_user_id&&e.session_id)&&m.completePromises(!!e)};var m=new c({name:"sessionConfigPromises"});t.sessionConfigPromise=function(e){if(e)return t.hasLoadedData&&t.config?e(!0):void m.push(e)};var _=!1,b=new c({name:"configPromises"});function w(e,t,r){var n=new Date(e);switch(t.toLowerCase()){case"year":n.setFullYear(n.getFullYear()+r);break;case"quarter":n.setMonth(n.getMonth()+3*r);break;case"month":n.setMonth(n.getMonth()+r);break;case"week":n.setDate(n.getDate()+7*r);break;case"day":n.setDate(n.getDate()+r);break;case"hour":n.setTime(n.getTime()+36e5*r);break;case"minute":n.setTime(n.getTime()+6e4*r);break;case"second":n.setTime(n.getTime()+1e3*r);break;default:n=void 0}return n}t.configPromise=function(e){if(e)return _&&t.config?e(!0):void b.push(e)},t.resetSession=function(){t.deleteSessionID(),t.deleteAppUserID(),t.config=null,t.hasLoadedData=!1}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r.d(t,"isNumber",function(){return g}),r.d(t,"isString",function(){return m}),r.d(t,"debounce",function(){return _}),r.d(t,"isObjectLike",function(){return b}),r.d(t,"values",function(){return w}),r.d(t,"includes",function(){return x}),r.d(t,"isEqual",function(){return D});var n=r(35),i=r.n(n),o=r(55),s=r.n(o),a=r(56),u=r.n(a),c=r(6),l=r.n(c),f=r(60),p=r.n(f),h=r(61),d=r.n(h),v=r(62),y=r.n(v),g=d.a,m=p.a,_=y.a,b=l.a,w=u.a,x=s.a,D=i.a},function(e,t,r){var n=r(27),i=r(4),o=r(0),s=r(14),a=r(15),u=new s,c=!1;t.publicToken=null,t.setPublicToken=function(e){this.publicToken=e},t.get=f(function(e,r,i){var s=d(r),a=h(e);o.log(`GET request: ${a}`,s,o.LOUD),n.get(a).query(s.query).timeout(t.timeout).end(l(a,i))}),t.getJSON=f(function(e,r){var s=function(e){return i.obj().cdnAPI+(e||"")}(e);o.log(`GET JSON file request: ${s}`,null,o.LOUD),n.get(s).timeout(t.timeout).end(l(s,r))}),t.post=f(function(e,t,r,i){var s=d(t,r),a=h(e);o.log(`POST request: ${a}`,s,o.LOUD),n.post(a).query(s.query).set("Content-Type","application/json").send(s.payload).end(l(a,i))}),t.del=f(function(e,r,i,s){var a=d(r,i),u=h(e);o.log(`DELETE request: ${u}`,a,o.LOUD),n.del(u).query(a.query).set("Content-Type","application/json").timeout(t.timeout).send(a.payload).end(l(u,s))});function l(e,t){return function(r,n){r&&o.error(`Error: ${e}`,r,o.DEBUG),t&&"function"==typeof t&&t(r,n),p()}}function f(e){return function(){u.enqueue({requestFunction:e,args:arguments}),c||p()}}function p(){if(!u.isEmpty()){c=!0;var e=u.dequeue();return o.log("Processing request",e,o.DEBUG),e&&e.requestFunction&&e.requestFunction.apply(t,e.args)}c=!1}function h(e,t){return("events"===e&&i.obj().eventsAPI?i.obj().eventsAPI:i.obj().baseAPI)+(e||"")+function(e){return e?`?${a.stringify(e)}`:""}(t)}function d(e,r){var n={},i={};return e&&"function"==typeof e?n=e():e&&(n=e),r&&"function"==typeof r?i=r():r&&(i=r),n.r_v="0",t.publicToken&&(n.public_token=t.publicToken),{query:n,payload:i}}t.timeout=4e3,t.setTimeout=function(e){var r=1e3*e;r>3e4?(o.error(`Timeout is larger then max timeout! timeout: ${e}s, max timeout: 30s. Using max timeout value.`,null,o.USER),t.timeout=3e4):r<1e3?(o.error(`Timeout is smaller then the min timeout! timeout: ${e}s, min timeout: 1s. Using min timeout value.`,null,o.USER),t.timeout=1e3):(o.log(`Set timeout: ${e}s`,null,o.LOUD),t.timeout=r)}},function(e,t,r){t.obj=function(){var e=r(8),t={cdnAPI:"https://cdn-config.taplytics.com/js/"};return"production"===e.env?(t.baseAPI="https://api.taplytics.com/public_api/v1/",t.eventsAPI="https://ping.taplytics.com/public_api/v1/"):"dev"===e.env||"development"===e.env?t.baseAPI="https://dev.taplytics.com/public_api/v1/":"stag"===e.env||"staging"===e.env?t.baseAPI="https://staging.taplytics.com/public_api/v1/":"local"===e.env&&(t.baseAPI="http://localhost:3002/public_api/v1/"),t.eventsFlushQueueTimeout=4e3,t.functionFlushQueueTimeout=500,t.sdkVersion="2.5.1",t.cookieDomain=e&&e.api&&e.api.config&&e.api.config.cookieDomain?e.api.config.cookieDomain:null,t},t.isProduction=function(){return"production"===r(8).env}},function(e,t,r){var n=r(41);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){var r={};function n(e){return r[e]?r[e]:"title"===e?document.title:document.location?document.location[e]:null}t.toObject=function(){return{href:n("href"),hash:n("hash"),search:n("search"),host:n("host"),protocol:n("protocol"),pathname:n("pathname"),title:n("title")}},t.attr=function(e){return n(e)},t.listen=function(e){}},function(e,t,r){e.exports={api:r(12),init:r(80),isReady:r(81),identify:r(82),track:r(83),page:r(84),reset:r(85),propertiesLoaded:r(86),runningExperiments:r(87),variable:r(88),codeBlock:r(90),featureFlagEnabled:r(91),runningFeatureFlags:r(92)}},function(e,t,r){var n=r(0),i=r(2),o=r(4),s=r(69),a=r(11).CookieJar,u=r(11).Cookie,c=r(11).CookieAccessInfo;s.supported()||(n.log("Local Storage not supported",null,n.DEBUG),s=null);var l={cookieSessionID:"_tl_csid",deviceUUID:"_tl_duuid",sessionUUID:"_tl_suuid",sessionID:"_tl_sid",appUserID:"_tl_auid"};t.getJSON=function(e,r){var o=t.get(e,r);if(!o||!i.isString(o))return o;try{return JSON.parse(o)}catch(e){return n.error("JSON parse cookie value",e,n.DEBUG),null}},t.getLS=function(e){if(!s)return null;var t=s.get(e);return n.log("Got local storage key: "+e+" with value: "+t,null,n.LOUD),t},t.get=function(e,r){if(t.getCookieSupport()&&!r){var n=p(),o=new c(t.getCookieDomain()),a=n.getCookie(e,o);return a&&!i.includes(i.values(l),e)&&(a.value=function(e){try{return decodeURIComponent(atob(e))}catch(t){return e}}(a.value)),a?a.value:void 0}return s?t.getLS(e):r?t.get(e):void 0},t.setJSON=function(e,r,o,s){var a=void 0;try{a=i.isString(r)?r:JSON.stringify(r)}catch(e){n.error("JSON stringify cookie value",e,n.DEBUG)}t.set(e,a,o,s)},t.set=function(e,r,o,a){if(e)if(t.getCookieSupport()&&!a){r=r||"",o=o||{};var c=p(),f=function(e,r,n){i.includes(i.values(l),e)||(o=r,r=btoa(encodeURIComponent(o)));var o;var s=new u(e+"="+r);n&&(s.expiration_date=n);return s.domain=t.getCookieDomain(),s}(e,r,o.expires).toString();document.cookie=f,c.setCookie(f),n.log("Setting cookies to:",f,n.LOUD)}else s?t.setLS(e,r,o):a&&t.set(e,r,o)},t.setLS=function(e,t,r){if(s){var i=r&&r.expires?30:null;s.set(e,t,i),n.log(`Setting local storage key: ${e} to value: ${t}`,null,n.LOUD)}},t.expire=function(e,r){t.getCookieSupport()&&!r?t.set(e,"-",{expires:new Date}):s?(n.log("Deleting local storage key: "+e,null,n.LOUD),s.remove(e)):r&&t.expire(e)};var f=void 0;function p(){return f||(f=new a,function(){if(f&&document.cookie&&document.cookie.length)for(var e=document.cookie.split(";"),t=0;t=3&&t[1].match(/^(com|edu|gov|net|mil|org|nom|co|ca|name|info|biz)$/i)?`.${t[2]}.${t[1]}.${t[0]}`:t&&t.length>1?`.${t[1]}.${t[0]}`:null};var h=void 0;t.getCookieSupport=function(){if(void 0!==h)return h;var e=!0;do{var t="gCStest="+Math.floor(1e8*Math.random());if(document.cookie=e?t+"; expires="+new Date("Tue, 01-Jan-2030 00:00:00").toUTCString():t,-1!==document.cookie.indexOf(t))return document.cookie=t+"; expires="+new Date("Sat, 01-Jan-2000 00:00:00 GMT").toUTCString(),h=e,e}while(!(e=!e));return h=null,null}},function(e,t){var r=Array.isArray;e.exports=r},function(e,t){!function(){"use strict";function e(t,r,n,i){return this instanceof e?(this.domain=t||void 0,this.path=r||"/",this.secure=!!n,this.script=!!i,this):new e(t,r,n,i)}function r(e,t,n){return e instanceof r?e:this instanceof r?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(n||"/"),this.explicit_path=!1,this.domain=t||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,e&&this.parse(e,t,n),this):new r(e,t,n)}e.All=Object.freeze(Object.create(null)),t.CookieAccessInfo=e,t.Cookie=r,r.prototype.toString=function(){var e=[this.name+"="+this.value];return this.expiration_date!==1/0&&e.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&e.push("domain="+this.domain),this.path&&e.push("path="+this.path),this.secure&&e.push("secure"),this.noscript&&e.push("httponly"),e.join("; ")},r.prototype.toValueString=function(){return this.name+"="+this.value};var n=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;function i(){var e,t;return this instanceof i?(e=Object.create(null),this.setCookie=function(n,i,o){var s,a;if(s=(n=new r(n,i,o)).expiration_date<=Date.now(),void 0!==e[n.name]){for(t=e[n.name],a=0;a0?e[0]:void 0}}},function(e,t,r){"use strict";var n=r(33),i=r(34),o=r(17);e.exports={formats:o,parse:i,stringify:n}},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?r+=t.charAt(n):o<128?r+=i[o]:o<2048?r+=i[192|o>>6]+i[128|63&o]:o<55296||o>=57344?r+=i[224|o>>12]+i[128|o>>6&63]+i[128|63&o]:(n+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(n)),r+=i[240|o>>18]+i[128|o>>12&63]+i[128|o>>6&63]+i[128|63&o])}return r},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n>>((3&t)<<3)&255;return i}}},function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,i=r;return i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]}},function(e,t,r){var n=this,i=r(3),o=r(18),s=r(4),a=r(0),u=r(78),c=r(7),l=r(14),f=r(1),p=r(9),h=new l,d={active:"appActive",terminate:"appTerminate",config:"tlClientConfig",fastConfig:"tlFastModeConfig",goal:"goalAchieved",pageView:"viewAppeared",pageClose:"viewDisappeared",timeOnPage:"viewTimeOnPage"};function v(e,t){var r=new Date;return e.val=(r.getTime()-t.getTime())/1e3,h.enqueue(e)}function y(e){return{type:e,date:(new Date).toISOString(),tvKey:c.attr("title"),tvCl:c.attr("href"),prod:s.isProduction()?1:0,data:{_tl_view:c.toObject()}}}function g(){if(a.log("events.flushQueue: tick.",h,a.LOUD),h.isEmpty()||!f.hasLoadedData)return t.scheduleTick();var e=h.flush(),r=f.getSessionID(),n=p.getLS(m);n&&n.length&&(a.log(`Add ${n.length} events from local storage cache`,null,a.DEBUG),e=e.concat(n),p.expire(m,!0)),r||o.post({},"Taplytics::events.flushQueue: failed to create sessions. Events will fail to process."),this.post(e,function(r,n){r&&h.enqueueAll(e),t.scheduleTick()})}t.types=d,t.watchLifecycleEvents=function(){t.appActive();g.bind(n);window.addEventListener("unload",function(){a.log("Window on unload",null,a.DEBUG),t.appTerminate(),function(){if(h.isEmpty()||!f.hasLoadedData)return;var e=h.flush();a.log(`save ${e.length} events to local storage`,h,a.DEBUG),p.setLS(m,e)}()})},t.timeOnPage=function(e,t,r,n,i,o){var s=y(d.timeOnPage);if(o&&o.getTime){var a=(new Date).getTime(),c=o.getTime();s.val=(a-c)/1e3}return s.vKey=t,s.tKey=e,s.tvKey=n,s.tvCl=r,i&&(s.data=u(s.data||{},{_tl_view:i})),h.enqueue(s)},t.scheduleTick=function(){var e=g.bind(n);setTimeout(e,s.obj().eventsFlushQueueTimeout)},t.pageClose=function(e,t,r,n,i){var o=y(d.pageClose);return o.val=(new Date).toISOString(),o.vKey=t,o.tKey=e,o.tvKey=n,o.tvCl=r,i&&(o.data=u(o.data||{},{_tl_view:i})),h.enqueue(o)},t.pageView=function(e,t,r){var n=y(d.pageView);return r&&(n.data=u(n.data,r)),n.val=(new Date).toISOString(),n.vKey=t,n.tKey=e,h.enqueue(n)},t.goalAchieved=function(e,t,r){var n=y(d.goal);return r&&(n.data=u(n.data,r)),t&&(n.val=t),n.gn=e,h.enqueue(n)},t.appActive=function(){return h.enqueue(y(d.active))},t.appTerminate=function(){return h.enqueue(y(d.terminate))},t.clientConfig=function(e){if(e)return v(y(d.config),e)},t.fastModeConfig=function(e){if(e)return v(y(d.fastConfig),e)},t.post=function(e,t){var r=new Date;i.post("events",{},function(t){var r={};return r.sid=f.getSessionID(),{session:r,events:e}},function(e,n){return e?a.error("Taplytics::events.post: failed to log events",e,a.LOG):a.time("Taplytics::events.post: succesfully logged events.",n,r,a.DEBUG),t&&t(e,n)})};var m="_tl_eventsQueue"},function(e,t,r){var n=r(3),i=r(0);r(1);t.post=function(e,t){if(!e)return i.error("No new variable to post to server",null,i.DEBUG);var r=new Date,o={name:e.name,createdAt:new Date,variableType:e.defaultType,defaultVal:e.stringifyValue?e.stringifyValue(e.defaultValue):e.defaultValue};i.log("variable_post",o,i.DEBUG),n.post("variable",{},o,function(e,n){if(e)i.error("Failed to post variable",e,i.DEBUG);else{var o=n.body;o&&o.name&&i.time("Users.post: successfully created new variable.",o,r,i.DEBUG)}return t&&t(e)})}},function(e,t,r){var n=r(8),i=r(0),o=r(4);t.Taplytics=window.Taplytics=e.exports=n,t.flushAppQueue=function(){if(i.log("flushAppQueue tick",window._tlq,i.LOUD),window._tlq&&window._tlq instanceof Array){var e=window._tlq.slice();if(window._tlq=[],Array.prototype.sort&&e.sort(function(e,t){if(e instanceof Array&&t instanceof Array){if("init"===e[0]&&"identify"===t[0])return-1;if("identify"===e[0]&&"init"===t[0])return 1;if("init"===e[0]||"identify"===e[0])return-1}return 2}),e.length>0){i.log("flushAppQueue: "+e.length,e,i.LOUD);for(var r=0;r=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==r){var n;try{n=t.status}catch(e){n=0}if(!n){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var n=function(t,r){r.total>0&&(r.percent=r.loaded/r.total*100),r.direction=t,e.emit("progress",r)};if(this.hasListeners("progress"))try{t.onprogress=n.bind(null,"download"),t.upload&&(t.upload.onprogress=n.bind(null,"upload"))}catch(e){}try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],o=this._serializer||l.serialize[i?i.split(";")[0]:""];!o&&v(i)&&(o=l.serialize["application/json"]),o&&(r=o(r))}for(var s in this.header)null!=this.header[s]&&this.header.hasOwnProperty(s)&&t.setRequestHeader(s,this.header[s]);return this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0!==r?r:null),this},l.agent=function(){return new u},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(e){u.prototype[e.toLowerCase()]=function(t,r){var n=new l.Request(e,t);return this._setDefaults(n),r&&n.end(r),n}}),u.prototype.del=u.prototype.delete,l.get=function(e,t,r){var n=l("GET",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},l.head=function(e,t,r){var n=l("HEAD",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},l.options=function(e,t,r){var n=l("OPTIONS",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},l.del=m,l.delete=m,l.patch=function(e,t,r){var n=l("PATCH",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},l.post=function(e,t,r){var n=l("POST",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},l.put=function(e,t,r){var n=l("PUT",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n}},function(e,t,r){function n(e){if(e)return function(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}(e)}e.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},n.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(e,t);if(!0===r)return!0;if(!1===r)return!1}catch(e){console.error(e)}if(t&&t.status&&t.status>=500&&501!=t.status)return!0;if(e){if(e.code&&~o.indexOf(e.code))return!0;if(e.timeout&&"ECONNABORTED"==e.code)return!0;if(e.crossDomain)return!0}return!1},i.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},i.prototype.then=function(e,t){if(!this._fullfilledPromise){var r=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(e,t){r.end(function(r,n){r?t(r):e(n)})})}return this._fullfilledPromise.then(e,t)},i.prototype.catch=function(e){return this.then(void 0,e)},i.prototype.use=function(e){return e(this),this},i.prototype.ok=function(e){if("function"!=typeof e)throw Error("Callback required");return this._okCallback=e,this},i.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},i.prototype.get=function(e){return this._header[e.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(e,t){if(n(e)){for(var r in e)this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},i.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},i.prototype.field=function(e,t){if(null===e||void 0===e)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),n(e)){for(var r in e)this.field(r,e[r]);return this}if(Array.isArray(t)){for(var i in t)this.field(e,t[i]);return this}if(null===t||void 0===t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=""+t),this._getFormData().append(e,t),this},i.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},i.prototype._auth=function(e,t,r,n){switch(r.type){case"basic":this.set("Authorization","Basic "+n(e+":"+t));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer "+e)}return this},i.prototype.withCredentials=function(e){return void 0==e&&(e=!0),this._withCredentials=e,this},i.prototype.redirects=function(e){return this._maxRedirects=e,this},i.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw TypeError("Invalid argument");return this._maxResponseSize=e,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(e){var t=n(e),r=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(t&&n(this._data))for(var i in e)this._data[i]=e[i];else"string"==typeof e?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"==r?this._data?this._data+"&"+e:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)?this:(r||this.type("json"),this)},i.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},i.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var r=this.url.substring(t+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.substring(0,t)+"?"+r.join("&")}}},i.prototype._appendQueryString=function(){console.trace("Unsupported")},i.prototype._timeoutError=function(e,t,r){if(!this._aborted){var n=new Error(e+t+"ms exceeded");n.timeout=t,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.abort(),this.callback(n)}},i.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(e,t,r){"use strict";var n=r(31);function i(e){if(e)return function(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}(e)}e.exports=i,i.prototype.get=function(e){return this.header[e.toLowerCase()]},i.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=n.type(t);var r=n.params(t);for(var i in r)this[i]=r[i];this.links={};try{e.link&&(this.links=n.parseLinks(e.link))}catch(e){}},i.prototype._setStatusProperties=function(e){var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.redirect=3==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.forbidden=403==e,this.notFound=404==e}},function(e,t,r){"use strict";t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){return e.split(/ *; */).reduce(function(e,t){var r=t.split(/ *= */),n=r.shift(),i=r.shift();return n&&i&&(e[n]=i),e},{})},t.parseLinks=function(e){return e.split(/ *, */).reduce(function(e,t){var r=t.split(/ *; */),n=r[0].slice(1,-1);return e[r[1].split(/ *= */)[1].slice(1,-1)]=n,e},{})},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},function(e,t){function r(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(e){r.prototype[e]=function(){return this._defaults.push({fn:e,arguments:arguments}),this}}),r.prototype._setDefaults=function(e){this._defaults.forEach(function(t){e[t.fn].apply(e,t.arguments)})},e.exports=r},function(e,t,r){"use strict";var n=r(16),i=r(17),o={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Date.prototype.toISOString,a={delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,serializeDate:function(e){return s.call(e)},skipNulls:!1,strictNullHandling:!1},u=function e(t,r,i,o,s,u,c,l,f,p,h,d){var v=t;if("function"==typeof c)v=c(r,v);else if(v instanceof Date)v=p(v);else if(null===v){if(o)return u&&!d?u(r,a.encoder):r;v=""}if("string"==typeof v||"number"==typeof v||"boolean"==typeof v||n.isBuffer(v))return u?[h(d?r:u(r,a.encoder))+"="+h(u(v,a.encoder))]:[h(r)+"="+h(String(v))];var y,g=[];if(void 0===v)return g;if(Array.isArray(c))y=c;else{var m=Object.keys(v);y=l?m.sort(l):m}for(var _=0;_0?T+O:""}},function(e,t,r){"use strict";var n=r(16),i=Object.prototype.hasOwnProperty,o={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:n.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},s=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,s=/(\[[^[\]]*])/.exec(n),a=s?n.slice(0,s.index):n,u=[];if(a){if(!r.plainObjects&&i.call(Object.prototype,a)&&!r.allowPrototypes)return;u.push(a)}for(var c=0;null!==(s=o.exec(n))&&c=0;--i){var o,s=e[i];if("[]"===s)o=(o=[]).concat(n);else{o=r.plainObjects?Object.create(null):{};var a="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(a,10);!isNaN(u)&&s!==a&&String(u)===a&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(o=[])[u]=n:o[a]=n}n=o}return n}(u,t,r)}};e.exports=function(e,t){var r=t?n.assign({},t):{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.ignoreQueryPrefix=!0===r.ignoreQueryPrefix,r.delimiter="string"==typeof r.delimiter||n.isRegExp(r.delimiter)?r.delimiter:o.delimiter,r.depth="number"==typeof r.depth?r.depth:o.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:o.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"==typeof r.decoder?r.decoder:o.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:o.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:o.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:o.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:o.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:o.strictNullHandling,""===e||null===e||void 0===e)return r.plainObjects?Object.create(null):{};for(var a="string"==typeof e?function(e,t){for(var r={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=t.parameterLimit===1/0?void 0:t.parameterLimit,a=n.split(t.delimiter,s),u=0;u-1}},function(e,t,r){var n=r(5);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},function(e,t,r){var n=r(46),i=r(47),o=r(48),s=1,a=2;e.exports=function(e,t,r,u,c,l){var f=r&s,p=e.length,h=t.length;if(p!=h&&!(f&&h>p))return!1;var d=l.get(e);if(d&&l.get(t))return d==t;var v=-1,y=!0,g=r&a?new n:void 0;for(l.set(e,t),l.set(t,e);++v-1}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,r){var n=r(51),i=1,o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,s,a,u){var c=r&i,l=n(e),f=l.length;if(f!=n(t).length&&!c)return!1;for(var p=f;p--;){var h=l[p];if(!(c?h in t:o.call(t,h)))return!1}var d=u.get(e);if(d&&u.get(t))return d==t;var v=!0;u.set(e,t),u.set(t,e);for(var y=c;++p-1}},function(e,t,r){var n=r(57),i=r(59);e.exports=function(e){return null==e?[]:n(e,i(e))}},function(e,t,r){var n=r(58);e.exports=function(e,t){return n(t,function(t){return e[t]})}},function(e,t){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r=t||r<0||g&&e-v>=f}function w(){var e=i();if(b(e))return x(e);h=setTimeout(w,function(e){var r=t-(e-d);return g?u(r,f-(e-v)):r}(e))}function x(e){return h=void 0,m&&c?_(e):(c=l=void 0,p)}function D(){var e=i(),r=b(e);if(c=arguments,l=this,d=e,r){if(void 0===h)return function(e){return v=e,h=setTimeout(w,t),y?_(e):p}(d);if(g)return h=setTimeout(w,t),_(d)}return void 0===h&&(h=setTimeout(w,t)),p}return t=o(t)||0,n(r)&&(y=!!r.leading,f=(g="maxWait"in r)?a(o(r.maxWait)||0,t):f,m="trailing"in r?!!r.trailing:m),D.cancel=function(){void 0!==h&&clearTimeout(h),v=0,c=d=l=h=void 0},D.flush=function(){return void 0===h?p:x(i())},D}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,r){var n=r(65);e.exports=function(){return n.Date.now()}},function(e,t,r){var n=r(66),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},function(e,t,r){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(t,r(67))},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t){e.exports=function(e){return e}},function(e,t){var r,n;r=this,n=function(){var e,t,r="lscache-",n="-cacheexpiration",i=10,o=6e4,s=Math.floor(864e13/o),a="",u=!1;function c(){var t="__lscachetest__";if(void 0!==e)return e;try{if(!localStorage)return!1}catch(e){return!1}try{v(t,"__lscachetest__"),y(t),e=!0}catch(t){e=!(!l(t)||!localStorage.length)}return e}function l(e){return!!(e&&"QUOTA_EXCEEDED_ERR"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name||"QuotaExceededError"===e.name)}function f(){return void 0===t&&(t=null!=window.JSON),t}function p(e){return e+n}function h(){return Math.floor((new Date).getTime()/o)}function d(e){return localStorage.getItem(r+a+e)}function v(e,t){localStorage.removeItem(r+a+e),localStorage.setItem(r+a+e,t)}function y(e){localStorage.removeItem(r+a+e)}function g(e){for(var t=new RegExp("^"+r+a.replace(/[[\]{}()*+?.\\^$|]/g,"\\$&")+"(.*)"),i=localStorage.length-1;i>=0;--i){var o=localStorage.key(i);(o=(o=o&&o.match(t))&&o[1])&&o.indexOf(n)<0&&e(o,p(o))}}function m(e){var t=p(e);y(e),y(t)}function _(e){var t=p(e),r=d(t);if(r){var n=parseInt(r,i);if(h()>=n)return y(e),y(t),!0}}function b(e,t){u&&"console"in window&&"function"==typeof window.console.warn&&(window.console.warn("lscache - "+e),t&&window.console.warn("lscache - The error was: "+t.message))}return{set:function(e,t,r){if(c()){if("string"!=typeof t){if(!f())return;try{t=JSON.stringify(t)}catch(e){return}}try{v(e,t)}catch(r){if(!l(r))return void b("Could not add item with key '"+e+"'",r);var n,o=[];g(function(e,t){var r=d(t);r=r?parseInt(r,i):s,o.push({key:e,size:(d(e)||"").length,expiration:r})}),o.sort(function(e,t){return t.expiration-e.expiration});for(var a=(t||"").length;o.length&&a>0;)n=o.pop(),b("Cache is full, removing item with key '"+e+"'"),m(n.key),a-=n.size;try{v(e,t)}catch(t){return void b("Could not add item with key '"+e+"', perhaps it's too big?",t)}}r?v(p(e),(h()+r).toString(i)):y(p(e))}},get:function(e){if(!c())return null;if(_(e))return null;var t=d(e);if(!t||!f())return t;try{return JSON.parse(t)}catch(e){return t}},remove:function(e){c()&&m(e)},supported:function(){return c()},flush:function(){c()&&g(function(e){m(e)})},flushExpired:function(){c()&&g(function(e){_(e)})},setBucket:function(e){a=e},resetBucket:function(){a=""},enableWarnings:function(e){u=e}}},void 0!==e&&e.exports?e.exports=n():r.lscache=n()},function(e,t,r){var n=r(71),i=r(72),o=i;o.v1=n,o.v4=i,e.exports=o},function(e,t,r){var n,i,o=r(22),s=r(23),a=0,u=0;e.exports=function(e,t,r){var c=t&&r||0,l=t||[],f=(e=e||{}).node||n,p=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==p){var h=o();null==f&&(f=n=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==p&&(p=i=16383&(h[6]<<8|h[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:u+1,y=d-a+(v-u)/1e4;if(y<0&&void 0===e.clockseq&&(p=p+1&16383),(y<0||d>a)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=d,u=v,i=p;var g=(1e4*(268435455&(d+=122192928e5))+v)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var m=d/4294967296*1e4&268435455;l[c++]=m>>>8&255,l[c++]=255&m,l[c++]=m>>>24&15|16,l[c++]=m>>>16&255,l[c++]=p>>>8|128,l[c++]=255&p;for(var _=0;_<6;++_)l[c+_]=f[_];return t||s(l)}},function(e,t,r){var n=r(22),i=r(23);e.exports=function(e,t,r){var o=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||n)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||i(s)}},function(e,t,r){var n=r(15);e.exports=function(){var e={},t=null;return location&&location.search&&location.search.length&&(e=n.parse(location.search.substr(1))),document&&document.referrer&&(t=document.referrer),{referrer:t,search:e}}},function(e,t,r){var n=r(0),i=r(3);function o(e){this.promises=[],this.name=e?e.name:null}o.prototype.push=function(e){var t=!1,r=this;function o(r){t||e&&(t=!0,e(r))}this.promises.push(o),setTimeout(function(){t||(n.log(r.name+" promise timed out",null,n.LOG),o())},i.timeout)},o.prototype.completePromises=function(e){var t=!0,r=!1,n=void 0;try{for(var i,o=this.promises[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value;s&&s(e)}}catch(e){r=!0,n=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw n}}this.promises=[]},e.exports=o},function(e,t,r){var n=r(2),i=r(0),o=r(1),s=r(76),a=r(77),u=void 0,c=setInterval(function(){document.body&&(l(),clearInterval(c),c=null)},1);function l(){if("undefined"!=typeof MutationObserver&&!u&&document.body){i.log("start DOM Observer",null,i.DEBUG);var e=function(){i.log("DOM mutation observed",null,i.DEBUG),t.applyVisualEditsFromConfig(o.config)};(u=new MutationObserver(n.debounce(e,50,{leading:!0}))).observe(document.body,{attributes:!0,childList:!0,characterData:!0,subtree:!0,attributeFilter:[],characterDataOldValue:!1,attributeOldValue:!1}),e()}}t.applyVisualEditsFromConfig=function(e){if(e&&e.webModifications&&e.webElements){l(),i.log("Apply visual edits from config",null,i.DEBUG);var t=s.buildUrlFromLocation(window.location);e.webModifications.forEach(function(r){if(r){var n=e.webElements.find(function(e){return e._id===r._element});if(!n)return i.error(`No web element found for _id: ${r._element}, modification: ${r._id}`,null,i.DEBUG);n.hostnameMatch&&!s.matchUrlsByDomain(n.url,t)||(n.hostnameMatch||s.matchUrlsByPath(n.url,t))&&a.applyModificationsToDOM({element:n,modification:r})}})}}},function(e,t,r){var n=r(2);t.buildUrlFromLocation=function(e){return e&&e.origin?e.origin+(e.pathname?e.pathname:""):null},t.matchUrlsByPath=function(e,r){var n=t.getLocationFromUrl(e),i=t.getLocationFromUrl(r);return n&&i&&n.origin.length&&i.origin.length?t.buildUrlFromLocation(n)===t.buildUrlFromLocation(i):(e=e.replace(/^(http(s?):\/\/)?((www\.)?)/,""))===(r=r.replace(/^(http(s?):\/\/)?((www\.)?)/,""))},t.matchUrlsByDomain=function(e,t){return e=e.replace(/^(http(s?):\/\/)?((www\.)?)/,"").split("/")[0],t=t.replace(/^(http(s?):\/\/)?((www\.)?)/,"").split("/")[0],e=e.split(".").slice(-2),t=t.split(".").slice(-2),n.isEqual(e,t)},t.getLocationFromUrl=function(e){var t=document.createElement("a");return t.href=e,t.origin.length?{origin:t.origin,hostname:t.hostname,pathname:t.pathname,href:t.href}:null}},function(e,t,r){var n=r(0);t.applyModificationsToDOM=function(e){var r=e.element,i=e.modification;if(r&&i){var o=t.findElementsBySelector(r.selector),s=o&&o.length?o[0]:null;if(s){n.log(`Apply modification for web element: ${s._id}, modification: ${i._id}`,null,n.LOUD);var a=i.attributes.outerHTML;a&&s.outerHTML!==a&&(s.outerHTML=a)}}},t.findElementsBySelector=function(e){return document.querySelectorAll(e)}},function(e,t){e.exports=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}},function(e,t,r){var n=r(3),i=r(0),o=r(1),s=r(24),a=r(2);function u(e){if(!e||!e.winning_variation)return null;if("baseline"===e.winning_variation)return"b";var t=!0,r=!1,n=void 0;try{for(var i,o=e.variations[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value;if(s&&e.winning_variation===s._id)return s}}catch(e){r=!0,n=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw n}}return null}function c(e){if(0===e.variations.length)return"baseline";var t=Math.random(),r=a.isNumber(e.baseline.distributionPercent)?e.baseline.distributionPercent:0;if(r&&t