77 lines
660 KiB
JavaScript
77 lines
660 KiB
JavaScript
!function(e,t){var n,i,r,o,a,s,c,l,u,f,d,h,p,v,g,m,_,y=["entityKeys","collectionPointId"],b=["entityKeys","wid"];function E(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function w(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(){return T="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=A(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},T.apply(this,arguments)}function A(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=j(e)););return e}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,r,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);a=!0);}catch(e){s=!0,r=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw r}}return o}(e,t)||K(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e){return function(e){if(Array.isArray(e))return H(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||K(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */D=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,i){var r=t&&t.prototype instanceof f?t:f,o=Object.create(r.prototype),a=new k(i||[]);return o._invoke=function(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return x()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=b(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var c=l(e,t,n);if("normal"===c.type){if(i=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function f(){}function d(){}function h(){}var p={};s(p,r,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(S([])));g&&g!==t&&n.call(g,r)&&(p=g);var m=h.prototype=f.prototype=Object.create(p);function _(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function i(r,o,a,s){var c=l(e[r],e,o);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==J(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(c.arg)}var r;this._invoke=function(e,n){function o(){return new t((function(t,r){i(e,n,t,r)}))}return r=r?r.then(o,o):o()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function S(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return d.prototype=h,s(m,"constructor",h),s(h,"constructor",d),d.displayName=s(h,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},_(y.prototype),s(y.prototype,o,(function(){return this})),e.AsyncIterator=y,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var a=new y(c(t,n,i,r),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(m),s(m,a,"Generator"),s(m,r,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=S,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return a.type="throw",a.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;w(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function R(e,t,n,i,r,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(i,r)}function O(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){R(o,i,r,a,s,"next",e)}function s(e){R(o,i,r,a,s,"throw",e)}a(void 0)}))}}function I(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}function M(e){var t=G();return function(){var n,i=j(e);if(t){var r=j(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return P(this,n)}}function P(e,t){if(t&&("object"===J(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return N(e)}function N(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U(e){var t="function"==typeof Map?new Map:void 0;return U=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return B(e,arguments,j(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),L(n,e)},U(e)}function B(e,t,n){return B=G()?Reflect.construct.bind():function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&L(r,n.prototype),r},B.apply(null,arguments)}function G(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function L(e,t){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L(e,t)}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function F(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=K(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function K(e,t){if(e){if("string"==typeof e)return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(e,t):void 0}}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function $(e,t,n){return t&&q(e.prototype,t),n&&q(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function J(e){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(e)}function W(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;"undefined"==typeof Reflect||J(Reflect);for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a
|
||
/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/}void 0===Element.prototype.getAttributeNames&&(Element.prototype.getAttributeNames=function(){for(var e=this.attributes,t=e.length,n=new Array(t),i=0;i<t;i++)n[i]=e[i].name;return n});var X,Z,Y=window,Q=Y.ShadowRoot&&(void 0===Y.ShadyCSS||Y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ee=Symbol(),te=new WeakMap,ne=function(){function e(t,n,i){if(V(this,e),this._$cssResult$=!0,i!==ee)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}return $(e,[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(Q&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=te.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&te.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}]),e}(),ie=function(e){return new ne("string"==typeof e?e:e+"",void 0,ee)},re=Q?function(e){return e}:function(e){return e instanceof CSSStyleSheet?function(e){var t,n="",i=F(e.cssRules);try{for(i.s();!(t=i.n()).done;){n+=t.value.cssText}}catch(e){i.e(e)}finally{i.f()}return ie(n)}(e):e},oe=window,ae=oe.trustedTypes,se=ae?ae.emptyScript:"",ce=oe.reactiveElementPolyfillSupport,le={toAttribute:function(e,t){switch(t){case Boolean:e=e?se:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute:function(e,t){var n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},ue=function(e,t){return t!==e&&(t==t||e==e)},fe={attribute:!0,type:String,converter:le,reflect:!1,hasChanged:ue},de=function(e){I(i,e);var t,n=M(i);function i(){var e;return V(this,i),(e=n.call(this))._$Ei=new Map,e.isUpdatePending=!1,e.hasUpdated=!1,e._$El=null,e.u(),e}return $(i,[{key:"u",value:function(){var e,t=this;this._$E_=new Promise((function(e){return t.enableUpdating=e})),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach((function(e){return e(t)}))}},{key:"addController",value:function(e){var t,n;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}},{key:"removeController",value:function(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}},{key:"_$Eg",value:function(){var e=this;this.constructor.elementProperties.forEach((function(t,n){e.hasOwnProperty(n)&&(e._$Ei.set(n,e[n]),delete e[n])}))}},{key:"createRenderRoot",value:function(){var e,t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return function(e,t){Q?e.adoptedStyleSheets=t.map((function(e){return e instanceof CSSStyleSheet?e:e.styleSheet})):t.forEach((function(t){var n=document.createElement("style"),i=Y.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=t.cssText,e.appendChild(n)}))}(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach((function(e){var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}},{key:"enableUpdating",value:function(e){}},{key:"disconnectedCallback",value:function(){var e;null===(e=this._$ES)||void 0===e||e.forEach((function(e){var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}},{key:"attributeChangedCallback",value:function(e,t,n){this._$AK(e,n)}},{key:"_$EO",value:function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fe,r=this.constructor._$Ep(e,i);if(void 0!==r&&!0===i.reflect){var o=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:le).toAttribute(t,i.type);this._$El=e,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}},{key:"_$AK",value:function(e,t){var n,i=this.constructor,r=i._$Ev.get(e);if(void 0!==r&&this._$El!==r){var o=i.getPropertyOptions(r),a="function"==typeof o.converter?{fromAttribute:o.converter}:void 0!==(null===(n=o.converter)||void 0===n?void 0:n.fromAttribute)?o.converter:le;this._$El=r,this[r]=a.fromAttribute(t,o.type),this._$El=null}}},{key:"requestUpdate",value:function(e,t,n){var i=!0;void 0!==e&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||ue)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}},{key:"_$Ej",value:(t=O(D().mark((function e(){var t;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isUpdatePending=!0,e.prev=1,e.next=4,this._$E_;case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),Promise.reject(e.t0);case 9:if(t=this.scheduleUpdate(),e.t1=null!=t,!e.t1){e.next=14;break}return e.next=14,t;case 14:return e.abrupt("return",!this.isUpdatePending);case 15:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return t.apply(this,arguments)})},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){var e,t=this;if(this.isUpdatePending){this.hasUpdated,this._$Ei&&(this._$Ei.forEach((function(e,n){return t[n]=e})),this._$Ei=void 0);var n=!1,i=this._$AL;try{(n=this.shouldUpdate(i))?(this.willUpdate(i),null===(e=this._$ES)||void 0===e||e.forEach((function(e){var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(i)):this._$Ek()}catch(e){throw n=!1,this._$Ek(),e}n&&this._$AE(i)}}},{key:"willUpdate",value:function(e){}},{key:"_$AE",value:function(e){var t;null===(t=this._$ES)||void 0===t||t.forEach((function(e){var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$Ek",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$E_}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){var t=this;void 0!==this._$EC&&(this._$EC.forEach((function(e,n){return t._$EO(n,t[n],e)})),this._$EC=void 0),this._$Ek()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}],[{key:"addInitializer",value:function(e){var t;null!==(t=this.h)&&void 0!==t||(this.h=[]),this.h.push(e)}},{key:"observedAttributes",get:function(){var e=this;this.finalize();var t=[];return this.elementProperties.forEach((function(n,i){var r=e._$Ep(i,n);void 0!==r&&(e._$Ev.set(r,i),t.push(r))})),t}},{key:"createProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe;if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){var n="symbol"==J(e)?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){return{get:function(){return this[t]},set:function(i){var r=this[e];this[t]=i,this.requestUpdate(e,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){return this.elementProperties.get(e)||fe}},{key:"finalize",value:function(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;var e=Object.getPrototypeOf(this);if(e.finalize(),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){var t,n=this.properties,i=F([].concat(C(Object.getOwnPropertyNames(n)),C(Object.getOwnPropertySymbols(n))));try{for(i.s();!(t=i.n()).done;){var r=t.value;this.createProperty(r,n[r])}}catch(e){i.e(e)}finally{i.f()}}return this.elementStyles=this.finalizeStyles(this.styles),!0}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e)){var n,i=F(new Set(e.flat(1/0).reverse()));try{for(i.s();!(n=i.n()).done;){var r=n.value;t.unshift(re(r))}}catch(e){i.e(e)}finally{i.f()}}else void 0!==e&&t.push(re(e));return t}},{key:"_$Ep",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}]),i}(U(HTMLElement));de.finalized=!0,de.elementProperties=new Map,de.elementStyles=[],de.shadowRootOptions={mode:"open"},null==ce||ce({ReactiveElement:de}),(null!==(X=oe.reactiveElementVersions)&&void 0!==X?X:oe.reactiveElementVersions=[]).push("1.4.1");var he=window,pe=he.trustedTypes,ve=pe?pe.createPolicy("lit-html",{createHTML:function(e){return e}}):void 0,ge="lit$".concat((Math.random()+"").slice(9),"$"),me="?"+ge,_e="<".concat(me,">"),ye=document,be=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return ye.createComment(e)},Ee=function(e){return null===e||"object"!=J(e)&&"function"!=typeof e},we=Array.isArray,ke=function(e){return we(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator])},Se=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xe=/-->/g,Te=/>/g,Ae=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),ze=/'/g,Ce=/"/g,De=/^(?:script|style|textarea|title)$/i,Re=function(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return{_$litType$:e,strings:t,values:i}}}(1),Oe=Symbol.for("lit-noChange"),Ie=Symbol.for("lit-nothing"),Me=new WeakMap,Pe=ye.createTreeWalker(ye,129,null,!1),Ne=function(){function e(t,n){var i,r=t.strings,o=t._$litType$;V(this,e),this.parts=[];var a=0,s=0,c=r.length-1,l=this.parts,u=function(e,t){for(var n,i=e.length-1,r=[],o=2===t?"<svg>":"",a=Se,s=0;s<i;s++){for(var c=e[s],l=void 0,u=void 0,f=-1,d=0;d<c.length&&(a.lastIndex=d,null!==(u=a.exec(c)));)d=a.lastIndex,a===Se?"!--"===u[1]?a=xe:void 0!==u[1]?a=Te:void 0!==u[2]?(De.test(u[2])&&(n=RegExp("</"+u[2],"g")),a=Ae):void 0!==u[3]&&(a=Ae):a===Ae?">"===u[0]?(a=null!=n?n:Se,f=-1):void 0===u[1]?f=-2:(f=a.lastIndex-u[2].length,l=u[1],a=void 0===u[3]?Ae:'"'===u[3]?Ce:ze):a===Ce||a===ze?a=Ae:a===xe||a===Te?a=Se:(a=Ae,n=void 0);var h=a===Ae&&e[s+1].startsWith("/>")?" ":"";o+=a===Se?c+_e:f>=0?(r.push(l),c.slice(0,f)+"$lit$"+c.slice(f)+ge+h):c+ge+(-2===f?(r.push(void 0),s):h)}var p=o+(e[i]||"<?>")+(2===t?"</svg>":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==ve?ve.createHTML(p):p,r]}(r,o),f=z(u,2),d=f[0],h=f[1];if(this.el=e.createElement(d,n),Pe.currentNode=this.el.content,2===o){var p=this.el.content,v=p.firstChild;v.remove(),p.append.apply(p,C(v.childNodes))}for(;null!==(i=Pe.nextNode())&&l.length<c;){if(1===i.nodeType){if(i.hasAttributes()){var g,m=[],_=F(i.getAttributeNames());try{for(_.s();!(g=_.n()).done;){var y=g.value;if(y.endsWith("$lit$")||y.startsWith(ge)){var b=h[s++];if(m.push(y),void 0!==b){var E=i.getAttribute(b.toLowerCase()+"$lit$").split(ge),w=/([.?@])?(.*)/.exec(b);l.push({type:1,index:a,name:w[2],strings:E,ctor:"."===w[1]?Ke:"?"===w[1]?Ve:"@"===w[1]?qe:Fe})}else l.push({type:6,index:a})}}}catch(e){_.e(e)}finally{_.f()}for(var k=0,S=m;k<S.length;k++){var x=S[k];i.removeAttribute(x)}}if(De.test(i.tagName)){var T=i.textContent.split(ge),A=T.length-1;if(A>0){i.textContent=pe?pe.emptyScript:"";for(var D=0;D<A;D++)i.append(T[D],be()),Pe.nextNode(),l.push({type:2,index:++a});i.append(T[A],be())}}}else if(8===i.nodeType)if(i.data===me)l.push({type:2,index:a});else for(var R=-1;-1!==(R=i.data.indexOf(ge,R+1));)l.push({type:7,index:a}),R+=ge.length-1;a++}}return $(e,null,[{key:"createElement",value:function(e,t){var n=ye.createElement("template");return n.innerHTML=e,n}}]),e}();function Ue(e,t){var n,i,r,o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,s=arguments.length>3?arguments[3]:void 0;if(t===Oe)return t;var c=void 0!==s?null===(n=a._$Cl)||void 0===n?void 0:n[s]:a._$Cu,l=Ee(t)?void 0:t._$litDirective$;return(null==c?void 0:c.constructor)!==l&&(null===(i=null==c?void 0:c._$AO)||void 0===i||i.call(c,!1),void 0===l?c=void 0:(c=new l(e))._$AT(e,a,s),void 0!==s?(null!==(r=(o=a)._$Cl)&&void 0!==r?r:o._$Cl=[])[s]=c:a._$Cu=c),void 0!==c&&(t=Ue(e,c._$AS(e,t.values),c,s)),t}var Be,Ge,Le=function(){function e(t,n){V(this,e),this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=n}return $(e,[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"p",value:function(e){var t,n=this._$AD,i=n.el.content,r=n.parts,o=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:ye).importNode(i,!0);Pe.currentNode=o;for(var a=Pe.nextNode(),s=0,c=0,l=r[0];void 0!==l;){if(s===l.index){var u=void 0;2===l.type?u=new je(a,a.nextSibling,this,e):1===l.type?u=new l.ctor(a,l.name,l.strings,this,e):6===l.type&&(u=new $e(a,this,e)),this.v.push(u),l=r[++c]}s!==(null==l?void 0:l.index)&&(a=Pe.nextNode(),s++)}return o}},{key:"m",value:function(e){var t,n=0,i=F(this.v);try{for(i.s();!(t=i.n()).done;){var r=t.value;void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,n),n+=r.strings.length-2):r._$AI(e[n])),n++}}catch(e){i.e(e)}finally{i.f()}}}]),e}(),je=function(){function e(t,n,i,r){var o;V(this,e),this.type=2,this._$AH=Ie,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=r,this._$C_=null===(o=null==r?void 0:r.isConnected)||void 0===o||o}return $(e,[{key:"_$AU",get:function(){var e,t;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$C_}},{key:"parentNode",get:function(){var e=this._$AA.parentNode,t=this._$AM;return void 0!==t&&11===e.nodeType&&(e=t.parentNode),e}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;e=Ue(this,e,t),Ee(e)?e===Ie||null==e||""===e?(this._$AH!==Ie&&this._$AR(),this._$AH=Ie):e!==this._$AH&&e!==Oe&&this.$(e):void 0!==e._$litType$?this.T(e):void 0!==e.nodeType?this.k(e):ke(e)?this.O(e):this.$(e)}},{key:"S",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._$AB;return this._$AA.parentNode.insertBefore(e,t)}},{key:"k",value:function(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}},{key:"$",value:function(e){this._$AH!==Ie&&Ee(this._$AH)?this._$AA.nextSibling.data=e:this.k(ye.createTextNode(e)),this._$AH=e}},{key:"T",value:function(e){var t,n=e.values,i=e._$litType$,r="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Ne.createElement(i.h,this.options)),i);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===r)this._$AH.m(n);else{var o=new Le(r,this),a=o.p(this.options);o.m(n),this.k(a),this._$AH=o}}},{key:"_$AC",value:function(e){var t=Me.get(e.strings);return void 0===t&&Me.set(e.strings,t=new Ne(e)),t}},{key:"O",value:function(t){we(this._$AH)||(this._$AH=[],this._$AR());var n,i,r=this._$AH,o=0,a=F(t);try{for(a.s();!(i=a.n()).done;){var s=i.value;o===r.length?r.push(n=new e(this.S(be()),this.S(be()),this,this.options)):n=r[o],n._$AI(s),o++}}catch(e){a.e(e)}finally{a.f()}o<r.length&&(this._$AR(n&&n._$AB.nextSibling,o),r.length=o)}},{key:"_$AR",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,n=arguments.length>1?arguments[1]:void 0;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,n);t&&t!==this._$AB;){var i=t.nextSibling;t.remove(),t=i}}},{key:"setConnected",value:function(e){var t;void 0===this._$AM&&(this._$C_=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}]),e}(),Fe=function(){function e(t,n,i,r,o){V(this,e),this.type=1,this._$AH=Ie,this._$AN=void 0,this.element=t,this.name=n,this._$AM=r,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Ie}return $(e,[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=this.strings,o=!1;if(void 0===r)e=Ue(this,e,t,0),(o=!Ee(e)||e!==this._$AH&&e!==Oe)&&(this._$AH=e);else{var a,s,c=e;for(e=r[0],a=0;a<r.length-1;a++)(s=Ue(this,c[n+a],t,a))===Oe&&(s=this._$AH[a]),o||(o=!Ee(s)||s!==this._$AH[a]),s===Ie?e=Ie:e!==Ie&&(e+=(null!=s?s:"")+r[a+1]),this._$AH[a]=s}o&&!i&&this.P(e)}},{key:"P",value:function(e){e===Ie?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}]),e}(),Ke=function(e){I(n,e);var t=M(n);function n(){var e;return V(this,n),(e=t.apply(this,arguments)).type=3,e}return $(n,[{key:"P",value:function(e){this.element[this.name]=e===Ie?void 0:e}}]),n}(Fe),He=pe?pe.emptyScript:"",Ve=function(e){I(n,e);var t=M(n);function n(){var e;return V(this,n),(e=t.apply(this,arguments)).type=4,e}return $(n,[{key:"P",value:function(e){e&&e!==Ie?this.element.setAttribute(this.name,He):this.element.removeAttribute(this.name)}}]),n}(Fe),qe=function(e){I(n,e);var t=M(n);function n(e,i,r,o,a){var s;return V(this,n),(s=t.call(this,e,i,r,o,a)).type=5,s}return $(n,[{key:"_$AI",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;if((e=null!==(t=Ue(this,e,n,0))&&void 0!==t?t:Ie)!==Oe){var i=this._$AH,r=e===Ie&&i!==Ie||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Ie&&(i===Ie||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}}},{key:"handleEvent",value:function(e){var t,n;"function"==typeof this._$AH?this._$AH.call(null!==(n=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==n?n:this.element,e):this._$AH.handleEvent(e)}}]),n}(Fe),$e=function(){function e(t,n,i){V(this,e),this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}return $(e,[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e){Ue(this,e)}}]),e}(),Je=he.litHtmlPolyfillSupport;null==Je||Je(Ne,je),(null!==(Z=he.litHtmlVersions)&&void 0!==Z?Z:he.litHtmlVersions=[]).push("2.3.1");var We=function(e){I(n,e);var t=M(n);function n(){var e;return V(this,n),(e=t.apply(this,arguments)).renderOptions={host:N(e)},e._$Do=void 0,e}return $(n,[{key:"createRenderRoot",value:function(){var e,t,i=T(j(n.prototype),"createRenderRoot",this).call(this);return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}},{key:"update",value:function(e){var t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),T(j(n.prototype),"update",this).call(this,e),this._$Do=function(e,t,n){var i,r,o=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:t,a=o._$litPart$;if(void 0===a){var s=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:null;o._$litPart$=a=new je(t.insertBefore(be(),s),s,void 0,null!=n?n:{})}return a._$AI(e),a}(t,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var e;T(j(n.prototype),"connectedCallback",this).call(this),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;T(j(n.prototype),"disconnectedCallback",this).call(this),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return Oe}}]),n}(de);We.finalized=!0,We._$litElement$=!0,null===(Be=globalThis.litElementHydrateSupport)||void 0===Be||Be.call(globalThis,{LitElement:We});var Xe=globalThis.litElementPolyfillSupport;null==Xe||Xe({LitElement:We}),(null!==(Ge=globalThis.litElementVersions)&&void 0!==Ge?Ge:globalThis.litElementVersions=[]).push("3.2.2");
|
||
/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/
|
||
var Ze,Ye=1,Qe=2,et=function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return{_$litDirective$:e,values:n}}},tt=function(){function e(t){V(this,e)}return $(e,[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AT",value:function(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}},{key:"_$AS",value:function(e,t){return this.update(e,t)}},{key:"update",value:function(e,t){return this.render.apply(this,C(t))}}]),e}(),nt=et(function(e){I(n,e);var t=M(n);function n(e){var i,r;if(V(this,n),i=t.call(this,e),e.type!==Ye||"class"!==e.name||(null===(r=e.strings)||void 0===r?void 0:r.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");return P(i)}return $(n,[{key:"render",value:function(e){return" "+Object.keys(e).filter((function(t){return e[t]})).join(" ")+" "}},{key:"update",value:function(e,t){var n,i,r=this,o=z(t,1)[0];if(void 0===this.nt){for(var a in this.nt=new Set,void 0!==e.strings&&(this.st=new Set(e.strings.join(" ").split(/\s/).filter((function(e){return""!==e})))),o)o[a]&&!(null===(n=this.st)||void 0===n?void 0:n.has(a))&&this.nt.add(a);return this.render(o)}var s=e.element.classList;for(var c in this.nt.forEach((function(e){e in o||(s.remove(e),r.nt.delete(e))})),o){var l=!!o[c];l===this.nt.has(c)||(null===(i=this.st)||void 0===i?void 0:i.has(c))||(l?(s.add(c),this.nt.add(c)):(s.remove(c),this.nt.delete(c)))}return Oe}}]),n}(tt)),it=function(e){return function(t){return"function"==typeof t?function(e,t){return customElements.define(e,t),t}(e,t):function(e,t){return{kind:t.kind,elements:t.elements,finisher:function(t){customElements.define(e,t)}}}(e,t)}};function rt(e){return function(t,n){return void 0!==n?function(e,t,n){t.constructor.createProperty(n,e)}(e,t,n):function(e,t){return"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?S(S({},t),{},{finisher:function(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer:function(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher:function(n){n.createProperty(t.key,e)}}}(e,t)}}
|
||
/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/function ot(e){return rt(S(S({},e),{},{state:!0}))}
|
||
/**
|
||
* @license
|
||
* Copyright 2021 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/null===(Ze=window.HTMLSlotElement)||void 0===Ze||Ze.prototype.assignedElements;var at=["ar"],st="cookie-consent",ct="https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/tiktok_fonts/",lt='<svg width="1" height="24" viewBox="0 0 1 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<line x1="0" y1="24" x2="0" stroke="#161823" stroke-opacity="0.12" stroke-width="1"/>\n</svg>',ut="LOCAL_IS_EFFECTIVE",ft={channel:"sg",channel_type:"tcpy"};/*! js-cookie v3.0.1 | MIT */function dt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}var ht=function e(t,n){function i(e,i,r){if("undefined"!=typeof document){"number"==typeof(r=dt({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var a in r)r[a]&&(o+="; "+a,!0!==r[a]&&(o+="="+r[a].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+o}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],i={},r=0;r<n.length;r++){var o=n[r].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(i[s]=t.read(a,s),e===s)break}catch(e){}}return e?i[e]:i}},remove:function(e,t){i(e,"",dt({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,dt({},this.attributes,t))},withConverter:function(t){return e(dt({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),pt=function(){return(pt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function vt(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function gt(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(vt(arguments[t]));return e}var mt,_t,yt,bt=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var n=this;e&&t&&"function"==typeof t&&this.on(e,(function i(r){t(r),n.off(e,i)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var n=this._hooks[e].indexOf(t);-1!==n&&this._hooks[e].splice(n,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,n){if(n){if(!e)return;-1!==this._cache.indexOf(n)?this._emit(e,t):(this._hooksCache.hasOwnProperty(n)||(this._hooksCache[n]={}),this._hooksCache[n].hasOwnProperty(e)||(this._hooksCache[n][e]=[]),this._hooksCache[n][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&>(this._hooks[e]).forEach((function(e){try{e(t)}catch(e){}}))},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),Et=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},wt=function(e){return Array.isArray(e)},kt=(mt=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return mt+=1}),St=function(e){return function(e,t,n){if("string"==typeof e&&"number"==typeof n){var i,r=[];n=n<=25?n:n%25;var o=String.fromCharCode(n+97);i=e.split(o);for(var a=0;a<i.length;a++){var s=parseInt(i[a],n);s=1*s^64;var c=String.fromCharCode(s);r.push(c)}return r.join("")}}(e,0,25)},xt=function(e){navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1)},Tt=function(){var e=0;return["hidden","msHidden","webkitHidden"].forEach((function(t){void 0!==document[t]&&(e=1)})),e},At=function(e){var t=document.createElement("a");return t.href=e,t},zt=function(e){var t={};try{var n=At(e).search;(n=n.slice(1)).split("&").forEach((function(e){var n,i,r=e.split("=");r.length&&(n=r[0],i=r[1]);try{t[n]=decodeURIComponent(void 0===i?"":i)}catch(e){t[n]=i}}))}catch(e){}return t},Ct=function(e,t){return function(e,t){var n;n=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(i){function r(){}function o(t,n,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},r.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=JSON.stringify(n);/^[\{\[]/.test(a)&&(n=a)}catch(e){}n=i.write?i.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var c in o)o[c]&&(s+="; "+c,!0!==o[c]&&(s+="="+o[c].split(";")[0]));return document.cookie=t+"="+n+s}}function a(e,n){if("undefined"!=typeof document){for(var r={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var s=o[a].split("="),c=s.slice(1).join("=");n||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var l=t(s[0]);if(c=(i.read||i)(c,l)||t(c),n)try{c=JSON.parse(c)}catch(e){}if(r[l]=c,e===l)break}catch(e){}}return e?r[e]:r}}return r.set=o,r.get=function(e){return a(e,!1)},r.getJSON=function(e){return a(e,!0)},r.remove=function(t,n){o(t,"",e(n,{expires:-1}))},r.defaults={},r.withConverter=n,r}((function(){}))},e.exports=n()}(t={exports:{}}),t.exports}(),Dt=function(e,t){try{return Ct.get(e)}catch(e){return""}},Rt=function(e,t,n,i){try{var r=i||document.domain,o=+new Date+(n||6048e5);Ct.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(e){}},Ot=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e,t){return Dt(e)},e.prototype.setCookie=function(e,t,n,i){Rt(e,t,n,i)},e}(),It={getItem:function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(e){}},getCookie:function(e,t){return Dt(e)},setCookie:function(e,t,n,i){Rt(e,t,n,i)},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},Mt={getItem:function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(e){}},getCookie:function(e,t){return Dt(e)},setCookie:function(e,t,n,i){Rt(e,t,n,i)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},Pt=function(){function e(e,t){this._storage=t&&"session"===t?Mt:!e&&It.isSupportLS?It:new Ot}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,n,i){this._storage.setCookie(e,t,n,i)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),Nt=function(){function e(e,t,n){this.appid=e,this.domain=t,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=n}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,n=document.referrer,i=n?At(n).hostname:"",r=zt(window.location.href),o=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web";this.utm=function(e,t,n,i){var r=new Pt(!1,"session"),o=e?"_$utm_from_url_"+e:"_$utm_from_url",a={},s=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],c={ad_id:Number(t.ad_id)||void 0,campaign_id:Number(t.campaign_id)||void 0,creative_id:Number(t.creative_id)||void 0,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,utm_term:t.utm_term,utm_content:t.utm_content,tr_shareuser:t.tr_shareuser,tr_admaster:t.tr_admaster,tr_param1:t.tr_param1,tr_param2:t.tr_param2,tr_param3:t.tr_param3,tr_param4:t.tr_param4};try{var l=!1;for(var u in c)c[u]&&(-1!==s.indexOf(u)?(a.hasOwnProperty("tracer_data")||(a.tracer_data={}),a.tracer_data[u]=c[u]):a[u]=c[u],l=!0);l&&r.setItem(o,"1"),r.getItem(o)&&(a.hasOwnProperty("tracer_data")||(a.tracer_data={}),a.tracer_data.$utm_from_url=1)}catch(e){return c}return a}(this.appid,r,this.domain,this.cookie_expire);var a=this.browser(),s=this.os();return{browser:a.browser,browser_version:a.browser_version,platform:o,os_name:s.os_name,os_version:s.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(s.os_name),language:t,referrer:n,referrer_host:i,utm:this.utm,latest_data:this.last(n,i)}},e.prototype.last=function(e,t){var n="",i="",r="",o=location.hostname,a=!1;if(e&&t&&o!==t){n=e,i=t,a=!0;var s=zt(e);s.keyword&&(r=s.keyword)}return{$latest_referrer:n,$latest_referrer_host:i,$latest_search_keyword:r,isLast:a}},e.prototype.browser=function(){var e,t,n="",i=""+parseFloat(this.appVersion),r=this.userAgent;return-1!==r.indexOf("Edge")||-1!==r.indexOf("Edg")?(n="Microsoft Edge",-1!==r.indexOf("Edge")?(e=r.indexOf("Edge"),i=r.substring(e+5)):(e=r.indexOf("Edg"),i=r.substring(e+4))):-1!==(e=r.indexOf("MSIE"))?(n="Microsoft Internet Explorer",i=r.substring(e+5)):-1!==(e=r.indexOf("Lark"))?(n="Lark",i=r.substring(e+5,e+11)):-1!==r.indexOf("Chrome")?-1!==(e=r.indexOf("TTWebView"))?(n="TTWebView",i=r.substring(e+10,e+23)):(-1!==(e=r.indexOf("Chrome"))||-1!==(e=r.indexOf("Chrome")))&&(n="Chrome",i=r.substring(e+7)):-1!==r.indexOf("Safari")?-1!==(e=r.indexOf("Safari"))&&(n="Safari",i=r.substring(e+7),-1!==(e=r.indexOf("Version"))&&(i=r.substring(e+8))):-1!==(e=r.indexOf("Firefox"))&&(n="Firefox",i=r.substring(e+8)),-1!==(t=i.indexOf(";"))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(" "))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(")"))&&(i=i.substring(0,t)),{browser:n,browser_version:i}},e.prototype.os=function(){for(var e="",t="",n=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"ChromeOS",r:/CrOS/},{s:"Linux",r:/(Linux|X11)/},{s:"Sun OS",r:/SunOS/}],i=0;i<n.length;i++){var r=n[i];if(r.r.test(this.userAgent)){"Mac OS X"===(e=r.s)&&this.isNewIpad()&&(e="iOS");break}}var o,a,s=function(e,t){var n=e.exec(t);return n&&n[1]?n[1]:""},c=function(e,t){var n=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return n?n.slice(1)[0]:""};switch(/Windows/.test(e)&&(t=s(/Windows (.*)/,e),e="windows"),e){case"Mac OS X":t=c("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":(a=s(/Android ([\.\_\d]+)/,o=this.userAgent))||(a=s(/Android\/([\.\_\d]+)/,o)),t=a,e="android";break;case"iOS":t=this.isNewIpad()?c("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios";break;case"chromeOS":var l=this.userAgent.indexOf("x86_64");t=this.userAgent.substring(l+7,l+16)}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var n=navigator.userAgent.replace("Mozilla/5.0 (",""),i=n.indexOf(";");t=n.slice(0,i)}}catch(e){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),Ut={sg:"1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k"},Bt={va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",in:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},Gt={sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z21z1ez4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z24z18z4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",in:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z24z18z49z23z21z1cz18z21z22z4ez18z4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",ie2:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z1gz1cz4ez4az22z1gz1iz22z1mz1iz25z4az1cz23"},Lt={sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1gz1iz22z1mz1iz25z4az23z21",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1gz1iz22z1mz1iz24z4az23z21",ie:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z1gz1cz4az22z1gz1iz22z1mz1iz25z4az1cz23",ie2:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z1gz1cz4ez4az22z1gz1iz22z1mz1iz25z4az1cz23"};!function(e){e.Init="init",e.Config="config",e.Start="start",e.Ready="ready",e.TokenComplete="token-complete",e.TokenStorage="token-storage",e.TokenFetch="token-fetch",e.TokenError="token-error",e.ConfigUuid="config-uuid",e.ConfigWebId="config-webid",e.ConfigDomain="config-domain",e.CustomWebId="custom-webid",e.TokenChange="token-change",e.TokenReset="token-reset",e.ConfigTransform="config-transform",e.EnvTransform="env-transform",e.SessionReset="session-reset",e.SessionResetTime="session-reset-time",e.Event="event",e.Events="events",e.EventNow="event-now",e.CleanEvents="clean-events",e.BeconEvent="becon-event",e.SubmitBefore="submit-before",e.SubmitScuess="submit-scuess",e.SubmitAfter="submit-after",e.SubmitError="submit-error",e.SubmitVerify="submit-verify",e.DestoryInstance="destory-instance",e.Stay="stay",e.ResetStay="reset-stay",e.StayReady="stay-ready",e.SetStay="set-stay",e.RouteChange="route-change",e.RouteReady="route-ready",e.Ab="ab",e.AbVar="ab-var",e.AbAllVars="ab-all-vars",e.AbConfig="ab-config",e.AbExternalVersion="ab-external-version",e.AbVersionChangeOn="ab-version-change-on",e.AbVersionChangeOff="ab-version-change-off",e.AbOpenLayer="ab-open-layer",e.AbCloseLayer="ab-close-layer",e.AbReady="ab-ready",e.AbComplete="ab-complete",e.AbTimeout="ab-timeout",e.Profile="profile",e.ProfileSet="profile-set",e.ProfileSetOnce="profile-set-once",e.ProfileUnset="profile-unset",e.ProfileIncrement="profile-increment",e.ProfileAppend="profile-append",e.ProfileClear="profile-clear",e.Autotrack="autotrack",e.AutotrackReady="autotrack-ready",e.CepReady="cep-ready",e.TracerReady="tracer-ready",e.sessionRecord="session-record",e.SessionRecordStart="session-record-start",e.SessionRecordPause="session-record-pause",e.SessionRecordEnd="session-record-end",e.SessionRecordReport="session-record-report",e.VisualCollectReady="visual-collect-ready",e.VisualApiReady="visual-api-ready",e.VisualApiUpdate="visual-api-update"}(_t||(_t={})),function(e){e.DEBUGGER_MESSAGE="debugger-message",e.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",e.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",e.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",e.DEBUGGER_MESSAGE_EVENT="debugger-message-event",e.DEVTOOL_WEB_READY="devtool-web-ready"}(yt||(yt={}));var jt,Ft=_t,Kt=void 0,Ht=(new Date).getTimezoneOffset(),Vt=parseInt(""+-Ht/60,10),qt=60*Ht,$t=function(){function e(e,t){this.is_first_time=!0,this.configPersist=!1,this.initConfig=t,this.collect=e;var n=new Nt(t.app_id,t.cookie_domain||"",t.cookie_expire||6048e5).init(),i="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new Pt(!1,"session"),this.localStorage=new Pt(!1,"local"),this.channelUrl="tcpy"===t.channel_type||"ttp"===t.channel_type?{WEBID_URL:"/v1/user/webid",TOB_URL:"",REPORT_URL:"/v1/list"}:{WEBID_URL:"/webid",TOB_URL:"/tobid",REPORT_URL:"/list"},t.configPersist&&(this.configPersist=!0,this.storage=1===t.configPersist?this.sessionStorage:this.localStorage);var r=this.localStorage.getItem(i);r&&1==r?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(i,"1")),this.envInfo={user:{user_unique_id:Kt,user_type:Kt,user_id:Kt,user_is_auth:Kt,user_is_login:Kt,device_id:Kt,web_id:Kt,ip_addr_id:Kt,user_unique_id_type:Kt},header:{app_id:Kt,app_name:Kt,app_install_id:Kt,install_id:Kt,app_package:Kt,app_channel:Kt,app_version:Kt,ab_version:Kt,os_name:n.os_name,os_version:n.os_version,device_model:n.device_model,ab_client:Kt,traffic_type:Kt,client_ip:Kt,device_brand:Kt,os_api:Kt,access:Kt,language:n.language,region:Kt,app_language:Kt,app_region:Kt,creative_id:n.utm.creative_id,ad_id:n.utm.ad_id,campaign_id:n.utm.campaign_id,log_type:Kt,rnd:Kt,platform:n.platform,sdk_version:"5.3.0_oversea",sdk_lib:"js",province:Kt,city:Kt,timezone:Vt,tz_offset:qt,tz_name:Kt,sim_region:Kt,carrier:Kt,resolution:n.screen_width+"x"+n.screen_height,browser:n.browser,browser_version:n.browser_version,referrer:n.referrer,referrer_host:n.referrer_host,width:n.screen_width,height:n.screen_height,screen_width:n.screen_width,screen_height:n.screen_height,utm_term:n.utm.utm_term,utm_content:n.utm.utm_content,utm_source:n.utm.utm_source,utm_medium:n.utm.utm_medium,utm_campaign:n.utm.utm_campaign,tracer_data:JSON.stringify(n.utm.tracer_data),custom:{}}},this.ab_version="",this.ab_uuid_cache={},this.evtParams={},this.reportErrorCallback=function(){},this.isLast=!1,this.setCustom(n),this.initDomain(),this.initABData()}return e.prototype.initDomain=function(e){var t=this.initConfig.channel_domain;if(t)this.domain=t;else{var n=e||this.initConfig.channel,i=this.initConfig&&this.initConfig.channel_type?"tcpy"===this.initConfig.channel_type?Gt[n]:Lt[n]:Ut[n];i||(console.warn("current channel: "+n+" is not exist, use va instead, please check!!!!"),i=Ut.sg),this.domain=St(i)}},e.prototype.setDomain=function(e){this.customDomain=!0,this.domain=e},e.prototype.getDomain=function(e){return this.customDomain||e&&this.initDomain(e),this.domain},e.prototype.initABData=function(){var e,t="__tea_sdk_ab_version_"+this.initConfig.app_id;e=this.localStorage.getItem(t),this.setAbCache(e)},e.prototype.setAbCache=function(e){this.ab_cache=e},e.prototype.getAbCache=function(){return this.ab_cache},e.prototype.clearAbCache=function(){this.ab_cache={},this.ab_version=""},e.prototype.setAbVersion=function(e){this.ab_version=e},e.prototype.getAbVersion=function(){return this.ab_version},e.prototype.setAbUuidCache=function(e,t){var n=t||this.envInfo.user.user_unique_id;this.ab_uuid_cache[""+n]||(this.ab_uuid_cache[""+n]=[]),-1===this.ab_uuid_cache[""+n].indexOf(e)&&this.ab_uuid_cache[""+n].push(e)},e.prototype.getAbUuidCache=function(e){return this.ab_uuid_cache[""+e]},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t=this.channelUrl.REPORT_URL;break;case"webid":t=this.channelUrl.WEBID_URL;break;case"tobid":t=this.channelUrl.TOB_URL}var n="";return this.initConfig.caller&&(n="?sdk_version=5.3.0_oversea&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),""+this.getDomain()+t+n},e.prototype.setCustom=function(e){if(e&&e.latest_data&&e.latest_data.isLast)for(var t in delete e.latest_data.isLast,this.isLast=!0,e.latest_data)this.envInfo.header.custom[t]=e.latest_data[t]},e.prototype.setAppid=function(e){this.envInfo.header.app_id=e},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(n){if(void 0!==e[n]&&null!==e[n]||t.delete(n),"traffic_type"===n&&t.isLast&&(t.envInfo.header.custom.$latest_traffic_source_type=e[n]),"evtParams"===n)t.evtParams=pt(pt({},t.evtParams||{}),e.evtParams||{});else if("_staging_flag"===n)t.evtParams=pt(pt({},t.evtParams||{}),{_staging_flag:e._staging_flag});else if("reportErrorCallback"===n&&"function"==typeof e[n])t.reportErrorCallback=e[n];else{var i="",r="";if(n.indexOf(".")>-1){var o=n.split(".");i=o[0],r=o[1]}i?"user"===i||"header"===i?t.envInfo[i][r]=e[n]:t.envInfo.header.custom[r]=e[n]:Object.hasOwnProperty.call(t.envInfo.user,n)?["user_type","ip_addr_id"].indexOf(n)>-1?t.envInfo.user[n]=e[n]?Number(e[n]):e[n]:["user_id","web_id","user_unique_id","user_unique_id_type"].indexOf(n)>-1?t.envInfo.user[n]=e[n]?String(e[n]):e[n]:["user_is_auth","user_is_login"].indexOf(n)>-1?t.envInfo.user[n]=Boolean(e[n]):"device_id"===n&&(t.envInfo.user[n]=e[n]):Object.hasOwnProperty.call(t.envInfo.header,n)?t.envInfo.header[n]=e[n]:t.envInfo.header.custom[n]=e[n]}}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(e){console.log("get config stringify error "),this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.setStore=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&Object.keys(e).length){var n=Object.assign(e,t);this.storage.setItem(this.configKey,n)}}catch(e){console.log("setStore error"),this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.getStore=function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey)||{};return e&&Object.keys(e).length?e:null}catch(e){return this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),null}},e.prototype.delete=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};t&&Object.hasOwnProperty.call(t,e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(e){this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),console.log("delete error")}},e}(),Jt=function(){function e(e,t){this.isLog=t||!1,this.name=e||""}return e.prototype.info=function(e){this.isLog&&console.log("%c %s","color: yellow; background-color: black;","[Tea instance: "+this.name+"] "+e)},e.prototype.warn=function(e){this.isLog&&console.warn("%c %s","color: #4D1B00; background-color: #FF7D00;","[Tea instance: "+this.name+"] "+e)},e.prototype.error=function(e){this.isLog&&console.error("%c %s","color: #FFF; background-color: #F53F3F;","[Tea instance: "+this.name+"] "+e)},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),Wt=function(){function e(){this.spiderBot=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"]}return e.prototype.checkSpider=function(e){if(!e.enable_spider)return!1;var t=window.navigator.userAgent;if(!t)return!0;var n=!1;return this.spiderBot.forEach((function(e){-1!==t.indexOf(e)&&(n=!0)})),n},e}(),Xt=function(){function e(e,t){this.collect=e,this.native=t}var t=e.prototype;return t.bridgeInject=function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),!0):(console.log("AppLogBridge is not inject"),!1))}catch(e){return console.log("AppLogBridge is not inject"),!1}},t.bridgeReady=function(){var e=this;return new Promise((function(t,n){try{e.bridgeInject()?AppLogBridge.hasStarted((function(e){console.log("AppLogBridge is started? : "+e),e?t(!0):n(!1)})):n(!1)}catch(e){console.log("AppLogBridge, error:"+JSON.stringify(e.stack)),n(!1)}}))},t.setNativeAppId=function(e){try{AppLogBridge.setNativeAppId(JSON.stringify(e)),console.log("change bridge appid, event report with appid: "+e)}catch(e){console.error("setNativeAppId error")}},t.setConfig=function(e){var t=this;try{Object.keys(e).forEach((function(n){"user_unique_id"===n?t.setUserUniqueId(e[n]):e[n]?t.addHeaderInfo(n,e[n]):t.removeHeaderInfo(n)}))}catch(e){console.error("setConfig error")}},t.setUserUniqueId=function(e){try{AppLogBridge.setUserUniqueId(e)}catch(e){console.error("setUserUniqueId error")}},t.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(e){console.error("addHeaderInfo error")}},t.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(JSON.stringify(e))}catch(e){console.error("setHeaderInfo error")}},t.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(e){console.error("removeHeaderInfo error")}},t.reportPv=function(e){this.onEventV3("predefine_pageview",e)},t.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t),this.collect.emit(DebuggerMesssge.DEBUGGER_MESSAGE,{type:DebuggerMesssge.DEBUGGER_MESSAGE_EVENT,info:"bridge埋点上报",time:Date.now(),data:[{events:[{event:e,params:t}]}],code:200,status:"success"})}catch(e){console.error("onEventV3 error")}},t.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(e){console.error("profileSet error")}},t.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(e){console.error("profileSetOnce error")}},t.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(e){console.error("profileIncrement error")}},t.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(e){console.error("profileUnset error")}},t.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(e){console.error("profileAppend error")}},e}(),Zt=function(){function e(){this.eventLimit=50,this.enable_ttwebid=!1,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new Pt(!0),this.localStorage=new Pt(!1),this.maxReport=t.max_report||10,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.enable_ttwebid=t.enable_ttwebid,this.reportUrl=t.report_url||this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.abKey="__tea_sdk_ab_version_"+this.configManager.get("app_id"),this.refer_key="__tea_cache_refer_"+this.configManager.get("app_id"),this.collect.on(Ft.Ready,(function(){n.reportAll(!1)})),this.collect.on(Ft.ConfigDomain,(function(){n.reportUrl=n.configManager.getUrl("event")})),this.collect.on(Ft.Event,(function(e){n.event(e)})),this.collect.on(Ft.BeconEvent,(function(e){n.beconEvent(e)})),this.collect.on(Ft.CleanEvents,(function(){n.reportAll(!1)})),this.linster()},e.prototype.linster=function(){var e=this;window.addEventListener("unload",(function(){e.reportAll(!0)}),!1),xt((function(){e.reportAll(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;if(!this.collect.destroy&&!this.collect.sdkStop)try{var n=gt(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,n),this.reportTimeout&&clearTimeout(this.reportTimeout),n.length>=this.maxReport)this.report(!1);else{var i=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),i)}}catch(e){this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.beconEvent=function(e){if(!this.collect.destroy&&!this.collect.sdkStop){var t=gt(e,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))}},e.prototype.reportBecon=function(){if(!this.collect.destroy&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))}},e.prototype.report=function(e){if(!this.collect.destroy&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var n=0;n<e.length;n+=this.eventLimit){var i;i=e.slice(n,n+this.eventLimit);var r=this.split(this.merge(i));this.send(r,t)}else r=this.split(this.merge(e)),this.send(r,t)},e.prototype.handleRefer=function(){var e="";try{if(this.config.spa||this.config.autotrack){var t=this.localStorage.getItem(this.refer_key)||{};e=t.routeChange?t.refer_key:this.configManager.get("referrer")}else e=this.configManager.get("referrer")}catch(t){e=document.referrer}return e},e.prototype.merge=function(e,t){var n=this,i=this.configManager.get(),r=i.header,o=i.user;r.custom=JSON.stringify(r.custom),r.referrer=this.handleRefer();var a=this.configManager.get("evtParams"),s=this.configManager.get("user_unique_id_type"),c=[];try{var l=e.filter((function(e){try{Object.keys(a).length&&!t&&(e.params=pt(pt({},a),e.params)),s&&(e.params.$user_unique_id_type=s);var i=n.configManager.getAbCache(),r=o[n.config.ab_user_mode]||o.user_unique_id,c=n.configManager.getAbUuidCache(r);if(i&&i.uuid&&i.uuid===r){var l=n.configManager.getAbVersion();if(n.config.enable_ab_uuid){if(c&&c.length){var u=c.join(",");l&&l.includes(u)&&(e.ab_sdk_version=l)}}else l&&(e.ab_sdk_version=l)}return e.session_id=n.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(t){return console.warn("filter merge event: "+(e&&e.event)+" error, pls check",t&&t.message),n.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Merge Event Something Error",level:"error",time:Date.now(),data:t.message,infoType:"sdk"}),!1}})),u=JSON.parse(JSON.stringify({events:l,user:o,header:r}));u.local_time=Math.floor(Date.now()/1e3),u.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0,u.verbose=1,c.push(u)}catch(e){console.warn("event merge error, pls check",e&&e.message)}return c},e.prototype.split=function(e){return e.map((function(e){var t=[];return t.push(e),t}))},e.prototype.send=function(e,t){var n=this;e.length&&(this.config.disable_track_event||e.forEach((function(e){try{var i=JSON.parse(JSON.stringify(e));n.config.filter&&((i=n.config.filter(i))||console.warn("filter must return data !!")),n.collect.eventFilter&&i&&((i=n.collect.eventFilter(i))||console.warn("filterEvent api must return data !!"));var r=i||e,o=JSON.parse(JSON.stringify(r));if(!r.length)return;var a=!0;if(r.forEach((function(e){e.events.length||(a=!1)})),!a)return;n.collect.emit(Ft.SubmitBefore,r),n.collect.emit(Ft.SubmitVerify,r),n.collect.requestManager.useRequest({url:n.reportUrl,data:r,success:function(e,t){e&&0!==e.e?(n.collect.emit(Ft.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e}),n.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_EVENT,info:"Event Report fail",time:Date.now(),data:o,code:e.e,failType:"数据异常失败",status:"fail"})):(n.collect.emit(Ft.SubmitScuess,{eventData:t,res:e}),n.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_EVENT,info:"Event Report Success",time:Date.now(),data:o,code:200,status:"success"}))},fail:function(e,t){n.configManager.get("reportErrorCallback")(e,t),n.collect.emit(Ft.SubmitError,{type:"f_net",eventData:e,errorCode:t}),n.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_EVENT,info:"Event Report Network fail",time:Date.now(),data:o,code:t,failType:"网络异常失败",status:"fail"})},timeout:n.timeout,useBeacon:!n.config.disable_sendbeacon&&t,withCredentials:n.enable_ttwebid}),n.collect.emit(Ft.SubmitAfter,r)}catch(e){console.warn("something error, "+JSON.stringify(e.stack)),n.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Report Event Something Error",level:"error",time:Date.now(),data:e.message})}})))},e}(),Yt=function(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}().replace(/-/g,"").slice(0,19)},Qt=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enable_ttwebid=!1,this.enableCustomWebid=!1}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new Pt(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.enable_ttwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on(Ft.ConfigUuid,(function(e){n.setUuid(e)})),this.collect.on(Ft.ConfigWebId,(function(e){n.setWebId(e)})),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()},e.prototype.checkStorage=function(){var e=this;this.cacheToken=this.storage.getItem(this.tokenKey)||{},this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid?this.enableCustomWebid?this.collect.on(Ft.CustomWebId,(function(){e.tokenReady=!0,e.collect.emit(Ft.TokenComplete)})):this.checkEnv()||(this.enable_ttwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:Yt(),user_unique_id:this.configManager.get("user_unique_id")||Yt()}):this.remoteWebid()},e.prototype.checkEnv=function(){var e=window.navigator.userAgent;if(-1!==e.indexOf("miniProgram")||-1!==e.indexOf("MiniProgram")){var t=zt(window.location.href);return!(!t||!t.Web_ID||(this.complete({web_id:""+t.Web_ID,user_unique_id:this.configManager.get("user_unique_id")||""+t.Web_ID}),0))}return!1},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),n={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Fetch WebID Request",logType:"fetch",level:"info",time:Date.now(),data:n});var i=Yt();this.collect.requestManager.useRequest({url:t,data:n,success:function(t){var n;t&&0===t.e?(n=t.web_id,e.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"Fetch WebID Request Success",logType:"fetch",level:"info",time:Date.now(),data:t})):(n=i,e.collect.configManager.set({localWebId:i}),e.collect.emit(Ft.TokenError),e.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"Fetch WebID Request Data Error, Use LocalId",logType:"fetch",level:"warn",time:Date.now(),data:t}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n})},fail:function(){e.complete({web_id:e.configManager.get("web_id")||i,user_unique_id:e.configManager.get("user_unique_id")||i}),e.collect.configManager.set({localWebId:i}),e.collect.emit(Ft.TokenError),e.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"Fetch WebID Request Network Fail, Use LocalId",logType:"fetch",level:"error",time:Date.now(),data:null}),e.collect.logger.warn("appid: "+e.config.app_id+", get webid error, use local webid~")},timeout:3e5})},e.prototype.complete=function(e){var t=e.web_id,n=e.user_unique_id;e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:n}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK UserInfo Complete",logType:"info",secType:"USER",level:"info",time:Date.now(),data:{web_id:t,user_unique_id:n},infoType:"sdk"}),this.collect.emit(Ft.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",n=this.configManager.get("user_unique_id");(n||t)&&this.configManager.set({user_unique_id:n||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(Ft.TokenComplete)},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),n=this.configManager.get("user_unique_id"),i=this.cacheToken&&this.cacheToken.user_unique_id;if(t===n&&t===i)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(Ft.TokenChange,"uuid"),this.collect.emit(Ft.SessionReset)}else this.clearUuid()},e.prototype.clearUuid=function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit(Ft.TokenReset))},e.prototype.setWebId=function(e){if(e&&!this.config.enable_ttwebid){this.cacheToken&&this.cacheToken.web_id?this.cacheToken.web_id!==e&&(this.cacheToken.user_unique_id=this.cacheToken.web_id===this.cacheToken.user_unique_id?e:this.cacheToken.user_unique_id,this.cacheToken.web_id=e):(this.cacheToken={},this.cacheToken.web_id=e,this.cacheToken.user_unique_id=e),this.cacheToken.timestamp=Date.now();var t=this.configManager.get("web_id"),n=this.configManager.get("user_unique_id");n&&n!==t||(this.configManager.set({user_unique_id:e}),this.collect.emit(Ft.TokenChange,"uuid")),t!==e&&(this.configManager.set({web_id:e}),this.collect.emit(Ft.TokenChange,"webid")),this.setStorage(this.cacheToken)}},e.prototype.setStorage=function(e){e._type_=this.enableCustomWebid?"custom":"default",delete e["diss".split("").reverse().join("")],this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e.prototype.getTobId=function(){var e=this;return new Promise((function(t){if("tcpy"!==e.config.channel_type&&"ttp"!==e.config.channel_type){var n={app_id:e.config.app_id,user_unique_id:e.configManager.get("user_unique_id"),web_id:e.configManager.get("web_id"),user_unique_id_type:e.configManager.get("user_unique_id_type")};e.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Fetch GetToken Request",logType:"fetch",level:"info",time:Date.now(),data:n,infoType:"sdk"}),e.collect.requestManager.useRequest({url:e.configManager.getUrl("tobid"),data:n,success:function(n){n&&0===n.e?(t(n.tobid),e.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"Fetch GetToken Request Success",logType:"fetch",level:"info",time:Date.now(),data:n,infoType:"sdk"})):(t(""),e.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"Fetch GetToken Request Fail",logType:"fetch",level:"error",time:Date.now(),data:n,infoType:"sdk"}))},fail:function(){t(""),e.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"Fetch GetToken Request Network Error",logType:"fetch",level:"error",time:Date.now(),infoType:"sdk"})},time:3e4,withCredentials:e.enable_ttwebid})}else t("")}))},e}(),en=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},tn=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.storage=new Pt(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSessionTimeCheck=t.disable_session_check,this.disableSession||(this.setSessionId(),this.collect.on(Ft.SessionReset,(function(e){n.resetSessionId(e)})),this.collect.on(Ft.SessionResetTime,(function(){n.updateSessionIdTime()})))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:en(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:en(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.disableSessionTimeCheck||(this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(e){var t={sessionId:e||en(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,t)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:en(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),nn=function(){function e(e,t){this.collector=e,this.config=t,this.requestType=t.request_type,this.supportBeacon=!(!window.navigator||!window.navigator.sendBeacon),this.errorCode={NO_URL:4001,IMG_ON:4e3,IMG_CATCH:4002,BEACON_FALSE:4003,XHR_ON:500,RESPONSE:5001,TIMEOUT:5005},this.customHeader=t.custom_request_header||{}}return e.prototype.useFetch=function(e){var t=e.url,n=e.data,i=e.method,r=e.success,o=e.fail,a={"Content-Type":"application/json; charset=utf-8"};if(Object.keys(this.customHeader).length)for(var s in this.customHeader)a[s]=this.customHeader[s];window.fetch?fetch(t,{method:i||"POST",headers:a,body:JSON.stringify(n)}).then((function(e){return e.json()})).then((function(e){r&&r(e)})).catch((function(e){o&&o(n,e)})):(this.requestType="xhr",console.log("your brwoser not support fetch, use xhr"),this.useRequest({url:t,data:n,method:i,success:r,fail:o}))},e.prototype.useBeacon=function(e){var t=e.url,n=e.data,i=e.success,r=e.fail;"xhr"!==this.requestType?window.navigator.sendBeacon(t,JSON.stringify(n))?i&&i():r&&r(n,this.errorCode.BEACON_FALSE):this.useXhr(e)},e.prototype.useXhr=function(e){var t=this,n=e.url,i=e.data,r=e.method,o=e.success,a=e.fail,s=e.timeout,c=e.withCredentials,l=e.app_key;try{var u=new XMLHttpRequest,f=r||"POST";if(u.open(f,""+n,!0),u.setRequestHeader("Content-Type","application/json; charset=utf-8"),l&&u.setRequestHeader("X-MCS-AppKey",""+l),Object.keys(this.customHeader).length)for(var d in this.customHeader)u.setRequestHeader(d,this.customHeader[d]);c&&(u.withCredentials=!0),s&&(u.timeout=s,u.ontimeout=function(){a&&a(i,t.errorCode.TIMEOUT)}),u.onload=function(){if(o){var e=null;if(u.responseText){try{e=JSON.parse(u.responseText)}catch(t){e={}}o(e,i)}}},u.onerror=function(){u.abort(),a&&a(i,t.errorCode.XHR_ON)},u.send(JSON.stringify(i))}catch(e){}},e.prototype.useRequest=function(e){var t=e.useBeacon,n=e.forceXhr;if("xhr"===this.requestType)this.useXhr(e);else{if(t&&this.supportBeacon)return void this.useBeacon(e);if("fetch"===this.requestType&&!n)return void this.useFetch(e);this.useXhr(e)}},e}(),rn=function(){function e(e,t){if(this.devToolReady=!1,this.devToolOrigin="*",this.sendAlready=!1,t.enable_debug&&"Microsoft Internet Explorer"!==e.configManager.get("browser")){this.collect=e,this.config=t,this.app_id=t.app_id;var n=e.adapters.storage;this.cacheStorgae=new n(!1),this.loadUrl=t.devtool_url||"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/devtool/debug-web.v2.0.0.js",this.filterEvent=new Set(["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","bav2b_page","bav2b_beat","bav2b_page_statistics","bav2b_click","bav2b_page_exposure","_be_active","predefine_pageview","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append","predefine_page_alive","predefine_page_close","abtest_exposure"]),this.load()}}return e.prototype.loadScript=function(e){try{var t=document.createElement("script");t.src=e,t.onerror=function(){console.log("load DevTool render fail")},t.onload=function(){console.log("load DevTool render success")},document.getElementsByTagName("body")[0].appendChild(t)}catch(e){console.log("devTool load fail, "+e.message)}},e.prototype.parseUrl=function(){var e={};try{var t=window.location.href.split("?")[1].split("&");t.length&&t.forEach((function(t){var n=t.split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}))}catch(e){}return e},e.prototype.load=function(){try{var e=this.parseUrl();if(e.open_devtool_web&&e.app_id){if(parseInt(e.app_id)!==this.app_id)return}else if(!this.getStorage())return;this.loadBaseInfo(),this.loadHook(),this.setStorage(),this.addLintener(),this.loadDebuggerModule(),this.loadDevTool()}catch(e){console.log("debug fail, "+e.message)}},e.prototype.getStorage=function(){var e=this.cacheStorgae.getItem("__applog_open_devtool_web");return e&&parseInt(e)===this.app_id},e.prototype.setStorage=function(){this.cacheStorgae.setItem("__applog_open_devtool_web",this.app_id)},e.prototype.loadDevTool=function(){this.loadScript(this.loadUrl)},e.prototype.loadBaseInfo=function(){if(this.log=[],this.event=[],this.info=[{title:"BaseInfo",key:"base",type:1,content:[{name:"app_id",desc:"APPID",value:this.config.app_id},{name:"channel",desc:"CHANNEL",value:this.config.channel},{name:"domain",desc:"Domain",value:this.collect.configManager.getDomain()},{name:"sdk_version",desc:"SDK Version",value:"5.3.0_oversea"},{name:"sdk_type",desc:"SDK Import Type",value:"npm"}]},{title:"UserInfo",key:"user",type:2,content:[{name:"uuid",desc:"UserUniqueId",value:this.collect.configManager.get("user").user_unique_id||""},{name:"web_id",desc:"WEB_ID",value:this.collect.configManager.get("user").web_id||""}]},{title:"CommonInfo",type:2,key:"common",content:[{name:"browser",desc:"Browser",value:this.collect.configManager.get("browser")},{name:"browser_version",desc:"Browser Version",value:this.collect.configManager.get("browser_version")},{name:"platform",desc:"Platform",value:this.collect.configManager.get("platform")},{name:"device_model",desc:"Devide Model",value:this.collect.configManager.get("device_model")},{name:"os_name",desc:"Os Name",value:this.collect.configManager.get("os_name")},{name:"os_version",desc:"Os Version",value:this.collect.configManager.get("os_version")},{name:"resolution",desc:"Screen Resolution",value:this.collect.configManager.get("resolution")},{name:"referrer",desc:"Referrer",value:this.collect.configManager.get("referrer")},{name:"custom",desc:"Custom Info",value:JSON.stringify(this.collect.configManager.get("custom"))}]},{title:"Config Info",key:"config",type:3,content:[{name:"autotrack",desc:"AutoTrackEvent",value:!!this.config.autotrack},{name:"stay",desc:"StayDuration",value:!!this.config.enable_stay_duration}]},{title:"A/B Config Info",key:"ab",type:4,content:[{name:"ab",desc:"A/BTester",value:!!this.config.enable_ab_test}]}],this.config.enable_ab_test){var e=this.getInfo("ab"),t=[{name:"ab",desc:"A/BTester",value:!!this.config.enable_ab_test},{name:"vid",desc:"A/B VID",value:this.collect.configManager.getAbVersion()},{name:"ab_domain",desc:"Domain",value:this.config.ab_channel_domain||St(Bt[this.config.channel])},{name:"all_values",desc:"A/B ALL Values",value:this.collect.configManager.getAbCache()}];e.content=t,this.setInfo("ab",e)}},e.prototype.getInfo=function(e){var t=null;return this.info.forEach((function(n){n.key===e&&(t=n)})),t},e.prototype.setInfo=function(e,t){var n=!1;this.info.forEach((function(i){i.key===e&&(n=!0,i=t)})),n||this.info.push(t)},e.prototype.getSecondInfo=function(e,t){var n=this.getInfo(e),i=null;return n.content.forEach((function(e){e.name===t&&(i=e)})),i},e.prototype.setSecondInfo=function(e,t,n){var i=this.getInfo(e);i.content.forEach((function(e){e.name===t&&(e.value=n)})),this.setInfo(e,i)},e.prototype.loadHook=function(){var e=this;this.collect.on(yt.DEBUGGER_MESSAGE,(function(t){switch(t.type){case yt.DEBUGGER_MESSAGE_SDK:var n={time:t.time,type:t.logType||"sdk",infoType:t.infoType||"sdk",level:t.level,name:t.info,show:!0,levelShow:!0,needDesc:!!t.data};return t.data&&(n.desc={content:JSON.stringify(t.data)}),e.updateLog(n),t.secType&&"AB"===t.secType?(e.setSecondInfo("ab","vid",e.collect.configManager.getAbVersion()),e.setSecondInfo("ab","all_values",e.collect.configManager.getAbCache())):"USER"===t.secType&&(e.setSecondInfo("user","uuid",e.collect.configManager.get("user").user_unique_id),e.setSecondInfo("user","web_id",e.collect.configManager.get("user").web_id)),void e.updateInfo();case yt.DEBUGGER_MESSAGE_EVENT:if(t.data&&t.data.length){var i=t.data[0],r=i.events;if(!r.length)return;r.forEach((function(n){n.checkShow=!0,n.searchShow=!0,n.focusShow=!0,n.status=t.status,n.type=e.filterEvent.has(n.event)?"sdk":"cus",n.verifyType=t.verifyType?"verify":"no",n.info="","fail"===t.status&&(n.info={message:"code: "+t.code+", msg: "+(t.msg||t.failType)})})),e.updateEvent(i)}return}}))},e.prototype.addLintener=function(){var e=this;window.addEventListener("message",(function(t){if(t&&t.data&&"devtool:web:ready"===t.data.type){if(e.devToolOrigin=t.origin,e.devToolReady=!0,e.sendAlready)return;e.sendData("devtool:web:init",{info:e.info,log:e.log,event:e.event,sdk_type:"5.3.0_oversea".includes("tob")?"tob":"inner",appId:e.app_id}),e.sendAlready=!0}t&&t.data&&"devtool:web:ssid"===t.data.type&&e.collect.getToken((function(t){e.setSecondInfo("user","sid",t.tobid),e.updateInfo()}))}))},e.prototype.sendData=function(e,t){try{var n={type:e,payload:t};window&&window.postMessage(n,this.devToolOrigin)}catch(e){}},e.prototype.updateInfo=function(){this.devToolReady&&this.sendData("devtool:web:info",this.info)},e.prototype.updateLog=function(e){this.devToolReady?this.sendData("devtool:web:log",e):this.log.push(e)},e.prototype.updateEvent=function(e){this.devToolReady?this.sendData("devtool:web:event",e):this.event.push(e)},e.prototype.loadDebuggerModule=function(){var e="#debugger-applog-web {\n position: fixed;\n width: 45px;\n height: 45px;\n background-image: url("+St("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz1bz1cz24z22z1mz1mz1jz4bz18z1nz1nz1jz1mz1ez4az1nz1lz1e")+");\n bottom: 5%;\n right: 10%;\n cursor: pointer;\n z-index:100;\n background-size: 45px;\n }",t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.appendChild(document.createTextNode(e)),t.appendChild(n);var i=document.createElement("div");i.innerHTML='<div id="debugger-applog-web" class="debugger-applog-web"></div>';var r=document.createElement("div");r.innerHTML='<div id="debugger-container" class="debugger-container"></div>',document.getElementsByTagName("body")[0].appendChild(i),document.getElementsByTagName("body")[0].appendChild(r);var o=document.getElementById("debugger-applog-web");o&&o.addEventListener("click",(function(){window&&window.postMessage({type:"devtool:web:open-draw"},location.origin)}))},e}(),on={autotrack:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/autotrack.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/autotrack.js"},object:"LogAutoTrack"},ab:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/ab.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/ab.js"},object:"LogAb"},stay:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/stay.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/stay.js"},object:"LogStay"},route:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/route.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/route.js"},object:"LogRoute"},tracer:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/tracer.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/tracer.js"},object:"LogTracer"},retry:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/retry.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/retry.js"},object:"LogRetry"},visual:{src:{sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/visual.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/visual.js"},object:"LogVisual"}},an=["ab","autotrack","Stay","store","et","profile","cep","heartbeat","monitor","route","tracer"],sn=function(){function e(e){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroy=!1,this.sdkReady=!1,this.adapters={},this.loadType="base",this.sdkStop=!1,this.name=e,this.hook=new bt,this.remotePlugin=new Map,this.Types=Ft,this.adapters.storage=Pt,this.loadType="full"}return e.usePlugin=function(t,n,i){if(n){for(var r=!1,o=0,a=e.plugins.length;o<a;o++)if(e.plugins[o].name===n){e.plugins[o].plugin=t,e.plugins[o].options=i||{},r=!0;break}r||e.plugins.push({name:n,plugin:t,options:i})}else e.plugins.push({plugin:t})},e.prototype.usePlugin=function(e,t,n){e&&("full"===this.loadType&&an.includes(e)?console.info("your sdk version has "+e+" already ~"):t?"string"==typeof t?this.remotePlugin.get(e)||this.remotePlugin.set(e,{src:t,call:n}):this.remotePlugin.get(e)||this.remotePlugin.set(e,{instance:t}):this.remotePlugin.get(e)||this.remotePlugin.set(e,"sdk"))},e.prototype.init=function(t){var n,i,r=this;try{n=JSON.parse(JSON.stringify(t))}catch(e){n=t}if(this.logger=new Jt(this.name,n.log),this.inited)this.logger.warn("[instance: "+this.name+"], every instance's api: init, can be call only one time!");else if(n&&Et(n))if(n.app_id&&"number"==typeof(i=n.app_id)&&!isNaN(i))if(!n.app_key||function(e){return"string"==typeof e}(n.app_key)){var o=["sg","va","in","ie","ie2"];n.channel_domain||-1!==o.indexOf(n.channel)||(this.logger.warn("your channel: "+n.channel+" is not exist. channel must be one of "+o.join(",")+", use sg instead, please check!!!"),n.channel="sg"),this.spider=new Wt,this.spider.checkSpider(n)?this.logger.warn("The current environment may be a spider, can not report!"):(this.appBridge=new Xt(this,n.enable_native),this.requestManager=new nn(this,n),this.bridgeReport=this.appBridge.bridgeInject(),this.configManager=new $t(this,n),this.debugger=new rn(this,n),this.initConfig=n,this.emit(Ft.Init),this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Init",data:n,level:"info",time:Date.now(),infoType:"cus"}),n.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport||(this.configManager.setAppid(n.app_id),this.eventManager=new Zt,this.tokenManager=new Qt,this.sessionManager=new tn,Promise.all([new Promise((function(e){r.once(Ft.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){r.once(Ft.Start,(function(){e(!0)}))}))]).then((function(){try{e.plugins.reduce((function(e,t){var n=t.plugin,i=t.options,o=Object.assign(r.initConfig,i);r.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Load "+t.name+" Plugin",level:"info",time:Date.now(),infoType:"sdk"});var a=new n;return a.apply(r,o),e.push(a),e}),r.pluginInstances)}catch(e){console.warn("load plugin error, "+e.message),r.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Load Plugin Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}r.sdkReady=!0,r.emit(Ft.Ready),r.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Initialization Completed",time:Date.now(),level:"info",secType:"USER",data:r.configManager.get("user"),infoType:"sdk"}),r.logger.info("appid: "+n.app_id+", userInfo:"+JSON.stringify(r.configManager.get("user"))),r.logger.info("appid: "+n.app_id+", sdk is ready, version is 5.3.0_oversea, you can report now !!!"),n.disable_auto_pv&&(r.disableAutoPageView=!0);try{("full"===r.loadType&&n.enable_ab_test||n.autotrack)&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(e){r.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}r.pageView(),r.on(Ft.TokenChange,(function(e){"webid"===e&&r.pageView(),r.logger.info("appid: "+n.app_id+" token change, new userInfo:"+JSON.stringify(r.configManager.get("user"))),r.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Set UserInfo",time:Date.now(),secType:"USER",level:"info",data:r.configManager.get("user"),infoType:"sdk"})})),r.on(Ft.TokenReset,(function(){r.logger.info("appid: "+n.app_id+" token reset, new userInfo:"+JSON.stringify(r.configManager.get("user"))),r.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Reset UserInfo",time:Date.now(),secType:"USER",level:"info",data:r.configManager.get("user"),infoType:"sdk"})})),r.on(Ft.RouteChange,(function(e){e.init||n.disable_route_report||r.pageView()}))})),this.tokenManager.apply(this,n),this.eventManager.apply(this,n),this.sessionManager.apply(this,n)),this.inited=!0)}else this.logger.warn("app_key param is error, must be string, please check!");else this.logger.warn("app_id param is error, must be number, please check!");else this.logger.warn("init params error,please check")},e.prototype.config=function(e){if(this.inited)if(e&&Et(e)){var t;try{t=JSON.parse(JSON.stringify(t))}catch(n){t=e}if(this.bridgeReport)this.appBridge.setConfig(t);else{t._staging_flag&&1===t._staging_flag&&(this.staging=!0),t.disable_auto_pv&&(this.disableAutoPageView=!0,delete t.disable_auto_pv);var n=pt({},t);if(this.initConfig&&this.initConfig.configPersist){var i=this.configManager.getStore();i&&(n=Object.assign(i,t)),this.configManager.setStore(t)}n.web_id,n.user_unique_id;var r=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&(n[i[r]]=e[i[r]])}return n}(n,["web_id","user_unique_id"]);n.hasOwnProperty("web_id")&&this.emit(Ft.ConfigWebId,n.web_id),n.hasOwnProperty("user_unique_id")&&this.emit(Ft.ConfigUuid,n.user_unique_id),this.configManager.set(r),this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Config",level:"info",time:Date.now(),data:n,infoType:"cus"})}}else console.warn("config params is error, please check");else console.warn("config must be use after function init")},e.prototype.setDomain=function(e){this.configManager&&this.configManager.setDomain(e),this.emit(Ft.ConfigDomain)},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.send=function(){this.start()},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit(Ft.Start),this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Start",level:"info",time:Date.now(),infoType:"cus"}),this.bridgeReport&&(this.pageView(),this.emit(Ft.Ready)))},e.prototype.event=function(e,t){var n=this;try{var i=[];if(Array.isArray(e))e.forEach((function(e){var t=n.processEvent(e[0],e[1]||{});t&&i.push(t)}));else{var r=this.processEvent(e,t);if(!r)return;i.push(r)}this.bridgeReport?i.forEach((function(e){var t=e.event,i=e.params;n.appBridge.onEventV3(t,JSON.stringify(i))})):i.length&&(this.emit(Ft.Event,i),this.emit(Ft.SessionResetTime)),this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Event",level:"info",time:Date.now(),data:e,infoType:"cus"})}catch(e){this.logger.warn("something error, please check"),this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Event Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.beconEvent=function(e,t){if(Array.isArray(e))this.logger.warn("beconEvent not support batch report, please check");else{var n=[],i=this.processEvent(e,t||{});i&&(n.push(i),n.length&&(this.emit(Ft.BeconEvent,n),this.emit(Ft.SessionResetTime)),this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Beacon Event",level:"info",time:Date.now(),data:e,infoType:"sdk"}))}},e.prototype.beaconEvent=function(e,t){this.beconEvent(e,t)},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{if(!e)return console.warn("eventName is null, please check"),null;var n=e;/^event\./.test(e)&&(n=e.slice(6));var i=t;"object"!=J(i)&&(i={}),i.profile?delete i.profile:i.event_index=kt();var r=void 0;return i.local_ms?(r=i.local_ms,delete i.local_ms):r=+new Date,{event:n,params:i,local_time_ms:r,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}catch(n){return this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:n.message,infoType:"sdk"}),{event:e,params:t}}},e.prototype.filterEvent=function(e){this.eventFilter=e},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,n){this.hook.emit(e,t,n)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.stop=function(){this.sdkStop=!0},e.prototype.reStart=function(){this.sdkStop=!1},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){if(void 0===e&&(e={}),this.inited){var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+(this.configManager&&this.configManager.is_first_time||!1)},n=pt(pt({},t),e);this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Report PV",level:"info",time:Date.now(),infoType:"sdk"}),this.event("predefine_pageview",n)}else console.warn("predefinePageView should call after init")},e.prototype.clearEventCache=function(){this.emit(Ft.CleanEvents)},e.prototype.setWebId=function(e){this.config({web_id:""+e})},e.prototype.setNativeAppId=function(e){this.bridgeReport&&this.appBridge.setNativeAppId(e)},e.prototype.getSessionId=function(){return en()},e.prototype.setSessionId=function(e){this.emit(Ft.SessionReset,e)},e.prototype.resetStayDuration=function(e,t,n){this.emit(Ft.ResetStay,{url_path:e,title:t,url:n},Ft.Stay)},e.prototype.resetStayParams=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.emit(Ft.SetStay,{url_path:e,title:t,url:n},Ft.Stay)},e.prototype.getToken=function(e,t){var n=this;if(this.inited){var i=!1,r=function(t){if(!i){i=!0;var r=n.configManager.get().user;return t&&(r.tobid=t,r["diss".split("").reverse().join("")]=t),e(pt({},r))}},o=function(){n.tokenManager.getTobId().then((function(e){r(e)}))};this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute GetToken",level:"info",time:Date.now(),infoType:"cus"}),this.sdkReady?o():(t&&setTimeout((function(){r()}),t),this.on(Ft.Ready,(function(){o()})))}else console.warn("predefinePageView should call after init")},e.prototype.profileSet=function(e){this.bridgeReport?this.appBridge.profileSet(JSON.stringify(e)):this.emit(Ft.ProfileSet,e,Ft.Profile),this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute profileSet",level:"info",time:Date.now(),data:e})},e.prototype.profileSetOnce=function(e){this.bridgeReport?this.appBridge.profileSetOnce(JSON.stringify(e)):this.emit(Ft.ProfileSetOnce,e,Ft.Profile),this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute profileSetOnce",level:"info",time:Date.now(),data:e})},e.prototype.profileIncrement=function(e){this.bridgeReport?this.appBridge.profileIncrement(JSON.stringify(e)):this.emit(Ft.ProfileIncrement,e,Ft.Profile),this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute profileIncrement",level:"info",time:Date.now(),data:e})},e.prototype.profileUnset=function(e){this.bridgeReport?this.appBridge.profileUnset(e):this.emit(Ft.ProfileUnset,e,Ft.Profile),this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute profileUnset",level:"info",time:Date.now(),data:e})},e.prototype.profileAppend=function(e){this.bridgeReport?this.appBridge.profileAppend(JSON.stringify(e)):this.emit(Ft.ProfileAppend,e,Ft.Profile),this.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute profileAppend",level:"info",time:Date.now(),data:e})},e.prototype.setExternalAbVersion=function(e){this.emit(Ft.AbExternalVersion,"string"==typeof e&&e?(""+e).trim():null,Ft.Ab)},e.prototype.getVar=function(e,t,n,i){this.emit(Ft.AbVar,{name:e,defaultValue:t,callback:n,uuid:i},Ft.Ab)},e.prototype.getABconfig=function(e,t){this.emit(Ft.AbConfig,{params:e,callback:t},Ft.Ab)},e.prototype.getAbSdkVersion=function(){return this.configManager.getAbVersion()},e.prototype.onAbSdkVersionChange=function(e){var t=this;return this.emit(Ft.AbVersionChangeOn,e,Ft.Ab),function(){t.emit(Ft.AbVersionChangeOff,e,Ft.Ab)}},e.prototype.offAbSdkVersionChange=function(e){this.emit(Ft.AbVersionChangeOff,e,Ft.Ab)},e.prototype.openOverlayer=function(){this.emit(Ft.AbOpenLayer,"",Ft.Ab)},e.prototype.closeOverlayer=function(){this.emit(Ft.AbCloseLayer,"",Ft.Ab)},e.prototype.getAllVars=function(e){this.emit(Ft.AbAllVars,e,Ft.Ab)},e.prototype.destoryInstace=function(){this.destroy||(this.destroy=!0,this.off(Ft.TokenComplete),this.emit(Ft.DestoryInstance))},e.prototype.destroyInstance=function(){this.destroy||(this.destroy=!0,this.off(Ft.TokenComplete),this.emit(Ft.DestoryInstance))},e.plugins=[],e}(),cn="__rangers_ab_style__";!function(e){e[e.Var=0]="Var",e[e.All=1]="All"}(jt||(jt={}));var ln=function(){function e(){this.fetchStatus="no",this.refreshFetchStatus="no",this.versions=[],this.extVersions=[],this.mulilinkVersions=[],this.enable_multilink=!1,this.enable_ab_visual=!1,this.editMode=!1,this.callbacks=[],this.data={},this.changeListener=new Map,this.readyStatus=!1,this.exposureCache=[]}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,this.config.enable_ab_test){var i=t.enable_multilink,r=t.ab_channel_domain,o=t.enable_ab_visual,a=t.ab_cross,s=t.ab_cookie_domain,c=t.ab_timeout,l=t.disable_auto_ab,u=Bt[t.channel||"sg"]||Bt.sg,f=r||St(u),d=e.adapters.storage;this.cacheStorgae=new d(!1),this.timeout=c||3e3,this.enable_multilink=i,this.enable_ab_visual=o,this.abKey="__tea_sdk_ab_version_"+t.app_id,this.ab_cross=a,this.ab_cookie_domain=s||"",this.fetchUrl=f+"/service/2/abtest_config/",this.reportUrl=this.collect.configManager.getUrl("event"),this.exposureLimit=t.exposure_limit||20,this.ab_batch_time=t.ab_batch_time||500,this.ab_user_mode=t.ab_user_mode||"user_unique_id";var h=this.collect.Types;this.types=h,this.collect.on(h.TokenChange,(function(e){"uuid"===e&&n.readyStatus&&(n.clearCache(),n.fetchAB())})),this.collect.on(h.AbVar,(function(e){var t=e.name,i=e.defaultValue,r=e.callback;n.getVar(t,i,r)})),this.collect.on(h.AbAllVars,(function(e){n.getAllVars(e)})),this.collect.on(h.AbConfig,(function(e){var t=e.params,i=e.callback;n.getABconfig(t,i)})),this.collect.on(h.AbExternalVersion,(function(e){n.setExternalAbVersion(e)})),this.collect.on(h.AbOpenLayer,(function(){n.openOverlayer()})),this.collect.on(h.AbCloseLayer,(function(){n.closeOverlayer()})),this.collect.on(h.AbVersionChangeOn,(function(e){n.changeListener.set(e,e)})),this.collect.on(h.AbVersionChangeOff,(function(e){n.changeListener.get(e)&&n.changeListener.delete(e)})),this.loadMode(),(this.enable_ab_visual||this.enable_multilink)&&this.openOverlayer(this.config.multilink_timeout_ms||500),this.checkLocal(),this.ready("ab"),this.readyStatus||(!l&&this.fetchAB(),this.readyStatus=!0),this.collect.emit(h.AbReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var r in n)i(r)}},e.prototype.loadMode=function(){var e=function(){try{return JSON.parse(atob(window.name))||void 0}catch(e){return}}(),t="";if(e){var n=e.scenario,i=e.href;n?(this.editMode=!0,t=n):!i||-1===i.indexOf("datatester")&&-1===i.indexOf("visual-editor")||(this.editMode=!0,t="visual-editor")}this.enable_ab_visual&&"visual-editor"===t&&this.collect.destoryInstace()},e.prototype.checkLocal=function(){var e=this.getABCache(),t=e.ab_version,n=e.ab_ext_version,i=e.ab_version_multilink,r=(e.data,this.checkFromUrl());r?this.mulilinkVersions.push(r):this.mulilinkVersions=i||[],this.extVersions=n||[],this.versions=t||[];var o=this.versions.concat(this.extVersions);this.enable_multilink&&(o=o.concat(this.mulilinkVersions))},e.prototype.checkFromUrl=function(){var e=zt(window.location.href);return e&&e.vid?e.vid:""},e.prototype.updateVersions=function(){var e=this.extVersions.length?this.versions.concat(this.extVersions):this.versions;this.enable_multilink&&(e=e.concat(this.mulilinkVersions)),this.configVersions(e.join(",")),this.updateABCache(),this.changeListener.size>0&&this.changeListener.forEach((function(t){"function"==typeof t&&t(e)}))},e.prototype.configVersions=function(e){this.collect.configManager.setAbVersion(e)},e.prototype.getVar=function(e,t,n,i){if(!e)throw new Error("variable must not be empty");if(void 0===t)throw new Error("variable no default value");if("function"!=typeof n)throw new Error("callback must be a function");var r={name:e,defaultValue:t,callback:n,type:jt.Var};this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetVar",level:"info",time:Date.now(),data:e,infoType:"cus"}),"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealVar(r,e,i):this.callbacks.push(r)},e.prototype.setAbUuid=function(e,t){this.collect.configManager.setAbUuidCache(e,t)},e.prototype.getRealVar=function(e,t,n){var i=e.name,r=e.defaultValue,o=e.callback,a=this.data;if(a){if(Et(a[i])){var s=a[i].vid;return"$ab_url"===t?this.mulilinkVersions.includes(s)||this.mulilinkVersions.push(s):this.versions.includes(s)||this.versions.push(s),this.setAbUuid(s,n),this.updateVersions(),this.fechEvent(s,t,r),o(a[i].val),void this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetVar, Exposure Experiment "+i,level:"info",time:Date.now(),data:a[i],infoType:"sdk"})}this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GerVar Default Callback",level:"info",time:Date.now(),data:this.data,infoType:"sdk"}),o(r)}else o(r)},e.prototype.getAllVars=function(e){if("function"!=typeof e)throw new Error("callback must be a function");var t={callback:e,type:jt.All};this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetAllVars",level:"info",time:Date.now(),infoType:"cus"}),"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealAllVars(t):this.callbacks.push(t)},e.prototype.getRealAllVars=function(e){(0,e.callback)(this.data?JSON.parse(JSON.stringify(this.data)):{}),this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetAllVars Callback",level:"info",time:Date.now(),data:this.data,infoType:"sdk"})},e.prototype.fechEvent=function(e,t,n){try{if(this.config.disable_track_event)return;if(!e)return;var i=this.collect.configManager.get(),r=i.header,o=i.user,a=this.getABCache(),s=o[this.ab_user_mode]||o.user_unique_id;if(a&&a.uuid&&a.uuid!==s)return;var c={event:"abtest_exposure",ab_sdk_version:""+e,params:JSON.stringify({app_id:this.config.appId,ab_url:"$ab_url"===t?n:window.location.href,data:this.data}),local_time_ms:Date.now()};r.custom=JSON.stringify(r.custom);var l={events:[c],user:o,header:r};this.reportExposure(l,t)}catch(e){this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.reportExposure=function(e,t){var n=this;this.exposureCache.push(e),this.reportTimeout&&clearTimeout(this.reportTimeout),this.exposureCache.length>=this.exposureLimit?this.report(t):this.reportTimeout=setTimeout((function(){n.report(t),clearTimeout(n.reportTimeout)}),this.ab_batch_time)},e.prototype.report=function(e){var t=this;this.collect.requestManager.useRequest({url:this.reportUrl,data:this.exposureCache,timeout:2e4,useBeacon:"$ab_url"===e}),this.exposureCache.forEach((function(e){t.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_EVENT,info:"SDK Report Exposure Event Success",time:Date.now(),data:[e],code:200,status:"success",infoType:"sdk"})})),this.exposureCache=[]},e.prototype.setExternalAbVersion=function(e){this.extVersions=[e],this.updateVersions()},e.prototype.getABconfig=function(e,t){var n=Object.keys(e);n&&n.length&&this.collect.configManager.set(e),this.fetchAB(t)},e.prototype.get=function(e){return this.cacheStorgae.getItem(e)},e.prototype.set=function(e,t){this.cacheStorgae.setItem(e,t),this.collect.configManager.setAbCache(t),this.collect.event("abtest_cache",{env_uuid:this.collect.configManager.get("user").user_unique_id||"",cache:JSON.stringify(t)})},e.prototype.getABCache=function(e){var t={ab_version:[],ab_ext_version:[],ab_version_multilink:[],data:null,timestamp:+new Date,uuid:""};return t=this.get(this.abKey)||t,e?t[e]:t},e.prototype.updateABCache=function(){var e=this.getABCache();e.ab_version_multilink=this.mulilinkVersions,e.ab_ext_version=this.extVersions,e.ab_version=this.versions,e.timestamp=Date.now(),this.set(this.abKey,e)},e.prototype.setAbCache=function(e){var t=this.getABCache();t.data=this.data,t.uuid=e,t.timestamp=Date.now(),this.set(this.abKey,t)},e.prototype.clearCache=function(){this.refreshFetchStatus="ing",this.data={},this.extVersions=[],this.mulilinkVersions=[],this.versions=[],this.collect.configManager.clearAbCache()},e.prototype.openOverlayer=function(e){var t=this;if(function(){if(!document.getElementById(cn)){var e="body { opacity: 0 !important; }",t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id=cn,n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n)}}(),e)var n=setTimeout((function(){t.closeOverlayer(),clearTimeout(n)}),e)},e.prototype.closeOverlayer=function(){var e;(e=document.getElementById(cn))&&e.parentElement.removeChild(e)},e.prototype.fetchComplete=function(e,t){var n=this;try{if(e&&"[object Object]"==Object.prototype.toString.call(e)){this.data=e,this.setAbCache(t);var i=[];Object.keys(e).forEach((function(t){var n=e[t].vid;n&&i.push(n)})),this.versions=this.versions.filter((function(e){return i.includes(e)}));var r=e.$ab_url,o=e.$ab_modification;if(o&&o.val&&this.enable_ab_visual){if(this.collect.destroy)return}else if(r&&this.enable_multilink){this.mulilinkVersions=this.mulilinkVersions.filter((function(e){return i.includes(e)}));var a=r.val,s=r.vid;a&&s&&this.getVar("$ab_url",a,(function(){n.editMode||(a!==window.location.href?setTimeout((function(){if(!n.collect.destroy){var e=""+a;e=-1===e.indexOf("http")?"https://"+e:e,At(e).host!==location.host?e=e+"&vid="+s:window.history.replaceState("","",e),window.location.href=e}}),100):n.closeOverlayer())}))}this.updateVersions()}else this.closeOverlayer();this.callbacks.forEach((function(e){return n[e.type===jt.Var?"getRealVar":"getRealAllVars"](e,"")})),this.callbacks=[]}catch(e){}},e.prototype.fetchAB=function(e){var t=this,n=this.collect.configManager.get(),i={header:pt(pt(pt({aid:this.config.app_id},n.user||{}),n.header||{}),{ab_sdk_version:this.collect.configManager.getAbVersion(),ab_url:window.location.href})};this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Fetch AB Request",level:"info",logType:"fetch",time:Date.now(),data:i,infoType:"sdk"});var r=n.user[this.ab_user_mode]||n.user.user_unique_id;this.collect.requestManager.useRequest({url:this.fetchUrl,data:i,success:function(n){t.fetchStatus="complete",t.refreshFetchStatus="complete";var i=n.data;"success"===n.message?(t.fetchComplete(i,r),e&&e(i)):(t.fetchComplete(null,r),e&&e(null)),t.collect.emit(t.types.AbComplete,i),t.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Fetch AB Request Success",level:"info",logType:"fetch",time:Date.now(),data:i,infoType:"sdk"})},fail:function(){t.fetchStatus="complete",t.refreshFetchStatus="complete",t.fetchComplete(null,r),t.collect.emit(t.types.AbTimeout),e&&e(null),t.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Fetch AB Request Network Error",level:"error",logType:"fetch",time:Date.now(),infoType:"sdk"})},timeout:this.timeout})},e.prototype.filterUrl=function(e){try{var t="";-1!==e.indexOf("&multilink=true")?t="&multilink=true[\0-ÿ]*":-1!==e.indexOf("?multilink=true")&&(t="\\?multilink=true[\0-ÿ]*");var n=new RegExp(t,"g");e=e.replace(n,"")}catch(e){}return e},e}(),un=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(t.event_verify_url)if("string"==typeof t.event_verify_url){if(this.url=t.event_verify_url+"/v1/list_test",this.url){var i=e.Types;e.on(i.SubmitBefore,(function(t){e.requestManager.useBeacon({url:n.url,data:t}),e.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_EVENT,info:"SDK Report ByteIo Verify Request",time:Date.now(),data:t,code:200,status:"success",verifyType:!0})}))}}else console.log("please use correct et_test url")},e}(),fn=function(){function e(e,t){this.maxDuration=432e5,this.aliveDTime=6e4,this.options={aliveName:"predefine_page_alive",params:{}},this.focusState=!0,this.collect=e,this.config=t,this.pageStartTime=Date.now(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,Et(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.hard=this.options.mode&&"hard"===this.options.mode,this.focusState=document.hasFocus()}return e.prototype.setParams=function(e,t,n){this.set_path=e,this.set_url=n,this.set_title=t},e.prototype.enable=function(e,t,n){this.url_path=e,this.url=n,this.title=t,this.disableCallback=this.enablePageAlive(),this.hard&&(this.removeMode=this.hardMode())},e.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},e.prototype.sendEvent=function(e,t){void 0===t&&(t=!1);var n=t?this.aliveDTime:Date.now()-this.sessionStartTime;n<0||n>this.aliveDTime||Date.now()-this.pageStartTime>this.maxDuration||t&&"hidden"===document.visibilityState||this.hard&&!this.focusState||(this.collect.beconEvent(this.options.aliveName,pt({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),duration:n,is_support_visibility_change:Tt(),startTime:this.sessionStartTime,hidden:document.visibilityState,leave:e,mode:this.hard?"hard":"normal",focusState:this.focusState},this.options.params)),this.sessionStartTime=Date.now())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.setUpTimer=function(){var e=this;return this.timerHandler&&clearInterval(this.timerHandler),setInterval((function(){Date.now()-e.sessionStartTime>e.aliveDTime&&e.sendEvent(!1,!0)}),1e3)},e.prototype.visibilitychange=function(){"hidden"===document.visibilityState?this.timerHandler&&(clearInterval(this.timerHandler),this.sendEvent(!1)):"visible"===document.visibilityState&&(this.sessionStartTime=Date.now(),this.timerHandler=this.setUpTimer())},e.prototype.beforeunload=function(){document.hidden||this.sendEvent(!0)},e.prototype.enablePageAlive=function(){var e=this;this.timerHandler=this.setUpTimer();var t=this.visibilitychange.bind(this),n=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),xt(n),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("beforeunload",n),window.removeEventListener("pagehide",n)}},e.prototype.hardMode=function(){var e=this,t=function(){e.timerHandler&&(clearInterval(e.timerHandler),e.sendEvent(!1)),e.focusState=!1},n=function(){e.focusState=!0,e.sessionStartTime=Date.now(),e.timerHandler=e.setUpTimer()};return window.addEventListener("blur",t),window.addEventListener("focus",n),function(){window.removeEventListener("blur",t),window.removeEventListener("focus",n)}},e}(),dn=function(){function e(e,t){var n=this;this.maxDuration=432e5,this.aliveDTime=6e4,this.options={closeName:"predefine_page_close",params:{}},this.focusState=!0,this.visibilitychange=function(){"hidden"===document.visibilityState?n.activeEndTime=Date.now():"visible"===document.visibilityState&&(n.activeEndTime&&(n.totalTime+=n.activeEndTime-n.activeStartTime,n.activeTimes+=1),n.activeEndTime=void 0,n.activeStartTime=Date.now())},this.beforeunload=function(){if(n.totalTime+=(n.activeEndTime||Date.now())-n.activeStartTime,n.config.autotrack)try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:n.totalTime,page_title:document.title||location.pathname}))}catch(e){}n.sendEventPageClose()},this.collect=e,this.config=t,this.maxDuration=t.maxDuration||864e5,this.pageStartTime=Date.now(),Et(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.hard=this.options.mode&&"hard"===this.options.mode,this.focusState=document.hasFocus(),this.resetData()}return e.prototype.setParams=function(e,t,n){this.set_path=e,this.set_url=n,this.set_title=t},e.prototype.resetParams=function(e,t,n){this.url_path=e,this.url=n,this.title=t},e.prototype.enable=function(e,t,n){this.url_path=e,this.url=n,this.title=t,this.disableCallback=this.enablePageClose(),this.hard&&(this.removeMode=this.hardMode())},e.prototype.disable=function(){this.disableCallback()},e.prototype.resetData=function(){this.activeStartTime=void 0===this.activeStartTime?this.pageStartTime:Date.now(),this.activeEndTime=void 0,this.activeTimes=1,this.totalTime=0,this.resetParams(location.pathname,document.title,location.href)},e.prototype.sendEventPageClose=function(){var e=Date.now()-this.pageStartTime;this.totalTime<0||e<0||this.totalTime>=this.maxDuration||this.hard&&!this.focusState||(this.collect.beconEvent(this.options.closeName,pt({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),active_times:this.activeTimes,duration:this.totalTime,total_duration:e,is_support_visibility_change:Tt(),mode:this.hard?"hard":"normal",focusState:this.focusState},this.options.params)),this.pageStartTime=Date.now(),this.resetData())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.enablePageClose=function(){var e=this,t=this.visibilitychange.bind(this),n=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),xt(n),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("beforeunload",n),window.removeEventListener("pagehide",n)}},e.prototype.hardMode=function(){var e=this,t=function(){e.focusState=!1},n=function(){e.focusState=!0};return window.addEventListener("blur",t),window.addEventListener("focus",n),function(){window.removeEventListener("blur",t),window.removeEventListener("focus",n)}},e}(),hn=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,this.config.enable_stay_duration){this.title=document.title||location.pathname,this.url=location.href,this.url_path=location.pathname,this.pageAlive=new fn(e,t),this.pageClose=new dn(e,t);var i=this.collect.Types;this.collect.on(i.ResetStay,(function(e){var t=e.url_path,i=e.title,r=e.url;n.resetStayDuration(t,i,r)})),this.collect.on(i.RouteChange,(function(e){e.init||t.disable_route_report||n.resetStayDuration()})),this.collect.on(i.SetStay,(function(e){var t=e.url_path,i=e.title,r=e.url;n.setStayParmas(t,i,r)})),this.enable(this.url_path,this.title,this.url),this.ready(i.Stay),this.collect.emit(i.StayReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var r in n)i(r)}},e.prototype.enable=function(e,t,n){this.pageAlive.enable(e,t,n),this.pageClose.enable(e,t,n)},e.prototype.disable=function(){this.pageAlive.disable(),this.pageClose.disable()},e.prototype.setStayParmas=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.pageAlive.setParams(e,t,n),this.pageClose.setParams(e,t,n),this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute resetStayParams",level:"info",time:Date.now(),data:{url_path:e,title:t,url:n}})},e.prototype.reset=function(e,t,n){this.disable(),this.enable(e,t,n)},e.prototype.resetStayDuration=function(e,t,n){this.reset(e,t,n),this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"SDK Execute resetStayDuration",level:"info",time:Date.now(),data:{url_path:e,title:t,url:n}})},e}(),pn=function(){function e(){var e=this;this.setInterval=function(){e.clearIntervalFunc=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=1e3);var n,i=Date.now()+t;return n=window.setTimeout((function r(){var o=Date.now()-i;e(),i+=t,n=window.setTimeout(r,Math.max(0,t-o))}),t),function(){window.clearTimeout(n)}}((function(){e.isSessionhasEvent&&e.endCurrentSession()}),e.sessionInterval)},this.clearInterval=function(){e.clearIntervalFunc&&e.clearIntervalFunc()}}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,!t.disable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var i=this.collect.Types;this.collect.on(i.SessionReset,(function(){n.process()}))}},e.prototype.endCurrentSession=function(){this.collect.event("_be_active",{start_time:this.startTime,end_time:this.lastTime,url:window.location.href,referrer:window.document.referrer,title:document.title||location.pathname}),this.isSessionhasEvent=!1,this.startTime=0},e.prototype.process=function(){this.isSessionhasEvent||(this.isSessionhasEvent=!0,this.startTime=+new Date);var e=this.lastTime||+new Date;this.lastTime=+new Date,this.lastTime-e>this.sessionInterval&&(this.clearInterval(),this.endCurrentSession(),this.setInterval())},e}(),vn=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,!this.config.channel_domain&&!t.disable_track_event&&!t.disable_sdk_monitor){this.url=e.configManager.getUrl("event");var i=this.collect.Types;this.collect.on(i.Ready,(function(){n.sdkOnload()})),this.collect.on(i.SubmitError,(function(e){var t=e.type,i=e.eventData,r=e.errorCode;"f_data"===t&&n.sdkError(i,r)}))}},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),n=t.header,i=t.user,r=n.app_id,o=n.app_name,a=n.sdk_version,s=i.web_id,c={events:[{event:"onload",params:JSON.stringify({app_id:r,app_name:o||"",sdk_version:a,sdk_type:"npm",sdk_config:this.config,sdk_desc:"TOC_OVERSEA"}),local_time_ms:Date.now()}],user:{user_unique_id:s},header:{}};setTimeout((function(){e.collect.requestManager.useRequest({url:e.url,data:[c],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})}),16)}catch(e){}},e.prototype.sdkError=function(e,t){var n=this;try{var i=e[0],r=i.user,o=i.header,a=[];e.forEach((function(e){e.events.forEach((function(e){a.push(e)}))}));var s={events:a.map((function(e){return{event:"on_error",params:JSON.stringify({error_code:t,app_id:o.app_id,app_name:o.app_name||"",error_event:e.event,sdk_version:o.sdk_version,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:JSON.stringify(o),user:JSON.stringify(r)}),local_time_ms:Date.now()}})),user:{user_unique_id:r.user_unique_id},header:{}};setTimeout((function(){n.collect.requestManager.useRequest({url:n.url,data:[s],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})}),16)}catch(e){}},e}();function gn(e,t){if(void 0===t&&(t="list"),!e)return!1;if(t&&"list"===t){if(["LI","TR","DL"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaIdx"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-idx"))return!0}else{if(["A","BUTTON"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaContainer"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-container"))return!0}return!1}function mn(e){for(var t=e;t&&!gn(t,"container");){if("HTML"===t.nodeName||"BODY"===t.nodeName)return e;t=t.parentElement}return t||e}function _n(e){var t="";return 3===e.nodeType?t=e.textContent.trim():e.dataset&&e.dataset.hasOwnProperty("teaTitle")||e.hasAttribute("ata-tea-title")?t=e.getAttribute("data-tea-title"):e.hasAttribute("title")?t=e.getAttribute("title"):"INPUT"===e.nodeName&&["button","submit"].includes(e.getAttribute("type"))?t=e.getAttribute("value"):"IMG"===e.nodeName&&e.getAttribute("alt")&&(t=e.getAttribute("alt")),t.slice(0,200)}var yn=function(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0},bn=function(){function e(e,t,n){var i=this;this.statistics=!1,this.pageView=!1,this.clickEvent=function(e){(function(e,t){if(1!==e.nodeType)return!1;if(!t.svg&&function(e){if("svg"===e.tagName.toLowerCase())return!0;for(var t=e.parentElement,n=!1;t;)"svg"===t.tagName.toLowerCase()?(t=null,n=!0):t=t.parentElement;return n}(e))return!1;if(["HTML","BODY"].includes(e.tagName.toUpperCase()))return!1;var n=e;return!("none"===n.style.display||!gn(n,"container")&&!function(e){if(e.children.length){var t=e.children;return![].slice.call(t).some((function(e){return e.children.length>0}))}return!0}(n)&&!t.svg)})(e.target,i.options)&&i.eventHandel({eventType:"dom",eventName:"click"},e)},this.changeEvent=function(e){i.eventHandel({eventType:"dom",eventName:"change"},e)},this.submitEvent=function(e){i.eventHandel({eventType:"dom",eventName:"submit"},e)},this.getPageViewEvent=function(e,t){t&&"pushState"===t&&i.eventHandel({eventType:"dom",eventName:"beat"},pt({beat_type:0},e)),i.eventHandel({eventType:"dom",eventName:"page_view"},e)},this.getPageLoadEvent=function(e){i.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:e})},this.config=n.getConfig().eventConfig,this.collect=t,this.options=e,this.beatTime=e.beat}return e.prototype.init=function(e){this.eventHandel=e;var t=this.config.mode;this.addListener(t)},e.prototype.addListener=function(e){var t=this;if("proxy-capturing"===e){if(this.config.click&&window.document.addEventListener("click",this.clickEvent,!0),this.config.change&&window.document.addEventListener("change",this.changeEvent,!0),this.config.submit&&window.document.addEventListener("submit",this.submitEvent,!0),this.config.pv){this.collect.on("route-change",(function(e){var n=e.config,i=e.name;t.getPageViewEvent(n,i),t.pageView=!0}));var n=setTimeout((function(){t.pageView||(t.getPageViewEvent(t.getDefaultConfig()),t.pageView=!0,clearTimeout(n))}),2e3)}if(this.config.beat){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",(function(){t.beatEvent(t.beatTime)}));var i=0,r=null;window.addEventListener("scroll",(function(){clearTimeout(r),r=setTimeout(o,500),i=document.documentElement.scrollTop||document.body.scrollTop}));var o=function(){(document.documentElement.scrollTop||document.body.scrollTop)==i&&t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(e){}try{var a=window.performance&&window.performance.getEntriesByType("paint");a&&a.length?(new PerformanceObserver((function(e){var n=e.getEntries(),i=n[n.length-1],r=i.renderTime||i.loadTime;t.statistics||(t.getPageLoadEvent(r),t.statistics=!0)})).observe({entryTypes:["largest-contentful-paint"]}),setTimeout((function(){t.statistics||(t.getPageLoadEvent(a[0].startTime||0),t.statistics=!0)}),2e3)):this.getPageLoadEvent(0)}catch(e){this.getPageLoadEvent(0)}}}},e.prototype.removeListener=function(){window.document.removeEventListener("click",this.clickEvent,!0),window.document.removeEventListener("change",this.changeEvent,!0),window.document.removeEventListener("submit",this.submitEvent,!0)},e.prototype.beatEvent=function(e){var t=this;try{var n;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(n=setInterval((function(){t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})}),e)),xt((function(){t.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),t.beatTime&&clearInterval(n)}))}catch(e){}},e.prototype.getDefaultConfig=function(){return{is_html:1,url:location.href,referrer:document.referrer,page_key:location.href,refer_page_key:document.referrer,page_title:document.title||location.pathname,page_manual_key:"",refer_page_manual_key:"",refer_page_title:"",page_path:location.pathname,page_host:location.host}},e}(),En={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},wn=function(){function e(e,t){this.config=e,this.config.eventConfig=Object.assign(this.config.eventConfig,t)}return e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(e){return this.config=e},e}();function kn(e,t,n,i){var r={},o=function(e){if(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return{left:t.left,top:t.top,element_width:n,element_height:i}}}(t),a=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.clientX,i=e.clientY,r=t.left,o=t.top,a=n-r>=0?n-r:0,s=i-o>=0?i-o:0;return{touch_x:Math.floor(a),touch_y:Math.floor(s)}}(e,o),s=o.element_width,c=o.element_height,l=a.touch_x,u=a.touch_y,f=function(e){for(var t=[];null!==e.parentElement;)t.push(e),e=e.parentElement;var n=[],i=[];return t.forEach((function(e){var t=function(e){if(null===e)return{str:"",index:0};var t=0,n=e.parentElement;if(n)for(var i=n.children,r=0;r<i.length&&i[r]!==e;r++)i[r].nodeName===e.nodeName&&t++;return{str:[e.nodeName.toLowerCase(),gn(e,"list")?"[]":""].join(""),index:t}}(e),r=t.str,o=t.index;n.unshift(r),i.unshift(o)})),{element_path:"/"+n.join("/"),positions:i}}(t),d=f.element_path,h=f.positions,p=function(e){var t=mn(e),n=[];return function e(t){var i=_n(t);if(i&&-1===n.indexOf(i)&&n.push(i),t.childNodes.length>0)for(var r=t.childNodes,o=0;o<r.length;o++)8!==r[o].nodeType&&e(r[o])}(t),n}(t),v=window.performance.timing.navigationStart,g=Date.now()-v,m=h.map((function(e){return""+e})),_=null;if(window.TEAVisualEditor&&window.TEAVisualEditor.getOriginXpath&&(_=window.TEAVisualEditor.getOriginXpath({xpath:d,positions:m})),r.element_path=_&&_.xpath||d,r.positions=_&&_.positions||m,i&&!i.text&&(r.texts=p,r.element_title=function(e){var t=mn(e),n="";return function e(t){var i=_n(t);if(i&&(n+=i),t.childNodes.length>0)for(var r=t.childNodes,o=0;o<r.length;o++)3===r[o].nodeType&&e(r[o])}(t),n}(t)),r.element_id=t.getAttribute("id")||"",r.element_class_name=t.getAttribute("class")||"",r.element_type=t.nodeType,r.element_width=Math.floor(s),r.element_height=Math.floor(c),r.touch_x=l,r.touch_y=u,r.page_manual_key="",r.elememt_manual_key="",r.since_page_start_ms=g,r.page_start_ms=v,r.page_path=location.pathname,r.page_host=location.host,n.track_attr&&function(e,t){return!!function(e,t){if("string"==typeof t)return yn(e,t);if(wt(t)){for(var n=!1,i=0;i<t.length;i++)if(yn(e,t[i])){n=!0;break}return n}}(e,t)}(t,n.track_attr)){var y=function(e,t){var n={};if("string"==typeof t)yn(e,t)&&(n.attrs=e.getAttribute(t));else if(wt(t))for(var i=0;i<t.length;i++)yn(e,t[i])&&(n[t[i]]=e.getAttribute(t[i]));return n}(t,n.track_attr);for(var b in y)r[b]=y[b]}var E=mn(t);return"A"===E.tagName&&(r.href=E.getAttribute("href")),"IMG"===t.tagName&&(r.src=t.getAttribute("src")),r}var Sn=function(e,t,n,i,r){return pt(pt({event:e},kn(t,n,i,r)),{is_html:1,page_key:window.location.href,page_title:document.title})},xn=function(){function e(e,t){this.ignore={text:!0},this.initConfig=e,this.options=t,this.eventName=t&&"tea"===t.custom?{click:"__bav_click",page:"__bav_page",beat:"__bav_beat",static:"__bav_page_statistics",exposure:"__bav_page_exposure"}:{click:"bav2b_click",page:"bav2b_page",beat:"bav2b_beat",static:"bav2b_page_statistics",exposure:"bav2b_exposure"},t&&!0===t.text&&(this.ignore.text=!1),t&&t.exposure&&t.exposure.eventName&&(this.eventName.exposure=t.exposure.eventName)}return e.prototype.handleEvent=function(e,t){try{if(function(e){for(var t=e;t&&t.parentNode;){if(t.hasAttribute("data-tea-ignore"))return!0;if("HTML"===t.nodeName||"body"===t.nodeName)return!1;t=t.parentNode}return!1}(e.target))return null;var n="bav2b_click";switch(t){case"click":return n=this.eventName.click,Sn(n,e,e.target,this.options,this.ignore);case"exposure":return n=this.eventName.exposure,Sn(n,e,e.target,this.options,this.ignore);case"change":return pt(pt({},Sn(n="bav2b_change",e,e.target,this.options)),function(e,t){try{if("bav2b_change"===e)return t.hasAttribute("data-tea-track")?{value:t.value}:{}}catch(e){return{}}}(n,e.target));case"submit":return Sn(n="bav2b_submit",e,e.target,this.options)}}catch(e){return console.error(e),null}},e.prototype.handleViewEvent=function(e){e.event=this.eventName.page,e.page_title=document.title,e.page_total_width=window.innerWidth,e.page_total_height=window.innerHeight;try{var t=window.sessionStorage.getItem("_tea_cache_duration");if(t){var n=JSON.parse(t);e.refer_page_duration_ms=n?n.duration:""}e.scroll_width=document.documentElement.scrollLeft?document.documentElement.scrollLeft+window.innerWidth:window.innerWidth,e.scroll_height=document.documentElement.scrollTop?document.documentElement.scrollTop+window.innerHeight:window.innerHeight,e.page_start_ms=window.performance.timing.navigationStart}catch(e){console.log("page event error "+JSON.stringify(e))}return e},e.prototype.handleStatisticsEvent=function(e){var t={};t.event=this.eventName.static,t.is_html=1,t.page_key=location.href,t.refer_page_key=document.referrer||"",t.page_title=document.title,t.page_manual_key=this.initConfig.autotrack.page_manual_key||"",t.refer_page_manual_key="";try{var n=e.lcp,i=window.performance.timing,r=i.loadEventEnd-i.navigationStart;t.page_init_cost_ms=parseInt(n||(r>0?r:0)),t.page_start_ms=i.navigationStart}catch(e){console.log("page_statistics event error "+JSON.stringify(e))}return t},e.prototype.handleBeadtEvent=function(e){e.event=this.eventName.beat,e.page_key=window.location.href,e.is_html=1,e.page_title=document.title,e.page_manual_key=this.initConfig.autotrack.page_manual_key||"";try{e.page_viewport_width=window.innerWidth,e.page_viewport_height=window.innerHeight,e.page_total_width=document.documentElement.scrollWidth,e.page_total_height=document.documentElement.scrollHeight,e.scroll_width=document.documentElement.scrollLeft+window.innerWidth,e.scroll_height=document.documentElement.scrollTop+window.innerHeight,e.since_page_start_ms=Date.now()-window.performance.timing.navigationStart,e.page_start_ms=window.performance.timing.navigationStart}catch(e){console.log("beat event error "+JSON.stringify(e))}return e},e}(),Tn=function(){function e(e){this.collect=e,this.eventNameList=["report_click_event","report_change_event","report_submit_event","report_exposure_event","report_page_view_event","report_page_statistics_event","report_beat_event"]}return e.prototype.send=function(e,t){var n=e.eventSend,i=t.event;delete t.event,n&&"becon"===n?this.collect.beconEvent(i,t):this.collect.event(i,t)},e.prototype.get=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"GET"},t);fetch(e,n)},e.prototype.post=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"POST"},t);fetch(e,n)},e}(),An={},zn=[];function Cn(e,t,n,i){var r=e&&e.source||window.opener||window.parent,o=e&&e.origin||i||"*",a={type:t,payload:n};r.postMessage(JSON.stringify(a),o)}function Dn(e){if(zn.some((function(e){return"*"===e}))||zn.some((function(t){return e.origin.indexOf(t)>-1}))){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(e){t=void 0}if(!t)return;var n=t.type,i=t.payload;An[n]&&An[n].forEach((function(t){"function"==typeof t&&t(e,i)}))}}var Rn=!1;function On(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.appId=t.app_id;var n,i,r,o,a=t.channel_domain,s="";if((n=["*"]).length&&n.forEach((function(e){zn.push(e)})),a){var c,l="";try{var u=window.performance.getEntriesByType("resource");if(u&&u.length&&(u.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(l=e.name)})),l&&(c=l.split("/"))&&c.length)){s="https:/";for(var f=2;f<c.length&&f!==c.length-1;f++)s=s+"/"+c[f];if(s&&s.indexOf("/5.0")){var d=s.split("/5.0");s=d[0]||s}}}catch(e){}}delete(i=pt({},t)).filter,(window.opener||window.parent).postMessage({type:"tea:sdk:info",config:i,version:"5.3.0_oversea"},"*"),window.addEventListener("message",Dn,!1);try{o=function(n){var i=n.data.app_id;i&&i!==t.app_id||function(e){var t,n,i,r,o=e.event,a=e.editorUrl,s=e.autoTrackInstance;Rn||(Rn=!0,t=a,n=function(){Cn(o,"editorScriptloadSuccess"),s.destroy()},i=function(){o&&Cn(o,"editorScriptloadError"),Rn=!1},(r=document.createElement("script")).src=t,r.onerror=function(){i()},r.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(r))}({event:n,editorUrl:"https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/log-sdk/collect/heatmap-core.js?query="+Date.now(),autoTrackInstance:e})},An[r="tea:openHeatMapCore"]=An[r]||[],An[r].push(o)}catch(e){console.log("openHeatMapCore error")}}var In,Mn=function(){function e(e){this._instance=null,this._intersection=e,this.init()}return e.prototype.init=function(){var e=this;this._instance=new MutationObserver((function(t){t.forEach((function(t){"attributes"===t.type&&e.attributeChangeObserve(t),"childList"===t.type&&e.modifyNodeObserve(t)}))})),this._instance.observe(document.body,{childList:!0,attributes:!0,subtree:!0,attributeOldValue:!1})},e.prototype.attributeChangeObserve=function(e){e.target.hasAttribute("data-exposure")?this.exposureAdd(e,"mutation"):this.exposureRemove(e)},e.prototype.modifyNodeObserve=function(e){var t=this;Array.prototype.forEach.call(e.addedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureAdd(e,"intersect"),t.mapChild(e,t.exposureAdd)})),Array.prototype.forEach.call(e.removedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureRemove(e),t.mapChild(e,t.exposureRemove)}))},e.prototype.mapChild=function(e,t){var n=this;1===e.nodeType&&e.children.length&&Array.prototype.forEach.call(e.children,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t(e),n.mapChild(e,t)}))},e.prototype.exposureAdd=function(e,t){this._intersection.exposureAdd(e,t)},e.prototype.exposureRemove=function(e){this._intersection.exposureRemove(e)},e._exposure_observer=null,e}(),Pn=function(){function e(t,n){this.count=1,this.instance=this.buildObserver(),this.observeMap=e._observer_map,t.autotrack.exposure.ratio?this.Ratio=t.autotrack.exposure.ratio:0===t.autotrack.exposure.ratio?this.Ratio=0:this.Ratio=.5,this.EventHandle=n}return e.prototype.buildObserver=function(){var t=this;if(!e._observer_instance)return IntersectionObserver&&(e._observer_instance=new IntersectionObserver((function(e){e.forEach((function(e){t.observeMap.get(e.target._observeId)&&t.exposureEvent(e)}))}),{threshold:[.01,.25,.5,.75,1]})),e._observer_instance},e.prototype.exposureAdd=function(e,t){var n=e;"mutation"===t&&(n=e.target);var i=n._observeId;if(i||this.observeMap.has(i)){if(!1===n.visible){var r=n.getBoundingClientRect(),o=r.top,a=r.left,s=r.right,c=r.bottom;o>=0&&c<=window.innerHeight&&a>=0&&s<=window.innerWidth&&(n.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e))}}else n._observeId=this.count,n.visible=!1,this.observeMap.set(this.count,n),this.observe(n),this.count++},e.prototype.exposureRemove=function(e){this.observeMap.has(e._observeId)&&(this.observeMap.delete(e._observeId),this.unobserve(e))},e.prototype.exposureEvent=function(e){if(e.intersectionRatio>=this.Ratio&&e.isIntersecting){if("0"===e.target.style.opacity||"hidden"===e.target.style.visibility)return;if(!0===e.target.visible)return;e.target.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e)}else e.target.visible=!1},e.prototype.observe=function(e){this.instance.observe(e)},e.prototype.unobserve=function(e){this.instance.unobserve(e)},e._observer_instance=null,e._observer_map=new Map,e}(),Nn=function(){function e(e,t){e.autotrack&&e.autotrack.exposure&&(this._intersection=new Pn(e,t),this._observer=new Mn(this._intersection),this.initObserver())}return e.prototype.initObserver=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),(function(t){e._intersection.exposureAdd(t,"intersect")}))},e}(),Un={hashTag:!1,impr:!1},Bn=function(){function e(){}return e.prototype.apply=function(e,t){if(this.autoTrackStart=!1,this.collect=e,this.config=t,t.autotrack){var n=e.Types;t.autotrack&&t.autotrack.collect_url&&!t.autotrack.collect_url()||(this.ready(n.Autotrack),this.collect.emit(n.AutotrackReady))}},e.prototype.ready=function(e){this.collect.set(e);var t=this.config.autotrack;t="object"==J(t)?t:{},t=Object.assign(Un,t),this.destroyed=!1,this.options=t,this.Config=new wn(En,this.options),this.Exposure=new Nn(this.config,this.handle.bind(this)),this.Listener=new bn(t,this.collect,this.Config),this.EventHandle=new xn(this.config,t),this.Request=new Tn(this.collect),this.autoTrackStart=!0,this.init(),On(this,this.config)},e.prototype.init=function(){this.Listener.init(this.handle.bind(this)),"base"===this.collect.loadType&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")},e.prototype.handle=function(e,t){"dom"===e.eventType&&this.handleDom(e,t)},e.prototype.handleDom=function(e,t){try{var n=e.eventName;if("click"===n||"exposure"===n||"change"===n||"submit"===n){var i=this.EventHandle.handleEvent(t,n);null!==i&&this.Request.send({eventType:"custom",eventName:"report_"+n+"_event",extra:{methods:"GET"}},i)}else if("page_view"===n||"page_statistics"===n){var r;r="page_view"===n?this.EventHandle.handleViewEvent(t):this.EventHandle.handleStatisticsEvent(t),this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"}},r)}else if("beat"===n){var o=this.EventHandle.handleBeadtEvent(t),a=e.eventSend;this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"},eventSend:a},o)}}catch(e){console.log("handel dom event error "+JSON.stringify(e))}},e.prototype.destroy=function(){if(!this.autoTrackStart)return console.warn("engine is undefined, make sure you have called autoTrack.start()");this.autoTrackStart=!1,this.Listener.removeListener()},e}();!function(e){e.Net="net",e.FailNet="f_net",e.FailData="f_data"}(In||(In={}));var Gn={pv:["predefine_pageview"],sdk:["_be_active","predefine_page_alive","predefine_page_close","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append"],autotrack:["bav2b_click","bav2b_page","bav2b_beat","bav2b_page_statistics","__bav_click","__bav_page","__bav_beat","__bav_page_statistics"]},Ln=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.ready=t.app_id&&t.enable_tracer&&!t.disable_track_event,this.ready){this.limit={pv:1,sdk:3,autotrack:3,log:3},this.errorCode={f_net:0,f_data:0},this.tracerCache=new Map,this.collect=e,this.appid=t.app_id,this.reportUrl=e.configManager.getUrl("event");var i=this.collect.Types;e.adapters.fetch,this.collect.on(i.Event,(function(e){wt(e)?e.forEach((function(e){n.addCount("log")})):n.addCount("log")})),this.collect.on(i.SubmitError,(function(e){var t=e.type,i=e.eventDate,r=e.errorCode,o=e.response;n.addErrorCount(i,t,r,o)})),this.listener(),this.collect.emit(i.TracerReady)}},e.prototype.addCount=function(e,t,n){void 0===t&&(t="net"),void 0===n&&(n=1);try{this.tracerCache||(this.tracerCache=new Map);var i=void 0;if(this.tracerCache.has(e))(r=this.tracerCache.get(e)).has(t)?(i=r.get(t).params.count,i++,r.set(t,this.processTracer(i,e,t))):(i=n,r.set(t,this.processTracer(n,e,t)));else{var r=new Map;i=n,r.set(t,this.processTracer(n,e,t)),this.tracerCache.set(e,r)}"net"===t&&i>=this.limit[e]&&this.report(!1)}catch(e){console.log(e)}},e.prototype.addErrorCount=function(e,t,n,i){var r=this;try{if(e&&e.length){var o=e[0].events;o&&o.length&&("f_data"===t?(i&&i.hasOwnProperty("sc")?this.addCount("log",t,o.length-i.sc):this.addCount("log",t,o.length),this.errorCode[t]=n):o.forEach((function(e){var i="log";for(var o in Gn)if(-1!==Gn[o].indexOf(e.event)){i=o;break}r.addCount(i,t,1),r.errorCode[t]=n})))}}catch(e){}},e.prototype.report=function(e){if(this.tracerCache){var t=[];this.tracerCache.forEach((function(e){console.log(e),e.forEach((function(e){t.push(e)}))})),t&&t.length&&this.sendTracer(t,e)}},e.prototype.sendTracer=function(e,t){try{var n=this.collect.eventManager.merge(e);this.collect.requestManager.useRequest({url:this.reportUrl,data:n,useBeacon:t}),this.tracerCache=null}catch(e){}},e.prototype.processTracer=function(e,t,n){try{var i={count:e,state:n,key:t,params_for_special:"applog_trace",aid:this.appid,platform:"web",_staging_flag:1,sdk_version:"5.3.0_oversea"};"f_net"!==n&&"f_data"!==n||(i.errorCode=this.errorCode[n]);var r=this.collect.processEvent("applog_trace",i);if(r&&r.event)return delete r.is_bav,r}catch(e){console.warn("something error")}},e.prototype.listener=function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.leavePage()})),xt((function(){e.leavePage()}))},e.prototype.leavePage=function(){this.report(!0)},e}(),jn="undefined"!=typeof window?(window.LogPluginObject||(window.LogPluginObject={}),window.LogPluginObject):null,Fn=function(){function e(){}return e.prototype.apply=function(e,t){this._plugin={},this.config=t,this.collect=e,this.channel=t.channel||"cn",this.loadExtend()},e.prototype.loadExtend=function(){var e=this;try{this.collect.remotePlugin.forEach((function(t,n){if("sdk"===t)if(on.hasOwnProperty(n)){var i=on[n].object,r=""+on[n].src[e.channel];e.exist(n,i,r)}else console.warn("your "+n+" is not exist,please check plugin name");else"object"==J(t)&&(t.src?e.exist(n,t.call,t.src):e.process(n,t.instance,"INSTANCE"))}))}catch(e){this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message}),console.log("load extend error")}},e.prototype.exist=function(e,t,n){var i=this;jn[t]?(this.process(e,jn[t]),console.log("already has "+e+" plugin~")):this.loadPlugin(e,n,(function(){i.process(e,jn[t]),console.log(" %c %s %s %s","color: yellow; background-color: black;","–","load plugin:"+e+" success","-")}),(function(){console.log(" %c %s %s %s","color: red; background-color: yellow;","–","load plugin:"+e+" error","-")}))},e.prototype.process=function(e,t,n){try{if(n){var i=new t;i.apply&&i.apply(this.collect,this.config),console.log("excude "+e+" success")}else t&&t(this.collect,this.config)}catch(t){this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),console.log("excude "+e+" error, message:"+t.message)}},e.prototype.loadPlugin=function(e,t,n,i){var r=this;try{var o=document.createElement("script");o.src=t,this._plugin[e]||(this._plugin[e]=[]),this._plugin[e].push(n),o.onerror=function(){i(t)},o.onload=function(){r._plugin[e].forEach((function(e){e()}))},document.getElementsByTagName("head")[0].appendChild(o)}catch(e){this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message})}},e}(),Kn=function(){function e(){this.autotrack=!1,this.spa=!1,this.cache={},this.allowHash=!1}return e.prototype.apply=function(e,t){if(t.spa||t.autotrack){var n=e.Types;this.collect=e,this.config=t,this.appid=t.app_id,this.allowHash=t.allow_hash,this.fncArray=new Map,this.setKey(),this.setLocation(),this.hack(),this.init(),this.listener(),e.emit(n.RouteReady)}},e.prototype.setKey=function(){var e=this.collect.adapters.storage;this.storage=new e(!1),this.cache_key="__tea_cache_refer_"+this.appid,this.cache={refer_key:"",refer_title:document.title||location.pathname,refer_manual_key:"",routeChange:!1},this.config.autotrack&&"object"==J(this.config.autotrack)&&this.config.autotrack.page_manual_key&&(this.cache.refer_manual_key=this.config.autotrack.page_manual_key),this.storage.setItem(this.cache_key,this.cache)},e.prototype.hack=function(){var e=this,t=window.history.pushState;history.pushState=function(n){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];"function"==typeof history.onpushstate&&history.onpushstate({state:n});var o=t.call.apply(t,gt([history,n],i));if(e.collect.sdkStop||e.collect.destroy)return o;if(!(e.lastLocation===location.href||e.config.disable_spa_query&&e.pathEquel())){var a=e.getPopStateChangeEventData();return e.setReferCache(e.lastLocation),e.lastLocation=location.href,e.sendPv(a,"pushState"),o}};var n=history.replaceState;history.replaceState=function(t){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];"function"==typeof history.onreplacestate&&history.onreplacestate({state:t});var o=n.call.apply(n,gt([history,t],i));if(e.collect.sdkStop||e.collect.destroy)return o;if(!(e.lastLocation===location.href||e.config.disable_spa_query&&e.pathEquel())){var a=e.getPopStateChangeEventData();return e.setReferCache(e.lastLocation),e.lastLocation=location.href,e.sendPv(a),o}}},e.prototype.setLocation=function(){"undefined"!=typeof window&&(this.lastLocation=window.location.href)},e.prototype.getLocation=function(){return this.lastLocation},e.prototype.pathEquel=function(){try{return new URL(this.lastLocation).origin+new URL(this.lastLocation).pathname===new URL(location.href).origin+new URL(location.href).pathname}catch(e){return!1}},e.prototype.init=function(){var e=this.getPopStateChangeEventData();this.collect.emit("route-change",{config:e,init:!0})},e.prototype.listener=function(){var e=this;window.addEventListener("hashchange",(function(t){if(!e.collect.sdkStop&&!e.collect.destroy&&e.lastLocation!==window.location.href&&(!e.config.disable_spa_query||!e.pathEquel())&&e.allowHash){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var n=e.getPopStateChangeEventData();e.sendPv(n)}})),window.addEventListener("popstate",(function(t){if(!e.collect.sdkStop&&!e.collect.destroy&&!(e.lastLocation===window.location.href||e.config.disable_spa_query&&e.pathEquel())){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var n=e.getPopStateChangeEventData();e.sendPv(n)}}))},e.prototype.getPopStateChangeEventData=function(){var e=this.pageConfig();return e.is_back=0,e},e.prototype.pageConfig=function(){try{var e,t=this.storage.getItem(this.cache_key)||{},n=this.storage.getItem("__tea_cache_first_"+this.appid);return e=!n||1!=n,{is_html:1,url:location.href,referrer:this.handleRefer(),page_key:location.href,refer_page_key:this.handleRefer(),page_title:document.title||location.pathname,page_manual_key:this.config.autotrack&&this.config.autotrack.page_manual_key||"",refer_page_manual_key:t&&t.refer_manual_key||"",refer_page_title:t&&t.refer_title||"",page_path:location.pathname,page_host:location.host,is_first_time:""+e}}catch(t){return this.collect.emit(yt.DEBUGGER_MESSAGE,{type:yt.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),{}}},e.prototype.sendPv=function(e,t){this.collect.emit("route-change",{config:e,init:!1})},e.prototype.handleRefer=function(){var e="";try{var t=this.storage.getItem()||{};e=t.routeChange?t.refer_key:this.collect.configManager.get("referrer")}catch(t){e=document.referrer}return e},e.prototype.setReferCache=function(e){var t=this.storage.getItem(this.cache_key)||{};t.refer_key=e,t.routeChange=!0,this.storage.setItem(this.cache_key,t)},e}();sn.usePlugin(Fn,"extend"),sn.usePlugin(Ln,"tracer"),sn.usePlugin(ln,"ab"),sn.usePlugin(hn,"stay"),sn.usePlugin(Bn,"autotrack"),sn.usePlugin(un,"et"),sn.usePlugin(pn,"heartbeat"),sn.usePlugin(vn,"monitor"),sn.usePlugin(Kn,"route"),sn.usePlugin(Ln,"tracer"),new sn("default");var Hn=function(e,t){return e&&function(e){return"object"===J(e)&&null!==e}(e)?t.reduce((function(t,n){return t[n]=e[n],t}),{}):e},Vn=new sn("cookie_banner_tea_ui"),qn=!1;function $n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(qn&&Vn){var n="".concat(location.protocol,"//").concat(location.host).concat(location.pathname);Vn.event(e,S({page_url:n,host:location.host,user_agent:navigator.userAgent,referrer:n},t))}}var Jn=function(){this.__data__=[],this.size=0};var Wn=function(e,t){return e===t||e!=e&&t!=t};var Xn=function(e,t){for(var n=e.length;n--;)if(Wn(e[n][0],t))return n;return-1},Zn=Array.prototype.splice;var Yn=function(e){var t=this.__data__,n=Xn(t,e);return!(n<0)&&(n==t.length-1?t.pop():Zn.call(t,n,1),--this.size,!0)};var Qn=function(e){var t=this.__data__,n=Xn(t,e);return n<0?void 0:t[n][1]};var ei=function(e){return Xn(this.__data__,e)>-1};var ti=function(e,t){var n=this.__data__,i=Xn(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};function ni(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}ni.prototype.clear=Jn,ni.prototype.delete=Yn,ni.prototype.get=Qn,ni.prototype.has=ei,ni.prototype.set=ti;var ii=ni;var ri=function(){this.__data__=new ii,this.size=0};var oi=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var ai=function(e){return this.__data__.get(e)};var si=function(e){return this.__data__.has(e)},ci="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function li(e,t){return e(t={exports:{}},t.exports),t.exports}var ui="object"==J(ci)&&ci&&ci.Object===Object&&ci,fi="object"==("undefined"==typeof self?"undefined":J(self))&&self&&self.Object===Object&&self,di=ui||fi||Function("return this")(),hi=di.Symbol,pi=Object.prototype,vi=pi.hasOwnProperty,gi=pi.toString,mi=hi?hi.toStringTag:void 0;var _i=function(e){var t=vi.call(e,mi),n=e[mi];try{e[mi]=void 0;var i=!0}catch(e){}var r=gi.call(e);return i&&(t?e[mi]=n:delete e[mi]),r},yi=Object.prototype.toString;var bi=function(e){return yi.call(e)},Ei=hi?hi.toStringTag:void 0;var wi=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ei&&Ei in Object(e)?_i(e):bi(e)};var ki=function(e){var t=J(e);return null!=e&&("object"==t||"function"==t)};var Si,xi=function(e){if(!ki(e))return!1;var t=wi(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ti=di["__core-js_shared__"],Ai=(Si=/[^.]+$/.exec(Ti&&Ti.keys&&Ti.keys.IE_PROTO||""))?"Symbol(src)_1."+Si:"";var zi=function(e){return!!Ai&&Ai in e},Ci=Function.prototype.toString;var Di=function(e){if(null!=e){try{return Ci.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ri=/^\[object .+?Constructor\]$/,Oi=Function.prototype,Ii=Object.prototype,Mi=Oi.toString,Pi=Ii.hasOwnProperty,Ni=RegExp("^"+Mi.call(Pi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ui=function(e){return!(!ki(e)||zi(e))&&(xi(e)?Ni:Ri).test(Di(e))};var Bi=function(e,t){return null==e?void 0:e[t]};var Gi=function(e,t){var n=Bi(e,t);return Ui(n)?n:void 0},Li=Gi(di,"Map"),ji=Gi(Object,"create");var Fi=function(){this.__data__=ji?ji(null):{},this.size=0};var Ki=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hi=Object.prototype.hasOwnProperty;var Vi=function(e){var t=this.__data__;if(ji){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Hi.call(t,e)?t[e]:void 0},qi=Object.prototype.hasOwnProperty;var $i=function(e){var t=this.__data__;return ji?void 0!==t[e]:qi.call(t,e)};var Ji=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ji&&void 0===t?"__lodash_hash_undefined__":t,this};function Wi(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Wi.prototype.clear=Fi,Wi.prototype.delete=Ki,Wi.prototype.get=Vi,Wi.prototype.has=$i,Wi.prototype.set=Ji;var Xi=Wi;var Zi=function(){this.size=0,this.__data__={hash:new Xi,map:new(Li||ii),string:new Xi}};var Yi=function(e){var t=J(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Qi=function(e,t){var n=e.__data__;return Yi(t)?n["string"==typeof t?"string":"hash"]:n.map};var er=function(e){var t=Qi(this,e).delete(e);return this.size-=t?1:0,t};var tr=function(e){return Qi(this,e).get(e)};var nr=function(e){return Qi(this,e).has(e)};var ir=function(e,t){var n=Qi(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function rr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}rr.prototype.clear=Zi,rr.prototype.delete=er,rr.prototype.get=tr,rr.prototype.has=nr,rr.prototype.set=ir;var or=rr;var ar=function(e,t){var n=this.__data__;if(n instanceof ii){var i=n.__data__;if(!Li||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new or(i)}return n.set(e,t),this.size=n.size,this};function sr(e){var t=this.__data__=new ii(e);this.size=t.size}sr.prototype.clear=ri,sr.prototype.delete=oi,sr.prototype.get=ai,sr.prototype.has=si,sr.prototype.set=ar;var cr=sr,lr=function(){try{var e=Gi(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var ur=function(e,t,n){"__proto__"==t&&lr?lr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var fr=function(e,t,n){(void 0!==n&&!Wn(e[t],n)||void 0===n&&!(t in e))&&ur(e,t,n)};var dr=function(e){return function(t,n,i){for(var r=-1,o=Object(t),a=i(t),s=a.length;s--;){var c=a[e?s:++r];if(!1===n(o[c],c,o))break}return t}}(),hr=li((function(e,t){var n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,r=i&&i.exports===n?di.Buffer:void 0,o=r?r.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,i=o?o(n):new e.constructor(n);return e.copy(i),i}})),pr=di.Uint8Array;var vr=function(e){var t=new e.constructor(e.byteLength);return new pr(t).set(new pr(e)),t};var gr=function(e,t){var n=t?vr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var mr=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t},_r=Object.create,yr=function(){function e(){}return function(t){if(!ki(t))return{};if(_r)return _r(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var br=function(e,t){return function(n){return e(t(n))}},Er=br(Object.getPrototypeOf,Object),wr=Object.prototype;var kr=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||wr)};var Sr=function(e){return"function"!=typeof e.constructor||kr(e)?{}:yr(Er(e))};var xr=function(e){return null!=e&&"object"==J(e)};var Tr=function(e){return xr(e)&&"[object Arguments]"==wi(e)},Ar=Object.prototype,zr=Ar.hasOwnProperty,Cr=Ar.propertyIsEnumerable,Dr=Tr(function(){return arguments}())?Tr:function(e){return xr(e)&&zr.call(e,"callee")&&!Cr.call(e,"callee")},Rr=Dr,Or=Array.isArray;var Ir=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var Mr=function(e){return null!=e&&Ir(e.length)&&!xi(e)};var Pr=function(e){return xr(e)&&Mr(e)};var Nr=function(){return!1},Ur=li((function(e,t){var n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,r=i&&i.exports===n?di.Buffer:void 0,o=(r?r.isBuffer:void 0)||Nr;e.exports=o})),Br=Function.prototype,Gr=Object.prototype,Lr=Br.toString,jr=Gr.hasOwnProperty,Fr=Lr.call(Object);var Kr=function(e){if(!xr(e)||"[object Object]"!=wi(e))return!1;var t=Er(e);if(null===t)return!0;var n=jr.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Lr.call(n)==Fr},Hr={};Hr["[object Float32Array]"]=Hr["[object Float64Array]"]=Hr["[object Int8Array]"]=Hr["[object Int16Array]"]=Hr["[object Int32Array]"]=Hr["[object Uint8Array]"]=Hr["[object Uint8ClampedArray]"]=Hr["[object Uint16Array]"]=Hr["[object Uint32Array]"]=!0,Hr["[object Arguments]"]=Hr["[object Array]"]=Hr["[object ArrayBuffer]"]=Hr["[object Boolean]"]=Hr["[object DataView]"]=Hr["[object Date]"]=Hr["[object Error]"]=Hr["[object Function]"]=Hr["[object Map]"]=Hr["[object Number]"]=Hr["[object Object]"]=Hr["[object RegExp]"]=Hr["[object Set]"]=Hr["[object String]"]=Hr["[object WeakMap]"]=!1;var Vr=function(e){return xr(e)&&Ir(e.length)&&!!Hr[wi(e)]};var qr=function(e){return function(t){return e(t)}},$r=li((function(e,t){var n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,r=i&&i.exports===n&&ui.process,o=function(){try{var e=i&&i.require&&i.require("util").types;return e||r&&r.binding&&r.binding("util")}catch(e){}}();e.exports=o})),Jr=$r&&$r.isTypedArray,Wr=Jr?qr(Jr):Vr;var Xr=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},Zr=Object.prototype.hasOwnProperty;var Yr=function(e,t,n){var i=e[t];Zr.call(e,t)&&Wn(i,n)&&(void 0!==n||t in e)||ur(e,t,n)};var Qr=function(e,t,n,i){var r=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],c=i?i(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),r?ur(n,s,c):Yr(n,s,c)}return n};var eo=function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i},to=/^(?:0|[1-9]\d*)$/;var no=function(e,t){var n=J(e);return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&to.test(e))&&e>-1&&e%1==0&&e<t},io=Object.prototype.hasOwnProperty;var ro=function(e,t){var n=Or(e),i=!n&&Rr(e),r=!n&&!i&&Ur(e),o=!n&&!i&&!r&&Wr(e),a=n||i||r||o,s=a?eo(e.length,String):[],c=s.length;for(var l in e)!t&&!io.call(e,l)||a&&("length"==l||r&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||no(l,c))||s.push(l);return s};var oo=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},ao=Object.prototype.hasOwnProperty;var so=function(e){if(!ki(e))return oo(e);var t=kr(e),n=[];for(var i in e)("constructor"!=i||!t&&ao.call(e,i))&&n.push(i);return n};var co=function(e){return Mr(e)?ro(e,!0):so(e)};var lo=function(e){return Qr(e,co(e))};var uo=function(e,t,n,i,r,o,a){var s=Xr(e,n),c=Xr(t,n),l=a.get(c);if(l)fr(e,n,l);else{var u=o?o(s,c,n+"",e,t,a):void 0,f=void 0===u;if(f){var d=Or(c),h=!d&&Ur(c),p=!d&&!h&&Wr(c);u=c,d||h||p?Or(s)?u=s:Pr(s)?u=mr(s):h?(f=!1,u=hr(c,!0)):p?(f=!1,u=gr(c,!0)):u=[]:Kr(c)||Rr(c)?(u=s,Rr(s)?u=lo(s):ki(s)&&!xi(s)||(u=Sr(c))):f=!1}f&&(a.set(c,u),r(u,c,i,o,a),a.delete(c)),fr(e,n,u)}};var fo=function e(t,n,i,r,o){t!==n&&dr(n,(function(a,s){if(o||(o=new cr),ki(a))uo(t,n,s,i,e,r,o);else{var c=r?r(Xr(t,s),a,s+"",t,n,o):void 0;void 0===c&&(c=a),fr(t,s,c)}}),co)};var ho=function(e){return e};var po=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},vo=Math.max;var go=function(e,t,n){return t=vo(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,o=vo(i.length-t,0),a=Array(o);++r<o;)a[r]=i[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=i[r];return s[t]=n(a),po(e,this,s)}};var mo=function(e){return function(){return e}},_o=lr?function(e,t){return lr(e,"toString",{configurable:!0,enumerable:!1,value:mo(t),writable:!0})}:ho,yo=Date.now;var bo=function(e){var t=0,n=0;return function(){var i=yo(),r=16-(i-n);if(n=i,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},Eo=bo(_o);var wo=function(e,t){return Eo(go(e,t,ho),e+"")};var ko=function(e,t,n){if(!ki(n))return!1;var i=J(t);return!!("number"==i?Mr(n)&&no(t,n.length):"string"==i&&t in n)&&Wn(n[t],e)};var So,xo,To,Ao,zo,Co,Do,Ro,Oo=function(e){return wo((function(t,n){var i=-1,r=n.length,o=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(r--,o):void 0,a&&ko(n[0],n[1],a)&&(o=r<3?void 0:o,r=1),t=Object(t);++i<r;){var s=n[i];s&&e(t,s,i,o)}return t}))},Io=Oo((function(e,t,n){fo(e,t,n)}));(xo=So||(So={})).CUSTOM="CUSTOM",xo.ACTUAL_FMP="ACTUAL_FMP",(Ao=To||(To={})).ABORT="ABORT",Ao.CRASH="CRASH",(Co=zo||(zo={})).normal="normal",Co.noRecord="noRecord",Co.noInternet="noInternet",Co.error="error",(Ro=Do||(Do={})).START="START",Ro.IN_PROGRESS="IN_PROGRESS",Ro.FAILURE="FAILURE",Ro.FINISH="FINISH",Ro.ABORT="ABORT";var Mo=function(){if("undefined"==typeof window||void 0===window.performance||"function"!=typeof window.performance.getEntriesByType)return{};var e=window.performance.getEntriesByType("mark").filter((function(e){return e.name.startsWith("pns_privacy_product_mark")})),t=window.performance.getEntriesByType("measure").filter((function(e){return e.name.startsWith("pns_privacy_product_duration")}));return[].concat(C(e),C(t)).map((function(e){return{duration:e.duration,entryType:e.entryType,name:e.name,startTime:e.startTime}})).reduce((function(e,t){return e[t.name]="mark"===t.entryType?Math.floor(t.startTime):Math.floor(t.duration),e}),{})},Po=function(){if("undefined"==typeof window||void 0===window.performance||"function"!=typeof window.performance.measure||"function"!=typeof window.performance.getEntriesByName)return-1;window.performance.measure("DCL","fetchStart","domContentLoadedEventEnd");var e=window.performance.getEntriesByName("DCL");return e.length>0?e[0].duration:-1},No=function(e,t){e("sendCustomPerfMetric",{name:"actual_fmp",value:t})},Uo=function(e,t){if(t){var n={method:e,params:t};if("undefined"!=typeof NativeModules){var i,r,o=null===(r=NativeModules)||void 0===r||null===(i=r.hybridMonitor)||void 0===i?void 0:i.request;null==o||o(n,(function(){}))}else{var a,s,c,l,u,f=function(){var e,t,n="unknown",i=null!==(t=null===(e=navigator)||void 0===e?void 0:e.userAgent)&&void 0!==t?t:"";return/android|Android/i.test(i)&&(n="Android"),/iPhone|iPad|iPod|iOS/i.test(i)&&(n="iOS"),{os:n,isAndroid:"Android"===n,isIOS:"iOS"===n}}();if(f.isIOS)null===(u=window)||void 0===u||null===(l=u.webkit)||void 0===l||null===(c=l.messageHandlers)||void 0===c||null===(s=c.bdhmRequest)||void 0===s||null===(a=s.postMessage)||void 0===a||a.call(s,n);else if(f.isAndroid){var d,h,p;null===(p=window)||void 0===p||null===(h=p.iesJsBridgeTransferMonitor)||void 0===h||null===(d=h.request)||void 0===d||d.call(h,JSON.stringify(n))}}}},Bo=function(e,t,n){var i={key:e,value:void 0===t?Date.now():t,description:n||""};Uo("timing.mark",i)},Go=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("undefined"==typeof location||"undefined"==typeof URLSearchParams)return"";var n=new URLSearchParams(location.search);return n.get(e)||t},Lo=function(){var e,t,n,i;return{scm_version:"undefined"==typeof window?"":null!==(n=null===(e=window.gfdatav1)||void 0===e?void 0:e.ver)&&void 0!==n?n:"",path:"undefined"==typeof location?"":location.pathname,enter_from:Go("enter_from"),host:"undefined"==typeof location?"":location.host,canary:"undefined"==typeof window?"":null!==(i=null===(t=window.gfdatav1)||void 0===t?void 0:t.canary)&&void 0!==i?i:""}};function jo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){jo(e,t,n[t])}))}return e}function Ko(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ho,Vo,qo,$o={pageCrash:!1,cuj:!1},Jo=$((function e(){var t=this;V(this,e),this.slardarWindowGlobalName="",this.slardarHybridGlobalName="",this._shouldReportJSError={pageCrash:!1,cuj:!1},this.setContext=function(e){t._context=e},this.initSlardar=function(e){try{var n=null!=e?e:{},i=n.slardarContainer,r=n.slardarWindowGlobalName,o=n.slardarHybridGlobalName,a=n.sparkMonitor,s=n.reportActualFMP,c=n.shouldReportJSError;"string"==typeof r&&(t.slardarWindowGlobalName=r),"string"==typeof o&&(t.slardarHybridGlobalName=o),"function"==typeof s&&(t.reportTTAPActualFMP=s),void 0!==a&&(t.sparkMonitor=a),void 0!==i&&"function"==typeof i.sendEvent&&"function"==typeof i.reportActualFMP&&(t.slardarContainer=i),t._shouldReportJSError=Fo({},$o,null!=c?c:{})}catch(e){}},this.initJSB=function(e){t.jsbBridge=e},this._formatEventPayload=function(e){var n=e.name,i=e.metrics,r=e.categories,o=Ko(e,["name","metrics","categories"]),a=Fo({},r,t._context);return Fo({name:n,metrics:i,categories:a},o)},this._formatErrorPayload=function(e){return Fo({},null!=e?e:{},t._context)},this.sendEvent=function(e){try{var n,i,r,o=null!==(r=t._formatEventPayload(e))&&void 0!==r?r:{};if(t.slardarWindowGlobalName&&"function"==typeof(null===(n=window)||void 0===n?void 0:n[t.slardarWindowGlobalName])&&window[t.slardarWindowGlobalName]("sendEvent",o),t.slardarHybridGlobalName&&"function"==typeof(null===(i=window)||void 0===i?void 0:i[t.slardarHybridGlobalName])){var a=o.name,s=void 0===a?"":a,c=o.categories,l=Ko(o,["name","categories"]);window[t.slardarHybridGlobalName]("emit","custom",Fo({eventName:s,level:0,category:c},l))}t.slardarContainer&&t.slardarContainer.sendEvent(o)}catch(e){}},this._sendError=function(e,n){if(t._shouldReportJSError)try{var i,r,o,a=null!==(o=t._formatErrorPayload(n))&&void 0!==o?o:{};if(t.slardarWindowGlobalName&&"function"==typeof(null===(i=window)||void 0===i?void 0:i[t.slardarWindowGlobalName])&&window[t.slardarWindowGlobalName]("captureException",e,a),t.slardarHybridGlobalName&&"function"==typeof(null===(r=window)||void 0===r?void 0:r[t.slardarHybridGlobalName])){var s=a.name,c=void 0===s?"":s,l=Ko(a,["name"]);window[t.slardarHybridGlobalName]("captureException",e,Fo({eventName:c,level:0},l))}t.slardarContainer&&"function"==typeof t.slardarContainer.captureException&&t.slardarContainer.captureException(e,a)}catch(e){}},this.sendPageCrashError=function(e,n){t._shouldReportJSError.pageCrash&&t._sendError(e,n)},this.sendCUJError=function(e,n){t._shouldReportJSError.cuj&&t._sendError(e,n)},this.teaReport=function(e){var n,i,r,o=null!==(i=t._formatEventPayload(e))&&void 0!==i?i:{};"undefined"!=typeof window&&"function"==typeof(null===(n=window)||void 0===n?void 0:n.collectEvent)&&(null===(r=window)||void 0===r||r.collectEvent(o.name,Fo({},o.metrics,o.categories,Lo())));t.jsbBridge&&t.jsbBridge.x.reportAppLog({eventName:o.name,params:Fo({},o.metrics,o.categories,Lo())})},this.resetTeaModule=function(){t.jsbBridge=void 0},this.resetSlardarModule=function(){t.slardarContainer=void 0,t.slardarWindowGlobalName="",t.slardarHybridGlobalName="",t.sparkMonitor=void 0,t.reportTTAPActualFMP=void 0}}));(qo=Vo||(Vo={})).FBJS="pns_privacy_product_mark_fbjs",qo.AFMP="pns_privacy_product_mark_afmp";var Wo=(null===(Ho=performance.timing)||void 0===Ho?void 0:Ho.navigationStart)||performance.timeOrigin;function Xo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){Xo(e,t,n[t])}))}return e}function Yo(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var Qo=function(){function e(t){var n=this;V(this,e),this._hasReportedActualFMP=!1,this._hasReportedFBJS=!1,this.reportFBJS=function(){var e,t,i,r;if(!n._hasReportedFBJS){n._hasReportedFBJS=!0;var o=Date.now();window.TTAP_APPPARSE_STARTTIME=o,"function"==typeof(null===(e=n._trackingContext.sparkMonitor)||void 0===e?void 0:e.mark)?n._trackingContext.sparkMonitor.mark("fbjs"):n._trackingContext.slardarHybridGlobalName&&"function"==typeof(null===(t=window)||void 0===t?void 0:t[n._trackingContext.slardarHybridGlobalName])&&Bo("fbjs"),null===(r=performance)||void 0===r||null===(i=r.mark)||void 0===i||i.call(r,"pns_privacy_product_mark_fbjs"),n._trackingContext.sendEvent({name:Vo.FBJS,metrics:{cost_ms:o-Wo},categories:Zo({},Lo())}),n._trackingContext.teaReport({name:Vo.FBJS,metrics:{cost_ms:o-Wo}})}},this.reportActualFMP=function(){var e,t,i,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zo.normal;if(!n._hasReportedActualFMP){n._hasReportedActualFMP=!0;var a,s,c,l,u,f,d=[zo.normal,zo.noRecord],h=d.includes(o),p=Date.now();if(null===(t=performance)||void 0===t||null===(e=t.mark)||void 0===e||e.call(t,"pns_privacy_product_mark_afmp"),h)if("function"==typeof(null===(a=n._trackingContext.sparkMonitor)||void 0===a?void 0:a.mark)?n._trackingContext.sparkMonitor.mark("fmp"):n._trackingContext.slardarHybridGlobalName&&"function"==typeof(null===(s=window)||void 0===s?void 0:s[n._trackingContext.slardarHybridGlobalName])&&Bo("fmp"),"function"==typeof(null===(c=n._trackingContext)||void 0===c?void 0:c.reportTTAPActualFMP))n._trackingContext.reportTTAPActualFMP();else if(n._trackingContext.slardarWindowGlobalName&&"function"==typeof(null===(l=window)||void 0===l?void 0:l[n._trackingContext.slardarWindowGlobalName])){var v;No(null===(v=window)||void 0===v?void 0:v[n._trackingContext.slardarWindowGlobalName],p-Wo)}if(n._trackingContext.slardarHybridGlobalName&&"function"==typeof(null===(i=window)||void 0===i?void 0:i[n._trackingContext.slardarHybridGlobalName]))null===(f=window)||void 0===f||null===(u=f[n._trackingContext.slardarHybridGlobalName])||void 0===u||u.call(f,"sendCustomPerfMetric",{name:"actual_fmp",value:p-Wo});n._trackingContext.sendEvent({name:Vo.AFMP,metrics:Yo(Zo({costMs:p-Wo},Mo()),{pns_privacy_product_mark_dcl:Po()}),categories:Zo({isSuccess:h?"1":"0",scene:o},Lo())}),n._trackingContext.teaReport({name:Vo.AFMP,metrics:Yo(Zo({costMs:p-Wo},Mo()),{pns_privacy_product_mark_dcl:Po()}),categories:{isSuccess:h?"1":"0",scene:o}}),"function"==typeof(null===(r=n._trackingContext.slardarContainer)||void 0===r?void 0:r.reportActualFMP)&&n._trackingContext.slardarContainer.reportActualFMP()}},this._trackingContext=t}return $(e,[{key:"resetForSPA",value:function(){this._hasReportedActualFMP=!1}}]),e}(),ea=function(){var e,t,n;return(null===(t=performance)||void 0===t||null===(e=t.timing)||void 0===e?void 0:e.navigationStart)||(null===(n=performance)||void 0===n?void 0:n.timeOrigin)},ta=function(e){var t=0;try{performance.mark("error"),t=performance.measure("navigationStart_to_error","navigationStart","error").duration,performance.clearMarks("error"),performance.clearMeasures("navigationStart_to_error")}catch(e){t=Date.now()-ea()}"object"===J(e)&&(e._triggerTime=t)},na=function(e){try{var t=e.error;ta(t)}catch(e){}},ia=function(){window._bound_error_time||(window._bound_error_time=!0,"development"===process.env.NODE_ENV?window.addEventListener("error",na,!0):function(){var e;if(null===(e=console)||void 0===e?void 0:e.error){var t=console.error;console.error=function(e){ta(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];t.apply(void 0,[e].concat(i))}}}())},ra=function(){function e(t){var n=this;V(this,e),this._hasReportedPageReady=!1,this._hasReportedPageCrash=!1,this._hasReportedUserDrop=!1,this._pageReadyTimestamp=-1,this._cuj={},this.reportPageReady=function(){if(!(n._hasReportedPageReady||n._hasReportedUserDrop||n._hasReportedPageCrash)){n._hasReportedPageReady=!0;var e=0;try{performance.mark("pageReady"),e=performance.measure("navigationStart_to_pageReady","navigationStart","pageReady").duration}catch(t){e=Date.now()-ea()}n._pageReadyTimestamp=e,n._trackingContext.sendEvent({name:"page_ready",metrics:{time:e}})}},this.reportUserDrop=function(){if(!n._hasReportedPageReady&&!n._hasReportedUserDrop){n._hasReportedUserDrop=!0;var e=0;try{performance.mark("userDrop"),e=performance.measure("navigationStart_to_userDrop","navigationStart","userDrop").duration}catch(t){e=Date.now()-ea()}n._trackingContext.sendEvent({name:"user_drop",metrics:{time:e},categories:{reason:n._hasReportedPageCrash?To.CRASH:To.ABORT}})}},this.reportPageCrash=function(e){var t,i,r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2?arguments[2]:void 0;if(!n._hasReportedUserDrop&&!n._hasReportedPageCrash){n._hasReportedPageCrash=!0;var s=null!=e?e:{},c=s.name,l=void 0===c?"":c,u=s.message,f=s.stack,d=s._triggerTime,h=void 0===d?0:d,p=0;if(!p)try{performance.mark("pageCrashReporting"),p=performance.measure("navigationStart_to_pageCrashReporting","navigationStart","pageCrashReporting").duration}catch(e){p=Date.now()-ea()}var v,g,m,_=o?h:p,y=_<n._pageReadyTimestamp||!n._hasReportedPageReady,b=p<n._pageReadyTimestamp||!n._hasReportedPageReady;n._trackingContext.sendEvent({name:"page_crash",metrics:{time:null!=_?_:0},categories:{isTriggeredBeforePageReady:y,isReportedBeforePageReady:b,name:l,message:null!==(v=null==u||null===(t=u.substring)||void 0===t?void 0:t.call(u,0,256))&&void 0!==v?v:"",stack:null!==(g=null==f||null===(i=f.substring)||void 0===i?void 0:i.call(f,0,256))&&void 0!==g?g:"",componentStack:null!==(m=null==a||null===(r=a.substring)||void 0===r?void 0:r.call(a,0,256))&&void 0!==m?m:""}}),e&&n._trackingContext.sendPageCrashError(e,{name:"page_crash",isTriggeredBeforePageReady:""+y,isReportedBeforePageReady:""+b})}},this.reportCUJ=function(e,t,i){var r,o,a="cuj_".concat(e,"_").concat(Do.START),s="cuj_".concat(e,"_").concat(t).replace(/\s/g,"_"),c=0,l=0;try{performance.mark(s),c=performance.measure("navigationStart_to_".concat(s),"navigationStart",s).duration,l=performance.measure("".concat(a,"_to_").concat(s),a,s).duration}catch(i){if(c=Date.now()-ea(),t===Do.START)n._cuj[e]=x({},Do.START,Date.now()),l=0;else{if(!n._cuj[e])return;var u;n._cuj[e][t]=Date.now(),l=n._cuj[e][t]-(null!==(u=n._cuj[e][Do.START])&&void 0!==u?u:0)}}var f,d,h,p,v=null!=i?i:{},g=v.error,m=v.detail,_=v.stepName,y="string"==typeof g?g:null!==(f=null==g?void 0:g.toString())&&void 0!==f?f:"",b=m||(null!==(d=null==g?void 0:g.stack)&&void 0!==d?d:"");n._trackingContext.sendEvent({name:"pns_cuj",metrics:{timestamp:c,duration:l},categories:{status:t,name:e,stepName:_,error:null!==(h=null==y||null===(r=y.substring)||void 0===r?void 0:r.call(y,0,256))&&void 0!==h?h:"",detail:null!==(p=null==b||null===(o=b.substring)||void 0===o?void 0:o.call(b,0,256))&&void 0!==p?p:""}}),t===Do.FAILURE&&g&&n._trackingContext.sendCUJError(g,{stepName:_,cujName:e,status:t,name:"pns_cuj"})},this._trackingContext=t}return $(e,[{key:"resetForSPA",value:function(){this._hasReportedPageReady=!1,this._hasReportedPageCrash=!1,this._hasReportedUserDrop=!1,this._pageReadyTimestamp=-1,this._cuj={}}}]),e}(),oa={},aa=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=!1,n=function(){function e(){var n,i=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return V(this,e),this._pageReadyTiming=So.ACTUAL_FMP,this.init=function(e){try{if(t)return;t=!0;var n=null!=e?e:{},r=n.slardarContainer,o=n.slardarWindowGlobalName,a=n.slardarHybridGlobalName,s=n.sparkMonitor,c=n.reportActualFMP,l=n.pageReadyTiming,u=void 0===l?So.CUSTOM:l,f=n.jsbBridge,d=n.shouldReportJSError,h=void 0===d?{}:d,p=n.shouldRegisterUserDrop,v=void 0===p||p,g=n.context;i._trackingContext.setContext(null!=g?g:{tenant:"N/A",appId:0,appVersion:"N/A"}),i._pageReadyTiming=u,i._trackingContext.initSlardar({slardarContainer:r,slardarWindowGlobalName:o,slardarHybridGlobalName:a,sparkMonitor:s,reportActualFMP:c,shouldReportJSError:h}),f&&i._trackingContext.initJSB(f),ia(),v&&i._registerUserDropEvent()}catch(e){}},this._registerUserDropEvent=function(){window.addEventListener("beforeunload",i.reportUserDrop,!0)},this.reportPageReady=function(e){i._stabilityTracker.reportPageReady(),i._pageReadyTiming===So.ACTUAL_FMP&&i._perfTracker.reportActualFMP(e)},this.reportUserDrop=function(){i._stabilityTracker.reportUserDrop()},this.reportPageCrash=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;i._stabilityTracker.reportPageCrash(e,t,n)},this.reportFBJS=function(){i._perfTracker.reportFBJS()},this.reportActualFMP=function(e){i._perfTracker.reportActualFMP(e)},this.reportCUJ=function(e,t,n){i._stabilityTracker.reportCUJ(e,t,n)},r?(oa[r]=this,n=this):(e._instance||(e._instance=this),n=e._instance),this._trackingContext=new Jo,this._perfTracker=new Qo(this._trackingContext),this._stabilityTracker=new ra(this._trackingContext),n}return $(e,[{key:"resetForSPA",value:function(){this._stabilityTracker.resetForSPA(),this._perfTracker.resetForSPA()}},{key:"reset",value:function(){this.resetForSPA();try{window.removeEventListener("beforeunload",this.reportUserDrop,!0)}catch(e){}this._trackingContext.resetSlardarModule(),this._trackingContext.resetTeaModule(),t=!1}},{key:"isInitialized",value:function(){return t}}]),e}();return e?(oa[e]||(oa[e]=new n(e)),oa[e]):new n},sa=aa();function ca(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var la,ua,fa,da,ha=function(){function e(){V(this,e),this.debug=!1,this.meta={}}return $(e,[{key:"init",value:function(e,t){var n,i;this.debug=null!==(n=null==t?void 0:t.debug)&&void 0!==n&&n,this.meta=null!==(i=null==e?void 0:e.meta)&&void 0!==i?i:{}}},{key:"send",value:function(e){}},{key:"info",value:function(e,t){}},{key:"warn",value:function(e,t){}},{key:"error",value:function(e,t){}},{key:"getMeta",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){ca(e,t,n[t])}))}return e}({},this.meta)}},{key:"reportCUJ",value:function(e,t,n){}},{key:"destruct",value:function(){}}]),e}(),pa=ha,va="0.0.0",ga="pns_sdk_common_modules";(ua=la||(la={})).US_EAST="US-East",ua.US_EASTRED="US-EastRed",ua.SINGAPORE_CENTRAL="Singapore-Central",ua.EU_TTP="EU-TTP",ua.EU_TTP2="EU-TTP2",ua.US_TTP="US-TTP",ua.US_TTP2="US-TTP2",(da=fa||(fa={})).PRODUCTION="production",da.DEV="dev",da.BOE="boe";var ma=li((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});
|
||
/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation.
|
||
|
||
Permission to use, copy, modify, and/or distribute this software for any
|
||
purpose with or without fee is hereby granted.
|
||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
PERFORMANCE OF THIS SOFTWARE.
|
||
***************************************************************************** */
|
||
var n=function(){return n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};function i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function r(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var o=function(e){return JSON.stringify({ev_type:"batch",list:e})};var a=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],s=function(){return{}};function c(e){return e}function l(e){return"object"===J(e)&&null!==e}var u=Object.prototype;function f(e){if(l(e)){if("function"==typeof Object.getPrototypeOf){var t=Object.getPrototypeOf(e);return t===u||null===t}return"[object Object]"===u.toString.call(e)}return!1}function d(e){return"[object Array]"===u.toString.call(e)}function h(e){return"function"==typeof e}function p(e){return"number"==typeof e}function v(e){return"string"==typeof e}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function m(e,t){var i=n({},e);for(var r in t)g(t,r)&&void 0!==t[r]&&(l(t[r])&&f(t[r])?i[r]=m(l(e[r])?e[r]:{},t[r]):d(t[r])&&d(e[r])?i[r]=_(e[r],t[r]):i[r]=t[r]);return i}function _(e,t){var n=d(e)?e:[],i=d(t)?t:[];return Array.prototype.concat.call(n,i).map((function(e){return e instanceof RegExp?e:l(e)&&f(e)?m({},e):d(e)?_([],e):e}))}function y(e,t){if(!d(e))return!1;if(0===e.length)return!1;for(var n=0;n<e.length;){if(e[n]===t)return!0;n++}return!1}var b=function(e,t){if(!d(e))return e;var n=e.indexOf(t);if(n>=0){var i=e.slice();return i.splice(n,1),i}return e},E=function(e,t,n){for(var r,o=i(t.split(".")),a=o[0],s=o.slice(1);e&&s.length>0;)e=e[a],a=(r=i(s))[0],s=r.slice(1);if(e)return n(e,a)},w=function(e,t,n){return E(e,t,(function(e,t){if(e&&t in e&&h(e[t]))try{return e[t].apply(e,n)}catch(e){return}}))};function k(e){return d(e)&&e.length?function(e){for(var t=[],n=e.length,i=0;i<n;i++){var r=e[i];v(r)?t.push(r.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):r&&r.source&&t.push(r.source)}return new RegExp(t.join("|"),"i")}(e):null}var S=function(e,t){var n=k(e||[]);return!!n&&n.test(t)};function x(e){try{return v(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}var T=function(e,t,n,o){return void 0===o&&(o=!0),function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];if(!e)return s;var l=e[t],u=n.apply(void 0,r([l],i(a),!1)),f=u;return h(f)&&o&&(f=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return u.apply(this,e)}catch(t){return h(l)&&l.apply(this,e)}}),e[t]=f,function(n){n||(f===e[t]?e[t]=l:u=l)}}},A=function(e,t,n){return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];if(!e)return s;var c=e[t],l=n.apply(void 0,r([c],i(o),!1)),u=l;return h(u)&&(u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l.apply(this,e)}),e[t]=u,function(){u===e[t]?e[t]=c:l=c}}},z="".padStart?function(e,t){return void 0===t&&(t=8),e.padStart(t," ")}:function(e){return e},C=0,D=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,r(["[SDK]",Date.now(),z(""+C++)],i(e),!1))},R=0,O=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.warn.apply(console,r(["[SDK]",Date.now(),z(""+R++)],i(e),!1))},I=function(e){return Math.random()<Number(e)},M=function(e,t){return e<Number(t)},P=function(e){return function(t){for(var n=t,i=0;i<e.length&&n;i++)try{n=e[i](n)}catch(e){D(e)}return n}};function N(){var e=function(){for(var e=new Array(16),t=0,n=0;n<16;n++)0==(3&n)&&(t=4294967296*Math.random()),e[n]=t>>>((3&n)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);var i=0,r=t;return[r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]]].join("")}(e)}var U=function e(t,n){var i=[];try{i=n.reduce((function(e,n){try{var i=n(t);"function"==typeof i&&e.push(i)}catch(e){}return e}),[])}catch(e){}return function(t){return e(t,i)}},B=function(e){void 0===e&&(e=3e5);var t,n=[],i=[],r=!1,o=function(e,t,n){var i=0;return-1===n?s:function(){if(e())return i&&clearTimeout(i),void(i=0);0===i&&(i=setTimeout(t,n))}}((function(){return!!n.length}),(function(){r=!0,t&&t[0](),i.forEach((function(e){return e()})),i.length=0,t=void 0}),e),a=function(e){n=b(n,e),!r&&o()};return{next:function(e){return U(e,n)},complete:function(e){i.push(e)},attach:function(e,n){t=[e,n]},subscribe:function(e){if(r)throw new Error("Observer is closed");return n.push(e),t&&t[1]&&t[1](e),o(),function(){return a(e)}},unsubscribe:a}},G=function(e,t,n){var i=B(n);try{e(i.next,i.attach),t&&i.complete(t)}catch(e){}return[i.subscribe,i.unsubscribe]},L=function(e,t){var n=i(e,1)[0];return function(e,i){var r=n((function(n){var i,r=(i=t,function(e){for(var t=!0,n=0;n<i.length&&t;n++)try{t=i[n](e)}catch(e){D(e)}return t})(n);return r?e(n):s}));i((function(){r()}))}};var j=function(e,t,n,i){return e.destroyAgent.set(t,n,i)};function F(e){var t,n,o=e.builder,s=e.createSender,c=e.createDefaultConfig,u=e.createConfigManager,f=e.userConfigNormalizer,d=e.initConfigNormalizer,h=e.validateInitConfig,p={};a.forEach((function(e){return p[e]=[]}));var v=!1,g=!1,m=!1,_=[],E=[],w=function(){var e=!1,t={},n=function(e){e.length&&e.forEach((function(e){try{e()}catch(e){}})),e.length=0},i=function(e){t[e]&&t[e].forEach((function(e){n(e[1])})),t[e]=void 0};return{set:function(i,r,o){t[i]?t[i].push([r,o]):t[i]=[[r,o]],e&&n(o)},has:function(e){return!!t[e]},remove:i,removeByEvType:function(e){Object.keys(t).forEach((function(i){t[i]&&t[i].forEach((function(t){t[0]===e&&n(t[1])}))}))},clear:function(){e=!0,Object.keys(t).forEach((function(e){i(e)}))}}}(),k={getBuilder:function(){return o},getSender:function(){return t},getPreStartQueue:function(){return _},init:function(e){if(v)O("already inited");else{if(!(e&&l(e)&&h(e)))throw new Error("invalid InitConfig, init failed");var i=c(e);if(!i)throw new Error("defaultConfig missing");var r=d(e);if((n=u(i)).setConfig(r),n.onChange((function(){S("config")})),!(t=s(n.getConfig())))throw new Error("sender missing");v=!0,S("init",!0)}},set:function(e){v&&e&&l(e)&&(S("beforeConfig",!1,e),null==n||n.setConfig(e))},config:function(e){if(v)return e&&l(e)&&(S("beforeConfig",!1,e),null==n||n.setConfig(f(e))),null==n?void 0:n.getConfig()},provide:function(e,t){y(E,e)?O("cannot provide "+e+", reserved"):(k[e]=t,S("provide",!1,e))},start:function(){var e=this;v&&(g||null==n||n.onReady((function(){g=!0,S("start",!0),_.forEach((function(t){return e.build(t)})),_.length=0})))},report:function(e){if(e){var t=P(p.beforeReport)(e);if(t){var n=P(p.report)(t);n&&(g?this.build(n):_.push(n))}}},build:function(e){if(g){var t=P(p.beforeBuild)(e);if(t){var n=o.build(t);if(n){var i=P(p.build)(n);i&&this.send(i)}}}},send:function(e){if(g){var n=P(p.beforeSend)(e);n&&(t.send(n),S("send",!1,n))}},destroy:function(){w.clear(),m=!0,_.length=0,S("beforeDestroy",!0)},on:function(e,t){if("init"===e&&v||"start"===e&&g||"beforeDestroy"===e&&m)try{t()}catch(e){}else p[e]&&p[e].push(t)},off:function(e,t){p[e]&&(p[e]=b(p[e],t))},destroyAgent:w};return E=Object.keys(k),k;function S(e,t){void 0===t&&(t=!1);for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];p[e].forEach((function(e){try{e.apply(void 0,r([],i(n),!1))}catch(e){}})),t&&(p[e].length=0)}}var K=function(e){var t=function(){var e={},t={},i={set:function(n,r){return e[n]=r,t[n]=x(r),i},merge:function(r){return e=n(n({},e),r),Object.keys(r).forEach((function(e){t[e]=x(r[e])})),i},delete:function(n){return delete e[n],delete t[n],i},clear:function(){return e={},t={},i},get:function(e){return t[e]},toString:function(){return n({},t)}};return i}();e.provide("context",t),e.on("report",(function(e){return e.extra||(e.extra={}),e.extra.context=t.toString(),e}))};function H(e,t){return e.initSubject(t)}function V(e,t,n){var r=i(t,2),o=r[0],a=r[1],s=e.privateSubject||{};return s[o]||(s[o]=G(a,(function(){s[o]=void 0}),n)),s[o]}var q=function(){return Date.now()};function $(){if("object"===("undefined"==typeof window?"undefined":J(window))&&l(window))return window}function W(){if("object"===("undefined"==typeof document?"undefined":J(document))&&l(document))return document}function X(){return $()&&window.location}function Z(){return $()&&window.history}function Y(){if("function"==typeof XMLHttpRequest&&h(XMLHttpRequest))return XMLHttpRequest}function Q(){var e=function(){if($()&&"navigator"in window)return window.navigator}();if(e)return e.connection||e.mozConnection||e.webkitConnection}function ee(){if(!document)return null;if(document.currentScript)return document.currentScript;try{throw new Error}catch(l){var e=0,t=/at\s+(.*)\s+\((.*):(\d*):(\d*)\)/i.exec(l.stack),n=t&&t[2]||!1,i=t&&t[3]||0,r=document.location.href.replace(document.location.hash,""),o="",a=document.getElementsByTagName("script");if(n===r){var s=document.documentElement.outerHTML,c=new RegExp("(?:[^\\n]+?\\n){0,"+(i-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i");o=s.replace(c,"$1").trim()}for(;e<a.length;e++){if("interactive"===a[e].readyState)return a[e];if(a[e].src===n)return a[e];if(n===r&&a[e].innerHTML&&a[e].innerHTML.trim()===o)return a[e]}return null}}function te(e){var t=W();if(!t||!e)return"";var n=t.createElement("a");return n.href=e,n.href}function ne(e){var t=W();if(!t||!e)return{url:e,protocol:"",domain:"",query:"",path:"",hash:""};var n=t.createElement("a");n.href=e;var i=n.pathname||"/";return"/"!==i[0]&&(i="/"+i),{url:n.href,protocol:n.protocol.slice(0,-1),domain:n.hostname,query:n.search.substring(1),path:i,hash:n.hash}}function ie(){var e=$()&&X();return e?e.href:""}var re=function(e){var t,n=e.config(),i={pid:(t=n).pid,view_id:t.viewId,url:ie()};return i.context=e.context?e.context.toString():{},i},oe=function(e,t){void 0===t&&(t=!1);var i=re(e);return t&&(i.timestamp=q()),function(t){e.report(n(n({},t),{overrides:i}))}},ae=function(e){return function(t,n){var i=re(e);n(s,(function(e){i&&e(i)}))}},se=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[],subject:{}}}),e.__SLARDAR_REGISTRY__.Slardar},ce=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=se($());n&&(n.errors||(n.errors=[]),n.errors.push(e))},le=function(e){var t={url:ie(),timestamp:q()},n=e.config();return(null==n?void 0:n.pid)&&(t.pid=n.pid),(null==e?void 0:e.context)&&(t.context=e.context.toString()),t},ue=function(e,t){return function(n){var i=function(e){return e.overrides=t,e};e.on("report",i),n(),e.off("report",i)}},fe=function(e,t,n,i){return void 0===i&&(i=!1),e.addEventListener(t,n,i),function(){e.removeEventListener(t,n,i)}},de=function(e,t,n,i){return void 0===i&&(i=!1),e.addEventListener(t,n,i),function(){e.removeEventListener(t,n,i)}};var he=function(e){var t=!1;return[function(n){t||(t=!0,e&&e(n))}]},pe=function(e,t){var n,i=W();if(i){var r=i.createElement("script");r.src=e,r.crossOrigin="anonymous",r.onload=t,null===(n=i.head)||void 0===n||n.appendChild(r)}},ve=function(e,t){return l(e)?n(n({},t),e):!!e&&t},ge=function(){return!!btoa&&!!atob};var me=function(e){try{var t=localStorage.getItem(e),n=t;t&&"string"==typeof t&&(n=JSON.parse((a=t,ge()?decodeURI(atob(a)):a)));var i=n,r=i.expires,o=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(i,["expires"]);return r>=q()?o:void 0}catch(e){return}var a},_e=function(e,t,i){var r;if(!(i<=0))try{localStorage.setItem(e,(r=JSON.stringify(n(n({},t),{expires:q()+i})),ge()?btoa(encodeURI(r)):r))}catch(e){}},ye=function(e){return!1===e?0:!0!==e&&void 0!==e&&p(e)?e:7776e6},be=function(){var e=new RegExp("\\/monitor_web\\/collect|\\/monitor_browser\\/collect\\/batch","i");return function(t){return e.test(t)}},Ee=function(e){return function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t=i(n,2),this._method=t[0],this._url=t[1],e.apply(this,n)}},we=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._reqHeaders=this._reqHeaders||{};var r=i(t,2),o=r[0],a=r[1];return this._reqHeaders[o]=a,e&&e.apply(this,t)}},ke=function(e,t){return A(e,"onreadystatechange",(function(n){return function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];return 4===this.readyState&&t(e),n&&n.apply(this,i)}}))},Se=function(e,t){var n=be();return function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];if(this._start=q(),this._data=null==i?void 0:i[0],!n(this._url)){var o=t([this._method,this._url,this._start,this]);ke(this,o)()}return e.apply(this,i)}},xe=function(e){return function(t,n){if(e){var i=[];i.push(A(e,"open",Ee)()),i.push(A(e,"setRequestHeader",we)()),i.push(A(e,"send",Se)(t)),n((function(){i.forEach((function(e){return e()}))}))}}},Te=function(e,t){return function(n,i){void 0===i&&(i={});var r=t([n,i]),o=e(n,i);return o.then((function(e){r(e)}),(function(){r(void 0)})),o}},Ae=["fetch_0",function(e,t){var n=$();if(n&&fetch){var i=[];i.push(A(n,"fetch",Te)(e)),t((function(){i.forEach((function(e){return e()}))}))}}],ze=["resource"],Ce=["resource_0",function(e,t){var n=function(){if($()&&h(window.PerformanceObserver))return window.PerformanceObserver}();if(n){var r=be();t(function(e,t,n){var r=i(function(e,t,n){var i=e&&new e((function(e,i){e.getEntries?e.getEntries().forEach((function(e,n,r){return t(e,n,r,i)})):n&&n()}));return[function(t){if(!e||!i)return n&&n();try{i.observe({entryTypes:t})}catch(e){return n&&n()}},function(t,r){if(!e||!i)return n&&n();try{var o={type:t,buffered:!0};!function(e){return void 0===e}(r)&&(o.durationThreshold=r),i.observe(o)}catch(e){return n&&n()}i.observe({type:t,buffered:!1})},function(){return i&&i.disconnect()}]}(e,t),3),o=r[0],a=r[2];return o(n),a}(n,(function(t){!r(t.name)&&e(t)}),ze))}}],De="pageview",Re="session",Oe="js_error",Ie="http",Me="custom",Pe="action",Ne={sampleRate:1,origins:[]},Ue=function(){var e=window&&(window.crypto||window.msCrypto);if(void 0!==e&&e.getRandomValues){var t=new Uint16Array(8);e.getRandomValues(t);var n=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return n(t[0])+n(t[1])+n(t[2])+n(t[3])+n(t[4])+n(t[5])+n(t[6])+n(t[7])}return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/[x]/g,(function(){return(16*Math.random()|0).toString(16)}))},Be=function(e){var t=ve(e,Ne);if(t&&I(t.sampleRate))return function(e,n){var i=t.origins;i.length&&S(i,e)&&n("traceparent","03-"+Ue()+"-"+Ue().substring(16)+"-01")}},Ge=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Le=new RegExp("(bearer|session)","i"),je=function(e,t){return!e||!t||(Ge.test(e)||Le.test(t))},Fe=function(e,t){try{if(t){var i=e.request.url,r=t(i);if(!r)return;e.request.url=r,e.extra=n(n({},e.extra),{original_url:i})}}catch(e){}},Ke=function(e,t,n){var r=i(t,2),o=r[0],a=r[1],c=n.setTraceHeader,l=n.ignoreUrls,u=n.setContextAtReq,f=n.extractUrl;e.push(o[0]((function(e){var t=i(e,4);t[0];var r=t[1];t[2];var o=t[3];if(!r)return s;var d=te(r);if(S(l,d))return s;c&&c(d,(function(e,t){return o.setRequestHeader(e,t)}));var h=u(),p=void 0,v=a()[0]((function(e){d===e.name&&!p&&(p=e)}));return function(e){var t=He(e,n);setTimeout((function(){p&&(t.response.timing=p),Fe(t,f),h&&h({ev_type:Ie,payload:t}),v()}),100)}})))};var He=function(e,t){var n,r=e._method,o=e._reqHeaders,a=e._url,s=e._start,c=e._data,l={api:"xhr",request:{url:te(a),method:(r||"").toLowerCase(),headers:o&&(n=o,Object.keys(n).reduce((function(e,t){return!je(t,n[t])&&(e[t.toLowerCase()]=n[t]),e}),{})),timestamp:s},response:{status:e.status||0,is_custom_error:!1,timestamp:q()},duration:q()-s};"function"==typeof e.getAllResponseHeaders&&(l.response.headers=function(e){return v(e)&&e?e.split("\r\n").reduce((function(e,t){if(v(t)){var n=i(t.split(": "),2),r=n[0],o=n[1];!je(r,o)&&(e[r.toLowerCase()]=o)}return e}),{}):{}}(e.getAllResponseHeaders()));var u=l.response.status,f=t.collectBodyOnError,d=t.extraExtractor;try{var h=null==d?void 0:d(e.response,l,c);h&&(l.extra=h),h&&(l.response.is_custom_error=!0),f&&(h||u>=400)&&(l.request.body=c?""+c:void 0,l.response.body=e.response?""+e.response:void 0)}catch(e){}return l},Ve="ajax",qe={autoWrap:!0,setContextAtReq:function(){return c},ignoreUrls:[],collectBodyOnError:!1};var $e=function(e,t,n){var r=i(t,2),o=r[0],a=r[1],c=n.setTraceHeader,l=n.ignoreUrls,u=n.setContextAtReq,f=n.extractUrl,d=window.Headers,h=window.Request;h&&d&&e.push(o[0]((function(e){var t=i(e,2),r=t[0],o=t[1],p=te(r instanceof h?r.url:r);if(!Je(p)||S(l,p))return s;c&&c(p,(function(e,t){return Xe(e,t,r,o,h,d)}));var v=u(),g=q(),m=void 0,_=a()[0]((function(e){p===e.name&&!m&&(m=e)}));return function(e){var t,i,a=et(r,o,e,h,d,n,g),s=(t=function(e){m&&(e.response.timing=m),Fe(e,f),v&&v({ev_type:Ie,payload:e}),_()},i=!1,function(e){i||(i=!0,t(e))});setTimeout((function(){s(a)}),1e3)}})))},Je=function(e){if(!v(e))return!1;var t=i(e.split(":"),2),n=t[0];return!t[1]||"http"===n||"https"===n},We=function(e,t){return e instanceof t},Xe=function(e,t,i,r,o,a){var s;We(i,o)?i.headers.set(e,t):r.headers instanceof a?r.headers.set(e,t):r.headers=n(n({},r.headers),((s={})[e]=t,s))},Ze=function(e,t,n){var i=t&&t.method||"get";return We(e,n)&&(i=e.method||i),i.toLowerCase()},Ye=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];try{return t.reduce((function(t,n){return new e(n||{}).forEach((function(e,n){return!je(n,e)&&(t[n]=e)})),t}),{})}catch(e){return{}}},Qe=function(e,t,n){return We(e,n)?e.body:null==t?void 0:t.body},et=function(e,t,n,i,r,o,a){var c={api:"fetch",request:{method:Ze(e,t,i),timestamp:a,url:te(e instanceof i?e.url:e),headers:Ye(r,e.headers,t.headers)},response:{status:n&&n.status||0,is_custom_error:!1,timestamp:q()},duration:q()-a},l=o.collectBodyOnError,u=o.extraExtractor,f=function(){var n;l&&(c.request.body=null===(n=Qe(e,t,i))||void 0===n?void 0:n.toString())};if(n)try{var d=Ye(r,n.headers);c.response.headers=d;try{-1!==(d["content-type"]||"").indexOf("application/json")&&u&&n.clone().json().then((function(n){var r,o=u(n,c,null===(r=Qe(e,t,i))||void 0===r?void 0:r.toString());o&&(c.extra=o,c.response.is_custom_error=!0,f())})).catch(s)}catch(e){}n.status>=400&&f()}catch(e){}else f();return c},tt="fetch",nt={autoWrap:!0,setContextAtReq:function(){return c},ignoreUrls:[],collectBodyOnError:!1};var it=["name","message","stack","filename","lineno","colno"],rt=function(e){var t,n;return!function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return!0;default:return e instanceof Error}}(e)?(f(e)||(n=e,"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(n,Event))||v(e))&&(t={message:x(e)}):t=function(e,t){return e&&l(e)?t.reduce((function(t,n){return t[n]=e[n],t}),{}):e}(e,it),t},ot=function(e){return t=e,"[object ErrorEvent]"===Object.prototype.toString.call(t)?function(e){var t=rt(e.error);if(!t)return t;var n=e.colno,i=e.lineno,r=e.filename;return n&&!t.colno&&(t.colno=String(n)),i&&!t.lineno&&(t.lineno=String(i)),r&&!t.filename&&(t.filename=r),t}(e):function(e){return"[object PromiseRejectionEvent]"===Object.prototype.toString.call(e)}(e)?function(e){var t;try{var i=void 0;if("reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason),i){var r=rt(i);return n(n({},r),{name:null!==(t=r&&r.name)&&void 0!==t?t:"UnhandledRejection"})}}catch(e){}}(e):rt(e);var t},at=function(e){return"hidden"===e.visibilityState},st=["hidden_3",function(e,t){var n=W(),i=$();if(n&&i){var r=function(t){e("pagehide"===t.type||at(n))},o=de(n,"visibilitychange",r,!0),a=fe(i,"pagehide",r,!0);t((function(){o(),a()}),(function(e){e(at(n))}))}}],ct=["unload_0",function(e,t){var n=$();if(n){var r=i(he(e),1)[0],o=function(){r()},a=[];["unload","beforeunload","pagehide"].forEach((function(e){a.push(fe(n,e,o,!1))})),t((function(){a.forEach((function(e){return e()}))}))}}],lt=["hash_0",function(e,t){var n=$();if(n){var i=fe(n,"hashchange",(function(){return e(location.href)}),!0);t((function(){i()}))}}],ut=["history_0",function(e,t){var n=Z(),i=$();if(n&&i){var r=[],o=function(){return e(location.href)},a=function(e){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];try{e.apply(n,t)}finally{o()}}};r.push(T(n,"pushState",a)(),T(n,"replaceState",a)()),r.push(fe(i,"popstate",o,!0)),t((function(){r.forEach((function(e){return e()}))}))}}],ft=function(e){return dt(e,q())},dt=function(e,t){return e+"_"+t},ht=function(e){return function(t,n){e(function(e,t){return{ev_type:De,payload:{pid:t,source:e}}}(t,n))}},pt=function(e){return"manual"===e},vt=function(e,t){var n=e[0]+e[1]+e[2],i=e[0]/n;return e[2]/n>t.frustrating_threshold?2:i>t.satisfying_threshold||0===n?0:1},gt=function(e,t){return function(n,i){var r=n.payload;switch(n.ev_type){case"performance":var o=r.name;r.isSupport&&e(i.perf_apdex,o,r.value);break;case Pe:e(i.perf_apdex,"action",r.duration||0);break;case Oe:t(i.error_weight,0);break;case Ie:if(r.response.is_custom_error||r.response.status>=400)t(i.error_weight,1);else{var a=r.response.timing;a&&e(i.duration_apdex,0,a.duration)}break;case"resource_error":t(i.error_weight,2);break;case"blank_screen":t(i.error_weight,3);break;case"resource":e(i.duration_apdex,1,r.duration);break;case"performance_longtask":r.longtasks.forEach((function(t){e(i.duration_apdex,2,t.duration)}))}}},mt=function(){var e,t,n=function(){e=[0,0,0],t=function(){var e;return(e={error_count:[0,0,0,0],duration_count:[0,0,0]}).perf_apdex={},e}()};n();return[function(n,i,r){var o=n&&n[i];if(o&&!(r<=0)){var a=r<(o[0].threshold||0)?0:r>(o[1].threshold||0)?2:1;if(e[a]+=o[a].weight,"string"==typeof i){var s=dt(i,a),c=t.perf_apdex[s];t.perf_apdex[s]=(c||0)+1}else 2===a&&(t.duration_count[i]+=1)}},function(n,i){n&&(e[2]+=n[i],t.error_count[i]+=1)},function(){return[e,t]},n]},_t=function(e,t,n,r){var o,a,s=r.sendInit,c=r.initPid,l=r.routeMode,u=r.extractPid,f=r.onPidUpdate,d=pt(l)?function(){return""}:function(e){return function(t){var n;return"hash"===e?(null===(n=ne(t).hash)||void 0===n?void 0:n.replace(/^#/,""))||"/":ne(t).path}}(l),h=u||function(){},p=i(function(e,t,n,i){var r=n,o=t;return i&&i(t),[function(t,n,a){"user_set"!==t&&n!==r?(r=n,o=null!=a?a:r,i&&i(o),e(t,o)):"user_set"===t&&n!==o&&(o=n,i&&i(o),e(t,o))},function(){t&&e("init",t)}]}(ht(e),c||function(e){var t;return null!==(t=h(e))&&void 0!==t?t:d(e)}(location.href),d(location.href),f),2),v=p[0],g=p[1];if(!pt(l)){var m=i((o=function(e,t){return v(e,d(t),h(t))},a="",[function(e,t){t!==a&&o(e,a=t)}]),1)[0];n.length&&n.forEach((function(e){return t.push(e[0]((function(e){return m(l,e)})))}))}return s&&g(),[v.bind(null,"user_set")]},yt=function(e,t,n,r){var o,a,s,c=i(n,2),l=c[0],u=c[1],f=2===r.apdex,d=void 0,h=void 0,p=void 0,v=!1,g=i(mt(),4),m=g[0],_=g[1],y=g[2],b=g[3],E=i(mt(),4),w=E[0],k=E[1],S=E[2],x=E[3],T=i((o={start:q(),end:0,time_spent:0,is_bounced:!1,entry:"",exit:"",p_count:0,a_count:0},[function(e,t){var n=i(e,3),r=n[0],a=n[1],s=n[2];o.end=q(),o.time_spent+=t&&t.time_spent||0,o.last_page=t,o.p_count+=1,o.rank=r,o.apdex=a,o.apdex_detail=s;var c=W();c&&(o.is_bounced=!function(e){return"complete"===e.readyState}(c))},function(e,t){o.time_spent+=e.time_spent,o.p_count+=1,o.exit=t},function(){o.a_count+=1},function(e){o.entry=e,o.exit=e},function(){return o}]),5),A=T[0],z=T[1],C=T[2],D=T[3],R=T[4],O=i((a=0,s=void 0,[function(e){if(e){if(!s)return;a+=q()-s,s=void 0}else s=q()},function(){s&&(a+=q()-s);var e=a;return a=0,s=q(),e}]),2),I=O[0],M=O[1];t.push(l[0](I)),!f&&t.push(u[0]((function(){if(v){var t=i(S(),2),n=t[0],r=t[1],o=vt(n,p);A([o,n,r],U()),e({ev_type:Re,payload:R()}),x()}})));var P=gt(m,_),N=gt(w,k),U=function(){var e=i(y(),2),t=e[0],n=e[1];return{start:d[0],pid:d[1],view_id:d[2],end:q(),time_spent:M(),apdex:t,rank:vt(t,p),detail:n}};return t.push((function(){v=!1})),[function(e,t){if(!d)return d=[q(),e,t],D(e),void(v=!(!p||!d));v&&(h=U(),z(h,e)),d=[q(),e,t],b()},function(e){v&&(f||(N(e,p),e.ev_type===Pe&&C()),e.common.pid===d[1]&&P(e,p))},function(t){v&&(t.payload.last=h),e(t)},function(e){if(!e)return t.forEach((function(e){return e()})),void(t.length=0);v=!(!(p=e)||!d)}]},bt="pageview",Et={sendInit:!0,routeMode:"history",apdex:2};var wt=function(e){e.provide("sendEvent",(function t(n){var i=function(e){if(e&&l(e)&&e.name&&v(e.name)){var t={name:e.name,type:"event"};if("metrics"in e&&l(e.metrics)){var n=e.metrics,i={};for(var r in n)p(n[r])&&(i[r]=n[r]);t.metrics=i}if("categories"in e&&l(e.categories)){var o=e.categories,a={};for(var r in o)a[r]=x(o[r]);t.categories=a}return"attached_log"in e&&v(e.attached_log)&&(t.attached_log=e.attached_log),t}}(n);if(i){var r=function(e){var t;if("object"===("undefined"==typeof window?"undefined":J(window))&&window.__perfsee__){var n={};return null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,n,e),n.stack}}(t);r&&(i.stacks=r),e.report({ev_type:Me,payload:i,extra:{timestamp:q()}})}})),e.provide("sendLog",(function(t){var n=function(e){if(e&&l(e)&&e.content&&v(e.content)){var t={content:x(e.content),type:"log",level:"info"};if("level"in e&&(t.level=e.level),"extra"in e&&l(e.extra)){var n=e.extra,i={},r={};for(var o in n)p(n[o])?i[o]=n[o]:r[o]=x(n[o]);t.metrics=i,t.categories=r}return"attached_log"in e&&v(e.attached_log)&&(t.attached_log=e.attached_log),t}}(t);n&&e.report({ev_type:Me,payload:n,extra:{timestamp:q()}})}))};function kt(e){return(null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||""}var St=function(e,t){var n=e.common||{};return n.sample_rate=t,e.common=n,e},xt=function(e,t,n,i,r){return e?function(e){return function(){return e}}(r(i,t)):function(){return n(t)}},Tt=function(e,t,n,i){var r=E(e,t,(function(e,t){return e[t]}));if(void 0===r)return!1;var o=function(e){return"boolean"==typeof e}(r)?"bool":p(r)?"number":"string";return function(e,t,n){switch(n){case"eq":return y(t,e);case"neq":return!y(t,e);case"gt":return e>t[0];case"gte":return e>=t[0];case"lt":return e<t[0];case"lte":return e<=t[0];case"regex":return Boolean(e.match(new RegExp(t.join("|"))));case"not_regex":return!e.match(new RegExp(t.join("|")));default:return!1}}(r,function(e,t){return e.map((function(e){switch(t){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}}))}(i,o),n)},At=function e(t,n){try{return"rule"===n.type?Tt(t,n.field,n.op,n.values):"and"===n.type?n.children.every((function(n){return e(t,n)})):n.children.some((function(n){return e(t,n)}))}catch(e){return ce(e),!1}},zt=function(e,t,n,i,r){if(!t)return c;var o=t.sample_rate,a=t.include_users,s=t.sample_granularity,l=t.rules,u=t.r,f=void 0===u?Math.random():u;if(y(a,e))return function(e){return St(e,1)};var d="session"===s,h=xt(d,o,n,f,i),p=function(e,t,n,i,r,o){var a={};return Object.keys(e).forEach((function(s){var c=e[s],l=c.enable,u=c.sample_rate,f=c.conditional_sample_rules;l?(a[s]={enable:l,sample_rate:u,effectiveSampleRate:u*n,hit:xt(t,u,i,r,o)},f&&(a[s].conditional_hit_rules=f.map((function(e){var a=e.sample_rate,s=e.filter;return{sample_rate:a,hit:xt(t,a,i,r,o),effectiveSampleRate:a*n,filter:s}})))):a[s]={enable:l,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}})),a}(l,d,o,n,f,i);return function(e){var t;if(!h())return d&&r[0](),!1;if(!(e.ev_type in p))return St(e,o);if(!p[e.ev_type].enable)return d&&r[1](e.ev_type),!1;if(null===(t=e.common)||void 0===t?void 0:t.sample_rate)return e;var n=p[e.ev_type],i=n.conditional_hit_rules;if(i)for(var a=0;a<i.length;a++)if(At(e,i[a].filter))return!!i[a].hit()&&St(e,i[a].effectiveSampleRate);return n.hit()?St(e,n.effectiveSampleRate):((!i||!i.length)&&d&&r[1](e.ev_type),!1)}},Ct=function(e,t,n){var i=t.url,r=t.data,o=t.success,a=void 0===o?s:o,c=t.fail,l=void 0===c?s:c,u=t.getResponseText,f=void 0===u?s:u,d=t.withCredentials,h=void 0!==d&&d,p=new n;p.withCredentials=h,p.open(e,i,!0),p.setRequestHeader("Content-Type","application/json"),p.onload=function(){null==f||f(this.responseText);try{if(this.status>=400)l(new Error(this.responseText||this.statusText));else if(this.responseText){var e=JSON.parse(this.responseText);a(e)}else a({})}catch(e){l(e)}},p.onerror=function(){l(new Error("Network request failed"))},p.onabort=function(){l(new Error("Network request aborted"))},p.send(r)},Dt=function(){var e=Y();return e?{useBeacon:!0,get:function(t){Ct("GET",t,e)},post:function(t){Ct("POST",t,e)}}:{get:s,post:s}};function Rt(e){var t=function(e){var t,n=e.transport,i=e.endpoint,r=e.size,a=void 0===r?10:r,s=e.wait,c=void 0===s?1e3:s,l=[],u=0,f={getSize:function(){return a},getWait:function(){return c},setSize:function(e){a=e},setWait:function(e){c=e},getEndpoint:function(){return i},setEndpoint:function(e){i=e},send:function(e){l.push(e),l.length>=a&&d.call(this),clearTimeout(u),u=setTimeout(d.bind(this),c)},flush:function(){clearTimeout(u),d.call(this)},getBatchData:function(){return l.length?o(l):""},clear:function(){clearTimeout(u),l=[]},fail:function(e){t=e}};function d(){if(l.length){var e=this.getBatchData();n.post({url:i,data:e,fail:function(n){t&&t(n,e)}}),l=[]}}return f}(e),n=t.send;return function(e){var t=$();if(t){var n=i(he(e),1)[0];["unload","beforeunload","pagehide"].forEach((function(e){fe(t,e,n,!1)}))}}((function(){if(e.transport.useBeacon){var i=function(){var e=$();return e&&e.navigator.sendBeacon?{get:function(){},post:function(t,n){e.navigator.sendBeacon(t,n)}}:{get:s,post:s}}(),r=t.getBatchData();r&&(i.post(t.getEndpoint(),r),t.clear()),t.send=function(e){i.post(t.getEndpoint(),o([e]))},function(e){var t=W(),n=$();if(t&&n){var i=s;i=de(t,"visibilitychange",(function(){"visible"===t.visibilityState&&(e(),i())}),!0)}}((function(){t.send=n}))}else t.flush()})),t}var Ot="mon-va.byteoversea.com",It="https://sf16-short-sg.bytedapm.com/slardar/fe/sdk-web/plugins",Mt="1.14.5",Pt="SDK_SLARDAR_WEB",Nt="/monitor_web/settings/browser-settings",Ut="/monitor_browser/collect/batch/",Bt="SLARDAR",Gt=["/log/sentry/",Ut,Nt],Lt="session",jt=["blankScreen","action"],Ft={sample_rate:1,include_users:[],sample_granularity:Lt,rules:{}};function Kt(e,t,n){void 0===n&&(n=qt),function(e){var t=$(),n=W();t&&n&&("complete"!==n.readyState?fe(t,"load",(function(){setTimeout((function(){e()}),0)}),!1):e())}((function(){e.on("init",(function(){n(e,t)}))}))}var Ht=function(e,t,n,i){void 0===i&&(i=$t);var r=t.config(),o=r.plugins,a=r.pluginBundle,s=e.filter((function(e){return o[e]&&!t.destroyAgent.has(e)})),c=function(){return s.forEach((function(e){return Jt(t,e,n)}))};s.every((function(e){return Xt(e,n)}))?c():i(t,{name:a.name},c)},Vt=function(e,t,n,i){void 0===i&&(i=$t);var r=t.config().plugins;e.filter((function(e){return r[e]&&!t.destroyAgent.has(e)})).forEach((function(e){Xt(e,n)?Jt(t,e,n):i(t,{name:e,config:r[e]},(function(){return Jt(t,e,n)}))}))};function qt(e,t,i){void 0===i&&(i=$t);var r=e.config().pluginBundle,o=r?r.plugins:[];Ht(o,e,t,i),Vt(jt,e,t,i),e.provide("reloadPlugin",function(e){return function(t,i){var r,o=e.config().pluginBundle;e.destroyAgent.has(t)&&e.destroyAgent.remove(t),void 0!==i&&e.set({plugins:n(n({},e.config().plugins),(r={},r[t]=i,r))}),o&&~o.plugins.indexOf(t)?Ht([t],e):Vt([t],e)}}(e))}function $t(e,t,n,i){var r=t.name,o=t.config;void 0===i&&(i=pe);var a=function(e,t,n){var i;return null!==(i=null==n?void 0:n.path)&&void 0!==i?i:e.config().pluginPathPrefix+"/"+(r=t,r.replace(/([a-z])([A-Z])/g,(function(e,t,n){return t+"-"+n.toLowerCase()}))+".")+"1.14.5.js";var r}(e,r,o);i(a,(function(){n()}))}function Jt(e,t,n){if(void 0===n&&(n=se($())),n){var i=Wt(n,t);if(i)try{if(e.destroyAgent.has(t))return;i.apply(e)}catch(e){ce(e),O("[loader].applyPlugin failed",t,e)}else O("[loader].applyPlugin not found",t)}}function Wt(e,t){return e.plugins.filter((function(e){return e.name===t&&e.version===Mt}))[0]}function Xt(e,t){return void 0===t&&(t=se($())),!(!t||!t.plugins)&&!!Wt(t,e)}function Zt(e,t,n){void 0===n&&(n=se($())),n&&n.plugins&&(Wt(n,e)||n.plugins.push({name:e,version:Mt,apply:t}))}function Yt(e){var t,n;try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(["userId","deviceId","sessionId","env"]),r=i.next();!r.done;r=i.next()){var o=r.value;e[o]||delete e[o]}}catch(e){t={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return e}function Qt(e){var t=e.plugins||{};for(var i in t)t[i]&&!l(t[i])&&(t[i]={});return Yt(n(n({},e),{plugins:t}))}function en(e){return l(e)&&"bid"in e}function tn(e){return Yt(n({},e))}function nn(e){var t;if(!e)return{};var n=e.sample,i=e.plugins,r=e.timestamp,o=e.quota_rate,a=void 0===o?1:o,s=e.apdex;if(!n)return{};var c=n.sample_rate,l=n.sample_granularity,u=void 0===l?Lt:l,f=n.include_users,d=n.rules;return{sample:{include_users:f,sample_rate:c*a,sample_granularity:u,rules:(void 0===d?[]:d).reduce((function(e,t){var n=t.name,i=t.enable,r=t.sample_rate,o=t.conditional_sample_rules;return e[n]={enable:i,sample_rate:r,conditional_sample_rules:o},e}),{})},plugins:{heatmap:null!==(t=null==i?void 0:i.heatmap)&&void 0!==t&&t},apdex:s,serverTimestamp:r}}var rn=function(e,t){return void 0===t&&(t=Ut),(e&&e.indexOf("//")>=0?"":"https://")+e+t},on=function(e,t){return void 0===t&&(t=Nt),(e&&e.indexOf("//")>=0?"":"https://")+e+t},an=function(){return N()},sn=function(e){var t=[];return e.observe=function(e){t.push(e)},e.push=function(){for(var n,o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return o.forEach((function(e){t.forEach((function(t){return t(e)}))})),(n=[].push).call.apply(n,r([e],i(o),!1))},e},cn=function(){var e,t,n,i=$(),r=W();if(i&&r)return(null===(n=null===(t=null===(e=ee())||void 0===e?void 0:e.getAttribute("src"))||void 0===t?void 0:t.match(/globalName=(.+)$/))||void 0===n?void 0:n[1])||"Slardar"},ln=function(e){return Bt+e},un=function(e,t){try{var n=localStorage.getItem(e);if(!n||!ge()||"{"!==n[0])return;_e(e,JSON.parse(n),t)}catch(e){}},fn=function(e,t){void 0===e&&(e="");var n={userId:N(),deviceId:N()};if(t<=0)return n;var i=ln(e);un(i,t);var r=me(i);return{userId:(null==r?void 0:r.userId)||n.userId,deviceId:(null==r?void 0:r.deviceId)||n.deviceId}},dn=function(e){var t=e.bid,n=e.userId,i=e.deviceId,r=e.storageExpires,o=ln(t);_e(o,{userId:n,deviceId:i},ye(r))},hn={get:function(){return this.__SLARDAR__REPALCE__HOLDER__}},pn=function(e){var t,i,r=e,o={},a=hn.get(),c=s,l=s;return{getConfig:function(){return r},setConfig:function(e){return o=n(n({},o),e||{}),u(),t||(t=e,r.useLocalConfig||!r.bid?(i={},c()):a?f():vn(r.transport,r.domain,r.bid,(function(e){a=e,f()}))),r},onChange:function(e){l=e},onReady:function(e){c=function(){dn(r),e()},i&&c()}};function u(){var t=n(n(n({},e),i||{}),o);t.plugins=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},i=0;i<e.length;)n=m(n,e[i++]);return n}(e.plugins,(null==i?void 0:i.plugins)||{},o.plugins||{}),t.sample=gn(gn(e.sample,null==i?void 0:i.sample),o.sample),r=t,l()}function f(){i=nn(a),u(),c()}};function vn(e,t,n,i){e.get({withCredentials:!0,url:on(t)+"?bid="+n+"&store=1",success:function(e){i(e.data||{})},fail:function(){i({sample:{sample_rate:.001}})}})}function gn(e,t){if(!e||!t)return e||t;var o=n(n({},e),t);return o.include_users=r(r([],i(e.include_users||[]),!1),i(t.include_users||[]),!1),o.rules=r(r([],i(Object.keys(e.rules||{})),!1),i(Object.keys(t.rules||{})),!1).reduce((function(o,a){var s,c;return a in o||(a in(e.rules||{})&&a in(t.rules||{})?(o[a]=n(n({},e.rules[a]),t.rules[a]),o[a].conditional_sample_rules=r(r([],i(e.rules[a].conditional_sample_rules||[]),!1),i(t.rules[a].conditional_sample_rules||[]),!1)):o[a]=(null===(s=e.rules)||void 0===s?void 0:s[a])||(null===(c=t.rules)||void 0===c?void 0:c[a])),o}),{}),o}var mn,_n={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:n(n({},e.extra||{}),e.overrides||{})}}},yn=function(e,t){var i=t||{},r=i.pid,o=void 0===r?"":r,a=i.viewId,s=void 0===a?"":a,c={url:ie(),timestamp:q(),sdk_version:Mt,sdk_name:Pt,pid:o,view_id:s};return n(n({},e),{extra:n(n({},c),e.extra||{})})},bn=function(e){e.on("report",(function(t){return yn(t,e.config())})),e.on("init",(function(){var t=e.config(),i=t.pid,r=t.viewId,o=e.getPreStartQueue();o.forEach((function(e,t){var a=e.extra||{};o[t]=n(n({},e),{extra:n(n({},a),{pid:a.pid||i,view_id:a.view_id||r})})}))}))},En={sri:"reportSri",st:"reportResourceError",err:"captureException",reject:"captureException"},wn=function(e){return Object.keys(e).reduce((function(e,t){return e[t]=[],e}),{})},kn=function(e){return Object.keys(e).reduce((function(t,n){return t[e[n]]?t[e[n]].push(n):t[e[n]]=[n],t}),{})},Sn=function(e,t,i){return function(r,o,a,s){var c;void 0===a&&(a=q()),void 0===s&&(s=location.href);var l=n(n({},le(e)),{url:s,timestamp:a});t[r]&&(e[i[r]]?ue(e,l)((function(){e[i[r]](o)})):null===(c=t[r])||void 0===c||c.push([o,l]))}},xn=function(e,t,n){return function(r){r in n&&n[r].forEach((function(n){var o;null===(o=t[n])||void 0===o||o.forEach((function(t){var n=i(t,2),o=n[0],a=n[1];ue(e,a)((function(){e[r](o)}))})),t[n]=null}))}},Tn=function(e,t){return"err"===t?!1!==E(e,"plugins.jsError.onerror",(function(e,t){return e[t]})):"reject"!==t||!1!==E(e,"plugins.jsError.onunhandledrejection",(function(e,t){return e[t]}))},An=function(e,t){var n;void 0===t&&(t=En);var r=wn(t),o=kn(t),a=Sn(e,r,t);(null===(n=e.p)||void 0===n?void 0:n.a)&&"observe"in e.p.a&&e.p.a.observe((function(t){var n=i(t,5);n[0];var r=n[1],o=n[2],s=n[3],c=n[4],l=e.config();Tn(l,r)&&a(r,o,s,c)})),e.on("init",(function(){var t,n=e.config();null===(t=e.p)||void 0===t||t.a.forEach((function(e){var t=i(e,5);t[0];var r=t[1],o=t[2],s=t[3],c=t[4];Tn(n,r)&&a(r,o,s,c)})),e.p&&e.p.a&&(e.p.a.length=0),e.provide("precollect",(function(e,t,i,r){void 0===i&&(i=q()),void 0===r&&(r=location.href),Tn(n,e)&&a(e,t,i,r)}))})),e.on("provide",xn(e,r,o))},zn=function(e){var t=i(e,2),n=t[0],r=t[1];return{ev_type:Oe,payload:{error:ot(n),breadcrumbs:[],extra:r||{}},extra:{bid:"slardar_sdk"}}},Cn=function(e,t){void 0===t&&(t=.001);var n=se($());n&&(n.errors||(n.errors=[]),"observe"in n.errors||I(t)&&(n.errors=sn(n.errors),n.errors.forEach((function(t){e.report(zn(t))})),n.errors.observe((function(t){e.report(zn(t))}))))},Dn=function(e){var t,i=!1;e.on("init",(function(){t=(new Date).getTime(),e.on("config",(function(){var r,o=null===(r=e.config())||void 0===r?void 0:r.serverTimestamp;if(!(isNaN(o)||Number(o)<=0||i)){i=!0;var a=(new Date).getTime();if(a-t<700&&o){var s=o-(a+t)/2;!isNaN(s)&&(s>0||s<-6e5)&&e.on("beforeBuild",(function(e){var t;return n(n({},e),{extra:n(n({},null!==(t=e.extra)&&void 0!==t?t:{}),{sdk_offset:null!=s?s:0})})}))}}}))}))},Rn=function(e,t){var i={};return i.bid=t.bid,i.user_id=t.userId,i.device_id=t.deviceId,i.session_id=t.sessionId,i.release=t.release,i.env=t.env,n(n({},e),{extra:n(n({},i),e.extra||{})})},On=function(e){e.on("beforeBuild",(function(t){return Rn(t,e.config())}))},In=function(e){e.on("start",(function(){var t=e.config().bid,n=e.getSender();n.setEndpoint(n.getEndpoint()+"?biz_id="+t)}))},Mn=function(e){var t=ye(e.storageExpires),n=fn(e.bid,t);return{bid:"",pid:"",viewId:ft("_"),userId:n.userId,deviceId:n.deviceId,storageExpires:t,sessionId:an(),domain:Ot,pluginBundle:{name:"commonMonitors",plugins:["breadcrumb","jsError","performance","resourceError","resource"]},pluginPathPrefix:It,plugins:{ajax:{ignoreUrls:Gt},fetch:{ignoreUrls:Gt},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1,heatmap:!1},release:"",env:"production",sample:Ft,transport:Dt()}},Pn=function(e){var t=void 0===e?{}:e,o=t.createSender,a=void 0===o?function(e){return Rt({size:20,endpoint:rn(e.domain),transport:e.transport})}:o,s=t.builder,c=void 0===s?_n:s,l=t.createDefaultConfig,u=F({validateInitConfig:en,initConfigNormalizer:Qt,userConfigNormalizer:tn,createSender:a,builder:c,createDefaultConfig:void 0===l?Mn:l,createConfigManager:pn});Cn(u),K(u);var f=se($());!function(e,t){var n=t||{},r={};e.provide("setFilter",(function(e,t){r[e]||(r[e]=[]),r[e].push(t)})),e.provide("initSubject",(function(t){var o=i(t,2),a=o[0],s=o[1],c=function(e){return e.split("_")[0]}(a),l=!!c&&r[c];return n[a]||(n[a]=G(s,(function(){n[a]=void 0}))),l?V(e,[a,L(n[a],l)]):n[a]})),e.provide("getSubject",(function(e){return n[e]})),e.provide("privateSubject",{})}(u,f&&f.subject),Dn(u),On(u),bn(u),function(e){var t=Q(),i=kt(t);t&&(t.onchange=function(){i=kt(t)}),e.on("report",(function(e){return n(n({},e),{extra:n(n({},e.extra||{}),{network_type:i})})}))}(u),In(u);var d=function(e,t,n){var o={},a=function n(){for(var a,s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];var l=s[0];if(l){var u=l.split(".")[0];if(!(u in n)){var f=o[u]||[],d=null!==(a=null==t?void 0:t(e))&&void 0!==a?a:{};return f.push(r([d],i(s),!1)),void(o[u]=f)}return w(n,l,[].slice.call(s,1))}};for(var s in T(e,"provide",(function(t){return function(n,i){a[n]=i,t.call(e,n,i)}}))(),e)Object.prototype.hasOwnProperty.call(e,s)&&(a[s]=e[s]);return e.on("provide",(function(t){o[t]&&(o[t].forEach((function(t){var r=i(t),o=r[0],a=r.slice(1);null==n||n(e,o,a)})),o[t]=null)})),a}(u,le,(function(e,t,n){return ue(e,t)((function(){var e=i(n),t=e[0],o=e.slice(1);u[t].apply(u,r([],i(o),!1))}))}));return function(e,t){e.on("init",(function(){var n=[],i=function(i){i.forEach((function(i){var r=i.name;y(n,r)||(n.push(r),i.setup(e),t&&t(r,i.setup),e.destroyAgent.set(r,r,[function(){n=b(n,r),i.tearDown&&i.tearDown()}]))}))};e.provide("applyIntegrations",i);var r=e.config();r&&r.integrations&&i(r.integrations)}))}(d,Zt),d},Nn=((mn={}).pageview=function(e){e.on("init",(function(){var t,r=null===(t=e.config())||void 0===t?void 0:t.plugins.pageview;!function(e,t){var r,o=ve(t,Et);if(o&&X()){var a=o.routeMode,c=o.apdex,l=e.report.bind(e),u=s;if(c){var f=[],d=i(yt(e.report.bind(e),f,[H(e,st),H(e,ct)],o),4),h=d[0],p=d[1],v=d[2],g=d[3];l=v,u=h,e.on("send",p),f.push((function(){return e.off("send",p)})),e.on("start",(function(){g(e.config().apdex)})),j(e,bt,Re,f)}var m=[],_=i(_t(l,m,pt(a)?[]:[e.initSubject(lt),e.initSubject(ut)],n(n({},o),{initPid:null===(r=e.config())||void 0===r?void 0:r.pid,onPidUpdate:function(t){var n=ft(t);u(t,n),e.set({pid:t,viewId:n,actionId:void 0})}})),1)[0];V(e,["f_view_0",ae(e)],-1);var y=function(){_(e.config().pid)};e.on("config",y),m.push((function(){return e.off("config",y)})),j(e,bt,De,m),e.provide("sendPageview",_)}}(e,r)}))},mn.ajax=function(e){e.on("init",(function(){var t,i=null===(t=e.config())||void 0===t?void 0:t.plugins.ajax;!function(e,t){var i=ve(t,qe);if(i){var r=[],o=n(n({},i),{setContextAtReq:function(){return oe(e,!0)},setTraceHeader:Be(i.trace)}),a=function(){return H(e,Ce)};o.autoWrap&&Ke(r,[H(e,["xhr_0",xe(XMLHttpRequest&&XMLHttpRequest.prototype)]),a],o),j(e,Ve,Ie,r),e.provide("wrapXhr",(function(e){function t(){var t=new e;return Ke(r,[G(xe(t)),a],o),t}return t.prototype=new e,["DONE","HEADERS_RECIEVED","LOADING","OPENED","UNSENT"].forEach((function(n){t[n]=e[n]})),t}))}}(e,i)}))},mn.fetch=function(e){e.on("init",(function(){var t,i=null===(t=e.config())||void 0===t?void 0:t.plugins.fetch;!function(e,t){var i=ve(t,nt);if(i){var r=[],o=n(n({},i),{setContextAtReq:function(){return oe(e,!0)},setTraceHeader:Be(i.trace)}),a=function(){return H(e,Ce)};o.autoWrap&&$e(r,[H(e,Ae),a],o),j(e,tt,Ie,r),e.provide("wrapFetch",(function(e){var t=void 0;return $e(r,[G((function(n){t=Te(e,n)})),a],o),t}))}}(e,i)}))},mn),Un=function e(t){void 0===t&&(t={});var n=Pn(t);return function(e){e.on("start",(function(){var t=e.config(),n=t.userId,i=t.sample,r=zt(n,i,I,M,[function(){e.destroy()},function(t){e.destroyAgent.removeByEvType(t)}]);e.on("build",r)}))}(n),An(n),wt(n),Object.keys(Nn).forEach((function(e){Zt(e,Nn[e]),Nn[e](n)})),Kt(n),n.provide("create",e),n},Bn="precollect",Gn=3e5;var Ln=Un(),jn=$();jn&&function(e,t){if("addEventListener"in e){t.pcErr=function(n){var i=(n=n||e.event).target||n.srcElement||{};i instanceof Element||i instanceof HTMLElement?t(Bn,"st",{tagName:i.tagName,url:i.getAttribute("href")||i.getAttribute("src")}):t(Bn,"err",n.error)},t.pcRej=function(n){n=n||e.event,t(Bn,"reject",n.reason||n.detail&&n.detail.reason)};var n=[];n.push(fe(e,"error",t.pcErr,!0)),n.push(fe(e,"unhandledrejection",t.pcRej,!0)),setTimeout((function(){n.forEach((function(e){return e()}))}),Gn)}"PerformanceObserver"in e&&"PerformanceLongTaskTiming"in e&&(t.pp={entries:[]},t.pp.observer=new PerformanceObserver((function(e){t.pp.entries=t.pp.entries.concat(e.getEntries())})),t.pp.observer.observe({entryTypes:["longtask"]}),setTimeout((function(){t.pp.observer.disconnect()}),Gn))}(jn,Ln),t.BATCH_REPORT_PATH=Ut,t.DEFAULT_IGNORE_PATHS=Gt,t.DEFAULT_SAMPLE_CONFIG=Ft,t.DEFAULT_SAMPLE_GRANULARITY=Lt,t.DEFAULT_SENDER_SIZE=20,t.DEVICE_ID_COOKIE_NAME="MONITOR_DEVICE_ID",t.EV_METHOD_MAP=En,t.EXTRA_INDEPENDENT_PLUGINS=jt,t.InjectConfigPlugin=On,t.InjectEnvPlugin=bn,t.InjectQueryPlugin=In,t.ObserveErrorPlugin=Cn,t.PLUGINS_LOAD_PREFIX=It,t.PluginMap=Nn,t.PrecollectPlugin=An,t.REPORT_DOMAIN=Ot,t.SDK_NAME=Pt,t.SDK_VERSION=Mt,t.SETTINGS_DOMAIN="mon-va.byteoversea.com",t.SETTINGS_PATH=Nt,t.STORAGE_PREFIX=Bt,t.TimeCalibrationPlugin=Dn,t.USER_ID_COOKIE_NAME="MONITOR_WEB_ID",t.addConfigToReportEvent=Rn,t.addEnvToSendEvent=yn,t.applyPlugin=Jt,t.browserBuilder=_n,t.buildSelfErrorEvent=zn,t.configHolder=hn,t.createBrowserClient=Un,t.createBrowserConfigManager=pn,t.createMinimalBrowserClient=Pn,t.createStore=wn,t.default=Ln,t.doesPluginExistInRegistry=Xt,t.filterIfPluginDisabled=Tn,t.getConsumeStored=xn,t.getDefaultConfig=Mn,t.getDefaultSessionId=an,t.getDefaultUserIdAndDeviceId=fn,t.getGlobalInstance=function(){var e=$(),t=cn();if(e&&t)return e[t]},t.getGlobalName=cn,t.getPluginFromRegistry=Wt,t.getReportUrl=rn,t.getServerConfig=vn,t.getSettingsUrl=on,t.getStorageKey=ln,t.getStoreOrConsume=Sn,t.glueCodeForStorageSecurity=un,t.hasSetStorageItem=function(e){void 0===e&&(e="");var t=ln(e);return!!me(t)},t.loadCombinedPlugins=Ht,t.loadIndependentPlugins=Vt,t.loadNow=$t,t.loadPlugins=qt,t.loadPluginsOnPageLoad=Kt,t.mergeSampleConfig=gn,t.normalizeInitConfig=Qt,t.normalizeStrictFields=Yt,t.normalizeUserConfig=tn,t.parseServerConfig=nn,t.register=Zt,t.reverseMap=kn,t.setStorageUserIdAndDeviceId=dn,t.toObservableArray=sn,t.validateInitConfig=en}));!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}(ma),ma.BATCH_REPORT_PATH,ma.DEFAULT_IGNORE_PATHS,ma.DEFAULT_SAMPLE_CONFIG,ma.DEFAULT_SAMPLE_GRANULARITY,ma.DEFAULT_SENDER_SIZE,ma.DEVICE_ID_COOKIE_NAME,ma.EV_METHOD_MAP,ma.EXTRA_INDEPENDENT_PLUGINS,ma.InjectConfigPlugin,ma.InjectEnvPlugin,ma.InjectQueryPlugin,ma.ObserveErrorPlugin,ma.PLUGINS_LOAD_PREFIX,ma.PluginMap,ma.PrecollectPlugin,ma.REPORT_DOMAIN,ma.SDK_NAME,ma.SDK_VERSION,ma.SETTINGS_DOMAIN,ma.SETTINGS_PATH,ma.STORAGE_PREFIX,ma.TimeCalibrationPlugin,ma.USER_ID_COOKIE_NAME,ma.addConfigToReportEvent,ma.addEnvToSendEvent,ma.applyPlugin,ma.browserBuilder,ma.buildSelfErrorEvent,ma.configHolder;var _a=ma.createBrowserClient;function ya(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ba(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}ma.createBrowserConfigManager,ma.createMinimalBrowserClient,ma.createStore,ma.doesPluginExistInRegistry,ma.filterIfPluginDisabled,ma.getConsumeStored,ma.getDefaultConfig,ma.getDefaultSessionId,ma.getDefaultUserIdAndDeviceId,ma.getGlobalInstance,ma.getGlobalName,ma.getPluginFromRegistry,ma.getReportUrl,ma.getServerConfig,ma.getSettingsUrl,ma.getStorageKey,ma.getStoreOrConsume,ma.glueCodeForStorageSecurity,ma.hasSetStorageItem,ma.loadCombinedPlugins,ma.loadIndependentPlugins,ma.loadNow,ma.loadPlugins,ma.loadPluginsOnPageLoad,ma.mergeSampleConfig,ma.normalizeInitConfig,ma.normalizeStrictFields,ma.normalizeUserConfig,ma.parseServerConfig,ma.register,ma.reverseMap,ma.setStorageUserIdAndDeviceId,ma.toObservableArray,ma.validateInitConfig;var Ea=$((function e(t,n){var i=this;V(this,e),this.sendEvent=function(e){i._client&&i._client.sendEvent&&i._client.sendEvent(e)},this.captureException=function(e){i._client&&i._client.captureException&&i._client.captureException(e)},this.reportActualFMP=function(){};var r=(null!=t?t:{}).slardar,o=null!=n?n:{},a=o.region,s=void 0===a?la.US_EAST:a,c=o.bid,l=void 0===c?ga:c,u=o.mode,f=void 0===u?fa.PRODUCTION:u,d=o.consumerBid,h=o.version,p=void 0===h?va:h,v=o.appId,g=o.appVersion,m=o.tenant;this._client=_a();var _={};switch(s){case la.US_EASTRED:case la.EU_TTP:case la.EU_TTP2:_={domain:"https://mon16-normal-useastred.tiktokv.eu",pluginPathPrefix:"https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/slardar/fe/sdk-web/plugins"};break;case la.US_TTP:case la.US_TTP2:_={domain:"https://mon16-normal-useast5.tiktokv.us",pluginPathPrefix:"https://lf16-cdn-tos.tiktokcdn-us.com/obj/static-tx/slardar/fe/sdk-web/plugins"};break;case la.US_EAST:case la.SINGAPORE_CENTRAL:default:_={domain:"https://mon.tiktokv.com",pluginPathPrefix:"https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/slardar/fe/sdk-web/plugins"}}this._client&&(this._client("context.merge",{appId:String(v),appVersion:String(null!=g?g:"0.0.0"),tenant:String(m)}),this._client("init",ba(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){ya(e,t,n[t])}))}return e}({},_,r),{bid:l,pid:d||window.location.href,release:p,env:f,plugins:{pageview:!1,jsError:{onerror:!1,onunhandledrejection:!1},tti:!1,performance:!1,resource:!1,ajax:!1,fetch:!1,fmp:!1,blankScreen:!1}})),this._client("start"))})),wa=function(){return(wa=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function ka(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function Sa(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function xa(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function Ta(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(xa(arguments[t]));return e}var Aa,za=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var n=this;e&&t&&"function"==typeof t&&this.on(e,(function i(r){t(r),n.off(e,i)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var n=this._hooks[e].indexOf(t);-1!==n&&this._hooks[e].splice(n,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,n){if(n){if(!e)return;-1!==this._cache.indexOf(n)?this._emit(e,t):(this._hooksCache.hasOwnProperty(n)||(this._hooksCache[n]={}),this._hooksCache[n].hasOwnProperty(e)||(this._hooksCache[n][e]=[]),this._hooksCache[n][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&Ta(this._hooks[e]).forEach((function(e){try{e(t)}catch(e){}}))},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),Ca=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},Da=function(e){return Array.isArray(e)},Ra=(Aa=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return Aa+=1}),Oa=function(e){return function(e,t,n){if("string"==typeof e&&"number"==typeof n){var i,r=[];n=n<=25?n:n%25;var o=String.fromCharCode(n+97);i=e.split(o);for(var a=0;a<i.length;a++){var s=parseInt(i[a],n);s=1*s^64;var c=String.fromCharCode(s);r.push(c)}return r.join("")}}(e,0,25)},Ia=function(){return!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)},Ma=function(e){Ia()?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1)},Pa=function(){var e=0;return["hidden","msHidden","webkitHidden"].forEach((function(t){void 0!==document[t]&&(e=1)})),e},Na=function(e){var t=document.createElement("a");return t.href=e,t},Ua=function(e){var t={};try{var n=Na(e).search;(n=n.slice(1)).split("&").forEach((function(e){var n,i,r=e.split("=");r.length&&(n=r[0],i=r[1]);try{t[n]=decodeURIComponent(void 0===i?"":i)}catch(e){t[n]=i}}))}catch(e){}return t},Ba="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ga(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function La(e,t){return e(t={exports:{}},t.exports),t.exports}var ja,Fa,Ka=La((function(e,t){var n;n=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(i){function r(){}function o(t,n,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},r.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=JSON.stringify(n);/^[\{\[]/.test(a)&&(n=a)}catch(e){}n=i.write?i.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var c in o)o[c]&&(s+="; "+c,!0!==o[c]&&(s+="="+o[c].split(";")[0]));return document.cookie=t+"="+n+s}}function a(e,n){if("undefined"!=typeof document){for(var r={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var s=o[a].split("="),c=s.slice(1).join("=");n||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var l=t(s[0]);if(c=(i.read||i)(c,l)||t(c),n)try{c=JSON.parse(c)}catch(e){}if(r[l]=c,e===l)break}catch(e){}}return e?r[e]:r}}return r.set=o,r.get=function(e){return a(e,!1)},r.getJSON=function(e){return a(e,!0)},r.remove=function(t,n){o(t,"",e(n,{expires:-1}))},r.defaults={},r.withConverter=n,r}((function(){}))},e.exports=n()})),Ha=La((function(e,t){e.exports=function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){if(!s&&Ga)return Ga();if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,(function(e){return r(t[a][1][e]||e)}),l,l.exports,e,t,n,i)}return n[a].exports}for(var o=Ga,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(e,t,n){(function(e){var n,i,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var o=0,a=new r(u),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),n=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new e.MessageChannel;c.port1.onmessage=u,n=function(){c.port2.postMessage(0)}}var l=[];function u(){var e,t;i=!0;for(var n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}i=!1}t.exports=function(e){1!==l.push(e)||i||n()}}).call(this,void 0!==Ba?Ba:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){var i=e(1);function r(){}var o={},a=["REJECTED"],s=["FULFILLED"],c=["PENDING"];function l(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==r&&h(this,e)}function u(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function f(e,t,n){i((function(){var i;try{i=t(n)}catch(t){return o.reject(e,t)}i===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,i)}))}function d(e){var t=e&&e.then;if(e&&("object"==J(e)||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var n=!1;function i(t){n||(n=!0,o.reject(e,t))}function r(t){n||(n=!0,o.resolve(e,t))}var a=p((function(){t(r,i)}));"error"===a.status&&i(a.value)}function p(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=l,l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var n=new this.constructor(r);return this.state!==c?f(n,this.state===s?e:t,this.outcome):this.queue.push(new u(n,e,t)),n},u.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){f(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){o.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){f(this.promise,this.onRejected,e)},o.resolve=function(e,t){var n=p(d,t);if("error"===n.status)return o.reject(e,n.value);var i=n.value;if(i)h(e,i);else{e.state=s,e.outcome=t;for(var r=-1,a=e.queue.length;++r<a;)e.queue[r].callFulfilled(t)}return e},o.reject=function(e,t){e.state=a,e.outcome=t;for(var n=-1,i=e.queue.length;++n<i;)e.queue[n].callRejected(t);return e},l.resolve=function(e){return e instanceof this?e:o.resolve(new this(r),e)},l.reject=function(e){var t=new this(r);return o.reject(t,e)},l.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);for(var a=new Array(n),s=0,c=-1,l=new this(r);++c<n;)u(e[c],c);return l;function u(e,r){t.resolve(e).then((function(e){a[r]=e,++s!==n||i||(i=!0,o.resolve(l,a))}),(function(e){i||(i=!0,o.reject(l,e))}))}},l.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,n=!1;if(!t)return this.resolve([]);for(var i,a=-1,s=new this(r);++a<t;)i=e[a],this.resolve(i).then((function(e){n||(n=!0,o.resolve(s,e))}),(function(e){n||(n=!0,o.reject(s,e))}));return s}},{1:1}],3:[function(e,t,n){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==Ba?Ba:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){var i="function"==typeof Symbol&&"symbol"==J(Symbol.iterator)?function(e){return J(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":J(e)},r=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function o(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(r){if("TypeError"!==r.name)throw r;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),i=0;i<e.length;i+=1)n.append(e[i]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var a=Promise;function s(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function c(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function l(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function u(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var f=void 0,d={},h=Object.prototype.toString;function p(e){return"boolean"==typeof f?a.resolve(f):function(e){return new a((function(t){var n=e.transaction("local-forage-detect-blob-support","readwrite"),i=o([""]);n.objectStore("local-forage-detect-blob-support").put(i,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return f=e}))}function v(e){var t=d[e.name],n={};n.promise=new a((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function g(e){var t=d[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function m(e,t){var n=d[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function _(e,t){return new a((function(n,i){if(d[e.name]=d[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);v(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var a=r.open.apply(r,o);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore("local-forage-detect-blob-support")}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),i(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),g(e)}}))}function y(e){return _(e,!1)}function b(e){return _(e,!0)}function E(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,r=e.version>e.db.version;if(i&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),r||n){if(n){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function w(e){return o([function(e){for(var t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n),r=0;r<t;r++)i[r]=e.charCodeAt(r);return n}(atob(e.data))],{type:e.type})}function k(e){return e&&e.__local_forage_encoded_blob}function S(e){var t=this,n=t._initReady().then((function(){var e=d[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return c(n,e,e),n}function x(e,t,n,i){void 0===i&&(i=1);try{var r=e.db.transaction(e.storeName,t);n(null,r)}catch(r){if(i>0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===r.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),b(e)})).then((function(){return function(e){v(e);for(var t=d[e.name],n=t.forages,i=0;i<n.length;i++){var r=n[i];r._dbInfo.db&&(r._dbInfo.db.close(),r._dbInfo.db=null)}return e.db=null,y(e).then((function(t){return e.db=t,E(e)?b(e):t})).then((function(i){e.db=t.db=i;for(var r=0;r<n.length;r++)n[r]._dbInfo.db=i})).catch((function(t){throw m(e,t),t}))}(e).then((function(){x(e,t,n,i-1)}))})).catch(n);n(r)}}var T={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var i in e)n[i]=e[i];var r=d[n.name];r||(r={forages:[],db:null,dbReady:null,deferredOperations:[]},d[n.name]=r),r.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=S);var o=[];function s(){return a.resolve()}for(var c=0;c<r.forages.length;c++){var l=r.forages[c];l!==t&&o.push(l._initReady().catch(s))}var u=r.forages.slice(0);return a.all(o).then((function(){return n.db=r.db,y(n)})).then((function(e){return n.db=e,E(n,t._defaultConfig.version)?b(n):e})).then((function(e){n.db=r.db=e,t._dbInfo=n;for(var i=0;i<u.length;i++){var o=u[i];o!==t&&(o._dbInfo.db=n.db,o._dbInfo.version=n.version)}}))},_support:function(){try{if(!r||!r.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var n=this,i=new a((function(t,i){n.ready().then((function(){x(n._dbInfo,"readonly",(function(r,o){if(r)return i(r);try{var a=o.objectStore(n._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var n=a.result;if(n){var i=n.value;k(i)&&(i=w(i));var r=e(i,n.key,s++);void 0!==r?t(r):n.continue()}else t()},a.onerror=function(){i(a.error)}}catch(e){i(e)}}))})).catch(i)}));return s(i,t),i},getItem:function(e,t){var n=this;e=l(e);var i=new a((function(t,i){n.ready().then((function(){x(n._dbInfo,"readonly",(function(r,o){if(r)return i(r);try{var a=o.objectStore(n._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),k(e)&&(e=w(e)),t(e)},a.onerror=function(){i(a.error)}}catch(e){i(e)}}))})).catch(i)}));return s(i,t),i},setItem:function(e,t,n){var i=this;e=l(e);var r=new a((function(n,r){var o;i.ready().then((function(){return o=i._dbInfo,"[object Blob]"===h.call(t)?p(o.db).then((function(e){return e?t:(n=t,new a((function(e,t){var i=new FileReader;i.onerror=t,i.onloadend=function(t){var i=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:i,type:n.type})},i.readAsBinaryString(n)})));var n})):t})).then((function(t){x(i._dbInfo,"readwrite",(function(o,a){if(o)return r(o);try{var s=a.objectStore(i._dbInfo.storeName);null===t&&(t=void 0);var c=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),n(t)},a.onabort=a.onerror=function(){try{var e=c.error?c.error:c.transaction.error;r(e)}catch(e){r(e)}}}catch(e){r(e)}}))})).catch(r)}));return s(r,n),r},removeItem:function(e,t){var n=this;e=l(e);var i=new a((function(t,i){n.ready().then((function(){x(n._dbInfo,"readwrite",(function(r,o){if(r)return i(r);try{var a=o.objectStore(n._dbInfo.storeName).delete(e);o.oncomplete=function(){t()},o.onerror=function(){i(a.error)},o.onabort=function(){try{var e=a.error?a.error:a.transaction.error;i(e)}catch(e){i(e)}}}catch(e){i(e)}}))})).catch(i)}));return s(i,t),i},clear:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){x(t._dbInfo,"readwrite",(function(i,r){if(i)return n(i);try{var o=r.objectStore(t._dbInfo.storeName).clear();r.oncomplete=function(){e()},r.onabort=r.onerror=function(){try{var e=o.error?o.error:o.transaction.error;n(e)}catch(e){n(e)}}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){x(t._dbInfo,"readonly",(function(i,r){if(i)return n(i);try{var o=r.objectStore(t._dbInfo.storeName).count();o.onsuccess=function(){e(o.result)},o.onerror=function(){n(o.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,i=new a((function(t,i){e<0?t(null):n.ready().then((function(){x(n._dbInfo,"readonly",(function(r,o){if(r)return i(r);try{var a=o.objectStore(n._dbInfo.storeName),s=!1,c=(a.openKeyCursor||a.openCursor).call(a);c.onsuccess=function(){var n=c.result;n?0===e||s?t(n.key):(s=!0,n.advance(e)):t(null)},c.onerror=function(){i(c.error)}}catch(e){i(e)}}))})).catch(i)}));return s(i,t),i},keys:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){x(t._dbInfo,"readonly",(function(i,r){if(i)return n(i);try{var o=r.objectStore(t._dbInfo.storeName),a=(o.openKeyCursor||o.openCursor).call(o),s=[];a.onsuccess=function(){var t=a.result;t?(s.push(t.key),t.continue()):e(s)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=u.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var i,o=this;if(e.name){var c=e.name===n.name&&o._dbInfo.db,l=c?a.resolve(o._dbInfo.db):y(e).then((function(t){var n=d[e.name],i=n.forages;n.db=t;for(var r=0;r<i.length;r++)i[r]._dbInfo.db=t;return t}));i=e.storeName?l.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;v(e);var i=d[e.name],o=i.forages;t.close();for(var s=0;s<o.length;s++){var c=o[s];c._dbInfo.db=null,c._dbInfo.version=n}return new a((function(t,i){var o=r.open(e.name,n);o.onerror=function(e){o.result.close(),i(e)},o.onupgradeneeded=function(){o.result.deleteObjectStore(e.storeName)},o.onsuccess=function(){var e=o.result;e.close(),t(e)}})).then((function(e){i.db=e;for(var t=0;t<o.length;t++){var n=o[t];n._dbInfo.db=e,g(n._dbInfo)}})).catch((function(t){throw(m(e,t)||a.resolve()).catch((function(){})),t}))}})):l.then((function(t){v(e);var n=d[e.name],i=n.forages;t.close();for(var o=0;o<i.length;o++)i[o]._dbInfo.db=null;return new a((function(t,n){var i=r.deleteDatabase(e.name);i.onerror=function(){var e=i.result;e&&e.close(),n(i.error)},i.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},i.onsuccess=function(){var e=i.result;e&&e.close(),t(e)}})).then((function(e){n.db=e;for(var t=0;t<i.length;t++)g(i[t]._dbInfo)})).catch((function(t){throw(m(e,t)||a.resolve()).catch((function(){})),t}))}))}else i=a.reject("Invalid arguments");return s(i,t),i}},A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z=/^~~local_forage_type~([^~]+)~/,C="__lfsc__:".length,D=C+"arbf".length,R=Object.prototype.toString;function O(e){var t,n,i,r,o,a=.75*e.length,s=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var l=new ArrayBuffer(a),u=new Uint8Array(l);for(t=0;t<s;t+=4)n=A.indexOf(e[t]),i=A.indexOf(e[t+1]),r=A.indexOf(e[t+2]),o=A.indexOf(e[t+3]),u[c++]=n<<2|i>>4,u[c++]=(15&i)<<4|r>>2,u[c++]=(3&r)<<6|63&o;return l}function I(e){var t,n=new Uint8Array(e),i="";for(t=0;t<n.length;t+=3)i+=A[n[t]>>2],i+=A[(3&n[t])<<4|n[t+1]>>4],i+=A[(15&n[t+1])<<2|n[t+2]>>6],i+=A[63&n[t+2]];return n.length%3==2?i=i.substring(0,i.length-1)+"=":n.length%3==1&&(i=i.substring(0,i.length-2)+"=="),i}var M={serialize:function(e,t){var n="";if(e&&(n=R.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===R.call(e.buffer))){var i,r="__lfsc__:";e instanceof ArrayBuffer?(i=e,r+="arbf"):(i=e.buffer,"[object Int8Array]"===n?r+="si08":"[object Uint8Array]"===n?r+="ui08":"[object Uint8ClampedArray]"===n?r+="uic8":"[object Int16Array]"===n?r+="si16":"[object Uint16Array]"===n?r+="ur16":"[object Int32Array]"===n?r+="si32":"[object Uint32Array]"===n?r+="ui32":"[object Float32Array]"===n?r+="fl32":"[object Float64Array]"===n?r+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(r+I(i))}else if("[object Blob]"===n){var o=new FileReader;o.onload=function(){var n="~~local_forage_type~"+e.type+"~"+I(this.result);t("__lfsc__:blob"+n)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if("__lfsc__:"!==e.substring(0,C))return JSON.parse(e);var t,n=e.substring(D),i=e.substring(C,D);if("blob"===i&&z.test(n)){var r=n.match(z);t=r[1],n=n.substring(r[0].length)}var a=O(n);switch(i){case"arbf":return a;case"blob":return o([a],{type:t});case"si08":return new Int8Array(a);case"ui08":return new Uint8Array(a);case"uic8":return new Uint8ClampedArray(a);case"si16":return new Int16Array(a);case"ur16":return new Uint16Array(a);case"si32":return new Int32Array(a);case"ui32":return new Uint32Array(a);case"fl32":return new Float32Array(a);case"fl64":return new Float64Array(a);default:throw new Error("Unkown type: "+i)}},stringToBuffer:O,bufferToString:I};function P(e,t,n,i){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,i)}function N(e,t,n,i,r,o){e.executeSql(n,i,r,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?o(e,a):P(e,t,(function(){e.executeSql(n,i,r,o)}),o)}),o):o(e,a)}),o)}function U(e,t,n,i){var r=this;e=l(e);var o=new a((function(o,a){r.ready().then((function(){void 0===t&&(t=null);var s=t,c=r._dbInfo;c.serializer.serialize(t,(function(t,l){l?a(l):c.db.transaction((function(n){N(n,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){o(s)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(i>0)return void o(U.apply(r,[e,s,n,i-1]));a(t)}}))}))})).catch(a)}));return s(o,n),o}function B(e){return new a((function(t,n){e.transaction((function(i){i.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,i){for(var r=[],o=0;o<i.rows.length;o++)r.push(i.rows.item(o).name);t({db:e,storeNames:r})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}var G={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var i in e)n[i]="string"!=typeof e[i]?e[i].toString():e[i];var r=new a((function(e,i){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return i(e)}n.db.transaction((function(r){P(r,n,(function(){t._dbInfo=n,e()}),(function(e,t){i(t)}))}),i)}));return n.serializer=M,r},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,i=new a((function(t,i){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){N(n,r,"SELECT * FROM "+r.storeName,[],(function(n,i){for(var o=i.rows,a=o.length,s=0;s<a;s++){var c=o.item(s),l=c.value;if(l&&(l=r.serializer.deserialize(l)),void 0!==(l=e(l,c.key,s+1)))return void t(l)}t()}),(function(e,t){i(t)}))}))})).catch(i)}));return s(i,t),i},getItem:function(e,t){var n=this;e=l(e);var i=new a((function(t,i){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){N(n,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var i=n.rows.length?n.rows.item(0).value:null;i&&(i=r.serializer.deserialize(i)),t(i)}),(function(e,t){i(t)}))}))})).catch(i)}));return s(i,t),i},setItem:function(e,t,n){return U.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=l(e);var i=new a((function(t,i){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){N(n,r,"DELETE FROM "+r.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){i(t)}))}))})).catch(i)}));return s(i,t),i},clear:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){var i=t._dbInfo;i.db.transaction((function(t){N(t,i,"DELETE FROM "+i.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){var i=t._dbInfo;i.db.transaction((function(t){N(t,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],(function(t,n){var i=n.rows.item(0).c;e(i)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,i=new a((function(t,i){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){N(n,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var i=n.rows.length?n.rows.item(0).key:null;t(i)}),(function(e,t){i(t)}))}))})).catch(i)}));return s(i,t),i},keys:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){var i=t._dbInfo;i.db.transaction((function(t){N(t,i,"SELECT key FROM "+i.storeName,[],(function(t,n){for(var i=[],r=0;r<n.rows.length;r++)i.push(n.rows.item(r).key);e(i)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=u.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var i,r=this;return s(i=e.name?new a((function(t){var i;i=e.name===n.name?r._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:i,storeNames:[e.storeName]}):t(B(i))})).then((function(e){return new a((function(t,n){e.db.transaction((function(i){function r(e){return new a((function(t,n){i.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var o=[],s=0,c=e.storeNames.length;s<c;s++)o.push(r(e.storeNames[s]));a.all(o).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):a.reject("Invalid arguments"),t),i}};function L(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}var j={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=L(e,this._defaultConfig),!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch(e){return!0}}()||localStorage.length>0?(this._dbInfo=t,t.serializer=M,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,i=n.ready().then((function(){for(var t=n._dbInfo,i=t.keyPrefix,r=i.length,o=localStorage.length,a=1,s=0;s<o;s++){var c=localStorage.key(s);if(0===c.indexOf(i)){var l=localStorage.getItem(c);if(l&&(l=t.serializer.deserialize(l)),void 0!==(l=e(l,c.substring(r),a++)))return l}}}));return s(i,t),i},getItem:function(e,t){var n=this;e=l(e);var i=n.ready().then((function(){var t=n._dbInfo,i=localStorage.getItem(t.keyPrefix+e);return i&&(i=t.serializer.deserialize(i)),i}));return s(i,t),i},setItem:function(e,t,n){var i=this;e=l(e);var r=i.ready().then((function(){void 0===t&&(t=null);var n=t;return new a((function(r,o){var a=i._dbInfo;a.serializer.serialize(t,(function(t,i){if(i)o(i);else try{localStorage.setItem(a.keyPrefix+e,t),r(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||o(e),o(e)}}))}))}));return s(r,n),r},removeItem:function(e,t){var n=this;e=l(e);var i=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return s(i,t),i},clear:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);0===i.indexOf(e)&&localStorage.removeItem(i)}}));return s(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var n=this,i=n.ready().then((function(){var t,i=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(i.keyPrefix.length)),t}));return s(i,t),i},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,i=[],r=0;r<n;r++){var o=localStorage.key(r);0===o.indexOf(e.keyPrefix)&&i.push(o.substring(e.keyPrefix.length))}return i}));return s(n,e),n},dropInstance:function(e,t){if(t=u.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var i,r=this;return s(i=e.name?new a((function(t){e.storeName?t(L(e,r._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):a.reject("Invalid arguments"),t),i}},F=function(e,t){for(var n,i,r=e.length,o=0;o<r;){if((n=e[o])===(i=t)||"number"==typeof n&&"number"==typeof i&&isNaN(n)&&isNaN(i))return!0;o++}return!1},K=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},H={},V={},q={INDEXEDDB:T,WEBSQL:G,LOCALSTORAGE:j},$=[q.INDEXEDDB._driver,q.WEBSQL._driver,q.LOCALSTORAGE._driver],W=["dropInstance"],X=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(W),Z={description:"",driver:$.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Y(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function Q(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(K(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var ee=new(function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),q)if(q.hasOwnProperty(n)){var i=q[n],r=i._driver;this[n]=r,H[r]||this.defineDriver(i)}this._defaultConfig=Q({},Z),this._config=Q({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":i(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var i=new a((function(t,n){try{var i=e._driver,r=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(r);for(var o=X.concat("_initStorage"),c=0,l=o.length;c<l;c++){var u=o[c];if((!F(W,u)||e[u])&&"function"!=typeof e[u])return void n(r)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=a.reject(t);return s(n,arguments[arguments.length-1]),n}},n=0,i=W.length;n<i;n++){var r=W[n];e[r]||(e[r]=t(r))}}();var f=function(n){H[i]&&console.info("Redefining LocalForage driver: "+i),H[i]=e,V[i]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(f,n):f(!!e._support):f(!0)}catch(e){n(e)}}));return c(i,t,n),i},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var i=H[e]?a.resolve(H[e]):a.reject(new Error("Driver not found."));return c(i,t,n),i},e.prototype.getSerializer=function(e){var t=a.resolve(M);return c(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return c(n,e,e),n},e.prototype.setDriver=function(e,t,n){var i=this;K(e)||(e=[e]);var r=this._getSupportedDrivers(e);function o(){i._config.driver=i.driver()}function s(e){return i._extend(e),o(),i._ready=i._initStorage(i._config),i._ready}var l=null!==this._driverSet?this._driverSet.catch((function(){return a.resolve()})):a.resolve();return this._driverSet=l.then((function(){var e=r[0];return i._dbInfo=null,i._ready=null,i.getDriver(e).then((function(e){i._driver=e._driver,o(),i._wrapLibraryMethodsWithReady(),i._initDriver=function(e){return function(){var t=0;return function n(){for(;t<e.length;){var r=e[t];return t++,i._dbInfo=null,i._ready=null,i.getDriver(r).then(s).catch(n)}o();var c=new Error("No available storage method found.");return i._driverSet=a.reject(c),i._driverSet}()}}(r)}))})).catch((function(){o();var e=new Error("No available storage method found.");return i._driverSet=a.reject(e),i._driverSet})),c(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!V[e]},e.prototype._extend=function(e){Q(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n];this.supports(r)&&t.push(r)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=X.length;e<t;e++)Y(this,X[e])},e.prototype.createInstance=function(t){return new e(t)},e}());t.exports=ee},{3:3}]},{},[4])(4)})),Va=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e}(),qa=function(){function e(){this.support=this.isSupportLS()}return e.prototype.isSupportLS=function(){try{return localStorage.setItem("_applogtest-test-key","hi"),localStorage.getItem("_applogtest-test-key"),localStorage.removeItem("_applogtest-test-key"),!0}catch(e){return!1}},e.prototype.getItem=function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},e.prototype.setItem=function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,n)}catch(e){}},e.prototype.removeItem=function(e){try{localStorage.removeItem(e)}catch(e){}},e}(),$a=function(){function e(){this.support=this.isSupportSession()}return e.prototype.isSupportSession=function(){try{return sessionStorage.setItem("_applogtest-test-key","hi"),sessionStorage.getItem("_applogtest-test-key"),sessionStorage.removeItem("_applogtest-test-key"),!0}catch(e){return!1}},e.prototype.getItem=function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},e.prototype.setItem=function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,n)}catch(e){}},e.prototype.removeItem=function(e){try{sessionStorage.removeItem(e)}catch(e){}},e}(),Ja=function(){function e(e,t){return this.dbStorage=Ha.createInstance({driver:[Ha.INDEXEDDB,Ha.LOCALSTORAGE],name:e,storeName:t}),this.dbStorage}return e.prototype.getItem=function(e){return ka(this,void 0,void 0,(function(){var t,n;return Sa(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.dbStorage.getItem(e)];case 1:t=i.sent(),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return[2,n||void 0];case 2:return i.sent(),console.warn("db get storage error"),[3,3];case 3:return[2,void 0]}}))}))},e.prototype.setItem=function(e,t){try{this.dbStorage.setItem(e,t)}catch(e){console.warn("db set storage error")}},e.prototype.removeItem=function(e){try{this.dbStorage.removeItem(e)}catch(e){console.warn("db remove storage error")}},e}(),Wa=function(){function e(){this.defaultExpireTime=6048e5,this.local=new qa,this.session=new $a,this.cache=new Va}return e.prototype.getLocalItem=function(e){return this.local.getItem(e)},e.prototype.setLocalItem=function(e,t){this.local.setItem(e,t)},e.prototype.removeLocalItem=function(e){this.local.removeItem(e)},e.prototype.getSessionItem=function(e){return this.session.getItem(e)},e.prototype.setSessionItem=function(e,t){this.session.setItem(e,t)},e.prototype.removeSessionItem=function(e){this.session.removeItem(e)},e.prototype.getCacheItem=function(e){return this.cache.getItem(e)},e.prototype.setCacheItem=function(e,t){this.cache.setItem(e,t)},e.prototype.removeCacheItem=function(e){this.cache.removeItem(e)},e.prototype.getCookie=function(e,t){try{return Ka.get(e)}catch(e){return""}},e.prototype.setCookie=function(e,t,n,i){void 0===n&&(n=this.defaultExpireTime);try{var r=i||document.domain,o=+new Date+n;Ka.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(e){}},e.prototype.removeCookie=function(e,t){try{Ka.remove(e,{path:"/",domain:t||""})}catch(e){}},e}(),Xa=function(){function e(e,t,n){this.appid=e,this.domain=t,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=n}return e.prototype.init=function(){var e,t=window.navigator.userAgent,n=window.navigator.language,i=document.referrer,r=i?Na(i).hostname:"",o=Ua(window.location.href),a=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web",s=(null===(e=window.navigator.connection)||void 0===e?void 0:e.effectiveType)||"";this.utm=function(e,t,n,i){var r=new Wa,o=e?"_tea_utm_cache_"+e:"_tea_utm_cache",a=e?"_$utm_from_url_"+e:"_$utm_from_url",s={},c=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],l={ad_id:Number(t.ad_id)||void 0,campaign_id:Number(t.campaign_id)||void 0,creative_id:Number(t.creative_id)||void 0,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,utm_term:t.utm_term,utm_content:t.utm_content,tr_shareuser:t.tr_shareuser,tr_admaster:t.tr_admaster,tr_param1:t.tr_param1,tr_param2:t.tr_param2,tr_param3:t.tr_param3,tr_param4:t.tr_param4};try{var u=!1;for(var f in l)l[f]&&(-1!==c.indexOf(f)?(s.hasOwnProperty("tracer_data")||(s.tracer_data={}),s.tracer_data[f]=l[f]):s[f]=l[f],u=!0);if(u)r.setSessionItem(a,"1"),r.setCookie(o,JSON.stringify(s),i,n);else{var d=r.getCookie(o,n);d&&(s=JSON.parse(d))}1==r.getSessionItem(a)&&(s.hasOwnProperty("tracer_data")||(s.tracer_data={}),s.tracer_data.$utm_from_url=1)}catch(e){return l}return s}(this.appid,o,this.domain,this.cookie_expire);var c=this.browser(),l=this.os();return{browser:c.browser,browser_version:c.browser_version,platform:a,os_name:l.os_name,os_version:l.os_version,userAgent:t,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(l.os_name),language:n,referrer:i,referrer_host:r,network_type:s,utm:this.utm,latest_data:this.last(i,r)}},e.prototype.last=function(e,t){var n="",i="",r="",o=location.hostname,a=!1;if(e&&t&&o!==t){n=e,i=t,a=!0;var s=Ua(e);s.keyword&&(r=s.keyword)}return{$latest_referrer:n,$latest_referrer_host:i,$latest_search_keyword:r,isLast:a}},e.prototype.browser=function(){var e,t,n="",i=""+parseFloat(this.appVersion),r=this.userAgent;return-1!==r.indexOf("Edge")||-1!==r.indexOf("Edg")?(n="Microsoft Edge",-1!==r.indexOf("Edge")?(e=r.indexOf("Edge"),i=r.substring(e+5)):(e=r.indexOf("Edg"),i=r.substring(e+4))):-1!==(e=r.indexOf("MSIE"))?(n="Microsoft Internet Explorer",i=r.substring(e+5)):-1!==(e=r.indexOf("Lark"))?(n="Lark",i=r.substring(e+5,e+11)):-1!==r.indexOf("Chrome")?-1!==(e=r.indexOf("TTWebView"))?(n="TTWebView",i=r.substring(e+10,e+23)):(-1!==(e=r.indexOf("Chrome"))||-1!==(e=r.indexOf("Chrome")))&&(n="Chrome",i=r.substring(e+7)):-1!==r.indexOf("Safari")?-1!==(e=r.indexOf("Safari"))&&(n="Safari",i=r.substring(e+7),-1!==(e=r.indexOf("Version"))&&(i=r.substring(e+8))):-1!==(e=r.indexOf("Firefox"))&&(n="Firefox",i=r.substring(e+8)),-1!==(t=i.indexOf(";"))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(" "))&&(i=i.substring(0,t)),-1!==(t=i.indexOf(")"))&&(i=i.substring(0,t)),{browser:n,browser_version:i}},e.prototype.os=function(){for(var e="",t="",n=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"ChromeOS",r:/CrOS/},{s:"Linux",r:/(Linux|X11)/},{s:"Sun OS",r:/SunOS/}],i=0;i<n.length;i++){var r=n[i];if(r.r.test(this.userAgent)){"Mac OS X"===(e=r.s)&&this.isNewIpad()&&(e="iOS");break}}var o,a,s=function(e,t){var n=e.exec(t);return n&&n[1]?n[1]:""},c=function(e,t){var n=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return n?n.slice(1)[0]:""};switch(/Windows/.test(e)&&(t=s(/Windows (.*)/,e),e="windows"),e){case"Mac OS X":t=c("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":(a=s(/Android ([\.\_\d]+)/,o=this.userAgent))||(a=s(/Android\/([\.\_\d]+)/,o)),t=a,e="android";break;case"iOS":t=this.isNewIpad()?c("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios";break;case"chromeOS":var l=this.userAgent.indexOf("x86_64");t=this.userAgent.substring(l+7,l+16)}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var n=navigator.userAgent.replace("Mozilla/5.0 (",""),i=n.indexOf(";");t=n.slice(0,i)}}catch(e){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),Za=function(e,t){try{return Ka.get(e)}catch(e){return""}},Ya=function(e,t,n,i){try{var r=i||document.domain,o=+new Date+(n||6048e5);Ka.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(e){}},Qa=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e,t){return Za(e)},e.prototype.setCookie=function(e,t,n,i){Ya(e,t,n,i)},e}(),es={getItem:function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(e){}},getCookie:function(e,t){return Za(e)},setCookie:function(e,t,n,i){Ya(e,t,n,i)},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},ts={getItem:function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(e){}},getCookie:function(e,t){return Za(e)},setCookie:function(e,t,n,i){Ya(e,t,n,i)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},ns=function(){function e(e,t){this._storage=t&&"session"===t?ts:!e&&es.isSupportLS?es:new Qa}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,n,i){this._storage.setCookie(e,t,n,i)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),is={sg_central:"1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",us_east:"1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",sg_central_tt:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z21z1ez4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",us_east_tt:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z24z18z4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",us_ttp:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1gz1iz22z1mz1iz24z4az23z21",us_ttp_w:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1gz1iz22z1mz1iz25z4az23z21",us_ttp2:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z22z22z1nz4ez4az23z21z4az22z1gz1iz22z1mz1iz4az1az1mz1k",eu_ttp_gcp:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z24z18z49z23z21z1cz18z21z22z4ez18z4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",eu_central:"1fz22z22z1nz21z4mz4bz4bz18z25z21z1dz20z49z1kz1az21z4az19z27z22z1cz1gz1lz22z1jz18z1nz1gz4az1az1mz1k",eu_ttp_ie2:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z1gz1cz4ez4az22z1gz1iz22z1mz1iz25z4az1cz23",eu_ttp2:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4dz4iz49z1lz1mz20z1kz18z1jz49z1lz1mz4dz18z4az22z1gz1iz22z1mz1iz25z4az1cz23"},rs=function(){return new Set(Object.keys(is))},os=function(){return Object.keys(is)},as={sg:"1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",my:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z19z1bz49z1kz27z4az1jz18z20z1iz1mz1dz1dz1gz1az1cz4az1az1mz1k"},ss={va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",in:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},cs={sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z21z1ez4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z24z18z4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",in:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z24z18z49z23z21z1cz18z21z22z4ez18z4az22z1gz1iz22z1mz1iz24z4az1az1mz1k",ie2:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z1gz1cz4ez4az22z1gz1iz22z1mz1iz25z4az1cz23"},ls={sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1gz1iz22z1mz1iz25z4az23z21",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1gz1iz22z1mz1iz24z4az23z21",ie2:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z49z1gz1cz4ez4az22z1gz1iz22z1mz1iz25z4az1cz23"},us="5.3.12_oversea",fs=["1fz22z22z1nz21z4mz4bz4bz1bz18z22z18z4az19z27z22z1cz1bz18z1lz1az1cz4az1lz1cz22","1fz22z22z1nz21z4mz4bz4bz22z1cz18z49z24z18z4az22z1gz1iz22z1mz1iz49z20z1mz25z4az1lz1cz22","1fz22z22z1nz21z4mz4bz4bz22z1cz18z4az22z1gz1iz22z1mz1iz49z1cz23z4az1lz1cz22","1fz22z22z1nz21z4mz4bz4bz22z1cz18z4az22z1gz1iz22z1mz1iz49z23z21z22z21z4az1lz1cz22","1fz22z22z1nz21z4mz4bz4bz1gz1mz49z21z1ez4az22z1gz1iz22z1mz1iz49z20z1mz25z4az1lz1cz22","1fz22z22z1nz21z4mz4bz4bz1gz1mz49z24z18z4az22z1gz1iz22z1mz1iz49z20z1mz25z4az1lz1cz22","1fz22z22z1nz21z4mz4bz4bz22z1cz18z49z24z18z4az19z27z22z1cz1bz18z1lz1az1cz4az1lz1cz22"].map((function(e){return Oa(e)}));!function(e){e.Init="init",e.Config="config",e.Start="start",e.Ready="ready",e.TokenComplete="token-complete",e.TokenStorage="token-storage",e.TokenFetch="token-fetch",e.TokenError="token-error",e.ConfigUuid="config-uuid",e.ConfigWebId="config-webid",e.ConfigDiD="config-deviceid",e.ConfigDomain="config-domain",e.CustomWebId="custom-webid",e.TokenChange="token-change",e.TokenReset="token-reset",e.ConfigTransform="config-transform",e.EnvTransform="env-transform",e.SessionReset="session-reset",e.SessionResetTime="session-reset-time",e.SessionResetInner="session-reset-inner",e.Event="event",e.Events="events",e.EventNow="event-now",e.CleanEvents="clean-events",e.BeconEvent="becon-event",e.SubmitBefore="submit-before",e.SubmitScuess="submit-scuess",e.SubmitAfter="submit-after",e.SubmitError="submit-error",e.SubmitVerify="submit-verify",e.DestoryInstance="destory-instance",e.LogSettingReady="log-setting-ready",e.Stay="stay",e.ResetStay="reset-stay",e.StayReady="stay-ready",e.SetStay="set-stay",e.RouteChange="route-change",e.RouteReady="route-ready",e.Ab="ab",e.AbVar="ab-var",e.AbAllVars="ab-all-vars",e.AbConfig="ab-config",e.AbExternalVersion="ab-external-version",e.AbVersionChangeOn="ab-version-change-on",e.AbVersionChangeOff="ab-version-change-off",e.AbOpenLayer="ab-open-layer",e.AbCloseLayer="ab-close-layer",e.AbReady="ab-ready",e.AbComplete="ab-complete",e.AbTimeout="ab-timeout",e.AbVerify="ab-verify",e.Profile="profile",e.ProfileSet="profile-set",e.ProfileSetOnce="profile-set-once",e.ProfileUnset="profile-unset",e.ProfileIncrement="profile-increment",e.ProfileAppend="profile-append",e.ProfileClear="profile-clear",e.Autotrack="autotrack",e.AutotrackReady="autotrack-ready",e.CepReady="cep-ready",e.TracerReady="tracer-ready",e.sessionRecord="session-record",e.SessionRecordStart="session-record-start",e.SessionRecordPause="session-record-pause",e.SessionRecordEnd="session-record-end",e.SessionRecordReport="session-record-report",e.TrackEventDuration="track-event-duration",e.TrackEventDurationStart="track-event-duration-start",e.TrackEventDurationEnd="track-event-duration-end",e.TrackEventDurationPause="track-event-duration-pause",e.TrackEventDurationResume="tracl-event-duration-resume",e.VisualCollectReady="visual-collect-ready",e.VisualApiReady="visual-api-ready",e.VisualApiUpdate="visual-api-update"}(ja||(ja={})),function(e){e.DEBUGGER_MESSAGE="debugger-message",e.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",e.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",e.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",e.DEBUGGER_MESSAGE_EVENT="debugger-message-event",e.DEVTOOL_WEB_READY="devtool-web-ready"}(Fa||(Fa={}));var ds=ja,hs=void 0,ps=(new Date).getTimezoneOffset(),vs=parseInt(""+-ps/60,10),gs=60*ps,ms=function(){function e(e,t){var n=this;this.is_first_time=!0,this.configPersist=!1,this.initConfig=t,this.collect=e;var i=new Xa(t.app_id,t.cookie_domain||"",t.cookie_expire||6048e5).init(),r="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new ns(!1,"session"),this.localStorage=new ns(!1,"local"),this.channelUrl=this.getChannelForUrl(),this.current_env="row",t.configPersist&&(this.configPersist=!0,this.storage=1===t.configPersist?this.sessionStorage:this.localStorage);var o=this.localStorage.getItem(r);o&&1==o?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(r,"1")),this.envInfo={user:{user_unique_id:hs,user_type:hs,user_id:hs,user_is_auth:hs,user_is_login:hs,device_id:hs,web_id:hs,ip_addr_id:hs,user_unique_id_type:hs},header:{app_id:hs,app_name:hs,app_install_id:hs,install_id:hs,app_package:hs,app_channel:hs,app_version:hs,ab_version:hs,os_name:i.os_name,os_version:i.os_version,device_model:i.device_model,ab_client:hs,traffic_type:hs,network_type:i.network_type,client_ip:hs,device_brand:hs,os_api:hs,access:hs,language:i.language,region:hs,app_language:hs,app_region:hs,creative_id:i.utm.creative_id,ad_id:i.utm.ad_id,campaign_id:i.utm.campaign_id,log_type:hs,rnd:hs,platform:i.platform,sdk_version:us,sdk_lib:"js",province:hs,city:hs,timezone:vs,tz_offset:gs,tz_name:hs,sim_region:hs,carrier:hs,resolution:i.screen_width+"x"+i.screen_height,browser:i.browser,browser_version:i.browser_version,referrer:i.referrer,referrer_host:i.referrer_host,width:i.screen_width,height:i.screen_height,screen_width:i.screen_width,screen_height:i.screen_height,utm_term:i.utm.utm_term,utm_content:i.utm.utm_content,utm_source:i.utm.utm_source,utm_medium:i.utm.utm_medium,utm_campaign:i.utm.utm_campaign,tracer_data:JSON.stringify(i.utm.tracer_data),custom:i.network_type?{network_type:i.network_type}:{}}},this.ab_version="",this.ab_uuid_cache={},this.evtParams={},this.reportErrorCallback=function(){},this.isLast=!1,this.setCustom(i),this.initDomain(),this.initABData(),this.collect.on("route-change",(function(e){n.changeReferInfo(e.config)}))}return e.prototype.initDomain=function(e){var t=this.initConfig.channel_domain;if(t)this.domain=t;else{var n=e||this.initConfig.report_channel||this.initConfig.channel,i=this.getChannelDomain(n);i||(console.warn("current channel: "+n+" is not exist, use va instead, please check!!!!"),i=as.sg),this.domain=Oa(i),this.setCurrentEnv(this.domain)}},e.prototype.setDomain=function(e){this.customDomain=!0,this.domain=e,this.setCurrentEnv(this.domain)},e.prototype.getDomain=function(e){return this.customDomain||e&&this.initDomain(e),this.domain},e.prototype.getChannelDomain=function(e){var t,n,i=e||this.initConfig.report_channel||this.initConfig.channel;return rs().has(i)?is[i]:"tcpy"===(null===(t=this.initConfig)||void 0===t?void 0:t.channel_type)?cs[i]:"ttp"===(null===(n=this.initConfig)||void 0===n?void 0:n.channel_type)?ls[i]:as[i]},e.prototype.getChannelForUrl=function(){return this.initConfig.channel_type?{WEBID_URL:"/v1/user/webid",TOB_URL:"",REPORT_URL:"/v1/list"}:this.initConfig.report_channel?-1!==["sg_central","us_east"].indexOf(this.initConfig.report_channel)?{WEBID_URL:"/webid",TOB_URL:"/tobid",REPORT_URL:"/list"}:{WEBID_URL:"/v1/user/webid",TOB_URL:"",REPORT_URL:"/v1/list"}:{WEBID_URL:"/webid",TOB_URL:"/tobid",REPORT_URL:"/list"}},e.prototype.setCurrentEnv=function(e){this.getDomain().includes("byteoversea")?this.current_env="row":this.current_env="other"},e.prototype.getCurrentEnv=function(){return this.current_env},e.prototype.initABData=function(){var e,t="__tea_sdk_ab_version_"+this.initConfig.app_id;e=this.localStorage.getItem(t),this.setAbCache(e)},e.prototype.setAbCache=function(e){this.ab_cache=e},e.prototype.getAbCache=function(){return this.ab_cache},e.prototype.clearAbCache=function(){this.ab_cache={},this.ab_version=""},e.prototype.setAbVersion=function(e){this.ab_version=e},e.prototype.getAbVersion=function(){return this.ab_version},e.prototype.setAbUuidCache=function(e,t){var n=t||this.envInfo.user.user_unique_id;this.ab_uuid_cache[""+n]||(this.ab_uuid_cache[""+n]=[]),-1===this.ab_uuid_cache[""+n].indexOf(e)&&this.ab_uuid_cache[""+n].push(e)},e.prototype.getAbUuidCache=function(e){return this.ab_uuid_cache[""+e]},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t=this.channelUrl.REPORT_URL;break;case"webid":t=this.channelUrl.WEBID_URL;break;case"tobid":t=this.channelUrl.TOB_URL}var n="";return this.initConfig.caller&&(n="?sdk_version=5.3.12_oversea&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),""+this.getDomain()+t+n},e.prototype.setCustom=function(e){if(e&&e.latest_data&&e.latest_data.isLast)for(var t in delete e.latest_data.isLast,this.isLast=!0,e.latest_data)this.envInfo.header.custom[t]=e.latest_data[t]},e.prototype.setAppid=function(e){this.envInfo.header.app_id=e},e.prototype.changeReferInfo=function(e){var t=e;this.set({referrer:t.referrer});var n="";try{n=new URL(t.referrer).host}catch(e){}this.set({referrer_host:n||this.envInfo.header.referrer_host})},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(n){if(void 0!==e[n]&&null!==e[n]||t.delete(n),"traffic_type"===n&&t.isLast&&(t.envInfo.header.custom.$latest_traffic_source_type=e[n]),"evtParams"===n)t.evtParams=wa(wa({},t.evtParams||{}),e.evtParams||{});else if("_staging_flag"===n)t.evtParams=wa(wa({},t.evtParams||{}),{_staging_flag:e._staging_flag});else if("reportErrorCallback"===n&&"function"==typeof e[n])t.reportErrorCallback=e[n];else{var i="",r="";if(n.indexOf(".")>-1){var o=n.split(".");i=o[0],r=o[1]}i?"user"===i||"header"===i?t.envInfo[i][r]=e[n]:(t.envInfo.header.custom[r]=e[n],t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Add Custom Params",level:"info",time:Date.now(),infoType:"sdk",secType:"HEADER",common:"custom"})):Object.hasOwnProperty.call(t.envInfo.user,n)?(["user_type","ip_addr_id"].indexOf(n)>-1?t.envInfo.user[n]=e[n]?Number(e[n]):e[n]:["user_id","web_id","user_unique_id","user_unique_id_type"].indexOf(n)>-1?t.envInfo.user[n]=e[n]?String(e[n]):e[n]:["user_is_auth","user_is_login"].indexOf(n)>-1?t.envInfo.user[n]=Boolean(e[n]):"device_id"===n&&(t.envInfo.user[n]=e[n]),t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Set Common Params",level:"info",time:Date.now(),infoType:"sdk",secType:"USER",common:n})):Object.hasOwnProperty.call(t.envInfo.header,n)?(t.envInfo.header[n]=e[n],t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Set Common Params",level:"info",time:Date.now(),infoType:"sdk",secType:"HEADER",common:n})):(t.envInfo.header.custom[n]=e[n],t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Add Custom Params",level:"info",time:Date.now(),infoType:"sdk",secType:"HEADER",common:"custom"}))}}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(e){console.log("get config stringify error "),this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.setStore=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&Object.keys(e).length){var n=Object.assign(e,t);this.storage.setItem(this.configKey,n)}}catch(e){console.log("setStore error"),this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.getStore=function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey)||{};return e&&Object.keys(e).length?e:null}catch(e){return this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),null}},e.prototype.delete=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};t&&Object.hasOwnProperty.call(t,e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(e){this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"}),console.log("delete error")}},e}(),_s=function(){function e(e){this.name=e||"default"}return e.prototype.enable=function(e){this.isLog=!1!==e},e.prototype.info=function(e){this.isLog&&console.log("%c %s","color: yellow; background-color: black;","[instance: "+this.name+"] "+e)},e.prototype.warn=function(e){this.isLog&&console.warn("%c %s","color: yellow; background-color: black;","[instance: "+this.name+"] "+e)},e.prototype.error=function(e){this.isLog&&console.error("%c %s","color: yellow; background-color: red;","[instance: "+this.name+"] "+e)},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),ys=function(){function e(){this.spiderBot=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"]}return e.prototype.checkSpider=function(e){if(!e.enable_spider)return!1;var t=window.navigator.userAgent;if(!t)return!0;var n=!1;return this.spiderBot.forEach((function(e){-1!==t.indexOf(e)&&(n=!0)})),n},e}(),bs=function(){function e(e,t){this.collect=e,this.native=t}var t=e.prototype;return t.bridgeInject=function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),!0):(console.log("AppLogBridge is not inject"),!1))}catch(e){return console.log("AppLogBridge is not inject"),!1}},t.bridgeReady=function(){var e=this;return new Promise((function(t,n){try{e.bridgeInject()?AppLogBridge.hasStarted((function(e){console.log("AppLogBridge is started? : "+e),e?t(!0):n(!1)})):n(!1)}catch(e){console.log("AppLogBridge, error:"+JSON.stringify(e.stack)),n(!1)}}))},t.setNativeAppId=function(e){try{AppLogBridge.setNativeAppId(JSON.stringify(e)),console.log("change bridge appid, event report with appid: "+e)}catch(e){console.error("setNativeAppId error")}},t.setConfig=function(e){var t=this;try{Object.keys(e).forEach((function(n){"user_unique_id"===n?t.setUserUniqueId(e[n]):e[n]?t.addHeaderInfo(n,e[n]):t.removeHeaderInfo(n)}))}catch(e){console.error("setConfig error")}},t.setUserUniqueId=function(e){try{AppLogBridge.setUserUniqueId(e)}catch(e){console.error("setUserUniqueId error")}},t.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(e){console.error("addHeaderInfo error")}},t.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(JSON.stringify(e))}catch(e){console.error("setHeaderInfo error")}},t.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(e){console.error("removeHeaderInfo error")}},t.reportPv=function(e){this.onEventV3("predefine_pageview",e)},t.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t),this.collect.emit(DebuggerMesssge.DEBUGGER_MESSAGE,{type:DebuggerMesssge.DEBUGGER_MESSAGE_EVENT,info:"bridge report success",time:Date.now(),data:[{events:[{event:e,params:t}]}],code:200,status:"success"})}catch(e){console.error("onEventV3 error")}},t.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(e){console.error("profileSet error")}},t.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(e){console.error("profileSetOnce error")}},t.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(e){console.error("profileIncrement error")}},t.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(e){console.error("profileUnset error")}},t.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(e){console.error("profileAppend error")}},e}(),Es=function(){function e(){this.setUrl="/service/2/web_sdk_settings/",this.expireTime=216e5}return e.prototype.apply=function(e,t){if(t.enable_logsetting){this.collect=e,this.config=t;var n=e.adapters.storage;this.setKey="applog_web_logsetting_"+t.app_id,this.uniqueKey="web_logsetting_data",this.cacheStorgae=new n(!1),this.dbStorage=new Ja(this.setKey,"LOGSETTING_DATA_STORE"),this.domain=t.logsetting_domain||this.collect.configManager.getDomain(),this.check()}else e.emit(ds.LogSettingReady)},e.prototype.check=function(){return ka(this,void 0,void 0,(function(){var e;return Sa(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.getLocalData()];case 1:return(e=t.sent())&&Object.keys(e).length?(null==e?void 0:e.timestamp)<Date.now()-this.expireTime?this.fetchSetting():(this.setSettingData(e.settingConfig),this.collect.emit(ds.LogSettingReady)):this.fetchSetting(),[3,3];case 2:return t.sent(),this.collect.emit(ds.LogSettingReady),this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Check LogSetting Data Error",logType:"fetch",level:"error",time:Date.now(),infoType:"sdk"}),[3,3];case 3:return[2]}}))}))},e.prototype.fetchSetting=function(e){var t=this;if(e)this.collect.emit(ds.LogSettingReady);else{var n=this.collect.configManager.get("header");n.custom=JSON.stringify(n.custom);var i=this.collect.configManager.get("user"),r={event_filter:0,header:wa(wa({aid:this.config.app_id},n),i),options:{params_block_enable:this.config.enable_logsetting_params?1:0,header_custom_allow_enable:this.config.enable_logsetting_header_custom?1:0}};this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Fetch LogSetting Request",logType:"fetch",level:"info",time:Date.now(),data:r,infoType:"sdk"}),this.collect.requestManager.useRequest({url:""+this.domain+this.setUrl+"?device_platform=web",data:r,timeout:5e3,success:function(e){(null==e?void 0:e.config)?(t.setLocalData(e.config),t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"LogSetting Request Success",logType:"fetch",level:"info",time:Date.now(),data:e,infoType:"sdk"})):t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"LogSetting Request Response No Data",logType:"fetch",level:"error",time:Date.now(),infoType:"sdk"}),t.collect.emit(ds.LogSettingReady)},fail:function(){t.collect.emit(ds.LogSettingReady),t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"LogSetting Request Fail",logType:"fetch",level:"error",time:Date.now(),infoType:"sdk"})}})}},e.prototype.getLocalData=function(){return ka(this,void 0,void 0,(function(){return Sa(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.dbStorage.getItem(this.uniqueKey)];case 1:return[2,e.sent()];case 2:return e.sent(),[2,null];case 3:return[2]}}))}))},e.prototype.setLocalData=function(e){try{var t={timestamp:Date.now(),settingConfig:e};this.setSettingData(e),this.dbStorage.setItem(this.uniqueKey,t),this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Update LogSetting Cache",logType:"info",level:"info",time:Date.now(),infoType:"sdk",data:e})}catch(e){this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Set LogSetting Data Error",logType:"info",level:"error",time:Date.now(),infoType:"sdk"})}},e.prototype.getSettingData=function(e){return e?this.logSettingConfig[e]:this.logSettingConfig},e.prototype.setSettingData=function(e){this.logSettingConfig=e},e.prototype.getPredefineEventList=function(){return new Set(["predefine_pageview","onload","bav2b_click","bav2b_page","bav2b_beat","bav2b_page_statistics","bav2b_exposure","predefine_page_alive","predefine_page_close","_be_active","__bav_click","__bav_page","__bav_beat","__bav_page_statistics","__bav_page_exposure"])},e.prototype.getPredefineParamsList=function(){return new Set(["event_index"])},e}(),ws=function(){function e(){this.eventLimit=50,this.enable_ttwebid=!1,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new ns(!0),this.localStorage=new ns(!1),this.logSetting=new Es,this.maxReport=t.max_report||10,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.enable_ttwebid=t.enable_ttwebid,this.reportUrl=t.report_url||this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.abKey="__tea_sdk_ab_version_"+this.configManager.get("app_id"),this.refer_key="__tea_cache_refer_"+this.configManager.get("app_id"),this.logSetting.apply(e,t),this.collect.on(ds.Ready,(function(){n.reportAll(!1)})),this.collect.on(ds.ConfigDomain,(function(){n.reportUrl=n.configManager.getUrl("event")})),this.collect.on(ds.Event,(function(e){n.event(e)})),this.collect.on(ds.BeconEvent,(function(e){n.beconEvent(e)})),this.collect.on(ds.CleanEvents,(function(){n.reportAll(!1)})),this.linster()},e.prototype.linster=function(){var e=this;window.addEventListener("unload",(function(){e.reportAll(!0)}),!1),Ma((function(){e.reportAll(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;if(!this.collect.destroy&&!this.collect.sdkStop)try{if(this.config.enable_ios_sendbeacon&&Ia())return void this.beconEvent(e);var n=Ta(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,n),this.reportTimeout&&clearTimeout(this.reportTimeout),n.length>=this.maxReport)this.report(!1);else{var i=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),i)}}catch(e){this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.beconEvent=function(e){if(!this.collect.destroy&&!this.collect.sdkStop){var t=Ta(e,this.cacheStorgae.getItem(this.beconKey)||[]);if(this.cacheStorgae.setItem(this.beconKey,t),this.collect.tokenManager.getReady()&&this.collect.sdkReady){this.cacheStorgae.removeItem(this.beconKey);try{var n=JSON.parse(JSON.stringify(t));if(this.send(this.split(this.merge(t)),!0),this.config.event_verify_url){var i=this.split(this.merge(n,!0));this.collect.emit(ds.SubmitVerify,i)}}catch(e){this.send(this.split(this.merge(t)),!0)}}}},e.prototype.reportBecon=function(){if(!this.collect.destroy&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var e=this.cacheStorgae.getItem(this.beconKey)||[];if(e&&e.length){this.cacheStorgae.removeItem(this.beconKey);try{var t=JSON.parse(JSON.stringify(e));if(this.send(this.split(this.merge(e)),!0),this.config.event_verify_url){var n=this.split(this.merge(t,!0));this.collect.emit(ds.SubmitVerify,n)}}catch(t){this.send(this.split(this.merge(e)),!0)}}}},e.prototype.report=function(e){if(!this.collect.destroy&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var n=0;n<e.length;n+=this.eventLimit){var i;i=e.slice(n,n+this.eventLimit);try{var r=JSON.parse(JSON.stringify(i));if(this.send(this.split(this.merge(i)),t),this.config.event_verify_url){var o=this.split(this.merge(r,!0));this.collect.emit(ds.SubmitVerify,o)}}catch(e){this.send(this.split(this.merge(i)),t)}}else try{r=JSON.parse(JSON.stringify(e)),this.send(this.split(this.merge(e)),t),this.config.event_verify_url&&(o=this.split(this.merge(r,!0)),this.collect.emit(ds.SubmitVerify,o))}catch(n){this.send(this.split(this.merge(e)),t)}},e.prototype.handleRefer=function(){var e="";try{if(this.config.spa||this.config.autotrack){var t=this.localStorage.getItem(this.refer_key)||{};e=t.routeChange?t.refer_key:this.configManager.get("referrer")}else e=this.configManager.get("referrer")}catch(t){e=document.referrer}return e},e.prototype.merge=function(e,t){var n=this;void 0===t&&(t=!1);var i=this.configManager.get(),r=i.header,o=i.user;r.custom=this.customAllow(r.custom,t);var a=this.configManager.get("evtParams"),s=this.configManager.get("user_unique_id_type"),c=[];try{var l=e.filter((function(e){try{Object.keys(a).length&&(e.params=wa(wa({},a),e.params)),s&&(e.params.$user_unique_id_type=s);var i=n.configManager.getAbCache(),r=o[n.config.ab_user_mode]||o.user_unique_id,c=n.configManager.getAbUuidCache(r);if(i&&i.uuid&&i.uuid===r){var l=n.configManager.getAbVersion();if(n.config.enable_ab_uuid){if(c&&c.length){var u=c.join(",");l&&l.includes(u)&&(e.ab_sdk_version=l)}}else l&&(e.ab_sdk_version=l)}return e.session_id=n.collect.sessionManager.getSessionId(),e.params=n.paramsAllow(e,t),e}catch(t){return console.warn("filter merge event: "+(e&&e.event)+" error, pls check",t&&t.message),n.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Merge Event Something Error",level:"error",time:Date.now(),data:t.message,infoType:"sdk"}),!1}})),u=JSON.parse(JSON.stringify({events:l,user:o,header:r}));u.local_time=Math.floor(Date.now()/1e3),u.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0,u.verbose=1,c.push(u)}catch(e){console.warn("event merge error, pls check",e&&e.message)}return c},e.prototype.split=function(e){return e.map((function(e){var t=[];return t.push(e),t}))},e.prototype.blockEvent=function(e){try{var t=this.blockList;if(this.config.enable_logsetting){var n=this.blockList,i=this.logSetting.getSettingData("blocklist_events").block_event;t=n.concat(i.filter((function(e){return-1===n.indexOf(e)})))}return!(t&&t.length&&t.includes(e))}catch(e){return!0}},e.prototype.whiteEvent=function(e){var t;try{return!(null===(t=this.whiteList)||void 0===t?void 0:t.length)||!!this.whiteList.includes(e)}catch(e){return!0}},e.prototype.customAllow=function(e,t){try{if(t)return JSON.stringify(e);if(!this.config.enable_logsetting||!this.config.enable_logsetting_header_custom)return JSON.stringify(e);var n=this.logSetting.getSettingData().header_custom_allow;if(n){var i={};if(n.length&&Object.keys(e).length){var r=new Set(n);for(var o in e)r.has(o)&&(i[o]=e[o])}return JSON.stringify(i)}return JSON.stringify(e)}catch(t){return this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute customAllow Something Error",level:"error",time:Date.now(),data:t.message,infoType:"sdk"}),JSON.stringify(e)}},e.prototype.paramsAllow=function(e,t){try{if(t)return JSON.stringify(e.params);if(!this.config.enable_logsetting||!this.config.enable_logsetting_params)return JSON.stringify(e.params);var n=this.logSetting.getSettingData().params_block,i=e.event,r=e.params;if(!n)return JSON.stringify(e.params);if(n[i]&&n[i].length){var o={},a=new Set(n[i]);for(var s in r)!this.logSetting.getPredefineParamsList().has(s)&&a.has(s)||(o[s]=r[s]);return JSON.stringify(o)}return JSON.stringify(e.params)}catch(t){return this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute paramsAllow Something Error",level:"error",time:Date.now(),data:t.message,infoType:"sdk"}),JSON.stringify(e.params)}},e.prototype.send=function(e,t){var n=this;e.length&&(this.config.disable_track_event||e.forEach((function(e){try{var i=JSON.parse(JSON.stringify(e));n.config.filter&&((i=n.config.filter(i))||console.warn("filter must return data !!")),n.collect.eventFilter&&i&&((i=n.collect.eventFilter(i))||console.warn("filterEvent api must return data !!"));var r=i||e,o=JSON.parse(JSON.stringify(r));if(!r.length)return;var a=!0;if(r.forEach((function(e){e.events.length||(a=!1)})),!a)return;n.collect.emit(ds.SubmitBefore,r),n.collect.requestManager.useRequest({url:n.reportUrl,data:r,success:function(e,t){e&&0!==e.e?(n.collect.emit(ds.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e}),n.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_EVENT,info:"Event Report Fail",time:Date.now(),data:o,code:e.e,failType:"event data error",status:"fail"})):(n.collect.emit(ds.SubmitScuess,{eventData:t,res:e}),n.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_EVENT,info:"Event Report Success",time:Date.now(),data:o,code:200,status:"success"}))},fail:function(e,t){n.configManager.get("reportErrorCallback")(e,t),n.collect.emit(ds.SubmitError,{type:"f_net",eventData:e,errorCode:t}),n.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_EVENT,info:"Event Report Network Fail",time:Date.now(),data:o,code:t,failType:"network error",status:"fail"})},timeout:n.timeout,useBeacon:!n.config.disable_sendbeacon&&t,withCredentials:n.enable_ttwebid,zip:!0}),n.collect.emit(ds.SubmitAfter,r)}catch(e){console.warn("something error, "+JSON.stringify(e.stack)),n.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Report Event Something Error",level:"error",time:Date.now(),data:e.message})}})))},e}(),ks=function(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}().replace(/-/g,"").slice(0,19)},Ss=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enable_ttwebid=!1,this.enableCustomWebid=!1}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new ns(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.enable_ttwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on(ds.ConfigUuid,(function(e){n.setUuid(e)})),this.collect.on(ds.ConfigWebId,(function(e){n.setWebId(e)})),this.collect.on(ds.ConfigDiD,(function(e){n.setDeviceId(e)})),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()},e.prototype.checkStorage=function(){var e=this;this.cacheToken=this.storage.getItem(this.tokenKey)||{},this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid?this.enableCustomWebid?this.collect.on(ds.CustomWebId,(function(){e.tokenReady=!0,e.collect.emit(ds.TokenComplete)})):this.checkEnv()||(this.enable_ttwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:ks(),user_unique_id:this.configManager.get("user_unique_id")||ks()}):this.remoteWebid()},e.prototype.checkEnv=function(){var e=window.navigator.userAgent;if(-1!==e.indexOf("miniProgram")||-1!==e.indexOf("MiniProgram")){var t=Ua(window.location.href);return!(!t||!t.Web_ID||(this.complete({web_id:""+t.Web_ID,user_unique_id:this.configManager.get("user_unique_id")||""+t.Web_ID}),0))}return!1},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),n={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Fetch WebID Request",logType:"fetch",level:"info",time:Date.now(),data:n});var i=ks();this.collect.requestManager.useRequest({url:t,data:n,success:function(t){var n;t&&0===t.e?(n=t.web_id,e.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"Fetch WebID Request Success",logType:"fetch",level:"info",time:Date.now(),data:t})):(n=i,e.collect.configManager.set({localWebId:i}),e.collect.emit(ds.TokenError),e.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"Fetch WebID Request Data Error, Use LocalId",logType:"fetch",level:"warn",time:Date.now(),data:t}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n})},fail:function(){e.complete({web_id:e.configManager.get("web_id")||i,user_unique_id:e.configManager.get("user_unique_id")||i}),e.collect.configManager.set({localWebId:i}),e.collect.emit(ds.TokenError),e.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"Fetch WebID Request Network Fail, Use LocalId",logType:"fetch",level:"error",time:Date.now(),data:null}),e.collect.logger.warn("appid: "+e.config.app_id+", get webid error, use local webid~")},timeout:3e5})},e.prototype.complete=function(e){var t=e.web_id,n=e.user_unique_id,i=e.device_id;if(e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:n}),this.config.enable_device_id){var r=this.configManager.get("device_id")||i||t;this.collect.configManager.set({device_id:r}),e=wa(wa({},e),{device_id:r})}else delete e.device_id;this.setStorage(e),this.tokenReady=!0,this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK UserInfo Complete",logType:"info",secType:"USER",level:"info",time:Date.now(),data:{web_id:t,user_unique_id:n},infoType:"sdk"}),this.collect.emit(ds.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",n=this.configManager.get("user_unique_id");(n||t)&&this.configManager.set({user_unique_id:n||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(ds.TokenComplete)},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),n=this.configManager.get("user_unique_id"),i=this.cacheToken&&this.cacheToken.user_unique_id;if(t===n&&t===i)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(ds.TokenChange,"uuid"),this.collect.emit(ds.SessionReset)}else this.clearUuid()},e.prototype.clearUuid=function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit(ds.TokenReset))},e.prototype.setWebId=function(e){if(e&&!this.config.enable_ttwebid){this.cacheToken&&this.cacheToken.web_id?this.cacheToken.web_id!==e&&(this.cacheToken.user_unique_id=this.cacheToken.web_id===this.cacheToken.user_unique_id?e:this.cacheToken.user_unique_id,this.cacheToken.web_id=e):(this.cacheToken={},this.cacheToken.web_id=e,this.cacheToken.user_unique_id=e),this.cacheToken.timestamp=Date.now();var t=this.configManager.get("web_id"),n=this.configManager.get("user_unique_id");n&&n!==t||(this.configManager.set({user_unique_id:e}),this.collect.emit(ds.TokenChange,"uuid")),t!==e&&(this.configManager.set({web_id:e}),this.collect.emit(ds.TokenChange,"webid")),this.setStorage(this.cacheToken)}},e.prototype.setDeviceId=function(e){this.configManager.set({device_id:e}),this.config.enable_device_id&&this.cacheToken&&(this.cacheToken.device_id=e,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken))},e.prototype.setStorage=function(e){e._type_=this.enableCustomWebid?"custom":"default",delete e["diss".split("").reverse().join("")],this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e.prototype.getTobId=function(){var e=this;return new Promise((function(t){var n;if("row"===(null===(n=e.collect.configManager)||void 0===n?void 0:n.getCurrentEnv()))if("tcpy"!==e.config.channel_type&&"ttp"!==e.config.channel_type){var i={app_id:e.config.app_id,user_unique_id:e.configManager.get("user_unique_id"),web_id:e.configManager.get("web_id"),user_unique_id_type:e.configManager.get("user_unique_id_type")};e.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Fetch GetToken Request",logType:"fetch",level:"info",time:Date.now(),data:i,infoType:"sdk"}),e.collect.requestManager.useRequest({url:e.configManager.getUrl("tobid"),data:i,success:function(n){n&&0===n.e?(t(n.tobid),e.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"Fetch GetToken Request Success",logType:"fetch",level:"info",time:Date.now(),data:n,infoType:"sdk"})):(t(""),e.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"Fetch GetToken Request Fail",logType:"fetch",level:"error",time:Date.now(),data:n,infoType:"sdk"}))},fail:function(){t(""),e.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"Fetch GetToken Request Network Error",logType:"fetch",level:"error",time:Date.now(),infoType:"sdk"})},time:3e4,withCredentials:e.enable_ttwebid})}else t("");else t("")}))},e}(),xs=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},Ts=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.storage=new Wa,this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||(this.setSessionId(),this.collect.on(ds.SessionReset,(function(){n.resetSessionId()})),this.collect.on(ds.SessionResetTime,(function(){n.updateSessionIdTime()})))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getSessionItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?(e={sessionId:xs(),timestamp:Date.now()},this.collect.emit(ds.SessionResetInner)):e.timestamp=Date.now(),this.storage.setSessionItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getSessionItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:xs(),timestamp:Date.now()},this.storage.setSessionItem(this.sessionKey,t),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime)},e.prototype.getSessionId=function(){var e=this.storage.getSessionItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(){var e={sessionId:xs(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)},e.prototype.checkEXp=function(){var e=this.storage.getSessionItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:xs(),timestamp:Date.now()},this.storage.setSessionItem(this.sessionKey,e))},e}();function As(e){for(var t=e.length;--t>=0;)e[t]=0}var zs=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Cs=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Ds=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Rs=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Os=new Array(576);As(Os);var Is=new Array(60);As(Is);var Ms=new Array(512);As(Ms);var Ps=new Array(256);As(Ps);var Ns=new Array(29);As(Ns);var Us,Bs,Gs,Ls=new Array(30);function js(e,t,n,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}function Fs(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}As(Ls);var Ks=function(e){return e<256?Ms[e]:Ms[256+(e>>>7)]},Hs=function(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Vs=function(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,Hs(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},qs=function(e,t,n){Vs(e,n[2*t],n[2*t+1])},$s=function(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},Js=function(e,t,n){var i,r,o=new Array(16),a=0;for(i=1;i<=15;i++)a=a+n[i-1]<<1,o[i]=a;for(r=0;r<=t;r++){var s=e[2*r+1];0!==s&&(e[2*r]=$s(o[s]++,s))}},Ws=function(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Xs=function(e){e.bi_valid>8?Hs(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Zs=function(e,t,n,i){var r=2*t,o=2*n;return e[r]<e[o]||e[r]===e[o]&&i[t]<=i[n]},Ys=function(e,t,n){for(var i=e.heap[n],r=n<<1;r<=e.heap_len&&(r<e.heap_len&&Zs(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!Zs(t,i,e.heap[r],e.depth));)e.heap[n]=e.heap[r],n=r,r<<=1;e.heap[n]=i},Qs=function(e,t,n){var i,r,o,a,s=0;if(0!==e.sym_next)do{i=255&e.pending_buf[e.sym_buf+s++],i+=(255&e.pending_buf[e.sym_buf+s++])<<8,r=e.pending_buf[e.sym_buf+s++],0===i?qs(e,r,t):(o=Ps[r],qs(e,o+256+1,t),0!==(a=zs[o])&&(r-=Ns[o],Vs(e,r,a)),i--,o=Ks(i),qs(e,o,n),0!==(a=Cs[o])&&(i-=Ls[o],Vs(e,i,a)))}while(s<e.sym_next);qs(e,256,t)},ec=function(e,t){var n,i,r,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<c;n++)0!==o[2*n]?(e.heap[++e.heap_len]=l=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(r=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[r]=0,e.opt_len--,s&&(e.static_len-=a[2*r+1]);for(t.max_code=l,n=e.heap_len>>1;n>=1;n--)Ys(e,o,n);r=c;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ys(e,o,1),i=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=i,o[2*r]=o[2*n]+o[2*i],e.depth[r]=(e.depth[n]>=e.depth[i]?e.depth[n]:e.depth[i])+1,o[2*n+1]=o[2*i+1]=r,e.heap[1]=r++,Ys(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,i,r,o,a,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,v=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)(o=c[2*c[2*(i=e.heap[n])+1]+1]+1)>p&&(o=p,v++),c[2*i+1]=o,i>l||(e.bl_count[o]++,a=0,i>=h&&(a=d[i-h]),s=c[2*i],e.opt_len+=s*(o+a),f&&(e.static_len+=s*(u[2*i+1]+a)));if(0!==v){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,v-=2}while(v>0);for(o=p;0!==o;o--)for(i=e.bl_count[o];0!==i;)(r=e.heap[--n])>l||(c[2*r+1]!==o&&(e.opt_len+=(o-c[2*r+1])*c[2*r],c[2*r+1]=o),i--)}}(e,t),Js(o,l,e.bl_count)},tc=function(e,t,n){var i,r,o=-1,a=t[1],s=0,c=7,l=4;for(0===a&&(c=138,l=3),t[2*(n+1)+1]=65535,i=0;i<=n;i++)r=a,a=t[2*(i+1)+1],++s<c&&r===a||(s<l?e.bl_tree[2*r]+=s:0!==r?(r!==o&&e.bl_tree[2*r]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=r,0===a?(c=138,l=3):r===a?(c=6,l=3):(c=7,l=4))},nc=function(e,t,n){var i,r,o=-1,a=t[1],s=0,c=7,l=4;for(0===a&&(c=138,l=3),i=0;i<=n;i++)if(r=a,a=t[2*(i+1)+1],!(++s<c&&r===a)){if(s<l)do{qs(e,r,e.bl_tree)}while(0!=--s);else 0!==r?(r!==o&&(qs(e,r,e.bl_tree),s--),qs(e,16,e.bl_tree),Vs(e,s-3,2)):s<=10?(qs(e,17,e.bl_tree),Vs(e,s-3,3)):(qs(e,18,e.bl_tree),Vs(e,s-11,7));s=0,o=r,0===a?(c=138,l=3):r===a?(c=6,l=3):(c=7,l=4)}},ic=!1,rc=function(e,t,n,i){Vs(e,0+(i?1:0),3),Xs(e),Hs(e,n),Hs(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},oc=function(e){ic||(function(){var e,t,n,i,r,o=new Array(16);for(n=0,i=0;i<28;i++)for(Ns[i]=n,e=0;e<1<<zs[i];e++)Ps[n++]=i;for(Ps[n-1]=i,r=0,i=0;i<16;i++)for(Ls[i]=r,e=0;e<1<<Cs[i];e++)Ms[r++]=i;for(r>>=7;i<30;i++)for(Ls[i]=r<<7,e=0;e<1<<Cs[i]-7;e++)Ms[256+r++]=i;for(t=0;t<=15;t++)o[t]=0;for(e=0;e<=143;)Os[2*e+1]=8,e++,o[8]++;for(;e<=255;)Os[2*e+1]=9,e++,o[9]++;for(;e<=279;)Os[2*e+1]=7,e++,o[7]++;for(;e<=287;)Os[2*e+1]=8,e++,o[8]++;for(Js(Os,287,o),e=0;e<30;e++)Is[2*e+1]=5,Is[2*e]=$s(e,5);Us=new js(Os,zs,257,286,15),Bs=new js(Is,Cs,0,30,15),Gs=new js(new Array(0),Ds,0,19,7)}(),ic=!0),e.l_desc=new Fs(e.dyn_ltree,Us),e.d_desc=new Fs(e.dyn_dtree,Bs),e.bl_desc=new Fs(e.bl_tree,Gs),e.bi_buf=0,e.bi_valid=0,Ws(e)},ac=rc,sc=function(e,t,n,i){var r,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),ec(e,e.l_desc),ec(e,e.d_desc),a=function(e){var t;for(tc(e,e.dyn_ltree,e.l_desc.max_code),tc(e,e.dyn_dtree,e.d_desc.max_code),ec(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Rs[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=r&&(r=o)):r=o=n+5,n+4<=r&&-1!==t?rc(e,t,n,i):4===e.strategy||o===r?(Vs(e,2+(i?1:0),3),Qs(e,Os,Is)):(Vs(e,4+(i?1:0),3),function(e,t,n,i){var r;for(Vs(e,t-257,5),Vs(e,n-1,5),Vs(e,i-4,4),r=0;r<i;r++)Vs(e,e.bl_tree[2*Rs[r]+1],3);nc(e,e.dyn_ltree,t-1),nc(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),Qs(e,e.dyn_ltree,e.dyn_dtree)),Ws(e),i&&Xs(e)},cc=function(e,t,n){return e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(Ps[n]+256+1)]++,e.dyn_dtree[2*Ks(t)]++),e.sym_next===e.sym_end},lc=function(e){Vs(e,2,3),qs(e,256,Os),function(e){16===e.bi_valid?(Hs(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)},uc=function(e,t,n,i){for(var r=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(r=r+t[i++]|0)|0}while(--a);r%=65521,o%=65521}return r|o<<16|0},fc=new Uint32Array(function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}()),dc=function(e,t,n,i){var r=fc,o=i+n;e^=-1;for(var a=i;a<o;a++)e=e>>>8^r[255&(e^t[a])];return-1^e},hc={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},pc={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},vc=oc,gc=ac,mc=sc,_c=cc,yc=lc,bc=pc.Z_NO_FLUSH,Ec=pc.Z_PARTIAL_FLUSH,wc=pc.Z_FULL_FLUSH,kc=pc.Z_FINISH,Sc=pc.Z_BLOCK,xc=pc.Z_OK,Tc=pc.Z_STREAM_END,Ac=pc.Z_STREAM_ERROR,zc=pc.Z_DATA_ERROR,Cc=pc.Z_BUF_ERROR,Dc=pc.Z_DEFAULT_COMPRESSION,Rc=pc.Z_FILTERED,Oc=pc.Z_HUFFMAN_ONLY,Ic=pc.Z_RLE,Mc=pc.Z_FIXED,Pc=pc.Z_UNKNOWN,Nc=pc.Z_DEFLATED,Uc=function(e,t){return e.msg=hc[t],t},Bc=function(e){return 2*e-(e>4?9:0)},Gc=function(e){for(var t=e.length;--t>=0;)e[t]=0},Lc=function(e){var t,n,i,r=e.w_size;i=t=e.hash_size;do{n=e.head[--i],e.head[i]=n>=r?n-r:0}while(--t);i=t=r;do{n=e.prev[--i],e.prev[i]=n>=r?n-r:0}while(--t)},jc=function(e,t,n){return(t<<e.hash_shift^n)&e.hash_mask},Fc=function(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},Kc=function(e,t){mc(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Fc(e.strm)},Hc=function(e,t){e.pending_buf[e.pending++]=t},Vc=function(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},qc=function(e,t,n,i){var r=e.avail_in;return r>i&&(r=i),0===r?0:(e.avail_in-=r,t.set(e.input.subarray(e.next_in,e.next_in+r),n),1===e.state.wrap?e.adler=uc(e.adler,t,r,n):2===e.state.wrap&&(e.adler=dc(e.adler,t,r,n)),e.next_in+=r,e.total_in+=r,r)},$c=function(e,t){var n,i,r=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,l=e.window,u=e.w_mask,f=e.prev,d=e.strstart+258,h=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(n=t)+a]===p&&l[n+a-1]===h&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&o<d);if(i=258-(d-o),o=d-258,i>a){if(e.match_start=t,a=i,i>=s)break;h=l[o+a-1],p=l[o+a]}}}while((t=f[t&u])>c&&0!=--r);return a<=e.lookahead?a:e.lookahead},Jc=function(e){var t,n,i,r=e.w_size;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=r+(r-262)&&(e.window.set(e.window.subarray(r,r+r-n),0),e.match_start-=r,e.strstart-=r,e.block_start-=r,e.insert>e.strstart&&(e.insert=e.strstart),Lc(e),n+=r),0===e.strm.avail_in)break;if(t=qc(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=t,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=jc(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=jc(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)},Wc=function(e,t){var n,i,r,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,s=e.strm.avail_in;do{if(n=65535,r=e.bi_valid+42>>3,e.strm.avail_out<r)break;if(r=e.strm.avail_out-r,n>(i=e.strstart-e.block_start)+e.strm.avail_in&&(n=i+e.strm.avail_in),n>r&&(n=r),n<o&&(0===n&&t!==kc||t===bc||n!==i+e.strm.avail_in))break;a=t===kc&&n===i+e.strm.avail_in?1:0,gc(e,0,0,a),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Fc(e.strm),i&&(i>n&&(i=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,n-=i),n&&(qc(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===a);return(s-=e.strm.avail_in)&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==bc&&t!==kc&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(r=e.window_size-e.strstart,e.strm.avail_in>r&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,r+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),r>e.strm.avail_in&&(r=e.strm.avail_in),r&&(qc(e.strm,e.window,e.strstart,r),e.strstart+=r,e.insert+=r>e.w_size-e.insert?e.w_size-e.insert:r),e.high_water<e.strstart&&(e.high_water=e.strstart),r=e.bi_valid+42>>3,o=(r=e.pending_buf_size-r>65535?65535:e.pending_buf_size-r)>e.w_size?e.w_size:r,((i=e.strstart-e.block_start)>=o||(i||t===kc)&&t!==bc&&0===e.strm.avail_in&&i<=r)&&(n=i>r?r:i,a=t===kc&&0===e.strm.avail_in&&n===i?1:0,gc(e,e.block_start,n,a),e.block_start+=n,Fc(e.strm)),a?3:1)},Xc=function(e,t){for(var n,i;;){if(e.lookahead<262){if(Jc(e),e.lookahead<262&&t===bc)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=jc(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-262&&(e.match_length=$c(e,n)),e.match_length>=3)if(i=_c(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=jc(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=jc(e,e.ins_h,e.window[e.strstart+1]);else i=_c(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(Kc(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===kc?(Kc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Kc(e,!1),0===e.strm.avail_out)?1:2},Zc=function(e,t){for(var n,i,r;;){if(e.lookahead<262){if(Jc(e),e.lookahead<262&&t===bc)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=jc(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-262&&(e.match_length=$c(e,n),e.match_length<=5&&(e.strategy===Rc||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,i=_c(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=jc(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(Kc(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((i=_c(e,0,e.window[e.strstart-1]))&&Kc(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=_c(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===kc?(Kc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Kc(e,!1),0===e.strm.avail_out)?1:2};function Yc(e,t,n,i,r){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=i,this.func=r}var Qc=[new Yc(0,0,0,0,Wc),new Yc(4,4,8,4,Xc),new Yc(4,5,16,8,Xc),new Yc(4,6,32,32,Xc),new Yc(4,4,16,16,Zc),new Yc(8,16,32,32,Zc),new Yc(8,16,128,128,Zc),new Yc(8,32,128,256,Zc),new Yc(32,128,258,1024,Zc),new Yc(32,258,258,4096,Zc)];function el(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Nc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Gc(this.dyn_ltree),Gc(this.dyn_dtree),Gc(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Gc(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Gc(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var tl=function(e){if(!e)return 1;var t=e.state;return!t||t.strm!==e||42!==t.status&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&113!==t.status&&666!==t.status?1:0},nl=function(e){if(tl(e))return Uc(e,Ac);e.total_in=e.total_out=0,e.data_type=Pc;var t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=-2,vc(t),xc},il=function(e){var t,n=nl(e);return n===xc&&((t=e.state).window_size=2*t.w_size,Gc(t.head),t.max_lazy_match=Qc[t.level].max_lazy,t.good_match=Qc[t.level].good_length,t.nice_match=Qc[t.level].nice_length,t.max_chain_length=Qc[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),n},rl=function(e,t,n,i,r,o){if(!e)return Ac;var a=1;if(t===Dc&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),r<1||r>9||n!==Nc||i<8||i>15||t<0||t>9||o<0||o>Mc||8===i&&1!==a)return Uc(e,Ac);8===i&&(i=9);var s=new el;return e.state=s,s.strm=e,s.status=42,s.wrap=a,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=r+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<r+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=o,s.method=n,il(e)},ol=rl,al=function(e,t){return tl(e)||2!==e.state.wrap?Ac:(e.state.gzhead=t,xc)},sl=function(e,t){if(tl(e)||t>Sc||t<0)return e?Uc(e,Ac):Ac;var n=e.state;if(!e.output||0!==e.avail_in&&!e.input||666===n.status&&t!==kc)return Uc(e,0===e.avail_out?Cc:Ac);var i=n.last_flush;if(n.last_flush=t,0!==n.pending){if(Fc(e),0===e.avail_out)return n.last_flush=-1,xc}else if(0===e.avail_in&&Bc(t)<=Bc(i)&&t!==kc)return Uc(e,Cc);if(666===n.status&&0!==e.avail_in)return Uc(e,Cc);if(42===n.status&&0===n.wrap&&(n.status=113),42===n.status){var r=Nc+(n.w_bits-8<<4)<<8;if(r|=(n.strategy>=Oc||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(r|=32),Vc(n,r+=31-r%31),0!==n.strstart&&(Vc(n,e.adler>>>16),Vc(n,65535&e.adler)),e.adler=1,n.status=113,Fc(e),0!==n.pending)return n.last_flush=-1,xc}if(57===n.status)if(e.adler=0,Hc(n,31),Hc(n,139),Hc(n,8),n.gzhead)Hc(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Hc(n,255&n.gzhead.time),Hc(n,n.gzhead.time>>8&255),Hc(n,n.gzhead.time>>16&255),Hc(n,n.gzhead.time>>24&255),Hc(n,9===n.level?2:n.strategy>=Oc||n.level<2?4:0),Hc(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Hc(n,255&n.gzhead.extra.length),Hc(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=dc(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(Hc(n,0),Hc(n,0),Hc(n,0),Hc(n,0),Hc(n,0),Hc(n,9===n.level?2:n.strategy>=Oc||n.level<2?4:0),Hc(n,3),n.status=113,Fc(e),0!==n.pending)return n.last_flush=-1,xc;if(69===n.status){if(n.gzhead.extra){for(var o=n.pending,a=(65535&n.gzhead.extra.length)-n.gzindex;n.pending+a>n.pending_buf_size;){var s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>o&&(e.adler=dc(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex+=s,Fc(e),0!==n.pending)return n.last_flush=-1,xc;o=0,a-=s}var c=new Uint8Array(n.gzhead.extra);n.pending_buf.set(c.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending+=a,n.gzhead.hcrc&&n.pending>o&&(e.adler=dc(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){var l,u=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>u&&(e.adler=dc(e.adler,n.pending_buf,n.pending-u,u)),Fc(e),0!==n.pending)return n.last_flush=-1,xc;u=0}l=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,Hc(n,l)}while(0!==l);n.gzhead.hcrc&&n.pending>u&&(e.adler=dc(e.adler,n.pending_buf,n.pending-u,u)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){var f,d=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>d&&(e.adler=dc(e.adler,n.pending_buf,n.pending-d,d)),Fc(e),0!==n.pending)return n.last_flush=-1,xc;d=0}f=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,Hc(n,f)}while(0!==f);n.gzhead.hcrc&&n.pending>d&&(e.adler=dc(e.adler,n.pending_buf,n.pending-d,d))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Fc(e),0!==n.pending))return n.last_flush=-1,xc;Hc(n,255&e.adler),Hc(n,e.adler>>8&255),e.adler=0}if(n.status=113,Fc(e),0!==n.pending)return n.last_flush=-1,xc}if(0!==e.avail_in||0!==n.lookahead||t!==bc&&666!==n.status){var h=0===n.level?Wc(n,t):n.strategy===Oc?function(e,t){for(var n;;){if(0===e.lookahead&&(Jc(e),0===e.lookahead)){if(t===bc)return 1;break}if(e.match_length=0,n=_c(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Kc(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===kc?(Kc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Kc(e,!1),0===e.strm.avail_out)?1:2}(n,t):n.strategy===Ic?function(e,t){for(var n,i,r,o,a=e.window;;){if(e.lookahead<=258){if(Jc(e),e.lookahead<=258&&t===bc)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&((i=a[r=e.strstart-1])===a[++r]&&i===a[++r]&&i===a[++r])){o=e.strstart+258;do{}while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&r<o);e.match_length=258-(o-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=_c(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=_c(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Kc(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===kc?(Kc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Kc(e,!1),0===e.strm.avail_out)?1:2}(n,t):Qc[n.level].func(n,t);if(3!==h&&4!==h||(n.status=666),1===h||3===h)return 0===e.avail_out&&(n.last_flush=-1),xc;if(2===h&&(t===Ec?yc(n):t!==Sc&&(gc(n,0,0,!1),t===wc&&(Gc(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Fc(e),0===e.avail_out))return n.last_flush=-1,xc}return t!==kc?xc:n.wrap<=0?Tc:(2===n.wrap?(Hc(n,255&e.adler),Hc(n,e.adler>>8&255),Hc(n,e.adler>>16&255),Hc(n,e.adler>>24&255),Hc(n,255&e.total_in),Hc(n,e.total_in>>8&255),Hc(n,e.total_in>>16&255),Hc(n,e.total_in>>24&255)):(Vc(n,e.adler>>>16),Vc(n,65535&e.adler)),Fc(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?xc:Tc)},cl=function(e){if(tl(e))return Ac;var t=e.state.status;return e.state=null,113===t?Uc(e,zc):xc},ll=function(e,t){var n=t.length;if(tl(e))return Ac;var i=e.state,r=i.wrap;if(2===r||1===r&&42!==i.status||i.lookahead)return Ac;if(1===r&&(e.adler=uc(e.adler,t,n,0)),i.wrap=0,n>=i.w_size){0===r&&(Gc(i.head),i.strstart=0,i.block_start=0,i.insert=0);var o=new Uint8Array(i.w_size);o.set(t.subarray(n-i.w_size,n),0),t=o,n=i.w_size}var a=e.avail_in,s=e.next_in,c=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Jc(i);i.lookahead>=3;){var l=i.strstart,u=i.lookahead-2;do{i.ins_h=jc(i,i.ins_h,i.window[l+3-1]),i.prev[l&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=l,l++}while(--u);i.strstart=l,i.lookahead=2,Jc(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=s,e.input=c,e.avail_in=a,i.wrap=r,xc},ul=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},fl=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=J(n))throw new TypeError(n+"must be non-object");for(var i in n)ul(n,i)&&(e[i]=n[i])}}return e},dl=function(e){for(var t=0,n=0,i=e.length;n<i;n++)t+=e[n].length;for(var r=new Uint8Array(t),o=0,a=0,s=e.length;o<s;o++){var c=e[o];r.set(c,a),a+=c.length}return r},hl=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(Vg){hl=!1}for(var pl=new Uint8Array(256),vl=0;vl<256;vl++)pl[vl]=vl>=252?6:vl>=248?5:vl>=240?4:vl>=224?3:vl>=192?2:1;pl[254]=pl[254]=1;var gl=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,n,i,r,o,a=e.length,s=0;for(r=0;r<a;r++)55296==(64512&(n=e.charCodeAt(r)))&&r+1<a&&(56320==(64512&(i=e.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),o=0,r=0;o<s;r++)55296==(64512&(n=e.charCodeAt(r)))&&r+1<a&&(56320==(64512&(i=e.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},ml=function(e,t){var n,i,r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var o=new Array(2*r);for(i=0,n=0;n<r;){var a=e[n++];if(a<128)o[i++]=a;else{var s=pl[a];if(s>4)o[i++]=65533,n+=s-1;else{for(a&=2===s?31:3===s?15:7;s>1&&n<r;)a=a<<6|63&e[n++],s--;s>1?o[i++]=65533:a<65536?o[i++]=a:(a-=65536,o[i++]=55296|a>>10&1023,o[i++]=56320|1023&a)}}}return function(e,t){if(t<65534&&e.subarray&&hl)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var n="",i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n}(o,i)},_l=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+pl[e[n]]>t?n:t},yl=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},bl=Object.prototype.toString,El=pc.Z_NO_FLUSH,wl=pc.Z_SYNC_FLUSH,kl=pc.Z_FULL_FLUSH,Sl=pc.Z_FINISH,xl=pc.Z_OK,Tl=pc.Z_STREAM_END,Al=pc.Z_DEFAULT_COMPRESSION,zl=pc.Z_DEFAULT_STRATEGY,Cl=pc.Z_DEFLATED;function Dl(e){this.options=fl({level:Al,method:Cl,chunkSize:16384,windowBits:15,memLevel:8,strategy:zl},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new yl,this.strm.avail_out=0;var n=ol(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==xl)throw new Error(hc[n]);if(t.header&&al(this.strm,t.header),t.dictionary){var i;if(i="string"==typeof t.dictionary?gl(t.dictionary):"[object ArrayBuffer]"===bl.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=ll(this.strm,i))!==xl)throw new Error(hc[n]);this._dict_set=!0}}function Rl(e,t){var n=new Dl(t);if(n.push(e,!0),n.err)throw n.msg||hc[n.err];return n.result}Dl.prototype.push=function(e,t){var n,i,r=this.strm,o=this.options.chunkSize;if(this.ended)return!1;for(i=t===~~t?t:!0===t?Sl:El,"string"==typeof e?r.input=gl(e):"[object ArrayBuffer]"===bl.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(o),r.next_out=0,r.avail_out=o),(i===wl||i===kl)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((n=sl(r,i))===Tl)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),n=cl(this.strm),this.onEnd(n),this.ended=!0,n===xl;if(0!==r.avail_out){if(i>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Dl.prototype.onData=function(e){this.chunks.push(e)},Dl.prototype.onEnd=function(e){e===xl&&(this.result=dl(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ol=Dl,Il=Rl,Ml=function(e,t){return(t=t||{}).raw=!0,Rl(e,t)},Pl=function(e,t){return(t=t||{}).gzip=!0,Rl(e,t)},Nl=function(e,t){var n,i,r,o,a,s,c,l,u,f,d,h,p,v,g,m,_,y,b,E,w,k,S,x,T=e.state;n=e.next_in,S=e.input,i=n+(e.avail_in-5),r=e.next_out,x=e.output,o=r-(t-e.avail_out),a=r+(e.avail_out-257),s=T.dmax,c=T.wsize,l=T.whave,u=T.wnext,f=T.window,d=T.hold,h=T.bits,p=T.lencode,v=T.distcode,g=(1<<T.lenbits)-1,m=(1<<T.distbits)-1;e:do{h<15&&(d+=S[n++]<<h,h+=8,d+=S[n++]<<h,h+=8),_=p[d&g];t:for(;;){if(d>>>=y=_>>>24,h-=y,0===(y=_>>>16&255))x[r++]=65535&_;else{if(!(16&y)){if(0==(64&y)){_=p[(65535&_)+(d&(1<<y)-1)];continue t}if(32&y){T.mode=16191;break e}e.msg="invalid literal/length code",T.mode=16209;break e}b=65535&_,(y&=15)&&(h<y&&(d+=S[n++]<<h,h+=8),b+=d&(1<<y)-1,d>>>=y,h-=y),h<15&&(d+=S[n++]<<h,h+=8,d+=S[n++]<<h,h+=8),_=v[d&m];n:for(;;){if(d>>>=y=_>>>24,h-=y,!(16&(y=_>>>16&255))){if(0==(64&y)){_=v[(65535&_)+(d&(1<<y)-1)];continue n}e.msg="invalid distance code",T.mode=16209;break e}if(E=65535&_,h<(y&=15)&&(d+=S[n++]<<h,(h+=8)<y&&(d+=S[n++]<<h,h+=8)),(E+=d&(1<<y)-1)>s){e.msg="invalid distance too far back",T.mode=16209;break e}if(d>>>=y,h-=y,E>(y=r-o)){if((y=E-y)>l&&T.sane){e.msg="invalid distance too far back",T.mode=16209;break e}if(w=0,k=f,0===u){if(w+=c-y,y<b){b-=y;do{x[r++]=f[w++]}while(--y);w=r-E,k=x}}else if(u<y){if(w+=c+u-y,(y-=u)<b){b-=y;do{x[r++]=f[w++]}while(--y);if(w=0,u<b){b-=y=u;do{x[r++]=f[w++]}while(--y);w=r-E,k=x}}}else if(w+=u-y,y<b){b-=y;do{x[r++]=f[w++]}while(--y);w=r-E,k=x}for(;b>2;)x[r++]=k[w++],x[r++]=k[w++],x[r++]=k[w++],b-=3;b&&(x[r++]=k[w++],b>1&&(x[r++]=k[w++]))}else{w=r-E;do{x[r++]=x[w++],x[r++]=x[w++],x[r++]=x[w++],b-=3}while(b>2);b&&(x[r++]=x[w++],b>1&&(x[r++]=x[w++]))}break}}break}}while(n<i&&r<a);n-=b=h>>3,d&=(1<<(h-=b<<3))-1,e.next_in=n,e.next_out=r,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=r<a?a-r+257:257-(r-a),T.hold=d,T.bits=h},Ul=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Bl=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Gl=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Ll=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),jl=function(e,t,n,i,r,o,a,s){var c,l,u,f,d,h,p,v,g,m=s.bits,_=0,y=0,b=0,E=0,w=0,k=0,S=0,x=0,T=0,A=0,z=null,C=new Uint16Array(16),D=new Uint16Array(16),R=null;for(_=0;_<=15;_++)C[_]=0;for(y=0;y<i;y++)C[t[n+y]]++;for(w=m,E=15;E>=1&&0===C[E];E--);if(w>E&&(w=E),0===E)return r[o++]=20971520,r[o++]=20971520,s.bits=1,0;for(b=1;b<E&&0===C[b];b++);for(w<b&&(w=b),x=1,_=1;_<=15;_++)if(x<<=1,(x-=C[_])<0)return-1;if(x>0&&(0===e||1!==E))return-1;for(D[1]=0,_=1;_<15;_++)D[_+1]=D[_]+C[_];for(y=0;y<i;y++)0!==t[n+y]&&(a[D[t[n+y]]++]=y);if(0===e?(z=R=a,h=20):1===e?(z=Ul,R=Bl,h=257):(z=Gl,R=Ll,h=0),A=0,y=0,_=b,d=o,k=w,S=0,u=-1,f=(T=1<<w)-1,1===e&&T>852||2===e&&T>592)return 1;for(;;){p=_-S,a[y]+1<h?(v=0,g=a[y]):a[y]>=h?(v=R[a[y]-h],g=z[a[y]-h]):(v=96,g=0),c=1<<_-S,b=l=1<<k;do{r[d+(A>>S)+(l-=c)]=p<<24|v<<16|g|0}while(0!==l);for(c=1<<_-1;A&c;)c>>=1;if(0!==c?(A&=c-1,A+=c):A=0,y++,0==--C[_]){if(_===E)break;_=t[n+a[y]]}if(_>w&&(A&f)!==u){for(0===S&&(S=w),d+=b,x=1<<(k=_-S);k+S<E&&!((x-=C[k+S])<=0);)k++,x<<=1;if(T+=1<<k,1===e&&T>852||2===e&&T>592)return 1;r[u=A&f]=w<<24|k<<16|d-o|0}}return 0!==A&&(r[d+A]=_-S<<24|64<<16|0),s.bits=w,0},Fl=pc.Z_FINISH,Kl=pc.Z_BLOCK,Hl=pc.Z_TREES,Vl=pc.Z_OK,ql=pc.Z_STREAM_END,$l=pc.Z_NEED_DICT,Jl=pc.Z_STREAM_ERROR,Wl=pc.Z_DATA_ERROR,Xl=pc.Z_MEM_ERROR,Zl=pc.Z_BUF_ERROR,Yl=pc.Z_DEFLATED,Ql=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function eu(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var tu,nu,iu=function(e){if(!e)return 1;var t=e.state;return!t||t.strm!==e||t.mode<16180||t.mode>16211?1:0},ru=function(e){if(iu(e))return Jl;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=16180,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Vl},ou=function(e){if(iu(e))return Jl;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ru(e)},au=function(e,t){var n;if(iu(e))return Jl;var i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Jl:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,ou(e))},su=function(e,t){if(!e)return Jl;var n=new eu;e.state=n,n.strm=e,n.window=null,n.mode=16180;var i=au(e,t);return i!==Vl&&(e.state=null),i},cu=!0,lu=function(e){if(cu){tu=new Int32Array(512),nu=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(jl(1,e.lens,0,288,tu,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;jl(2,e.lens,0,32,nu,0,e.work,{bits:5}),cu=!1}e.lencode=tu,e.lenbits=9,e.distcode=nu,e.distbits=5},uu=function(e,t,n,i){var r,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),i>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):((r=o.wsize-o.wnext)>i&&(r=i),o.window.set(t.subarray(n-i,n-i+r),o.wnext),(i-=r)?(o.window.set(t.subarray(n-i,n),0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0},fu=ou,du=su,hu=function(e,t){var n,i,r,o,a,s,c,l,u,f,d,h,p,v,g,m,_,y,b,E,w,k,S,x,T=0,A=new Uint8Array(4),z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(iu(e)||!e.output||!e.input&&0!==e.avail_in)return Jl;16191===(n=e.state).mode&&(n.mode=16192),a=e.next_out,r=e.output,c=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,l=n.hold,u=n.bits,f=s,d=c,k=Vl;e:for(;;)switch(n.mode){case 16180:if(0===n.wrap){n.mode=16192;break}for(;u<16;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,A[0]=255&l,A[1]=l>>>8&255,n.check=dc(n.check,A,2,0),l=0,u=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=16209;break}if((15&l)!==Yl){e.msg="unknown compression method",n.mode=16209;break}if(u-=4,w=8+(15&(l>>>=4)),0===n.wbits&&(n.wbits=w),w>15||w>n.wbits){e.msg="invalid window size",n.mode=16209;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:16191,l=0,u=0;break;case 16181:for(;u<16;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(n.flags=l,(255&n.flags)!==Yl){e.msg="unknown compression method",n.mode=16209;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=16209;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=dc(n.check,A,2,0)),l=0,u=0,n.mode=16182;case 16182:for(;u<32;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,n.check=dc(n.check,A,4,0)),l=0,u=0,n.mode=16183;case 16183:for(;u<16;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=dc(n.check,A,2,0)),l=0,u=0,n.mode=16184;case 16184:if(1024&n.flags){for(;u<16;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=dc(n.check,A,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&((h=n.length)>s&&(h=s),h&&(n.head&&(w=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(o,o+h),w)),512&n.flags&&4&n.wrap&&(n.check=dc(n.check,i,h,o)),s-=h,o+=h,n.length-=h),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;h=0;do{w=i[o+h++],n.head&&w&&n.length<65536&&(n.head.name+=String.fromCharCode(w))}while(w&&h<s);if(512&n.flags&&4&n.wrap&&(n.check=dc(n.check,i,h,o)),s-=h,o+=h,w)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;h=0;do{w=i[o+h++],n.head&&w&&n.length<65536&&(n.head.comment+=String.fromCharCode(w))}while(w&&h<s);if(512&n.flags&&4&n.wrap&&(n.check=dc(n.check,i,h,o)),s-=h,o+=h,w)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;u<16;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(4&n.wrap&&l!==(65535&n.check)){e.msg="header crc mismatch",n.mode=16209;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=16191;break;case 16189:for(;u<32;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}e.adler=n.check=Ql(l),l=0,u=0,n.mode=16190;case 16190:if(0===n.havedict)return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=u,$l;e.adler=n.check=1,n.mode=16191;case 16191:if(t===Kl||t===Hl)break e;case 16192:if(n.last){l>>>=7&u,u-=7&u,n.mode=16206;break}for(;u<3;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}switch(n.last=1&l,u-=1,3&(l>>>=1)){case 0:n.mode=16193;break;case 1:if(lu(n),n.mode=16199,t===Hl){l>>>=2,u-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=16209}l>>>=2,u-=2;break;case 16193:for(l>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=16209;break}if(n.length=65535&l,l=0,u=0,n.mode=16194,t===Hl)break e;case 16194:n.mode=16195;case 16195:if(h=n.length){if(h>s&&(h=s),h>c&&(h=c),0===h)break e;r.set(i.subarray(o,o+h),a),s-=h,o+=h,c-=h,a+=h,n.length-=h;break}n.mode=16191;break;case 16196:for(;u<14;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(n.nlen=257+(31&l),l>>>=5,u-=5,n.ndist=1+(31&l),l>>>=5,u-=5,n.ncode=4+(15&l),l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=16209;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;u<3;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.lens[z[n.have++]]=7&l,l>>>=3,u-=3}for(;n.have<19;)n.lens[z[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},k=jl(0,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,k){e.msg="invalid code lengths set",n.mode=16209;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;m=(T=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,_=65535&T,!((g=T>>>24)<=u);){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(_<16)l>>>=g,u-=g,n.lens[n.have++]=_;else{if(16===_){for(x=g+2;u<x;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(l>>>=g,u-=g,0===n.have){e.msg="invalid bit length repeat",n.mode=16209;break}w=n.lens[n.have-1],h=3+(3&l),l>>>=2,u-=2}else if(17===_){for(x=g+3;u<x;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}u-=g,w=0,h=3+(7&(l>>>=g)),l>>>=3,u-=3}else{for(x=g+7;u<x;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}u-=g,w=0,h=11+(127&(l>>>=g)),l>>>=7,u-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=16209;break}for(;h--;)n.lens[n.have++]=w}}if(16209===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=16209;break}if(n.lenbits=9,S={bits:n.lenbits},k=jl(1,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,k){e.msg="invalid literal/lengths set",n.mode=16209;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},k=jl(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,k){e.msg="invalid distances set",n.mode=16209;break}if(n.mode=16199,t===Hl)break e;case 16199:n.mode=16200;case 16200:if(s>=6&&c>=258){e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=u,Nl(e,d),a=e.next_out,r=e.output,c=e.avail_out,o=e.next_in,i=e.input,s=e.avail_in,l=n.hold,u=n.bits,16191===n.mode&&(n.back=-1);break}for(n.back=0;m=(T=n.lencode[l&(1<<n.lenbits)-1])>>>16&255,_=65535&T,!((g=T>>>24)<=u);){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(m&&0==(240&m)){for(y=g,b=m,E=_;m=(T=n.lencode[E+((l&(1<<y+b)-1)>>y)])>>>16&255,_=65535&T,!(y+(g=T>>>24)<=u);){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}l>>>=y,u-=y,n.back+=y}if(l>>>=g,u-=g,n.back+=g,n.length=_,0===m){n.mode=16205;break}if(32&m){n.back=-1,n.mode=16191;break}if(64&m){e.msg="invalid literal/length code",n.mode=16209;break}n.extra=15&m,n.mode=16201;case 16201:if(n.extra){for(x=n.extra;u<x;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;m=(T=n.distcode[l&(1<<n.distbits)-1])>>>16&255,_=65535&T,!((g=T>>>24)<=u);){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(0==(240&m)){for(y=g,b=m,E=_;m=(T=n.distcode[E+((l&(1<<y+b)-1)>>y)])>>>16&255,_=65535&T,!(y+(g=T>>>24)<=u);){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}l>>>=y,u-=y,n.back+=y}if(l>>>=g,u-=g,n.back+=g,64&m){e.msg="invalid distance code",n.mode=16209;break}n.offset=_,n.extra=15&m,n.mode=16203;case 16203:if(n.extra){for(x=n.extra;u<x;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=16209;break}n.mode=16204;case 16204:if(0===c)break e;if(h=d-c,n.offset>h){if((h=n.offset-h)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=16209;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),v=n.window}else v=r,p=a-n.offset,h=n.length;h>c&&(h=c),c-=h,n.length-=h;do{r[a++]=v[p++]}while(--h);0===n.length&&(n.mode=16200);break;case 16205:if(0===c)break e;r[a++]=n.length,c--,n.mode=16200;break;case 16206:if(n.wrap){for(;u<32;){if(0===s)break e;s--,l|=i[o++]<<u,u+=8}if(d-=c,e.total_out+=d,n.total+=d,4&n.wrap&&d&&(e.adler=n.check=n.flags?dc(n.check,r,d,a-d):uc(n.check,r,d,a-d)),d=c,4&n.wrap&&(n.flags?l:Ql(l))!==n.check){e.msg="incorrect data check",n.mode=16209;break}l=0,u=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;u<32;){if(0===s)break e;s--,l+=i[o++]<<u,u+=8}if(4&n.wrap&&l!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=16209;break}l=0,u=0}n.mode=16208;case 16208:k=ql;break e;case 16209:k=Wl;break e;case 16210:return Xl;default:return Jl}return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||d!==e.avail_out&&n.mode<16209&&(n.mode<16206||t!==Fl))&&uu(e,e.output,e.next_out,d-e.avail_out),f-=e.avail_in,d-=e.avail_out,e.total_in+=f,e.total_out+=d,n.total+=d,4&n.wrap&&d&&(e.adler=n.check=n.flags?dc(n.check,r,d,e.next_out-d):uc(n.check,r,d,e.next_out-d)),e.data_type=n.bits+(n.last?64:0)+(16191===n.mode?128:0)+(16199===n.mode||16194===n.mode?256:0),(0===f&&0===d||t===Fl)&&k===Vl&&(k=Zl),k},pu=function(e){if(iu(e))return Jl;var t=e.state;return t.window&&(t.window=null),e.state=null,Vl},vu=function(e,t){if(iu(e))return Jl;var n=e.state;return 0==(2&n.wrap)?Jl:(n.head=t,t.done=!1,Vl)},gu=function(e,t){var n,i=t.length;return iu(e)?Jl:0!==(n=e.state).wrap&&16190!==n.mode?Jl:16190===n.mode&&uc(1,t,i,0)!==n.check?Wl:uu(e,t,i,i)?(n.mode=16210,Xl):(n.havedict=1,Vl)},mu=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},_u=Object.prototype.toString,yu=pc.Z_NO_FLUSH,bu=pc.Z_FINISH,Eu=pc.Z_OK,wu=pc.Z_STREAM_END,ku=pc.Z_NEED_DICT,Su=pc.Z_STREAM_ERROR,xu=pc.Z_DATA_ERROR,Tu=pc.Z_MEM_ERROR;function Au(e){this.options=fl({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new yl,this.strm.avail_out=0;var n=du(this.strm,t.windowBits);if(n!==Eu)throw new Error(hc[n]);if(this.header=new mu,vu(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=gl(t.dictionary):"[object ArrayBuffer]"===_u.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=gu(this.strm,t.dictionary))!==Eu))throw new Error(hc[n])}function zu(e,t){var n=new Au(t);if(n.push(e),n.err)throw n.msg||hc[n.err];return n.result}Au.prototype.push=function(e,t){var n,i,r,o=this.strm,a=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(i=t===~~t?t:!0===t?bu:yu,"[object ArrayBuffer]"===_u.call(e)?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;;){for(0===o.avail_out&&(o.output=new Uint8Array(a),o.next_out=0,o.avail_out=a),(n=hu(o,i))===ku&&s&&((n=gu(o,s))===Eu?n=hu(o,i):n===xu&&(n=ku));o.avail_in>0&&n===wu&&o.state.wrap>0&&0!==e[o.next_in];)fu(o),n=hu(o,i);switch(n){case Su:case xu:case ku:case Tu:return this.onEnd(n),this.ended=!0,!1}if(r=o.avail_out,o.next_out&&(0===o.avail_out||n===wu))if("string"===this.options.to){var c=_l(o.output,o.next_out),l=o.next_out-c,u=ml(o.output,c);o.next_out=l,o.avail_out=a-l,l&&o.output.set(o.output.subarray(c,c+l),0),this.onData(u)}else this.onData(o.output.length===o.next_out?o.output:o.output.subarray(0,o.next_out));if(n!==Eu||0!==r){if(n===wu)return n=pu(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===o.avail_in)break}}return!0},Au.prototype.onData=function(e){this.chunks.push(e)},Au.prototype.onEnd=function(e){e===Eu&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=dl(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Cu=function(e,t){return(t=t||{}).raw=!0,zu(e,t)},Du={Deflate:Ol,deflate:Il,deflateRaw:Ml,gzip:Pl,Inflate:Au,inflate:zu,inflateRaw:Cu,ungzip:zu,constants:pc},Ru=function(){function e(e,t){this.collector=e,this.config=t,this.requestType=t.request_type,this.supportBeacon=!(!window.navigator||!window.navigator.sendBeacon),this.errorCode={NO_URL:4001,IMG_ON:4e3,IMG_CATCH:4002,BEACON_FALSE:4003,XHR_ON:500,RESPONSE:5001,TIMEOUT:5005},this.customHeader=t.custom_request_header||{}}return e.prototype.useFetch=function(e){var t=e.url,n=e.data,i=e.method,r=e.success,o=e.fail,a={"Content-Type":"application/json; charset=utf-8"};if(Object.keys(this.customHeader).length)for(var s in this.customHeader)a[s]=this.customHeader[s];window.fetch?fetch(t,{method:i||"POST",headers:a,body:JSON.stringify(n)}).then((function(e){return e.json()})).then((function(e){r&&r(e)})).catch((function(e){o&&o(n,e)})):(this.requestType="xhr",console.log("your brwoser not support fetch, use xhr"),this.useRequest({url:t,data:n,method:i,success:r,fail:o}))},e.prototype.useBeacon=function(e){var t=e.url,n=e.data,i=e.success,r=e.fail;"xhr"!==this.requestType?window.navigator.sendBeacon(t,JSON.stringify(n))?i&&i():r&&r(n,this.errorCode.BEACON_FALSE):this.useXhr(e)},e.prototype.useXhr=function(e){var t=this,n=e.url,i=e.data,r=e.method,o=e.success,a=e.fail,s=e.timeout,c=e.withCredentials,l=e.app_key,u=e.zip;try{var f=new XMLHttpRequest,d=r||"POST";if(f.open(d,""+n,!0),f.setRequestHeader("Content-Type","application/json; charset=utf-8"),l&&f.setRequestHeader("X-MCS-AppKey",""+l),Object.keys(this.customHeader).length)for(var h in this.customHeader)f.setRequestHeader(h,this.customHeader[h]);c&&(f.withCredentials=!0),s&&(f.timeout=s,f.ontimeout=function(){a&&a(i,t.errorCode.TIMEOUT)}),f.onload=function(){if(o){var e=null;if(f.responseText){try{e=JSON.parse(f.responseText)}catch(t){e={}}o(e,i)}}},f.onerror=function(){f.abort(),a&&a(i,t.errorCode.XHR_ON)};try{var p=JSON.stringify(i),v=this.collector.configManager.getCurrentEnv();if(this.config.need_zip&&u)if("row"===v){var g=(new TextEncoder).encode(p),m=Du.gzip(g);f.setRequestHeader("Content-Encoding","gzip"),f.send(m)}else f.send(p),this.collector.logger.warn("your channel do not support gzip, use normal data!");else f.send(p)}catch(e){f.send(JSON.stringify(i)),this.collector.emit("sdk-inner-error",{type:"sdk_error_send",eventData:i,errorCode:1e3,msg:e.message||e.stack||"sdk_error_send"})}}catch(e){this.collector.emit("sdk-inner-error",{type:"sdk_error_request",eventData:i,errorCode:1001,msg:e.message||e.stack||"sdk_error_request"})}},e.prototype.useRequest=function(e){var t=e.useBeacon,n=e.forceXhr;if("xhr"===this.requestType)this.useXhr(e);else{if(t&&this.supportBeacon)return void this.useBeacon(e);if("fetch"===this.requestType&&!n)return void this.useFetch(e);this.useXhr(e)}},e}(),Ou=function(){function e(e){var t=this;this.onMove=function(e){if(t.isDragging){var n=e.clientX||e.touches[0].clientX,i=e.clientY||e.touches[0].clientY;if(t.clickAllowed){var r=Math.abs(n-t.initialX),o=Math.abs(i-t.initialY);(r>t.dragThreshold||o>t.dragThreshold)&&(t.clickAllowed=!1)}t.animationFrameId&&cancelAnimationFrame(t.animationFrameId),t.animationFrameId=requestAnimationFrame((function(){var n=e.touches?e.touches[0].clientX:e.clientX,i=e.touches?e.touches[0].clientY:e.clientY,r=n-t.offsetX,o=i-t.offsetY,a=window.innerWidth-t.element.offsetWidth,s=window.innerHeight-t.element.offsetHeight;r=Math.max(0,Math.min(r,a)),o=Math.max(0,Math.min(o,s)),t.element.style.transform="translate(\n "+(r-t.initialX)+"px, \n "+(o-t.initialY)+"px\n )"}))}},this.onEnd=function(){if(t.isDragging){t.isDragging=!1;var e=new DOMMatrix(getComputedStyle(t.element).transform),n=t.initialX+e.m41,i=t.initialY+e.m42;t.element.style.left=n+"px",t.element.style.top=i+"px",t.element.style.transform="none",t.initialX=n,t.initialY=i,document.removeEventListener("mousemove",t.onMove),document.removeEventListener("mouseup",t.onEnd),document.removeEventListener("touchmove",t.onMove),document.removeEventListener("touchend",t.onEnd),setTimeout((function(){t.clickAllowed=!0}),50)}},this.element=e,this.isDragging=!1,this.animationFrameId=null,this.lastX=0,this.lastY=0,this.initialX=0,this.initialY=0,this.offsetX=0,this.offsetY=0,this.clickAllowed=!0,this.dragThreshold=1,this.initPosition(),this.bindEvents(),this.bindClickHandler()}return e.prototype.initPosition=function(){var e=this.element.getBoundingClientRect();this.element.style.position="fixed",this.element.style.left=e.left+"px",this.element.style.top=e.top+"px",this.element.style.transform="translate(0, 0)"},e.prototype.bindEvents=function(){this.element.addEventListener("mousedown",this.onStart.bind(this)),this.element.addEventListener("touchstart",this.onStart.bind(this))},e.prototype.onStart=function(e){e.preventDefault(),this.initialX=e.clientX||e.touches[0].clientX,this.initialY=e.clientY||e.touches[0].clientY;var t=e.touches?e.touches[0].clientX:e.clientX,n=e.touches?e.touches[0].clientY:e.clientY,i=this.element.getBoundingClientRect();this.initialX=i.left,this.initialY=i.top,this.offsetX=t-this.initialX,this.offsetY=n-this.initialY,this.clickAllowed=!0,this.isDragging=!0,document.addEventListener("mousemove",this.onMove),document.addEventListener("mouseup",this.onEnd),document.addEventListener("touchmove",this.onMove),document.addEventListener("touchend",this.onEnd)},e.prototype.bindClickHandler=function(){var e=this;this.element.addEventListener("click",(function(t){if(!e.clickAllowed)return t.stopImmediatePropagation(),void t.preventDefault();window&&window.postMessage({type:"devtool:web:open-draw"},location.origin)}))},e}(),Iu=function(){function e(e,t){if(this.devToolReady=!1,this.sendAlready=!1,t.enable_debug&&"Microsoft Internet Explorer"!==e.configManager.get("browser")){this.collect=e,this.config=t,this.app_id=t.app_id;var n=e.adapters.storage;this.cacheStorgae=new n(!1),this.devToolOrigin=window.location.origin,this.currentInstance=t.current_instance||"",this.loadUrl=t.devtool_url||"https://sf16-website-login.neutral.ttwstatic.com/obj/tiktok_web_login_static/log-sdk/collect/devtool/debug-web.v2.0.0.js",this.filterEvent=new Set(["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","bav2b_page","bav2b_beat","bav2b_page_statistics","bav2b_click","bav2b_page_exposure","_be_active","predefine_pageview","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append","predefine_page_alive","predefine_page_close","abtest_exposure"]),this.load()}}return e.prototype.loadScript=function(e){try{var t=document.createElement("script");t.src=e,t.onerror=function(){console.log("load DevTool render fail")},t.onload=function(){console.log("load DevTool render success")},document.getElementsByTagName("body")[0].appendChild(t)}catch(e){console.log("devTool load fail, "+e.message)}},e.prototype.parseUrl=function(){var e={};try{var t=window.location.href.split("?")[1].split("&");t.length&&t.forEach((function(t){var n=t.split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}))}catch(e){}return e},e.prototype.load=function(){try{var e=this.parseUrl();if(e.open_devtool_web&&e.app_id){if(parseInt(e.app_id)!==this.app_id)return;if(e.current_instance&&e.current_instance!==this.currentInstance)return}else if(!this.getStorage())return;this.loadBaseInfo(),this.loadHook(),this.setStorage(),this.addLintener(),this.loadDebuggerModule(),this.loadDevTool()}catch(e){console.log("debug fail, "+e.message)}},e.prototype.getStorage=function(){var e=this.cacheStorgae.getItem("__applog_open_devtool_web");return e&&parseInt(e)===this.app_id},e.prototype.setStorage=function(){this.cacheStorgae.setItem("__applog_open_devtool_web",this.app_id)},e.prototype.loadDevTool=function(){this.loadScript(this.loadUrl)},e.prototype.loadBaseInfo=function(){if(this.log=[],this.event=[],this.info=[{title:"BaseInfo",key:"base",type:1,content:[{name:"app_id",desc:"APPID",value:this.config.app_id},{name:"channel",desc:"CHANNEL",value:this.config.channel},{name:"domain",desc:"Domain",value:this.collect.configManager.getDomain()},{name:"sdk_version",desc:"SDK Version",value:us},{name:"sdk_type",desc:"SDK Import Type",value:"npm"}]},{title:"UserInfo",key:"user",type:2,content:[{name:"uuid",desc:"UserUniqueId",value:this.collect.configManager.get("user").user_unique_id||""},{name:"web_id",desc:"WEB_ID",value:this.collect.configManager.get("user").web_id||""}]},{title:"CommonInfo",type:2,key:"common",content:[{name:"browser",desc:"Browser",value:this.collect.configManager.get("browser")},{name:"browser_version",desc:"Browser Version",value:this.collect.configManager.get("browser_version")},{name:"platform",desc:"Platform",value:this.collect.configManager.get("platform")},{name:"device_model",desc:"Devide Model",value:this.collect.configManager.get("device_model")},{name:"os_name",desc:"Os Name",value:this.collect.configManager.get("os_name")},{name:"os_version",desc:"Os Version",value:this.collect.configManager.get("os_version")},{name:"resolution",desc:"Screen Resolution",value:this.collect.configManager.get("resolution")},{name:"referrer",desc:"Referrer",value:this.collect.configManager.get("referrer")},{name:"custom",desc:"Custom Info",value:JSON.stringify(this.collect.configManager.get("custom"))}]},{title:"Config Info",key:"config",type:3,content:[{name:"autotrack",desc:"AutoTrackEvent",value:!!this.config.autotrack},{name:"stay",desc:"StayDuration",value:!!this.config.enable_stay_duration}]},{title:"A/B Config Info",key:"ab",type:4,content:[{name:"ab",desc:"A/BTester",value:!!this.config.enable_ab_test}]}],this.config.enable_ab_test){var e=this.getInfo("ab"),t=[{name:"ab",desc:"A/BTester",value:!!this.config.enable_ab_test},{name:"vid",desc:"A/B VID",value:this.collect.configManager.getAbVersion()},{name:"ab_domain",desc:"Domain",value:this.config.ab_channel_domain||Oa(ss[this.config.channel])},{name:"all_values",desc:"A/B ALL Values",value:this.collect.configManager.getAbCache()}];e.content=t,this.setInfo("ab",e)}},e.prototype.getInfo=function(e){var t=null;return this.info.forEach((function(n){n.key===e&&(t=n)})),t},e.prototype.setInfo=function(e,t){var n=!1;this.info.forEach((function(i){i.key===e&&(n=!0,i=t)})),n||this.info.push(t)},e.prototype.getSecondInfo=function(e,t){var n=this.getInfo(e),i=null;return n.content.forEach((function(e){e.name===t&&(i=e)})),i},e.prototype.setSecondInfo=function(e,t,n){var i=this.getInfo(e),r=!1;if(i.content.forEach((function(e){e.name===t&&(e.value=n,r=!0)})),!r){var o={name:t,value:n,desc:t.toLocaleUpperCase()};i.content.push(o)}this.setInfo(e,i)},e.prototype.loadHook=function(){var e=this;this.collect.on(Fa.DEBUGGER_MESSAGE,(function(t){switch(t.type){case Fa.DEBUGGER_MESSAGE_SDK:var n={time:t.time,type:t.logType||"sdk",infoType:t.infoType||"sdk",level:t.level,name:t.info,show:!0,levelShow:!0,needDesc:!!t.data};if(t.data&&(n.desc={content:JSON.stringify(t.data)}),e.updateLog(n),t.secType&&"AB"===t.secType)e.setSecondInfo("ab","vid",e.collect.configManager.getAbVersion()),e.setSecondInfo("ab","all_values",e.collect.configManager.getAbCache());else if("USER"===t.secType)e.setSecondInfo("user","user_unique_id"===t.common?"uuid":t.common,e.collect.configManager.get(t.common));else if("HEADER"===t.secType){var i=e.collect.configManager.get(t.common);e.setSecondInfo("common",t.common,"custom"===t.common?JSON.stringify(i):i)}return void e.updateInfo();case Fa.DEBUGGER_MESSAGE_EVENT:if(t.data&&t.data.length){var r=t.data[0],o=r.events;if(!o.length)return;o.forEach((function(n){n.checkShow=!0,n.searchShow=!0,n.focusShow=!0,n.status=t.status,n.type=e.filterEvent.has(n.event)?"sdk":"cus",n.verifyType=t.verifyType?"verify":"no",n.info="","fail"===t.status&&(n.info={message:"code: "+t.code+", msg: "+(t.msg||t.failType)})})),e.updateEvent(r)}return}}))},e.prototype.addLintener=function(){var e=this;window.addEventListener("message",(function(t){if(e.devToolOrigin===t.origin){if(t&&t.data&&"devtool:web:ready"===t.data.type){if(e.devToolOrigin=t.origin,e.devToolReady=!0,e.sendAlready)return;e.sendData("devtool:web:init",{info:e.info,log:e.log,event:e.event,sdk_type:us.includes("tob")?"tob":"inner",appId:e.app_id}),e.sendAlready=!0}t&&t.data&&"devtool:web:ssid"===t.data.type&&e.collect.getToken((function(t){e.setSecondInfo("user","sid",t.tobid),e.updateInfo()}))}}))},e.prototype.sendData=function(e,t){try{var n={type:e,payload:t};window&&window.postMessage(n,this.devToolOrigin)}catch(e){}},e.prototype.updateInfo=function(){this.devToolReady&&this.sendData("devtool:web:info",this.info)},e.prototype.updateLog=function(e){this.devToolReady?this.sendData("devtool:web:log",e):this.log.push(e)},e.prototype.updateEvent=function(e){this.devToolReady?this.sendData("devtool:web:event",e):this.event.push(e)},e.prototype.loadDebuggerModule=function(){var e="#debugger-applog-web {\n position: fixed;\n width: 45px;\n height: 45px;\n background-image: url("+Oa("1fz22z22z1nz21z4mz4bz4bz21z1dz4dz4iz49z25z1cz19z21z1gz22z1cz49z1jz1mz1ez1gz1lz4az1lz1cz23z22z20z18z1jz4az22z22z25z21z22z18z22z1gz1az4az1az1mz1kz4bz1mz19z1hz4bz22z1gz1iz22z1mz1iz16z25z1cz19z16z1jz1mz1ez1gz1lz16z21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz1bz1cz24z22z1mz1mz1jz4bz18z1nz1nz1jz1mz1ez4az1nz1lz1e")+");\n bottom: 5%;\n right: 10%;\n cursor: pointer;\n z-index:100;\n background-size: 45px;\n }",t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.appendChild(document.createTextNode(e)),t.appendChild(n);var i=document.createElement("div");i.innerHTML='<div id="debugger-applog-web" class="debugger-applog-web"></div>';var r=document.createElement("div");r.innerHTML='<div id="debugger-container" class="debugger-container"></div>',document.getElementsByTagName("body")[0].appendChild(i),document.getElementsByTagName("body")[0].appendChild(r);var o=document.getElementById("debugger-applog-web");new Ou(o)},e}(),Mu={autotrack:{src:{sg:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/autotrack.js",va:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/autotrack.js"},object:"LogAutoTrack"},ab:{src:{sg:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/ab.js",va:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/ab.js"},object:"LogAb"},stay:{src:{sg:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/stay.js",va:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/stay.js"},object:"LogStay"},route:{src:{sg:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/route.js",va:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/route.js"},object:"LogRoute"},tracer:{src:{sg:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/tracer.js",va:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/tracer.js"},object:"LogTracer"},retry:{src:{sg:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/retry.js",va:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/retry.js"},object:"LogRetry"},visual:{src:{sg:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-sg/log-sdk/collect/5/plugin/visual.js",va:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/5/plugin/visual.js"},object:"LogVisual"}},Pu=["ab","autotrack","Stay","store","et","profile","cep","heartbeat","monitor","route","tracer"],Nu=function(){function e(e){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroy=!1,this.sdkReady=!1,this.adapters={},this.loadType="base",this.sdkStop=!1,this.name=e,this.hook=new za,this.remotePlugin=new Map,this.logger=new _s(e),this.Types=ds,this.adapters.storage=ns,this.loadType="full"}return e.usePlugin=function(t,n,i){if(n){for(var r=!1,o=0,a=e.plugins.length;o<a;o++)if(e.plugins[o].name===n){e.plugins[o].plugin=t,e.plugins[o].options=i||{},r=!0;break}r||e.plugins.push({name:n,plugin:t,options:i})}else e.plugins.push({plugin:t})},e.prototype.usePlugin=function(e,t,n){e&&("full"===this.loadType&&Pu.includes(e)?console.info("your sdk version has "+e+" already ~"):t?"string"==typeof t?this.remotePlugin.get(e)||this.remotePlugin.set(e,{src:t,call:n}):this.remotePlugin.get(e)||this.remotePlugin.set(e,{instance:t}):this.remotePlugin.get(e)||this.remotePlugin.set(e,"sdk"))},e.prototype.init=function(t){var n,i=this;if(this.logger.enable(t.log),this.inited)this.logger.warn("[instance: "+this.name+"], every instance's api: init, can be call only one time!");else if(t&&Ca(t))if(t.app_id&&"number"==typeof(n=t.app_id)&&!isNaN(n))if(!t.app_key||function(e){return"string"==typeof e}(t.app_key)){if(t.channel_domain||("eu_ttp_ie"!==t.report_channel&&"ie"!==t.channel||this.logger.error("ie dc will be deprecated in the future, please use other dc instead"),t.report_channel&&!rs().has(t.report_channel)?(this.logger.warn("your report_channel: "+t.report_channel+" is not exist. report_channel must be one of "+os().join(",")+", use default report_channel: us_east instead, please check!!!"),t.report_channel="us_east"):t.report_channel||-1!==["sg","va","in","my","ie","ie2"].indexOf(t.channel)||(this.logger.warn("your channel: "+t.channel+" is not exist. use report_channel instead and report_channel must be one of "+os().join(",")+", use default report_channel: us_east instead, please check!!!"),t.report_channel="us_east"),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK set channel warning",level:"error",time:Date.now(),data:"your report_channel: "+t.channel+" is not exist. report_channel must be one of "+os().join(",")+", use us_east instead, please check!!!",infoType:"sdk"})),this.spider=new ys,this.spider.checkSpider(t))return this.logger.warn("The current environment may be a spider, can not report!"),void this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK hit spider",level:"error",time:Date.now(),data:"The current environment may be a spider, can not report!",infoType:"sdk"});this.appBridge=new bs(this,t.enable_native),this.requestManager=new Ru(this,t),this.bridgeReport=this.appBridge.bridgeInject(),this.configManager=new ms(this,t),this.debugger=new Iu(this,t),this.initConfig=t,this.emit(ds.Init),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Init",data:t,level:"info",time:Date.now(),infoType:"cus"}),t.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport||(this.configManager.setAppid(t.app_id),this.eventManager=new ws,this.tokenManager=new Ss,this.sessionManager=new Ts,Promise.all([new Promise((function(e){i.once(ds.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){i.once(ds.Start,(function(){e(!0)}))})),new Promise((function(e){i.once(ds.LogSettingReady,(function(){e(!0)}))}))]).then((function(){try{e.plugins.reduce((function(e,t){var n=t.plugin,r=t.options,o=Object.assign(i.initConfig,r);i.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Load "+t.name+" Plugin",level:"info",time:Date.now(),infoType:"sdk"});var a=new n;return a.apply(i,o),e.push(a),e}),i.pluginInstances)}catch(e){console.warn("load plugin error, "+e.message),i.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Load Plugin Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}i.sdkReady=!0,i.emit(ds.Ready),i.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK UserInfo Init Completed",time:Date.now(),secType:"USER",level:"info",data:i.configManager.get("user"),infoType:"sdk"}),i.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Initialization Completed",time:Date.now(),level:"info",data:i.configManager.get("user"),infoType:"sdk"}),i.logger.info("appid: "+t.app_id+", userInfo:"+JSON.stringify(i.configManager.get("user"))),i.logger.info("appid: "+t.app_id+", sdk is ready, version is "+us+", you can report now !!!"),t.disable_auto_pv&&(i.disableAutoPageView=!0);try{("full"===i.loadType&&t.enable_ab_test||t.autotrack)&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(e){i.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}i.pageView(),i.on(ds.TokenChange,(function(e){"webid"===e&&i.pageView(),i.logger.info("appid: "+t.app_id+" token change, new userInfo:"+JSON.stringify(i.configManager.get("user"))),i.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Set UserInfo",time:Date.now(),secType:"USER",level:"info",data:i.configManager.get("user"),infoType:"sdk"})})),i.on(ds.TokenReset,(function(){i.logger.info("appid: "+t.app_id+" token reset, new userInfo:"+JSON.stringify(i.configManager.get("user"))),i.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Reset UserInfo",time:Date.now(),secType:"USER",level:"info",data:i.configManager.get("user"),infoType:"sdk"})})),i.on(ds.RouteChange,(function(e){e.init||t.disable_route_report||i.pageView()}))})),this.tokenManager.apply(this,t),this.eventManager.apply(this,t),this.sessionManager.apply(this,t)),this.inited=!0}else this.logger.warn("app_key param is error, must be string, please check!");else this.logger.warn("app_id param is error, must be number, please check!");else this.logger.warn("init params error,please check")},e.prototype.config=function(e){if(!this.inited)return console.warn("config must be use after function init"),void this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Config Error",level:"error",time:Date.now(),data:"config must be use after function init",infoType:"sdk"});if(!e||!Ca(e))return console.warn("config params is error, please check"),void this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Config Error",level:"error",time:Date.now(),data:"config params is error, please check",infoType:"sdk"});var t;try{t=JSON.parse(JSON.stringify(t))}catch(n){t=e}if(this.bridgeReport)this.appBridge.setConfig(t);else{t._staging_flag&&1===t._staging_flag&&(this.staging=!0),t.disable_auto_pv&&(this.disableAutoPageView=!0,delete t.disable_auto_pv);var n=wa({},t);if(this.initConfig&&this.initConfig.configPersist){var i=this.configManager.getStore();i&&(n=Object.assign(i,t)),this.configManager.setStore(t)}n.web_id,n.user_unique_id,n.device_id;var r=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&(n[i[r]]=e[i[r]])}return n}(n,["web_id","user_unique_id","device_id"]);n.hasOwnProperty("web_id")&&this.emit(ds.ConfigWebId,n.web_id),n.hasOwnProperty("user_unique_id")&&this.emit(ds.ConfigUuid,n.user_unique_id),n.hasOwnProperty("device_id")&&this.emit(ds.ConfigDiD,n.device_id),this.configManager.set(r),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Config",level:"info",time:Date.now(),data:n,infoType:"cus"})}},e.prototype.setDomain=function(e){this.configManager&&this.configManager.setDomain(e),this.emit(ds.ConfigDomain)},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.send=function(){this.start()},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit(ds.Start),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Start",level:"info",time:Date.now(),infoType:"cus"}),this.bridgeReport&&(this.pageView(),this.emit(ds.Ready)))},e.prototype.event=function(e,t){var n=this;try{var i=[];if(Array.isArray(e))e.forEach((function(e){var t=n.processEvent(e[0],e[1]||{});t&&i.push(t)}));else{var r=this.processEvent(e,t);if(!r)return;i.push(r)}this.bridgeReport?i.forEach((function(e){var t=e.event,i=e.params;n.appBridge.onEventV3(t,JSON.stringify(i))})):i.length&&(this.emit(ds.Event,i),this.emit(ds.SessionResetTime)),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Event",level:"info",time:Date.now(),data:e,infoType:"cus"})}catch(e){this.logger.warn("something error, please check"),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Event Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.beconEvent=function(e,t){if(Array.isArray(e))return this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK BeconEvent Error",level:"error",time:Date.now(),data:"beconEvent not support batch report, please check",infoType:"sdk"}),void this.logger.warn("beconEvent not support batch report, please check");var n=[],i=this.processEvent(e,t||{});i&&(n.push(i),n.length&&(this.emit(ds.BeconEvent,n),this.emit(ds.SessionResetTime)),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute Beacon Event",level:"info",time:Date.now(),data:e,infoType:"sdk"}))},e.prototype.beaconEvent=function(e,t){this.beconEvent(e,t)},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{if(!e)return console.warn("eventName is null, please check"),null;var n=e;/^event\./.test(e)&&(n=e.slice(6));var i=t;"object"!=J(i)&&(i={}),i.profile?delete i.profile:i.event_index=Ra();var r=void 0;return i.local_ms?(r=i.local_ms,delete i.local_ms):r=+new Date,{event:n,params:i,local_time_ms:r,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}catch(n){return this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:n.message,infoType:"sdk"}),{event:e,params:t}}},e.prototype.filterEvent=function(e){this.eventFilter=e},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,n){this.hook.emit(e,t,n)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.stop=function(){this.sdkStop=!0},e.prototype.reStart=function(){this.sdkStop=!1},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){if(void 0===e&&(e={}),this.inited){var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+(this.configManager&&this.configManager.is_first_time||!1)},n=wa(wa({},t),e);this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Report PV",level:"info",time:Date.now(),infoType:"sdk"}),this.event("predefine_pageview",n)}else console.warn("predefinePageView should call after init")},e.prototype.clearEventCache=function(){this.emit(ds.CleanEvents)},e.prototype.setWebId=function(e){this.config({web_id:""+e})},e.prototype.setNativeAppId=function(e){this.bridgeReport&&this.appBridge.setNativeAppId(e)},e.prototype.getSessionId=function(){return xs()},e.prototype.setSessionId=function(e){this.emit(ds.SessionReset,e)},e.prototype.resetStayDuration=function(e,t,n){this.emit(ds.ResetStay,{url_path:e,title:t,url:n},ds.Stay)},e.prototype.resetStayParams=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.emit(ds.SetStay,{url_path:e,title:t,url:n},ds.Stay)},e.prototype.getToken=function(e,t){var n=this;if(this.inited){var i=!1,r=function(t){if(!i){i=!0;var r=n.configManager.get().user;return t&&(r.tobid=t,r["diss".split("").reverse().join("")]=t),e(wa({},r))}},o=function(){n.tokenManager.getTobId().then((function(e){r(e)}))};this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute GetToken",level:"info",time:Date.now(),infoType:"cus"}),this.sdkReady?o():(t&&setTimeout((function(){r()}),t),this.on(ds.Ready,(function(){o()})))}else console.warn("predefinePageView should call after init")},e.prototype.startTrackEvent=function(e){e&&this.emit(ds.TrackEventDurationStart,e,ds.TrackEventDuration)},e.prototype.endTrackEvent=function(e,t){void 0===t&&(t={}),e&&this.emit(ds.TrackEventDurationEnd,{eventName:e,params:t},ds.TrackEventDuration)},e.prototype.pauseTrackEvent=function(e){e&&this.emit(ds.TrackEventDurationPause,e,ds.TrackEventDuration)},e.prototype.resumeTrackEvent=function(e){e&&this.emit(ds.TrackEventDurationResume,e,ds.TrackEventDuration)},e.prototype.profileSet=function(e){this.bridgeReport?this.appBridge.profileSet(JSON.stringify(e)):this.emit(ds.ProfileSet,e,ds.Profile),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute profileSet",level:"info",time:Date.now(),data:e})},e.prototype.profileSetOnce=function(e){this.bridgeReport?this.appBridge.profileSetOnce(JSON.stringify(e)):this.emit(ds.ProfileSetOnce,e,ds.Profile),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute profileSetOnce",level:"info",time:Date.now(),data:e})},e.prototype.profileIncrement=function(e){this.bridgeReport?this.appBridge.profileIncrement(JSON.stringify(e)):this.emit(ds.ProfileIncrement,e,ds.Profile),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute profileIncrement",level:"info",time:Date.now(),data:e})},e.prototype.profileUnset=function(e){this.bridgeReport?this.appBridge.profileUnset(e):this.emit(ds.ProfileUnset,e,ds.Profile),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute profileUnset",level:"info",time:Date.now(),data:e})},e.prototype.profileAppend=function(e){this.bridgeReport?this.appBridge.profileAppend(JSON.stringify(e)):this.emit(ds.ProfileAppend,e,ds.Profile),this.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute profileAppend",level:"info",time:Date.now(),data:e})},e.prototype.setExternalAbVersion=function(e){this.emit(ds.AbExternalVersion,"string"==typeof e&&e?(""+e).trim():null,ds.Ab)},e.prototype.getVar=function(e,t,n,i){this.emit(ds.AbVar,{name:e,defaultValue:t,callback:n,uuid:i},ds.Ab)},e.prototype.getABconfig=function(e,t){this.emit(ds.AbConfig,{params:e,callback:t},ds.Ab)},e.prototype.getABConfig=function(e,t){this.emit(ds.AbConfig,{params:e,callback:t},ds.Ab)},e.prototype.getAbSdkVersion=function(){return this.configManager.getAbVersion()},e.prototype.onAbSdkVersionChange=function(e){var t=this;return this.emit(ds.AbVersionChangeOn,e,ds.Ab),function(){t.emit(ds.AbVersionChangeOff,e,ds.Ab)}},e.prototype.offAbSdkVersionChange=function(e){this.emit(ds.AbVersionChangeOff,e,ds.Ab)},e.prototype.openOverlayer=function(){this.emit(ds.AbOpenLayer,"",ds.Ab)},e.prototype.closeOverlayer=function(){this.emit(ds.AbCloseLayer,"",ds.Ab)},e.prototype.getAllVars=function(e,t){this.emit(ds.AbAllVars,{callback:e,timeout:t},ds.Ab)},e.prototype.destoryInstace=function(){this.destroy||(this.destroy=!0,this.off(ds.TokenComplete),this.emit(ds.DestoryInstance))},e.prototype.destroyInstance=function(){this.destroy||(this.destroy=!0,this.off(ds.TokenComplete),this.emit(ds.DestoryInstance))},e.plugins=[],e}(),Uu={},Bu=[],Gu=function(e){e.length&&e.forEach((function(e){Bu.push(e)}))};function Lu(e,t,n,i){var r=e&&e.source||window.opener||window.parent,o=e&&e.origin||i||window.location.origin,a={type:t,payload:n};r.postMessage(JSON.stringify(a),o)}function ju(e){if(Bu.some((function(t){return e.origin.indexOf(t)>-1}))){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(e){t=void 0}if(!t)return;var n=t.type,i=t.payload;Uu[n]&&Uu[n].forEach((function(t){"function"==typeof t&&t(e,i)}))}}var Fu,Ku="__rangers_ab_style__";!function(e){e[e.Var=0]="Var",e[e.All=1]="All"}(Fu||(Fu={}));var Hu=function(){function e(){this.fetchStatus="no",this.refreshFetchStatus="no",this.versions=[],this.extVersions=[],this.mulilinkVersions=[],this.enable_multilink=!1,this.enable_ab_visual=!1,this.editMode=!1,this.callbacks=[],this.data={},this.changeListener=new Map,this.readyStatus=!1,this.exposureCache=[],this.fetchQueueMap=new Map}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,this.config.enable_ab_test){var i=t.enable_multilink,r=t.ab_channel_domain,o=t.enable_ab_visual,a=t.ab_cross,s=t.ab_cookie_domain,c=t.ab_timeout,l=t.disable_auto_ab,u=ss[t.channel||"sg"]||ss.sg,f=r||Oa(u),d=e.adapters.storage;this.cacheStorgae=new d(!1),this.timeout=c||3e3,this.enable_multilink=i,this.enable_ab_visual=o,this.abKey="__tea_sdk_ab_version_"+t.app_id,this.ab_cross=a,this.ab_cookie_domain=s||"",this.fetchUrl=f+"/service/2/abtest_config/",this.reportUrl=this.collect.configManager.getUrl("event"),this.exposureLimit=t.exposure_limit||20,this.ab_batch_time=t.ab_batch_time||500,this.ab_user_mode=t.ab_user_mode||"user_unique_id",this.callbackMap=new Map,this.fetchQueueMap=new Map;var h=this.collect.Types;this.types=h,this.collect.on(h.TokenChange,(function(e){"uuid"===e&&n.readyStatus&&(n.clearCache(),n.fetchAB())})),this.collect.on(h.AbVar,(function(e){var t=e.name,i=e.defaultValue,r=e.callback;n.getVar(t,i,r)})),this.collect.on(h.AbAllVars,(function(e){var t=e.callback,i=e.timeout;n.getAllVars(t,i)})),this.collect.on(h.AbConfig,(function(e){var t=e.params,i=e.callback;n.getABconfig(t,i)})),this.collect.on(h.AbExternalVersion,(function(e){n.setExternalAbVersion(e)})),this.collect.on(h.AbOpenLayer,(function(){n.openOverlayer()})),this.collect.on(h.AbCloseLayer,(function(){n.closeOverlayer()})),this.collect.on(h.AbVersionChangeOn,(function(e){n.changeListener.set(e,e)})),this.collect.on(h.AbVersionChangeOff,(function(e){n.changeListener.get(e)&&n.changeListener.delete(e)})),this.loadMode(),(this.enable_ab_visual||this.enable_multilink)&&this.openOverlayer(this.config.multilink_timeout_ms||500),this.checkLocal(),this.ready("ab"),this.readyStatus||(!l&&this.fetchAB(),this.readyStatus=!0),this.collect.emit(h.AbReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var r in n)i(r)}},e.prototype.loadMode=function(){var e=function(){try{return JSON.parse(atob(window.name))||void 0}catch(e){return}}(),t="";if(e){var n=e.scenario,i=e.href;n?(this.editMode=!0,t=n):!i||-1===i.indexOf("datatester")&&-1===i.indexOf("visual-editor")||(this.editMode=!0,t="visual-editor")}this.enable_ab_visual&&"visual-editor"===t&&this.collect.destoryInstace()},e.prototype.checkLocal=function(){var e=this.getABCache(),t=e.ab_version,n=e.ab_ext_version,i=e.ab_version_multilink,r=(e.data,this.checkFromUrl());r?this.mulilinkVersions.push(r):this.mulilinkVersions=i||[],this.extVersions=n||[],this.versions=t||[];var o=this.versions.concat(this.extVersions);this.enable_multilink&&(o=o.concat(this.mulilinkVersions))},e.prototype.checkFromUrl=function(){var e=Ua(window.location.href);return e&&e.vid?e.vid:""},e.prototype.updateVersions=function(){var e=this.extVersions.length?this.versions.concat(this.extVersions):this.versions;this.enable_multilink&&(e=e.concat(this.mulilinkVersions)),this.configVersions(e.join(",")),this.updateABCache(),this.changeListener.size>0&&this.changeListener.forEach((function(t){"function"==typeof t&&t(e)}))},e.prototype.configVersions=function(e){this.collect.configManager.setAbVersion(e)},e.prototype.getVar=function(e,t,n,i){if(!e)throw new Error("getVar key must not be empty");if(void 0===t&&console.warn("getVar defaultValue is illegal, please check!"),"function"!=typeof n)throw new Error("getVar callback must be a function");var r={name:e,defaultValue:t,callback:n,type:Fu.Var};this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetVar",level:"info",time:Date.now(),data:e,infoType:"cus"}),"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealVar(r,e,i):this.callbackMap.set(e,r)},e.prototype.setAbUuid=function(e,t){this.collect.configManager.setAbUuidCache(e,t)},e.prototype.getRealVar=function(e,t,n){var i=e.name,r=e.defaultValue,o=e.callback,a=this.data;if(a){var s=a[i];if(s&&Ca(s)){var c=s.vid;return"$ab_url"===t?this.mulilinkVersions.includes(c)||this.mulilinkVersions.push(c):this.versions.includes(c)||this.versions.push(c),this.setAbUuid(c,n),this.updateVersions(),this.fechEvent(c,t||i,r,o,s.val),void this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetVar, Exposure Experiment "+i,level:"info",time:Date.now(),data:a[i],infoType:"sdk"})}this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GerVar Default Callback",level:"info",time:Date.now(),data:this.data,infoType:"sdk"}),o(r)}else o(r)},e.prototype.getAllVars=function(e,t){var n=this;if("function"!=typeof e)throw new Error("getAllVars callback must be a function");var i=null,r={callback:e,type:Fu.All,timer:i};this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetAllVars",level:"info",time:Date.now(),infoType:"cus"}),t&&(i=setTimeout((function(){r.timer=null,n.getRealAllVars(r),clearTimeout(i)}),t),r.timer=i),"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?(r.timer=null,this.getRealAllVars(r),i&&clearTimeout(i)):this.callbackMap.set("allVars",r)},e.prototype.getRealAllVars=function(e,t){var n=e.callback,i=e.timer;i&&(clearTimeout(i),e.timer=null);var r=(null!=t?t:this.data)||{};try{n(JSON.parse(JSON.stringify(r)))}catch(e){n(r)}this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Execute GetAllVars Callback",level:"info",time:Date.now(),data:this.data,infoType:"sdk"})},e.prototype.fechEvent=function(e,t,n,i,r){try{if(this.config.disable_track_event)return;if(!e)return;var o=this.collect.configManager.get(),a=o.header,s=o.user,c=this.getABCache(),l=s[this.ab_user_mode]||s.user_unique_id;if(c&&c.uuid&&c.uuid!==l)return;var u={event:"abtest_exposure",ab_sdk_version:""+e,params:JSON.stringify({app_id:this.config.appId,ab_url:"$ab_url"===t?n:window.location.href,data:this.data}),local_time_ms:Date.now()};a.custom=JSON.stringify(a.custom);var f={events:[u],user:s,header:a};this.reportExposure(f,t),i&&i(r)}catch(e){this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Something Error",level:"error",time:Date.now(),data:e.message,infoType:"sdk"})}},e.prototype.reportExposure=function(e,t){var n=this;this.exposureCache.push(e),this.reportTimeout&&clearTimeout(this.reportTimeout),this.exposureCache.length>=this.exposureLimit?this.report(t):this.reportTimeout=setTimeout((function(){n.report(t),clearTimeout(n.reportTimeout)}),this.ab_batch_time)},e.prototype.report=function(e){var t=this;this.collect.requestManager.useRequest({url:this.reportUrl,data:this.exposureCache,timeout:2e4,useBeacon:"$ab_url"===e,zip:!0}),this.exposureCache.forEach((function(e){t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_EVENT,info:"SDK Report Exposure Event Success",time:Date.now(),data:[e],code:200,status:"success",infoType:"sdk"})})),this.collect.emit(this.types.AbVerify,[this.exposureCache]),this.exposureCache=[]},e.prototype.setExternalAbVersion=function(e){this.extVersions=[e],this.updateVersions()},e.prototype.getABconfig=function(e,t){var n=Object.keys(e);n&&n.length&&this.collect.configManager.set(e),this.fetchAB(t)},e.prototype.get=function(e){return this.cacheStorgae.getItem(e)},e.prototype.set=function(e,t){this.cacheStorgae.setItem(e,t),this.collect.configManager.setAbCache(t)},e.prototype.getABCache=function(e){var t={ab_version:[],ab_ext_version:[],ab_version_multilink:[],data:null,timestamp:+new Date,uuid:""};return t=this.get(this.abKey)||t,e?t[e]:t},e.prototype.updateABCache=function(){var e=this.getABCache();e.ab_version_multilink=this.mulilinkVersions,e.ab_ext_version=this.extVersions,e.ab_version=this.versions,e.timestamp=Date.now(),this.set(this.abKey,e)},e.prototype.setAbCache=function(e){var t=this.getABCache();t.data=this.data,t.uuid=e,t.timestamp=Date.now(),this.set(this.abKey,t)},e.prototype.clearCache=function(){this.refreshFetchStatus="ing",this.data={},this.extVersions=[],this.mulilinkVersions=[],this.versions=[],this.collect.configManager.clearAbCache()},e.prototype.openOverlayer=function(e){var t=this;if(function(){if(!document.getElementById(Ku)){var e="body { opacity: 0 !important; }",t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id=Ku,n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n)}}(),e)var n=setTimeout((function(){t.closeOverlayer(),clearTimeout(n)}),e)},e.prototype.closeOverlayer=function(){var e;(e=document.getElementById(Ku))&&e.parentElement.removeChild(e)},e.prototype.fetchComplete=function(e,t){var n=this;this.changeFetchQueueStatus(t);try{if(e&&"[object Object]"==Object.prototype.toString.call(e)){var i=this.collect.configManager.get().user;if(t&&t!==i.user_unique_id)return;this.data=e,this.setAbCache(t);var r=[];Object.keys(e).forEach((function(t){var n=e[t].vid;n&&r.push(n)})),this.versions=this.versions.filter((function(e){return r.includes(e)}));var o=e.$ab_url,a=e.$ab_modification;if(a&&a.val&&this.enable_ab_visual){if(this.collect.destroy)return}else if(o&&this.enable_multilink){this.mulilinkVersions=this.mulilinkVersions.filter((function(e){return r.includes(e)}));var s=o.val,c=o.vid;s&&c&&this.getVar("$ab_url",s,(function(){n.editMode||(s!==window.location.href?setTimeout((function(){if(!n.collect.destroy){var e=""+s;e=-1===e.indexOf("http")?"https://"+e:e,Na(e).host!==location.host?e=e+"&vid="+c:window.history.replaceState("","",e),window.location.href=e}}),100):n.closeOverlayer())}))}this.updateVersions()}else this.closeOverlayer();this.callbackMap.forEach((function(t){t.type===Fu.Var?n.getRealVar(t,""):n.getRealAllVars(t,e)}))}catch(e){}},e.prototype.pushFetchToQueue=function(e){var t=e,n=this.fetchQueueMap.get(t);n?n.fetchStatus="ing":n={current_user_id:t,fetchStatus:"ing"},this.fetchQueueMap.set(t,n)},e.prototype.changeFetchQueueStatus=function(e){var t=this.fetchQueueMap.get(e);t&&(t.fetchStatus="complete",this.fetchQueueMap.set(e,t))},e.prototype.checkFetchQueueStatus=function(){if(0===this.fetchQueueMap.size)return!1;var e=!0;return this.fetchQueueMap.forEach((function(t){"complete"!==t.fetchStatus&&(e=!1)})),e},e.prototype.clearFetchQueue=function(e){this.fetchQueueMap.delete(e)},e.prototype.fetchAB=function(e){var t=this,n=this.collect.configManager.get(),i={header:wa(wa(wa({aid:this.config.app_id},n.user||{}),n.header||{}),{ab_sdk_version:this.collect.configManager.getAbVersion(),ab_url:window.location.href})};this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Fetch AB Request",level:"info",logType:"fetch",time:Date.now(),data:i,infoType:"sdk"});var r=n.user[this.ab_user_mode]||n.user.user_unique_id;this.pushFetchToQueue(r),this.collect.requestManager.useRequest({url:this.fetchUrl,data:i,success:function(n){t.fetchStatus="complete",t.refreshFetchStatus="complete";var i=n.data;"success"===n.message?(t.fetchComplete(i,r),e&&e(i)):(t.fetchComplete(null,r),e&&e(null)),t.collect.emit(t.types.AbComplete,i),t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Fetch AB Request Success",level:"info",logType:"fetch",time:Date.now(),data:i,infoType:"sdk"})},fail:function(){t.fetchStatus="complete",t.refreshFetchStatus="complete",t.fetchComplete(null,r),t.collect.emit(t.types.AbTimeout),e&&e(null),t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK Fetch AB Request Network Error",level:"error",logType:"fetch",time:Date.now(),infoType:"sdk"})},timeout:this.timeout})},e.prototype.filterUrl=function(e){try{var t="";-1!==e.indexOf("&multilink=true")?t="&multilink=true[\0-ÿ]*":-1!==e.indexOf("?multilink=true")&&(t="\\?multilink=true[\0-ÿ]*");var n=new RegExp(t,"g");e=e.replace(n,"")}catch(e){}return e},e}(),Vu=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,t.event_verify_url)if("string"==typeof t.event_verify_url){if(this.url=t.event_verify_url+"/v1/list_test",this.url){var i=e.Types;e.on(i.SubmitVerify,(function(e){n.verify(e)})),e.on(i.AbVerify,(function(e){n.verify(e)}))}}else console.log("please use correct et_test url")},e.prototype.verify=function(e){var t=this;e.forEach((function(e){try{var n=JSON.parse(JSON.stringify(e));t.config.filter&&((n=t.config.filter(n))||console.warn("filter must return data !!")),t.collect.eventFilter&&n&&((n=t.collect.eventFilter(n))||console.warn("filterEvent api must return data !!"));var i=n||e,r=JSON.parse(JSON.stringify(i));if(!i.length)return;var o=!0;if(i.forEach((function(e){e.events.length||(o=!1)})),!o)return;t.collect.requestManager.useBeacon({url:t.url,data:i}),t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_EVENT,info:"SDK Report ByteIo Verify Request",time:Date.now(),data:r,code:200,status:"success",verifyType:!0})}catch(e){console.warn("something error, "+JSON.stringify(e.stack)),t.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Report ByteIo Verify Request Error",level:"error",time:Date.now(),data:e.message})}}))},e}(),qu=function(){function e(e,t){this.maxDuration=432e5,this.aliveDTime=6e4,this.options={aliveName:"predefine_page_alive",params:{}},this.focusState=!0,this.collect=e,this.config=t,this.pageStartTime=Date.now(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,Ca(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.hard=this.options.mode&&"hard"===this.options.mode,this.focusState=document.hasFocus()}return e.prototype.setParams=function(e,t,n){this.set_path=e,this.set_url=n,this.set_title=t},e.prototype.enable=function(e,t,n){this.url_path=e,this.url=n,this.title=t,this.disableCallback=this.enablePageAlive(),this.hard&&(this.removeMode=this.hardMode())},e.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},e.prototype.sendEvent=function(e,t){void 0===t&&(t=!1);var n=t?this.aliveDTime:Date.now()-this.sessionStartTime;n<0||n>this.aliveDTime||Date.now()-this.pageStartTime>this.maxDuration||t&&"hidden"===document.visibilityState||this.hard&&!this.focusState||(this.collect.beconEvent(this.options.aliveName,wa({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),duration:n,is_support_visibility_change:Pa(),startTime:this.sessionStartTime,hidden:document.visibilityState,leave:e,mode:this.hard?"hard":"normal",focusState:this.focusState},this.options.params)),this.sessionStartTime=Date.now())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.setUpTimer=function(){var e=this;return this.timerHandler&&clearInterval(this.timerHandler),setInterval((function(){Date.now()-e.sessionStartTime>e.aliveDTime&&e.sendEvent(!1,!0)}),1e3)},e.prototype.visibilitychange=function(){"hidden"===document.visibilityState?this.timerHandler&&(clearInterval(this.timerHandler),this.sendEvent(!1)):"visible"===document.visibilityState&&(this.sessionStartTime=Date.now(),this.timerHandler=this.setUpTimer())},e.prototype.beforeunload=function(){document.hidden||this.sendEvent(!0)},e.prototype.enablePageAlive=function(){var e=this;this.timerHandler=this.setUpTimer();var t=this.visibilitychange.bind(this),n=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),Ma(n),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("beforeunload",n),window.removeEventListener("pagehide",n)}},e.prototype.hardMode=function(){var e=this,t=function(){e.timerHandler&&(clearInterval(e.timerHandler),e.sendEvent(!1)),e.focusState=!1},n=function(){e.focusState=!0,e.sessionStartTime=Date.now(),e.timerHandler=e.setUpTimer()};return window.addEventListener("blur",t),window.addEventListener("focus",n),function(){window.removeEventListener("blur",t),window.removeEventListener("focus",n)}},e}(),$u=function(){function e(e,t){var n=this;this.maxDuration=432e5,this.aliveDTime=6e4,this.options={closeName:"predefine_page_close",params:{}},this.focusState=!0,this.visibilitychange=function(){"hidden"===document.visibilityState?n.activeEndTime=Date.now():"visible"===document.visibilityState&&(n.activeEndTime&&(n.totalTime+=n.activeEndTime-n.activeStartTime,n.activeTimes+=1),n.activeEndTime=void 0,n.activeStartTime=Date.now())},this.beforeunload=function(){if(n.totalTime+=(n.activeEndTime||Date.now())-n.activeStartTime,n.config.autotrack)try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:n.totalTime,page_title:document.title||location.pathname}))}catch(e){}n.sendEventPageClose()},this.collect=e,this.config=t,this.maxDuration=t.maxDuration||864e5,this.pageStartTime=Date.now(),Ca(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.hard=this.options.mode&&"hard"===this.options.mode,this.focusState=document.hasFocus(),this.resetData()}return e.prototype.setParams=function(e,t,n){this.set_path=e,this.set_url=n,this.set_title=t},e.prototype.resetParams=function(e,t,n){this.url_path=e,this.url=n,this.title=t},e.prototype.enable=function(e,t,n){this.url_path=e,this.url=n,this.title=t,this.disableCallback=this.enablePageClose(),this.hard&&(this.removeMode=this.hardMode())},e.prototype.disable=function(){this.disableCallback()},e.prototype.resetData=function(){this.activeStartTime=void 0===this.activeStartTime?this.pageStartTime:Date.now(),this.activeEndTime=void 0,this.activeTimes=1,this.totalTime=0,this.resetParams(location.pathname,document.title,location.href)},e.prototype.sendEventPageClose=function(){var e=Date.now()-this.pageStartTime;this.totalTime<0||e<0||this.totalTime>=this.maxDuration||this.hard&&!this.focusState||(this.collect.beconEvent(this.options.closeName,wa({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),active_times:this.activeTimes,duration:this.totalTime,total_duration:e,is_support_visibility_change:Pa(),mode:this.hard?"hard":"normal",focusState:this.focusState},this.options.params)),this.pageStartTime=Date.now(),this.resetData())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.enablePageClose=function(){var e=this,t=this.visibilitychange.bind(this),n=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),Ma(n),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("beforeunload",n),window.removeEventListener("pagehide",n)}},e.prototype.hardMode=function(){var e=this,t=function(){e.focusState=!1},n=function(){e.focusState=!0};return window.addEventListener("blur",t),window.addEventListener("focus",n),function(){window.removeEventListener("blur",t),window.removeEventListener("focus",n)}},e}(),Ju=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,this.config.enable_stay_duration){this.title=document.title||location.pathname,this.url=location.href,this.url_path=location.pathname,this.pageAlive=new qu(e,t),this.pageClose=new $u(e,t);var i=this.collect.Types;this.collect.on(i.ResetStay,(function(e){var t=e.url_path,i=e.title,r=e.url;n.resetStayDuration(t,i,r)})),this.collect.on(i.RouteChange,(function(e){e.init||t.disable_route_report||n.resetStayDuration()})),this.collect.on(i.SetStay,(function(e){var t=e.url_path,i=e.title,r=e.url;n.setStayParmas(t,i,r)})),this.enable(this.url_path,this.title,this.url),this.ready(i.Stay),this.collect.emit(i.StayReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var r in n)i(r)}},e.prototype.enable=function(e,t,n){this.pageAlive.enable(e,t,n),this.pageClose.enable(e,t,n)},e.prototype.disable=function(){this.pageAlive.disable(),this.pageClose.disable()},e.prototype.setStayParmas=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),this.pageAlive.setParams(e,t,n),this.pageClose.setParams(e,t,n),this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute resetStayParams",level:"info",time:Date.now(),data:{url_path:e,title:t,url:n}})},e.prototype.reset=function(e,t,n){this.disable(),this.enable(e,t,n)},e.prototype.resetStayDuration=function(e,t,n){this.reset(e,t,n),this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"SDK Execute resetStayDuration",level:"info",time:Date.now(),data:{url_path:e,title:t,url:n}})},e}(),Wu=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.collect=e,this.config=t,!this.config.channel_domain&&!t.disable_track_event&&!t.disable_sdk_monitor){this.url=e.configManager.getUrl("event");var i=this.collect.Types;this.collect.on(i.Ready,(function(){n.sdkOnload()})),this.collect.on(i.SubmitError,(function(e){var t=e.type,i=e.eventData,r=e.errorCode,o=e.response;"f_data"===t&&n.sdkError(i,r,o)})),this.collect.on(e.Types.SDKInnerError,(function(e){var t=e.type,i=e.eventData,r=e.errorCode,o=e.msg;n.sdkInnerError(t,i,r,o)}))}},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),n=t.header,i=t.user,r=n.app_id,o=n.app_name,a=n.sdk_version,s=(i.web_id,{events:[{event:"onload",params:JSON.stringify({app_id:r,app_name:o||"",sdk_version:a,sdk_type:"npm",sdk_config:this.config,sdk_desc:"TOC_OVERSEA",url:location.href,is_setting:this.config.enable_logsetting||!1,enable_logsetting_params:this.config.enable_logsetting_params||!1,enable_logsetting_header_custom:this.config.enable_logsetting_header_custom||!1}),local_time_ms:Date.now()}],user:{user_unique_id:i.user_unique_id},header:{app_id:6656}});setTimeout((function(){e.collect.requestManager.useRequest({url:e.url,data:[s],timeout:3e4,forceXhr:!0})}),16)}catch(e){}},e.prototype.sdkError=function(e,t,n){var i=this;try{var r=e[0],o=r.user,a=r.header,s=[];e.forEach((function(e){e.events.forEach((function(e){s.push(e)}))}));var c={events:s.map((function(e){return{event:"on_error",params:JSON.stringify({type:"sdk_event_error",error_code:t,app_id:a.app_id,app_name:a.app_name||"",error_event:e.event,sdk_version:a.sdk_version,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:a,user:o,err_msg:n.m||""}),local_time_ms:Date.now()}})),user:{user_unique_id:o.user_unique_id},header:{app_id:6656}};setTimeout((function(){i.collect.requestManager.useRequest({url:i.url,data:[c],timeout:3e4,forceXhr:!0})}),16)}catch(e){}},e.prototype.sdkInnerError=function(e,t,n,i){var r=this;try{var o=t[0],a=o.user,s=o.header,c=[];t.forEach((function(e){e.events.forEach((function(e){c.push(e)}))}));var l={events:c.map((function(t){return{event:"on_error",params:JSON.stringify({type:e,error_code:n,app_id:s.app_id,app_name:s.app_name||"",error_event:t.event,sdk_version:s.sdk_version,local_time_ms:t.local_time_ms,tea_event_index:Date.now(),params:t.params,header:s,user:a,ua:window.navigator.userAgent,err_msg:i}),local_time_ms:Date.now()}})),user:a,header:{}};setTimeout((function(){r.collect.requestManager.useRequest({url:r.url,data:[l],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})}),16)}catch(e){}},e}();function Xu(e,t){if(void 0===t&&(t="list"),!e)return!1;if(t&&"list"===t){if(["LI","TR","DL"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaIdx"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-idx"))return!0}else{if(["A","BUTTON"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaContainer"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-container"))return!0}return!1}function Zu(e){for(var t=e;t&&!Xu(t,"container");){if("HTML"===t.nodeName||"BODY"===t.nodeName)return e;t=t.parentElement}return t||e}function Yu(e){var t="";return 3===e.nodeType?t=e.textContent.trim():e.dataset&&e.dataset.hasOwnProperty("teaTitle")||e.hasAttribute("ata-tea-title")?t=e.getAttribute("data-tea-title"):e.hasAttribute("title")?t=e.getAttribute("title"):"INPUT"===e.nodeName&&["button","submit"].includes(e.getAttribute("type"))?t=e.getAttribute("value"):"IMG"===e.nodeName&&e.getAttribute("alt")&&(t=e.getAttribute("alt")),t.slice(0,200)}function Qu(e){for(var t=e;t&&t.parentNode;){if(t.hasAttribute("data-tea-ignore"))return!0;if("HTML"===t.nodeName||"body"===t.nodeName)return!1;t=t.parentNode}return!1}var ef=function(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0},tf=function(){function e(e,t,n){var i=this;this.statistics=!1,this.pageView=!1,this.clickEvent=function(e){(function(e,t){if(1!==e.nodeType)return!1;if(!t.svg&&function(e){if("svg"===e.tagName.toLowerCase())return!0;for(var t=e.parentElement,n=!1;t;)"svg"===t.tagName.toLowerCase()?(t=null,n=!0):t=t.parentElement;return n}(e))return!1;if(["HTML","BODY"].includes(e.tagName.toUpperCase()))return!1;var n=e;return!("none"===n.style.display||!Xu(n,"container")&&!function(e){if(e.children.length){var t=e.children;return![].slice.call(t).some((function(e){return e.children.length>0}))}return!0}(n)&&!t.svg)})(e.target,i.options)&&i.eventHandel({eventType:"dom",eventName:"click"},e)},this.changeEvent=function(e){i.eventHandel({eventType:"dom",eventName:"change"},e)},this.submitEvent=function(e){i.eventHandel({eventType:"dom",eventName:"submit"},e)},this.getPageViewEvent=function(e,t){t&&"pushState"===t&&i.eventHandel({eventType:"dom",eventName:"beat"},wa({beat_type:0},e)),i.eventHandel({eventType:"dom",eventName:"page_view"},e)},this.getPageLoadEvent=function(e){i.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:e})},this.config=n.getConfig().eventConfig,this.collect=t,this.options=e,this.beatTime=e.beat}return e.prototype.init=function(e){this.eventHandel=e;var t=this.config.mode;this.addListener(t)},e.prototype.addListener=function(e){var t=this;if("proxy-capturing"===e){if(this.config.click&&window.document.addEventListener("click",this.clickEvent,!0),this.config.change&&window.document.addEventListener("change",this.changeEvent,!0),this.config.submit&&window.document.addEventListener("submit",this.submitEvent,!0),this.config.pv){this.collect.on("route-change",(function(e){var n=e.config,i=e.name;t.getPageViewEvent(n,i),t.pageView=!0}));var n=setTimeout((function(){t.pageView||(t.getPageViewEvent(t.getDefaultConfig()),t.pageView=!0,clearTimeout(n))}),2e3)}if(this.config.beat){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",(function(){t.beatEvent(t.beatTime)}));var i=0,r=null;window.addEventListener("scroll",(function(){clearTimeout(r),r=setTimeout(o,500),i=document.documentElement.scrollTop||document.body.scrollTop}));var o=function(){(document.documentElement.scrollTop||document.body.scrollTop)==i&&t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(e){}try{var a=window.performance&&window.performance.getEntriesByType("paint");a&&a.length?(new PerformanceObserver((function(e){var n=e.getEntries(),i=n[n.length-1],r=i.renderTime||i.loadTime;t.statistics||(t.getPageLoadEvent(r),t.statistics=!0)})).observe({entryTypes:["largest-contentful-paint"]}),setTimeout((function(){t.statistics||(t.getPageLoadEvent(a[0].startTime||0),t.statistics=!0)}),2e3)):this.getPageLoadEvent(0)}catch(e){this.getPageLoadEvent(0)}}}},e.prototype.removeListener=function(){window.document.removeEventListener("click",this.clickEvent,!0),window.document.removeEventListener("change",this.changeEvent,!0),window.document.removeEventListener("submit",this.submitEvent,!0)},e.prototype.beatEvent=function(e){var t=this;try{var n;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(n=setInterval((function(){t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})}),e)),Ma((function(){t.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),t.beatTime&&clearInterval(n)}))}catch(e){}},e.prototype.getDefaultConfig=function(){return{is_html:1,url:location.href,referrer:document.referrer,page_key:location.href,refer_page_key:document.referrer,page_title:document.title||location.pathname,page_manual_key:"",refer_page_manual_key:"",refer_page_title:"",page_path:location.pathname,page_host:location.host}},e}(),nf={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},rf=function(){function e(e,t){this.config=e,this.config.eventConfig=Object.assign(this.config.eventConfig,t)}return e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(e){return this.config=e},e}();function of(e,t,n,i){var r={},o=function(e){if(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return{left:t.left,top:t.top,element_width:n,element_height:i}}}(t),a=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.clientX,i=e.clientY,r=t.left,o=t.top,a=n-r>=0?n-r:0,s=i-o>=0?i-o:0;return{touch_x:Math.floor(a),touch_y:Math.floor(s)}}(e,o),s=o.element_width,c=o.element_height,l=a.touch_x,u=a.touch_y,f=function(e){for(var t=[];null!==e.parentElement;)t.push(e),e=e.parentElement;var n=[],i=[];return t.forEach((function(e){var t=function(e){if(null===e)return{str:"",index:0};var t=0,n=e.parentElement;if(n)for(var i=n.children,r=0;r<i.length&&i[r]!==e;r++)i[r].nodeName===e.nodeName&&t++;return{str:[e.nodeName.toLowerCase(),Xu(e,"list")?"[]":""].join(""),index:t}}(e),r=t.str,o=t.index;n.unshift(r),i.unshift(o)})),{element_path:"/"+n.join("/"),positions:i}}(t),d=f.element_path,h=f.positions,p=function(e){var t=Zu(e),n=[];return function e(t){var i=Yu(t);if(i&&-1===n.indexOf(i)&&n.push(i),t.childNodes.length>0)for(var r=t.childNodes,o=0;o<r.length;o++)8!==r[o].nodeType&&e(r[o])}(t),n}(t),v=window.performance.timing.navigationStart,g=Date.now()-v,m=h.map((function(e){return""+e})),_=null;if(window.TEAVisualEditor&&window.TEAVisualEditor.getOriginXpath&&(_=window.TEAVisualEditor.getOriginXpath({xpath:d,positions:m})),r.element_path=_&&_.xpath||d,r.positions=_&&_.positions||m,i&&!i.text&&(r.texts=p,r.element_title=function(e){var t=Zu(e),n="";return function e(t){var i=Yu(t);if(i&&(n+=i),t.childNodes.length>0)for(var r=t.childNodes,o=0;o<r.length;o++)3===r[o].nodeType&&e(r[o])}(t),n}(t)),r.element_id=t.getAttribute("id")||"",r.element_class_name=t.getAttribute("class")||"",r.element_type=t.nodeType,r.element_width=Math.floor(s),r.element_height=Math.floor(c),r.touch_x=l,r.touch_y=u,r.page_manual_key="",r.elememt_manual_key="",r.since_page_start_ms=g,r.page_start_ms=v,r.page_path=location.pathname,r.page_host=location.host,n.track_attr&&function(e,t){return!!function(e,t){if("string"==typeof t)return ef(e,t);if(Da(t)){for(var n=!1,i=0;i<t.length;i++)if(ef(e,t[i])){n=!0;break}return n}}(e,t)}(t,n.track_attr)){var y=function(e,t){var n={};if("string"==typeof t)ef(e,t)&&(n.attrs=e.getAttribute(t));else if(Da(t))for(var i=0;i<t.length;i++)ef(e,t[i])&&(n[t[i]]=e.getAttribute(t[i]));return n}(t,n.track_attr);for(var b in y)r[b]=y[b]}var E=Zu(t);return"A"===E.tagName&&(r.href=E.getAttribute("href")),"IMG"===t.tagName&&(r.src=t.getAttribute("src")),r}var af=function(e,t,n,i,r){return wa(wa({event:e},of(t,n,i,r)),{is_html:1,page_key:window.location.href,page_title:document.title})},sf=function(){function e(e,t){this.ignore={text:!0},this.initConfig=e,this.options=t,this.eventName=t&&"tea"===t.custom?{click:"__bav_click",page:"__bav_page",beat:"__bav_beat",static:"__bav_page_statistics",exposure:"__bav_page_exposure"}:{click:"bav2b_click",page:"bav2b_page",beat:"bav2b_beat",static:"bav2b_page_statistics",exposure:"bav2b_exposure"},t&&!0===t.text&&(this.ignore.text=!1),t&&t.exposure&&t.exposure.eventName&&(this.eventName.exposure=t.exposure.eventName)}return e.prototype.handleEvent=function(e,t){try{if(Qu(e.target))return null;var n="bav2b_click";switch(t){case"click":return n=e.target.getAttribute("data-applog-click-event")||this.eventName.click,af(n,e,e.target,this.options,this.ignore);case"change":return wa(wa({},af(n="bav2b_change",e,e.target,this.options)),function(e,t){try{if("bav2b_change"===e)return t.hasAttribute("data-tea-track")?{value:t.value}:{}}catch(e){return{}}}(n,e.target));case"submit":return af(n="bav2b_submit",e,e.target,this.options)}}catch(e){return console.error(e),null}},e.prototype.handleViewEvent=function(e){e.event=this.eventName.page,e.page_title=document.title,e.page_total_width=window.innerWidth,e.page_total_height=window.innerHeight;try{var t=window.sessionStorage.getItem("_tea_cache_duration");if(t){var n=JSON.parse(t);e.refer_page_duration_ms=n?n.duration:""}e.scroll_width=document.documentElement.scrollLeft?document.documentElement.scrollLeft+window.innerWidth:window.innerWidth,e.scroll_height=document.documentElement.scrollTop?document.documentElement.scrollTop+window.innerHeight:window.innerHeight,e.page_start_ms=window.performance.timing.navigationStart}catch(e){console.log("page event error "+JSON.stringify(e))}return e},e.prototype.handleStatisticsEvent=function(e){var t={};t.event=this.eventName.static,t.is_html=1,t.page_key=location.href,t.refer_page_key=document.referrer||"",t.page_title=document.title,t.page_manual_key=this.initConfig.autotrack.page_manual_key||"",t.refer_page_manual_key="";try{var n=e.lcp,i=window.performance.timing,r=i.loadEventEnd-i.navigationStart;t.page_init_cost_ms=parseInt(n||(r>0?r:0)),t.page_start_ms=i.navigationStart}catch(e){console.log("page_statistics event error "+JSON.stringify(e))}return t},e.prototype.handleBeadtEvent=function(e){e.event=this.eventName.beat,e.page_key=window.location.href,e.is_html=1,e.page_title=document.title,e.page_manual_key=this.initConfig.autotrack.page_manual_key||"";try{e.page_viewport_width=window.innerWidth,e.page_viewport_height=window.innerHeight,e.page_total_width=document.documentElement.scrollWidth,e.page_total_height=document.documentElement.scrollHeight,e.scroll_width=document.documentElement.scrollLeft+window.innerWidth,e.scroll_height=document.documentElement.scrollTop+window.innerHeight,e.since_page_start_ms=Date.now()-window.performance.timing.navigationStart,e.page_start_ms=window.performance.timing.navigationStart}catch(e){console.log("beat event error "+JSON.stringify(e))}return e},e.prototype.handleExposureEvent=function(e,t){if(Qu(t.target))return null;var n=af(e.event||this.eventName.exposure,t,t.target||t,this.options,this.ignore);if(n.$exposure_type=e.exposureType,this.options.exposure.callback){var i=this.options.exposure.callback(n);return i||Object.keys(i).length?i:(console.warn("exposure callback must return data!"),n)}return n},e.prototype.handleScrollEvent=function(e,t){var n=af(e.event||this.eventName.scroll,t,t.target||t,this.options,this.ignore);if(n=Object.assign(n,e.params),!this.options.scroll.callback||(n=this.options.scroll.callback(n))||Object.keys(n).length)return n;console.warn("scroll callback must return data!")},e}(),cf=function(){function e(e){this.collect=e,this.eventNameList=["report_click_event","report_change_event","report_submit_event","report_exposure_event","report_page_view_event","report_page_statistics_event","report_beat_event"]}return e.prototype.send=function(e,t){var n=e.eventSend,i=t.event;delete t.event,n&&"becon"===n?this.collect.beconEvent(i,t):this.collect.event(i,t)},e.prototype.get=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"GET"},t);fetch(e,n)},e.prototype.post=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"POST"},t);fetch(e,n)},e}();var lf,uf=function(){function e(e,t){this._instance=null,this._intersection=e,this.config=t,this._intersection&&this.init()}return e.prototype.init=function(){var e=this;if(window.MutationObserver)try{if(this._instance=new MutationObserver((function(t){t.forEach((function(t){"attributes"===t.type&&e.attributeChangeObserve(t),"childList"===t.type&&e.modifyNodeObserve(t)}))})),!document||!document.body)return void console.warn("please use sdk api init after body element");var t=!1!==this.config.autotrack.exposure.attributes;this._instance.observe(document.body,{childList:!0,attributes:t,subtree:!0,attributeOldValue:!1})}catch(e){console.log("your browser cannot support MutationObserver,so cannot report exposure event, please update")}else console.log("your browser cannot support MutationObserver,so cannot report exposure event, please update")},e.prototype.attributeChangeObserve=function(e){e.target.hasAttribute("data-exposure")?this.exposureAdd(e,"mutation"):this.exposureRemove(e)},e.prototype.modifyNodeObserve=function(e){var t=this;Array.prototype.forEach.call(e.addedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureAdd(e,"intersect"),t.mapChild(e,t.exposureAdd.bind(t))})),Array.prototype.forEach.call(e.removedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureRemove(e),t.mapChild(e,t.exposureRemove.bind(t))}))},e.prototype.mapChild=function(e,t){var n=this;1===e.nodeType&&e.children.length&&Array.prototype.forEach.call(e.children,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t(e),n.mapChild(e,t)}))},e.prototype.exposureAdd=function(e,t){try{this._intersection&&this._intersection.exposureAdd(e,t)}catch(e){console.log("intersection error",JSON.stringify(e.message))}},e.prototype.exposureRemove=function(e){try{this._intersection&&this._intersection.exposureRemove(e)}catch(e){console.log("intersection error",JSON.stringify(e.message))}},e._exposure_observer=null,e}();!function(e){e[e.EXPOSURE_ONCE=0]="EXPOSURE_ONCE",e[e.LIFECYCLE_SHOW_NEW=3]="LIFECYCLE_SHOW_NEW",e[e.RESUME_FORM_PAGE=6]="RESUME_FORM_PAGE",e[e.RESUME_FORM_BACK=7]="RESUME_FORM_BACK",e[e.NOT_EXPOSURE=-1]="NOT_EXPOSURE"}(lf||(lf={}));var ff,df=function(){function e(t,n,i){var r=this;this.backStatus=!1,this.instance=this.buildObserver(),this.collect=t,this.observeMap=e._observer_map,n.autotrack.exposure.ratio?this.ratio=n.autotrack.exposure.ratio:0===n.autotrack.exposure.ratio?this.ratio=0:this.ratio=.5,this.timeLimit=n.autotrack.exposure.stay||0,this.exposureType=lf.NOT_EXPOSURE,this.eventHandle=i,this.hashMap=new Map,this.backStatus=!1,this.lastState=null,this.collect.on("re-start-sdk",(function(){r.visibilitychange()})),this.addListen()}return e.prototype.buildObserver=function(){var t=this;if(e._observer_instance)return console.log("your browser cannot support IntersectionObserver, so cannot report exposure event, please update"),null;if(window.IntersectionObserver){for(var n=[],i=0;i<=1;i+=.01)n.push(i);n.push(1);try{e._observer_instance=new IntersectionObserver((function(e){e.forEach((function(e){var n=e.target.observeId,i=t.observeMap.get(n),r=(e.target,e.isIntersecting,e.intersectionRatio);if(i.intersectionRatio=r,r<=.1&&(e.target.backStatus=!1),t.observeMap.set(n,i),r<t.ratio)return i.isIntersecting=!1,i.added=!1,i.exposured=!1,i.startTime=Date.now(),void t.observeMap.set(n,i);if(!i.added){if(i.startTime=Date.now(),i.added=!0,i.isIntersecting=!0,t.timeLimit){var o=setTimeout((function(){try{if(i.isIntersecting&&!i.exposured&&t.observeMap.get(n)){var r=t.observeMap.get(n).intersectionRatio;t.exposureEvent(e,r,n,i)}}catch(e){console.log("IntersectionObserver setTimeout error,msg: "+JSON.stringify(e))}}),t.timeLimit);i.wait=o}t.observeMap.set(n,i)}Date.now()-i.startTime>=t.timeLimit&&!i.exposured&&t.exposureEvent(e,r,n,i)}))}),{threshold:n})}catch(e){console.log("IntersectionObserver error,msg: "+JSON.stringify(e))}return e._observer_instance}return console.log("your browser cannot support IntersectionObserver, so cannot report exposure event, please update"),null},e.prototype.exposureAdd=function(e,t){var n="mutation"===t?e.target:e,i=n.observeId,r=ks();if(i||this.observeMap.has(i)){var o=this.observeMap.get(i);if(o&&n!==o.instance)this.unobserve(n),this.observeMap.delete(i),n.observeId=r,n.visible=!1,this.observeMap.set(r,{instance:n.cloneNode(!0),isIntersecting:!1}),this.observe(n);else{if(!0===n.visible)return;this.handleBoundingExposure(n)}}else n.observeId=r,n.visible=!1,this.observeMap.set(r,{instance:n.cloneNode(!0),isIntersecting:!1}),this.observe(n)},e.prototype.exposureRemove=function(e){this.observeMap.has(e.observeId)&&(this.observeMap.delete(e.observeId),this.unobserve(e),e.observeId="",e.visible=!1)},e.prototype.exposureEvent=function(e,t,n,i){if(t>=this.ratio){if("0"===e.target.style.opacity||"hidden"===e.target.style.visibility)return;if(!0===i.exposured)return;i.startWait&&clearTimeout(i.startWait);var r=e.target.getAttribute("data-applog-exposure-event");this.eventHandle({eventType:"dom",eventName:"exposure",event:r,exposureType:this.getExposureType(e.target)},e),e.target.visible=!0,e.target.hasExposure=!0,i.startTime=Date.now(),i.exposured=!0}else i.startTime=Date.now(),i.exposured=!1;this.observeMap.set(n,i)},e.prototype.observe=function(e){this.instance&&this.instance.observe(e)},e.prototype.unobserve=function(e){this.instance&&this.instance.unobserve(e)},e.prototype.getExposureDomToExposure=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),(function(t){e.handleBoundingExposure(t)}))},e.prototype.visibilitychange=function(){var e=this,t=null;"visible"===document.visibilityState?this.timeLimit?t=setTimeout((function(){e.getExposureDomToExposure()}),this.timeLimit):this.getExposureDomToExposure():(clearTimeout(t),this.customType=void 0)},e.prototype.handleBoundingExposure=function(e){if(this.getBoundingRatio(e)>=this.ratio){e.visible=!0;var t=e.getAttribute&&e.getAttribute("data-exposure-event");this.eventHandle({eventType:"dom",eventName:"exposure",event:t,exposureType:this.customType||lf.RESUME_FORM_BACK},e)}},e.prototype.getBoundingRatio=function(e){var t=e.getBoundingClientRect(),n=t.top,i=t.left,r=t.width,o=t.height,a=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return n>=0&&i>=0&&n<=s&&i<=a?(r>a?a:r)*(s-n)/(r*o):0},e.prototype.getExposureType=function(e){return e.visible?!1!==e.backStatus&&(this.backStatus||this.customType||2===window.performance.navigation.type)?this.exposureType=lf.RESUME_FORM_PAGE:this.exposureType=lf.LIFECYCLE_SHOW_NEW:(e.hasExposure,!1!==e.backStatus&&(this.backStatus||this.customType||2===window.performance.navigation.type)?this.exposureType=lf.RESUME_FORM_PAGE:this.exposureType=lf.EXPOSURE_ONCE),this.exposureType},e.prototype.addListen=function(){var e=this;this.collect.on("set-exposure-type",(function(t){e.customType=t}));var t,n,i,r=this.visibilitychange.bind(this);return t=document,n="visibilitychange",i=r,!1,t.addEventListener?t.addEventListener(n,i,false):t.attachEven?t.attachEven("on"+n,i):t["on"+n]=i,window.addEventListener("hashchange",(function(t){var n=e.hashMap.get(t.oldURL);n&&location.href===n.prev?(e.backStatus=!0,e.exposureType=lf.RESUME_FORM_PAGE):(e.backStatus=!1,e.hashMap.set(location.href,{current:t.newURL,prev:t.oldURL}))})),this.collect.on("STATE_CHANGE",(function(t){e.lastState=t})),window.addEventListener("popstate",(function(t){var n=t.state;n&&n.current&&e.lastState&&e.lastState.back&&n.current===e.lastState.back?(e.backStatus=!0,e.exposureType=lf.RESUME_FORM_PAGE):e.backStatus=!1})),function(){!function(e,t,n,i){e.addEventListener?e.removeEventListener(t,n,!1):e.attachEven&&e.detachEven("on"+t,n)}(document,"visibilitychange",r)}},e._observer_instance=null,e._observer_map=new Map,e}(),hf=function(){function e(e,t,n){t.autotrack&&t.autotrack.exposure&&(this._intersection=new df(e,t,n),this._observer=new uf(this._intersection,t),this._intersection&&this._observer?this.initObserver():console.log("your browser version cannot support exposure event, please update~"))}return e.prototype.initObserver=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),(function(t){e._intersection.exposureAdd(t,"intersect")}))},e}();!function(e){e[e.SCROLL_UP=1]="SCROLL_UP",e[e.SCROLL_DOWN=2]="SCROLL_DOWN",e[e.SCROLL_LEFT=3]="SCROLL_LEFT",e[e.SCROLL_RIGHT=4]="SCROLL_RIGHT",e[e.NOT_SCROLL=-1]="NOT_SCROLL"}(ff||(ff={}));var pf,vf=function(){function e(e,t){this.distance=30,e.autotrack&&e.autotrack.scroll&&(e.autotrack.scroll.distance&&(this.distance=e.autotrack.scroll.distance),this.eventHandle=t,this.addLinstenr(),this.mutation())}return e.prototype.addLinstenr=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-scroll]"),(function(t){e.scrollHandle(t)}))},e.prototype.mutation=function(){var e=this;if(window.MutationObserver)try{var t=new MutationObserver((function(t){t.forEach((function(t){"childList"===t.type&&e.modifyNodeObserve(t)}))}));if(!document||!document.body)return void console.warn("please use sdk api init after body element");t.observe(document.body,{childList:!0,attributes:!0,subtree:!0,attributeOldValue:!1})}catch(e){console.log("your browser cannot support MutationObserver")}else console.log("your browser cannot support MutationObserver")},e.prototype.modifyNodeObserve=function(e){var t=this;Array.prototype.forEach.call(e.addedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-scroll")&&t.scrollHandle(e),t.mapChild(e,t.scrollHandle.bind(t))})),Array.prototype.forEach.call(e.removedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-scroll")&&t.scrollHandle(e,"remove"),t.mapChild(e,t.scrollHandle.bind(t))}))},e.prototype.mapChild=function(e,t){var n=this;1===e.nodeType&&e.children.length&&Array.prototype.forEach.call(e.children,(function(e){1===e.nodeType&&e.hasAttribute("data-scroll")&&t(e),n.mapChild(e,t)}))},e.prototype.scrollHandle=function(e,t){var n=this;try{var i=e.scrollTop,r=e.scrollLeft,o=null,a=0,s=0,c=function(t){clearTimeout(o),o=setTimeout((function(){var o=e.scrollTop,f=e.scrollLeft,d=t.target&&t.target.getAttribute("data-scroll-event")||"";1===u||2===u?o===c&&(s=c-i,Math.abs(s)>=n.distance&&n.distance&&n.eventHandle({eventType:"dom",eventName:"scroll",event:d,params:{$direction:u,$offsetY:s,$offsetX:a}},t)):3!==u&&4!==u||f===l&&(a=l-r,Math.abs(a)>=n.distance&&n.distance&&n.eventHandle({eventType:"dom",eventName:"scroll",event:d,params:{$direction:u,$offsetY:s,$offsetX:a}},t)),i=c,r=l}),100);var c=e.scrollTop,l=e.scrollLeft,u=ff.NOT_SCROLL;c>i?u=ff.SCROLL_DOWN:c<i?u=ff.SCROLL_UP:l>r?u=ff.SCROLL_LEFT:l<r&&(u=ff.SCROLL_RIGHT)};return"remove"===t?e.removeEventListener("scroll",c,!1):e.addEventListener("scroll",c,!1),function(){e.removeEventListener("scroll",c,!1)}}catch(e){console.warn("scroll event error",JSON.stringify(e))}},e}(),gf={hashTag:!1,impr:!1},mf=function(){function e(){}return e.prototype.apply=function(e,t){if(this.autoTrackStart=!1,this.collect=e,this.config=t,t.autotrack){var n=e.Types;this.ready(n.Autotrack),this.collect.emit(n.AutotrackReady)}},e.prototype.ready=function(e){this.collect.set(e);var t=this.config.autotrack;t="object"==J(t)?t:{},t=Object.assign(gf,t),this.destroyed=!1,this.options=t,this.Config=new rf(nf,this.options),this.Exposure=new hf(this.collect,this.config,this.handle.bind(this)),this.Scroll=new vf(this.config,this.handle.bind(this)),this.Listener=new tf(t,this.collect,this.Config),this.EventHandle=new sf(this.config,t),this.Request=new cf(this.collect),this.autoTrackStart=!0,this.init(),function(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.appId=t.app_id;var n=t.channel_domain,i="";if(Gu(fs),n){var r=void 0,o="";try{var a=window.performance.getEntriesByType("resource");if(a&&a.length&&(a.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(o=e.name)})),o&&(r=o.split("/"))&&r.length)){i="https:/";for(var s=2;s<r.length&&s!==r.length-1;s++)i=i+"/"+r[s];if(i&&i.indexOf("/5.0")){var c=i.split("/5.0");i=c[0]||i}}}catch(e){}}window.addEventListener("message",ju,!1)}(0,this.config)},e.prototype.init=function(){this.Listener.init(this.handle.bind(this)),"base"===this.collect.loadType&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")},e.prototype.handle=function(e,t){try{if(this.config.autotrack.collect_url&&!this.config.autotrack.collect_url())return}catch(e){}"dom"===e.eventType&&this.handleDom(e,t)},e.prototype.handleDom=function(e,t){try{var n=e.eventName;if("click"===n||"change"===n||"submit"===n)(a=this.EventHandle.handleEvent(t,n))&&this.Request.send({eventType:"custom"},a);else if("page_view"===n||"page_statistics"===n){var i;(i="page_view"===n?this.EventHandle.handleViewEvent(t):this.EventHandle.handleStatisticsEvent(t))&&this.Request.send({eventType:"custom"},i)}else if("beat"===n){var r=this.EventHandle.handleBeadtEvent(t),o=e.eventSend;r&&this.Request.send({eventType:"custom",eventSend:o},r)}else if("exposure"===n)(a=this.EventHandle.handleExposureEvent(e,t))&&this.Request.send({eventType:"custom"},a);else if("scroll"===n){var a;(a=this.EventHandle.handleScrollEvent(e,t))&&this.Request.send({eventType:"custom"},a)}}catch(e){console.log("handel dom event error "+JSON.stringify(e))}},e.prototype.destroy=function(){if(!this.autoTrackStart)return console.warn("engine is undefined, make sure you have called autoTrack.start()");this.autoTrackStart=!1,this.Listener.removeListener()},e}();!function(e){e.Net="net",e.FailNet="f_net",e.FailData="f_data"}(pf||(pf={}));var _f={pv:["predefine_pageview"],sdk:["_be_active","predefine_page_alive","predefine_page_close","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append"],autotrack:["bav2b_click","bav2b_page","bav2b_beat","bav2b_page_statistics","__bav_click","__bav_page","__bav_beat","__bav_page_statistics"]},yf=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;if(this.ready=t.app_id&&t.enable_tracer&&!t.disable_track_event,this.ready){this.limit={pv:1,sdk:3,autotrack:3,log:3},this.errorCode={f_net:0,f_data:0},this.tracerCache=new Map,this.collect=e,this.appid=t.app_id,this.reportUrl=e.configManager.getUrl("event");var i=this.collect.Types;e.adapters.fetch,this.collect.on(i.Event,(function(e){Da(e)?e.forEach((function(e){n.addCount("log")})):n.addCount("log")})),this.collect.on(i.SubmitError,(function(e){var t=e.type,i=e.eventDate,r=e.errorCode,o=e.response;n.addErrorCount(i,t,r,o)})),this.listener(),this.collect.emit(i.TracerReady)}},e.prototype.addCount=function(e,t,n){void 0===t&&(t="net"),void 0===n&&(n=1);try{this.tracerCache||(this.tracerCache=new Map);var i=void 0;if(this.tracerCache.has(e))(r=this.tracerCache.get(e)).has(t)?(i=r.get(t).params.count,i++,r.set(t,this.processTracer(i,e,t))):(i=n,r.set(t,this.processTracer(n,e,t)));else{var r=new Map;i=n,r.set(t,this.processTracer(n,e,t)),this.tracerCache.set(e,r)}"net"===t&&i>=this.limit[e]&&this.report(!1)}catch(e){console.log(e)}},e.prototype.addErrorCount=function(e,t,n,i){var r=this;try{if(e&&e.length){var o=e[0].events;o&&o.length&&("f_data"===t?(i&&i.hasOwnProperty("sc")?this.addCount("log",t,o.length-i.sc):this.addCount("log",t,o.length),this.errorCode[t]=n):o.forEach((function(e){var i="log";for(var o in _f)if(-1!==_f[o].indexOf(e.event)){i=o;break}r.addCount(i,t,1),r.errorCode[t]=n})))}}catch(e){}},e.prototype.report=function(e){if(this.tracerCache){var t=[];this.tracerCache.forEach((function(e){console.log(e),e.forEach((function(e){t.push(e)}))})),t&&t.length&&this.sendTracer(t,e)}},e.prototype.sendTracer=function(e,t){try{var n=this.collect.eventManager.merge(e);this.collect.requestManager.useRequest({url:this.reportUrl,data:n,useBeacon:t}),this.tracerCache=null}catch(e){}},e.prototype.processTracer=function(e,t,n){try{var i={count:e,state:n,key:t,params_for_special:"applog_trace",aid:this.appid,platform:"web",_staging_flag:1,sdk_version:us};"f_net"!==n&&"f_data"!==n||(i.errorCode=this.errorCode[n]);var r=this.collect.processEvent("applog_trace",i);if(r&&r.event)return delete r.is_bav,r}catch(e){console.warn("something error")}},e.prototype.listener=function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.leavePage()})),Ma((function(){e.leavePage()}))},e.prototype.leavePage=function(){this.report(!0)},e}(),bf=function(){function e(){this.retryWaitTime=3e3,this.retryStatus=!1,this.retryCacheStatus=!1}return e.prototype.apply=function(e,t){var n=this;if(t.enable_storage&&!t.disable_storage&&(this.collect=e,this.config=t,!this.collect.destroy)){var i=e.Types,r=e.adapters.storage;this.storage=new r(!1),this.eventUrl=this.collect.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+t.app_id,this.storageNum=t.storage_num||50,this.retryNum=t.retry_num||3,this.retryInterval=1e3,e.on(i.SubmitError,(function(e){"f_data"!==e.type&&n.storeData(e)})),e.on(i.Ready,(function(){n.checkStorage()}))}},e.prototype.retryRightNow=function(e){var t=this;if(this.retryStatus)this.errorCache.push(e);else{var n=0;this.retryStatus=!0;var i=setInterval((function(){if(3===n)return t.storeData(t.errorCache),t.retryStatus=!1,void clearInterval(i);var r=e.eventData;t.fetchData(r,(function(){t.retryStatus=!1,clearInterval(i),t.retryCacheStatus&&t.errorCache.splice(0,1),t.errorCache.length&&(t.retryCacheStatus=!0,t.retryRightNow(t.errorCache[0]))}),(function(){n++}))}),this.retryInterval)}},e.prototype.storeData=function(e){var t=this.storage.getItem(this.eventKey),n=e.eventData;Object.keys(t).length!==this.storageNum&&(t[Date.now()]=n,this.storage.setItem(this.eventKey,t))},e.prototype.checkStorage=function(){var e=this;try{if(!window.navigator.onLine)return;var t=this.storage.getItem(this.eventKey);if(!t||!Object.keys(t).length)return;var n={events:[{event:"ontest",params:{app_id:this.config.app_id},local_time_ms:Date.now()}],user:{user_unique_id:this.collect.configManager.get("web_id")},header:{}};this.fetchData([n],(function(){var n=JSON.parse(JSON.stringify(t)),i=function(i){e.fetchData(t[i],(function(){delete n[i],e.storage.setItem(e.eventKey,n)}),(function(){}),!1)};for(var r in t)i(r)}),(function(){}),!0)}catch(e){console.warn("error check storage")}},e.prototype.fetchData=function(e,t,n,i){this.collect.requestManager.useRequest({url:this.eventUrl,data:e,timeout:3e4,success:t,fail:n,app_key:i?"566f58151b0ed37e":""})},e}(),Ef="undefined"!=typeof window?(window.LogPluginObject||(window.LogPluginObject={}),window.LogPluginObject):null,wf=function(){function e(){}return e.prototype.apply=function(e,t){this._plugin={},this.config=t,this.collect=e,this.channel="va",this.loadExtend()},e.prototype.loadExtend=function(){var e=this;try{this.collect.remotePlugin.forEach((function(t,n){if("sdk"===t)if(Mu.hasOwnProperty(n)){var i=Mu[n].object,r=""+Mu[n].src[e.channel];e.exist(n,i,r)}else console.warn("your "+n+" is not exist,please check plugin name");else"object"==J(t)&&(t.src?e.exist(n,t.call,t.src):e.process(n,t.instance,"INSTANCE"))}))}catch(e){this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"LoadExtend Fail",level:"error",time:Date.now(),data:e.message}),console.log("load extend error")}},e.prototype.exist=function(e,t,n){var i=this;Ef[t]?(this.process(e,Ef[t]),console.log("already has "+e+" plugin~")):this.loadPlugin(e,n,(function(){i.process(e,Ef[t]),console.log(" %c %s %s %s","color: yellow; background-color: black;","–","load plugin:"+e+" success","-")}),(function(){console.log(" %c %s %s %s","color: red; background-color: yellow;","–","load plugin:"+e+" error","-")}))},e.prototype.process=function(e,t,n){try{if(n){var i=new t;i.apply&&i.apply(this.collect,this.config),console.log("excude "+e+" success")}else t&&t(this.collect,this.config)}catch(t){this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"Extend Process Fail",level:"error",time:Date.now(),data:t.message}),console.log("excude "+e+" error, message:"+t.message)}},e.prototype.loadPlugin=function(e,t,n,i){var r=this;try{var o=document.createElement("script");o.src=t,this._plugin[e]||(this._plugin[e]=[]),this._plugin[e].push(n),o.onerror=function(){i(t)},o.onload=function(){r._plugin[e].forEach((function(e){e()}))},document.getElementsByTagName("head")[0].appendChild(o)}catch(e){this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"Extend LoadPlugin Fail",level:"error",time:Date.now(),data:e.message})}},e}(),kf=function(){function e(){this.autotrack=!1,this.spa=!1,this.cache={},this.allowHash=!1}return e.prototype.apply=function(e,t){if(t.spa||t.autotrack){var n=e.Types;this.collect=e,this.config=t,this.appid=t.app_id,this.allowHash=t.allow_hash,this.fncArray=new Map,this.setKey(),this.setLocation(),this.hack(),this.init(),this.listener(),e.emit(n.RouteReady)}},e.prototype.setKey=function(){var e=this.collect.adapters.storage;this.storage=new e(!1),this.cache_key="__tea_cache_refer_"+this.appid,this.cache={refer_key:"",refer_title:document.title||location.pathname,refer_manual_key:"",routeChange:!1},this.config.autotrack&&"object"==J(this.config.autotrack)&&this.config.autotrack.page_manual_key&&(this.cache.refer_manual_key=this.config.autotrack.page_manual_key),this.storage.setItem(this.cache_key,this.cache)},e.prototype.hack=function(){var e=this,t=window.history.pushState;history.pushState=function(n){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];"function"==typeof history.onpushstate&&history.onpushstate({state:n});var o=t.call.apply(t,Ta([history,n],i));if(e.collect.sdkStop||e.collect.destroy)return o;if(!(e.lastLocation===location.href||e.config.disable_spa_query&&e.pathEquel())){e.setReferCache(e.lastLocation);var a=e.getPopStateChangeEventData();return e.lastLocation=location.href,e.sendPv(a,"pushState"),o}};var n=history.replaceState;history.replaceState=function(t){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];"function"==typeof history.onreplacestate&&history.onreplacestate({state:t});var o=n.call.apply(n,Ta([history,t],i));if(e.collect.sdkStop||e.collect.destroy)return o;if(!(e.lastLocation===location.href||e.config.disable_spa_query&&e.pathEquel())){e.setReferCache(e.lastLocation);var a=e.getPopStateChangeEventData();return e.lastLocation=location.href,e.sendPv(a),o}}},e.prototype.setLocation=function(){"undefined"!=typeof window&&(this.lastLocation=window.location.href)},e.prototype.getLocation=function(){return this.lastLocation},e.prototype.pathEquel=function(){try{return new URL(this.lastLocation).origin+new URL(this.lastLocation).pathname===new URL(location.href).origin+new URL(location.href).pathname}catch(e){return!1}},e.prototype.init=function(){var e=this.getPopStateChangeEventData();this.collect.emit("route-change",{config:e,init:!0})},e.prototype.listener=function(){var e=this;window.addEventListener("hashchange",(function(t){if(!e.collect.sdkStop&&!e.collect.destroy&&e.lastLocation!==window.location.href&&(!e.config.disable_spa_query||!e.pathEquel())&&e.allowHash){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var n=e.getPopStateChangeEventData();e.sendPv(n)}})),window.addEventListener("popstate",(function(t){if(!e.collect.sdkStop&&!e.collect.destroy&&!(e.lastLocation===window.location.href||e.config.disable_spa_query&&e.pathEquel())){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var n=e.getPopStateChangeEventData();e.sendPv(n)}}))},e.prototype.getPopStateChangeEventData=function(){var e=this.pageConfig();return e.is_back=0,e},e.prototype.pageConfig=function(){try{var e,t=this.storage.getItem(this.cache_key)||{},n=this.storage.getItem("__tea_cache_first_"+this.appid);return e=!n||1!=n,{is_html:1,url:location.href,referrer:this.handleRefer(),page_key:location.href,refer_page_key:this.handleRefer(),page_title:document.title||location.pathname,page_manual_key:this.config.autotrack&&this.config.autotrack.page_manual_key||"",refer_page_manual_key:t&&t.refer_manual_key||"",refer_page_title:t&&t.refer_title||"",page_path:location.pathname,page_host:location.host,is_first_time:""+e}}catch(t){return this.collect.emit(Fa.DEBUGGER_MESSAGE,{type:Fa.DEBUGGER_MESSAGE_SDK,info:"something error",level:"error",time:Date.now(),data:t.message}),{}}},e.prototype.sendPv=function(e,t){this.collect.emit("route-change",{config:e,init:!1})},e.prototype.handleRefer=function(){var e="";try{var t=this.storage.getItem(this.cache_key)||{};e=t.routeChange?t.refer_key:this.collect.configManager.get("referrer")}catch(t){e=document.referrer}return e},e.prototype.removeQuery=function(e){try{var t=new URL(e);return t.search="",t.href}catch(t){return e.split(/[?#]/)[0]}},e.prototype.setReferCache=function(e){var t=this.storage.getItem(this.cache_key)||{},n=this.removeQuery(e);t.refer_key=n,t.routeChange=!0,this.storage.setItem(this.cache_key,t)},e}(),Sf=function(){function e(){this.privateMode=!1}return e.prototype.apply=function(e,t){this.collector=e,this.config=t,this.dynamicEditorUrl="",this.privateMode=!!t.channel_domain,window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.appId=t.app_id,this.dynamicUrl(),this.init()},e.prototype.init=function(){this.config.autotrack||(Gu(["*"]),this.addMessage()),this.reviceMessage()},e.prototype.addMessage=function(){window.addEventListener("message",ju,!1)},e.prototype.reviceMessage=function(){var e,t,n=this;try{t=function(e){n.loadScriptUrl({event:e,url:"https://lf-global-static.iapplogcdn.com/obj/applog-sdk-static-us/log-sdk/collect/heatmap-core.js?query="+Date.now()})},Uu[e="tea:openHeatMapCore"]=Uu[e]||[],Uu[e].push(t)}catch(e){console.log("openHeatMapCore error"),this.collector.emit("sdk-inner-error",{type:"sdk_error_load_heatmap",errorCode:1e3,msg:e.message||e.stack||"sdk_error_load_heatmap"})}},e.prototype.loadScriptUrl=function(e){var t,n,i,r,o=e.event,a=e.url;t=a,n=function(){Lu(o,a+" ScriptloadSuccess")},i=function(){o&&Lu(o,a+" ScriptloadFail")},(r=document.createElement("script")).src=t,r.onerror=function(){i()},r.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(r)},e.prototype.dynamicUrl=function(){if(this.privateMode){var e="",t="";try{var n=window.performance.getEntriesByType("resource");if(n&&n.length){var i=this.config.remote_file_protocol?this.config.remote_file_protocol+":":location.protocol;if(i=i||"https:",n.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(t=e.name)})),t||document.currentScript&&(t=document.currentScript.src),t&&(e=t.split("/"))&&e.length){this.dynamicEditorUrl=i+"/";for(var r=2;r<e.length&&r!==e.length-1;r++)this.dynamicEditorUrl=this.dynamicEditorUrl+"/"+e[r];if(this.dynamicEditorUrl&&this.dynamicEditorUrl.indexOf("/5.0")){var o=this.dynamicEditorUrl.split("/5.0");this.dynamicEditorUrl=o[0]||this.dynamicEditorUrl}}}}catch(e){this.collector.emit("sdk-inner-error",{type:"sdk_error_parsing_remote_url",errorCode:1e3,msg:e.message||e.stack||"sdk_error_parsing_remote_url"})}}},e}(),xf=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t;var i=e.Types;e.on(i.TrackDurationStart,(function(e){n.trackEventStart(e)})),e.on(i.TrackDurationEnd,(function(e){n.trackEventEnd(e)})),e.on(i.TrackDurationPause,(function(e){n.trackEventPause(e)})),e.on(i.TrackDurationResume,(function(e){n.trackEventResume(e)})),this.Types=i,this.TrackEventMap=new Map,this.ready(i.TrackDuration)},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var n=this.collect.hook._hooksCache[e];if(!Object.keys(n).length)return;var i=function(e){n[e].length&&n[e].forEach((function(n){t.collect.hook.emit(e,n)}))};for(var r in n)i(r)}},e.prototype.trackEventStart=function(e){this.TrackEventMap.set(e,{startTime:Date.now(),isPause:!1,pauseTime:0,resumeTime:0})},e.prototype.trackEventEnd=function(e){var t=e.eventName,n=e.params;if(this.TrackEventMap.has(t)){var i,r=this.TrackEventMap.get(t);i=r.isPause?r.pauseTime-r.startTime:r.resumeTime?r.pauseTime-r.startTime+(Date.now()-r.resumeTime):Date.now()-r.startTime;var o=Object.assign(n,{event_duration:i});this.collect.event(t,o),this.cleanEventTrack(t)}},e.prototype.trackEventPause=function(e){if(this.TrackEventMap.has(e)){var t=this.TrackEventMap.get(e);t.isPause||(t.isPause=!0,t.pauseTime=Date.now(),this.TrackEventMap.set(e,t))}},e.prototype.trackEventResume=function(e){if(this.TrackEventMap.has(e)){var t=this.TrackEventMap.get(e);t.isPause&&(t.isPause=!1,t.resumeTime=Date.now(),this.TrackEventMap.set(e,t))}},e.prototype.cleanEventTrack=function(e){this.TrackEventMap.delete(e)},e}();Nu.usePlugin(wf,"extend"),Nu.usePlugin(Vu,"et"),Nu.usePlugin(bf,"retry"),Nu.usePlugin(Hu,"ab"),Nu.usePlugin(Ju,"stay"),Nu.usePlugin(Sf,"heatmap"),Nu.usePlugin(mf,"autotrack"),Nu.usePlugin(xf,"trackeventduration"),Nu.usePlugin(Wu,"monitor"),Nu.usePlugin(kf,"route"),Nu.usePlugin(yf,"tracer"),new Nu("default");var Tf=Nu;function Af(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){Af(e,t,n[t])}))}return e}function Cf(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var Df=function(e,t){var n=null;if(!1!==(null==e?void 0:e.tea))try{var i=(null!=e?e:{}).tea,r=null!=t?t:{},o=r.appId,a=r.region,s=r.debug,c=function(e){var t={};switch(e){case la.US_EASTRED:t={channel:"in",channel_type:"tcpy",channel_domain:"https://mcs16-normal-useastred.tiktokw.eu"};break;case la.EU_TTP:t={channel:"ie",channel_type:"ttp",channel_domain:"https://mcs-ie.tiktokw.eu"};break;case la.EU_TTP2:t={channel:"ie2",channel_type:"ttp",channel_domain:"https://mcs-ie2.tiktokw.eu"};break;case la.US_TTP:t={channel_type:"ttp",channel_domain:"https://mcs.tiktokv.us"};break;case la.US_TTP2:t={channel_type:"ttp",channel_domain:"https://mcs.tiktokw.us"};break;case la.SINGAPORE_CENTRAL:t={channel:"sg",channel_type:"tcpy",channel_domain:"https://mcs-sg.tiktokv.com"};break;case la.US_EAST:t={channel:"va",channel_type:"tcpy",channel_domain:"https://mcs-va.tiktokv.com"}}return t}(a),l=zf({},c,null!=i?i:{});o&&function(e){return!(!e||!e.channel_type||!e.channel&&!e.channel_domain)}(l)&&((n=new Tf("".concat(ga,"_").concat(va,"_").concat(Date.now()))).init(Cf(zf({},l),{app_id:o,log:s,enable_debug:s})),n.start())}catch(e){}return n};function Rf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Of,If,Mf=$((function e(t){var n=this;V(this,e),this._tea=null,this._slardar=null,this._useSingleton=!1,this._isInitialized=!1,this.init=function(e,t){if(!n._isInitialized){n._isInitialized=!0;var i=null!=t?t:{},r=i.bid,o=void 0===r?ga:r,a=i.version,s=void 0===a?va:a,c=i.appId,l=i.appVersion,u=i.tenant;n._name="".concat(o,"_").concat(s,"_").concat(Date.now()),n._trackingModule=n._useSingleton?sa:aa(n._name),n._tea=Df(e,t),n._teaEventNameFormatter=null==e?void 0:e.teaEventNameFormatter,n._slardar=function(e,t){var n=null;if(!1!==(null==e?void 0:e.slardar))try{n=new Ea(e,t)}catch(e){}return n}(e,t),n._slardar&&n._trackingModule.init({slardarContainer:n._slardar,shouldReportJSError:{cuj:!0},shouldRegisterUserDrop:!1,context:{appId:c,appVersion:l,tenant:u}})}},this.reportCUJ=function(e,t,i){if(e)try{var r,o,a;if(n._trackingModule.reportCUJ(e,t,i),n._tea)n._tea.event(null!==(a=null===(r=(o=n)._teaEventNameFormatter)||void 0===r?void 0:r.call(o,e))&&void 0!==a?a:e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){Rf(e,t,n[t])}))}return e}({status:t},null!=i?i:{}))}catch(e){}},this._useSingleton=null!=t&&t})),Pf=Mf;function Nf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(t){Nf(e,t,n[t])}))}return e}(If=Of||(Of={})).INFO="info",If.WARN="warn",If.ERROR="error";var Bf,Gf=function(e){I(n,e);var t=M(n);function n(){var e;return V(this,n),(e=t.call(this))._monitorModule=new Pf,e._isInitialized=!1,e.debug=!1,n._instance||(n._instance=N(e)),P(e,n._instance)}return $(n,[{key:"init",value:function(e,t){var n;this._isInitialized||(this.meta=Uf({},null!==(n=e.meta)&&void 0!==n?n:{},t),this.debug=!!(null==t?void 0:t.debug),e.monitorModuleConfig&&this._monitorModule.init(e.monitorModuleConfig,t),e.customLoggingModule&&e.customLoggingModule instanceof pa?this._customLogger=e.customLoggingModule:this.warn("[LoggingModule]: init - incorrect implementation of LoggingModule"))}},{key:"sendDebugMessage",value:function(e){if(this.debug){var t=e.level;console[t](e.message,e);try{chrome.runtime.sendMessage(e)}catch(e){}}}},{key:"send",value:function(e){var t;this.sendDebugMessage(e),"function"==typeof(null===(t=this._customLogger)||void 0===t?void 0:t.send)&&this._customLogger.send(e)}},{key:"getMeta",value:function(){return Uf({},this.meta)}},{key:"info",value:function(e,t){this.send({message:e,level:Of.INFO,meta:this.getMeta(),data:t})}},{key:"warn",value:function(e,t){this.send({message:e,level:Of.WARN,meta:this.getMeta(),data:t})}},{key:"error",value:function(e,t){this.send({message:e,level:Of.ERROR,meta:this.getMeta(),data:t})}},{key:"destruct",value:function(){var e;"function"==typeof(null===(e=this._customLogger)||void 0===e?void 0:e.destruct)&&this._customLogger.destruct(),this._isInitialized=!1}},{key:"reportCUJ",value:function(e,t,n){this._monitorModule.reportCUJ(e,t,n)}}]),n}(pa),Lf=new Gf,jf=function(e,t){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return e.apply(t,n)}},Ff=Object.prototype.toString,Kf=(Bf=Object.create(null),function(e){var t=Ff.call(e);return Bf[t]||(Bf[t]=t.slice(8,-1).toLowerCase())});function Hf(e){return e=e.toLowerCase(),function(t){return Kf(t)===e}}function Vf(e){return Array.isArray(e)}function qf(e){return void 0===e}var $f=Hf("ArrayBuffer");function Jf(e){return null!==e&&"object"===J(e)}function Wf(e){if("object"!==Kf(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var Xf=Hf("Date"),Zf=Hf("File"),Yf=Hf("Blob"),Qf=Hf("FileList");function ed(e){return"[object Function]"===Ff.call(e)}var td=Hf("URLSearchParams");function nd(e,t){if(null!=e)if("object"!==J(e)&&(e=[e]),Vf(e))for(var n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(null,e[r],r,e)}var id,rd=(id="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return id&&e instanceof id}),od={isArray:Vf,isArrayBuffer:$f,isBuffer:function(e){return null!==e&&!qf(e)&&null!==e.constructor&&!qf(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||Ff.call(e)===t||ed(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$f(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:Jf,isPlainObject:Wf,isUndefined:qf,isDate:Xf,isFile:Zf,isBlob:Yf,isFunction:ed,isStream:function(e){return Jf(e)&&ed(e.pipe)},isURLSearchParams:td,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:nd,merge:function e(){var t={};function n(n,i){Wf(t[i])&&Wf(n)?t[i]=e(t[i],n):Wf(n)?t[i]=e({},n):Vf(n)?t[i]=n.slice():t[i]=n}for(var i=0,r=arguments.length;i<r;i++)nd(arguments[i],n);return t},extend:function(e,t,n){return nd(t,(function(t,i){e[i]=n&&"function"==typeof t?jf(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,i){e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n){var i,r,o,a={};t=t||{};do{for(r=(i=Object.getOwnPropertyNames(e)).length;r-- >0;)a[o=i[r]]||(t[o]=e[o],a[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Kf,kindOfTest:Hf,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var i=e.indexOf(t,n);return-1!==i&&i===n},toArray:function(e){if(!e)return null;var t=e.length;if(qf(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:rd,isFileList:Qf};function ad(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var sd=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(od.isURLSearchParams(t))i=t.toString();else{var r=[];od.forEach(t,(function(e,t){null!=e&&(od.isArray(e)?t+="[]":e=[e],od.forEach(e,(function(e){od.isDate(e)?e=e.toISOString():od.isObject(e)&&(e=JSON.stringify(e)),r.push(ad(t)+"="+ad(e))})))})),i=r.join("&")}if(i){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e};function cd(){this.handlers=[]}cd.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},cd.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},cd.prototype.forEach=function(e){od.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var ld=cd,ud=function(e,t){od.forEach(e,(function(n,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[i])}))};function fd(e,t,n,i,r){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r)}od.inherits(fd,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var dd=fd.prototype,hd={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){hd[e]={value:e}})),Object.defineProperties(fd,hd),Object.defineProperty(dd,"isAxiosError",{value:!0}),fd.from=function(e,t,n,i,r,o){var a=Object.create(dd);return od.toFlatObject(e,a,(function(e){return e!==Error.prototype})),fd.call(a,e.message,t,n,i,r),a.name=e.name,o&&Object.assign(a,o),a};var pd=fd,vd={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var gd=function(e,t){t=t||new FormData;var n=[];function i(e){return null===e?"":od.isDate(e)?e.toISOString():od.isArrayBuffer(e)||od.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}return function e(r,o){if(od.isPlainObject(r)||od.isArray(r)){if(-1!==n.indexOf(r))throw Error("Circular reference detected in "+o);n.push(r),od.forEach(r,(function(n,r){if(!od.isUndefined(n)){var a,s=o?o+"."+r:r;if(n&&!o&&"object"===J(n))if(od.endsWith(r,"{}"))n=JSON.stringify(n);else if(od.endsWith(r,"[]")&&(a=od.toArray(n)))return void a.forEach((function(e){!od.isUndefined(e)&&t.append(s,i(e))}));e(n,s)}})),n.pop()}else t.append(o,i(r))}(e),t},md=od.isStandardBrowserEnv()?{write:function(e,t,n,i,r,o){var a=[];a.push(e+"="+encodeURIComponent(t)),od.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),od.isString(i)&&a.push("path="+i),od.isString(r)&&a.push("domain="+r),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},_d=function(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t},yd=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],bd=od.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var i=e;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=od.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function Ed(e){pd.call(this,null==e?"canceled":e,pd.ERR_CANCELED),this.name="CanceledError"}od.inherits(Ed,pd,{__CANCEL__:!0});var wd=Ed,kd=function(e){return new Promise((function(t,n){var i,r=e.data,o=e.headers,a=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}od.isFormData(r)&&od.isStandardBrowserEnv()&&delete o["Content-Type"];var c=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",u=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(l+":"+u)}var f=_d(e.baseURL,e.url);function d(){if(c){var i="getAllResponseHeaders"in c?function(e){var t,n,i,r={};return e?(od.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=od.trim(e.substr(0,i)).toLowerCase(),n=od.trim(e.substr(i+1)),t){if(r[t]&&yd.indexOf(t)>=0)return;r[t]="set-cookie"===t?(r[t]?r[t]:[]).concat([n]):r[t]?r[t]+", "+n:n}})),r):r}(c.getAllResponseHeaders()):null;!function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new pd("Request failed with status code "+n.status,[pd.ERR_BAD_REQUEST,pd.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:a&&"text"!==a&&"json"!==a?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:i,config:e,request:c}),c=null}}if(c.open(e.method.toUpperCase(),sd(f,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(d)},c.onabort=function(){c&&(n(new pd("Request aborted",pd.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new pd("Network Error",pd.ERR_NETWORK,e,c,c)),c=null},c.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",i=e.transitional||vd;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new pd(t,i.clarifyTimeoutError?pd.ETIMEDOUT:pd.ECONNABORTED,e,c)),c=null},od.isStandardBrowserEnv()){var h=(e.withCredentials||bd(f))&&e.xsrfCookieName?md.read(e.xsrfCookieName):void 0;h&&(o[e.xsrfHeaderName]=h)}"setRequestHeader"in c&&od.forEach(o,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:c.setRequestHeader(t,e)})),od.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),a&&"json"!==a&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(i=function(e){c&&(n(!e||e&&e.type?new wd:e),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i))),r||(r=null);var p,v=(p=/^([-+\w]{1,25})(:?\/\/|:)/.exec(f))&&p[1]||"";v&&-1===["http","https","file"].indexOf(v)?n(new pd("Unsupported protocol "+v+":",pd.ERR_BAD_REQUEST,e)):c.send(r)}))},Sd={"Content-Type":"application/x-www-form-urlencoded"};function xd(e,t){!od.isUndefined(e)&&od.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Td,Ad={transitional:vd,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Td=kd),Td),transformRequest:[function(e,t){if(ud(t,"Accept"),ud(t,"Content-Type"),od.isFormData(e)||od.isArrayBuffer(e)||od.isBuffer(e)||od.isStream(e)||od.isFile(e)||od.isBlob(e))return e;if(od.isArrayBufferView(e))return e.buffer;if(od.isURLSearchParams(e))return xd(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var n,i=od.isObject(e),r=t&&t["Content-Type"];if((n=od.isFileList(e))||i&&"multipart/form-data"===r){var o=this.env&&this.env.FormData;return gd(n?{"files[]":e}:e,o&&new o)}return i||"application/json"===r?(xd(t,"application/json"),function(e,t,n){if(od.isString(e))try{return(t||JSON.parse)(e),od.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Ad.transitional,n=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,r=!n&&"json"===this.responseType;if(r||i&&od.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw pd.from(e,pd.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:null},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};od.forEach(["delete","get","head"],(function(e){Ad.headers[e]={}})),od.forEach(["post","put","patch"],(function(e){Ad.headers[e]=od.merge(Sd)}));var zd=Ad,Cd=function(e,t,n){var i=this||zd;return od.forEach(n,(function(n){e=n.call(i,e,t)})),e},Dd=function(e){return!(!e||!e.__CANCEL__)};function Rd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new wd}var Od=function(e){return Rd(e),e.headers=e.headers||{},e.data=Cd.call(e,e.data,e.headers,e.transformRequest),e.headers=od.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),od.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||zd.adapter)(e).then((function(t){return Rd(e),t.data=Cd.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return Dd(t)||(Rd(e),t&&t.response&&(t.response.data=Cd.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},Id=function(e,t){t=t||{};var n={};function i(e,t){return od.isPlainObject(e)&&od.isPlainObject(t)?od.merge(e,t):od.isPlainObject(t)?od.merge({},t):od.isArray(t)?t.slice():t}function r(n){return od.isUndefined(t[n])?od.isUndefined(e[n])?void 0:i(void 0,e[n]):i(e[n],t[n])}function o(e){if(!od.isUndefined(t[e]))return i(void 0,t[e])}function a(n){return od.isUndefined(t[n])?od.isUndefined(e[n])?void 0:i(void 0,e[n]):i(void 0,t[n])}function s(n){return n in t?i(e[n],t[n]):n in e?i(void 0,e[n]):void 0}var c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s};return od.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||r,i=t(e);od.isUndefined(i)&&t!==s||(n[e]=i)})),n},Md="0.27.2",Pd=Md,Nd={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Nd[e]=function(n){return J(n)===e||"a"+(t<1?"n ":" ")+e}}));var Ud={};Nd.transitional=function(e,t,n){function i(e,t){return"[Axios v"+Pd+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,o){if(!1===e)throw new pd(i(r," has been removed"+(t?" in "+t:"")),pd.ERR_DEPRECATED);return t&&!Ud[r]&&(Ud[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,o)}};var Bd={assertOptions:function(e,t,n){if("object"!==J(e))throw new pd("options must be an object",pd.ERR_BAD_OPTION_VALUE);for(var i=Object.keys(e),r=i.length;r-- >0;){var o=i[r],a=t[o];if(a){var s=e[o],c=void 0===s||a(s,o,e);if(!0!==c)throw new pd("option "+o+" must be "+c,pd.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new pd("Unknown option "+o,pd.ERR_BAD_OPTION)}},validators:Nd},Gd=Bd.validators;function Ld(e){this.defaults=e,this.interceptors={request:new ld,response:new ld}}Ld.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=Id(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&Bd.assertOptions(n,{silentJSONParsing:Gd.transitional(Gd.boolean),forcedJSONParsing:Gd.transitional(Gd.boolean),clarifyTimeoutError:Gd.transitional(Gd.boolean)},!1);var i=[],r=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(r=r&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));var o,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!r){var s=[Od,void 0];for(Array.prototype.unshift.apply(s,i),s=s.concat(a),o=Promise.resolve(t);s.length;)o=o.then(s.shift(),s.shift());return o}for(var c=t;i.length;){var l=i.shift(),u=i.shift();try{c=l(c)}catch(e){u(e);break}}try{o=Od(c)}catch(e){return Promise.reject(e)}for(;a.length;)o=o.then(a.shift(),a.shift());return o},Ld.prototype.getUri=function(e){e=Id(this.defaults,e);var t=_d(e.baseURL,e.url);return sd(t,e.params,e.paramsSerializer)},od.forEach(["delete","get","head","options"],(function(e){Ld.prototype[e]=function(t,n){return this.request(Id(n||{},{method:e,url:t,data:(n||{}).data}))}})),od.forEach(["post","put","patch"],(function(e){function t(t){return function(n,i,r){return this.request(Id(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Ld.prototype[e]=t(),Ld.prototype[e+"Form"]=t(!0)}));var jd=Ld;function Fd(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,i=n._listeners.length;for(t=0;t<i;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,i=new Promise((function(e){n.subscribe(e),t=e})).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e((function(e){n.reason||(n.reason=new wd(e),t(n.reason))}))}Fd.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Fd.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},Fd.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},Fd.source=function(){var e,t=new Fd((function(t){e=t}));return{token:t,cancel:e}};var Kd=Fd;var Hd=function e(t){var n=new jd(t),i=jf(jd.prototype.request,n);return od.extend(i,jd.prototype,n),od.extend(i,n),i.create=function(n){return e(Id(t,n))},i}(zd);Hd.Axios=jd,Hd.CanceledError=wd,Hd.CancelToken=Kd,Hd.isCancel=Dd,Hd.VERSION=Md,Hd.toFormData=gd,Hd.AxiosError=pd,Hd.Cancel=Hd.CanceledError,Hd.all=function(e){return Promise.all(e)},Hd.spread=function(e){return function(t){return e.apply(null,t)}},Hd.isAxiosError=function(e){return od.isObject(e)&&!0===e.isAxiosError};var Vd=Hd,qd=Hd;Vd.default=qd;var $d=Vd,Jd=li((function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",f="type",d="vendor",h="version",p="architecture",v="console",g="mobile",m="tablet",_="smarttv",y="wearable",b="embedded",E="Amazon",w="Apple",k="ASUS",S="BlackBerry",x="Firefox",T="Google",A="Huawei",z="LG",C="Microsoft",D="Motorola",R="Opera",O="Samsung",I="Sharp",M="Sony",P="Xiaomi",N="Zebra",U="Facebook",B="Chromium OS",G="Mac OS",L=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},j=function(e,t){return J(e)===s&&-1!==F(t).indexOf(F(e))},F=function(e){return e.toLowerCase()},K=function(e,t){if(J(e)===s)return e=e.replace(/^\s\s*/,""),J(t)===o?e:e.substring(0,500)},H=function(e,t){for(var n,o,s,c,l,u,f=0;f<t.length&&!l;){var d=t[f],h=t[f+1];for(n=o=0;n<d.length&&!l&&d[n];)if(l=d[n++].exec(e))for(s=0;s<h.length;s++)u=l[++o],J(c=h[s])===a&&c.length>0?2===c.length?J(c[1])==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?J(c[1])!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;f+=2}},V=function(e,t){for(var n in t)if(J(t[n])===a&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(j(t[n][r],e))return"?"===n?i:n}else if(j(t[n],e))return"?"===n?i:n;return e},q={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,h],[/opios[\/ ]+([\w\.]+)/i],[h,[u,"Opera Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[h,[u,"Opera GX"]],[/\bopr\/([\w\.]+)/i],[h,[u,R]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[h,[u,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[u,h],[/\bddg\/([\w\.]+)/i],[h,[u,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[u,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[h,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[u,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[h,[u,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[h,[u,"Smart Lenovo Browser"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure Browser"],h],[/\bfocus\/([\w\.]+)/i],[h,[u,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[h,[u,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[u,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[u,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[h,[u,x]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 Browser"]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 Browser"],h],[/samsungbrowser\/([\w\.]+)/i],[h,[u,"Samsung Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],h],[/metasr[\/ ]?([\d\.]+)/i],[h,[u,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,"Sogou Mobile"],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[u,h],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,U],h],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[u,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[u,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[h,[u,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[u,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,"Chrome WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[u,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,h],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[h,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[h,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[h,V,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[u,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[u,h],[/(cobalt)\/([\w\.]+)/i],[u,[h,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,F]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",F]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,F]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,O],[f,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,O],[f,g]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[d,w],[f,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,w],[f,m]],[/(macintosh);/i],[l,[d,w]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,I],[f,g]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,A],[f,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,A],[f,g]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,P],[f,g]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,P],[f,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[f,g]],[/\b(opd2\d{3}a?) bui/i],[l,[d,"OPPO"],[f,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[f,g]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[f,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,D],[f,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,D],[f,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,z],[f,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,z],[f,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[f,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[f,g]],[/(pixel c)\b/i],[l,[d,T],[f,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,T],[f,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,M],[f,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,M],[f,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[f,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,E],[f,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,E],[f,g]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[f,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,S],[f,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,k],[f,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,k],[f,g]],[/(nexus 9)/i],[l,[d,"HTC"],[f,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[f,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[f,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[f,g]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[l,[d,"Ulefone"],[f,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[f,g]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[f,m]],[/(surface duo)/i],[l,[d,C],[f,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[f,g]],[/(u304aa)/i],[l,[d,"AT&T"],[f,g]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[f,g]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[f,m]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[f,m]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[f,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[f,m]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[f,m]],[/\b(k88) b/i],[l,[d,"ZTE"],[f,m]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[f,g]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[f,g]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[f,m]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[f,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[f,m]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[f,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[f,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[f,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[f,g]],[/\b(ph-1) /i],[l,[d,"Essential"],[f,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[f,m]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[f,m]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[f,m]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[f,m]],[/(sprint) (\w+)/i],[d,l,[f,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,C],[f,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,N],[f,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,N],[f,g]],[/smart-tv.+(samsung)/i],[d,[f,_]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,O],[f,_]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,z],[f,_]],[/(apple) ?tv/i],[d,[l,"Apple TV"],[f,_]],[/crkey/i],[[l,"Chromecast"],[d,T],[f,_]],[/droid.+aft(\w+)( bui|\))/i],[l,[d,E],[f,_]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,I],[f,_]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,M],[f,_]],[/(mitv-\w{5}) bui/i],[l,[d,P],[f,_]],[/Hbbtv.*(technisat) (.*);/i],[d,l,[f,_]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,K],[l,K],[f,_]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,_]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[f,v]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[f,v]],[/(playstation [345portablevi]+)/i],[l,[d,M],[f,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,C],[f,v]],[/((pebble))app/i],[d,l,[f,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[d,w],[f,y]],[/droid.+; (glass) \d/i],[l,[d,T],[f,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,N],[f,y]],[/(quest( \d| pro)?)/i],[l,[d,U],[f,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[f,b]],[/(aeobc)\b/i],[l,[d,E],[f,b]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[l,[f,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[f,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,m]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,g]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,h],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[u,[h,V,q]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,V,q],[u,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,G],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[h,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,h],[/\(bb(10);/i],[h,[u,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[u,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[u,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[h,[u,"watchOS"]],[/crkey\/([\d\.]+)/i],[h,[u,"Chromecast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,B],h],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,h],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,h]]},W=function e(t,c){if(J(t)===a&&(c=t,t=i),!(this instanceof e))return new e(t,c).getResult();var l=J(n)!==o&&n.navigator?n.navigator:i,u=t||(l&&l.userAgent?l.userAgent:""),f=l&&l.userAgentData?l.userAgentData:i,d=c?function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n}($,c):$,h=l&&l.userAgent==u;return this.getBrowser=function(){var e,t={};return t.name=i,t.version=i,H.call(t,u,d.browser),t.major=J(e=t.version)===s?e.replace(/[^\d\.]/g,"").split(".")[0]:i,h&&l&&l.brave&&J(l.brave.isBrave)==r&&(t.name="Brave"),t},this.getCPU=function(){var e={};return e.architecture=i,H.call(e,u,d.cpu),e},this.getDevice=function(){var e={};return e.vendor=i,e.model=i,e.type=i,H.call(e,u,d.device),h&&!e.type&&f&&f.mobile&&(e.type=g),h&&"Macintosh"==e.model&&l&&J(l.standalone)!==o&&l.maxTouchPoints&&l.maxTouchPoints>2&&(e.model="iPad",e.type=m),e},this.getEngine=function(){var e={};return e.name=i,e.version=i,H.call(e,u,d.engine),e},this.getOS=function(){var e={};return e.name=i,e.version=i,H.call(e,u,d.os),h&&!e.name&&f&&f.platform&&"Unknown"!=f.platform&&(e.name=f.platform.replace(/chrome os/i,B).replace(/macos/i,G)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return u},this.setUA=function(e){return u=J(e)===s&&e.length>500?K(e,500):e,this},this.setUA(u),this};W.VERSION="1.0.38",W.BROWSER=L([u,h,c]),W.CPU=L([p]),W.DEVICE=L([l,d,f,v,g,_,m,y,b]),W.ENGINE=W.OS=L([u,h]),e.exports&&(t=e.exports=W),t.UAParser=W;var X=J(n)!==o&&(n.jQuery||n.Zepto);if(X&&!X.ua){var Z=new W;X.ua=Z.getResult(),X.ua.get=function(){return Z.getUA()},X.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)X.ua[n]=t[n]}}}("object"===("undefined"==typeof window?"undefined":J(window))?window:ci)}));Jd.UAParser;var Wd="2.0.2",Xd="_ccfs_".concat(Wd),Zd="".concat(Xd,"_consent"),Yd="".concat(Xd,"_notifications"),Qd=function(e){return e.US_EAST="US-East",e.US_EASTRED="US-EastRed",e.SINGAPORE_CENTRAL="Singapore-Central",e.EU_TTP="EU-TTP",e.EU_TTP2="EU-TTP2",e.US_TTP="US-TTP",e.US_TTP2="US-TTP2",e}(Qd||{}),eh=function(e){return e.PRODUCTION="production",e.DEV="dev",e.BOE="boe",e}(eh||{}),th=function(e){return e.UNSUPPORTED="Unsupported",e.WEB="Web",e.ANDROID="Android",e.IOS="IOS",e.PC_MAC="PC_MAC",e.PC_WINDOWS="PC_WINDOWS",e}(th||{}),nh={},ih=function(){var e,t,n,i;if(Object.keys(nh).length)return nh;var r=(new Jd).getResult(),o=r.browser,a=r.os;return nh={platform:th.WEB,browser:null!=(e=null==o?void 0:o.name)?e:"",browser_version:null!=(t=null==o?void 0:o.version)?t:"",os:null!=(n=null==a?void 0:a.name)?n:"",os_version:null!=(i=null==a?void 0:a.version)?i:""}},rh=Object.defineProperty,oh=Object.getOwnPropertySymbols,ah=Object.prototype.hasOwnProperty,sh=Object.prototype.propertyIsEnumerable,ch=function(e,t,n){return t in e?rh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},lh=function(e,t){for(var n in t||(t={}))ah.call(t,n)&&ch(e,n,t[n]);if(oh){var i,r=F(oh(t));try{for(r.s();!(i=r.n()).done;){n=i.value;sh.call(t,n)&&ch(e,n,t[n])}}catch(e){r.e(e)}finally{r.f()}}return e},uh=/^(https?:\/\/)/,fh=$((function e(){var t=this;return V(this,e),this._region="",this._bid="",this._debug=!1,this.init=function(e){Lf.info("[ServiceModule]: init");var n=null!=e?e:{},i=n.region,r=void 0===i?"":i,o=n.bid,a=void 0===o?"":o,s=n.appId,c=n.domain;t._appId=s,t._region=r,t._bid=a,t._domain=c},this.sendRequest=function(e,n,i,r){var o=uh.test(e)?e:"".concat(t._domain).concat(e),a=new URL(o),s=Array.from(a.searchParams.entries()).reduce((function(e,t){var n=z(t,2),i=n[0],r=n[1];return void 0===r&&""===r||(e[i]=r),e}),{}),c=null!=r?r:{},l=c.params,u=c.timeout,f=function(e,t){var n={};for(var i in e)ah.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&oh){var r,o=F(oh(e));try{for(o.s();!(r=o.n()).done;)i=r.value,t.indexOf(i)<0&&sh.call(e,i)&&(n[i]=e[i])}catch(e){o.e(e)}finally{o.f()}}return n}(c,["params","timeout"]),d=lh(lh(lh({region:t._region,aid:t._appId,bid:t._bid},s),null!=l?l:{}),ih());"GET"===n&&i&&"object"===J(i)&&(d=lh(lh({},d),i));var h=new URLSearchParams(function(e){if(!e)return"";var t=new URLSearchParams;return Object.entries(e).forEach((function(e){var n=z(e,2),i=n[0],r=n[1];Array.isArray(r)?r.forEach((function(e){t.append(i,e)})):null!=r&&t.append(i,r)})),t.toString()}(d)),p=new URL("".concat(a.origin).concat(a.pathname,"?").concat(h.toString())),v=Io({},f,{method:n,timeout:null!=u?u:0,data:i});return Lf.info("[ServiceModule]: sendRequest start",v),$d(p.href,v).then((function(e){return Lf.info("[ServiceModule]: sendRequest finish",e),e})).catch((function(e){throw Lf.error("[ServiceModule]: sendRequest error",e),e}))},this.destruct=function(){Lf.info("[ServiceModule]: destruct")},e._instance||(e._instance=this),e._instance})),dh=new fh,hh=function(e){return e.beforeFetchUserInfo="beforeFetchUserInfo",e.afterFetchUserInfo="afterFetchUserInfo",e.beforeFetchConsentData="beforeFetchConsentData",e.afterFetchConsentData="afterFetchConsentData",e.beforeFetchCollectionPoint="beforeFetchCollectionPoint",e.afterFetchCollectionPoint="afterFetchCollectionPoint",e.beforeFetchEntities="beforeFetchEntities",e.afterFetchEntities="afterFetchEntities",e.beforeFetchNotificationData="beforeFetchNotificationData",e.afterFetchNotificationData="afterFetchNotificationData",e.beforeUpdateRecords="beforeUpdateRecords",e.afterUpdateRecords="afterUpdateRecords",e.beforeNotify="beforeNotify",e.afterNotify="afterNotify",e.beforeRemoveNotification="beforeRemoveNotification",e.afterRemoveNotification="afterRemoveNotification",e.beforeThirdPartyApprove="beforeThirdPartyApprove",e.afterThirdPartyApprove="afterThirdPartyApprove",e.beforeThirdPartyReject="beforeThirdPartyReject",e.afterThirdPartyReject="afterThirdPartyReject",e}(hh||{}),ph=function(e){return e.sessionStorage="sessionStorage",e.localStorage="localStorage",e.inMem="inMem",e}(ph||{}),vh=function(e){return e.UNSUPPORTED="Unsupported",e.APPROVE="Approve",e.REJECT="Reject",e.NOT_DETERMINED="NotDetermined",e.PENDING_REVIEW="PENDING_REVIEW",e.REVOKE="REVOKE",e}(vh||{}),gh=function(e){return e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.APPROVE=1]="APPROVE",e[e.REJECT=2]="REJECT",e[e.NOT_DETERMINED=3]="NOT_DETERMINED",e[e.PENDING_REVIEW=4]="PENDING_REVIEW",e[e.REVOKE=5]="REVOKE",e}(gh||{}),mh=function(e){return e.ENTITIES="entities",e.COLLECTION_POINTS="collectionPoints",e.NOTIFICATIONS="notifications",e}(mh||{}),_h=(x(n={},0,"Unsupported"),x(n,1,"Approve"),x(n,2,"Reject"),x(n,3,"NotDetermined"),x(n,4,"PENDING_REVIEW"),x(n,5,"REVOKE"),n);var yh=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e},bh=br(Object.keys,Object),Eh=Object.prototype.hasOwnProperty;var wh=function(e){if(!kr(e))return bh(e);var t=[];for(var n in Object(e))Eh.call(e,n)&&"constructor"!=n&&t.push(n);return t};var kh=function(e){return Mr(e)?ro(e):wh(e)};var Sh=function(e,t){return e&&Qr(t,kh(t),e)};var xh=function(e,t){return e&&Qr(t,co(t),e)};var Th=function(e,t){for(var n=-1,i=null==e?0:e.length,r=0,o=[];++n<i;){var a=e[n];t(a,n,e)&&(o[r++]=a)}return o};var Ah=function(){return[]},zh=Object.prototype.propertyIsEnumerable,Ch=Object.getOwnPropertySymbols,Dh=Ch?function(e){return null==e?[]:(e=Object(e),Th(Ch(e),(function(t){return zh.call(e,t)})))}:Ah;var Rh=function(e,t){return Qr(e,Dh(e),t)};var Oh=function(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e},Ih=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Oh(t,Dh(e)),e=Er(e);return t}:Ah;var Mh=function(e,t){return Qr(e,Ih(e),t)};var Ph=function(e,t,n){var i=t(e);return Or(e)?i:Oh(i,n(e))};var Nh=function(e){return Ph(e,kh,Dh)};var Uh=function(e){return Ph(e,co,Ih)},Bh=Gi(di,"DataView"),Gh=Gi(di,"Promise"),Lh=Gi(di,"Set"),jh=Gi(di,"WeakMap"),Fh="[object Map]",Kh="[object Promise]",Hh="[object Set]",Vh="[object WeakMap]",qh="[object DataView]",$h=Di(Bh),Jh=Di(Li),Wh=Di(Gh),Xh=Di(Lh),Zh=Di(jh),Yh=wi;(Bh&&Yh(new Bh(new ArrayBuffer(1)))!=qh||Li&&Yh(new Li)!=Fh||Gh&&Yh(Gh.resolve())!=Kh||Lh&&Yh(new Lh)!=Hh||jh&&Yh(new jh)!=Vh)&&(Yh=function(e){var t=wi(e),n="[object Object]"==t?e.constructor:void 0,i=n?Di(n):"";if(i)switch(i){case $h:return qh;case Jh:return Fh;case Wh:return Kh;case Xh:return Hh;case Zh:return Vh}return t});var Qh=Yh,ep=Object.prototype.hasOwnProperty;var tp=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ep.call(e,"index")&&(n.index=e.index,n.input=e.input),n};var np=function(e,t){var n=t?vr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},ip=/\w*$/;var rp=function(e){var t=new e.constructor(e.source,ip.exec(e));return t.lastIndex=e.lastIndex,t},op=hi?hi.prototype:void 0,ap=op?op.valueOf:void 0;var sp=function(e){return ap?Object(ap.call(e)):{}};var cp=function(e,t,n){var i=e.constructor;switch(t){case"[object ArrayBuffer]":return vr(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return np(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return gr(e,n);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return rp(e);case"[object Symbol]":return sp(e)}};var lp=function(e){return xr(e)&&"[object Map]"==Qh(e)},up=$r&&$r.isMap,fp=up?qr(up):lp;var dp=function(e){return xr(e)&&"[object Set]"==Qh(e)},hp=$r&&$r.isSet,pp=hp?qr(hp):dp,vp="[object Arguments]",gp="[object Function]",mp="[object Object]",_p={};_p[vp]=_p["[object Array]"]=_p["[object ArrayBuffer]"]=_p["[object DataView]"]=_p["[object Boolean]"]=_p["[object Date]"]=_p["[object Float32Array]"]=_p["[object Float64Array]"]=_p["[object Int8Array]"]=_p["[object Int16Array]"]=_p["[object Int32Array]"]=_p["[object Map]"]=_p["[object Number]"]=_p[mp]=_p["[object RegExp]"]=_p["[object Set]"]=_p["[object String]"]=_p["[object Symbol]"]=_p["[object Uint8Array]"]=_p["[object Uint8ClampedArray]"]=_p["[object Uint16Array]"]=_p["[object Uint32Array]"]=!0,_p["[object Error]"]=_p[gp]=_p["[object WeakMap]"]=!1;var yp=function e(t,n,i,r,o,a){var s,c=1&n,l=2&n,u=4&n;if(i&&(s=o?i(t,r,o,a):i(t)),void 0!==s)return s;if(!ki(t))return t;var f=Or(t);if(f){if(s=tp(t),!c)return mr(t,s)}else{var d=Qh(t),h=d==gp||"[object GeneratorFunction]"==d;if(Ur(t))return hr(t,c);if(d==mp||d==vp||h&&!o){if(s=l||h?{}:Sr(t),!c)return l?Mh(t,xh(s,t)):Rh(t,Sh(s,t))}else{if(!_p[d])return o?t:{};s=cp(t,d,c)}}a||(a=new cr);var p=a.get(t);if(p)return p;a.set(t,s),pp(t)?t.forEach((function(r){s.add(e(r,n,i,r,t,a))})):fp(t)&&t.forEach((function(r,o){s.set(o,e(r,n,i,o,t,a))}));var v=f?void 0:(u?l?Uh:Nh:l?co:kh)(t);return yh(v||t,(function(r,o){v&&(r=t[o=r]),Yr(s,o,e(r,n,i,o,t,a))})),s};var bp=function(e){return yp(e,5)};var Ep,wp,kp,Sp,xp,Tp,Ap,zp,Cp,Dp,Rp,Op,Ip,Mp,Pp,Np,Up,Bp,Gp,Lp,jp=function e(t,n,i,r,o,a){return ki(t)&&ki(n)&&(a.set(n,t),fo(t,n,void 0,e,a),a.delete(n)),t},Fp=Oo((function(e,t,n,i){fo(e,t,n,i)})),Kp=wo((function(e){return e.push(void 0,jp),po(Fp,void 0,e)})),Hp=Object.defineProperty,Vp=Object.getOwnPropertySymbols,qp=Object.prototype.hasOwnProperty,$p=Object.prototype.propertyIsEnumerable,Jp=function(e,t,n){return t in e?Hp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Wp=function(e,t){for(var n in t||(t={}))qp.call(t,n)&&Jp(e,n,t[n]);if(Vp){var i,r=F(Vp(t));try{for(r.s();!(i=r.n()).done;){n=i.value;$p.call(t,n)&&Jp(e,n,t[n])}}catch(e){r.e(e)}finally{r.f()}}return e},Xp={data:{},timestamp:0},Zp=$((function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"BaseStorageWrapper";V(this,e),this._getConsentData=function(e){var n,i,r,o,a=e.userInfo,s=e.entityKeys,c=e.collectionPointId;Lf.info("[".concat(t.name,"]: _getConsentData"),{userInfo:a,entityKeys:s,collectionPointId:c});var l={entityMap:null,collectionPoint:null};try{var u=t.getConsentStore(a),f=u[mh.ENTITIES],d=u[mh.COLLECTION_POINTS],h=[];if(c&&(l.collectionPoint=(null==(n=null==d?void 0:d.data)?void 0:n[c])?bp(d.data[c]):null,h=null!=(r=null==(i=l.collectionPoint)?void 0:i.entity_keys)?r:[]),l.entityMap=bp(null!=(o=null==f?void 0:f.data)?o:{}),Object.keys(l.entityMap).length)if(c){var p={};h.forEach((function(e){var t;(null==(t=l.entityMap)?void 0:t[e])&&(p[e]=l.entityMap[e])})),l.entityMap=p}else if(null==s?void 0:s.length){var v={};s.forEach((function(e){var t;(null==(t=l.entityMap)?void 0:t[e])&&(v[e]=l.entityMap[e])})),l.entityMap=v}}catch(e){Lf.error("[".concat(t.name,"]: getConsentData Error"),{userInfo:a,entityKeys:s,collectionPointId:c,error:e})}return l},this._updateUserInfo=function(e,n){Lf.info("[".concat(t.name,"]: _updateUserInfo"),{userId:n,deviceId:e}),t._did=e,t._uid=n},this._formatConsentRecord=function(e){var t=null!=e?e:{},n=t.key,i=t.record,r=t.version;return i&&n?Wp({entity_key:n,entity_version:r},i):null},this.getUserInfo=function(){return{device_id:t._did,user_id:t._uid}},this.cleanUpUnrelatedUserData=function(e){Lf.info("[".concat(t.name,"]: cleanUpUnrelatedUserData"),{userInfo:e});var n=null!=e?e:{},i=n.device_id,r=void 0===i?"":i,o=n.user_id,a=void 0===o?"":o;(r||a)&&r===t._did&&a===t._uid||(t.cleanConsentData(),t._updateUserInfo(r,a))},this.insertDataByStorageName=function(e,n,i,r){Lf.info("[".concat(t.name,"]: insertDataByStorageName"),{data:i,storageName:n,timestamp:r});var o=e[n],a=o.data,s=void 0===a?{}:a,c=o.timestamp;if((void 0===c?0:c)<r){var l=Kp({},i,s);e[n]={data:l,timestamp:r}}},this.getNotificationData=function(e){return Lf.info("[".concat(t.name,"]: getNotificationData"),{userInfo:e}),t.getNotificationStore(e).notification.data},this.insertConsentDataIntoStore=function(e,n,i){Lf.info("[".concat(t.name,"]: insertConsentDataIntoStore"),{userInfo:i,data:e,timestamp:n});var r=t.getConsentStore(i),o=e.entityMap,a=e.collectionPoint;return((null==i?void 0:i.user_id)||(null==i?void 0:i.device_id))&&(t.insertDataByStorageName(r,mh.ENTITIES,o,n),(null==a?void 0:a.id)&&t.insertDataByStorageName(r,mh.COLLECTION_POINTS,x({},a.id,a),n)),r},this.getRecord=function(e,n){var i;Lf.info("[".concat(t.name,"]: getRecord"),{userInfo:n,key:e});var r=t._getConsentData({userInfo:n,entityKeys:[e]}).entityMap,o=null==r?void 0:r[e],a=null!=(i=t._formatConsentRecord(o))?i:null;return a||Lf.info("[".concat(t.name,"]: getRecord - no record for ").concat(e),{key:e}),{record:a}},this.getEntity=function(e,n){var i;Lf.info("[".concat(t.name,"]: getEntity"),{userInfo:n,key:e});var r=t._getConsentData({userInfo:n,entityKeys:[e]}).entityMap,o=null!=(i=null==r?void 0:r[e])?i:null;return o||Lf.info("[".concat(t.name,"]: getEntity - no entity for ").concat(e),{key:e}),{entity:o}},this.getEntities=function(e,n){return Lf.info("[".concat(t.name,"]: getEntities"),{userInfo:n,keys:e}),{entityMap:t._getConsentData({userInfo:n,entityKeys:e}).entityMap}},this.getRecords=function(e,n){Lf.info("[".concat(t.name,"]: getRecords"),{userInfo:n,keys:e});var i=[],r=t._getConsentData({userInfo:n,entityKeys:e}).entityMap;if(null==e?void 0:e.length){var o=[];e.forEach((function(e){var n=null==r?void 0:r[e],a=t._formatConsentRecord(n);a?i.push(a):o.push(e)})),o.length&&Lf.info("[".concat(t.name,"]: getRecords - missing some records"),{entityKeys:o})}else Object.keys(null!=r?r:{}).forEach((function(e){var n=t._formatConsentRecord(null==r?void 0:r[e]);n&&i.push(n)}));return{records:i}},this.getCollectionPoint=function(e,n){return Lf.info("[".concat(t.name,"]: getCollectionPoint"),{userInfo:n,collectionPointId:e}),t._getConsentData({userInfo:n,collectionPointId:e})},this.clean=function(){t.cleanConsentData(),t.cleanNotificationData()},this.destruct=function(){t.clean()},this.name=n})),Yp=Zp,Qp=(x(i={},mh.ENTITIES,bp(Xp)),x(i,mh.COLLECTION_POINTS,bp(Xp)),i),ev=x({},mh.NOTIFICATIONS,bp(Xp)),tv=function(e){I(n,e);var t=M(n);function n(){var e;return V(this,n),(e=t.call(this,"InMemStorageWrapper")).insertConsentData=function(t,n,i){Lf.info("[".concat(e.name,"]: insertConsentData"),{data:t,timestamp:n,userInfo:i});try{e.insertConsentDataIntoStore(t,n,i)}catch(t){Lf.error("[".concat(e.name,"]: insert - ").concat(t.message),t)}},e.insertNotificationData=function(t,n,i){Lf.info("[".concat(e.name,"]: insertNotificationData"),{data:t,timestamp:n,userInfo:i});try{var r=e.getNotificationStore(i);e.insertDataByStorageName(r,mh.NOTIFICATIONS,t,n)}catch(t){Lf.error("[".concat(e.name,"]: insert - ").concat(t.message),t)}},e.getConsentStore=function(t){return e.cleanUpUnrelatedUserData(t),e._consentStore},e.getNotificationStore=function(t){return e._notificationStore},e.cleanConsentData=function(){e._consentStore[mh.COLLECTION_POINTS]=bp(Xp),e._consentStore[mh.ENTITIES]=bp(Xp)},e.cleanNotificationData=function(){e._notificationStore[mh.NOTIFICATIONS]=bp(Xp)},e.clean=function(){e._consentStore=bp(Qp),e._notificationStore=bp(ev)},e.destruct=function(){e.clean()},e.clean(),e}return $(n)}(Yp),nv=tv,iv=function(e){return e&&e.default||e}(Object.freeze({__proto__:null,default:{}})),rv=li((function(e,t){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==ci&&ci.crypto&&(n=ci.crypto),!n)try{n=iv}catch(e){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},s=a.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,r=e.sigBytes;if(this.clamp(),i%4)for(var o=0;o<r;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[i+o>>>2]|=a<<24-(i+o)%4*8}else for(var s=0;s<r;s+=4)t[i+s>>>2]=n[s>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new c.init(t,e)}}),l=o.enc={},u=l.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r<n;r++){var o=t[r>>>2]>>>24-r%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new c.init(n,t/2)}},f=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r<n;r++){var o=t[r>>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new c.init(n,t)}},d=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},h=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,i=this._data,r=i.words,o=i.sigBytes,a=this.blockSize,s=o/(4*a),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*l,o);if(l){for(var f=0;f<l;f+=a)this._doProcessBlock(r,f);n=r.splice(0,l),i.sigBytes-=u}return new c.init(n,u)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}});var p=o.algo={};return o}(Math),n)})),ov=(li((function(e,t){var n;e.exports=(n=rv,function(e){var t=n,i=t.lib,r=i.Base,o=i.WordArray,a=t.x64={};a.Word=r.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=r.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=n!=e?n:8*t.length},toX32:function(){for(var e=this.words,t=e.length,n=[],i=0;i<t;i++){var r=e[i];n.push(r.high),n.push(r.low)}return o.create(n,this.sigBytes)},clone:function(){for(var e=r.clone.call(this),t=e.words=this.words.slice(0),n=t.length,i=0;i<n;i++)t[i]=t[i].clone();return e}})}(),n)})),li((function(e,t){var n;e.exports=(n=rv,function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init,i=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var n=e.byteLength,i=[],r=0;r<n;r++)i[r>>>2]|=e[r]<<24-r%4*8;t.call(this,i,n)}else t.apply(this,arguments)};i.prototype=e}}(),n.lib.WordArray)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib.WordArray,i=e.enc;function r(e){return e<<8&4278255360|e>>>8&16711935}i.Utf16=i.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r<n;r+=2){var o=t[r>>>2]>>>16-r%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var n=e.length,i=[],r=0;r<n;r++)i[r>>>1]|=e.charCodeAt(r)<<16-r%2*16;return t.create(i,2*n)}},i.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],o=0;o<n;o+=2){var a=r(t[o>>>2]>>>16-o%4*8&65535);i.push(String.fromCharCode(a))}return i.join("")},parse:function(e){for(var n=e.length,i=[],o=0;o<n;o++)i[o>>>1]|=r(e.charCodeAt(o)<<16-o%2*16);return t.create(i,2*n)}}}(),n.enc.Utf16)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib.WordArray;function i(e,n,i){for(var r=[],o=0,a=0;a<n;a++)if(a%4){var s=i[e.charCodeAt(a-1)]<<a%4*2|i[e.charCodeAt(a)]>>>6-a%4*2;r[o>>>2]|=s<<24-o%4*8,o++}return t.create(r,o)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,i=this._map;e.clamp();for(var r=[],o=0;o<n;o+=3)for(var a=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s++)r.push(i.charAt(a>>>6*(3-s)&63));var c=i.charAt(64);if(c)for(;r.length%4;)r.push(c);return r.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o<n.length;o++)r[n.charCodeAt(o)]=o}var a=n.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return i(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),n.enc.Base64)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib.WordArray;function i(e,n,i){for(var r=[],o=0,a=0;a<n;a++)if(a%4){var s=i[e.charCodeAt(a-1)]<<a%4*2|i[e.charCodeAt(a)]>>>6-a%4*2;r[o>>>2]|=s<<24-o%4*8,o++}return t.create(r,o)}e.enc.Base64url={stringify:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.words,i=e.sigBytes,r=t?this._safe_map:this._map;e.clamp();for(var o=[],a=0;a<i;a+=3)for(var s=(n[a>>>2]>>>24-a%4*8&255)<<16|(n[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|n[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c<i;c++)o.push(r.charAt(s>>>6*(3-c)&63));var l=r.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.length,r=t?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var a=0;a<r.length;a++)o[r.charCodeAt(a)]=a}var s=r.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(n=c)}return i(e,n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),n.enc.Base64url)})),li((function(e,t){var n;e.exports=(n=rv,function(e){var t=n,i=t.lib,r=i.WordArray,o=i.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var i=t+n,r=e[i];e[i]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var o=this._hash.words,a=e[t+0],c=e[t+1],h=e[t+2],p=e[t+3],v=e[t+4],g=e[t+5],m=e[t+6],_=e[t+7],y=e[t+8],b=e[t+9],E=e[t+10],w=e[t+11],k=e[t+12],S=e[t+13],x=e[t+14],T=e[t+15],A=o[0],z=o[1],C=o[2],D=o[3];A=l(A,z,C,D,a,7,s[0]),D=l(D,A,z,C,c,12,s[1]),C=l(C,D,A,z,h,17,s[2]),z=l(z,C,D,A,p,22,s[3]),A=l(A,z,C,D,v,7,s[4]),D=l(D,A,z,C,g,12,s[5]),C=l(C,D,A,z,m,17,s[6]),z=l(z,C,D,A,_,22,s[7]),A=l(A,z,C,D,y,7,s[8]),D=l(D,A,z,C,b,12,s[9]),C=l(C,D,A,z,E,17,s[10]),z=l(z,C,D,A,w,22,s[11]),A=l(A,z,C,D,k,7,s[12]),D=l(D,A,z,C,S,12,s[13]),C=l(C,D,A,z,x,17,s[14]),A=u(A,z=l(z,C,D,A,T,22,s[15]),C,D,c,5,s[16]),D=u(D,A,z,C,m,9,s[17]),C=u(C,D,A,z,w,14,s[18]),z=u(z,C,D,A,a,20,s[19]),A=u(A,z,C,D,g,5,s[20]),D=u(D,A,z,C,E,9,s[21]),C=u(C,D,A,z,T,14,s[22]),z=u(z,C,D,A,v,20,s[23]),A=u(A,z,C,D,b,5,s[24]),D=u(D,A,z,C,x,9,s[25]),C=u(C,D,A,z,p,14,s[26]),z=u(z,C,D,A,y,20,s[27]),A=u(A,z,C,D,S,5,s[28]),D=u(D,A,z,C,h,9,s[29]),C=u(C,D,A,z,_,14,s[30]),A=f(A,z=u(z,C,D,A,k,20,s[31]),C,D,g,4,s[32]),D=f(D,A,z,C,y,11,s[33]),C=f(C,D,A,z,w,16,s[34]),z=f(z,C,D,A,x,23,s[35]),A=f(A,z,C,D,c,4,s[36]),D=f(D,A,z,C,v,11,s[37]),C=f(C,D,A,z,_,16,s[38]),z=f(z,C,D,A,E,23,s[39]),A=f(A,z,C,D,S,4,s[40]),D=f(D,A,z,C,a,11,s[41]),C=f(C,D,A,z,p,16,s[42]),z=f(z,C,D,A,m,23,s[43]),A=f(A,z,C,D,b,4,s[44]),D=f(D,A,z,C,k,11,s[45]),C=f(C,D,A,z,T,16,s[46]),A=d(A,z=f(z,C,D,A,h,23,s[47]),C,D,a,6,s[48]),D=d(D,A,z,C,_,10,s[49]),C=d(C,D,A,z,x,15,s[50]),z=d(z,C,D,A,g,21,s[51]),A=d(A,z,C,D,k,6,s[52]),D=d(D,A,z,C,p,10,s[53]),C=d(C,D,A,z,E,15,s[54]),z=d(z,C,D,A,c,21,s[55]),A=d(A,z,C,D,y,6,s[56]),D=d(D,A,z,C,T,10,s[57]),C=d(C,D,A,z,m,15,s[58]),z=d(z,C,D,A,S,21,s[59]),A=d(A,z,C,D,v,6,s[60]),D=d(D,A,z,C,w,10,s[61]),C=d(C,D,A,z,h,15,s[62]),z=d(z,C,D,A,b,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+z|0,o[2]=o[2]+C|0,o[3]=o[3]+D|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;n[r>>>5]|=128<<24-r%32;var o=e.floor(i/4294967296),a=i;n[15+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(r+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,i,r,o,a){var s=e+(t&n|~t&i)+r+a;return(s<<o|s>>>32-o)+t}function u(e,t,n,i,r,o,a){var s=e+(t&i|n&~i)+r+a;return(s<<o|s>>>32-o)+t}function f(e,t,n,i,r,o,a){var s=e+(t^n^i)+r+a;return(s<<o|s>>>32-o)+t}function d(e,t,n,i,r,o,a){var s=e+(n^(t|~i))+r+a;return(s<<o|s>>>32-o)+t}t.MD5=o._createHelper(c),t.HmacMD5=o._createHmacHelper(c)}(Math),n.MD5)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib,i=t.WordArray,r=t.Hasher,o=e.algo,a=[],s=o.SHA1=r.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],s=n[3],c=n[4],l=0;l<80;l++){if(l<16)a[l]=0|e[t+l];else{var u=a[l-3]^a[l-8]^a[l-14]^a[l-16];a[l]=u<<1|u>>>31}var f=(i<<5|i>>>27)+c+a[l];f+=l<20?1518500249+(r&o|~r&s):l<40?1859775393+(r^o^s):l<60?(r&o|r&s|o&s)-1894007588:(r^o^s)-899497514,c=s,s=o,o=r<<30|r>>>2,r=i,i=f}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(i+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=r._createHelper(s),e.HmacSHA1=r._createHmacHelper(s)}(),n.SHA1)})),li((function(e,t){var n;e.exports=(n=rv,function(e){var t=n,i=t.lib,r=i.WordArray,o=i.Hasher,a=t.algo,s=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),i=2;i<=n;i++)if(!(t%i))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var i=2,r=0;r<64;)t(i)&&(r<8&&(s[r]=n(e.pow(i,.5))),c[r]=n(e.pow(i,1/3)),r++),i++}();var l=[],u=a.SHA256=o.extend({_doReset:function(){this._hash=new r.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],d=n[7],h=0;h<64;h++){if(h<16)l[h]=0|e[t+h];else{var p=l[h-15],v=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=l[h-2],m=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[h]=v+l[h-7]+m+l[h-16]}var _=i&r^i&o^r&o,y=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),b=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&f)+c[h]+l[h];d=f,f=u,u=s,s=a+b|0,a=o,o=r,r=i,i=b+(y+_)|0}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+u|0,n[6]=n[6]+f|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=e.floor(i/4294967296),n[15+(r+64>>>9<<4)]=i,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(u),t.HmacSHA256=o._createHmacHelper(u)}(Math),n.SHA256)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib.WordArray,i=e.algo,r=i.SHA256,o=i.SHA224=r.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=r._doFinalize.call(this);return e.sigBytes-=4,e}});e.SHA224=r._createHelper(o),e.HmacSHA224=r._createHmacHelper(o)}(),n.SHA224)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib.Hasher,i=e.x64,r=i.Word,o=i.WordArray,a=e.algo;function s(){return r.create.apply(r,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=s()}();var u=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],d=n[7],h=i.high,p=i.low,v=r.high,g=r.low,m=o.high,_=o.low,y=a.high,b=a.low,E=s.high,w=s.low,k=u.high,S=u.low,x=f.high,T=f.low,A=d.high,z=d.low,C=h,D=p,R=v,O=g,I=m,M=_,P=y,N=b,U=E,B=w,G=k,L=S,j=x,F=T,K=A,H=z,V=0;V<80;V++){var q,$,J=l[V];if(V<16)$=J.high=0|e[t+2*V],q=J.low=0|e[t+2*V+1];else{var W=l[V-15],X=W.high,Z=W.low,Y=(X>>>1|Z<<31)^(X>>>8|Z<<24)^X>>>7,Q=(Z>>>1|X<<31)^(Z>>>8|X<<24)^(Z>>>7|X<<25),ee=l[V-2],te=ee.high,ne=ee.low,ie=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,re=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),oe=l[V-7],ae=oe.high,se=oe.low,ce=l[V-16],le=ce.high,ue=ce.low;$=($=($=Y+ae+((q=Q+se)>>>0<Q>>>0?1:0))+ie+((q+=re)>>>0<re>>>0?1:0))+le+((q+=ue)>>>0<ue>>>0?1:0),J.high=$,J.low=q}var fe,de=U&G^~U&j,he=B&L^~B&F,pe=C&R^C&I^R&I,ve=D&O^D&M^O&M,ge=(C>>>28|D<<4)^(C<<30|D>>>2)^(C<<25|D>>>7),me=(D>>>28|C<<4)^(D<<30|C>>>2)^(D<<25|C>>>7),_e=(U>>>14|B<<18)^(U>>>18|B<<14)^(U<<23|B>>>9),ye=(B>>>14|U<<18)^(B>>>18|U<<14)^(B<<23|U>>>9),be=c[V],Ee=be.high,we=be.low,ke=K+_e+((fe=H+ye)>>>0<H>>>0?1:0),Se=me+ve;K=j,H=F,j=G,F=L,G=U,L=B,U=P+(ke=(ke=(ke=ke+de+((fe+=he)>>>0<he>>>0?1:0))+Ee+((fe+=we)>>>0<we>>>0?1:0))+$+((fe+=q)>>>0<q>>>0?1:0))+((B=N+fe|0)>>>0<N>>>0?1:0)|0,P=I,N=M,I=R,M=O,R=C,O=D,C=ke+(ge+pe+(Se>>>0<me>>>0?1:0))+((D=fe+Se|0)>>>0<fe>>>0?1:0)|0}p=i.low=p+D,i.high=h+C+(p>>>0<D>>>0?1:0),g=r.low=g+O,r.high=v+R+(g>>>0<O>>>0?1:0),_=o.low=_+M,o.high=m+I+(_>>>0<M>>>0?1:0),b=a.low=b+N,a.high=y+P+(b>>>0<N>>>0?1:0),w=s.low=w+B,s.high=E+U+(w>>>0<B>>>0?1:0),S=u.low=S+L,u.high=k+G+(S>>>0<L>>>0?1:0),T=f.low=T+F,f.high=x+j+(T>>>0<F>>>0?1:0),z=d.low=z+H,d.high=A+K+(z>>>0<H>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[30+(i+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(i+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),n.SHA512)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.x64,i=t.Word,r=t.WordArray,o=e.algo,a=o.SHA512,s=o.SHA384=a.extend({_doReset:function(){this._hash=new r.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=a._createHelper(s),e.HmacSHA384=a._createHmacHelper(s)}(),n.SHA384)})),li((function(e,t){var n;e.exports=(n=rv,function(e){var t=n,i=t.lib,r=i.WordArray,o=i.Hasher,a=t.x64.Word,s=t.algo,c=[],l=[],u=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var i=(2*e+3*t)%5;e=t%5,t=i}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var r=1,o=0;o<24;o++){for(var s=0,f=0,d=0;d<7;d++){if(1&r){var h=(1<<d)-1;h<32?f^=1<<h:s^=1<<h-32}128&r?r=r<<1^113:r<<=1}u[o]=a.create(s,f)}}();var f=[];!function(){for(var e=0;e<25;e++)f[e]=a.create()}();var d=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,i=this.blockSize/2,r=0;r<i;r++){var o=e[t+2*r],a=e[t+2*r+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(z=n[r]).high^=a,z.low^=o}for(var s=0;s<24;s++){for(var d=0;d<5;d++){for(var h=0,p=0,v=0;v<5;v++)h^=(z=n[d+5*v]).high,p^=z.low;var g=f[d];g.high=h,g.low=p}for(d=0;d<5;d++){var m=f[(d+4)%5],_=f[(d+1)%5],y=_.high,b=_.low;for(h=m.high^(y<<1|b>>>31),p=m.low^(b<<1|y>>>31),v=0;v<5;v++)(z=n[d+5*v]).high^=h,z.low^=p}for(var E=1;E<25;E++){var w=(z=n[E]).high,k=z.low,S=c[E];S<32?(h=w<<S|k>>>32-S,p=k<<S|w>>>32-S):(h=k<<S-32|w>>>64-S,p=w<<S-32|k>>>64-S);var x=f[l[E]];x.high=h,x.low=p}var T=f[0],A=n[0];for(T.high=A.high,T.low=A.low,d=0;d<5;d++)for(v=0;v<5;v++){var z=n[E=d+5*v],C=f[E],D=f[(d+1)%5+5*v],R=f[(d+2)%5+5*v];z.high=C.high^~D.high&R.high,z.low=C.low^~D.low&R.low}z=n[0];var O=u[s];z.high^=O.high,z.low^=O.low}},_doFinalize:function(){var t=this._data,n=t.words;this._nDataBytes;var i=8*t.sigBytes,o=32*this.blockSize;n[i>>>5]|=1<<24-i%32,n[(e.ceil((i+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u<c;u++){var f=a[u],d=f.high,h=f.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),l.push(h),l.push(d)}return new r.init(l,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=o._createHelper(d),t.HmacSHA3=o._createHmacHelper(d)}(Math),n.SHA3)})),li((function(e,t){var n;e.exports=(n=rv,
|
||
/** @preserve
|
||
(c) 2012 by Cédric Mesnil. All rights reserved.
|
||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||
|
||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/
|
||
function(e){var t=n,i=t.lib,r=i.WordArray,o=i.Hasher,a=t.algo,s=r.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=r.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=r.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=r.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=r.create([0,1518500249,1859775393,2400959708,2840853838]),d=r.create([1352829926,1548603684,1836072691,2053994217,0]),h=a.RIPEMD160=o.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var i=t+n,r=e[i];e[i]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var o,a,h,b,E,w,k,S,x,T,A,z=this._hash.words,C=f.words,D=d.words,R=s.words,O=c.words,I=l.words,M=u.words;for(w=o=z[0],k=a=z[1],S=h=z[2],x=b=z[3],T=E=z[4],n=0;n<80;n+=1)A=o+e[t+R[n]]|0,A+=n<16?p(a,h,b)+C[0]:n<32?v(a,h,b)+C[1]:n<48?g(a,h,b)+C[2]:n<64?m(a,h,b)+C[3]:_(a,h,b)+C[4],A=(A=y(A|=0,I[n]))+E|0,o=E,E=b,b=y(h,10),h=a,a=A,A=w+e[t+O[n]]|0,A+=n<16?_(k,S,x)+D[0]:n<32?m(k,S,x)+D[1]:n<48?g(k,S,x)+D[2]:n<64?v(k,S,x)+D[3]:p(k,S,x)+D[4],A=(A=y(A|=0,M[n]))+T|0,w=T,T=x,x=y(S,10),S=k,k=A;A=z[1]+h+x|0,z[1]=z[2]+b+T|0,z[2]=z[3]+E+w|0,z[3]=z[4]+o+k|0,z[4]=z[0]+a+S|0,z[0]=A},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var r=this._hash,o=r.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return r},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,n){return e^t^n}function v(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function m(e,t,n){return e&n|t&~n}function _(e,t,n){return e^(t|~n)}function y(e,t){return e<<t|e>>>32-t}t.RIPEMD160=o._createHelper(h),t.HmacRIPEMD160=o._createHmacHelper(h)}(),n.RIPEMD160)})),li((function(e,t){var n;e.exports=(n=rv,void function(){var e=n,t=e.lib.Base,i=e.enc.Utf8;e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),a=this._iKey=t.clone(),s=o.words,c=a.words,l=0;l<n;l++)s[l]^=1549556828,c[l]^=909522486;o.sigBytes=a.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}())})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib,i=t.Base,r=t.WordArray,o=e.algo,a=o.SHA1,s=o.HMAC,c=o.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,i=s.create(n.hasher,e),o=r.create(),a=r.create([1]),c=o.words,l=a.words,u=n.keySize,f=n.iterations;c.length<u;){var d=i.update(t).finalize(a);i.reset();for(var h=d.words,p=h.length,v=d,g=1;g<f;g++){v=i.finalize(v),i.reset();for(var m=v.words,_=0;_<p;_++)h[_]^=m[_]}o.concat(d),l[0]++}return o.sigBytes=4*u,o}});e.PBKDF2=function(e,t,n){return c.create(n).compute(e,t)}}(),n.PBKDF2)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib,i=t.Base,r=t.WordArray,o=e.algo,a=o.MD5,s=o.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,i=this.cfg,o=i.hasher.create(),a=r.create(),s=a.words,c=i.keySize,l=i.iterations;s.length<c;){n&&o.update(n),n=o.update(e).finalize(t),o.reset();for(var u=1;u<l;u++)n=o.finalize(n),o.reset();a.concat(n)}return a.sigBytes=4*c,a}});e.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}}(),n.EvpKDF)})),li((function(e,t){var n;e.exports=void((n=rv).lib.Cipher||function(e){var t=n,i=t.lib,r=i.Base,o=i.WordArray,a=i.BufferedBlockAlgorithm,s=t.enc;s.Utf8;var c=s.Base64,l=t.algo.EvpKDF,u=i.Cipher=a.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?y:m}return function(t){return{encrypt:function(n,i,r){return e(i).encrypt(t,n,i,r)},decrypt:function(n,i,r){return e(i).decrypt(t,n,i,r)}}}}()});i.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=t.mode={},d=i.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var t=d.extend();function n(t,n,i){var r,o=this._iv;o?(r=o,this._iv=e):r=this._prevBlock;for(var a=0;a<i;a++)t[n+a]^=r[a]}return t.Encryptor=t.extend({processBlock:function(e,t){var i=this._cipher,r=i.blockSize;n.call(this,e,t,r),i.encryptBlock(e,t),this._prevBlock=e.slice(t,t+r)}}),t.Decryptor=t.extend({processBlock:function(e,t){var i=this._cipher,r=i.blockSize,o=e.slice(t,t+r);i.decryptBlock(e,t),n.call(this,e,t,r),this._prevBlock=o}}),t}(),p=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,i=n-e.sigBytes%n,r=i<<24|i<<16|i<<8|i,a=[],s=0;s<i;s+=4)a.push(r);var c=o.create(a,i);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};i.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:p}),reset:function(){var e;u.reset.call(this);var t=this.cfg,n=t.iv,i=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(i,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var v=i.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?o.create([1398893684,1701076831]).concat(n).concat(t):t).toString(c)},parse:function(e){var t,n=c.parse(e),i=n.words;return 1398893684==i[0]&&1701076831==i[1]&&(t=o.create(i.slice(2,4)),i.splice(0,4),n.sigBytes-=16),v.create({ciphertext:n,salt:t})}},m=i.SerializableCipher=r.extend({cfg:r.extend({format:g}),encrypt:function(e,t,n,i){i=this.cfg.extend(i);var r=e.createEncryptor(n,i),o=r.finalize(t),a=r.cfg;return v.create({ciphertext:o,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,n,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(n,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=(t.kdf={}).OpenSSL={execute:function(e,t,n,i){i||(i=o.random(8));var r=l.create({keySize:t+n}).compute(e,i),a=o.create(r.words.slice(t),4*n);return r.sigBytes=4*t,v.create({key:r,iv:a,salt:i})}},y=i.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:_}),encrypt:function(e,t,n,i){var r=(i=this.cfg.extend(i)).kdf.execute(n,e.keySize,e.ivSize);i.iv=r.iv;var o=m.encrypt.call(this,e,t,r.key,i);return o.mixIn(r),o},decrypt:function(e,t,n,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var r=i.kdf.execute(n,e.keySize,e.ivSize,t.salt);return i.iv=r.iv,m.decrypt.call(this,e,t,r.key,i)}})}())})),li((function(e,t){var n;e.exports=((n=rv).mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function t(e,t,n,i){var r,o=this._iv;o?(r=o.slice(0),this._iv=void 0):r=this._prevBlock,i.encryptBlock(r,0);for(var a=0;a<n;a++)e[t+a]^=r[a]}return e.Encryptor=e.extend({processBlock:function(e,n){var i=this._cipher,r=i.blockSize;t.call(this,e,n,r,i),this._prevBlock=e.slice(n,n+r)}}),e.Decryptor=e.extend({processBlock:function(e,n){var i=this._cipher,r=i.blockSize,o=e.slice(n,n+r);t.call(this,e,n,r,i),this._prevBlock=o}}),e}(),n.mode.CFB)})),li((function(e,t){var n,i,r;e.exports=((r=rv).mode.CTR=(n=r.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,r=this._iv,o=this._counter;r&&(o=this._counter=r.slice(0),this._iv=void 0);var a=o.slice(0);n.encryptBlock(a,0),o[i-1]=o[i-1]+1|0;for(var s=0;s<i;s++)e[t+s]^=a[s]}}),n.Decryptor=i,n),r.mode.CTR)})),li((function(e,t){var n;e.exports=(
|
||
/** @preserve
|
||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||
* derived from CryptoJS.mode.CTR
|
||
* Jan Hruby jhruby.web@gmail.com
|
||
*/
|
||
(n=rv).mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,n=e>>8&255,i=255&e;255===t?(t=0,255===n?(n=0,255===i?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}function i(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var r=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),i(a);var s=a.slice(0);n.encryptBlock(s,0);for(var c=0;c<r;c++)e[t+c]^=s[c]}});return e.Decryptor=r,e}(),n.mode.CTRGladman)})),li((function(e,t){var n,i,r;e.exports=((r=rv).mode.OFB=(n=r.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,r=this._iv,o=this._keystream;r&&(o=this._keystream=r.slice(0),this._iv=void 0),n.encryptBlock(o,0);for(var a=0;a<i;a++)e[t+a]^=o[a]}}),n.Decryptor=i,n),r.mode.OFB)})),li((function(e,t){var n,i;e.exports=((i=rv).mode.ECB=((n=i.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),n.Decryptor=n.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),n),i.mode.ECB)})),li((function(e,t){var n;e.exports=((n=rv).pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,i=4*t,r=i-n%i,o=n+r-1;e.clamp(),e.words[o>>>2]|=r<<24-o%4*8,e.sigBytes+=r},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)})),li((function(e,t){var n;e.exports=((n=rv).pad.Iso10126={pad:function(e,t){var i=4*t,r=i-e.sigBytes%i;e.concat(n.lib.WordArray.random(r-1)).concat(n.lib.WordArray.create([r<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)})),li((function(e,t){var n;e.exports=((n=rv).pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)})),li((function(e,t){var n;e.exports=((n=rv).pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},n.pad.ZeroPadding)})),li((function(e,t){var n;e.exports=((n=rv).pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)})),li((function(e,t){var n;e.exports=(n=rv,function(e){var t=n,i=t.lib.CipherParams,r=t.enc.Hex;t.format.Hex={stringify:function(e){return e.ciphertext.toString(r)},parse:function(e){var t=r.parse(e);return i.create({ciphertext:t})}}}(),n.format.Hex)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib.BlockCipher,i=e.algo,r=[],o=[],a=[],s=[],c=[],l=[],u=[],f=[],d=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,i=0;for(t=0;t<256;t++){var p=i^i<<1^i<<2^i<<3^i<<4;p=p>>>8^255&p^99,r[n]=p,o[p]=n;var v=e[n],g=e[v],m=e[g],_=257*e[p]^16843008*p;a[n]=_<<24|_>>>8,s[n]=_<<16|_>>>16,c[n]=_<<8|_>>>24,l[n]=_,_=16843009*m^65537*g^257*v^16843008*n,u[p]=_<<24|_>>>8,f[p]=_<<16|_>>>16,d[p]=_<<8|_>>>24,h[p]=_,n?(n=v^e[e[e[m^v]]],i^=e[e[i]]):n=i=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],v=i.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,i=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a<i;a++)a<n?o[a]=t[a]:(l=o[a-1],a%n?n>6&&a%n==4&&(l=r[l>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l]):(l=r[(l=l<<8|l>>>24)>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l],l^=p[a/n|0]<<24),o[a]=o[a-n]^l);for(var s=this._invKeySchedule=[],c=0;c<i;c++){if(a=i-c,c%4)var l=o[a];else l=o[a-4];s[c]=c<4||a<=4?l:u[r[l>>>24]]^f[r[l>>>16&255]]^d[r[l>>>8&255]]^h[r[255&l]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,l,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,f,d,h,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,i,r,o,a,s){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],f=e[t+2]^n[2],d=e[t+3]^n[3],h=4,p=1;p<c;p++){var v=i[l>>>24]^r[u>>>16&255]^o[f>>>8&255]^a[255&d]^n[h++],g=i[u>>>24]^r[f>>>16&255]^o[d>>>8&255]^a[255&l]^n[h++],m=i[f>>>24]^r[d>>>16&255]^o[l>>>8&255]^a[255&u]^n[h++],_=i[d>>>24]^r[l>>>16&255]^o[u>>>8&255]^a[255&f]^n[h++];l=v,u=g,f=m,d=_}v=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&d])^n[h++],g=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[d>>>8&255]<<8|s[255&l])^n[h++],m=(s[f>>>24]<<24|s[d>>>16&255]<<16|s[l>>>8&255]<<8|s[255&u])^n[h++],_=(s[d>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^n[h++],e[t]=v,e[t+1]=g,e[t+2]=m,e[t+3]=_},keySize:8});e.AES=t._createHelper(v)}(),n.AES)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib,i=t.WordArray,r=t.BlockCipher,o=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=o.DES=r.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var i=a[n]-1;t[n]=e[i>>>5]>>>31-i%32&1}for(var r=this._subKeys=[],o=0;o<16;o++){var l=r[o]=[],u=c[o];for(n=0;n<24;n++)l[n/6|0]|=t[(s[n]-1+u)%28]<<31-n%6,l[4+(n/6|0)]|=t[28+(s[n+24]-1+u)%28]<<31-n%6;for(l[0]=l[0]<<1|l[0]>>>31,n=1;n<7;n++)l[n]=l[n]>>>4*(n-1)+3;l[7]=l[7]<<5|l[7]>>>27}var f=this._invSubKeys=[];for(n=0;n<16;n++)f[n]=r[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],d.call(this,4,252645135),d.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var r=n[i],o=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=l[c][((a^r[c])&u[c])>>>0];this._lBlock=a,this._rBlock=o^s}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,d.call(this,1,1431655765),h.call(this,8,16711935),h.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function h(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}e.DES=r._createHelper(f);var p=o.TripleDES=r.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),r=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=f.createEncryptor(i.create(t)),this._des2=f.createEncryptor(i.create(n)),this._des3=f.createEncryptor(i.create(r))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=r._createHelper(p)}(),n.TripleDES)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib.StreamCipher,i=e.algo,r=i.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,i=this._S=[],r=0;r<256;r++)i[r]=r;r=0;for(var o=0;r<256;r++){var a=r%n,s=t[a>>>2]>>>24-a%4*8&255;o=(o+i[r]+s)%256;var c=i[r];i[r]=i[o],i[o]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,n=this._j,i=0,r=0;r<4;r++){n=(n+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[n],e[n]=o,i|=e[(e[t]+e[n])%256]<<24-8*r}return this._i=t,this._j=n,i}e.RC4=t._createHelper(r);var a=i.RC4Drop=r.extend({cfg:r.cfg.extend({drop:192}),_doReset:function(){r._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),n.RC4)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib.StreamCipher,i=e.algo,r=[],o=[],a=[],s=i.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)r[n]^=i[n+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=l>>>16|4294901760&u,d=u<<16|65535&l;for(r[0]^=l,r[1]^=f,r[2]^=u,r[3]^=d,r[4]^=l,r[5]^=f,r[6]^=u,r[7]^=d,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),r[0]=n[0]^n[5]>>>16^n[3]<<16,r[1]=n[2]^n[7]>>>16^n[5]<<16,r[2]=n[4]^n[1]>>>16^n[7]<<16,r[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)r[i]=16711935&(r[i]<<8|r[i]>>>24)|4278255360&(r[i]<<24|r[i]>>>8),e[t+i]^=r[i]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var i=e[n]+t[n],r=65535&i,s=i>>>16,c=((r*r>>>17)+r*s>>>15)+s*s,l=((4294901760&i)*i|0)+((65535&i)*i|0);a[n]=c^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),n.Rabbit)})),li((function(e,t){var n;e.exports=(n=rv,function(){var e=n,t=e.lib.StreamCipher,i=e.algo,r=[],o=[],a=[],s=i.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=l>>>16|4294901760&u,d=u<<16|65535&l;for(i[0]^=l,i[1]^=f,i[2]^=u,i[3]^=d,i[4]^=l,i[5]^=f,i[6]^=u,i[7]^=d,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),r[0]=n[0]^n[5]>>>16^n[3]<<16,r[1]=n[2]^n[7]>>>16^n[5]<<16,r[2]=n[4]^n[1]>>>16^n[7]<<16,r[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)r[i]=16711935&(r[i]<<8|r[i]>>>24)|4278255360&(r[i]<<24|r[i]>>>8),e[t+i]^=r[i]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var i=e[n]+t[n],r=65535&i,s=i>>>16,c=((r*r>>>17)+r*s>>>15)+s*s,l=((4294901760&i)*i|0)+((65535&i)*i|0);a[n]=c^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),n.RabbitLegacy)})),li((function(e,t){e.exports=rv}))),av=function(e){I(n,e);var t=M(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"WebStorageWrapper",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ph.sessionStorage;return V(this,n),(e=t.call(this,i))._decrypt=function(t,n,i){Lf.info("[".concat(e.name,"]: _decrypt"));var r=null;if(n||i){var o="".concat(null!=n?n:"","_").concat(null!=i?i:"");try{var a=ov.AES.decrypt(t,o).toString(ov.enc.Utf8),s=JSON.parse(a);(null==s?void 0:s.data)&&"number"==typeof(null==s?void 0:s.timestamp)&&(r=s)}catch(t){Lf.info("[".concat(e.name,"]: _decrypt - ").concat(t.message),t)}}return Lf.info("[".concat(e.name,"]: _decrypt - finish"),r),r},e._encrypt=function(t,n){Lf.info("[".concat(e.name,"]: _encrypt"));var i=null!=n?n:{},r=i.device_id,o=void 0===r?"":r,a=i.user_id,s=void 0===a?"":a,c="";if(o||s){var l="".concat(null!=o?o:"","_").concat(null!=s?s:"");c=ov.AES.encrypt(JSON.stringify(t),l).toString()}return c},e._encryptConsentStorage=function(t,n){var i;return x(i={},mh.ENTITIES,e._encrypt(t[mh.ENTITIES],n)),x(i,mh.COLLECTION_POINTS,JSON.stringify(t[mh.COLLECTION_POINTS])),i},e._setConsentWebStorage=function(t,n){var i=e._encryptConsentStorage(t,n);window[e._storageName].setItem(Zd,JSON.stringify(i))},e.insertConsentData=function(t,n,i){Lf.info("[".concat(e.name,"]: insertConsentData"),{data:t,timestamp:n,userInfo:i});try{var r=e.insertConsentDataIntoStore(t,n,i);e._setConsentWebStorage(r,i)}catch(t){throw Lf.error("[".concat(e.name,"]: insertConsentData - ").concat(t.message),t),t}},e.insertNotificationData=function(t,n,i){Lf.info("[".concat(e.name,"]: insertNotificationData"),{data:t,timestamp:n,userInfo:i});try{var r=e.getNotificationStore(i);e.insertDataByStorageName(r,mh.NOTIFICATIONS,t,n),window[e._storageName].setItem(Yd,JSON.stringify(r))}catch(t){throw Lf.error("[".concat(e.name,"]: insertNotificationData - ").concat(t.message),t),t}},e.getConsentStore=function(t){var n,i,r;Lf.info("[".concat(e.name,"]: getConsentStore"),{userInfo:t}),e.cleanUpUnrelatedUserData(t);var o=null!=t?t:{},a=o.device_id,s=void 0===a?"":a,c=o.user_id,l=void 0===c?"":c,u=bp(Xp),f=bp(Xp);try{var d=null!=(i=window[e._storageName].getItem(Zd))?i:"{}",h=null!=(r=JSON.parse(d))?r:{};u=e._retrieveEntitiesData(h,s,l),f=e._retrieveCollectionPointData(h)}catch(t){Lf.error("[".concat(e.name,"]: getConsentStore - ").concat(t.message),t)}return x(n={},mh.ENTITIES,u),x(n,mh.COLLECTION_POINTS,f),n},e.getNotificationStore=function(t){var n,i;Lf.info("[".concat(e.name,"]: getNotificationStore"),{userInfo:t});var r=bp(Xp);try{var o=null!=(n=window[e._storageName].getItem(Yd))?n:"{}";r=null!=(i=JSON.parse(o))?i:{}}catch(t){Lf.error("[".concat(e.name,"]: getNotificationStore - ").concat(t.message),t)}return x({},mh.NOTIFICATIONS,r)},e.cleanConsentData=function(){Lf.info("[".concat(e.name,"]: cleanConsentData")),window[e._storageName].removeItem(Zd)},e.cleanNotificationData=function(){Lf.info("[".concat(e.name,"]: cleanNotificationData")),window[e._storageName].removeItem(Yd)},e.clean=function(){window[e._storageName].removeItem(Zd),window[e._storageName].removeItem(Yd)},e.destruct=function(){e.clean()},e._storageName=r,e}return $(n,[{key:"_retrieveEntitiesData",value:function(e,t,n){var i=bp(Xp),r=this._decrypt(e[mh.ENTITIES],t,n);return r||i}},{key:"_retrieveCollectionPointData",value:function(e){var t=bp(Xp),n=null;try{n=JSON.parse(e[mh.COLLECTION_POINTS])}catch(e){Lf.info("[".concat(this.name,"]: _retrieveCollectionPointData - ").concat(e.message),e)}return n||t}}]),n}(Yp),sv=function(e){I(n,e);var t=M(n);function n(){return V(this,n),t.call(this,"LocalStorageWrapper",ph.localStorage)}return $(n)}(av),cv=function(e){I(n,e);var t=M(n);function n(){return V(this,n),t.call(this,"SessionStorageWrapper",ph.sessionStorage)}return $(n)}(av),lv=(x(r={},ph.inMem,nv),x(r,ph.localStorage,sv),x(r,ph.sessionStorage,cv),r),uv=function(){function e(){return V(this,e),e._instance||(e._instance=this),e._instance}return $(e,[{key:"init",value:function(e){Lf.info("[StorageModule]: init");var t=(null!=e?e:{}).storageType,n=void 0===t?ph.sessionStorage:t;n&&(Object.values(ph).includes(n)||Lf.error("[StorageModule]: init - Invalid Storage Type ".concat(n),{storageType:n}),this._setupStorage(n))}},{key:"getRecord",value:function(e,t){return Lf.info("[StorageModule]: getRecord",{key:e}),this._store.getRecord(e,t)}},{key:"getRecords",value:function(e,t){return Lf.info("[StorageModule]: getRecords",{keys:e}),this._store.getRecords(e,t)}},{key:"getEntity",value:function(e,t){return Lf.info("[StorageModule]: getEntity",{key:e}),this._store.getEntity(e,t)}},{key:"getEntities",value:function(e,t){return Lf.info("[StorageModule]: getEntities",{keys:e}),this._store.getEntities(e,t)}},{key:"getCollectionPoint",value:function(e,t){return Lf.info("[StorageModule]: getCollectionPoint",{collectionPointId:e}),this._store.getCollectionPoint(e,t)}},{key:"insertConsentData",value:function(e,t,n){Lf.info("[StorageModule]: insertConsentData",{data:e,timestamp:t});try{this._inMemStore.insertConsentData(e,t,n),this._store.insertConsentData(e,t,n)}catch(e){e instanceof DOMException&&"QuotaExceededError"===e.name?Lf.error("[StorageModule]: insertConsentData - Storage limit exceeded, switch to in mem storage",e):Lf.error("[StorageModule]: insertConsentData - Error",e),this._store.destruct(),this._store=this._inMemStore}}},{key:"getNotificationData",value:function(e){return Lf.info("[StorageModule]: getNotificationData",{userInfo:e}),this._store.getNotificationData(e)}},{key:"insertNotificationData",value:function(e,t,n){Lf.info("[StorageModule]: insertNotificationData",{data:e,timestamp:t});try{this._inMemStore.insertNotificationData(e,t,n),this._store.insertNotificationData(e,t,n)}catch(e){e instanceof DOMException&&"QuotaExceededError"===e.name?Lf.error("[StorageModule]: insertNotificationData - Storage limit exceeded, switch to in mem storage",e):Lf.error("[StorageModule]: insertNotificationData - Error",e),this._store.destruct(),this._store=this._inMemStore}}},{key:"_checkStorage",value:function(e){if(Lf.info("[StorageModule]: checkStorage",{storageType:e}),e===ph.inMem)return!0;try{var t=window[e].getItem(Zd);return t?(window[e].setItem(Zd,t),!0):(window[e].setItem(Zd,"{}"),window[e].removeItem(Zd),!0)}catch(e){return!1}}},{key:"_setupStorage",value:function(e){if(Lf.info("[StorageModule]: setupStorage",{storageType:e}),this._inMemStore=new nv,e&&this._checkStorage(e)){var t=lv[e];this._store=new t}else this._checkStorage(ph.sessionStorage)?this._store=new cv:this._checkStorage(ph.localStorage)?this._store=new sv:this._store=this._inMemStore}},{key:"clean",value:function(){Lf.info("[StorageModule]: clean"),this._store&&this._store.clean(),this._inMemStore&&this._inMemStore.clean()}},{key:"destruct",value:function(){Lf.info("[StorageModule]: destruct"),this.clean()}}]),e}(),fv=new uv,dv=function(e){return e.SDK_INIT="sdk_init",e.FETCH_DATA="fetch_data",e.SUBSCRIBE_EVENT="subscribe_event",e.UNSUBSCRIBE_EVENT="unsubscribe_event",e.GET_RECORD="get_record",e.FETCH_RECORD="fetch_record",e.GET_RECORDS="get_records",e.FETCH_RECORDS="fetch_records",e.GET_ENTITY="get_entity",e.FETCH_ENTITY="fetch_entity",e.GET_ENTITIES="get_entities",e.FETCH_ENTITIES="fetch_entities",e.FETCH_COLLECTION_POINT="fetch_collection_point",e.GET_COLLECTION_POINT="get_collection_point",e.UPDATE_RECORD="update_record",e.UPDATE_RECORDS_BY_COLLECTION_POINT="update_records_by_collection_point",e}(dv||{}),hv=(x(o={},"sdk_init","consent_init_sdk"),x(o,"fetch_data","consent_fetch_data"),x(o,"subscribe_event","consent_subscribe_event"),x(o,"unsubscribe_event","consent_unsubscribe_event"),x(o,"fetch_record","consent_fetch_record"),x(o,"fetch_records","consent_fetch_records"),x(o,"get_record","consent_get_record"),x(o,"get_records","consent_get_records"),x(o,"fetch_entity","consent_fetch_entity"),x(o,"fetch_entities","consent_fetch_entities"),x(o,"get_entity","consent_get_entity"),x(o,"get_entities","consent_get_entities"),x(o,"fetch_collection_point","consent_fetch_collection_point"),x(o,"get_collection_point","consent_get_collection_point"),x(o,"update_records_by_collection_point","consent_update_records_by_collection_point"),x(o,"update_record","consent_create_record_api"),o),pv=function(e){return e.USAGE_BEFORE_INIT="Usage before init",e.INVALID_PARAM="Invalid param",e.INVALID_USER_INFO="Empty user info",e.INVALID_RESPONSE="Invalid response",e.ENTITY_MAX_PAGE_SIZE="Max page size for entity is 20. If you need to fetch all, remove page size & page token settings",e}(pv||{}),vv=function(){function e(){V(this,e),this.userInfo={}}return $(e,[{key:"init",value:function(e){Lf.info("[BaseInfoModule]: init")}},{key:"getUserInfo",value:function(){return Lf.info("[BaseInfoModule]: getUserInfo"),this.userInfo}},{key:"setUserInfo",value:function(e){Lf.info("[BaseInfoModule]: setUserInfo"),this.userInfo=e}},{key:"fetchUserInfo",value:function(){return Lf.info("[BaseInfoModule]: fetchUserInfo"),Promise.resolve({})}}]),e}(),gv=function(){function e(){V(this,e)}return $(e,[{key:"getName",value:function(){return this.constructor.name}},{key:"getLifeCycleEvents",value:function(){var e=this;return Object.values(hh).filter((function(t){return"function"==typeof(null==e?void 0:e[t])}))}}]),e}(),mv=Object.defineProperty,_v=Object.getOwnPropertySymbols,yv=Object.prototype.hasOwnProperty,bv=Object.prototype.propertyIsEnumerable,Ev=function(e,t,n){return t in e?mv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},wv=function(e,t){for(var n in t||(t={}))yv.call(t,n)&&Ev(e,n,t[n]);if(_v){var i,r=F(_v(t));try{for(r.s();!(i=r.n()).done;){n=i.value;bv.call(t,n)&&Ev(e,n,t[n])}}catch(e){r.e(e)}finally{r.f()}}return e},kv=function(e,t){var n={};for(var i in e)yv.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&_v){var r,o=F(_v(e));try{for(o.s();!(r=o.n()).done;){i=r.value;t.indexOf(i)<0&&bv.call(e,i)&&(n[i]=e[i])}}catch(e){o.e(e)}finally{o.f()}}return n},Sv=Object.keys(hh).reduce((function(e,t){return e[hh[t]]={},e}),{}),xv=function(e){I(n,e);var t=M(n);function n(){var e;return V(this,n),(e=t.apply(this,arguments)).addEventListener=function(t,n,i){var r,o;Lf.info("[DefaultEventPlugin]: addEventListener"),(null==(o=null==(r=e._registeredCallbackMap)?void 0:r[t])?void 0:o[n])?Lf.error("[DefaultEventPlugin]: addEventListener - id for this event callback has been used"):e._registeredCallbackMap[t][n]=i},e.removeEventListener=function(t,n){var i,r;Lf.info("[DefaultEventPlugin]: removeEventListener"),(null==(r=null==(i=e._registeredCallbackMap)?void 0:i[t])?void 0:r[n])&&delete e._registeredCallbackMap[t][n]},e[Ep]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.beforeFetchUserInfo)),e._triggerEvent(hh.beforeFetchUserInfo,t)},e[wp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.afterFetchUserInfo)),e._triggerEvent(hh.afterFetchUserInfo,t)},e[kp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.beforeFetchConsentData)),e._triggerEvent(hh.beforeFetchConsentData,t)},e[Sp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.afterFetchConsentData)),e._triggerEvent(hh.afterFetchConsentData,t)},e[xp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.beforeFetchEntities)),e._triggerEvent(hh.beforeFetchEntities,t)},e[Tp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.afterFetchEntities)),e._triggerEvent(hh.afterFetchEntities,t)},e[Ap]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.beforeFetchCollectionPoint)),e._triggerEvent(hh.beforeFetchCollectionPoint,t)},e[zp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.afterFetchCollectionPoint)),e._triggerEvent(hh.afterFetchCollectionPoint,t)},e[Cp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.beforeFetchNotificationData)),e._triggerEvent(hh.beforeFetchNotificationData,t)},e[Dp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.afterFetchNotificationData)),e._triggerEvent(hh.afterFetchNotificationData,t)},e[Rp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.beforeUpdateRecords)),e._triggerEvent(hh.beforeUpdateRecords,t)},e[Op]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.afterUpdateRecords)),e._triggerEvent(hh.afterUpdateRecords,t)},e[Ip]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.beforeNotify)),e._triggerEvent(hh.beforeNotify,t)},e[Mp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.afterNotify)),e._triggerEvent(hh.afterNotify,t)},e[Pp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.beforeRemoveNotification)),e._triggerEvent(hh.beforeRemoveNotification,t)},e[Np]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.afterRemoveNotification)),e._triggerEvent(hh.afterRemoveNotification,t)},e[Up]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.beforeThirdPartyApprove)),e._triggerEvent(hh.beforeThirdPartyApprove,t)},e[Bp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.afterThirdPartyApprove)),e._triggerEvent(hh.afterThirdPartyApprove,t)},e[Gp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.beforeThirdPartyReject)),e._triggerEvent(hh.beforeThirdPartyReject,t)},e[Lp]=function(t){Lf.info("[DefaultEventPlugin]: ".concat(hh.afterThirdPartyReject)),e._triggerEvent(hh.afterThirdPartyReject,t)},e.destruct=function(){Object.keys(hh).forEach((function(t){var n=hh[t];Object.keys(e._registeredCallbackMap[n]).forEach((function(t){delete e._registeredCallbackMap[n][t]})),e._registeredCallbackMap[n]={}}))},e}return $(n,[{key:"init",value:function(){this._registeredCallbackMap=bp(Sv)}},{key:"_triggerEvent",value:function(e,t){return n=this,i=null,r=D().mark((function n(){var i;return D().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return Lf.info("[DefaultEventPlugin]: triggerEvent"),i=[],Object.values(this._registeredCallbackMap[e]).forEach((function(e){if("function"==typeof e){var n=t,r=n.plugin,o=kv(n,["plugin"]);i.push(e(wv({plugin:r},bp(o))))}})),n.prev=3,n.next=6,Promise.all(i);case 6:n.next=11;break;case 8:n.prev=8,n.t0=n.catch(3),Lf.warn("[DefaultEventPlugin]: plugin callback error",n.t0);case 11:case"end":return n.stop()}}),n,this,[[3,8]])})),new Promise((function(e,t){var o=function(e){try{s(r.next(e))}catch(e){t(e)}},a=function(e){try{s(r.throw(e))}catch(e){t(e)}},s=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(o,a)};s((r=r.apply(n,i)).next())}));var n,i,r}}]),n}(gv);Ep=hh.beforeFetchUserInfo,wp=hh.afterFetchUserInfo,kp=hh.beforeFetchConsentData,Sp=hh.afterFetchConsentData,xp=hh.beforeFetchEntities,Tp=hh.afterFetchEntities,Ap=hh.beforeFetchCollectionPoint,zp=hh.afterFetchCollectionPoint,Cp=hh.beforeFetchNotificationData,Dp=hh.afterFetchNotificationData,Rp=hh.beforeUpdateRecords,Op=hh.afterUpdateRecords,Ip=hh.beforeNotify,Mp=hh.afterNotify,Pp=hh.beforeRemoveNotification,Np=hh.afterRemoveNotification,Up=hh.beforeThirdPartyApprove,Bp=hh.afterThirdPartyApprove,Gp=hh.beforeThirdPartyReject,Lp=hh.afterThirdPartyReject;var Tv=xv;var Av=function(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(r);++i<r;)o[i]=e[i+t];return o},zv=/\s/;var Cv=function(e){for(var t=e.length;t--&&zv.test(e.charAt(t)););return t},Dv=/^\s+/;var Rv=function(e){return e?e.slice(0,Cv(e)+1).replace(Dv,""):e};var Ov=function(e){return"symbol"==J(e)||xr(e)&&"[object Symbol]"==wi(e)},Iv=/^[-+]0x[0-9a-f]+$/i,Mv=/^0b[01]+$/i,Pv=/^0o[0-7]+$/i,Nv=parseInt;var Uv=function(e){if("number"==typeof e)return e;if(Ov(e))return NaN;if(ki(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ki(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Rv(e);var n=Mv.test(e);return n||Pv.test(e)?Nv(e.slice(2),n?2:8):Iv.test(e)?NaN:+e},Bv=1/0;var Gv=function(e){return e?(e=Uv(e))===Bv||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var Lv=function(e){var t=Gv(e),n=t%1;return t==t?n?t-n:t:0},jv=Math.ceil,Fv=Math.max;var Kv=function(e,t,n){t=(n?ko(e,t,n):void 0===t)?1:Fv(Lv(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var r=0,o=0,a=Array(jv(i/t));r<i;)a[o++]=Av(e,r,r+=t);return a},Hv=function(e,t){return t?new Error("".concat(e,": ").concat(JSON.stringify(t))):new Error(e)},Vv=Object.defineProperty,qv=Object.defineProperties,$v=Object.getOwnPropertyDescriptors,Jv=Object.getOwnPropertySymbols,Wv=Object.prototype.hasOwnProperty,Xv=Object.prototype.propertyIsEnumerable,Zv=function(e,t,n){return t in e?Vv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Yv=function(e,t){for(var n in t||(t={}))Wv.call(t,n)&&Zv(e,n,t[n]);if(Jv){var i,r=F(Jv(t));try{for(r.s();!(i=r.n()).done;){n=i.value;Xv.call(t,n)&&Zv(e,n,t[n])}}catch(e){r.e(e)}finally{r.f()}}return e},Qv=function(e,t){return qv(e,$v(t))},eg=function(e,t,n){return new Promise((function(i,r){var o=function(e){try{s(n.next(e))}catch(e){r(e)}},a=function(e){try{s(n.throw(e))}catch(e){r(e)}},s=function(e){return e.done?i(e.value):Promise.resolve(e.value).then(o,a)};s((n=n.apply(e,t)).next())}))},tg={fetchEntities:{},fetchCollectionPoint:{},updateRecords:{}},ng=function(){function e(){var t=this;V(this,e),this._validateStatus=function(e){return Object.keys(gh).map((function(e){return gh[e]})).includes(e)},this._validateEntityKeys=function(e){return(null==e?void 0:e.length)>0&&e.every((function(e){return!!t._validateEntityKey(e)}))},this._validateEntityKey=function(e){return/^(conditions|permissions|data)/.test(e)},this._validateUserInfo=function(e){if(!(null==e?void 0:e.user_id)&&!(null==e?void 0:e.device_id))throw Lf.error("[ConsentModule]: updateRecords - invalid user info"),Hv(pv.INVALID_USER_INFO)},this._validateUpdateParam=function(e){return(null==e?void 0:e.length)>0&&e.every((function(e){if(!e)return!1;var n=e.key,i=e.status;return!!/^(conditions|permissions|data)/.test(n)&&!!t._validateStatus(i)}))},this._formatExtra=function(e,n){var i={};try{var r=JSON.parse(null!=n?n:"");i=Yv({},r)}catch(e){}return t._debug&&(i=Qv(Yv({},i),{appId:t._appId,domain:e||t._domain,tenant:t._tenant,path:"/consent/api/record/create/v2",debug:!0,vregion:t._vregion})),JSON.stringify(i)},this.destruct=function(){Lf.info("[ConsentModule]: destruct")}}return $(e,[{key:"_getAPIConfig",value:function(e){var t,n,i={};return(null==(t=this._config)?void 0:t[e])&&(i="function"==typeof this._config[e]?this._config[e]():null!=(n=this._config[e])?n:{}),i}},{key:"init",value:function(e){Lf.info("[ConsentModule]: init");var t=null!=e?e:{},n=t.api,i=t.appId,r=t.debug,o=t.domain,a=t.tenant,s=t.region;this._appId=i,this._debug=null!=r&&r,this._domain=o,this._tenant=a,this._vregion=null!=s?s:Qd.SINGAPORE_CENTRAL;var c=(null!=n?n:{}).consent;this._config=Kp({},c,tg)}},{key:"getRecord",value:function(e,t){return Lf.info("[ConsentModule]: getRecord",{entityKey:e,userInfo:t}),fv.getRecord(e,t)}},{key:"getRecords",value:function(e,t){return Lf.info("[ConsentModule]: getRecords",{entityKeys:e,userInfo:t}),fv.getRecords(e,t)}},{key:"getEntity",value:function(e,t){return Lf.info("[ConsentModule]: getEntity",{entityKey:e,userInfo:t}),fv.getEntity(e,t)}},{key:"getEntities",value:function(e,t){return Lf.info("[ConsentModule]: getEntities",{entityKeys:e,userInfo:t}),fv.getEntities(e,t)}},{key:"fetchEntities",value:function(e,t){return eg(this,null,D().mark((function n(){var i,r,o,a,s,c,l,u,f,d=this;return D().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(Lf.info("[ConsentModule]: fetchEntities",{entityKeys:e,userInfo:t}),this._validateUserInfo(t),this._validateEntityKeys(e)){n.next=4;break}throw Hv(pv.INVALID_PARAM,{entityKeys:e});case 4:if(Lf.reportCUJ(dv.FETCH_ENTITIES,Do.IN_PROGRESS,{stepName:"api"}),i=this._getAPIConfig("fetchEntities"),r=i.domain,o=void 0===r?"":r,a=i.timeout,s=i.requestConfig,!((c=i.pageSize)&&c>20)){n.next=8;break}throw Hv(pv.ENTITY_MAX_PAGE_SIZE);case 8:return l={entityMap:{},collectionPoint:null},u=(new Date).getTime(),f=(c?Kv(e,c):[e]).map((function(e){return Lf.reportCUJ(dv.FETCH_ENTITIES,Do.IN_PROGRESS,{stepName:"pagination_api"}),d._fetchEntitiesWithPagination(e,t,o,c,a,"",s).then((function(t){var n,i,r=null!=(n=null==t?void 0:t.data)?n:{},o=r.data,a=r.status_code,s=r.status_msg,c=r.extra;if(0!==a)throw Hv(pv.INVALID_RESPONSE,{entityKey:e,statusCode:a,statusMessage:s});Lf.reportCUJ(dv.FETCH_ENTITIES,Do.IN_PROGRESS,{stepName:"pagination_api_finish"});var f=null==(i=null==o?void 0:o.reduce)?void 0:i.call(o,(function(e,t){var n=(null!=t?t:{}).key;return n&&(e[n]=t),e}),{});l.entityMap=Yv(Yv({},l.entityMap),null!=f?f:{}),(null==c?void 0:c.now)&&u<c.now&&(u=c.now)})).catch((function(e){throw Lf.error("[ConsentModule]: fetchEntities - fail to fetch",e),e}))})),n.abrupt("return",Promise.all(f).then((function(e){return Lf.reportCUJ(dv.FETCH_ENTITIES,Do.IN_PROGRESS,{stepName:"api_finish"}),fv.insertConsentData(l,u,t),Lf.reportCUJ(dv.FETCH_ENTITIES,Do.IN_PROGRESS,{stepName:"storage"}),l})).catch((function(e){throw Lf.error("[ConsentModule]: fetch - fail to fetch",e),e})));case 12:case"end":return n.stop()}}),n,this)})))}},{key:"getCollectionPoint",value:function(e,t){return Lf.info("[ConsentModule]: getCollectionPoint",{collectionPointId:e,userInfo:t}),fv.getCollectionPoint(e,t)}},{key:"fetchCollectionPoint",value:function(e,t){return eg(this,null,D().mark((function n(){var i,r,o,a,s;return D().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(Lf.info("[ConsentModule]: fetchCollectionPoint",{collectionPointId:e,userInfo:t}),this._validateUserInfo(t),e){n.next=4;break}throw Hv(pv.INVALID_PARAM,{collectionPointId:e});case 4:return Lf.reportCUJ(dv.FETCH_COLLECTION_POINT,Do.IN_PROGRESS,{stepName:"api"}),i=this._getAPIConfig("fetchCollectionPoint"),r=i.domain,o=void 0===r?"":r,a=i.timeout,s=i.requestConfig,n.abrupt("return",dh.sendRequest("".concat(o,"/consent/api/collection-point-records/list/v1"),"POST",{collection_point_id:e},Qv(Yv({},s),{timeout:a,params:Yv({},t)})).then((function(n){var i,r,o,a=null!=(i=null==n?void 0:n.data)?i:{},s=a.data,c=void 0===s?[]:s,l=a.collection_point,u=void 0===l?null:l,f=a.status_code,d=a.status_msg,h=a.extra;if(0===f){Lf.reportCUJ(dv.FETCH_COLLECTION_POINT,Do.IN_PROGRESS,{stepName:"api_finish"});var p=null;return u&&(p=null!=(r=null==c?void 0:c.reduce((function(e,t){var n=(null!=t?t:{}).key;return n&&(e[n]=t),e}),{}))?r:null,fv.insertConsentData({entityMap:p,collectionPoint:u},null!=(o=null==h?void 0:h.now)?o:Date.now(),t),Lf.reportCUJ(dv.FETCH_COLLECTION_POINT,Do.IN_PROGRESS,{stepName:"storage"})),{collectionPoint:u,entityMap:p}}throw Hv(pv.INVALID_RESPONSE,{collectionPointId:e,statusCode:f,statusMessage:d})})).catch((function(e){throw Lf.error("[ConsentModule]: fetchCollectionPoint - fail to fetch",e),e})));case 7:case"end":return n.stop()}}),n,this)})))}},{key:"getEntitiesWithApprovedRecord",value:function(e,t){Lf.info("[ConsentModule]: getEntitiesWithApprovedRecord",{entityKeys:e,userInfo:t});var n=fv.getEntities(e,t).entityMap;if(n){var i=Object.keys(n).map((function(e){var t,i=n[e];return(null==(t=null==i?void 0:i.record)?void 0:t.status)===vh.APPROVE?i:null})).filter((function(e){return e}));return i}return[]}},{key:"shouldFetch",value:function(){return Lf.info("[ConsentModule]: shouldFetch"),!0}},{key:"_fetchEntitiesWithPagination",value:function(e,t,n,i,r,o,a){return dh.sendRequest("".concat(n,"/consent/api/combine/list/v3"),"POST",Yv({entity_keys:e},i?{page_size:i,page_token:null!=o?o:""}:{}),Qv(Yv({},a),{timeout:r,params:Yv({},t)}))}},{key:"updateRecords",value:function(e,t){return eg(this,null,D().mark((function n(){var i,r,o,a,s,c,l,u=this;return D().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(Lf.info("[ConsentModule]: updateRecords"),this._validateUserInfo(t),this._validateUpdateParam(e)){n.next=5;break}throw Lf.error("[ConsentModule]: updateRecords - invalid param",{params:e}),Hv(pv.INVALID_PARAM,{params:e});case 5:return Lf.reportCUJ(dv.UPDATE_RECORD,Do.IN_PROGRESS,{stepName:"api"}),i=this._getAPIConfig("updateRecords"),r=i.domain,o=void 0===r?"":r,a=i.timeout,s=i.requestConfig,c=e.map((function(e){return e.key})),l=e.map((function(e){var t;return{entity_key:e.key,status:e.status,coll_point_id:e.collectionPointId,extra:u._formatExtra(o,null!=(t=e.extra)?t:"")}})),n.abrupt("return",dh.sendRequest("".concat(o,"/consent/api/record/create/v2"),"POST",{records:l},Qv(Yv({},null!=s?s:{}),{timeout:a,params:Yv({},t)})).then((function(n){var i,r=null!=(i=null==n?void 0:n.data)?i:{},a=r.status_code,s=r.status_msg,l=r.extra,f=void 0===l?{now:Date.now()}:l;if(0===a){if(Lf.reportCUJ(dv.UPDATE_RECORD,Do.IN_PROGRESS,{stepName:"api_finish"}),e.length){var d=e.reduce((function(e,t){var n;return e[t.key]={key:t.key,record:{entity_key:t.key,status:_h[t.status],extra:u._formatExtra(o,t.extra),coll_point_id:t.collectionPointId,app_id:u._appId,created_at:null!=(n=null==f?void 0:f.now)?n:Date.now()}},e}),{});fv.insertConsentData({entityMap:d,collectionPoint:null},f.now,t),Lf.reportCUJ(dv.UPDATE_RECORD,Do.IN_PROGRESS,{stepName:"storage"})}return fv.getEntities(c,t)}throw Hv(pv.INVALID_RESPONSE,{params:e,statusCode:a,statusMessage:s})})).catch((function(e){throw Lf.error("[ConsentModule]: updateRecords - fail to create records",e),e})));case 10:case"end":return n.stop()}}),n,this)})))}}]),e}(),ig=ng,rg=function(){function e(){V(this,e)}return $(e,[{key:"init",value:function(e){}},{key:"getData",value:function(){return null}},{key:"shouldNotify",value:function(e){return!0}},{key:"notify",value:function(e){}},{key:"canNotificationBeRemoved",value:function(e){return!1}},{key:"removeNotification",value:function(e){}},{key:"shouldFetch",value:function(){return!0}},{key:"fetch",value:function(){return Promise.resolve(null)}},{key:"destruct",value:function(){}}]),e}(),og=Object.defineProperty,ag=Object.defineProperties,sg=Object.getOwnPropertyDescriptors,cg=Object.getOwnPropertySymbols,lg=Object.prototype.hasOwnProperty,ug=Object.prototype.propertyIsEnumerable,fg=function(e,t,n){return t in e?og(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},dg=function(e,t){for(var n in t||(t={}))lg.call(t,n)&&fg(e,n,t[n]);if(cg){var i,r=F(cg(t));try{for(r.s();!(i=r.n()).done;){n=i.value;ug.call(t,n)&&fg(e,n,t[n])}}catch(e){r.e(e)}finally{r.f()}}return e},hg=function(e,t){return ag(e,sg(t))},pg=function(e,t,n){return new Promise((function(i,r){var o=function(e){try{s(n.next(e))}catch(e){r(e)}},a=function(e){try{s(n.throw(e))}catch(e){r(e)}},s=function(e){return e.done?i(e.value):Promise.resolve(e.value).then(o,a)};s((n=n.apply(e,t)).next())}))},vg=function(){function e(){var t=this;return V(this,e),this._thirdPartyMap={},this._cleanUpPlugins=function(){t._pluginsMap&&Object.keys(t._pluginsMap).forEach((function(e){var n=e,i=t._pluginsMap[n];(null==i?void 0:i.length)&&(i.forEach((function(e){var t;null==(t=null==e?void 0:e.destruct)||t.call(e)})),delete t._pluginsMap[n])})),t._defaultPlugin=null},this.dispatch=function(e,n){return pg(t,null,D().mark((function t(){var i,r,o;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Lf.info("[LifeCycleModule]: dispatch start"),!this._currentEvent.has(e)){t.next=4;break}return Lf.error("[LifeCycleModule]: Dispatch is already in process",{currentEvent:C(this._currentEvent),upcomingEvent:e}),t.abrupt("return");case 4:return this._currentEvent.add(e),r=null==(i=this._pluginsMap)?void 0:i[e],o=[],(null==r?void 0:r.length)&&r.forEach((function(t){var i;(null==t?void 0:t[e])&&"function"==typeof t[e]&&o.push(null==(i=null==t?void 0:t[e])?void 0:i.call(t,{name:e,data:bp(n),plugin:t}))})),t.prev=8,t.next=11,Promise.all(o);case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(8),Lf.warn("[LifeCycleModule]: plugin callback error",t.t0);case 16:this._currentEvent.delete(e),Lf.info("[LifeCycleModule]: dispatch finish");case 18:case"end":return t.stop()}}),t,this,[[8,13]])})))},this._dispatchAfterEvent=function(e,n){Lf.info("[LifeCycleModule]: dispatchAfterEvent"),n instanceof Promise?n.then((function(n){t.dispatch(e,n)})).catch((function(n){t.dispatch(e,n)})):t.dispatch(e,n)},this.addEventListener=function(e,n,i){var r;null==(r=t._defaultPlugin)||r.addEventListener(e,n,i)},this.removeEventListener=function(e,n){var i;null==(i=t._defaultPlugin)||i.removeEventListener(e,n)},e._instance||(e._instance=this),e._instance}return $(e,[{key:"init",value:function(e){var t,n;Lf.info("[LifeCycleModule]: init"),this._entityKeys=null!=(t=e.entityKeys)?t:[],this._collectionPointId=null!=(n=e.collectionPointId)?n:"",this._entityKeys.length||this._collectionPointId||Lf.warn("[LifeCycleModule]: no entityKeys or collectionPointId provided"),this._currentEvent=new Set,this._initPlugins(e),this._initModules(e),this._registerThirdParties(e)}},{key:"_initModules",value:function(e){var t,n;if(Lf.info("[LifeCycleModule]: initModules"),this._consentModule=new ig,this._consentModule.init(e),(null==(t=null==e?void 0:e.modules)?void 0:t.notification)&&(e.modules.notification instanceof rg?(this._notificationModule=e.modules.notification,this._notificationModule.init(e)):Lf.warn("[LifeCycleModule]: initModules - incorrect implementation of NotificationModule, will skip")),null==(n=null==e?void 0:e.modules)?void 0:n.info)if(e.modules.info instanceof vv)this._infoModule=e.modules.info,this._infoModule.init(e);else{Lf.error("[LifeCycleModule]: initModules - incorrect implementation of InfoModule")}else{Lf.error("[LifeCycleModule]: initModules - info module is required")}}},{key:"_initPlugins",value:function(e){var t,n=this;Lf.info("[LifeCycleModule]: initPlugins"),this._cleanUpPlugins(),this._pluginsMap=Object.values(hh).reduce((function(e,t){return e[t]=[],e}),{}),this._defaultPlugin=new Tv;var i=[this._defaultPlugin];(null==(t=e.plugins)?void 0:t.length)&&(i=i.concat(e.plugins));var r=new Set;i.forEach((function(e,t){var i;null==(i=e.init)||i.call(e),n._registerPlugin(e,t,r)}))}},{key:"_registerPlugin",value:function(e,t,n){var i,r,o,a=this,s=null==(i=null==e?void 0:e.getName)?void 0:i.call(e);if(s)if(n.has(s))Lf.error("[LifeCycleModule]: registerPlugin - Duplicate Plugin ".concat(s,"."),{index:t,pluginName:s,plugin:e});else if(e instanceof gv){Lf.info("[LifeCycleModule]: registerPlugin ".concat(s," start"));var c=null==(o=null==(r=e.getLifeCycleEvents)?void 0:r.call(e))?void 0:o.filter((function(e){return e in hh}));(null==c?void 0:c.length)&&c.forEach((function(t){a._pluginsMap[t].push(e)})),Lf.info("[LifeCycleModule]: registerPlugin ".concat(s," finish"),{plugin:s,events:c})}else Lf.error("[LifeCycleModule]: registerPlugin - ".concat(s," incorrectly implements of Plugin."),{index:t,pluginName:s,plugin:e});else Lf.error("[LifeCycleModule]: registerPlugin - Plugin on index ".concat(t," is an invalid Plugin. Plugin should always have a unique name"),{index:t,plugin:e})}},{key:"_registerThirdParties",value:function(e){var t,n,i;Lf.info("[LifeCycleModule]: registerThirdParties");var r=(null!=(t=null==e?void 0:e.modules)?t:{}).thirdParties;this._thirdPartyMap=null!=(i=null==(n=null==r?void 0:r.reduce)?void 0:n.call(r,(function(e,t){var n,i=F(t.getRelatedEntities());try{for(i.s();!(n=i.n()).done;){var r=n.value;e[r]?e[r].push(t):e[r]=[t]}}catch(e){i.e(e)}finally{i.f()}return e}),{}))?i:{}}},{key:"_initThirdParties",value:function(e){var t,n,i=this;Lf.info("[LifeCycleModule]: initThirdParties");var r=e.entityMap;if(r&&(null==(t=Object.values(r))?void 0:t.length)){var o=new Set,a=new Set;if(Object.values(r).forEach((function(e){var t,n=null==(t=i._thirdPartyMap)?void 0:t[null==e?void 0:e.key];(null==n?void 0:n.length)&&n.forEach((function(e){if(e){var t=e.getRelatedEntities();(null==t?void 0:t.length)&&(t.forEach((function(e){o.add(e)})),a.add(e))}}))})),a.size){var s,c=this._getUserInfo(),l=(null!=(n=this._consentModule.getEntitiesWithApprovedRecord(C(o),c))?n:[]).reduce((function(e,t){return e[t.key]=t,e}),{}),u=F(a);try{for(u.s();!(s=u.n()).done;){s.value.initThirdPartyModule(l,this.dispatch,this._dispatchAfterEvent)}}catch(e){u.e(e)}finally{u.f()}}}}},{key:"fetch",value:function(e){return pg(this,null,D().mark((function t(){var n,i,r,o,a,s,c,l,u;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Lf.info("[LifeCycleModule]: fetch"),t.prev=1,t.next=4,this.fetchUserInfo();case 4:return i=[this.shouldFetchConsentData()?this.fetchConsentData({collectionPointId:this._collectionPointId,entityKeys:this._entityKeys}):Promise.resolve({}),this.shouldFetchNotificationData()?this.fetchNotificationData(null==e?void 0:e.notificationParam):Promise.resolve({})],t.next=7,Promise.all(i);case 7:return r=t.sent,o=z(r,2),a=o[0],s=o[1],l=(c=null!=a?a:{}).entityMap,u=c.collectionPoint,l&&(null==(n=Object.keys(l))?void 0:n.length)&&this._initThirdParties(a),s&&this._triggerNotification({notificationData:s,relatedEntityMap:l,collectionPoint:u}),t.abrupt("return",hg(dg({},a),{notificationData:s}));case 17:return t.prev=17,t.t0=t.catch(1),Lf.error("[LifeCycleModule]: fetch failure",t.t0),t.abrupt("return",{entityMap:null,notificationData:null,collectionPoint:null});case 21:case"end":return t.stop()}}),t,this,[[1,17]])})))}},{key:"fetchUserInfo",value:function(){return pg(this,null,D().mark((function e(){var t,n,i,r,o;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Lf.info("[LifeCycleModule]: fetchUserInfo"),this.dispatch(hh.beforeFetchUserInfo),o={},e.prev=3,e.next=6,null!=(n=null==(t=this._infoModule)?void 0:t.fetchUserInfo())?n:Promise.resolve({});case 6:if(e.t0=i=e.sent,null==e.t0){e.next=11;break}e.t1=i,e.next=12;break;case 11:e.t1={};case 12:o=e.t1,null==(r=this._infoModule)||r.setUserInfo(o),e.next=19;break;case 16:e.prev=16,e.t2=e.catch(3),Lf.error("[LifeCycleModule]: fetchUserInfo - error",e.t2);case 19:return this.dispatch(hh.afterFetchUserInfo,{userInfo:o}),e.abrupt("return",o);case 21:case"end":return e.stop()}}),e,this,[[3,16]])})))}},{key:"_getUserInfo",value:function(){var e,t;return Lf.info("[LifeCycleModule]: _getUserInfo"),null!=(t=null==(e=this._infoModule)?void 0:e.getUserInfo())?t:{}}},{key:"shouldFetchConsentData",value:function(){var e,t;return Lf.info("[LifeCycleModule]: shouldFetchConsentData"),null!=(t=null==(e=this._consentModule)?void 0:e.shouldFetch())&&t}},{key:"shouldFetchNotificationData",value:function(){var e,t,n;return Lf.info("[LifeCycleModule]: shouldFetchNotificationData"),this._notificationModule?null!=(n=null==(t=null==(e=this._notificationModule)?void 0:e.shouldFetch)?void 0:t.call(e))&&n:(Lf.info("[LifeCycleModule]: no notification module"),!1)}},{key:"fetchNotificationData",value:function(){for(var e,t,n,i=this,r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return Lf.info("[LifeCycleModule]: fetchNotificationData"),this._notificationModule?(this.dispatch(hh.beforeFetchNotificationData,{notificationParams:o}),null==(n=null==(t=this._notificationModule)?void 0:t.fetch)?void 0:(e=n).call.apply(e,[t].concat(o)).then((function(e){var t=(null!=e?e:{}).data;return i.dispatch(hh.afterFetchNotificationData,{notificationParams:o,data:t}),t})).catch((function(e){Lf.error("[LifeCycleModule]: fetchNotificationData failure",e),i.dispatch(hh.afterFetchNotificationData,{notificationParams:o,data:null,error:e})}))):(Lf.info("[LifeCycleModule]: no notification module"),Promise.resolve(null))}},{key:"getNotificationData",value:function(){return Lf.info("[LifeCycleModule]: getNotificationData"),this._notificationModule?this._notificationModule.getData():(Lf.info("[LifeCycleModule]: no notification module"),null)}},{key:"removeNotification",value:function(e){if(Lf.info("[LifeCycleModule]: removeNotification"),this._notificationModule){if(this._notificationModule.canNotificationBeRemoved(e)){this.dispatch(hh.beforeRemoveNotification,e);var t=this._notificationModule.removeNotification(e);this._dispatchAfterEvent(hh.afterRemoveNotification,t)}}else Lf.info("[LifeCycleModule]: no notification module")}},{key:"notify",value:function(e){var t=e,n=t.relatedEntityKeys,i=void 0===n?[]:n,r=function(e,t){var n={};for(var i in e)lg.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&cg){var r,o=F(cg(e));try{for(o.s();!(r=o.n()).done;)i=r.value,t.indexOf(i)<0&&ug.call(e,i)&&(n[i]=e[i])}catch(e){o.e(e)}finally{o.f()}}return n}(t,["relatedEntityKeys"]);if(Lf.info("[LifeCycleModule]: notify"),this._notificationModule){var o=this.getEntities(i).entityMap;this._triggerNotification(dg({relatedEntityKeys:i,notificationData:this.getNotificationData(),relatedEntityMap:o},r))}else Lf.info("[LifeCycleModule]: no notification module")}},{key:"_triggerNotification",value:function(e){if(Lf.info("[LifeCycleModule]: triggerNotification"),this._notificationModule){if(this._notificationModule.shouldNotify(e)){this.dispatch(hh.beforeNotify,e);var t=this._notificationModule.notify(e);this._dispatchAfterEvent(hh.afterNotify,t)}}else Lf.info("[LifeCycleModule]: no notification module")}},{key:"fetchConsentData",value:function(e){var t=this,n=e.collectionPointId,i=e.entityKeys;Lf.info("[LifeCycleModule]: fetchConsentData"),this.dispatch(hh.beforeFetchConsentData,{entityKeys:i,collectionPointId:n});var r=Promise.resolve({entityMap:null,collectionPoint:null});return n?r=this.fetchCollectionPoint(n):i&&(r=this.fetchEntities(i)),r.then((function(e){return t.dispatch(hh.afterFetchConsentData,{entityKeys:i,collectionPointId:n,data:e}),e})).catch((function(e){return Lf.error("[LifeCycleModule]: fetchConsentData failure",e),t.dispatch(hh.afterFetchConsentData,{entityKeys:i,collectionPointId:n,data:{entityMap:null,collectionPoint:null},error:e}),{entityMap:null,collectionPoint:null,error:e}}))}},{key:"getConsentRecord",value:function(e){Lf.info("[LifeCycleModule]: getConsentRecord",{entityKey:e});var t=this._getUserInfo();return this._consentModule.getRecord(e,t)}},{key:"getConsentRecords",value:function(e){var t;Lf.info("[LifeCycleModule]: getConsentRecords",{entityKeys:e});var n=this._getUserInfo();return null!=(t=this._consentModule.getRecords(e,n))?t:[]}},{key:"getEntity",value:function(e){Lf.info("[LifeCycleModule]: getEntity",{entityKey:e});var t=this._getUserInfo();return this._consentModule.getEntity(e,t)}},{key:"getEntities",value:function(e){Lf.info("[LifeCycleModule]: getEntities",{entityKeys:e});var t=this._getUserInfo();return this._consentModule.getEntities(e,t)}},{key:"fetchEntities",value:function(e){var t=this;Lf.info("[LifeCycleModule]: fetchEntities"),this.dispatch(hh.beforeFetchEntities,{entityKeys:e});var n=this._getUserInfo();return this._consentModule.fetchEntities(e,n).then((function(n){return t.dispatch(hh.afterFetchEntities,{entityKeys:e,data:n}),n})).catch((function(n){throw Lf.error("[LifeCycleModule]: fetchEntities failure",n),t.dispatch(hh.afterFetchEntities,{entityKeys:e,data:null,error:n}),n}))}},{key:"getCollectionPoint",value:function(e){Lf.info("[LifeCycleModule]: getCollectionPoint",{collectionPointId:e});var t=this._getUserInfo();return this._consentModule.getCollectionPoint(e,t)}},{key:"fetchCollectionPoint",value:function(e){var t=this;Lf.info("[LifeCycleModule]: fetchByCollectionPoint"),this.dispatch(hh.beforeFetchCollectionPoint,{collectionPointId:e});var n=this._getUserInfo();return this._consentModule.fetchCollectionPoint(e,n).then((function(n){return t.dispatch(hh.afterFetchCollectionPoint,{collectionPointId:e,data:n}),n})).catch((function(n){throw Lf.error("[LifeCycleModule]: fetchByCollectionPoint failure",n),t.dispatch(hh.afterFetchCollectionPoint,{collectionPointId:e,data:null,error:n}),n}))}},{key:"updateConsentRecords",value:function(e){return pg(this,null,D().mark((function t(){var n,i;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Lf.info("[LifeCycleModule]: updateConsentRecords",{params:e}),this.dispatch(hh.beforeUpdateRecords,{params:e}),n={entityMap:null,collectionPoint:null},i=this._getUserInfo(),t.prev=4,t.next=7,this._consentModule.updateRecords(e,i);case 7:n=t.sent,this.dispatch(hh.afterUpdateRecords,{data:n}),t.next=16;break;case 11:throw t.prev=11,t.t0=t.catch(4),Lf.error("[LifeCycleModule]: updateConsentRecords",t.t0),this.dispatch(hh.afterUpdateRecords,{params:e,data:n,error:t.t0}),t.t0;case 16:return this._initThirdParties(n),t.abrupt("return",n);case 18:case"end":return t.stop()}}),t,this,[[4,11]])})))}},{key:"destruct",value:function(){this._cleanUpPlugins(),Lf.info("[LifeCycleModule]: destruct")}}]),e}(),gg=new vg,mg=function(e){return hv[e]},_g=function(e,t,n){return new Promise((function(i,r){var o=function(e){try{s(n.next(e))}catch(e){r(e)}},a=function(e){try{s(n.throw(e))}catch(e){r(e)}},s=function(e){return e.done?i(e.value):Promise.resolve(e.value).then(o,a)};s((n=n.apply(e,t)).next())}))},yg={appId:-1,domain:"",tenant:"",entityKeys:[],mode:eh.PRODUCTION,isPPE:!1,debug:!1,fetchDataAtInit:!0,region:Qd.SINGAPORE_CENTRAL,storageType:ph.sessionStorage,modules:{info:new vv}},bg=function(){function e(){var t=this;return V(this,e),this._isInitialized=!1,this._validateInitStatus=function(){return!!t._isInitialized||(console.error("[SDK]: SDK is used before init"),!1)},this.getConsentRecord=function(e){if(!t._validateInitStatus())return{record:null,error:Hv(pv.USAGE_BEFORE_INIT)};Lf.reportCUJ(dv.GET_RECORD,Do.START);try{Lf.info("[SDK]: getConsentRecord",{entityKey:e});var n=gg.getConsentRecord(e);return Lf.reportCUJ(dv.GET_RECORD,Do.FINISH),n}catch(e){return Lf.reportCUJ(dv.GET_RECORD,Do.FAILURE,{error:e}),{record:null,error:e}}},this.getConsentRecords=function(e){if(!t._validateInitStatus())return{records:[],error:Hv(pv.USAGE_BEFORE_INIT)};Lf.reportCUJ(dv.GET_RECORDS,Do.START);try{Lf.info("[SDK]: getConsentRecords",{entityKeys:e});var n=gg.getConsentRecords(e);return Lf.reportCUJ(dv.GET_RECORDS,Do.FINISH),n}catch(e){return Lf.reportCUJ(dv.GET_RECORDS,Do.FAILURE,{error:e}),{records:[],error:e}}},this.getEntity=function(e){if(!t._validateInitStatus())return{entity:null,error:Hv(pv.USAGE_BEFORE_INIT)};Lf.reportCUJ(dv.GET_ENTITY,Do.START);try{Lf.info("[SDK]: getEntity",{entityKey:e});var n=gg.getEntity(e);return Lf.reportCUJ(dv.GET_ENTITY,Do.FINISH),n}catch(e){return Lf.reportCUJ(dv.GET_ENTITY,Do.FAILURE,{error:e}),{entity:null,error:e}}},this.getEntities=function(e){if(!t._validateInitStatus())return{collectionPoint:null,entityMap:null,error:Hv(pv.USAGE_BEFORE_INIT)};Lf.reportCUJ(dv.GET_ENTITIES,Do.START);try{Lf.info("[SDK]: getEntities",{entityKeys:e});var n=gg.getEntities(e);return Lf.reportCUJ(dv.GET_ENTITIES,Do.FINISH),n}catch(e){return Lf.reportCUJ(dv.GET_ENTITIES,Do.FAILURE,{error:e}),{collectionPoint:null,entityMap:null,error:e}}},this.fetchEntities=function(e){return _g(t,null,D().mark((function t(){var n;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._validateInitStatus()){t.next=2;break}return t.abrupt("return",{collectionPoint:null,entityMap:null,error:Hv(pv.USAGE_BEFORE_INIT)});case 2:return Lf.reportCUJ(dv.FETCH_ENTITIES,Do.START),t.prev=3,Lf.info("[SDK]: fetchEntities",{entityKeys:e}),t.next=7,gg.fetchEntities(e);case 7:return n=t.sent,Lf.reportCUJ(dv.FETCH_ENTITIES,Do.FINISH),t.abrupt("return",n);case 12:return t.prev=12,t.t0=t.catch(3),Lf.reportCUJ(dv.FETCH_ENTITIES,Do.FAILURE,{error:t.t0}),t.abrupt("return",{collectionPoint:null,entityMap:null,error:t.t0});case 16:case"end":return t.stop()}}),t,this,[[3,12]])})))},this.getCollectionPoint=function(e){if(!t._validateInitStatus())return{collectionPoint:null,entityMap:null,error:Hv(pv.USAGE_BEFORE_INIT)};Lf.reportCUJ(dv.GET_COLLECTION_POINT,Do.START);try{Lf.info("[SDK]: getCollectionPoint",{collectionPointId:e});var n=gg.getCollectionPoint(e);return Lf.reportCUJ(dv.GET_COLLECTION_POINT,Do.FINISH),n}catch(e){return Lf.reportCUJ(dv.GET_COLLECTION_POINT,Do.FAILURE,{error:e}),{collectionPoint:null,entityMap:null,error:e}}},this.fetchCollectionPoint=function(e){return _g(t,null,D().mark((function t(){var n;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._validateInitStatus()){t.next=2;break}return t.abrupt("return",{collectionPoint:null,entityMap:null,error:Hv(pv.USAGE_BEFORE_INIT)});case 2:return Lf.reportCUJ(dv.FETCH_COLLECTION_POINT,Do.START),t.prev=3,Lf.info("[SDK]: fetchCollectionPoint",{collectionPointId:e}),t.next=7,gg.fetchCollectionPoint(e);case 7:return n=t.sent,Lf.reportCUJ(dv.FETCH_COLLECTION_POINT,Do.FINISH),t.abrupt("return",n);case 12:return t.prev=12,t.t0=t.catch(3),Lf.reportCUJ(dv.FETCH_COLLECTION_POINT,Do.FAILURE,{error:t.t0}),t.abrupt("return",{collectionPoint:null,entityMap:null,error:t.t0});case 16:case"end":return t.stop()}}),t,this,[[3,12]])})))},this.updateConsentRecords=function(e){return _g(t,null,D().mark((function t(){var n;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._validateInitStatus()){t.next=2;break}return t.abrupt("return",{collectionPoint:null,entityMap:null,error:Hv(pv.USAGE_BEFORE_INIT)});case 2:return Lf.reportCUJ(dv.UPDATE_RECORD,Do.START,{data:e}),t.prev=3,Lf.info("[SDK]: updateConsentRecords",{params:e}),t.next=7,gg.updateConsentRecords(e);case 7:return n=t.sent,Lf.reportCUJ(dv.UPDATE_RECORD,Do.FINISH,{data:e}),t.abrupt("return",n);case 12:return t.prev=12,t.t0=t.catch(3),Lf.reportCUJ(dv.UPDATE_RECORD,Do.FAILURE,{error:t.t0}),t.abrupt("return",{collectionPoint:null,entityMap:null,error:t.t0});case 16:case"end":return t.stop()}}),t,this,[[3,12]])})))},this.removeNotification=function(e){t._validateInitStatus()&&(Lf.info("[SDK]: removeNotification",{arg:e}),gg.removeNotification(e))},this.notify=function(e){t._validateInitStatus()&&(Lf.info("[SDK]: notify",{arg:e}),gg.notify(e))},this.fetch=function(e){return _g(t,null,D().mark((function t(){var n;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._validateInitStatus()){t.next=2;break}return t.abrupt("return",{error:Hv(pv.USAGE_BEFORE_INIT)});case 2:return Lf.reportCUJ(dv.FETCH_DATA,Do.START),t.prev=3,Lf.info("[SDK]: fetch",{arg:e}),t.next=7,gg.fetch(e);case 7:return n=t.sent,Lf.reportCUJ(dv.FETCH_DATA,Do.FINISH),t.abrupt("return",n);case 12:return t.prev=12,t.t0=t.catch(3),Lf.reportCUJ(dv.FETCH_DATA,Do.FAILURE,{error:t.t0}),t.abrupt("return",{error:t.t0});case 16:case"end":return t.stop()}}),t,this,[[3,12]])})))},this.addEventListener=function(e,n,i){if(t._validateInitStatus()){if(Lf.reportCUJ(dv.SUBSCRIBE_EVENT,Do.START),Lf.info("[SDK]: addEventListener"),!e||!hh[e]||!n||"function"!=typeof i){var r="[SDK]: addEventListener - invalid param for adding new event listener",o=new Error(r);return Lf.error(r,o),void Lf.reportCUJ(dv.SUBSCRIBE_EVENT,Do.FAILURE,{error:o})}try{gg.addEventListener(e,n,i),Lf.reportCUJ(dv.SUBSCRIBE_EVENT,Do.FINISH)}catch(e){Lf.reportCUJ(dv.SUBSCRIBE_EVENT,Do.FAILURE,{error:e})}}},this.removeEventListener=function(e,n){if(t._validateInitStatus()){Lf.reportCUJ(dv.UNSUBSCRIBE_EVENT,Do.START),Lf.info("[SDK]: removeEventListener");try{gg.removeEventListener(e,n),Lf.reportCUJ(dv.UNSUBSCRIBE_EVENT,Do.FINISH)}catch(e){Lf.reportCUJ(dv.UNSUBSCRIBE_EVENT,Do.FAILURE,{error:e})}}},this.destruct=function(){Lf.info("[SDK]: destruct"),gg.destruct(),dh.destruct(),fv.destruct(),Lf.destruct(),t._isInitialized=!1},e._instance||(e._instance=this),e._instance}return $(e,[{key:"init",value:function(e){return _g(this,null,D().mark((function t(){var n,i,r,o,a,s,c,l,u,f,d,h,p,v;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"!=typeof window){t.next=3;break}return console.warn("ConsentClientFrameworkSDK can not be init on server"),t.abrupt("return",Promise.resolve());case 3:if(!this._isInitialized){t.next=5;break}throw new Error("ConsentClientFrameworkSDK has been initialized");case 5:if(n=Kp({},e,yg),i=n.debug,r=void 0!==i&&i,o=n.fetchDataAtInit,a=n.modules,s=n.region,c=n.appId,l=n.bid,u=n.tea,f=n.slardar,d=n.mode,h=n.appVersion,p=n.tenant,r&&(window.consentSDK=this,window.consentSDK.storage=fv),Lf.init({customLoggingModule:a.logging,monitorModuleConfig:{tea:u,slardar:f,teaEventNameFormatter:mg},meta:ih()},{bid:"pns_consent_system",consumerBid:l,version:Wd,appId:c,appVersion:h,tenant:p,mode:d,region:s,debug:r}),Lf.reportCUJ(dv.SDK_INIT,Do.START),t.prev=10,Lf.info("[SDK]: init global module"),dh.init(n),fv.init(n),Lf.info("[SDK]: init life cycle"),gg.init(n),this._isInitialized=!0,!o){t.next=25;break}return Lf.reportCUJ(dv.FETCH_DATA,Do.START),t.next=21,gg.fetch();case 21:return v=t.sent,Lf.reportCUJ(dv.FETCH_DATA,Do.FINISH),Lf.reportCUJ(dv.SDK_INIT,Do.FINISH),t.abrupt("return",v);case 25:return Lf.reportCUJ(dv.SDK_INIT,Do.FINISH),t.abrupt("return",Promise.resolve());case 29:throw t.prev=29,t.t0=t.catch(10),Lf.reportCUJ(dv.SDK_INIT,Do.FAILURE,{error:t.t0}),t.t0;case 33:case"end":return t.stop()}}),t,this,[[10,29]])})))}},{key:"isInitialized",value:function(){return Lf.info("[SDK]: isInitialized"),this._isInitialized}}]),e}(),Eg=new bg,wg={TTP:Qd.US_TTP,TTP2:Qd.US_TTP2,GCP:Qd.US_EASTRED,EU_TTP:Qd.EU_TTP,MALI_VA:Qd.US_EAST,ALL_SG:Qd.SINGAPORE_CENTRAL,EU_TTP2:Qd.EU_TTP2},kg=function(e){I(n,e);var t=M(n);function n(e){var i,r=e.wid,o=e.region;return V(this,n),(i=t.call(this)).wid="",i.region="",i.wid=r,i.region=o,i}return $(n,[{key:"getUserInfo",value:function(){return{device_id:this.wid,user_country:this.region,carrier_region:this.region}}}]),n}(vv),Sg=!1;function xg(e){return Tg.apply(this,arguments)}function Tg(){return(Tg=O(D().mark((function e(t){var n,i,r,o,a,s,c,l,u,f,d,h,p;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.config,i=t.region,r=t.tenantId,o=t.consentApiDomain,a=t.idcRegion,s=t.disableTea,c=t.tea,e.prev=1,Sg){e.next=12;break}return Sg=!0,l=n.entityKeys,u=n.wid,f=w(n,b),d=[],Object.keys(l||{}).forEach((function(e){var t=l[e]||[];d.push.apply(d,C(t))})),h=(null==r?void 0:r.startsWith("paas_"))?r.split("paas_")[1]:r,p=S(S(S({},f),{},{region:wg[a]||wg.ALL_SG,bid:"tiktok-cookie-banner"},s?{tea:!1}:{tea:S({disable_auto_pv:!0},c||{})}),{},{modules:{info:new kg({wid:u,region:i})},tenant:h}),o&&(p.domain=o),e.next=12,Eg.init(p);case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),console.error("initConsentSDK failed: errMsg=".concat(e.t0.message,", config=").concat(JSON.stringify(n)));case 17:case"end":return e.stop()}}),e,null,[[1,14]])})))).apply(this,arguments)}function Ag(){return(Ag=O(D().mark((function e(t,n){var i;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i=t.map((function(e){return{key:e.key,status:e.value?gh.APPROVE:gh.REJECT,collectionPointId:n}})),e.next=4,Eg.updateConsentRecords(i);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("updateConsentRecords failed: errMsg=".concat(e.t0.message,", value=").concat(JSON.stringify(t)));case 9:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function zg(){var e=window.location.hostname.split(".");if(e.length>3){var t=e.length-1;return".".concat(e.slice(-t).join("."))}return".".concat(e.slice(-2).join("."))}function Cg(){ht.remove(st,{domain:zg()}),ht.remove(st),ht.remove(st,{domain:window.location.hostname})}function Dg(e){return e?"1":"0"}var Rg=function(){function e(){V(this,e),this.isRequestInflight=!1,this.pendingTasks=[],this.entityKeys={},this.collectionPointId=""}return $(e,[{key:"getSettings",value:function(){var e,t;return(null===(t=null===(e=this.value)||void 0===e?void 0:e.settings)||void 0===t?void 0:t.length)?this.value.settings:(console.error("`CookieConfigManager.getSettings` returned undefined."),[])}},{key:"getSettingItemKeys",value:function(e,t){var n=Object.keys(e||{});return n.length?n:(null==t?void 0:t.length)?t.map((function(e){return e.entityKey})):[]}},{key:"getCategoryConsents",value:function(e){var t=e.groupName,n=e.value,i=this.getSettings().find((function(e){return e.groupName===t}));return i?this.getSettingItemKeys(i.items,i.groupEntityKeys).reduce((function(e,t){return e[t]=n,e}),{}):(console.error("`CookieConfigManager.getCategoryConsents` returned category undefined."),{})}},{key:"setFullConsents",value:function(){var e=this.getFullConsents();return this.setCookieConsents(e)}},{key:"getFullConsents",value:function(){var e=this,t=this.getSettings(),n={};return t.forEach((function(t){var i=e.getCategoryConsents({groupName:t.groupName,value:!0});n=S(S({},n),i)})),n}},{key:"setEmptyConsents",value:function(){var e=this.getEmptyConsents();return this.setCookieConsents(e)}},{key:"getEmptyConsents",value:function(){var e=this,t=this.getSettings(),n={};return t.forEach((function(t){var i=e.getCategoryConsents({groupName:t.groupName,value:!1});n=S(S({},n),i)})),n}},{key:"setCookieConsents",value:function(e){var t,n=this.getSettings();if(!n.length)return{};n.forEach((function(t){for(var n=0,i=Object.keys(t.items);n<i.length;n++){var r=i[n];if(!e[r]){var o=(t.items[r]||{}).cookies;(void 0===o?[]:o).forEach((function(e){return ht.remove(e,{domain:zg()})}))}}}));var i=(null===(t=this.value)||void 0===t?void 0:t.version)||"",r=JSON.stringify(S(S({},e),{},{version:i}));return ht.set(st,r,{expires:390,domain:zg(),secure:!0,sameSite:"None"}),setTimeout((function(){ht.get(st)!==r&&$n("cookie_banner_save_cookie_failed")}),100),this.updateConsentRecords(e),e}},{key:"updateConsentRecords",value:function(e){var t=this,n=[];Object.keys(e).forEach((function(i){var r,o=(null===(r=t.entityKeys)||void 0===r?void 0:r[i])||[];if(null==o?void 0:o.length){var a=e[i],s=o.map((function(e){return{key:e,value:a}}));n.push.apply(n,C(s))}})),function(e,t){Ag.apply(this,arguments)}(n,this.collectionPointId)}},{key:"getCookieConsents",value:function(e){var t=this.getSettings();if(!t.length)return{};var n=e.isEffective,i=e.cookie,r=e.isFTC,o=[],a=t.reduce((function(e,t){var n=t.groupEntityKeys||[],i={};return n.length&&(o.push.apply(o,C(n)),i=n.reduce((function(e,t){return S(S({},e),{},x({},t.entityKey,{default:t.default,cookies:t.cookies}))}),{})),S(S(S({},e),(null==t?void 0:t.items)||{}),i)}),{}),s=this.getSettingItemKeys(a),c=o.map((function(e){return e.entityKey}));s.push.apply(s,C(c));try{var l=i?decodeURIComponent(i):ht.get(st),u=s.reduce((function(e,t){return e[t]=!0,e}),{}),f=l&&JSON.parse(l);if(r)return this.getEmptyConsents();if(f)return function(e){return Object.keys(e).filter((function(e){return"version"!==e})).reduce((function(t,n){return t[n]=e[n],t}),{})}(Object.assign({},n?this.getDefaultConsents(a):u,f));if(!n)return u}catch(e){}return this.getDefaultConsents(a)}},{key:"getDefaultConsents",value:function(e){var t=Object.keys(e||{});if(t.length){var n={};return t.forEach((function(t){n[t]=!!e[t].default})),n}return{}}},{key:"isShowCookieBanner",value:function(e){var t,n=e.isEffective,i=function(e){var t=(e||{}).cookie,n=t?decodeURIComponent(t):ht.get(st);if(!n)return null;try{var i=n&&JSON.parse(n);return i&&!i.version?(Cg(),null):i.version}catch(e){return Cg(),null}}(e);return!!n&&(!!this.value&&function(e,t){if(!t)return!0;var n=/^v(\d+)$/,i=n.exec(e),r=n.exec(t);return i&&r?Number(i[1])>Number(r[1]):e!==t}((null===(t=this.value)||void 0===t?void 0:t.version)||"",i))}},{key:"setCookieConfig",value:function(e){var t=e.entityKeys,n=e.collectionPointId,i=w(e,y);this.value=i,this.entityKeys=t||{},this.collectionPointId=n||""}}]),e}(),Og=new Rg;function Ig(e,t){var n,i,r,o,a;try{o=null===(n=document.getElementById(e))||void 0===n?void 0:n.textContent;var s=JSON.parse(o),c=s.i18n,l=void 0===c?{}:c,u=s.appProps,f=(u=void 0===u?{}:u).region,d=void 0===f?"":f,h=u.user,p=(h=void 0===h?{}:h).ftcUser,v=void 0!==p&&p,g=u.idcRegion,m=void 0===g?"":g,_=s.cookieBanner,y=(_=void 0===_?{}:_).disabled,b=void 0!==y&&y,E=_.isEffective,w=void 0!==E&&E,k=_.settings,x=void 0===k?{}:k,T=_.version,A=void 0===T?"":T,z=_.disabledAccessKeys,C=void 0===z?[]:z,D=_.resource,R=void 0===D?{}:D,O=s.consent,I=s.consentApiDomain,M=s.customTheme,P=void 0===M?[]:M,N=s.tea,U=s.tenantId;return function(e){if(!qn&&Vn){qn=!0;var t=null!=e?e:ft;Vn.init(S({app_id:345918,log:!1,disable_auto_pv:!0},t)),Vn.start()}}(N),Og.setCookieConfig({settings:x,version:A,entityKeys:O.entityKeys,collectionPointId:O.collectionPointId}),a={locale:t,region:d,js_version:null!==(i=null==R?void 0:R.version)&&void 0!==i?i:"default",tenant_id:U||"default"},qn&&Vn&&Vn.config({evtParams:a}),{region:d,isFTC:v,i18n:l,disabled:b,isEffective:w,consent:O,disabledAccessKeys:C,consentApiDomain:I,customTheme:P.join(";")||"",idcRegion:m,disableTea:null===(r=null==R?void 0:R.esm)||void 0===r?void 0:r.includes("no-tea"),tenantId:U,tea:N}}catch(e){return console.error(e),null}}
|
||
/**
|
||
* @license
|
||
* Copyright 2020 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/var Mg=function e(t,n){var i,r,o=t._$AN;if(void 0===o)return!1;var a,s=F(o);try{for(s.s();!(a=s.n()).done;){var c=a.value;null===(r=(i=c)._$AO)||void 0===r||r.call(i,n,!1),e(c,n)}}catch(e){s.e(e)}finally{s.f()}return!0},Pg=function(e){var t,n;do{if(void 0===(t=e._$AM))break;(n=t._$AN).delete(e),e=t}while(0===(null==n?void 0:n.size))},Ng=function(e){for(var t;t=e._$AM;e=t){var n=t._$AN;if(void 0===n)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Gg(t)}};
|
||
/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/function Ug(e){void 0!==this._$AN?(Pg(this),this._$AM=e,Ng(this)):this._$AM=e}function Bg(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(t)if(Array.isArray(i))for(var o=n;o<i.length;o++)Mg(i[o],!1),Pg(i[o]);else null!=i&&(Mg(i,!1),Pg(i));else Mg(this,e)}var Gg=function(e){var t,n,i,r;e.type==Qe&&(null!==(t=(i=e)._$AP)&&void 0!==t||(i._$AP=Bg),null!==(n=(r=e)._$AQ)&&void 0!==n||(r._$AQ=Ug))},Lg=function(e){I(n,e);var t=M(n);function n(){var e;return V(this,n),(e=t.apply(this,arguments))._$AN=void 0,e}return $(n,[{key:"_$AT",value:function(e,t,i){T(j(n.prototype),"_$AT",this).call(this,e,t,i),Ng(this),this.isConnected=e._$AU}},{key:"_$AO",value:function(e){var t,n,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e!==this.isConnected&&(this.isConnected=e,e?null===(t=this.reconnected)||void 0===t||t.call(this):null===(n=this.disconnected)||void 0===n||n.call(this)),i&&(Mg(this,e),Pg(this))}},{key:"setValue",value:function(e){if(function(e){return void 0===e.strings}(this._$Ct))this._$Ct._$AI(e,this);else{var t=C(this._$Ct._$AH);t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}},{key:"disconnected",value:function(){}},{key:"reconnected",value:function(){}}]),n}(tt),jg=function(){return new Fg},Fg=$((function e(){V(this,e)})),Kg=new WeakMap,Hg=et(function(e){I(n,e);var t=M(n);function n(){return V(this,n),t.apply(this,arguments)}return $(n,[{key:"render",value:function(e){return Ie}},{key:"update",value:function(e,t){var n,i=z(t,1)[0],r=i!==this.Y;return r&&void 0!==this.Y&&this.rt(void 0),(r||this.lt!==this.dt)&&(this.Y=i,this.ct=null===(n=e.options)||void 0===n?void 0:n.host,this.rt(this.dt=e.element)),Ie}},{key:"rt",value:function(e){var t;if("function"==typeof this.Y){var n=null!==(t=this.ct)&&void 0!==t?t:globalThis,i=Kg.get(n);void 0===i&&(i=new WeakMap,Kg.set(n,i)),void 0!==i.get(this.Y)&&this.Y.call(this.ct,void 0),i.set(this.Y,e),void 0!==e&&this.Y.call(this.ct,e)}else this.Y.value=e}},{key:"lt",get:function(){var e,t,n;return"function"==typeof this.Y?null===(t=Kg.get(null!==(e=this.ct)&&void 0!==e?e:globalThis))||void 0===t?void 0:t.get(this.Y):null===(n=this.Y)||void 0===n?void 0:n.value}},{key:"disconnected",value:function(){this.lt===this.dt&&this.rt(void 0)}},{key:"reconnected",value:function(){this.rt(this.dt)}}]),n}(Lg)),Vg=[],qg=[];function $g(e,t){if(e&&"undefined"!=typeof document){var n,i=!0===t.prepend?"prepend":"append",r=!0===t.singleTag,o="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(r){var a=Vg.indexOf(o);-1===a&&(a=Vg.push(o)-1,qg[a]={}),n=qg[a]&&qg[a][i]?qg[a][i]:qg[a][i]=s()}else n=s();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),r=0;r<n.length;r++)e.setAttribute(n[r],t.attributes[n[r]]);var a="prepend"===i?"afterbegin":"beforeend";return o.insertAdjacentElement(a,e),e}}var Jg='.cookie-banner-toast {\n font-family: "tiktok-text-medium", PingFangSC, sans-serif;\n font-weight: 600;\n font-size: 17px;\n line-height: 130%;\n letter-spacing: 0%;\n position: fixed;\n left: 0;\n top: 70px;\n right: 0;\n text-align: center;\n padding: 12px 20px;\n background: rgba(84, 84, 84, 0.92);\n color: #fff;\n box-sizing: border-box;\n z-index: 10003;\n transition: opacity 0.3s;\n opacity: 0;\n}\n.cookie-banner-toast.show {\n opacity: 1;\n}';$g(Jg,{});var Wg,Xg=function(e){I(n,e);var t=M(n);function n(){var e;return V(this,n),(e=t.apply(this,arguments)).visible=!0,e.timeoutId=-1,e.wrapperRef=jg(),e}return $(n,[{key:"willUpdate",value:function(e){e.has("textId")&&this.resetAutoFadeOut()}},{key:"firstUpdated",value:function(){var e,t=this;this.resetAutoFadeOut(),null===(e=this.wrapperRef.value)||void 0===e||e.addEventListener("transitionend",(function(){t.visible||t.dispatchEvent(new Event("fadeOutComplete"))}))}},{key:"resetAutoFadeOut",value:function(){var e=this;this.text&&(clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){e.visible=!1}),3e3))}},{key:"render",value:function(){return Re(a||(a=E(["<div ",' class="','">',"</div>"])),Hg(this.wrapperRef),nt({"cookie-banner-toast":!0,show:this.visible}),this.text)}}]),n}(We);function Zg(e){if(Wg)Wg.setAttribute("text",e),Wg.setAttribute("text-id",Date.now().toString(36));else{(Wg=document.createElement("tiktok-cookie-banner-toast")).setAttribute("text",e),Wg.setAttribute("text-id",Date.now().toString(36));Wg.addEventListener("fadeOutComplete",(function e(){Wg&&(Wg.removeEventListener("fadeOutComplete",e),document.body.removeChild(Wg),Wg=null)})),document.body.appendChild(Wg)}}Xg.styles=ie(Jg),W([rt()],Xg.prototype,"text",void 0),W([rt({attribute:"text-id"})],Xg.prototype,"textId",void 0),W([ot()],Xg.prototype,"visible",void 0),Xg=W([it("tiktok-cookie-banner-toast")],Xg);var Yg='.tiktok-cookie-banner.paas_lemon8 {\n box-shadow: 0px -0.5px 0px 0px rgba(0, 0, 0, 0.05);\n}\n\n.tiktok-cookie-banner {\n font-family: "tiktok-text-regular", PingFangSC, sans-serif;\n font-weight: 400;\n font-size: 18px;\n line-height: 130%;\n letter-spacing: -0.16%;\n position: fixed;\n left: 0;\n bottom: 0;\n right: 0;\n background: var(--banner-background-color--, #10a2c5);\n z-index: 10001;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n color: #fff;\n padding: 24px 64px 32px;\n box-sizing: border-box;\n box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);\n -moz-text-size-adjust: 100%;\n text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n}\n.tiktok-cookie-banner .cookie-content .cookie-title {\n font-family: "tiktok-display-bold", PingFangSC, sans-serif;\n font-weight: 700;\n font-size: 24px;\n line-height: 125%;\n letter-spacing: 1%;\n margin-top: 0;\n margin-bottom: 0;\n color: var(--banner-title-color--, #fff);\n}\n.tiktok-cookie-banner .cookie-content .cookie-desc {\n font-family: "tiktok-text-regular", PingFangSC, sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 130%;\n letter-spacing: 0.19%;\n margin-top: 8px;\n margin-bottom: 0;\n color: var(--banner-desc-color--, #fff);\n}\n.tiktok-cookie-banner .cookie-content .cookie-desc a {\n font-family: "tiktok-text-medium", PingFangSC, sans-serif;\n font-weight: 600;\n font-size: 16px;\n line-height: 130%;\n letter-spacing: 0.19%;\n text-decoration: none;\n color: var(--banner-link-color--, #fff);\n}\n.tiktok-cookie-banner .cookie-content .cookie-desc a:hover {\n text-decoration: underline;\n color: var(--banner-link-hover-color--, #fff);\n}\n.tiktok-cookie-banner .button-wrapper {\n display: flex;\n margin-left: 64px;\n}\n.tiktok-cookie-banner .button-wrapper a,\n.tiktok-cookie-banner .button-wrapper button {\n font-family: "tiktok-text-bold", PingFangSC, sans-serif;\n font-weight: 700;\n font-size: 16px;\n line-height: 130%;\n letter-spacing: 0.19%;\n box-sizing: border-box;\n padding: 0 24px;\n height: 46px;\n min-width: 153px;\n white-space: nowrap;\n border-radius: 4px;\n border: 1px solid rgba(22, 24, 35, 0.12);\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n cursor: pointer;\n background: #fff;\n color: #161823;\n outline: none;\n text-decoration: none;\n border: 1px solid rgba(22, 24, 35, 0.12);\n}\n.tiktok-cookie-banner .button-wrapper a:hover,\n.tiktok-cookie-banner .button-wrapper button:hover {\n background: #f8f8f8;\n}\n.tiktok-cookie-banner .button-wrapper button {\n margin-left: 16px;\n background: var(--banner-button-background-color--, #fff);\n color: var(--banner-button-text-color--, #161823);\n}\n.tiktok-cookie-banner .button-wrapper button:hover {\n background: var(--banner-button-hover-background-color--, #f8f8f8);\n}\n@media (min-width: 768px) and (max-width: 1200px) {\n .tiktok-cookie-banner .special-button-wrapper button {\n height: auto;\n min-height: 44px;\n white-space: pre-wrap;\n }\n}\n.tiktok-cookie-banner.is-rtl {\n direction: rtl;\n}\n.tiktok-cookie-banner.is-rtl .button-wrapper {\n margin-left: unset;\n margin-right: 64px;\n}\n.tiktok-cookie-banner.is-rtl .button-wrapper button {\n margin-left: unset;\n margin-right: 16px;\n}\n@media (max-width: 991px) {\n .tiktok-cookie-banner.is-rtl .button-wrapper button {\n margin-right: 8px;\n }\n}\n@media (max-width: 991px) {\n .tiktok-cookie-banner {\n flex-direction: column;\n height: auto;\n padding: 16px 16px 20px;\n box-shadow: none;\n }\n .tiktok-cookie-banner .cookie-content .cookie-title {\n font-family: "tiktok-text-bold", PingFangSC, sans-serif;\n font-weight: 700;\n font-size: 16px;\n line-height: 130%;\n letter-spacing: 0.19%;\n text-align: center;\n color: var(--banner-title-color--, #fff);\n }\n .tiktok-cookie-banner .cookie-content .cookie-desc {\n font-family: "tiktok-text-regular", PingFangSC, sans-serif;\n font-weight: 400;\n font-size: 12px;\n line-height: 130%;\n letter-spacing: 1.34%;\n width: auto;\n text-align: center;\n color: var(--banner-desc-color--, #fff);\n }\n .tiktok-cookie-banner .cookie-content .cookie-desc a {\n font-family: "tiktok-text-medium", PingFangSC, sans-serif;\n font-weight: 600;\n font-size: 12px;\n line-height: 130%;\n letter-spacing: 1.34%;\n text-decoration: none;\n color: var(--banner-link-color--, #fff);\n }\n .tiktok-cookie-banner .cookie-content .cookie-desc a:hover {\n text-decoration: underline;\n color: var(--banner-link-hover-color--, #fff);\n }\n .tiktok-cookie-banner .button-wrapper {\n align-self: flex-end;\n margin-top: 16px;\n margin-left: 0;\n margin-right: 0;\n width: 100%;\n }\n .tiktok-cookie-banner .button-wrapper a,\n .tiktok-cookie-banner .button-wrapper button {\n font-family: "tiktok-text-medium", PingFangSC, sans-serif;\n font-weight: 600;\n font-size: 15px;\n line-height: 130%;\n letter-spacing: 0.4%;\n min-width: unset;\n padding: 0 6px;\n width: 100%;\n height: 44px;\n border-radius: 2px;\n white-space: pre-wrap;\n margin: 0;\n }\n .tiktok-cookie-banner .button-wrapper button {\n margin-left: 8px;\n height: auto;\n min-height: 44px;\n }\n}';$g(Yg,{});
|
||
/**
|
||
* @license
|
||
* Copyright 2018 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/
|
||
var Qg=et(function(e){I(n,e);var t=M(n);function n(e){var i,r;if(V(this,n),i=t.call(this,e),e.type!==Ye||"style"!==e.name||(null===(r=e.strings)||void 0===r?void 0:r.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");return P(i)}return $(n,[{key:"render",value:function(e){return Object.keys(e).reduce((function(t,n){var i=e[n];return null==i?t:t+"".concat(n=n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(i,";")}),"")}},{key:"update",value:function(e,t){var n=this,i=z(t,1)[0],r=e.element.style;if(void 0===this.vt){for(var o in this.vt=new Set,i)this.vt.add(o);return this.render(i)}for(var a in this.vt.forEach((function(e){null==i[e]&&(n.vt.delete(e),e.includes("-")?r.removeProperty(e):r[e]="")})),i){var s=i[a];null!=s&&(this.vt.add(a),a.includes("-")?r.setProperty(a,s):r[a]=s)}return Oe}}]),n}(tt)),em=':root body.disable-scroll {\n overflow: hidden;\n}\n\n.tiktok-cookie-setting-portal {\n font-family: "tiktok-text-regular", PingFangSC, sans-serif;\n font-weight: 400;\n font-size: 14px;\n line-height: 130%;\n letter-spacing: 0.67%;\n position: fixed;\n left: 0;\n top: 0;\n width: 0;\n height: 0;\n color: rgb(22, 24, 35);\n -webkit-font-smoothing: antialiased;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-backdrop {\n background-color: rgba(0, 0, 0, 0.5);\n transition: opacity 300ms linear;\n opacity: 0;\n position: fixed;\n inset: 0;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-backdrop.visible {\n opacity: 1;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-modal-container {\n position: fixed;\n inset: 0;\n left: 0;\n top: 32px;\n bottom: 32px;\n left: 16px;\n right: 16px;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n transform: scale(0.8);\n transition: opacity 300ms cubic-bezier(0.65, 0, 0.35, 1), transform 300ms cubic-bezier(0.65, 0, 0.35, 1);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-modal-container.visible {\n opacity: 1;\n transform: scale(1);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-modal-container .tiktok-cookie-setting-modal {\n position: relative;\n max-width: 700px;\n max-height: 100%;\n background-color: var(--setting-modal-background-color--, #fff);\n border-radius: 8px;\n overflow: hidden;\n box-shadow: rgba(0, 0, 0, 0.12) 0 2px 12px;\n outline: 0;\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n@media (max-width: 700px) {\n .tiktok-cookie-setting-portal .tiktok-cookie-setting-modal-container .tiktok-cookie-setting-modal {\n width: calc(100vw - 32px);\n }\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-header-container {\n font-family: "tiktok-display-bold", PingFangSC, sans-serif;\n font-weight: 700;\n font-size: 24px;\n line-height: 125%;\n letter-spacing: 1%;\n padding: 24px 29px 16px 24px;\n color: var(--setting-modal-title-color--, #161823);\n border-bottom: 0.5px solid rgba(22, 24, 35, 0.2);\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex: 0;\n}\n@media (max-width: 468px) {\n .tiktok-cookie-setting-portal .tiktok-cookie-setting-header-container {\n border-bottom: none;\n padding: 32px 24px 24px;\n font-family: "tiktok-display-bold", PingFangSC, sans-serif;\n font-weight: 700;\n font-size: 20px;\n line-height: 125%;\n letter-spacing: 1.5%;\n justify-content: center;\n }\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-modal-close {\n width: 24px;\n height: 24px;\n cursor: pointer;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-modal-close svg {\n fill: var(--setting-modal-close-icon-color--, rgba(22, 24, 35, 0.6));\n}\n@media (max-width: 468px) {\n .tiktok-cookie-setting-portal .tiktok-cookie-setting-modal-close {\n position: absolute;\n top: 14px;\n right: 14px;\n transform: scale(0.8);\n }\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-modal-description-container {\n background-color: rgba(22, 24, 35, 0.03);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-modal-description-container .tiktok-cookie-setting-modal-description {\n font-family: "tiktok-text-regular", PingFangSC, sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 130%;\n letter-spacing: 0.19%;\n margin: 20px 24px;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-content {\n padding: 12px 40px 12px 24px;\n overflow-y: auto;\n flex: 1 1 auto;\n}\n@media (max-width: 700px) {\n .tiktok-cookie-setting-portal .tiktok-cookie-setting-content {\n width: calc(100% - 48px);\n }\n}\n@media (max-width: 468px) {\n .tiktok-cookie-setting-portal .tiktok-cookie-setting-content {\n padding: 6px 16px 0 16px;\n }\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-content::-webkit-scrollbar {\n width: 6px;\n margin-right: 8px;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-content:hover::-webkit-scrollbar-thumb {\n background: rgba(0, 0, 0, 0.15);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-content::-webkit-scrollbar-track {\n background: transparent;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-content::-webkit-scrollbar-thumb {\n border-radius: 3px;\n background: rgba(0, 0, 0, 0.15);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-content .tiktok-cookie-setting-info-icon {\n margin-left: auto;\n justify-content: flex-end;\n height: 48px;\n cursor: pointer;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-content .tiktok-cookie-setting-info-icon.hide {\n transform: rotate(180deg);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-content .tiktok-cookie-setting-info-icon svg {\n width: 14px;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n padding: 17px;\n fill: var(--setting-modal-arrow-icon-color--, #161823);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-content .tiktok-cookie-vertical-info-icon {\n margin-left: auto;\n margin-right: 20px;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-content .tiktok-cookie-vendor-group-name {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n font-family: "tiktok-text-medium", PingFangSC, sans-serif;\n font-weight: 600;\n font-size: 16px;\n line-height: 130%;\n letter-spacing: 0.19%;\n margin-top: 0;\n margin-bottom: 0;\n color: var(--setting-modal-text-color--, #161823);\n flex: 1 1 0;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-content .tiktok-cookie-vendor-group-name .tiktok-cookie-vendor-group-name-outside {\n display: flex;\n align-items: center;\n flex-shrink: 1;\n flex-grow: 1;\n}\n@media (max-width: 468px) {\n .tiktok-cookie-setting-portal .tiktok-cookie-setting-content .tiktok-cookie-vendor-group-name {\n font-family: "tiktok-text-medium", PingFangSC, sans-serif;\n font-weight: 600;\n font-size: 15px;\n line-height: 130%;\n letter-spacing: 0.4%;\n }\n}\n.tiktok-cookie-setting-portal cookie-setting-switch {\n line-height: 0;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-footer {\n padding: 24px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-top: 0.5px solid rgba(22, 24, 35, 0.2);\n flex: 0 0 auto;\n}\n@media (max-width: 468px) {\n .tiktok-cookie-setting-portal .tiktok-cookie-setting-footer {\n border-top: none;\n padding: 20px;\n flex-direction: column-reverse;\n justify-content: center;\n align-items: stretch;\n }\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-footer .tiktok-cookie-setting-footer-btn-text,\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-footer .tiktok-cookie-setting-footer-btn-primary {\n font-family: "tiktok-text-medium", PingFangSC, sans-serif;\n font-weight: 600;\n font-size: 16px;\n line-height: 130%;\n letter-spacing: 0.19%;\n min-width: 100px;\n border-radius: 4px;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n cursor: pointer;\n box-sizing: border-box;\n height: 36px;\n outline: none;\n border: none;\n text-align: center;\n}\n@media (max-width: 468px) {\n .tiktok-cookie-setting-portal .tiktok-cookie-setting-footer .tiktok-cookie-setting-footer-btn-text,\n .tiktok-cookie-setting-portal .tiktok-cookie-setting-footer .tiktok-cookie-setting-footer-btn-primary {\n height: 44px;\n margin-left: 0;\n border-radius: 2px;\n }\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-footer .tiktok-cookie-setting-footer-btn-text {\n color: #fe2c55;\n background-color: #fff;\n text-decoration: none;\n padding-left: 0;\n padding-right: 0;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-footer .tiktok-cookie-setting-footer-btn-primary {\n background-color: var(--setting-modal-button-background-color--, rgb(254, 44, 85));\n color: var(--setting-modal-button-text-color--, #fff);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-footer .tiktok-cookie-setting-footer-btn-primary:hover {\n background: var(--setting-modal-button-hover-background-color--, linear-gradient(0deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.06)), #fe2c55);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-vendor-group {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-vendor-group.show-detail {\n margin-bottom: 16px;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-vendor {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-vendor .tiktok-cookie-vendor-label-outside {\n display: flex;\n flex-shrink: 1;\n flex-grow: 1;\n color: var(--setting-modal-text-color--, #161823);\n cursor: pointer;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-vendor .tiktok-cookie-vendor-label-outside .tiktok-cookie-vendor-label {\n margin-left: 16px;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n flex: 1 1 0;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-manage-tip-context {\n padding: 0;\n margin: 0;\n margin-bottom: 8px;\n padding-left: -16px;\n color: var(--setting-modal-desc-color--, rgba(0, 0, 0, 0.7));\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-manage-tip-context .tiktok-cookie-manage-tip-context-ref {\n text-decoration: none;\n color: var(--setting-modal-link-color--, #fe2c55);\n font-weight: bold;\n text-decoration: none;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-manage-tip-context .tiktok-cookie-manage-tip-context-ref:hover {\n text-decoration: underline;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-vendor-context-ref {\n text-decoration: none;\n color: var(--setting-modal-link-color--, #fe2c55);\n font-weight: bold;\n text-decoration: none;\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-vendor-context-ref:hover {\n text-decoration: underline;\n color: var(--setting-modal-link-hover-color--, #fe2c55);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-vendor-context {\n padding: 0;\n margin-top: 4px;\n margin-bottom: 8px;\n padding-left: 16px;\n color: var(--setting-modal-text-color--, rgba(0, 0, 0, 0.56));\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-vendor-group p,\n.tiktok-cookie-setting-portal .tiktok-cookie-vendor p {\n font-family: "tiktok-text-regular", PingFangSC, sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 130%;\n letter-spacing: 0.19%;\n margin-top: 0;\n margin-bottom: 0;\n}\n@media (max-width: 468px) {\n .tiktok-cookie-setting-portal .tiktok-cookie-vendor-group p,\n .tiktok-cookie-setting-portal .tiktok-cookie-vendor p {\n font-family: "tiktok-text-regular", PingFangSC, sans-serif;\n font-weight: 400;\n font-size: 15px;\n line-height: 130%;\n letter-spacing: 0.4%;\n }\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-desc {\n color: var(--setting-modal-text-color--, rgba(0, 0, 0, 0.56));\n font-family: "tiktok-text-regular", PingFangSC, sans-serif;\n font-weight: 400;\n font-size: 14px;\n line-height: 130%;\n letter-spacing: 0.67%;\n margin-bottom: 24px;\n}\n.tiktok-cookie-setting-portal .cookie-setting-switch {\n line-height: 0;\n padding-left: 36px;\n flex-grow: 0;\n flex-shrink: 0;\n}\n.tiktok-cookie-setting-portal .cookie-setting-switch.checked {\n background-color: var(--setting-modal-switch-toggle-color--, #0be09b);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-footer-desc {\n font-family: "tiktok-text-medium", PingFangSC, sans-serif;\n font-weight: 600;\n font-size: 16px;\n line-height: 130%;\n letter-spacing: 0.19%;\n padding: 0;\n margin: 0 16px 0 0;\n color: var(--setting-modal-link-color--, #fe2c55);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-footer-desc a {\n font-family: "tiktok-text-medium", PingFangSC, sans-serif;\n font-weight: 600;\n font-size: 16px;\n line-height: 130%;\n letter-spacing: 0.19%;\n text-decoration: none;\n color: var(--setting-modal-link-color--, #fe2c55);\n}\n.tiktok-cookie-setting-portal .tiktok-cookie-setting-footer-desc a:hover {\n text-decoration: underline;\n color: var(--setting-modal-link-color--, #fe2c55);\n}\n@media (max-width: 468px) {\n .tiktok-cookie-setting-portal .tiktok-cookie-setting-footer-desc {\n margin: 16px 0 0 0;\n text-align: center;\n }\n}\n.tiktok-cookie-setting-portal.is-rtl {\n direction: rtl;\n}\n.tiktok-cookie-setting-portal.is-rtl .tiktok-cookie-setting-content {\n padding: 12px 24px 12px 40px;\n}\n.tiktok-cookie-setting-portal.is-rtl .tiktok-cookie-vertical-info-icon {\n margin-left: 20px;\n margin-right: auto;\n}\n.tiktok-cookie-setting-portal.is-rtl .tiktok-cookie-setting-info-icon {\n margin-right: auto;\n margin-left: 0;\n}\n.tiktok-cookie-setting-portal.is-rtl .tiktok-cookie-vendor .tiktok-cookie-vendor-label-outside .tiktok-cookie-vendor-label {\n margin-left: 0;\n margin-right: 16px;\n}\n.tiktok-cookie-setting-portal.is-rtl .tiktok-cookie-vendor-context {\n padding-left: 0;\n padding-right: 16px;\n}\n.tiktok-cookie-setting-portal.is-rtl .tiktok-cookie-setting-footer-desc {\n margin: 0 0 0 16px;\n}\n@media (max-width: 468px) {\n .tiktok-cookie-setting-portal.is-rtl .tiktok-cookie-setting-footer-desc {\n margin: 16px 0 0 0;\n text-align: center;\n }\n}';
|
||
/**
|
||
* @license
|
||
* Copyright 2018 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/$g(em,{});var tm="global_module_disableScroll__472ccca3";$g(":root body.global_module_disableScroll__472ccca3 {\n overflow: hidden;\n}",{});var nm=".tiktok-cookie-setting-switch {\n box-sizing: border-box;\n display: inline-block;\n border-radius: 12px;\n border: 1px rgba(0, 0, 0, 0) solid;\n position: relative;\n cursor: pointer;\n background-color: var(--setting-modal-switch-toggle-color--, rgba(46, 50, 56, 0.05));\n transition: background-color 200ms ease-in-out;\n width: 40px;\n height: 24px;\n}\n.tiktok-cookie-setting-switch.checked {\n background-color: var(--setting-modal-switch-toggle-checked-color--, #0be09b);\n}\n.tiktok-cookie-setting-switch.checked .tiktok-cookie-setting-switch-knob {\n transform: translateX(18px);\n}\n.tiktok-cookie-setting-switch.disabled {\n opacity: 0.34;\n cursor: not-allowed;\n}\n\n.tiktok-cookie-setting-switch-knob {\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.08);\n cursor: pointer;\n border-radius: 9px;\n background-color: #fff;\n box-sizing: border-box;\n position: absolute;\n left: 0;\n right: auto;\n transition: transform 200ms ease-in-out, width 200ms ease-in-out;\n width: 18px;\n height: 18px;\n top: 2px;\n transform: translateX(2px);\n}\n\n.tiktok-cookie-setting-switch-native-control {\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: inherit;\n pointer-events: auto;\n margin: 0;\n position: absolute;\n top: 0;\n left: 0;\n}";$g(nm,{});var im=function(e){I(n,e);var t=M(n);function n(){var e;return V(this,n),(e=t.apply(this,arguments)).value=!1,e.name="",e.disabled=!1,e}return $(n,[{key:"handleCheck",value:function(e){var t=e.target.checked;this.dispatchEvent(new CustomEvent("checkedChange",{detail:t}))}},{key:"render",value:function(){return Re(s||(s=E(['<div class="','" role="switch" aria-checked="','"><div class="tiktok-cookie-setting-switch-knob"></div><input @change="','" ?checked="','" type="checkbox" role="switch" class="tiktok-cookie-setting-switch-native-control" name="','"></div>'])),nt({"tiktok-cookie-setting-switch":!0,checked:this.value,disabled:this.disabled}),this.value,this.handleCheck,this.value,this.name)}}]),n}(We);im.styles=ie(nm),W([rt({converter:function(e){return"true"===e}})],im.prototype,"value",void 0),W([rt()],im.prototype,"name",void 0),W([rt({converter:function(e){return"true"===e}})],im.prototype,"disabled",void 0),im=W([it("cookie-setting-switch")],im);var rm=["touchstart","touchmove","touchend","scroll"],om=function(e){I(n,e);var t=M(n);function n(){var e;return V(this,n),(e=t.apply(this,arguments)).zIndex=10002,e.visible=!1,e.settingModalCloseDisabled=!1,e.deferredVisible=!1,e.cookieConsent={},e.customTheme="",e.tenantId="",e.modalBackdropRef=jg(),e.scrollableListRef=jg(),e}return $(n,[{key:"connectedCallback",value:function(){var e=this;if(T(j(n.prototype),"connectedCallback",this).call(this),this.initUserConfig(),this.userConfig){this.cookieConsent=Og.getCookieConsents(this.userConfig);var t=this.userConfig;xg({config:t.consent,region:t.region,consentApiDomain:t.consentApiDomain,idcRegion:t.idcRegion,disableTea:t.disableTea,tea:t.tea,tenantId:t.tenantId})}this.visible&&requestAnimationFrame((function(){return e.deferredVisible=!0}))}},{key:"willUpdate",value:function(e){var t,n=this;if((e.has("userConfigEleId")||e.has("locale"))&&this.initUserConfig(),e.has("visible"))if(this.visible)this.cookieConsent=this.userConfig?Og.getCookieConsents(this.userConfig):{},requestAnimationFrame((function(){return n.deferredVisible=!0})),this.lockScroll(),$n("cookie_setting_show"),this.dispatchEvent(new CustomEvent("customBannerEvents",{detail:{eventName:"onSettingShow"},bubbles:!0,composed:!0}));else{var i=this.modalBackdropRef.value;null==i||i.addEventListener("transitionend",(function e(){null==i||i.removeEventListener("transitionend",e),n.deferredVisible=!1})),this.unlockScroll();var r,o=F(rm);try{for(o.s();!(r=o.n()).done;){var a=r.value;null===(t=this.scrollableListRef.value)||void 0===t||t.removeEventListener(a,this.stopTouchEventPropagation)}}catch(e){o.e(e)}finally{o.f()}}}},{key:"updated",value:function(e){if(e.has("visible")&&this.visible&&this.scrollableListRef.value){var t,n=F(rm);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.scrollableListRef.value.addEventListener(i,this.stopTouchEventPropagation)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"stopTouchEventPropagation",value:function(e){e.stopPropagation()}},{key:"lockScroll",value:function(){document.body.classList.add(tm)}},{key:"unlockScroll",value:function(){document.body.classList.remove(tm)}},{key:"initUserConfig",value:function(){var e=Ig(this.userConfigEleId,this.locale);e&&(this.userConfig=e,this.customTheme=e.customTheme,this.tenantId=e.tenantId)}},{key:"handleClose",value:function(){$n("cookie_setting_close"),this.dispatchEvent(new Event("close"))}},{key:"disagreeToAll",value:function(e){var t=e.value,n=e.groupName,i=Og.getCategoryConsents({groupName:n,value:t});this.cookieConsent=S(S({},this.cookieConsent||{}),i),$n("cookie_setting_toggle",{state:t?1:0,type:"category",name:n})}},{key:"disagreeToOne",value:function(e){var t=this.cookieConsent[e];this.cookieConsent=S(S({},this.cookieConsent),{},x({},e,!t)),$n("cookie_setting_toggle",{state:t?0:1,type:"vendor",name:e})}},{key:"handleSave",value:function(){var e=this;Og.setCookieConsents(this.cookieConsent),this.dispatchEvent(new Event("close")),this.dispatchEvent(new CustomEvent("save",{detail:this.cookieConsent})),$n("cookie_setting_save",{result:Object.keys(this.cookieConsent).filter((function(t){return e.cookieConsent[t]})).join(",")});var t=Object.keys(this.cookieConsent).every((function(t){return e.cookieConsent[t]})),n=Object.keys(this.cookieConsent).every((function(t){return!e.cookieConsent[t]}));t?$n("cookie_banner_accept"):n&&$n("cookie_banner_decline")}},{key:"renderVendorDescription",value:function(e){for(var t,n=[],i=new RegExp("\\[([^\\]]+)\\]\\(([^)]+)\\)","g");null!==(t=i.exec(e));){var r=e.slice(0,t.index);r&&n.push({type:"normalText",value:r}),n.push({type:"linkText",value:t[1],ref:t[2]}),e=e.slice(t.index+t[0].length)}return e&&n.push({type:"normalText",value:e}),n.map((function(e){var t,n=e.type,i=e.value,r=e.ref;switch(n){case"normalText":return Re(c||(c=E(["<span>","</span>"])),i);case"linkText":return Re(l||(l=E(['<a class="tiktok-cookie-vendor-context-ref" href="','" target="_blank" rel="noopener noreferrer">',"</a>"])),null!=(t=r)?t:Ie,i);default:return Ie}}))}},{key:"render",value:function(){var e,t,n=this,i=this.locale,r=void 0===i?"en":i,o=this.tenantId,a=null!==(t=null===(e=this.userConfig)||void 0===e?void 0:e.i18n)&&void 0!==t?t:{},s=a.cookieSettingsTitle,c=void 0===s?"":s,l=a.cookieSettingSaveBtn,g=void 0===l?"":l,m=a.cookieSettingsSubTitle,_=void 0===m?"":m,y=a.cookieSettingsFooter,b=void 0===y?"":y;if(!this.deferredVisible&&!this.visible)return Ie;var w=Og.getSettings();return Re(u||(u=E(["<style>:host{",'}</style><div class="','" style="','"><div ',' class="','"></div><div class="','"><section class="tiktok-cookie-setting-modal"><div class="tiktok-cookie-setting-header-container">'," ",'</div><div class="tiktok-cookie-setting-modal-description-container"><div class="tiktok-cookie-setting-modal-description"><p class="tiktok-cookie-manage-tip-context">',"</p></div></div><div ",' class="tiktok-cookie-setting-content">','</div><div class="tiktok-cookie-setting-footer"><p class="tiktok-cookie-setting-footer-desc" .innerHTML="','"></p><button class="tiktok-cookie-setting-footer-btn-primary" @click="','">',"</button></div></section></div></div>"])),this.customTheme,nt(S({"tiktok-cookie-setting-portal":!0,"is-rtl":at.includes(r)},o?x({},o,!0):{})),Qg({zIndex:"".concat(this.zIndex)}),Hg(this.modalBackdropRef),nt({"tiktok-cookie-setting-backdrop":!0,visible:this.visible&&this.deferredVisible}),nt({"tiktok-cookie-setting-modal-container":!0,visible:this.visible&&this.deferredVisible}),c,this.settingModalCloseDisabled?Ie:Re(f||(f=E(['<div class="tiktok-cookie-setting-modal-close" @click="','" .innerHTML="','"></div>'])),this.handleClose,'<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><path d="M21.1718 23.9999L10.2931 13.1212C9.90261 12.7307 9.90261 12.0975 10.2931 11.707L11.7074 10.2928C12.0979 9.90228 12.731 9.90228 13.1216 10.2928L24.0002 21.1715L34.8789 10.2928C35.2694 9.90228 35.9026 9.90228 36.2931 10.2928L37.7073 11.707C38.0979 12.0975 38.0979 12.7307 37.7073 13.1212L26.8287 23.9999L37.7073 34.8786C38.0979 35.2691 38.0979 35.9023 37.7073 36.2928L36.2931 37.707C35.9026 38.0975 35.2694 38.0975 34.8789 37.707L24.0002 26.8283L13.1216 37.707C12.731 38.0975 12.0979 38.0975 11.7074 37.707L10.2931 36.2928C9.90261 35.9023 9.90261 35.2691 10.2931 34.8786L21.1718 23.9999Z"></path></svg>'),this.renderVendorDescription(_),Hg(this.scrollableListRef),w.map((function(e){return Re(d||(d=E(['<div class="tiktok-cookie-vendor-group show-detail"><h1 class="tiktok-cookie-vendor-group-name"><div class="tiktok-cookie-vendor-group-name-outside with-hover-effect">','</div><span class="tiktok-cookie-vertical-info-icon" .innerHTML="','"></span></h1><cookie-setting-switch .value="','" .disabled="','" @checkedChange="','"></cookie-setting-switch></div>'," ",""])),e.groupName,lt,!!e.disabled||function(e){var t=e.reduce((function(e,t){return S(S({},e),{},x({},t,n.cookieConsent[t]))}),{});return Object.values(t).every((function(e){return Boolean(e)}))}(Og.getSettingItemKeys(e.items,e.groupEntityKeys)),e.disabled,(function(t){e.disabled||n.disagreeToAll({value:t.detail,groupName:e.groupName})}),Re(h||(h=E(['<div class="tiktok-cookie-setting-desc">',"</div>"])),e.groupDescription),Og.getSettingItemKeys(e.items).map((function(t){var i,r;return Re(p||(p=E(['<div class="tiktok-cookie-vendor-container"><div class="tiktok-cookie-vendor"><div class="tiktok-cookie-vendor-label-outside with-hover-effect"><p class="tiktok-cookie-vendor-label">','</p></div><span class="tiktok-cookie-vertical-info-icon" .innerHTML="','"></span><cookie-setting-switch .value="','" .disabled="','" @checkedChange="','"></cookie-setting-switch></div>',"</div>"])),(null===(i=e.items[t])||void 0===i?void 0:i.vendorName)||"",lt,Boolean(n.cookieConsent[t]),e.disabled,(function(){e.disabled||n.disagreeToOne(t)}),Re(v||(v=E(['<p class="tiktok-cookie-vendor-context">',"</p>"])),n.renderVendorDescription(null===(r=e.items[t])||void 0===r?void 0:r.description)))})))})),b,this.handleSave,g)}}]),n}(We);function am(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];window.dataLayer.push(arguments)}function sm(e){var t,n={};return e&&(n=null===(t=Object.keys(e))||void 0===t?void 0:t.reduce((function(t,n){return t[n]=e[n]?"granted":"denied",t}),{})),n}om.styles=ie(em),W([rt({attribute:"z-index"})],om.prototype,"zIndex",void 0),W([rt({converter:function(e){return"true"===e}})],om.prototype,"visible",void 0),W([rt({attribute:"user-config-ele-id"})],om.prototype,"userConfigEleId",void 0),W([rt()],om.prototype,"locale",void 0),W([rt({attribute:"setting-modal-close-disabled"})],om.prototype,"settingModalCloseDisabled",void 0),W([ot()],om.prototype,"deferredVisible",void 0),W([ot()],om.prototype,"userConfig",void 0),W([ot()],om.prototype,"cookieConsent",void 0),W([ot()],om.prototype,"customTheme",void 0),W([ot()],om.prototype,"tenantId",void 0),om=W([it("cookie-setting-modal")],om),window.dataLayer=window.dataLayer||[];var cm=new(function(){function e(){V(this,e)}return $(e,[{key:"defaultGrantAll",value:function(e){am("consent","default",S({ad_storage:"granted",analytics_storage:"granted",ad_user_data:"granted",ad_personalization:"granted"},sm(e)))}},{key:"defaultDenyAll",value:function(e){am("consent","default",S({ad_storage:"denied",analytics_storage:"denied",ad_user_data:"denied",ad_personalization:"denied"},sm(e)))}},{key:"updateGrantAll",value:function(e){am("consent","update",S({ad_storage:"granted",analytics_storage:"granted",ad_user_data:"granted",ad_personalization:"granted"},sm(e)))}},{key:"updateDenyAll",value:function(e){am("consent","update",S({ad_storage:"denied",analytics_storage:"denied",ad_user_data:"denied",ad_personalization:"denied"},sm(e)))}},{key:"initializeWithConsent",value:function(e){e.ga||e.optional?this.defaultGrantAll(e):this.defaultDenyAll(e)}},{key:"updateWithConsent",value:function(e){e.ga||e.optional?this.updateGrantAll(e):this.updateDenyAll(e)}}]),e}());[["tiktok-display-bold","TikTokDisplayFont-Bold.woff2?_default_font=1&v=2"],["tiktok-display-regular","TikTokDisplayFont-Regular.woff2?_default_font=1&v=2"],["tiktok-display-medium","TikTokDisplayFont-Semibold.woff2?_default_font=1&v=2"],["tiktok-text-bold","TikTokFont-Bold.woff2?_default_font=1&v=2"],["tiktok-text-regular","TikTokFont-Regular.woff2?_default_font=1&v=2"],["tiktok-text-medium","TikTokFont-SEMIBOLD.woff2?_default_font=1&v=2"]].forEach((function(e){var t=z(e,2),n=t[0],i=t[1];!function(e,t){var n=document.querySelector("style[data-tiktok-cookie-banner-font='".concat(e,"']"));n||((n=document.createElement("style")).setAttribute("data-tiktok-cookie-banner-font",e),n.innerHTML='\n @font-face {\n font-family: "'.concat(e,'";\n src: url("').concat(t,'");\n font-display: swap;\n }\n '),document.head.appendChild(n))}(n,"".concat(ct).concat(i))})),function(){var e,t=null===(e=document.currentScript)||void 0===e?void 0:e.src;t&&window.addEventListener("error",(function(e){e instanceof ErrorEvent&&e.filename===t&&$n("cookie_banner_js_error",S(S({},Hn(e.error,["name","message","stack"])),Hn(e,["filename","lineno","colno"])))}))}();var lm=function(e){I(i,e);var t,n=M(i);function i(){var e;return V(this,i),(e=n.apply(this,arguments)).disabled=!1,e.disabledAccessKey="",e.i18n={},e.disabledByPolicy=!1,e.settingVisible=!1,e.forceUpdater=1,e.disabledAccessKeyConfig=[],e.customTheme="",e.tenantId="",e.region="",e.isFTC=!1,e.previousShow=!1,e.isEffective=!1,e}return $(i,[{key:"showCookieBanner",get:function(){var e=!this._disabledByAccessKey()&&!this.disabledByPolicy&&Og.isShowCookieBanner({isEffective:this.isEffective,isFTC:this.isFTC});return e!==this.previousShow&&(e&&$n("cookie_banner_show"),this._sendEvent("bannerEvents",{type:e?"show":"hide"}),this.previousShow=e),e}},{key:"reload",value:(t=O(D().mark((function e(){return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.requestUpdate();case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"connectedCallback",value:function(){T(j(i.prototype),"connectedCallback",this).call(this);try{var e=Ig(this.userConfigEleId,this.locale);if(!e)return;$n("cookie_banner_load");var t=e.i18n,n=e.region,r=e.isFTC,o=e.disabled,a=e.isEffective,s=e.consent,c=e.disabledAccessKeys,l=e.consentApiDomain,u=e.customTheme,f=e.idcRegion,d=e.disableTea,h=e.tenantId;xg({config:s,region:n,consentApiDomain:l,idcRegion:f,disableTea:d,tea:e.tea,tenantId:h}),Object.assign(this,{i18n:t,region:n,isFTC:r,disabledByPolicy:o,isEffective:a,disabledAccessKeyConfig:c,customTheme:u,tenantId:h});var p=Og.getCookieConsents({isEffective:a,isFTC:r});cm.initializeWithConsent(p),this._execConsentsGetCallback(p),this.cookieConsent=p,this._updatePumbaaContext(a,r),this._updateLocalStorage(a,r)}catch(e){console.error(e)}}},{key:"updated",value:function(e){if(e.has("locale")){var t=Ig(this.userConfigEleId,this.locale);(null==t?void 0:t.i18n)&&(this.i18n=t.i18n)}}},{key:"firstUpdated",value:function(e){this._sendEvent("bannerEvents",{type:"renderCompleted"}),this._sendEvent("customBannerEvents",{eventName:"onRenderCompleted",payload:{showCookieBanner:this.showCookieBanner}})}},{key:"_disabledByAccessKey",value:function(){var e,t=this;try{return!!(this.disabled&&this.disabledAccessKey&&(null===(e=this.disabledAccessKeyConfig)||void 0===e?void 0:e.length))&&this.disabledAccessKeyConfig.some((function(e){var n=e.path,i=e.accessKeys,r=location.pathname;return new RegExp(n).test(r)&&(i.includes(t.disabledAccessKey)||i.includes("*"))}))}catch(e){return console.error("disabled by access key error, err=".concat(e)),!1}}},{key:"_updatePumbaaContext",value:function(e,t){var n,i,r;try{var o=Dg(e||t),a=document.head.querySelector('meta[name="pumbaa-ctx"]');a||((a=document.createElement("meta")).name="pumbaa-ctx",document.head.appendChild(a)),a.content="".concat(a.content?a.content+",":"","cb_enabled=").concat(o),(null===(n=window.__PNS_RUNTIME__)||void 0===n?void 0:n.updateContext)&&(null===(r=(i=window.__PNS_RUNTIME__).updateContext)||void 0===r||r.call(i,{cb_enabled:o}))}catch(e){console.error("update pumbaa context error"),console.error(e)}}},{key:"_updateLocalStorage",value:function(e,t){try{var n=Dg(e||t);localStorage.setItem(ut,n)}catch(n){console.error("update local is effective error"),console.error(n),this._updateWindow(e,t)}}},{key:"_updateWindow",value:function(e,t){try{var n=Dg(e||t);window[ut]=n}catch(e){console.error("window - update local is effective error"),console.error(e)}}},{key:"_execConsentsGetCallback",value:function(e){window.gtm_permission=e;var t={region:this.region,isFTC:this.isFTC,isEffective:this.isEffective};this._sendEvent("bannerEvents",{type:"consentGet",payload:[e,t]}),this._sendEvent("getConsent",{payload:{cookieConsent:e,consentOptions:t}})}},{key:"_handleDescClick",value:function(e){var t=e.target;if(t instanceof HTMLAnchorElement){var n=t.href;if(!n)return;n.includes("policy")?$n("cookie_banner_go_to_policy"):n.includes("cookie-settings")&&(e.preventDefault(),this.openSettingModal())}}},{key:"_handleConfirm",value:function(){var e=this.i18n.cookieBannerSaveToast,t=Og.setFullConsents();cm.updateWithConsent(t),this._execConsentsGetCallback(t),this._sendEvent("bannerEvents",{type:"accept"}),this.cookieConsent=t,Zg(e),$n("cookie_banner_accept")}},{key:"_handleDecline",value:function(){var e=this.i18n.cookieBannerSaveToast,t=Og.setEmptyConsents();cm.updateWithConsent(t),this._execConsentsGetCallback(t),this._sendEvent("bannerEvents",{type:"decline"}),this.cookieConsent=t,Zg(e),$n("cookie_banner_decline")}},{key:"_handleSave",value:function(e){var t=e.detail,n=this.i18n.cookieBannerSaveToast;cm.updateWithConsent(t),this._execConsentsGetCallback(t),this._sendEvent("bannerEvents",{type:"save",payload:[t]}),this.cookieConsent=t,Zg(n)}},{key:"_sendEvent",value:function(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t}))}},{key:"openSettingModal",value:function(e){this.settingVisible=!0,this.settingModalCloseDisabled=e,$n("cookie_banner_go_to_settings")}},{key:"render",value:function(){var e=this,t=this.locale,n=void 0===t?"en":t,i=this.i18n,r=this.tenantId,o=i.cookieBannerTitle,a=void 0===o?"":o,s=i.cookieBannerSubTitle,c=void 0===s?"":s,l=i.cookieBannerBtnDecline,u=void 0===l?"":l,f=i.cookieBannerBtnAccept,d=void 0===f?"":f,h=i.cookieBannerBtnSetting,p=void 0===h?"":h,v=this.showCookieBanner?Re(g||(g=E(['<div class="','"><div class="cookie-content"><p class="cookie-title">','</p><p class="cookie-desc" @click="','" .innerHTML="','"></p></div><div class="','">',' <button type="button" @click="','">','</button> <button type="button" @click="','">',"</button></div></div>"])),nt(S({"tiktok-cookie-banner":!0,"is-rtl":at.includes(n)},r?x({},r,!0):{})),a,this._handleDescClick,c,nt({"button-wrapper":!0,"special-button-wrapper":(null==u?void 0:u.length)>30||(null==d?void 0:d.length)>30}),p?Re(m||(m=E(['<button type="button" @click="','">',"</button>"])),this.openSettingModal,p):Ie,this._handleDecline,u,this._handleConfirm,d):Ie;return Re(_||(_=E(["<style>:host{","}</style>",'<cookie-setting-modal .visible="','" .settingModalCloseDisabled="','" .userConfigEleId="','" .locale="','" @close="','" @save="','"></cookie-setting-modal>'])),this.customTheme,v,this.settingVisible,this.settingModalCloseDisabled,this.userConfigEleId,this.locale,(function(){e.settingModalCloseDisabled||(e.settingVisible=!1)}),this._handleSave)}}]),i}(We);lm.styles=ie(Yg),W([rt()],lm.prototype,"locale",void 0),W([rt({attribute:"user-config-ele-id"})],lm.prototype,"userConfigEleId",void 0),W([rt({converter:function(e){return"true"===e}})],lm.prototype,"disabled",void 0),W([rt({attribute:"disabled-access-key"})],lm.prototype,"disabledAccessKey",void 0),W([ot()],lm.prototype,"i18n",void 0),W([ot()],lm.prototype,"userConfig",void 0),W([ot()],lm.prototype,"cookieConsent",void 0),W([ot()],lm.prototype,"disabledByPolicy",void 0),W([ot()],lm.prototype,"settingVisible",void 0),W([ot()],lm.prototype,"settingModalCloseDisabled",void 0),W([ot()],lm.prototype,"forceUpdater",void 0),W([ot()],lm.prototype,"disabledAccessKeyConfig",void 0),W([ot()],lm.prototype,"customTheme",void 0),W([ot()],lm.prototype,"tenantId",void 0),lm=W([it("tiktok-cookie-banner")],lm)}(this.reactJsxRuntime,this.react);
|
||
//# sourceMappingURL=default.eu-ttp.esm.js.map
|