tdem-web-sdk 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tdem.min.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * ===========================================================================
3
- * tdem-web-sdk@1.0.10 (c) 2026 TencentCloud Real User Monitoring.
3
+ * tdem-web-sdk@1.0.11 (c) 2026 TencentCloud Real User Monitoring.
4
4
  * Author pumpkincai.
5
- * Last Release Time Fri Sep 04 2026 10:32:25 GMT+0800 (China Standard Time).
5
+ * Last Release Time Mon Sep 28 2026 15:27:21 GMT+0800 (China Standard Time).
6
6
  * Released under the MIT License.
7
7
  * Thanks for supporting TDEM!
8
8
  * ===========================================================================
9
9
  **/
10
- ((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).TDEM=t()})(this,function(){var w,S;function E(e){this.name="__st"+(1e9*Math.random()>>>0)+w+"__",null!=e&&e.forEach(this.add,this),w+=1}Array.prototype.find||Object.defineProperty(Array.prototype,"find",{configurable:!0,writable:!0,value:function(e){if(null===this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=t[i];if(e.call(r,o,i,t))return o;i+=1}}}),window.WeakSet||(w=Date.now()%1e9,E.prototype.add=function(e){var t=this.name;return e[t]||Object.defineProperty(e,t,{value:!0,writable:!0}),this},E.prototype.delete=function(e){return!!e[this.name]&&!(e[this.name]=void 0)},E.prototype.has=function(e){return!!e[this.name]},S=E,Object.defineProperty(window,"WeakSet",{value:function(e){return new S(e)}})),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n<arguments.length;n++)if(null!=(r=arguments[n]))for(var r=Object(r),i=Object.keys(Object(r)),o=0,a=i.length;o<a;o++){var s=i[o],l=Object.getOwnPropertyDescriptor(r,s);null!=l&&l.enumerable&&(t[s]=r[s])}return t}});var C=function(e,t){return(C=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},x=function(){return(x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function P(e,a,s,l){return new(s=s||Promise)(function(n,t){function r(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,i)}o((l=l.apply(e,a||[])).next())})}function D(r,i){var o,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!((s=0<(s=l.trys).length&&s[s.length-1])||6!==t[0]&&2!==t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=i.call(r,l)}catch(e){t=[6,e],a=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function g(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function R(e,t){return void 0===t&&(t="https://dem.rumt-zh.com"),t=(e.url||"").replace(/\/+$/,"")||("string"==typeof t?t:"https://dem.rumt-zh.com"),e.url=t,e.hostUrl=t,e.offlineUrl=t+"/offline",e.whiteListUrl=t+"/collect/whitelist",e.pvUrl=t+"/collect/pv",e.eventUrl=t+"/collect/events",e.speedUrl=t+"/speed",e.customTimeUrl=t+"/speed/custom",e.performanceUrl=t+"/speed/performance",e.performanceUrlForHippy=t+"/speed/hippyPerformance",e.webVitalsUrl=t+"/speed/webvitals",e.setDataReportUrl=t+"/speed/miniProgramData",e}function O(e){try{return localStorage.getItem(e)}catch(e){return null}}function T(e,t){try{localStorage.setItem(e,t)}catch(e){}}function L(e,t){try{return e?JSON.parse(e):t}catch(e){return t}}var F,U=/_?t(\d)?(imestamp)?=\d+&?/g,z=["aegis.qq.com","tamaegis.com","/aegis-sdk","rumt-","/flog.core.min.js","pingfore.qq.com","pingfore.tencent.com","zhiyan.tencent-cloud.net","h.trace.qq.com","btrace.qq.com","beacon.qq.com","dmplog.qq.com","qq.com/report","svibeacon.onezapp.com","cube.weixinbridge.com","doubleclick.net","pcmgrmonitor.3g.qq.com","tdm.qq.com","report.qqweb.qq.com","tpstelemetry.tencent.com","galileotelemetry.tencent.com","insight.cloud.tencent.com","facebook.com","facebook.net","google","yahoo.com","twitter.com","ga-audiences","report.idqqimg.com","arms-retcode.aliyuncs.com","px.effirst.com","sentry","baidu.com","hot-update.json","u.c.b.r.o.w.s.e.r","report.url.cn","sockjs-node","m3u8","flv"],B=["ResizeObserver loop limit exceeded","ResizeObserver loop completed","Failed to execute 'transaction'","window.indexedDB.deleteDatabase is not a function"],j=["ext1","ext2","ext3","ext4","ext5","ext6","ext7","ext8","ext9","ext10","level","trace","tag","seq","code"],W=["static","fetch"],H="unknown",q=(V.prototype.indexOf=function(e,t){for(var n=0;n<e.length;n++)if(e[n].callback===t)return n;return-1},V.prototype.on=function(e,t,n){var r;if(void 0===n&&(n=0),this)return(r=this.eventsList[e])||(this.eventsList[e]=[],r=this.eventsList[e]),-1===this.indexOf(r,t)&&r.push({name:e,type:n||0,callback:t}),this},V.prototype.one=function(e,t){this.on(e,t,1)},V.prototype.remove=function(e,t){if(this){var n=this.eventsList[e];if(n){if(t)return n.length&&(t=this.indexOf(n,t),n.splice(t,1)),this;try{delete this.eventsList[e]}catch(e){}}return null}},V.prototype.clear=function(){this.eventsList={}},V);function V(){var a=this;this.emit=function(e,t){if(a){var n;if(null!=(r=a.eventsList[e])&&r.length)for(var r=r.slice(),i=0;i<r.length;i++){n=r[i];try{var o=n.callback.apply(a,[t]);if(1===n.type&&a.remove(e,n.callback),!1===o)break}catch(e){throw e}}return a}},this.eventsList={}}function G(e){if(null!=e){e=String(e).trim();if(e){var t=e.toLowerCase();if(t!==H&&"undefined"!==t&&"null"!==t&&"未知"!==e)return e}}}(e=F=F||{})[e.number=-1]="number",e.string="";function Z(e,t){return"number"==typeof e||"string"==typeof e?e:t?F.string:F.number}function J(e,t){return"string"==typeof e?e.split("?")[t?1:0]||"":e}function K(e,t){return void 0===t&&(t=2048),String(e).replace(U,"").slice(0,t)}function $(e){return"string"==typeof e&&/^\//.test(e)?"https:"===(null==location?void 0:location.protocol):/^https/.test(e)}function X(e,t,n){var r,i,o;try{if("function"==typeof(null==t?void 0:t.retCodeHandler))return{code:void 0===(o=(i=t.retCodeHandler(e,null==n?void 0:n.url,null==n?void 0:n.ctx,null==n?void 0:n.payload)||{}).code)?H:o,isErr:i.isErr};if(!(e="string"==typeof e?JSON.parse(e):e))return{code:H,isErr:!1};"function"==typeof(null==(r=null==t?void 0:t.ret)?void 0:r.join)&&(le=[].concat(t.ret.map(function(e){return e.toLowerCase()})));var a=Object.getOwnPropertyNames(e).filter(function(e){return-1!==le.indexOf(e.toLowerCase())});return a.length?{code:""+(o="未知"!==(o=e[a[0]])&&""!==o?o:H),isErr:0!==o&&"0"!==o&&o!==H}:{code:H,isErr:!1}}catch(e){return{code:H,isErr:!1}}}function ee(e,t,n){try{var r="function"==typeof t?t(e,null==n?void 0:n.url,null==n?void 0:n.ctx)||"":e;return de(r).slice(0,10240)}catch(e){return""}}function te(e){if("string"==typeof e)return e;try{return e instanceof Error?(JSON.stringify(e,ue(),2)||"undefined").replace(/"/gim,""):JSON.stringify(e,ue(),2)||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}}function ne(e,t){var n,r={fetch:[],static:[],bridge:[]},i=new FormData;return Array.isArray(e)?e.forEach(function(e){var t=pe(e);r[e.type].push(t)}):(n=pe(e),r[e.type].push(n)),i.append("payload",ce(x({duration:r},t))),i}function re(t,e){return"string"!=typeof t||!t||e&&-1<t.indexOf(e)||me.test(t)||z.some(function(e){return-1<t.indexOf(e)})}var oe,ae=["application/xhtml+xml","application/xml","application/pdf","application/pkcs12","application/javascript","application/x-javascript","application/ecmascript","application/vnd.mspowerpoint","application/vnd.apple.mpegurl","application/ogg","text/css","text/javascript","image","audio","video","video/mp2t"],se=/\.(json|js|css|jpg|jpeg|png|svg|apng|webp|gif|bmp|mp4|mp3|ts|mpeg|wav|webm|ogg|flv|m3u8|ttf|woff2|otf|eot|woff|html|htm|shtml|shtm|)$/i,le=["ret","retcode","code","errcode"],ue=function(){var n=new WeakSet;return function(e,t){if(t instanceof Error)return"Error.message: "+t.message+" \n Error.stack: "+t.stack;if("object"==typeof t&&null!==t){if(n.has(t))return"[Circular "+(e||"root")+"]";n.add(t)}return t}},ce=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e,ue())||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}},de=function(n,r){void 0===r&&(r=3);var i,o,a,s="";return Array.isArray(n)?(s+="[",i=n.length,n.forEach(function(e,t){s=(s+="object"==typeof e&&1<r?de(e,r-1):fe(e))+(t===i-1?"":",")}),s+="]"):n instanceof Object||"object"==typeof n?(s="{",o=Object.keys(n),a=o.length,o.forEach(function(e,t){"object"==typeof n[e]&&1<r?s+='"'+e+'":'+de(n[e],r-1):s+=he(e,n[e]),s+=t===a-1||t<a-1&&void 0===n[o[t+1]]?"":","}),s+="}"):s+=n,s},he=function(e,t){var n=typeof t,r="";return"string"==n||"object"==n?r+='"'+e+'":"'+t+'"':"function"==typeof t?r+='"'+e+'":"function '+t.name+'"':"symbol"==typeof t?r+='"'+e+'":"symbol"':"number"!=typeof t&&"boolean"!=n||(r+='"'+e+'": '+t),r},fe=function(e){var t=typeof e;return""+("undefined"==t||"symbol"==t||"function"==t?"null":"string"==t||"object"==t?'"'+e+'"':e)},pe=function(t){var n;return t.payload?(n={},Object.keys(t).forEach(function(e){"payload"!==e&&(n[e]=t[e])}),n):t},me=/data:(image|text|application|font)\/.*;base64/;(e=oe=oe||{}).LOG="log",e.SPEED="speed",e.PERFORMANCE="performance",e.OFFLINE="offline",e.WHITE_LIST="whiteList",e.VITALS="vitals",e.PV="pv",e.CUSTOM_PV="customPV",e.EVENT="event",e.CUSTOM="custom",e.SDK_ERROR="sdkError",e.SET_DATA="setData",e.LOAD_PACKAGE="loadPackage",e.MEMORY="memory";var ve,M,I,ge={maxAttempts:3,delays:[0,1e3,3e3]};function A(){return"evt_"+Date.now()+"_"+Math.random().toString(36).substring(2,8)}function ye(e){var t=[];if(e.stack)for(var n=0,r=0,i=e.stack.split("\n");r<i.length;r++){var o,a,s,l,u,c=i[r],d=c.match(/at\s+(.+?)\s+\((.+?):(\d+):(\d+)\)/);d?(o=d[1],a=d[2],s=d[3],l=d[4],u=a.split("/").pop()||a,t.push({abs_path:a,colno:parseInt(l,10),filename:u,function:o||"(anonymous)",lineno:parseInt(s,10),in_app:a.includes("node_modules")||a.includes("cdn")?0:1,stack_level:n++})):(d=c.match(/at\s+(.+?):(\d+):(\d+)/))&&(a=d[1],s=d[2],l=d[3],u=a.split("/").pop()||a,t.push({abs_path:a,colno:parseInt(l,10),filename:u,function:"(anonymous)",lineno:parseInt(s,10),in_app:a.includes("node_modules")||a.includes("cdn")?0:1,stack_level:n++}))}return t}(e=ve=ve||{}).production="production",e.development="development",e.gray="gray",e.pre="pre",e.daily="daily",e.local="local",e.test="test",e.others="others",(e=M=M||{}).JS_ERROR="js_error",e.PROMISE_ERROR="promise_error",e.RESOURCE_ERROR="resource_error",e.API_ERROR="api_error",e.BLANK_SCREEN="blank_screen",e.PAGE_LOAD="page_load",e.RESOURCE_LOAD="resource_load",e.API_CALL="api_call",e.true="web_vitals",e.LAG_DETECTED="lag_detected",e.NO_RESPONSE="no_response",e.MEMORY_USAGE="memory_usage",e.MEMORY_OOM="memory_oom",e.FILE_IO="file_io",e.CLICK="click",e.SCROLL="scroll",e.LONG_PRESS="long_press",e.PAGE_VIEW="page_view",e.TAB_HIDDEN="tab_hidden",e.TAB_VISIBLE="tab_visible",e.WINDOW_BLUR="window_blur",e.WINDOW_FOCUS="window_focus",e.FORM_FOCUS="form_focus",e.FORM_BLUR="form_blur",e.FORM_CHANGE="form_change",e.FORM_SUBMIT="form_submit",e.FORM_SUBMIT_RESULT="form_submit_result",e.STRUGGLE="struggle",e.CUSTOM="custom",e.LOG="log",(e=I=I||{}).ERROR="error",e.PERFORMANCE="performance",e.BEHAVIOR="behavior",e.NETWORK="network",e.LOG="log",e.CUSTOM="custom";function we(u,c){return function(i,o){var s,a,l,e,t,n;null!=i&&i.log&&null!=i&&i.type?(s=function(e,t){var n,r,t=x(x({},u.bean),{from:t}),i=x({},u.bean);return(()=>{try{return"undefined"!=typeof FormData&&"function"==typeof FormData.prototype.append}catch(e){}})()?ne(e,t):(t=e,e=i,r={fetch:[],static:[],bridge:[]},i={},Array.isArray(t)?t.forEach(function(e){var t;null!=(t=r[e.type])&&t.push(e)}):null!=(n=r[t.type])&&n.push(t),i.payload=JSON.stringify(x({duration:r},e)),i)},a=function(e,t,n,r){switch(t){case oe.LOG:o=e;var i=(Array.isArray(o)?o:[o]).map(function(n){return Object.getOwnPropertyNames(n).reduce(function(e,t){return"ctx"!==t&&(e[t]=n[t]),e},{level:"2",msg:""})});if(!i||0===i.length)return"{}";i=Array.isArray(i)?i:[i];var o=Array.from(new Set(i.flatMap(function(e){return Object.keys(e)}))),a={};return o.forEach(function(t){a[t]=i.map(function(e){return e[t]||""})}),a.count=i.length,ce(a);case oe.SPEED:return s(e,n);case oe.EVENT:return r;default:return r||{}}var o},1!==(e=Array.isArray(i.log)?i.log:[i.log]).length?(l={},e.forEach(function(e){var t=e.from||"undefined";delete e.from,l[t]||(l[t]=[]),l[t].push(e)}),Object.keys(l).forEach(function(e){var t,n=l[e],r=null!=(r=i.url)&&r.includes("?")?"&":"?";"undefined"===e?(t=""+i.url,o(x(x({},i),{url:t,log:1===n.length?n[0]:n,data:a(n,c,e,i.data)}))):(t=i.url+r+"from="+e,o(x(x({},i),{url:t,log:1===n.length?n[0]:n,beanFilter:g(i.beanFilter||[],["from"]),data:a(n,c,e,i.data)})))})):(t=(e=e[0]).from,delete e.from,n=null!=(n=i.url)&&n.includes("?")?"&":"?",t?(n=i.url+n+"from="+t,o(x(x({},i),{url:n,log:e,beanFilter:g(i.beanFilter||[],["from"]),data:a(e,c,t,i.data)}))):(n=""+i.url,o(x(x({},i),{url:n,log:e,data:a(e,c,t,i.data)}))))):o(i)}}function be(l,u){return function(e,t){var n,r,i,o=Array.isArray(e),a=o?e:[e],s=(l.lifeCycle.emit("beforeRequest",e),l.config.beforeRequest);(a="function"==typeof s?a.map(function(t){try{var e=s({logs:t,logType:u});return(null==e?void 0:e.logType)===u&&null!=e&&e.logs?e.logs:!1!==e&&t}catch(e){return t}}).filter(function(e){return!1!==e}):a).length&&(n=a,e=j,!Array.isArray(n)||n.length<=1||(r=[],i=[],!(i="string"==typeof e?[e]:e))||i.length<=0||(i.forEach(function(t){n.forEach(function(e){null!=e&&e[t]&&r.push(t)})}),0<r.length&&(n=n.map(function(e){var t={};return r.forEach(function(e){t[e]=""}),x(x({},t),e)}))),a=n,t(o?a:a[0]))}}function ke(i){return function(e,t){i.lifeCycle.emit("modifyRequest",e);var n=i.config.modifyRequest;if("function"==typeof n)try{var r=n(e);"object"==typeof r&&"url"in r&&(e=r)}catch(e){console.error(e)}t(e)}}function _e(r){return function(e,t){null!=(n=r.lifeCycle)&&n.emit("afterRequest",e);var n=(r.config||{}).afterRequest;"function"==typeof n&&!1===n(e)||t(e)}}var Se=function(e){return e.filter(function(n,r){return"static"!==n.type||!e.find(function(e,t){return n.url===e.url&&200===n.status&&r<t})})},Ee={},Ce={},Re=function(e){return Ee[e]||(Ee[e]=setTimeout(function(){Ce[e]={},Ee[e]=null},6e4)),Ee[e]},Oe={generateTraceId:xe(16),generateSpanId:xe(8)},Te=Array(32);function xe(t){return function(){for(var e=0;e<2*t;e++)Te[e]=Math.floor(16*Math.random())+48,58<=Te[e]&&(Te[e]+=39);return String.fromCharCode.apply(null,Te.slice(0,2*t))}}function Me(){return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)})}function Fe(){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)})}function Ue(e){for(var t,n,r,i="",o=0,a=(e=String(e)).length%3;o<e.length;){if(255<(t=e.charCodeAt(o++))||255<(n=e.charCodeAt(o++))||255<(r=e.charCodeAt(o++)))throw new TypeError("Failed to execute 'btoa': The string to be encoded contains characters outside of the Latin1 range.");i+=je.charAt((t=t<<16|n<<8|r)>>18&63)+je.charAt(t>>12&63)+je.charAt(t>>6&63)+je.charAt(63&t)}return a?i.slice(0,a-3)+"===".substring(a):i}function ze(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!We.test(e))throw new TypeError("Failed to execute 'atob': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var n,r,i="",o=0;o<e.length;)t=je.indexOf(e.charAt(o++))<<18|je.indexOf(e.charAt(o++))<<12|(n=je.indexOf(e.charAt(o++)))<<6|(r=je.indexOf(e.charAt(o++))),i+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return i}function Be(e){var t,n="";return n="object"==typeof e&&(t=(e=((e,t)=>{for(var n=0;n<t.length;n++){var r=t[n],i=e[r]||"function"==typeof e.get&&e.get(r);if(i)return[r,i]}return["",""]})(e,Object.keys(qe)))[0])?qe[t](e[1]):n}var je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",We=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,He=(Ve.prototype.generate=function(e,t,n){if(void 0===t&&(t={}),this.url=e,!this.isUrlIgnored()&&this.isUrlInTraceUrls()&&this.traceType){switch(this.traceType){case"traceparent":this.traceId=this.createTraceparent();break;case"b3":this.traceId=this.createB3();break;case"sw8":this.traceId=this.createSw8(n);break;case"sentry-trace":this.traceId=this.createSentryTrace();break;default:return console.warn("this trace key "+this.traceType+" is not supported"),void(this.traceId="")}return t[this.traceType]&&(this.traceId=t[this.traceType]),{name:this.traceType,value:this.traceId}}},Ve.prototype.createTraceparent=function(){var e=Oe.generateSpanId();return"00-"+Oe.generateTraceId()+"-"+e+"-0"+this.traceFlag.toString(16)},Ve.prototype.createB3=function(){var e=Oe.generateSpanId();return Oe.generateTraceId()+"-"+e+"-"+this.traceFlag},Ve.prototype.createSw8=function(e){var t="function"==typeof btoa?btoa:Ue,e=e||{},n=e.host,n=void 0===n?"":n,e=e.pathname,e=void 0===e?"":e,r=Fe(),i=Fe();return"1-"+String(t(i))+"-"+String(t(r))+"-1-"+String(t("tdem"))+"-"+String(t("1.0.10"))+"-"+String(t(encodeURI(e)))+"-"+String(t(n))},Ve.prototype.createSentryTrace=function(){var e=Me().substring(16);return Me()+"-"+e+"-"+this.traceFlag},Ve.prototype.isUrlIgnored=function(){if(Array.isArray(this.ignoreUrls)&&0!==this.ignoreUrls.length)for(var e=0,t=this.ignoreUrls;e<t.length;e++){var n=t[e];if(this.urlMatches(this.url,n))return!0}return!1},Ve.prototype.isUrlInTraceUrls=function(){if(!this.urls)return!0;if(Array.isArray(this.urls)){if(0===this.urls.length)return!1;for(var e=0,t=this.urls;e<t.length;e++){var n=t[e];if(this.urlMatches(this.url,n))return!0}}return!1},Ve.prototype.urlMatches=function(e,t){return"string"==typeof t?e===t:!!e.match(t)},Ve),qe={sw8:function(e){var t="function"==typeof atob?atob:ze,e=e.split("-")[1];return e?t(e):""},traceparent:function(e){return e.split("-")[1]},b3:function(e){return e.split("-")[0]},"sentry-trace":function(e){return e.split("-")[0]}};function Ve(e,t,n,r){void 0===n&&(n=null),this.traceType=e,this.ignoreUrls=t,this.urls=n,this.traceFlag=null==r?1:Number(!!r)}function Ge(l){return function(e){e&&0!==e.length&&l.sendPipeline([function(t,e){var n,r,i,o,a={protocol_version:2,project_key:String(l.config.id||""),sdk:{name:l.sdkName,version:l.sdkVersion},app:{version:String(l.config.version||"1.0.0")},context:(n=l,r=String((null==(a=null==(a=null==(r=n.sessionManager)?void 0:r.getSession)?void 0:a.call(r))?void 0:a.id)||n.bean.sessionId||""),a=String(n.config.userId||n.config.uin||""),r={session_id:r,platform:(r=String(n.runtimePlatform||n.config.platform||"web").trim().toLowerCase(),["web","miniprogram","uniapp","android","ios","electron","unknown"].includes(r)?r:["wx","my","qq","tt"].includes(r)?"miniprogram":"undefined"!=typeof window?"web":"unknown")},a&&(r.user_id=a),a=n.bean.runtime?String(n.bean.runtime):"",s=n.bean.processType?String(n.bean.processType):"",i=void 0!==n.bean.windowId?String(n.bean.windowId):"",o=void 0!==n.bean.webContentsId?String(n.bean.webContentsId):"",n=n.bean.appVersion?String(n.bean.appVersion):"",a&&(r.runtime=a),s&&(r.process_type=s),i&&(r.window_id=i),o&&(r.web_contents_id=o),n&&(r.app_version=n),"undefined"!=typeof navigator&&(r.user_agent=navigator.userAgent,r.language=navigator.language),"undefined"!=typeof screen&&(r.screen_resolution=screen.width+"x"+screen.height),r),events:t},s=String(l.config.url||"").replace(/\/+$/,"");s&&e({url:s+"/api/v1/collect/events",data:JSON.stringify(a),method:"POST",contentType:"application/json",addBean:!1,type:oe.EVENT,log:t,success:function(){l.lifeCycle.emit("afterReport",{success:!0,events:t})},fail:function(e){l.lifeCycle.emit("afterReport",{success:!1,error:e,events:t})}})}],oe.EVENT)(e)}}function Ze(n){if(n&&n.reduce&&n.length)return 1===n.length?function(e,t){n[0](e,t||Xe)}:n.reduce(function(n,r){return function(e,t){return void 0===t&&(t=Xe),n(e,function(e){return null==r?void 0:r(e,t)})}});throw new TypeError("createPipeline need at least one function param")}function Je(t,n){Object.getOwnPropertyNames(t).forEach(function(e){"function"==typeof t[e]&&"constructor"!==e&&(n?n[e]="sendPipeline"===e?function(){return function(){}}:function(){}:t[e]=function(){})})}function Ke(){return void 0!==window.performance&&"function"==typeof performance.getEntriesByType&&"function"==typeof performance.now}function $e(e){var t;return-1<(null==(t=null==(t=window.PerformanceObserver)?void 0:t.supportedEntryTypes)?void 0:t.indexOf(e))}var Xe=function(){},Ye={low:1,medium:3,high:5},Qe=new Set(["custom_struggle_name","form_id","field_id","trigger_event_id","struggle_status","struggle_owner_type","struggle_owner_key","detection_source","rule_version"]),et={rage_click:3,dead_click:4,error_click:4,form_validation_error:3,slow_page:3,back_forward:2,long_focus_time:2,form_zigzag:2,uncompleted_form:3,custom_struggle:3},tt={rage_click:4,dead_click:5,error_click:5,form_validation_error:4,slow_page:4,back_forward:3,long_focus_time:3,form_zigzag:3,uncompleted_form:3,custom_struggle:3},nt=(d.use=function(e){-1===d.installedPlugins.indexOf(e)&&e.tdemPlugin&&d.installedPlugins.push(e)},d.unuse=function(e){e=d.installedPlugins.indexOf(e);-1!==e&&d.installedPlugins.splice(e,1)},d.prototype.getInternalTransport=function(){return this.internalTransport},d.prototype.setInternalTransport=function(e){this.internalTransport=e},d.prototype.getInternalRetrySchedule=function(){return this.internalRetrySchedule},d.prototype.transportRequest=function(t,n){return P(this,void 0,void 0,function(){return D(this,function(e){switch(e.label){case 0:if(this.internalTransport)return[4,this.internalTransport.request(t,n)];throw new Error("Internal Transport is not configured");case 1:return[2,e.sent()||{ok:!0,request:t}]}})})},d.prototype.transportHandoff=function(t,n){return P(this,void 0,void 0,function(){return D(this,function(e){switch(e.label){case 0:if(this.internalTransport)return[4,(this.internalTransport.handoff||this.internalTransport.request).call(this.internalTransport,x(x({},t),{handoff:!0}),n)];throw new Error("Internal Transport is not configured");case 1:return[2,e.sent()||{ok:!0,request:t,handoffAccepted:!0}]}})})},d.prototype.init=function(e){this.setConfig(e),this.config=R(this.config,e.hostUrl);for(var t=0;t<d.installedPlugins.length;t++)try{d.installedPlugins[t].patch(this)}catch(e){this.sendSDKError(e)}this.lifeCycle.emit("onInited")},d.prototype.destroy=function(e){void 0===e&&(e=!1);var t,n,r=d.instances.indexOf(this);-1!==r&&d.instances.splice(r,1);for(var i=d.installedPlugins.length-1;0<=i;i--)try{d.installedPlugins[i].unpatch(this)}catch(e){this.sendSDKError(e)}if(this.lifeCycle.emit("destroy"),this.lifeCycle.clear(),e)t=this,n=Object.getOwnPropertyDescriptors(t),Object.keys(n).forEach(function(e){n[e].writable&&(t[e]=null)}),Object.setPrototypeOf(this,null);else{for(var o=this;o.constructor!==Object&&Je(o,this),o=Object.getPrototypeOf(o););0===d.instances.length&&(r=Object.getPrototypeOf(this).constructor,Je(r),Je(d))}},d.prototype.setConfig=function(e){Object.assign(this.config,e);var e=this.config,t=e.id,n=e.uin,r=e.version,i=e.aid,o=e.env,a=void 0===o?"production":o,o=e.pageUrl,e=e.userId||(null!=n?String(n):""),n=this.bean.id!==t||this.bean.uin!==e||this.bean.aid!==i;return this.bean.id=t||"",this.bean.uin=e,this.bean.version=r||"1.0.10",this.bean.aid=i||"",this.bean.env=(()=>{switch(a){case ve.production:case ve.development:case ve.gray:case ve.pre:case ve.daily:case ve.local:case ve.test:case ve.others:return 1;default:return}})()?a:ve.others,o&&this.extendBean("from",encodeURIComponent(o.slice(0,2048))),n&&this.lifeCycle.emit("onConfigChange",this.config),this.config},d.prototype.extendBean=function(e,t){this.bean[e]=t},d.prototype.send=function(e,i,o){var t=this;return Ze([ke(this),we(this,null==e?void 0:e.type),function(n,r){t.request(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r({isErr:!1,result:e,logType:n.type,logs:n.log}),null!=i&&i.apply(void 0,e)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r({isErr:!0,result:e,logType:n.type,logs:n.log}),null!=o&&o.apply(void 0,e)})},_e(this)])(e)},d.prototype.sendSDKError=function(e){var n=this;this.sendPipeline([function(e,t){t({url:n.config.url+"?id=1085&msg[0]="+encodeURIComponent(te(e))+"&level[0]=2&from="+n.config.id+"&count=1&version="+n.config.id+"(1.0.10)",addBean:!1,method:"get",type:oe.SDK_ERROR,log:e})}],oe.SDK_ERROR)(e)},d.prototype.sendPipeline=function(e,t){var n,o=this;return Ze(g([function(e,t){if(e&&e.type===oe.EVENT)return t(e);if("number"!=typeof n.config.random&&(console.warn("random must in [0, 1], default is 1."),n.config.random=1),!n.isHidden||!n.isGetSample)if(n.isGetSample)n.isHidden||t(e);else{if(n.isGetSample=!0,Math.random()<n.config.random)return n.isHidden=!1,t(e);n.isHidden=!0}},be(n=this,t)],e,[we(this,t),ke(this),function(r,i){o.request(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;-1<(""+e[o.failRequestCount=0]).indexOf("403 forbidden")&&(n=!0,o.destroy()),i({isErr:n,result:e,logType:null==r?void 0:r.type,logs:null==r?void 0:r.log}),null!=(n=null==r?void 0:r.success)&&n.call.apply(n,g([r],e))},function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];60<=++o.failRequestCount&&o.destroy(),-1<(""+t[0]).indexOf("403 forbidden")&&o.destroy(),i({isErr:!0,result:t,logType:null==r?void 0:r.type,logs:null==r?void 0:r.log}),null!=(e=null==r?void 0:r.fail)&&e.call.apply(e,g([r],t))})},_e(this)]))},d.prototype.track=function(e,t){void 0===t&&(t={}),e&&"string"==typeof e?(e={event_id:A(),event_type:M.CUSTOM,event_category:I.CUSTOM,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(),data:{event_name:e,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(t.properties)}},this.reportTDEMEvent(e)):console.warn("track: name must be a non-empty string")},d.prototype.trackStruggle=function(e,t){void 0===t&&(t={});var n,e="string"==typeof e?e.trim():"";!e||128<e.length?console.warn("trackStruggle: name must be a non-empty string limited to 128 characters"):(n=t.severity||"medium",(n=Ye[n])?this.reportStruggle({type:"custom_struggle",ownerType:"business",ownerKey:e,severity:n,detectionSource:"custom",ruleVersion:"custom-v1",tags:t.tags,properties:x(x({},t.properties||{}),{custom_struggle_name:e})}):console.warn("trackStruggle: severity must be low, medium, or high"))},d.prototype.reportTDEMEvent=function(e){var n=this,e=Array.isArray(e)?e:[e];e.length&&(e=e.map(function(e){var t;return x(x({},e),{page_url:e.page_url||n.getCurrentEventPageUrl(),data:x(x(x({},e.data),null!=(t=e.data)&&t.replay_id||!n.getCurrentReplayId()?{}:{replay_id:n.getCurrentReplayId()}),n.mergeEventTags(null==(t=e.data)?void 0:t.tags)?{tags:n.mergeEventTags(null==(t=e.data)?void 0:t.tags)}:{})})}),this.lifeCycle.emit("tdemEventCreated",e),this.tdemEventPipeline(e))},d.prototype.measure=function(e,t,n){void 0===n&&(n={}),e&&"string"==typeof e?"number"==typeof t?t<0||2147483646<t?console.warn("measure: duration must between 0 and 2147483646"):this.submitMeasure(e,t,n):console.warn("measure: duration must be a number"):console.warn("measure: name must be a non-empty string")},d.prototype.startMeasure=function(e){"string"==typeof e&&e?this.timeMap[e]?console.warn("Measure "+e+" already exists"):this.timeMap[e]=Date.now():console.warn("startMeasure: name must be a non-empty string")},d.prototype.endMeasure=function(e,t){var n;void 0===t&&(t={}),"string"==typeof e&&e?void 0!==(n=this.getTimeEventDuration(e))?(this.submitMeasure(e,n,t),delete this.timeMap[e]):console.warn("Measure "+e+" does not exist"):console.warn("endMeasure: name must be a non-empty string")},d.prototype.captureMessage=function(e,t){var n;void 0===t&&(t={}),"string"==typeof e&&e?(n="error"===t.level?"error":"warn"===t.level?"warn":"info",n={event_id:A(),event_type:M.LOG,event_category:I.LOG,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(t.pageUrl),data:{log_level:n,replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(x({message:e},t.properties||{}))}},this.reportTDEMEvent(n)):console.warn("captureMessage: message must be a non-empty string")},d.prototype.captureException=function(e,t){void 0===t&&(t={});var e="string"==typeof e?new Error(e):e;e instanceof Error?(e={event_id:A(),event_type:M.JS_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(t.pageUrl),data:{exception_stacks:[{type:e.name||"Error",value:e.message,mechanism_type:"manual",mechanism_handled:1}],exception_frames:ye(e),replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(x(x({},t.properties||{}),t.level?{capture_level:t.level}:{}))}},this.reportTDEMEvent(e)):console.warn("captureException: error must be an Error or string")},d.prototype.setTags=function(e){e=this.sanitizeEventTags(e);this.setConfig({defaultTags:x(x({},this.config.defaultTags||{}),e||{})})},d.prototype.removeTags=function(e){var t,e=Array.isArray(e)?e:[e];e.length&&(t=x({},this.config.defaultTags||{}),e.forEach(function(e){delete t[e]}),this.setConfig({defaultTags:t}))},d.prototype.clearTags=function(){this.setConfig({defaultTags:{}})},d.prototype.setUser=function(e){"string"==typeof e&&e?this.setConfig({userId:e}):console.warn("setUser: userId must be a non-empty string")},d.prototype.clearUser=function(){this.setConfig({userId:"",uin:""})},d.prototype.reportStruggle=function(e){var t,n,r;e&&e.type&&e.ownerType&&e.ownerKey?(r=e.type,t="number"==typeof e.severity?e.severity:et[r],n="number"==typeof e.weight?e.weight:tt[r],r={event_id:A(),event_type:M.STRUGGLE,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl),data:{event_name:r,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(e.tags),is_effective_action:!1,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),struggle_weight:n,struggle_severity:t,struggle_value:"number"==typeof e.value?e.value:n*t,event_properties:x(x({},this.sanitizeStruggleProperties(e.properties)),{form_id:e.formId||"",field_id:e.fieldId||"",trigger_event_id:e.triggerEventId||"",struggle_status:e.status||"detected",struggle_owner_type:e.ownerType,struggle_owner_key:e.ownerKey,detection_source:e.detectionSource||"sdk_auto",rule_version:e.ruleVersion||this.getDefaultRuleVersion()})}},this.reportTDEMEvent(r)):console.warn("reportStruggle params error")},d.prototype.reportFormSubmitResult=function(e){e&&e.status?(e={event_id:A(),event_type:M.FORM_SUBMIT_RESULT,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl),data:{event_name:e.eventName||"form_submit_"+e.status,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(e.tags),is_effective_action:"boolean"!=typeof e.isEffectiveAction||e.isEffectiveAction,trigger_event_id:e.triggerEventId,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),validation_message:e.validationMessage?e.validationMessage.slice(0,256):void 0,event_properties:{status:e.status,validation_code:e.validationCode||"",form_id:e.formId||"",field_id:e.fieldId||""}}},this.reportTDEMEvent(e)):console.warn("reportFormSubmitResult params error")},d.prototype.reportPageView=function(e,t){void 0===t&&(t={});e=this.getCurrentEventPageUrl(e||t.pageUrl),e={event_id:A(),event_type:M.PAGE_VIEW,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:e,data:{page_title:t.pageTitle||"",referrer:t.referrer,replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(x(x(x(x(x(x(x({},t.properties||{}),t.navigationType?{navigation_type:t.navigationType}:{}),t.fromPage?{from_page:t.fromPage}:{}),t.toPage?{to_page:t.toPage}:{}),"boolean"==typeof t.isFirstVisit?{is_first_visit:t.isFirstVisit?"1":"0"}:{}),"boolean"==typeof t.isFirstLoad?{is_first_load:t.isFirstLoad?"1":"0"}:{}),t.deviceType?{device_type:t.deviceType}:{}))}};this.reportTDEMEvent(e)},d.prototype.setPage=function(e,t){var n;e&&"string"==typeof e?(n=this._customPageUrl||this.getCurrentEventPageUrl(),this._customPageUrl=e,this.reportPageView(e,{pageTitle:null==t?void 0:t.pageTitle,navigationType:"push",fromPage:(n||"").slice(0,512),toPage:e.slice(0,512),isFirstVisit:!1,tags:x({source:"manual",environment:this.config.env||"production",version:String(this.config.version||"")},null!=t&&t.pageGroup?{page_group:t.pageGroup}:{})}),this.lifeCycle.emit("pageChanged",{pageUrl:e,previousUrl:n,source:"manual"})):console.warn("setPage: pageUrl must be a non-empty string")},d.prototype.leavePage=function(){var e;this._customPageUrl&&(e=this._customPageUrl,this._customPageUrl=null,this.lifeCycle.emit("pageChanged",{pageUrl:this.getCurrentEventPageUrl(),previousUrl:e,source:"auto"}))},d.prototype.getCurrentEventPageUrl=function(e){var t;if(e)return e;if(this._customPageUrl)return this._customPageUrl;try{return this.getOriginFrom()}catch(e){return this.config.pageUrl||"undefined"!=typeof window&&(null==(t=window.location)?void 0:t.href)||""}},d.prototype.getCurrentReplayId=function(){var e,t;return String((null==(t=null==(t=null==(e=this.sessionManager)?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"")},d.prototype.getDefaultRuleVersion=function(){var e;return(null==(e=null==(e=this.config)?void 0:e.struggleMonitor)?void 0:e.ruleVersion)||"1.0.0"},d.prototype.getEventReplayId=function(e){return e||this.getCurrentReplayId()||void 0},d.prototype.mergeEventTags=function(e){return this.sanitizeEventTags(x(x({},this.config.defaultTags||{}),e||{}))},d.prototype.sanitizeStringMap=function(n,r){var i;if(void 0===r&&(r=1024),n&&"object"==typeof n)return i={},Object.keys(n).forEach(function(e){var t=n[e];e&&null!=t&&(i[String(e)]=String(t).slice(0,r))}),Object.keys(i).length?i:void 0},d.prototype.sanitizeEventTags=function(e){return this.sanitizeStringMap(e,1024)},d.prototype.sanitizeEventProperties=function(e){return this.sanitizeStringMap(e,1024)},d.prototype.sanitizeStruggleProperties=function(e){var n=this.sanitizeEventProperties(e);if(n)return Object.keys(n).reduce(function(e,t){return Qe.has(t)&&"custom_struggle_name"!==t||(e[t]=n[t]),e},{})},d.prototype.sanitizeEventPayload=function(n,e){var r,i=this;if(n&&"object"==typeof n)return e=(e=this.getPayloadAllowlist(e)).length?e:Object.keys(n),r={},e.forEach(function(e){var t;Object.prototype.hasOwnProperty.call(n,e)&&void 0!==(t=i.sanitizePayloadValue(n[e]))&&(r[e]=t)}),Object.keys(r).length?r:void 0},d.prototype.sanitizePayloadValue=function(n,r){var i=this;if(void 0===r&&(r=0),null!=n){if("string"==typeof n)return n.slice(0,256);if("number"==typeof n||"boolean"==typeof n)return n;if(Array.isArray(n))return n.slice(0,10).map(function(e){e=i.sanitizePayloadValue(e,r+1);return void 0===e?null:e});if("object"!=typeof n)return String(n).slice(0,256);if(2<=r)try{return JSON.stringify(n).slice(0,256)}catch(n){return}var o={};return Object.keys(n).slice(0,20).forEach(function(e){var t=i.sanitizePayloadValue(n[e],r+1);void 0!==t&&(o[e]=t)}),Object.keys(o).length?o:void 0}},d.prototype.getPayloadAllowlist=function(e){var t=null==(t=null==(t=this.config)?void 0:t.struggleMonitor)?void 0:t.payloadAllowlist;return Array.from(new Set(g(Array.isArray(t)?t:[],Array.isArray(e)?e:[]).filter(function(e){return!!e})))},d.prototype.normalizeRelatedEventIds=function(e){return Array.isArray(e)&&e.length&&(e=Array.from(new Set(e.filter(function(e){return"string"==typeof e&&e})))).length?e:void 0},d.prototype.ready=function(e,t,n){throw new Error('You need to override "ready" method')},d.prototype.request=function(e,t,n){throw new Error('You need to override "request" method')},d.prototype.speedLogPipeline=function(e){throw new Error('You need to override "speedLogPipeline" method')},d.prototype.getOriginFrom=function(){throw new Error('You need to override "getOriginFrom" method')},Object.defineProperty(d.prototype,"__version__",{get:function(){return"1.0.10"},enumerable:!1,configurable:!0}),d.prototype.submitMeasure=function(e,t,n){void 0===n&&(n={});e={event_id:A(),event_type:M.CUSTOM,event_category:I.CUSTOM,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(n.pageUrl),data:{event_name:e,measurements:{duration:t},replay_id:this.getEventReplayId(n.replayId),tags:this.sanitizeEventTags(n.tags),payload:this.sanitizeEventPayload(n.payload),event_properties:this.sanitizeEventProperties(n.properties)}};this.reportTDEMEvent(e)},d.prototype.getTimeEventDuration=function(e){if(void 0!==e&&this.timeMap[e])return Date.now()-this.timeMap[e]},d.version="1.0.10",d.instances=[],d.environment=ve,d.installedPlugins=[],d),e=(it.prototype.patch=function(e){this.canUse(e)&&this.exist(e)&&(this.instances.push(e),this.triggerInit(e),this.triggerOnNewTdem(e))},it.prototype.unpatch=function(e){var t=this.instances.indexOf(e);-1!==t&&(this.instances.splice(t,1),0===this.instances.length)&&this.uninstall(e)},it.prototype.countInstance=function(){return this.instances.length},it.prototype.uninstall=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.destroy)&&t.apply(this,[e])},it.prototype.walk=function(n){var r=this;this.instances.forEach(function(e){var t=r.canUse(e);t&&n(e,t)})},it.prototype.canUse=function(e){e=this.getConfig(e);return!(!e||"object"!=typeof e)||!!e},it.prototype.getConfig=function(e){return null==(e=e.config)?void 0:e[this.name]},it.prototype.exist=function(e){return-1===this.instances.indexOf(e)},it.prototype.triggerInit=function(e){var t;this.inited||(this.inited=!0,null==(t=null==(t=this.option)?void 0:t.init))||t.call(this.option,this.getConfig(e))},it.prototype.triggerOnNewTdem=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.onNewTdem)&&t.call(this.option,e,this.getConfig(e))},it),rt=new e({name:"aid",aid:"",init:function(e){try{var t=!0!==e&&e||window.localStorage.getItem("TDEM_ID");t||(t=Fe(),window.localStorage.setItem("TDEM_ID",t)),this.aid=t}catch(e){}},onNewTdem:function(e){e.bean.aid=this.aid,e.config.aid=this.aid}});function it(e){this.tdemPlugin=!0,this.name="",this.instances=[],this.inited=!1,e.$walk=this.walk.bind(this),e.$getConfig=this.getConfig.bind(this),this.option=e,this.name=e.name}function d(e,t){var n,r,i,o,a,s,l,u,c;void 0===t&&(t={}),this.sdkName="tdem-web-sdk",this.sdkVersion=d.version,this.isGetSample=!1,this.isHidden=!1,this.config={version:0,delay:1e3,onError:!0,repeat:60,random:1,aid:!0,device:!0,pagePerformance:!0,webVitals:!0,lagMonitor:!0,blankScreen:!0,memoryMonitor:!0,speedSample:!0,onClose:!0,reportLoadPackageSpeed:!0,env:"production",url:"",reportImmediately:!0,tdemConfig:!0,hostUrl:"https://dem.rumt-zh.com",offlineUrl:"",whiteListUrl:"",pvUrl:"",speedUrl:"",customTimeUrl:"",performanceUrl:"",performanceUrlForHippy:"",webVitalsUrl:"",eventUrl:"",setDataReportUrl:""},this.isWhiteList=!1,this.lifeCycle=new q,this.bean={},this.internalRetrySchedule=ge,this._customPageUrl=null,this.tdemEventPipeline=Ze([(r=n=!1,i=[],this._tdemSampleGate={decide:function(e){n=!0,(r=e)&&i.forEach(function(e){var t=e.event;return(0,e.resolve)(t)}),i=[]},reDecide:function(e){return r=!(e<=0)&&(100<=e||100*Math.random()<e)},get isDecided(){return n},get isSampled(){return r}},function(e,t){n?r&&t(e):i.length<1e3&&i.push({event:e,resolve:t})}),(a=20,u=Math.max(Number(a)||1,1),c=[],function(e,t){function n(){for(clearTimeout(s),clearTimeout(l),l=s=void 0;0<c.length;)t(c.splice(0,u))}e=Array.isArray(e)?e:[e];c.push.apply(c,e);u<=c.length?n():(clearTimeout(s),s=setTimeout(function(){0<c.length&&n()},5e3),l=l||setTimeout(function(){0<c.length&&n()},3e4))}),function(t,n){try{var e,r=JSON.parse(JSON.stringify(t)),i=(o.lifeCycle.emit("beforeReport",r),o.config.beforeReport);"function"==typeof i?0<(e=t.filter(function(e){return!1!==i(e)})).length&&n(e):n(t)}catch(e){n(t)}},Ge(o=this)]),this.timeMap={},this.failRequestCount=0,this.internalTransport=t.transport,this.internalRetrySchedule=t.retrySchedule||ge,d.instances.push(this)}function ot(e){return e=e.sessionManager,[(null==(t=null==(t=null==e?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"",null==t||t.id,!t||t.sampled,null==t||t.sampled][0];var t}function at(e){return-1!==ut.indexOf(e)}var st=new e({name:"assets"}),lt=st=new e({name:"assets",collectCur:0,collectEntryType:"resource",ASSETS_INITIATOR_TYPE:["img","css","script","link","audio","video"],getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},onNewTdem:function(e){var t=this;Ke()&&(setTimeout(function(){t.collectSuccessLog(e),t.collectFailLog(e)},5e3),performance.onresourcetimingbufferfull=function(){"function"==typeof performance.clearResourceTimings&&(t.collectCur=0,performance.clearResourceTimings())})},processLog:function(e,t){var n=t.duration||0,r=t.transferSize||0,n={event_id:A(),event_type:M.RESOURCE_LOAD,event_category:I.NETWORK,timestamp:Date.now(),page_url:t.from||window.location.href,data:{url:t.url,resource_type:t.type||"static",measurements:{duration:n,dns_time:t.domainLookup,tcp_time:t.connectTime,transfer_size:0<r?r:void 0},replay_id:ot(e),tags:{environment:e.config.env||"production",is_https:t.isHttps?"true":"false"},event_properties:{is_cached:String(0===r),protocol:t.nextHopProtocol||"",http_status:String(t.status||0)}}};null!=(r=e.reportTDEMEvent)&&r.call(e,n)},publish:function(t,n){var r=this;this.$walk(function(e){e===n&&(Array.isArray(t)?t.forEach(r.processLog):r.processLog(n,t))})},publishMany:function(e,t){for(var n=t.config,r=this.getFromParam(t),i=0,o=e.length;i<o;i++){var a=e[i];-1===this.ASSETS_INITIATOR_TYPE.indexOf(a.initiatorType)||re(a.name,n.hostUrl)||this.publish(this.generateLog(a,n,r),t)}},collectSuccessLog:function(n){var e,t,r=this;"function"==typeof window.PerformanceObserver?(this.publishMany(performance.getEntriesByType(this.collectEntryType),n),(e=new window.PerformanceObserver(function(e){r.publishMany(e.getEntries(),n)})).observe({entryTypes:[this.collectEntryType]}),n.lifeCycle.on("destroy",function(){0===st.countInstance()&&e.disconnect()})):(t=setInterval(function(){var e=performance.getEntriesByType(r.collectEntryType),t=e.slice(r.collectCur);r.collectCur=e.length,r.publishMany(t,n)},3e3),n.lifeCycle.on("destroy",function(){0===st.countInstance()&&clearInterval(t)}))},collectFailLog:function(i){function e(e){var t,n,r;e&&(e=e.target||e.srcElement,!(t=(null==e?void 0:e.src)||(null==e?void 0:e.href))||"string"!=typeof t||-1<window.location.href.indexOf(t)||(e="function"==typeof(null==(e=a.api)?void 0:e.resourceTypeHandler)?null==e?void 0:e.resourceTypeHandler(t):"",r=performance.getEntriesByType(o.collectEntryType).find(function(e){return e.name===t}),re(t,a.hostUrl))||(n=o.getFromParam(i),r={url:K(t),status:400,duration:Number(((null==r?void 0:r.duration)||0).toFixed(2)),method:"get",type:e||"static",isHttps:$(t),urlQuery:J(t,!0),nextHopProtocol:"",domainLookup:0,connectTime:0,from:n},o.publish(r,i)))}var o=this,a=i.config;window.document.addEventListener("error",e,!0),i.lifeCycle.on("destroy",function(){0===st.countInstance()&&window.document.removeEventListener("error",e,!0)})},generateLog:function(e,t,n){var t="function"==typeof(null==(r=t.api)?void 0:r.resourceTypeHandler)?null==(r=t.api)?void 0:r.resourceTypeHandler(e.name):"",r=e.transferSize;return{url:K(e.name),method:"get",duration:Number(e.duration.toFixed(2)),status:200,type:t||"static",isHttps:$(e.name),nextHopProtocol:e.nextHopProtocol||"",urlQuery:J(e.name,!0),domainLookup:Z(e.domainLookupEnd-e.domainLookupStart),connectTime:Z(e.connectEnd-e.connectStart),transferSize:0<r?r:-1,from:n}},collectNotReportedLog:function(e){var t,n;Ke()&&(t=(n=performance.getEntriesByType(this.collectEntryType)).length,"function"!=typeof window.PerformanceObserver)&&this.collectCur!==t&&(n=n.slice(this.collectCur),this.collectCur=t,this.publishMany(n,e))},destroy:function(){this.option.publish=function(){}}}),ut=window.navigator.userAgent.toLowerCase(),l={};l.macos=function(){return at("mac")},l.ios=function(){return l.iphone()||l.ipod()||l.ipad()},l.iphone=function(){return!l.windows()&&at("iphone")},l.ipod=function(){return at("ipod")},l.ipad=function(){var e="MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;return at("ipad")||e},l.android=function(){return!l.windows()&&at("android")},l.androidPhone=function(){return l.android()&&at("mobile")},l.androidTablet=function(){return l.android()&&!at("mobile")},l.blackberry=function(){return at("blackberry")||at("bb10")},l.blackberryPhone=function(){return l.blackberry()&&!at("tablet")},l.blackberryTablet=function(){return l.blackberry()&&at("tablet")},l.windows=function(){return at("windows")},l.windowsPhone=function(){return l.windows()&&at("phone")},l.windowsTablet=function(){return l.windows()&&at("touch")&&!l.windowsPhone()},l.fxos=function(){return(at("(mobile")||at("(tablet"))&&at(" rv:")},l.fxosPhone=function(){return l.fxos()&&at("mobile")},l.fxosTablet=function(){return l.fxos()&&at("tablet")},l.meego=function(){return at("meego")},l.cordova=function(){return window.cordova&&"file:"===location.protocol},l.nodeWebkit=function(){return"object"==typeof window.process},l.mobile=function(){return l.androidPhone()||l.iphone()||l.ipod()||l.windowsPhone()||l.blackberryPhone()||l.fxosPhone()||l.meego()},l.tablet=function(){return l.ipad()||l.androidTablet()||l.blackberryTablet()||l.windowsTablet()||l.fxosTablet()},l.desktop=function(){return!l.tablet()&&!l.mobile()};function ct(){return{host:new URL(location.href).host,pathname:location.pathname}}function dt(r,e,i){return null!=e&&e.length&&"object"==typeof r?e.reduce(function(e,t){var n=window.Headers&&r instanceof Headers?r.get(t):r[t];return n?e+(""===e?"":"\n\n")+i+" header "+t+": "+n:e},""):""}function ht(e,t){return e&&-1===["null","undefined"].indexOf(e)?t+": "+e:""}function ft(e,t,n){void 0===t&&(t="");var r,i,e="function"==typeof(null==(i=e.api)?void 0:i.resourceTypeHandler)?null==(i=e.api)?void 0:i.resourceTypeHandler(n):"";return-1===W.indexOf(e)&&(r=void 0===t?"":t,i=(void 0===n?"":n).split("?")[0],e=se.test(i)||ae.some(function(e){return-1!==String(r).indexOf(e)})?"static":"fetch"),e}function pt(e,t){return e?It.AJAX_ERROR:t?It.RET_ERROR:It.API_RESPONSE}function mt(e,t,n){if(!e)return!1;if(null!=(t=null==t?void 0:t.api)&&t.isSlowApi&&"function"==typeof(null==t?void 0:t.isSlowApi))try{return t.isSlowApi(n||{duration:e})}catch(e){return console.warn("[TDEM] isSlowApi function happen error:",e,", this data will not be reported."),!1}return(n=null!=(n=null==t?void 0:t.slowThreshold)?n:null==t?void 0:t.apiSlowThreshold)&&"number"==typeof n?n<e:1e3<e}function vt(e,t){if(null!=(e=e.api)&&e.usePerformanceTiming&&"string"==typeof t.url){e=null==(e=performance.getEntriesByName(t.url))?void 0:e.pop();if(e)return{url:t.url,isHttps:$(t.url),method:t.method,type:t.type,status:t.status,duration:Number(e.duration.toFixed(2)),nextHopProtocol:e.nextHopProtocol||"",domainLookup:Z(e.domainLookupEnd-e.domainLookupStart),connectTime:Z(e.connectEnd-e.connectStart)}}return{url:t.url,isHttps:$(t.url),method:t.method,type:t.type,status:t.status,duration:Number(t.duration.toFixed(2)),nextHopProtocol:"",domainLookup:F.number,connectTime:F.number}}function gt(e){return(e=(e=>{var t="",n=e.nodeType;if(1===n||9===n||11===n){if("string"==typeof e.textContent)return e.textContent;for(var r=e.firstChild;r;r=r.nextSibling)t+=qt(e)}else if(3===n||4===n)return e.nodeValue;return t})(e))?e.replace(/^\s+|\s+$/g,""):""}var yt,wt,bt,kt,_t,St,Et,Ct=!(l.isIE=function(){return"ActiveXObject"in window}),Rt=[],Ot=/^\/[^/]/,Tt=!1,xt=[],Mt={maxRetryCount:10,retryInterval:function(e){return 1e3*(2<<e)},whenRetryEndStillFail:"discard"},It={API_RESPONSE:"api_response",AJAX_ERROR:"ajax_error",RET_ERROR:"ret_error",SLOW_NET_REQUEST:"slow_net_request"},At=(new e({name:"api"}),new e({name:"api",override:!1,onNewTdem:function(e){var t,n;this.override||(this.override=!0,null!=(n=e.config.api)&&n.injectTraceHeader&&(this.traceRequestHeader=new He(n.injectTraceHeader,null!=(t=null==n?void 0:n.injectTraceIgnoreUrls)?t:[],null==n?void 0:n.injectTraceUrls,null==n?void 0:n.traceFlag)),this.overrideFetch(e.config,e),this.overrideXhr(e.config,e))},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},overrideFetch:function(k,_){var S=this,e=k.api,e={name:this.name,traceRequestHeader:null!=e&&e.injectTraceHeader?this.traceRequestHeader:null,getCurrentFrom:function(){return S.getFromParam(_)},then:function(f,p,m,v,g,y,w){var e,b;re(m,k.hostUrl)||(e=f.headers?f.headers.get("content-type"):"","fetch"===(b=ft(k,e||"",m))?f.clone().text().then(function(i){var e,o=f.status<=0||400<=f.status,t=(null==(t=k.api)?void 0:t.reqHeaders)||[],a=dt(null==v?void 0:v.headers,t,"req"),t=(null==(t=k.api)?void 0:t.resHeaders)||[],s=dt(f.headers,t,"res"),l=Be(null==v?void 0:v.headers),t=X(i,k.api,{url:m,ctx:f,payload:null==v?void 0:v.body}),u=t.code,c=t.isErr,t=null==(t=k.api)?void 0:t.apiDetail,d=t?ee(null==v?void 0:v.body,null==(e=k.api)?void 0:e.reqParamHandler,{url:m}):"",h=t?ee(i,null==(e=k.api)?void 0:e.resBodyHandler,{url:m,ctx:f}):"";setTimeout(function(){var e=vt(k,{url:m,duration:p,type:b,status:f.status||0,method:(null==v?void 0:v.method)||"get"}),t=[o?"FETCH_ERROR: "+i:"","fetch req url: "+m,"res status: "+(e.status||0),"res duration: "+e.duration+"ms","res startTime: "+g,a,s,"req method: "+(e.method||"GET"),"res retcode: "+u,ht(d,"req param"),ht(h,"res data")].filter(function(e){return e}).join("\n\n"),t=(e.payload=null==v?void 0:v.body,e.ret=u,e.isErr=+c,e.from=y||S.getFromParam(_),{msg:t,code:u,trace:l,errorMsg:"",from:y||S.getFromParam(_),originFrom:w,level:It.API_RESPONSE}),n=mt(null==e?void 0:e.duration,k,e),r=pt(o,c);t.level=r===It.API_RESPONSE&&n?It.SLOW_NET_REQUEST:r,t.isErr=c,(n||t.level!==It.API_RESPONSE||_.isWhiteList||null!=(n=null==(r=_.config)?void 0:r.api)&&n.reportRequest)&&S.publishNormalLog(t,_),S.publishSpeed(e,_)},0)}).catch(function(e){console.info("ignore something error when process resp "+e)}):setTimeout(function(){var e=vt(k,{url:m,duration:p,type:b,status:f.status||0,method:(null==v?void 0:v.method)||"get"});e.type="static",e.urlQuery=J(m,!0),e.from=y||S.getFromParam(_),S.publishSpeed(e,_)},0))},catch:function(t,n,r,i,o,a,s){var l,e,u,c,d;if(re(r,k.hostUrl))throw t;if("AbortError"!==(t&&t.name))throw l=ft(k,"",r),e=(null==(e=k.api)?void 0:e.reqHeaders)||[],u=dt(null==i?void 0:i.headers,e,"req"),c=Be(null==i?void 0:i.headers),d=null!=(e=k.api)&&e.apiDetail?ee(null==i?void 0:i.body,null==(e=k.api)?void 0:e.reqParamHandler,{url:r}):"",setTimeout(function(){var e=vt(k,{url:r,duration:n,type:l,status:0,method:(null==i?void 0:i.method)||"get"}),e=(e.from=a||S.getFromParam(_),S.publishSpeed(e,_),"AJAX_ERROR: "+t+"\n \nreq url: "+r+"\n \nres status: 0\n \nres duration: "+e.duration+"ms\n \nreq method: "+((null==i?void 0:i.method)||"get")+"\n \nreq param: "+d+"\n \nres startTime: "+o+"\n \n"+u);S.publishNormalLog({msg:e,level:It.AJAX_ERROR,code:-400,trace:c,errorMsg:"",from:a||S.getFromParam(_),originFrom:s},_)},0),t}},h=(this.hackFetchOptions=e,this.hackFetchOptions),f=null==(e=k.api)?void 0:e.ignoreHackReg;if(void 0===f&&(f=/\.flv(\?|$)/i),xt.find(function(e){return e.name===h.name}))throw new Error("name '"+h.name+"' is already in hackFetch option list");xt.push(h),!Tt&&window.fetch&&(Tt=!0,kt=window.fetch,window.fetch=function(e,i){void 0===i&&(i={});var o="string"==typeof e?e:null==e?void 0:e.url;if(null!=(a=null==f?void 0:f.test)&&a.call(f,o))return kt(o,i);Ot.test(o)&&(o=""+location.origin+o);var t,n,r,a=(h||{}).traceRequestHeader;a&&(t=void 0===(t=(i||{}).headers)?{}:t,n=(r=ct()).host,n=(a=a.generate(o,t,{host:n,pathname:r.pathname})||{}).name,r=a.value)&&n&&(i.headers=Object.assign(t,((a={})[n]=r,a)));for(var s=new Map,l=window.location.href,u=0;u<xt.length;u++){var c=xt[u];try{"function"==typeof c.beforeFetch&&c.beforeFetch(o,i),"function"==typeof c.getCurrentFrom&&s.set(c.name,c.getCurrentFrom())}catch(e){}}var d=Date.now();return kt(e,i).then(function(e){for(var t=e.clone(),n=0;n<xt.length;n++){var r=xt[n];try{"function"==typeof r.then&&r.then(t,Date.now()-d,o,i,d,s.get(r.name),l)}catch(e){}}return e}).catch(function(e){for(var t=0;t<xt.length;t++){var n=xt[t];try{"function"==typeof n.catch&&n.catch(e,Date.now()-d,o,i,d,s.get(n.name),l)}catch(e){}}throw e})})},overrideXhr:function(b,k){var i,_=this,e={name:this.name,ignoreHackReg:null==(e=b.api)?void 0:e.ignoreHackReg,traceRequestHeader:null!=(e=b.api)&&e.injectTraceHeader?this.traceRequestHeader:null,getCurrentFrom:function(){return _.getFromParam(k)},send:function(i,p,m,v){var e,t,g=Date.now(),o=(((null==b?void 0:b.api)||{}).injectTraceHeader&&(t=(e=ct()).host,e=(t=_.traceRequestHeader.generate(i.tdemUrl,{},{host:t,pathname:e.pathname})||{}).name,t=t.value,e)&&t&&i.setRequestHeader(e,t),i.addEventListener("loadend",function(){var h,n,e,r,f=i.tdemUrl||"";re(f,b.hostUrl)||"abort"===i.failType||(h="",(i.failType||!i.status||400<=i.status)&&(h=i.failType||"failed"),n=Date.now()-g,e=i.getResponseHeader("content-type")||"",r=ft(b,e,f),setTimeout(function(){var a=vt(b,{url:f,duration:n,type:r,status:i.status,method:i.tdemMethod||"get"});if(a.from=m||_.getFromParam(k),"fetch"===r){var e=(null==(e=b.api)?void 0:e.reqHeaders)||[],s=dt(i.tdemXhrReqHeader,e,"req"),e=(null==(e=b.api)?void 0:e.resHeaders)||[],t=i.getAllResponseHeaders().split("\r\n").reduce(function(e,t){t=t.split(": ");return t[0]&&t[1]&&(e[t[0]]=t[1]),e},{}),l=dt(t,e,"res"),u=Be(i.tdemXhrReqHeader),e=null==(t=b.api)?void 0:t.apiDetail,c=e?ee(p,null==(t=b.api)?void 0:t.reqParamHandler,{url:f}):"",d=e?ee(i.response,null==(t=b.api)?void 0:t.resBodyHandler,{url:f}):"";try{((e,t,n,r)=>{var i,o,a;try{if("function"==typeof(null==t?void 0:t.retCodeHandlerAsync))return t.retCodeHandlerAsync(e,null==n?void 0:n.url,null==n?void 0:n.ctx,function(e){var t=e.code;null!=r&&r({code:void 0===t?H:t,isErr:e.isErr})});if("function"==typeof(null==t?void 0:t.retCodeHandler))return a=(o=t.retCodeHandler(e,null==n?void 0:n.url,null==n?void 0:n.ctx,null==n?void 0:n.payload)||{}).code,null!=r&&r({code:void 0===a?H:a,isErr:o.isErr});if(!(e="string"==typeof e?JSON.parse(e):e))return null!=r&&r({code:H,isErr:!1});"function"==typeof(null==(i=null==t?void 0:t.ret)?void 0:i.join)&&(le=[].concat(t.ret.map(function(e){return e.toLowerCase()})));var s=Object.getOwnPropertyNames(e).filter(function(e){return-1!==le.indexOf(e.toLowerCase())});if(s.length)return"未知"!==(a=e[s[0]])&&""!==a||(a=H),null!=r&&r({code:""+a,isErr:0!==a&&"0"!==a&&a!==H});null!=r&&r({code:H,isErr:!1})}catch(e){null!=r&&r({code:H,isErr:!1})}})(i.response,b.api,{url:f,ctx:i,payload:p},function(e){var t,n=e.code,e=e.isErr,r=[h?"AJAX_ERROR: request "+h:"","fetch req url: "+f,"res status: "+(a.status||0),"res duration: "+a.duration+"ms","res startTime: "+g,s,l,"req method: "+(a.method||"GET"),"res retcode: "+n,ht(c,"req param"),ht(d,"res data")].filter(function(e){return e}).join("\n\n"),i=(a.ret=n,a.isErr=+e,a.payload=p,pt(!!h,e)),o=mt(null==a?void 0:a.duration,b,a);(i!==It.API_RESPONSE||o||k.isWhiteList||null!=(t=null==(t=k.config)?void 0:t.api)&&t.reportRequest)&&_.publishNormalLog({msg:r,level:i===It.API_RESPONSE&&o?It.SLOW_NET_REQUEST:i,code:n,isErr:e,trace:u,errorMsg:"",from:m||_.getFromParam(k),originFrom:v},k),_.publishSpeed(a,k)})}catch(e){a.ret=H,_.publishSpeed(a,k)}}else a.type="static",a.urlQuery=J(f,!0),_.publishSpeed(a,k);i.removeEventListener("abort",o),i.removeEventListener("error",y),i.removeEventListener("timeout",w)},0))}),function(){i.failType="abort"}),y=function(){i.failType="error"},w=function(){i.failType="timeout"};i.addEventListener("abort",o),i.addEventListener("error",y),i.addEventListener("timeout",w)}};this.hackXHROptions=e,i=this.hackXHROptions,Rt.find(function(e){return e.name===i.name})||(Rt.push(i),!Ct&&window.XMLHttpRequest&&(yt=window.XMLHttpRequest.prototype.send,wt=window.XMLHttpRequest.prototype.open,bt=window.XMLHttpRequest.prototype.setRequestHeader,Ct=!0,window.XMLHttpRequest.prototype.open=function(){this.tdemMethod=arguments[0];var e,t=arguments[1];if(Ot.test(t)&&(t=""+location.origin+t),this.tdemUrl=t,null==(t=null==(e=i.ignoreHackReg)?void 0:e.test)||!t.call(e,this.tdemUrl))if(this.tdemXhrStartTime=Date.now(),this.sendByTdem)l.isIE()||(this.timeout=5e3);else for(var n=0;n<Rt.length;n++){var r=Rt[n];try{"function"==typeof r.open&&r.open(this)}catch(e){}}return wt.apply(this,arguments)},window.XMLHttpRequest.prototype.setRequestHeader=function(){var e,t,n;return null!=(t=null==(n=i.ignoreHackReg)?void 0:n.test)&&t.call(n,this.tdemUrl)?bt.apply(this,arguments):(t=arguments[0],n=arguments[1],this.tdemXhrReqHeader=null!=(e=this.tdemXhrReqHeader)?e:{},null!=i&&i.traceRequestHeader&&-1<["traceparent","b3","sw8","sentry-trace"].indexOf(t)&&(this.tdemXhrReqHeader[t]||(arguments[1]=n),this.tdemXhrReqHeader[t])?void 0:(this.tdemXhrReqHeader[t]=arguments[1],bt.apply(this,arguments)))},window.XMLHttpRequest.prototype.send=function(){var e,t;if(!(null!=(t=null==(e=i.ignoreHackReg)?void 0:e.test)&&t.call(e,this.tdemUrl)||this.sendByTdem))for(var n=0;n<Rt.length;n++){var r=Rt[n];try{"function"==typeof r.send&&r.send(this,arguments[0],"function"==typeof r.getCurrentFrom?r.getCurrentFrom():void 0,window.location.href)}catch(e){}}return yt.apply(this,arguments)}))},publishSpeed:function(e){},publishNormalLog:function(e,t){var n,r,i,o,a,s,l,u;[It.API_RESPONSE,It.AJAX_ERROR,It.RET_ERROR,It.SLOW_NET_REQUEST].includes(e.level)&&(n=(n=null==(n=e.msg)?void 0:n.match(/(?:fetch req url|req url):\s*(.+?)(?:\n|$)/))?n[1].trim():"",s=(s=null==(s=e.msg)?void 0:s.match(/req method:\s*(.+?)(?:\n|$)/i))?s[1].trim().toUpperCase():"GET",a=(a=null==(a=e.msg)?void 0:a.match(/res status:\s*(\d+)/))?parseInt(a[1],10):0,r=(r=null==(r=e.msg)?void 0:r.match(/res duration:\s*([\d.]+)ms/))?parseFloat(r[1]):0,i=(i=null==(i=e.msg)?void 0:i.match(/=+\s*res data\s*=+\s*\n([\s\S]*?)(?:\n=+|$)/))?i[1].trim().slice(0,1e3):void 0,o={},e.trace&&(o.trace_id=e.trace),(u=(l={httpStatus:a,isTransportFailure:a<=0,isBusinessError:e.level===It.RET_ERROR||!!e.isErr,businessCode:e.code}).aborted?{report:!1,eventType:null}:(u=Number(l.httpStatus),l.isTransportFailure||!Number.isFinite(u)||u<=0?{report:!0,eventType:"api_error",outcome:"transport_error"}:400<=u?{report:!0,eventType:"api_error",outcome:"http_error"}:l.isBusinessError?{report:!0,eventType:"api_error",outcome:"business_error",businessCode:G(l.businessCode)||H}:{report:!0,eventType:"api_call",businessCode:G(l.businessCode)})).report)&&u.eventType&&(l={http_method:s,http_status:String(a)},u.outcome&&(l.outcome=u.outcome),u.businessCode&&(l.business_code=u.businessCode),"api_error"===u.eventType?(a={event_id:A(),event_type:M.API_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:e.from||(null==(s=t.getOriginFrom)?void 0:s.call(t))||window.location.href,data:{url:n,measurements:{duration:r},response_body:i,replay_id:ot(t),tags:0<Object.keys(o).length?o:void 0,event_properties:l}},null!=(s=t.reportTDEMEvent)&&s.call(t,a)):(s={event_id:A(),event_type:M.API_CALL,event_category:I.NETWORK,timestamp:Date.now(),page_url:e.from||(null==(i=t.getOriginFrom)?void 0:i.call(t))||window.location.href,data:{url:n,measurements:{duration:r},replay_id:ot(t),tags:0<Object.keys(o).length?o:void 0,event_properties:l}},null!=(a=t.reportTDEMEvent)&&a.call(t,s)))},destroy:function(){var t,n,e;this.option.publishSpeed=function(){},this.option.publishNormalLog=function(){},this.option.hackXHROptions&&(n=this.option.hackXHROptions,-1!==(e=Rt.findIndex(function(e){return e.name===n.name})))&&Rt.splice(e,1),this.option.hackFetchOptions&&(t=this.option.hackFetchOptions,-1!==(e=xt.findIndex(function(e){return e.name===t.name})))&&xt.splice(e,1),this.option.override=!1}})),Pt={},Dt=new e({name:"bridge",override:!1,onNewTdem:function(e){this.override||(this.override=!0,this.overrideBridge(e))},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},publishSpeed:function(t,n){this.$walk(function(e){e===n&&e.speedLogPipeline(t)})},overrideBridge:function(u){var c=this,d=u.config,e="object"==typeof d.bridge?d.bridge:void 0,t=null==e?void 0:e.target,e=null==e?void 0:e.methods;t&&null!=e&&e.length&&e.forEach(function(e){var l=t[e];Pt[e]=l,t[e]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],i=e[1],n=e[2],o=e[3],a=Date.now(),s=c.getFromParam(u);l(r,i,n,function(e){var t=X(e,d.api),n=t.code,t=t.isErr,n={url:r+"-"+i,name:r+"-"+i,duration:Date.now()-a,type:"bridge",ret:n,isErr:+t,from:s};c.publishSpeed(n,u),o(e)})}})},unHackBridge:function(e){var e="object"==typeof e.config.bridge?e.config.bridge:void 0,t=null==e?void 0:e.target;Pt=(t&&Object.keys(Pt).forEach(function(e){Pt[e]&&(t[e]=Pt[e])}),{})},destroy:function(e){this.option.publishSpeed=function(){},this.option.unHackBridge(e),this.option.override=!1}}),t=((t=_t=_t||{})[t.unknown=100]="unknown",t[t.wifi=1]="wifi",t[t.net2g=2]="net2g",t[t.net3g=3]="net3g",t[t.net4g=4]="net4g",t[t.net5g=5]="net5g",t[t.net6g=6]="net6g",(t=St=St||{})[t.android=1]="android",t[t.ios=2]="ios",t[t.windows=3]="windows",t[t.macos=4]="macos",t[t.linux=5]="linux",t[t.other=100]="other",(t=Et=Et||{})[t.unknown=100]="unknown",t[t.normal=0]="normal",t[t.weak=1]="weak",t[t.disconnected=2]="disconnected",new e({name:"device",onNewTdem:function(e){e.extendBean("platform",this.getPlatform()),e.extendBean("netType",_t.unknown),this.getDpi(e),this.refreshNetworkTypeToBean(e),this.refreshNetworkStatusToBean(e)},getDpi:function(e){e.extendBean("vp",Math.round(window.innerWidth)+" * "+Math.round(window.innerHeight)),window.screen&&e.extendBean("sr",Math.round(window.screen.width)+" * "+Math.round(window.screen.height))},getPlatform:function(){var t={android:/\bAndroid\s*([^;]+)/,ios:/\b(iPad|iPhone|iPod)\b.*? OS ([\d_]+)/,windows:/\b(Windows NT)/,macos:/\b(Mac OS)/,linux:/\b(Linux)/i},e=Object.keys(t).find(function(e){return t[e].test(navigator.userAgent)});return e?St[e]:St.other},refreshNetworkTypeToBean:function(t){var n=this,e=t.config;e&&("function"==typeof e.getNetworkType?e.getNetworkType:Lt)(function(e){_t[e]||(e=_t.unknown),t.extendBean("netType",e),n.NetworkRefreshTimer=setTimeout(function(){n.refreshNetworkTypeToBean(t),clearTimeout(n.NetworkRefreshTimer)},1e4)})},refreshNetworkStatusToBean:function(t){var e,n=this,r=t.config;r&&null!=(e="function"==typeof r.getNetworkStatus?r.getNetworkStatus:e)&&e(function(e){void 0===Et[e]&&(e=Et.unknown),t.extendBean("netStatus",e),n.NetworkStatusRefreshTimer=setTimeout(function(){n.refreshNetworkStatusToBean(t),clearTimeout(n.NetworkStatusRefreshTimer)},1e4)})}})),Lt=function(e){var t="",n=navigator.userAgent.match(/NetType\/(\w+)/);n?t=n[1]:navigator.connection&&(t=navigator.connection.effectiveType||navigator.connection.type),e((n=t=t||H,0<=(n=String(n).toLowerCase()).indexOf("4g")?_t.net4g:0<=n.indexOf("wifi")?_t.wifi:0<=n.indexOf("5g")?_t.net5g:0<=n.indexOf("6g")?_t.net6g:0<=n.indexOf("3g")?_t.net3g:0<=n.indexOf("2g")?_t.net2g:_t.unknown))},Nt=window.WebSocket,Ft=[],Ut={construct:function(e,t){var r=new e(t[0],t[1]);return r.originSend=r.send,r.addEventListener("error",function(e){var e=(null==e?void 0:e.currentTarget)||{},t=e.url,n=e.readyState;null!=Ft&&Ft.forEach(function(e){e=e.onErr;null!=e&&e({msg:"无法获知具体错误信息,需在浏览器控制台查看!",readyState:n,connectUrl:t})})}),Object.defineProperty(r,"send",{get:function(){return function(e){null!=(t=r.originSend)&&t.call(r,e);var t=r.readyState;if(t!==WebSocket.OPEN){var n={readyState:t,connectUrl:r.url};switch(t){case WebSocket.CLOSED:Ft.forEach(function(e){e=e.sendErr;null!=e&&e(x({msg:"消息发送失败,连接已关闭!"},n))});break;case WebSocket.CONNECTING:Ft.forEach(function(e){(0,e.sendErr)(x({msg:"消息发送失败,正在连接中!"},n))});break;case WebSocket.CLOSING:Ft.forEach(function(e){(0,e.sendErr)(x({msg:"消息发送失败,连接正在关闭!"},n))})}}}}}),r}},zt=new e({name:"onError"}),Bt=zt=new e({name:"onError",onNewTdem:function(e){this.startListen(e)},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},startListen:function(l){function e(e){var t,n=e&&te(e.reason);n&&(t=[{type:(null==(t=e.reason)?void 0:t.name)||"PromiseRejection",value:(null==(t=e.reason)?void 0:t.message)||String(n),mechanism_type:"unhandledrejection",mechanism_handled:0}],n=e.reason instanceof Error?ye(e.reason):[],e={event_id:A(),event_type:M.PROMISE_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{exception_stacks:t,exception_frames:n,replay_id:ot(l),tags:{environment:l.config.env||"production"}}},null!=(t=l.reportTDEMEvent))&&t.call(l,e)}function t(e){if(e=(null==e?void 0:e.target)||(null==e?void 0:e.srcElement)){var t=e.src||e.href||"",n=e.tagName,n=(void 0===n?"script":n).toLowerCase(),r=["audio","video"].includes(n);if((!r||null!=e&&e.error)&&!(re(i=t,l.config.hostUrl)||-1<window.location.href.indexOf(i))){var i="other";if(/\.js$/.test(t)||"script"===n)i="script";else if(/\.css$/.test(t)||"link"===n)i="stylesheet";else if("img"===n)i="image";else{if(!r)return;i="media"}t={event_id:A(),event_type:M.RESOURCE_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{url:t,resource_type:i,replay_id:ot(l),tags:x({environment:l.config.env||"production"},r&&null!=e&&e.error?{error_code:String(e.error.code),error_message:e.error.message||""}:{}),event_properties:{element_tag:n}}};null!=(i=l.reportTDEMEvent)&&i.call(l,t)}}}var n,r,i,u=this,c=window.onerror,o=(window.onerror=function(e,t,n,r,i){var o,a,s=te(e);"string"!=typeof(o=s)||!o||B.some(function(e){return-1<o.indexOf(e)})||z.some(function(e){return-1<o.indexOf(e)})||(s=[{type:(null==i?void 0:i.name)||"Error",value:String(e),mechanism_type:"onerror",mechanism_handled:0}],a=i?ye(i):[{abs_path:t||"",colno:r||0,filename:(null==t?void 0:t.split("/").pop())||"",function:"(anonymous)",lineno:n||0,in_app:1,stack_level:0}],s={event_id:A(),event_type:M.JS_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{exception_stacks:s,exception_frames:a,replay_id:ot(l),tags:{environment:l.config.env||"production",version:String(l.config.version||"")}}},null!=(a=l.reportTDEMEvent)&&a.call(l,s)),null!=c&&c.call(window,e,t,n,r,i)},window.addEventListener("unhandledrejection",e),window.document.addEventListener("error",t,!0),l.lifeCycle.on("destroy",function(){0===zt.countInstance()&&(window.removeEventListener("unhandledrejection",e),window.document.removeEventListener("error",t,!0))}),l.config.websocket);(("object"==typeof o?!1!==o.enabled:o)||l.config.websocketHack)&&(o={key:l.config.id+"-"+this.name,onErr:function(e){var t;null!=(t=u.publishWsErrorLog)&&t.call(u,e,l)},sendErr:function(e){var t;null!=(t=u.publishWsErrorLog)&&t.call(u,e,l)}},this.hackWebsocketConfig=o,o=this.hackWebsocketConfig,window.Proxy)&&window.WebSocket&&(n=window.WebSocket,window&&!n.isHack&&(r=new Proxy(WebSocket,Ut),n.isHack=!0,window.WebSocket=r),i=o,Ft.find(function(e){return e.key===i.key})||i&&Ft.push(i))},publishWsErrorLog:function(e,n){var t=e.connectUrl,r=e.msg,e=e.readyState,i={event_id:A(),event_type:M.JS_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:this.getFromParam(n),data:{exception_stacks:[{type:"WebSocketError",value:"WEBSOCKET_ERROR: connect: "+t+" readyState: "+e+" msg: "+r,mechanism_type:"websocket",mechanism_handled:0}],exception_frames:[],replay_id:ot(n),tags:{environment:n.config.env||"production",websocket_url:t||"",websocket_ready_state:String(null!=e?e:"")}}};this.$walk(function(e){var t;e===n&&null!=(t=e.reportTDEMEvent)&&t.call(e,i)})},destroy:function(){var t,e;this.option.hackWebsocketConfig&&(t=this.option.hackWebsocketConfig,window.WebSocket=Nt,-1!==(e=Ft.findIndex(function(e){return e.key===t.key})))&&Ft.splice(e,1)}}),jt=(new e({name:"click"}),function(e){if(""!==e.id&&e.id)return'id("'+e.id+'")';if(e===document.body)return e.tagName;if(e instanceof Document)return"document";var t=0;if(e.parentNode)for(var n=e.parentNode.childNodes,r=0;r<n.length;r+=1){var i=n[r];if(i===e)return jt(e.parentNode)+"/"+e.tagName+"["+(t+1)+"]";1===i.nodeType&&i.tagName===e.tagName&&(t+=1)}return 0}),Wt=function(e){return e instanceof Array?new Map(e.map(function(e){return[e,!0]})):new Map},Ht=function(e,t){return"string"==typeof e?e.split(t):[]},qt=function(e){if(3===e.nodeType||4===e.nodeType)return e.nodeValue||"";if(1!==e.nodeType)return"";if("string"==typeof e.textContent)return e.textContent;for(var t="",n=e.firstChild;n;n=n.nextSibling)t+=qt(n);return t},Vt=new e({name:"click",listeners:[],onNewTdem:function(e){this.startListen(e)},startListen:function(a){for(var e=function(o){t.listeners.push(((e,t,n,r)=>{function i(e){var t=document.documentElement;t&&n.call(t,e,e.target)}return void 0===r&&(r=!0),e.addEventListener(t,i,r),{destroy:function(){e.removeEventListener(t,i,r)}}})(document,o,function(e,t){var n,r,i;t&&!((e,t)=>{e="object"==typeof e.click?e.click:void 0,n=Wt((null==e?void 0:e.ignoreClasses)||[])||new Map;for(var n,r=(e={ignoreIds:Wt((null==e?void 0:e.ignoreIds)||[])||new Map,ignoreClasses:n}).ignoreClasses,i=e.ignoreIds,o=!(0===i.size&&0===r.size),a=t,s=(Ht(t.getAttribute("id")||""," "),Ht(t.getAttribute("class")||"",""),0),l=!1;a&&o&&a.getAttribute;){if(l)return!0;if(10<=s)break;for(var u=Ht(a.getAttribute("id")||""," "),c=Ht(a.getAttribute("class")||"",""),d=0,h=u;d<h.length;d++){var f=h[d];if(i.has(f)){l=!0;break}}for(var p=0,m=c;p<m.length;p++){var v=m[p];if(r.has(v)){l=!0;break}}s+=1,a=a.parentNode||a.parentElement}return!1})(a.config,t)&&(i=jt(t),n=gt(t),r=t.getBoundingClientRect&&t.getBoundingClientRect(),i={event_id:A(),event_type:M.CLICK,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:window.location.href,data:{target_element:String(i),target_text:n.slice(0,127),click_position:r?{x:parseInt(String(r.left+window.scrollX),10)||0,y:parseInt(String(r.top+window.scrollY),10)||0}:void 0,replay_id:ot(a),tags:{environment:a.config.env||"production",event_op:o,node_name:(null==t?void 0:t.nodeName)||""},event_properties:{target_id:t.id||"",target_class:"string"==typeof t.className?t.className.slice(0,128):""}}},null!=(n=a.reportTDEMEvent))&&n.call(a,i)},!0))},t=this,n=0,r=Object.entries({click:1,longpress:2});n<r.length;n++)e(r[n][0])},destroy:function(){this.listeners.forEach(function(e){return e.destroy()}),this.listeners=[]}}),Gt=(new e({name:"console"}),["log","error","warn","info","debug","trace"]),Zt={log:console.log,error:console.error,warn:console.warn,info:console.info,debug:console.debug,trace:console.trace};var Jt,Kt,$t,Xt,Yt,Qt,en,tn,nn,rn,on,an=new e({name:"console",onNewTdem:function(e){this.startListen(e)},startListen:function(e){var h,f;f="object"==typeof(h=e).config.console?h.config.console:void 0,Gt.forEach(function(c){var d=Zt[c];console[c]=function(){for(var e,t,n,r,i,o,a,s,l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];try{d.apply(console,l),o=c,a=h.isWhiteList,("all"===(s=(null==(s=f)?void 0:s.level)||"error")||a||("error"===s?"error"===o:"warn"===s?"error"===o||"warn"===o:"info"===s?["error","warn","info"].includes(o):"log"===s?["error","warn","info","log"].includes(o):"error"===o))&&(r=l.map(function(e){if("object"==typeof e&&null!==e)try{return JSON.stringify(e)}catch(e){}return String(e)}).join(" "),i={event_id:A(),event_type:M.LOG,event_category:I.LOG,timestamp:Date.now(),page_url:(null==(e=h.getOriginFrom)?void 0:e.call(h))||("undefined"!=typeof window?null==(t=window.location)?void 0:t.href:""),data:{log_level:"error"===c?"error":"warn"===c?"warn":"info",replay_id:ot(h),tags:{console_method:c},event_properties:{message:("console."+c+": "+r).slice(0,2048)}}},null!=(n=h.reportTDEMEvent)&&n.call(h,i))}catch(e){Zt.error("Console hook error:",e)}}})},destroy:function(){Object.keys(Zt).forEach(function(e){console[e]=Zt[e]})}});function sn(){Xt=[],Kt=-1,Jt=null,rn(addEventListener)}Yt={passive:!0,capture:!0},Qt=new Date,en=function(e,t){Jt||(Jt=t,Kt=e,$t=new Date,rn(removeEventListener),tn())},tn=function(){var t;0<=Kt&&Kt<$t-Qt&&(t={entryType:"first-input",name:Jt.type,target:Jt.target,cancelable:Jt.cancelable,startTime:Jt.timeStamp,processingStart:Jt.timeStamp+Kt},Xt.forEach(function(e){e(t)}),Xt=[])},nn=function(e){var t,n,r,i,o,a;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(n=t,r=e,i=function(){en(n,r),a()},o=function(){a()},a=function(){removeEventListener("pointerup",i,Yt),removeEventListener("pointercancel",o,Yt)},addEventListener("pointerup",i,Yt),addEventListener("pointercancel",o,Yt)):en(t,e))},rn=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,nn,Yt)})},on="hidden"===document.visibilityState?0:1/0,addEventListener("visibilitychange",function e(t){"hidden"===document.visibilityState&&(on=t.timeStamp,removeEventListener("visibilitychange",e,!0))},!0),sn(),self.webVitals={firstInputPolyfill:function(e){Xt.push(e),tn()},resetFirstInputPolyfill:sn,get firstHiddenTime(){return on}};function ln(e,t){var n=xn(),r="navigate";return 0<=On?r="back-forward-cache":n&&(document.prerendering||0<Mn()?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}}function un(e,t,n){try{var r;if(PerformanceObserver.supportedEntryTypes.includes(e))return(r=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})})).observe(Object.assign({type:e,buffered:!0},n||{})),r}catch(e){}}function cn(t,n,r,i){var o,a;return function(e){0<=n.value&&(e||i)&&((a=n.value-(o||0))||void 0===o)&&(o=n.value,n.delta=a,n.rating=(e=n.value)>r[1]?"poor":e>r[0]?"needs-improvement":"good",t(n))}}function dn(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})}function hn(t){function e(e){"pagehide"!==e.type&&"hidden"!==document.visibilityState||t(e)}addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0)}function fn(t){var n=!1;return function(e){n||(t(e),n=!0)}}function pn(){return In<0&&(In=An(),Dn(),Tn(function(){setTimeout(function(){In=An(),Dn()},0)})),{get firstHiddenTime(){return In}}}function mn(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()}function vn(o,a){a=a||{},mn(function(){var t,n=pn(),r=ln("FCP"),i=un("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<n.firstHiddenTime)&&(r.value=Math.max(e.startTime-Mn(),0),r.entries.push(e),t(!0))})});i&&(t=cn(o,r,Nn,a.reportAllChanges),Tn(function(e){r=ln("FCP"),t=cn(o,r,Nn,a.reportAllChanges),dn(function(){r.value=performance.now()-e.timeStamp,t(!0)})}))})}function gn(e){var t,n,r,i,o,a;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(n=t,r=e,i=function(){Bn(n,r),a()},o=function(){a()},a=function(){removeEventListener("pointerup",i,Un),removeEventListener("pointercancel",o,Un)},addEventListener("pointerup",i,Un),addEventListener("pointercancel",o,Un)):Bn(t,e))}function yn(e){e.forEach(function(e){e.interactionId&&(Vn=Math.min(Vn,e.interactionId),Gn=Math.max(Gn,e.interactionId),qn=Gn?(Gn-Vn)/7+1:0)})}function wn(){return Zn()-Kn}function bn(e){var t=$n[$n.length-1],n=Xn[e.interactionId];(n||$n.length<10||e.duration>t.latency)&&(n?(n.entries.push(e),n.latency=Math.max(n.latency,e.duration)):(t={id:e.interactionId,latency:e.duration,entries:[e]},Xn[t.id]=t,$n.push(t)),$n.sort(function(e,t){return t.latency-e.latency}),$n.splice(10).forEach(function(e){delete Xn[e.id]}))}function kn(e,t){function n(t,n,r,i){function o(e){"visibilitychange"===t&&"hidden"!==document.visibilityState||(i?setTimeout(function(){return n(e)},i):n(e),r&&removeEventListener(t,o,!0))}addEventListener(t,o,!0)}var r;n("visibilitychange",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.visibilitychange),n("pagehide",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.pagehide),n("beforeunload",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.beforeunload)}var _n,Sn,En,Cn,Rn,On=-1,Tn=function(t){addEventListener("pageshow",function(e){e.persisted&&(On=e.timeStamp,t(e))},!0)},xn=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Mn=function(){var e=xn();return e&&e.activationStart||0},In=-1,An=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Pn=function(e){"hidden"===document.visibilityState&&-1<In&&(In="visibilitychange"===e.type?e.timeStamp:0,Ln())},Dn=function(){addEventListener("visibilitychange",Pn,!0),addEventListener("prerenderingchange",Pn,!0)},Ln=function(){removeEventListener("visibilitychange",Pn,!0),removeEventListener("prerenderingchange",Pn,!0)},Nn=[1800,3e3],Fn=[.1,.25],Un={passive:!0,capture:!0},zn=new Date,Bn=function(e,t){_n||(_n=t,Sn=e,En=new Date,Wn(removeEventListener),jn())},jn=function(){var t;0<=Sn&&Sn<En-zn&&(t={entryType:"first-input",name:_n.type,target:_n.target,cancelable:_n.cancelable,startTime:_n.timeStamp,processingStart:_n.timeStamp+Sn},Cn.forEach(function(e){e(t)}),Cn=[])},Wn=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,gn,Un)})},Hn=[100,300],qn=0,Vn=1/0,Gn=0,Zn=function(){return Rn?qn:performance.interactionCount||0},Jn=[200,500],Kn=0,$n=[],Xn={},Yn=[2500,4e3],Qn={},er=(tr.prototype.start=function(){var t=this,n=new PerformanceObserver(function(e){e=e.getEntriesByName("first-contentful-paint");0<e.length&&(t.fcp=e[0].startTime,t.slientWindowStartTime=t.fcp,n.disconnect(),setTimeout(function(){t.checkTTI()},Math.max(t.slienceTimeInterval-(performance.now()-t.fcp)+20,1)))});n.observe({entryTypes:["paint"]}),this.longtaskObserver=new PerformanceObserver(function(e){e=e.getEntries();t.longTaskEntries=t.longTaskEntries.concat(e)}),this.longtaskObserver.observe({entryTypes:["longtask"]}),this.resourceObserver=new PerformanceObserver(function(e){e=e.getEntries();t.resourceEntries=t.resourceEntries.concat(e)}),this.resourceObserver.observe({entryTypes:["resource"]})},tr.prototype.checkTTI=function(){var e=this;this.hasSlientWindow()?(this.calculateTTI(),this.longtaskObserver.disconnect(),this.resourceObserver.disconnect()):setTimeout(function(){e.checkTTI()},this.checkInterval)},tr.prototype.hasSlientWindow=function(){var e,t=performance.now();return!(t-this.slientWindowStartTime<5e3||((e=this.getLastLongTaskEndTime())>this.slientWindowStartTime?(this.slientWindowStartTime=e,this.resourceEntries=[]):this.getRequestCount(this.slientWindowStartTime,t)<=2?(this.lastLongtaskEndTime=e,0):(t=this.resourceEntries.sort(function(e,t){return e.startTime-t.startTime}),this.slientWindowStartTime=t[this.resourceEntries.length-2].startTime,1)))},tr.prototype.getLastLongTaskEndTime=function(){var t;return 0===this.longTaskEntries.length?-1:(t=0,this.longTaskEntries.forEach(function(e){e.startTime+e.duration>t&&(t=e.startTime+e.duration)}),t)},tr.prototype.getRequestCount=function(t,n){var r=0;return this.resourceEntries.forEach(function(e){e.startTime>=t&&e.startTime+e.duration<=n&&(r+=1)}),r},tr.prototype.calculateTTI=function(){var e=-1===this.lastLongtaskEndTime?this.slientWindowStartTime:this.lastLongtaskEndTime,t=performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,e=Math.max(t,e);this.onTTICallback(e)},tr);function tr(e){this.slienceTimeInterval=5e3,this.checkInterval=100,this.fcp=0,this.longTaskEntries=[],this.resourceEntries=[],this.slientWindowStartTime=performance.now(),this.onTTICallback=e}new e({name:"webVitals"});function nr(e){var t=e.name;0<(e=e.value)&&(or[t]=e)}function rr(e,t,n,r){return void 0===n&&(n=15e3),void 0===r&&(r=0),(t=void 0===t?0:t)<=e&&e<=n?e:r}var ir,or={FCP:-1,LCP:-1,FID:-1,CLS:-1,INP:-1,TTI:-1,from:void 0},ar=new Map,sr=new e({name:"webVitals",onNewTdem:function(e){var t,n,r,o,a,s,l,u,c,d,h,i,f,p,m=this;if(Ke()&&"function"==typeof window.PerformanceObserver&&"function"==typeof performance.getEntriesByName)try{"function"!=typeof(p=(i=void 0===i?"undefined"==typeof window?{}:window:i).PerformanceObserver)||p.__tdemStartTimeGuard||(f=p,Object.setPrototypeOf(v,f),v.prototype=f.prototype,v.__tdemStartTimeGuard=!0,i.PerformanceObserver=v),ar.set(e,{isWebVitalsReported:!1,hasFirstEntry:!1,custom:null}),vn(nr),d=nr,h={},mn(function(){function e(e){(e=e[e.length-1])&&e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Mn(),0),i.entries=[e],t())}var t,n,r=pn(),i=ln("LCP"),o=un("largest-contentful-paint",e);o&&(t=cn(d,i,Yn,h.reportAllChanges),n=fn(function(){Qn[i.id]||(e(o.takeRecords()),o.disconnect(),Qn[i.id]=!0,t(!0))}),["keydown","click"].forEach(function(e){addEventListener(e,function(){return setTimeout(n,0)},!0)}),hn(n),Tn(function(e){i=ln("LCP"),t=cn(d,i,Yn,h.reportAllChanges),dn(function(){i.value=performance.now()-e.timeStamp,Qn[i.id]=!0,t(!0)})}))}),u=nr,c={},mn(function(){function t(e){e.startTime<n.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),o(!0))}function e(e){e.forEach(t)}var n=pn(),r=ln("FID"),i=un("first-input",e),o=cn(u,r,Hn,c.reportAllChanges);i&&hn(fn(function(){e(i.takeRecords()),i.disconnect()})),i&&Tn(function(){r=ln("FID"),o=cn(u,r,Hn,c.reportAllChanges),Cn=[],Sn=-1,_n=null,Wn(addEventListener),Cn.push(t),jn()})}),s=nr,l={},vn(fn(function(){function e(e){e.forEach(function(e){var t,n;e.hadRecentInput||(t=i[0],n=i[i.length-1],r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,i.push(e)):(r=e.value,i=[e]))}),r>n.value&&(n.value=r,n.entries=i,t())}var t,n=ln("CLS",0),r=0,i=[],o=un("layout-shift",e);o&&(t=cn(s,n,Fn,l.reportAllChanges),hn(function(){e(o.takeRecords()),t(!0)}),Tn(function(){n=ln("CLS",r=0),t=cn(s,n,Fn,l.reportAllChanges),dn(function(){return t()})}),setTimeout(t,0))})),o=nr,a={},mn(function(){var e;"interactionCount"in performance||(Rn=Rn||un("event",yn,{type:"event",buffered:!0,durationThreshold:0}));function t(e){e.forEach(function(t){t.interactionId&&bn(t),"first-input"!==t.entryType||$n.some(function(e){return e.entries.some(function(e){return t.duration===e.duration&&t.startTime===e.startTime})})||bn(t)}),e=Math.min($n.length-1,Math.floor(wn()/50)),(e=$n[e])&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,i())}var n=ln("INP"),r=un("event",t,{durationThreshold:null!=(e=a.durationThreshold)?e:40}),i=cn(o,n,Jn,a.reportAllChanges);r&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&r.observe({type:"first-input",buffered:!0}),hn(function(){t(r.takeRecords()),n.value<0&&0<wn()&&(n.value=0,n.entries=[]),i(!0)}),Tn(function(){$n=[],Kn=Zn(),n=ln("INP"),i=cn(o,n,Jn,a.reportAllChanges)}))}),r=function(e){nr({name:"TTI",value:e})},Ke()&&new er(r).start(),kn(function(){m.tryReport(e,null,"onHidden")},{once:!0,delay:{visibilitychange:10}}),or.from=(null==(n=null==(t=e)?void 0:t.getOriginFrom)?void 0:n.call(t))||window.location.href}catch(e){}function v(n){return new f(function(e,t){try{n(e,t)}catch(e){if(!(0<=(e instanceof Error?e.message:String(e||"")).indexOf("startTime")))throw e}})}},tryReport:function(t,n,r){var i=this;void 0===r&&(r="manual"),this.$walk(function(e){e===t&&("object"==typeof(e=i.$getConfig(t))&&!0===e.manualReport||"onHidden"!==r?(e=ar.get(t))&&!e.hasFirstEntry?(e.hasFirstEntry=!0,"manual"===r&&n&&(e.custom=n)):i.doReport(t,(null==e?void 0:e.custom)||n):i.doReport(t,null))})},doReport:function(o,a){var e=ar.get(o);if(e){if(null!=e&&e.isWebVitalsReported)return;e.isWebVitalsReported=!0}this.$walk(function(e){var t,n,r,i;e===o&&(t=x({},or),a&&Object.keys(a).forEach(function(e){null!=a[e]&&(t[e]=a[e])}),n={environment:e.config.env||"production",version:String(e.config.version||"")},r={},0<t.LCP&&(r.lcp=t.LCP),0<t.FCP&&(r.fcp=t.FCP),0<t.FID&&(r.fid=t.FID),0<=t.CLS&&(r.cls=t.CLS),0<t.TTFB&&(r.ttfb=t.TTFB),0<t.TTI&&(r.tti=t.TTI),0<t.INP&&(r.inp=t.INP),i={event_id:A(),event_type:M.true,event_category:I.PERFORMANCE,timestamp:Date.now(),page_url:t.from||(null==(i=e.getOriginFrom)?void 0:i.call(e))||window.location.href,data:{measurements:r,replay_id:ot(e),tags:n}},null!=(r=e.reportTDEMEvent))&&r.call(e,i)})},publish:function(e,t){this.tryReport(e,t,"manual")},destroy:function(){this.option.publish=function(){}}}),lr=(new e({name:"pagePerformance"}),3),ur=new Map,cr=new e({name:"pagePerformance",performanceMap:{},onNewTdem:function(t){var e;Ke()&&(ur.set(t,{isPagePerformanceReported:!1}),ir?this.publish(ir,t):this.startCalcPerformance(t),e=this.publishWhenObHidden.bind(this,t),kn(e,{once:!0}),t.lifeCycle.on("destroy",function(){var e=ur.get(t);e&&(e.isPagePerformanceReported=!1)}))},publishWhenObHidden:function(e){var t,n=ur.get(e);if(null==n||!n.isPagePerformanceReported){n=0;if(null!=(t=e.firstScreenInfo)&&t.timing)n=e.firstScreenInfo.timing;else if($e("paint"))try{var r,i=performance.getEntriesByName("first-contentful-paint");i&&0<i.length&&(r=i[0])&&0<r.startTime&&(n=r.startTime)}catch(e){}(ir=this.buildPerformanceLog(e,n,this.getPageUrl(e),window.location.href))&&this.publish(ir,e,!0)}},buildPerformanceLog:function(e,t,n,r){var i=performance.timing;if(i)return n={from:n,originFrom:r,dnsLookup:rr(i.domainLookupEnd-i.domainLookupStart),tcp:rr(i.connectEnd-i.connectStart),ssl:rr(0===i.secureConnectionStart?0:i.requestStart-i.secureConnectionStart),ttfb:rr(i.responseStart-i.requestStart),contentDownload:rr(i.responseEnd-i.responseStart),domParse:rr(i.domInteractive-i.domLoading,0,15e3,1070),resourceDownload:rr(i.loadEventStart-i.domInteractive,0,15e3,1070),firstScreenTiming:rr(Math.floor(t),0,15e3,15e3)},(r=e.config).extraPerformanceData&&"{}"!==JSON.stringify(r.extraPerformanceData)&&(t=(i=r.extraPerformanceData).engineInit,e=i.bundleLoad,n=x(x({},n),{engineInit:rr(t,0,1e4),bundleLoad:rr(e,0,1e4)})),n},publish:function(r,i){this.$walk(function(e){var t,n;e===i&&(n=(t=performance.timing).navigationStart,t={event_id:A(),event_type:M.PAGE_LOAD,event_category:I.PERFORMANCE,timestamp:Date.now(),page_url:r.originFrom||window.location.href,data:{measurements:{lcp:or.lcp,fcp:or.fcp,fid:or.fid,cls:or.cls,ttfb:or.ttfb||r.ttfb,dns_time:r.dnsLookup,tcp_time:r.tcp,ssl_time:r.ssl,request_time:r.ttfb,response_time:r.contentDownload,dom_parse_time:r.domParse,dom_ready:t.domContentLoadedEventEnd-n,load_complete:t.loadEventEnd-n,first_screen_time:r.firstScreenTiming},replay_id:ot(e),tags:{environment:e.config.env||"production",version:String(e.config.version||"")}}},null!=(n=e.reportTDEMEvent)&&n.call(e,t),n=ur.get(e))&&(n.isPagePerformanceReported=!0)})},getPageUrl:function(e){var t=this.$getConfig(e);if(null!=t&&t.urlHandler&&"function"==typeof(null==t?void 0:t.urlHandler)){t=null==t?void 0:t.urlHandler();if(t)return encodeURIComponent(t)}return e.getCurrentPageUrl()},startCalcPerformance:function(t){var n=this;try{var r=this.getPageUrl(t),i=t.getOriginFrom();this.getFirstScreenTiming(t,function(e){ir=n.buildPerformanceLog(t,e,r,i);e=ur.get(t);!ir||null!=e&&e.isPagePerformanceReported||n.publish(ir,t)})}catch(t){}},getFirstScreenTiming:function(s,l){var u=this;s.lifeCycle.on("destroy",function(){v&&clearTimeout(v)});var c,d=this,n=["script","style","link","br"],h=[],f={},p=($e("paint")&&(c=new PerformanceObserver(function(e){e.getEntries().forEach(function(e){var t;"paint"===e.entryType&&"first-contentful-paint"===e.name&&0<(t=document.querySelectorAll("[TDEM-FIRST-SCREEN-TIMING],[AEGIS-FIRST-SCREEN-TIMING]")).length&&s.config.id&&!u.performanceMap[s.config.id]&&(u.setFirstScreenInfo(s,e.startTime,t[0],t),null!=l&&l(e.startTime),p.disconnect(),c.disconnect(),v)&&clearTimeout(v)})})).observe({entryTypes:["paint"]}),new MutationObserver(function(e){var t={roots:[],ignores:[],rootsDomNum:[],time:performance.now()};e.forEach(function(e){e&&e.addedNodes&&Array.prototype.slice.call(e.addedNodes).forEach(function(e){d.isEleInArray(e,t.ignores)?t.ignores.push(e):1===e.nodeType&&(e.hasAttribute("TDEM-FIRST-SCREEN-TIMING")||e.hasAttribute("AEGIS-FIRST-SCREEN-TIMING"))?(Object.prototype.hasOwnProperty.apply(f,[t.time])||(f[t.time]=[]),f[t.time].push(e)):1===e.nodeType&&(d.hasAncestorOrSelfWithAttribute(e,"TDEM-IGNORE-FIRST-SCREEN-TIMING")?t.ignores.push(e):-1!==n.indexOf(e.nodeName.toLocaleLowerCase())||d.isEleInArray(e,t.roots)||(t.roots.push(e),t.rootsDomNum.push(d.walkAndCount(e)||0)))})}),t.roots.length&&h.push(t)})),m=(p.observe(document,{childList:!0,subtree:!0}),function(n){(n=void 0===n?0:n)||(r=0,(e=Object.keys(f)).length?(n=Math.max.apply(null,e),u.setFirstScreenInfo(s,n,null==(e=f[n])?void 0:e[0],f)):h.forEach(function(e){for(var t=0;t<e.roots.length;t++)e.rootsDomNum[t]>r&&d.isInFirstScreen(e.roots[t])&&(r=e.rootsDomNum[t],n=e.time,u.setFirstScreenInfo(s,n,e.roots[t]))}),h.length=0,Object.keys(f).forEach(function(e){f[e]=f[e].map(function(e){var t={tagName:e.tagName},n=e.attributes;if(!n)return e;for(var r=0;r<n.length;r++){var i=n[r];i.name&&(t[i.name]=e.getAttribute(i.name))}return t})}));var r,e=performance.timing,t=e.domInteractive-e.domLoading,i=n;v=null;for(var o=0,a=[t,e.loadEventStart-e.domInteractive,i];o<a.length;o++)if(a[o]<=0&&0<lr){v=setTimeout(function(){return m(i)},3e3);break}v?--lr:(p.disconnect(),null!=c&&c.disconnect(),null!=l&&l(n))}),v=setTimeout(function(){return m()},3e3)},setFirstScreenInfo:function(e,t,n,r){var i;e.config.id&&this.performanceMap[e.config.id]||(e.config.id&&(this.performanceMap[e.config.id]=!0),("object"!=typeof(null==(i=e.config)?void 0:i.pagePerformance)||null!=(i=e.config.pagePerformance)&&i.firstScreenInfo)&&(e.firstScreenInfo={element:n,timing:t,markDoms:r}))},isEleInArray:function(e,t){return!(!e||e===document.documentElement)&&(-1!==t.indexOf(e)||this.isEleInArray(e.parentElement,t))},isInFirstScreen:function(e){var t;return!(!e||"function"!=typeof e.getBoundingClientRect)&&(e=e.getBoundingClientRect(),t=window.innerHeight,0<=e.left)&&e.left<window.innerWidth&&0<=e.top&&e.top<t&&0<e.width&&0<e.height},walkAndCount:function(e){var t=0;if(e&&1===e.nodeType){t+=1;var n=e.children;if(null!=n&&n.length)for(var r=0;r<n.length;r++)1===n[r].nodeType&&(n[r].hasAttribute("TDEM-IGNORE-FIRST-SCREEN-TIMING")||n[r].hasAttribute("AEGIS-IGNORE-FIRST-SCREEN-TIMING"))||(t+=this.walkAndCount(n[r]))}return t},hasAncestorOrSelfWithAttribute:function(e,t){for(var n=t.replace(/^TDEM-/,"AEGIS-"),r=e;r&&r!==document.body;){if(r.hasAttribute(t)||n!==t&&r.hasAttribute(n))return!0;r=r.parentElement}return!1}}),dr=(new e({name:"spa"}),["replaceState","pushState","popstate","hashchange"]),hr=new e({name:"spa",originFireUrl:"",lastPageUrl:"",navigationStack:[],navigationIndex:-1,onNewTdem:function(n){var r=this,e=(history.pushState=this.wr("pushState")||history.pushState,history.replaceState=this.wr("replaceState")||history.replaceState,this.sendPv=this.sendPv.bind(this),location.href);this.navigationStack.length||(this.navigationStack=[e],this.navigationIndex=0),n.config.spa&&this.sendPv(n,"reload"),dr.forEach(function(e){var t=e;window.addEventListener(e,function(){return r.sendPv.call(r,n,t)})})},wr:function(n){var r=history[n],e="__"+n+"__hasWrittenByTamSpa";return"function"==typeof r&&!history[e]&&(Object.defineProperty(history,e,{value:!0,enumerable:!1}),function(){var e=r.apply(this,arguments),t=null;return"function"==typeof Event?t=new Event(n):(t=document.createEvent("HTMLEvents")).initEvent(n,!1,!0),window.dispatchEvent(t),e})},resolveNavigationType:function(e,t){var n;return"pushState"===e?(this.navigationIndex<this.navigationStack.length-1&&(this.navigationStack=this.navigationStack.slice(0,this.navigationIndex+1)),this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"push"):"replaceState"===e?(this.navigationIndex<0?(this.navigationStack=[t],this.navigationIndex=0):this.navigationStack[this.navigationIndex]=t,"replace"):"hashchange"===e?"hashchange":"popstate"===e?0<=(e=this.navigationStack.lastIndexOf(t))?(n=e<this.navigationIndex?"back":"forward",this.navigationIndex=e,n):(this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"forward"):"reload"},sendPv:function(s,e){var l=this;void 0===e&&(e="reload"),setTimeout(function(){s._customPageUrl=null;var r=location.pathname+location.hash+s.config.id,i=s.getOriginFrom(),o=l.lastPageUrl||void 0,a=l.resolveNavigationType(e,location.href);l.$walk(function(e){var t,n;e===s&&r&&r!==l.originFireUrl&&(n={event_id:A(),event_type:M.PAGE_VIEW,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:i,data:{page_title:document.title||"",referrer:document.referrer||void 0,is_effective_action:!0,replay_id:ot(e),tags:{environment:e.config.env||"production",version:String(e.config.version||""),is_spa:"true"},event_properties:{navigation_type:a,from_page:(o||"").slice(0,512),to_page:(i||"").slice(0,512)}}},null!=(t=e.reportTDEMEvent)&&t.call(e,n),l.originFireUrl=r,l.lastPageUrl=i)})},0)},destroy:function(){this.option.sendPv=function(){}}}),fr="__MONITOR_SESSION_V1__";function pr(e,t){"undefined"!=typeof document&&(e=[e+"="+encodeURIComponent(t),"path=/","SameSite=Lax"],"undefined"!=typeof location&&"https:"===location.protocol&&e.push("Secure"),document.cookie=e.join("; "))}function mr(e,t,n){void 0===n&&(n=1);var r=Date.now();return{sessionId:e,createdAt:r,lastActivity:r,source:t,version:n}}function vr(e,t){var n,r,i;return"undefined"==typeof window?mr(t(),e):(r="undefined"!=typeof document&&(r="_tdem_s".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=document.cookie.match(new RegExp("(?:^|; )"+r+"=([^;]*)")))?decodeURIComponent(r[1]):null,n=window[fr],r?(null==n?void 0:n.sessionId)===r?(n.lastActivity=Date.now(),n):(i=mr(r,(null==n?void 0:n.source)||e,(null==n?void 0:n.version)||1),window[fr]=i):null!=n&&n.sessionId?(n.lastActivity=Date.now(),pr("_tdem_s",n.sessionId),n):(i=mr(t(),e),pr("_tdem_s",(window[fr]=i).sessionId),i))}_r.prototype.request=function(o,a){var s=this;return void 0===a&&(a={}),o.sendBeacon||o.handoff?this.handoff(o,a):new Promise(function(n){var e,r,t,i=new XMLHttpRequest;i.sendByTdem=!0,i.addEventListener("readystatechange",function(){var e,t;4===i.readyState&&((e={ok:0<i.status&&i.status<400,status:i.status,statusText:i.statusText,body:i.response,request:o}).ok?(null!=(t=a.success)&&t.call(a,i.response),null!=(t=a.final)&&t.call(a,e),n(e)):(t=x(x({},e),{error:i.response}),null!=(e=a.fail)&&e.call(a,i.response),null!=(e=a.final)&&e.call(a,t),n(t)))}),"get"===(o.method||"GET").toLowerCase()?(i.open("get",(e=o.url,r=o.data,"string"!=typeof e?"":"object"==typeof r&&r?(t=Object.getOwnPropertyNames(r).map(function(e){var t=r[e];return e+"="+("string"==typeof t?encodeURIComponent(t):encodeURIComponent(JSON.stringify(t)))}).join("&").replace(/eval/gi,"evaI"),e+(-1===e.indexOf("?")?"?":"&")+t):e)),s.applyHeaders(i,o.headers),i.send()):(i.open("post",o.url),s.applyHeaders(i,o.headers),o.contentType&&i.setRequestHeader("Content-Type",o.contentType),t=void 0!==o.body?o.body:o.data,s.shouldSanitizeEvalKeyword(o,t)&&(t=t.replace(/eval/gi,"evaI")),i.send(t))})},_r.prototype.shouldSanitizeEvalKeyword=function(e,t){return"string"==typeof t&&!("replay"===e.kind||(e=null!=(t=null==(t=e.headers)?void 0:t["Content-Encoding"])?t:null==(t=e.headers)?void 0:t["content-encoding"])&&/gzip/i.test(e))},_r.prototype.handoff=function(e,t){void 0===t&&(t={});var n,r="undefined"!=typeof navigator?navigator:void 0;return r&&"function"==typeof r.sendBeacon?(n=void 0!==e.body?e.body:e.data,n={ok:r=r.sendBeacon(e.url,n),request:e,handoffAccepted:r,error:r?void 0:new Error("navigator.sendBeacon rejected the payload")},r?null!=(r=t.success)&&r.call(t,{accepted:!0}):null!=(r=t.fail)&&r.call(t,n.error),null!=(r=t.final)&&r.call(t,n),Promise.resolve(n)):(r={ok:!1,request:e,error:new Error("navigator.sendBeacon is unavailable")},null!=(n=t.fail)&&n.call(t,r.error),null!=(e=t.final)&&e.call(t,r),Promise.resolve(r))},_r.prototype.applyHeaders=function(t,n){n&&Object.keys(n).forEach(function(e){t.setRequestHeader(e,n[e])})};var gr,yr,wr=_r,br=new Map,n=(C(yr=r,n=gr=nt),yr.prototype=null===n?Object.create(n):(kr.prototype=n.prototype,new kr),r.prototype._bootstrapInit=function(e){this.setConfig(e),this.config=R(this.config,e.hostUrl),this._prefetchConfigAndInit(e)},r.prototype._initImmediately=function(e){this.init(e),this._afterInit(e)},r.prototype._prefetchConfigAndInit=function(a){return P(this,void 0,void 0,function(){var t,n,r,i,o;return D(this,function(e){switch(e.label){case 0:if(t=this.config.id,n=this._buildPrefetchConfigUrl(),r=!1,i=null,!t||!n)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transportRequest({kind:"config",url:n,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_key:t})})];case 2:return(o=e.sent()).ok&&0===(o="string"==typeof o.body?JSON.parse(o.body):o.body).code&&o.data&&(r=!!o.data.enabled,i=o.data),[3,4];case 3:return e.sent(),(o=this._loadPrefetchDataFromCache(t))&&(r=!!o.enabled,i=o),[3,4];case 4:if(r){i&&(this._prefetchedConfigData=i);try{this._initAfterPreparedConfig(a)}catch(e){console.warn(e),console.log("%cThe above error occurred in the process of initializing TDEM, which will affect your normal use of TDEM.\nIt is recommended that you contact us for feedback and thank you for your support.","color: red"),this.sendSDKError(e)}}else console.info("[TDEM] SDK disabled by remote config, skip initialization");return[2]}})})},r.prototype._buildPrefetchConfigUrl=function(){var e=(this.config.url||"").replace(/\/+$/,"");return e?e+"/api/v1/config":""},r.prototype._loadPrefetchDataFromCache=function(e){try{var t,n,r=localStorage.getItem("TDEM_SAMPLE_CONFIG");return r?!((t=JSON.parse(r)).projectKey!==e||6048e5<=Date.now()-t.timestamp)&&0<t.sampleRate?(n={enabled:void 0!==t.remoteEnabled?!!t.remoteEnabled:0<t.sampleRate,tdem_sample_rate:t.sampleRate},void 0!==t.replaySampleRate&&(n.replay_sample_rate=t.replaySampleRate),void 0!==t.errorTraceback&&(n.error_traceback=t.errorTraceback),void 0!==t.errorSampleRate&&(n.error_sample_rate=t.errorSampleRate),n):null:null}catch(e){return null}},r.prototype._initAfterPreparedConfig=function(e){for(var t=0;t<nt.installedPlugins.length;t++)try{nt.installedPlugins[t].patch(this)}catch(e){this.sendSDKError(e)}this.lifeCycle.emit("onInited"),this._afterInit(e)},r.prototype._afterInit=function(e){var t,o,n=this;this._sdkInitialized=!0,this.extendBean("sessionId",r.sessionID),this.extendBean("from",this.getCurrentPageUrl()),"undefined"!=typeof document&&this.extendBean("referer",encodeURIComponent(document.referrer||"")),t=L(O("tdem-web-retry-report-requests"),[]),(o=function(){var i;t.length&&(i=t.splice(0,1)[0],T("tdem-web-retry-report-requests",JSON.stringify(t)),n.$request(i,function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return null==(t=br.get(null==(e=i.extraRetryOptions)?void 0:e.success))?void 0:t.apply(i,n)}finally{o()}},function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return null==(t=br.get(null==(e=i.extraRetryOptions)?void 0:e.fail))?void 0:t.apply(i,n)}finally{o()}}))})()},r.prototype.getBean=function(t){var n=this;return void 0===t&&(t=[]),""+Object.getOwnPropertyNames(this.bean).filter(function(e){return-1===t.indexOf(e)}).map(function(e){return"from"===e?"from="+n.getCurrentPageUrl():e+"="+n.bean[e]}).join("&")},r.prototype.getCurrentPageUrl=function(){var e;return this._customPageUrl?encodeURIComponent(this._customPageUrl.slice(0,2048)):(e=this.config.pageUrl||location.href,e=(e="function"==typeof this.config.urlHandler?this.config.urlHandler()||location.href:e).slice(0,2048),encodeURIComponent(e))},r.prototype.getOriginFrom=function(){if(this._customPageUrl)return this._customPageUrl.slice(0,2048);try{return("undefined"!=typeof window&&window.location?window.location.href:"").slice(0,2048)}catch(e){return""}},r.prototype.ready=function(){function o(){var e,n,r,i;t.reportRequestQueue.length&&(e=t.reportRequestQueue.splice(0,1)[0],n=e.options,r=e.success,i=e.fail,t.$request(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==r?void 0:r.apply(n,e)}finally{o()}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==i?void 0:i.apply(n,e)}finally{o()}}))}var t=this;o(),this.isReportReady=!0},r.prototype.request=function(l,n,u){var c,d,h=this;this.config.reportImmediately||this.isReportReady?this.$request(l,c=function(e){var t=L(O("tdem-web-retry-report-requests"),[]);null!=t&&t.length&&l.extraRetryOptions&&(t.splice(t.findIndex(function(e){return e.extraRetryOptions.requestId===l.extraRetryOptions.requestId}),1),T("tdem-web-retry-report-requests",JSON.stringify(t)),br.delete(l.extraRetryOptions.success),br.delete(l.extraRetryOptions.fail)),null!=n&&n(e)},d=function(e){if(!h.config.reportRetry)return null==u?void 0:u(e);var t,n="boolean"==typeof h.config.reportRetry?Mt:x(x({},Mt),h.config.reportRetry),r=n.maxRetryCount,i=void 0===r?Mt.maxRetryCount:r,r=n.retryInterval,r=void 0===r?Mt.retryInterval:r,n=n.whenRetryEndStillFail,o=void 0===n?Mt.whenRetryEndStillFail:n,a=(l.extraRetryOptions||(l.extraRetryOptions={requestId:"",retriedCount:0,success:"",fail:""}),l.extraRetryOptions),s=(a.requestId=a.requestId||l.url+"-"+Date.now()+"-"+Math.random(),a.requestId),n=(a.retriedCount=a.retriedCount||0,a.success=a.success||s+"_successCallback",a.fail=a.fail||s+"_failCallback",L(O("tdem-web-retry-report-requests"),[]));n.find(function(e){return e.extraRetryOptions.requestId===s})?(t=n.findIndex(function(e){return e.extraRetryOptions.requestId===s}),n[t]=l):n.push(l),T("tdem-web-retry-report-requests",JSON.stringify(n)),setTimeout(function(){if(a.retriedCount<i)l.extraRetryOptions.retriedCount+=1,h.$request(l,c,d);else{if("discard"===o){var e=L(O("tdem-web-retry-report-requests"),[]).filter(function(e){return(null==(e=e.extraRetryOptions)?void 0:e.requestId)!==s});if(e.length)T("tdem-web-retry-report-requests",JSON.stringify(e));else try{localStorage.removeItem("tdem-web-retry-report-requests")}catch(e){}}br.delete(a.success),br.delete(a.fail)}},"function"==typeof r?r(l.extraRetryOptions.retriedCount):r),null!=u&&u(e),br.has(a.success)||br.set(a.success,c),br.has(a.fail)||br.set(a.fail,d)}):this.reportRequestQueue.push({options:l,success:n,fail:u})},r.prototype.$request=function(s,e,t){var n,r;if(s&&"string"==typeof s.url&&""!==s.url&&this.bean.id)return n=s.url,!1!==s.addBean&&(n=((e,t)=>{var n,r,i,o=e,a=s.beanFilter||[];for(n in t)-1===a.indexOf(n)&&((i=(r=new RegExp("([?&])"+n+"(=([^&]*))?(?=&|$)")).exec(o))?i[2]&&""!==i[3]&&"undefined"!==i[3]||(o=o.replace(r,"$1"+n+"="+t[n])):(i=-1<o.indexOf("?")?"&":"?",o+=i+n+"="+t[n]));return o})(n,x(x({},this.bean),{from:this.getCurrentPageUrl()}))),s.url=n,n=s.method||"get",r=this.config.onBeforeRequest,(s=r?r(s,this):s)?s.url?(r={success:e,fail:t},void((e={kind:s.type===oe.WHITE_LIST?"config":"events",url:s.url,method:n.toUpperCase(),contentType:s.contentType,data:s.data,body:s.data,sendBeacon:!!(null!=s&&s.sendBeacon||this.sendNow),source:s}).sendBeacon?this.transportHandoff(e,r):this.transportRequest(e,r))):console.warn("Please handle the parameters reasonably, options.url is necessary"):console.warn("Sending request blocked")},r.prototype.publishPluginsLogs=function(){var e=r.installedPlugins.find(function(e){return"assets"===e.name});null!=e&&e.option.collectNotReportedLog(this)},r.prototype.uploadLogs=function(e,t){var n;void 0===e&&(e={}),void 0===t&&(t={}),null!=(n=this.lifeCycle)&&n.emit("uploadLogs",e,t)},r.prototype.reportWebVitals=function(e){try{var t=r.installedPlugins.find(function(e){return"webVitals"===e.name});t&&this.config.webVitals&&this.config.webVitals.manualReport&&t.option.publish(this,e)}catch(e){}},r.sessionID=vr("tdem",Me).sessionId,r);function r(e,t){var n,r,i,a,o,s,l,u,c,d,h=gr.call(this,e,t=void 0===t?{}:t)||this;h.sendNow=!1,h.isReportReady=!1,h.reportRequestQueue=[],h._sdkInitialized=!1,h.speedLogPipeline=Ze([(u=[],c=(o=h).config,o.lifeCycle.on("destroy",function(){u.length=0}),function(e,t){Array.isArray(e)?u=u.concat(e):u.push(e),s&&u.length>=s||o.sendNow&&0<u.length?(u=Se(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length)),l&&clearTimeout(l)):(l&&clearTimeout(l),l=setTimeout(function(){l=null,u=Se(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length))},c.delay))}),(a=h.config,function(e,t){var n,r,i,o="number"==typeof a.repeat?a.repeat:60;!a.speedSample||o<=0?t(e):(n=(null==a?void 0:a.id)||"0",r=Ce[n]||{},Array.isArray(e)?(i=e.filter(function(e){var t=!r[e.url]||r[e.url]<o;return t?(r[e.url]=1+~~r[e.url],Ce[n]=r):Ee[n]||Re(n),t})).length&&t(i):!r[e.url]||r[e.url]<o?(r[e.url]=1+~~r[e.url],Ce[n]=r,t(e)):Ee[n]||Re(n))}),(i=h,function(t,n){Lt(function(e){i.extendBean("netType",e),n(t)})}),function(e,t){null!=(n=h.lifeCycle)&&n.emit("beforeReportSpeed",e);var n,r=h.config.beforeReportSpeed;if((e="function"==typeof r?e.filter(function(e){return!1!==r(e)}):e).length)return t(e)},function(e,t){t(e.map(function(e){return void 0!==e.payload&&delete e.payload,e}))},function(e){return h.sendPipeline([function(e,t){t({type:oe.SPEED,url:""+h.config.speedUrl,method:"post",data:ne(e,x(x({},h.bean),{from:h.getCurrentPageUrl()})),log:e})}],oe.SPEED)(e)}]),h.getInternalTransport()||h.setInternalTransport(new wr),e.asyncPlugin=!0;try{"undefined"!=typeof document&&(d=String(e.userId||e.uin||(null!=(n=document.cookie.match(/\buin=\D+(\d*)/))?n:[])[1]||(null!=(r=document.cookie.match(/\bilive_uin=\D*(\d+)/))?r:[])[1]||""),e.userId=d,e.uin=e.uin||d),h._bootstrapInit(e)}catch(e){console.warn(e),console.log("%cThe above error occurred in the process of initializing TDEM, which will affect your normal use of TDEM.\nIt is recommended that you contact us for feedback and thank you for your support.","color: red"),h.sendSDKError(e)}return h}function kr(){this.constructor=yr}function _r(){}new e({name:"ie"}),new e({name:"onClose"});var Sr=new e({name:"onClose",onNewTdem:function(n){var r,i=this;l.desktop()?(r=window.onunload,window.onunload=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.publishNotReportedLog(n),null!=r&&r.call.apply(r,g([window],e))}):kn(this.publishNotReportedLog.bind(this,n),{once:!0})},publishNotReportedLog:function(t){var n=this;this.$walk(function(e){e===t&&(e.sendNow=!0,e.publishPluginsLogs(),n.publishThrottlePipeLogs(e))})},publishThrottlePipeLogs:function(e){null!=e&&e.speedLogPipeline([]),null!=e&&e.tdemEventPipeline([])}});function Er(){return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)})}new e({name:"aid"});Tr.generate=function(){return"rep_"+this.uuid32()},Tr.uuid32=function(){return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/x/g,function(){return Math.floor(16*Math.random()).toString(16)})};var Cr=Tr,Rr="[SessionReplay]",Or=!1;function Tr(){}function f(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Or&&console.log.apply(console,g([Rr+"["+e+"]"],t))}function xr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Or&&console.debug.apply(console,g([Rr+"["+e+"]"],t))}function Mr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Or&&console.log.apply(console,g([Rr+"["+e+"] WARN:"],t))}function Ir(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Or&&console.log.apply(console,g([Rr+"["+e+"] ERROR:"],t))}Nr.prototype.setTdemInstance=function(e){this.tdemInstance=e},Nr.prototype.createSession=function(e){void 0===e&&(e="session");var t=null==(t=this.session)?void 0:t.replayId,n=vr("tdem",Er),n=x({id:n.sessionId,replayId:Cr.generate(),started:Date.now(),lastActivity:Date.now(),segmentId:0,sampled:e},t?{previousReplayId:t}:{});return this.session=n,this.syncSharedSession(n.id),f("SessionManager","Document replay session created:",n.id,n.replayId),n},Nr.prototype.restoreSession=function(){return this.session},Nr.prototype.saveSession=function(){},Nr.prototype.refreshSession=function(){var e=null!=(e=null==(e=this.session)?void 0:e.sampled)?e:"session";return this.createSession(e)},Nr.prototype.updateActivity=function(){this.session&&(this.session.lastActivity=Date.now())},Nr.prototype.incrementSegmentId=function(){var e;return this.session?(e=this.session.segmentId,this.session.segmentId+=1,e):0},Nr.prototype.shouldRefreshSession=function(){return!1},Nr.prototype.getSession=function(){return this.session},Nr.prototype.getSessionId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.id)?e:""},Nr.prototype.getReplayId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.replayId)?e:""},Nr.prototype.clearSession=function(){var e;this.session=null;try{null!=(e=window.sessionStorage)&&e.removeItem("tdem_session")}catch(e){}},Nr.prototype.syncSharedSession=function(e){var t,n,r,i;this.tdemInstance&&this.tdemInstance.extendBean("sessionId",e),e=e,t="tdem","undefined"!=typeof window&&(n=Date.now(),(r=window[fr])?(i=r.sessionId!==e,r.sessionId=e,r.version=i?r.version+1:r.version,r.source=t,i&&(r.createdAt=n),r.lastActivity=n):window[fr]=mr(e,t),pr("_tdem_s",e),window.dispatchEvent(new CustomEvent("monitor-session-update",{detail:{sessionId:e,source:t}})))};var Ar=Nr,Pr=((i={})[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i[i.Asset=7]="Asset",i),Dr=(Lr.prototype.ensureReady=function(){return P(this,void 0,void 0,function(){return D(this,function(e){return[2,this.ready]})})},Lr.prototype.postMessage=function(n,r){var i=this,o=this.nextId++;return new Promise(function(e,t){i.pendingRequests.set(o,{resolve:e,reject:t}),i.worker.postMessage({id:o,method:n,arg:r})})},Lr.prototype.destroy=function(){this.pendingRequests.forEach(function(e){return(0,e.reject)(new Error("Worker destroyed"))}),this.pendingRequests.clear(),this.worker.terminate()},Lr);function Lr(e){var o=this;this.nextId=0,this.pendingRequests=new Map,this.worker=e,this.worker.addEventListener("message",function(e){var e=e.data,t=e.id,n=e.success,r=e.response;"init"!==e.method&&(e=o.pendingRequests.get(t))&&(o.pendingRequests.delete(t),n?e.resolve(r):e.reject(new Error(r||"Worker request failed")))}),this.ready=new Promise(function(t,n){var r=function(e){e=e.data;"init"===e.method&&e.success&&(o.worker.removeEventListener("message",r),clearTimeout(i),t())},i=(o.worker.addEventListener("message",r),o.worker.addEventListener("error",function(e){o.worker.removeEventListener("message",r),clearTimeout(i),n(new Error("Worker error: "+(e.message||"unknown")))}),setTimeout(function(){o.worker.removeEventListener("message",r),n(new Error("Worker init timeout (5s)"))},5e3))})}function Nr(e){this.session=null,this.tdemInstance=null}Ur.prototype.initWorker=function(){var t=this,e=(()=>{try{var e,t,n;return"undefined"==typeof Worker||"undefined"==typeof Blob||"undefined"==typeof URL?null:(e=new Blob(["\n(function() {\n var events = [];\n var totalSize = 0;\n\n function handleMessage(data) {\n var method = data.method;\n var id = data.id;\n\n switch (method) {\n case 'addEvent':\n events.push(data.arg);\n totalSize += data.arg.length;\n return { id: id, method: method, success: true, response: totalSize };\n\n case 'finish':\n var json = '[' + events.join(',') + ']';\n events = [];\n totalSize = 0;\n // 返回原始 JSON 字符串,压缩在主线程做(pako 不好内联到 worker)\n return { id: id, method: method, success: true, response: json };\n\n case 'clear':\n events = [];\n totalSize = 0;\n return { id: id, method: method, success: true, response: void 0 };\n\n default:\n return { id: id, method: method, success: false, response: 'Unknown method' };\n }\n }\n\n self.addEventListener('message', function(e) {\n try {\n var result = handleMessage(e.data);\n self.postMessage(result);\n } catch (err) {\n self.postMessage({\n id: e.data.id,\n method: e.data.method,\n success: false,\n response: err.message || 'Worker error'\n });\n }\n });\n\n // 就绪信号\n self.postMessage({ method: 'init', success: true });\n})();\n"],{type:"application/javascript"}),t=URL.createObjectURL(e),n=new Worker(t,{name:"tdem-replay-compressor"}),URL.revokeObjectURL(t),f("CompressionWorker","Worker created successfully"),new Dr(n))}catch(e){return Mr("CompressionWorker","Failed to create worker, will fallback to sync buffer:",e),null}})();e?(this.workerHandler=e,this.useWorker=!0,e.ensureReady().then(function(){t.workerReady=!0,f("EventBuffer","Worker ready, migrating buffered events"),t.migrateEventsToWorker()}).catch(function(e){Mr("EventBuffer","Worker init failed, falling back to sync buffer:",e),t.useWorker=!1,t.workerHandler=null})):f("EventBuffer","Worker not available, using sync buffer")},Ur.prototype.migrateEventsToWorker=function(){if(this.workerHandler&&this.workerReady){var e=this.events;this.events=[];for(var t=0,n=e;t<n.length;t++){var r=n[t];this.addEventToWorker(r)}this.currentSize=0}},Ur.prototype.addEventToWorker=function(e){if(this.workerHandler)try{var t=JSON.stringify(e);this.workerHandler.postMessage("addEvent",t),this.workerEventCount++,this.workerSize+=t.length}catch(e){Mr("EventBuffer","Failed to send event to worker:",e)}},Ur.prototype.addEvent=function(e){var t;this.useWorker&&this.workerReady&&this.workerHandler?(t=this.estimateEventSize(e),this.workerSize+t>this.config.maxSize&&(Mr("EventBuffer","Worker buffer size limit exceeded, dropping old events"),this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0),this.addEventToWorker(e)):(t=this.estimateEventSize(e),this.currentSize+t>this.config.maxSize&&(Mr("EventBuffer","Size limit exceeded, removing old events"),this.trimOldEvents(t)),this.events.push(e),this.currentSize+=t)},Ur.prototype.getEvents=function(){return g(this.events)},Ur.prototype.getEventCount=function(){return this.useWorker&&this.workerReady?this.workerEventCount+this.events.length:this.events.length},Ur.prototype.getSize=function(){return this.useWorker&&this.workerReady?this.workerSize+this.currentSize:this.currentSize},Ur.prototype.isEmpty=function(){return!(this.useWorker&&this.workerReady&&0!==this.workerEventCount||0!==this.events.length)},Ur.prototype.finishAsync=function(){return P(this,void 0,void 0,function(){var t,n,r;return D(this,function(e){switch(e.label){case 0:if(!(this.useWorker&&this.workerReady&&this.workerHandler&&0<this.workerEventCount))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.workerHandler.postMessage("finish")];case 2:return t=e.sent(),r=this.workerEventCount,n=this.workerSize,this.workerEventCount=0,this.workerSize=0,[2,{events:[],eventCount:r,uncompressedSize:n,eventsJson:t}];case 3:return Mr("EventBuffer","Worker finish failed, falling back to sync:",e.sent()),[3,4];case 4:return[2,{events:r=this.getEvents(),eventCount:r.length,uncompressedSize:this.currentSize}]}})})},Ur.prototype.finish=function(){var e=this.getEvents();return{events:e,eventCount:e.length,uncompressedSize:this.currentSize}},Ur.prototype.clear=function(){this.events=[],this.currentSize=0,this.useWorker&&this.workerHandler&&(this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0)},Ur.prototype.destroy=function(){this.clear(),this.workerHandler&&(this.workerHandler.destroy(),this.workerHandler=null),this.useWorker=!1,this.workerReady=!1},Ur.prototype.estimateEventSize=function(e){try{return JSON.stringify(e).length}catch(e){return 1024}},Ur.prototype.trimOldEvents=function(e){for(var t=-1,n=this.events.length-1;0<=n;n--)if(this.events[n].type===Pr.FullSnapshot){t=n;break}var r=t;if(0<r)for(n=r-1;0<=n;n--)if(this.events[n].type===Pr.Meta){r=n;break}for(var i,o=0,a=Math.max(e,.2*this.config.maxSize),s=0;s<r&&o<a;)s++,(i=this.events.shift())&&(o+=this.estimateEventSize(i));if(r<0)for(;0<this.events.length&&o<a;)(i=this.events.shift())&&(o+=this.estimateEventSize(i));this.currentSize=Math.max(0,this.currentSize-o)},Ur.prototype.hasCheckout=function(){return this.events.some(function(e){return e.type===Pr.Meta||e.type===Pr.FullSnapshot})},Ur.prototype.getLastCheckoutTime=function(){for(var e=this.events.length-1;0<=e;e--){var t=this.events[e];if(t.type===Pr.FullSnapshot)return t.timestamp}return null},Ur.prototype.isUsingWorker=function(){return this.useWorker&&this.workerReady};var Fr=Ur;function Ur(e,t){void 0===e&&(e={}),void 0===t&&(t=!1),this.events=[],this.currentSize=0,this.workerHandler=null,this.useWorker=!1,this.workerReady=!1,this.workerEventCount=0,this.workerSize=0,this.config={maxSize:null!=(e=e.maxSize)?e:5242880},t&&this.initWorker()}function zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Br(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function jr(s){return function(){var e=this,a=arguments;return new Promise(function(t,n){var r=s.apply(e,a);function i(e){Br(r,t,n,i,o,"next",e)}function o(e){Br(r,t,n,i,o,"throw",e)}i(void 0)})}}function Wr(e,t,n){t=Vr(t);var r=e,t=Zr()?Reflect.construct(t,n||[],Vr(e).constructor):t.apply(e,n);if(!t||"object"!=typeof t&&"function"!=typeof t){if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");if(void 0===(t=r))throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ni(r.key),r)}}function k(e,t,n){return t&&Hr(e.prototype,t),n&&Hr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ie(e,t){var n,r,i,o,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return i=!(r=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return r=e.done,e},e:function(e){i=!0,n=e},f:function(){try{r||null==a.return||a.return()}finally{if(i)throw n}}};if(Array.isArray(e)||(a=ri(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),o=0,{s:t=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function qr(){return(qr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=((e,t)=>{for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Vr(e)););return e})(e,t);if(r)return(r=Object.getOwnPropertyDescriptor(r,t)).get?r.get.call(arguments.length<3?e:n):r.value}).apply(null,arguments)}function Vr(e){return(Vr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Gr(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&&Qr(e,t)}function Zr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Zr=function(){return!!e})()}function Jr(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function Ae(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Jr(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],(e=ni(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):Jr(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function Kr(e,t){if(null==e)return{};var n,r=((e,t)=>{if(null==e)return{};var n,r={};for(n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r})(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),o=0;o<i.length;o++)n=i[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function $r(){var p,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function r(e,t,n,r){var i,o,a,s,l,u,c,d,h,t=t&&t.prototype instanceof v?t:v,t=Object.create(t.prototype);return Xr(t,"_invoke",(i=e,o=n,c=r||[],d=!1,h={p:u=0,n:0,v:p,a:f,f:f.bind(p,4),d:function(e,t){return a=e,s=0,l=p,h.n=t,m}},function(e,t,n){if(1<u)throw TypeError("Generator is already running");for(d&&1===t&&f(t,n),s=t,l=n;(g=s<2?p:l)||!d;){a||(s?s<3?(1<s&&(h.n=-1),f(s,l)):h.n=l:h.v=l);try{if(u=2,a){if(g=a[e=s?e:"next"]){if(!(g=g.call(a,l)))throw TypeError("iterator result is not an object");if(!g.done)return g;l=g.value,s<2&&(s=0)}else 1===s&&(g=a.return)&&g.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+e+"' method"),s=1);a=p}else if((g=(d=h.n<0)?l:i.call(o,h))!==m)break}catch(e){a=p,s=1,l=e}finally{u=1}}return{value:g,done:d}}),!0),t;function f(e,t){for(s=e,l=t,g=0;!d&&u&&!n&&g<c.length;g++){var n,r=c[g],i=h.p,o=r[2];3<e?(n=o===t)&&(l=r[(s=r[4])?5:s=3],r[4]=r[5]=p):r[0]<=i&&((n=e<2&&i<r[1])?(s=0,h.v=t,h.n=r[1]):i<o&&(n=e<3||r[0]>t||o<t)&&(r[4]=e,r[5]=t,h.n=o,s=0))}if(n||1<e)return m;throw d=!0,t}}var m={};function v(){}function i(){}function o(){}var g=Object.getPrototypeOf,e=[][t]?g(g([][t]())):(Xr(g={},t,function(){return this}),g),a=o.prototype=v.prototype=Object.create(e);function s(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,Xr(e,n,"GeneratorFunction")),e.prototype=Object.create(a),e}return Xr(a,"constructor",i.prototype=o),Xr(o,"constructor",i),Xr(o,n,i.displayName="GeneratorFunction"),Xr(a),Xr(a,n,"Generator"),Xr(a,t,function(){return this}),Xr(a,"toString",function(){return"[object Generator]"}),($r=function(){return{w:r,m:s}})()}function Xr(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(Xr=function(e,t,n,r){function i(t,n){Xr(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))})(e,t,n,r)}function Yr(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function Qr(e,t){return(Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Pe(e,t){return(e=>{if(Array.isArray(e))return e})(e)||((e,t)=>{var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}})(e,t)||ri(e,t)||(()=>{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 ei(e,t,n,r){var i=qr(Vr(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function ti(e){return(e=>{if(Array.isArray(e))return zr(e)})(e)||(()=>{if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)})()||ri(e)||(()=>{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 ni(e){e=(e=>{if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);if("object"!=typeof(t=t.call(e,"string")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e);return"symbol"==typeof e?e:e+""}function _(e){return(_="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})(e)}function ri(e,t){var n;if(e)return"string"==typeof e?zr(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zr(e,t):void 0}function ii(e){var n="function"==typeof Map?new Map:void 0;return(ii=function(e){if(null===e||!(t=>{try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}})(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return function(e,t,n){var r;return Zr()?Reflect.construct.apply(null,arguments):((r=[null]).push.apply(r,t),t=new(e.bind.apply(e,r)),n&&Qr(t,n.prototype),t)}(e,arguments,Vr(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Qr(t,e)})(e)}function u(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?di(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}function oi(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}var ai=["inputs"],si=["inputId"],li=["inputs"],ui=["inputId"],ci=["type"],di=Object.defineProperty,hi=Object.defineProperty,fi=((i=fi||{})[i.Document=0]="Document",i[i.DocumentType=1]="DocumentType",i[i.Element=2]="Element",i[i.Text=3]="Text",i[i.CDATA=4]="CDATA",i[i.Comment=5]="Comment",i),pi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},mi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},vi={},gi={};function yi(e){if(vi[e])return vi[e];var t=globalThis[e],n=t.prototype,r=e in pi?pi[e]:void 0,r=Boolean(r&&r.every(function(e){return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(n,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),i=e in mi?mi[e]:void 0,i=Boolean(i&&i.every(function(e){return"function"==typeof n[e]&&(null==(e=n[e])?void 0:e.toString().includes("[native code]"))}));if(r&&i&&!globalThis.Zone)return vi[e]=t.prototype,t.prototype;try{var o,a,s=document.createElement("iframe"),l=(s.style.display="none",document.body.appendChild(s),s.contentWindow);return l?(o=l[e].prototype)?((a=navigator.userAgent).includes("Safari")&&!a.includes("Chrome")?(s.classList.add("rr-block"),s.setAttribute("__rrwebUntaintedMutationObserver",""),gi[e]=function(){return s.remove()}):s.remove(),vi[e]=o):(s.remove(),n):t.prototype}catch(e){return n}}var wi={};function bi(e,t,n){var r="".concat(e,".").concat(String(n));return wi[r]?wi[r].call(t):(e=yi(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,n))?void 0:e.get)?(wi[r]=e).call(t):t[n])}var ki={};function _i(e,t,n){var r="".concat(e,".").concat(String(n));return ki[r]?ki[r].bind(t):"function"!=typeof(e=yi(e)[n])?t[n]:(ki[r]=e).bind(t)}var i=Date.now,Si={ownerDocument:function(e){return bi("Node",e,"ownerDocument")},childNodes:function(e){return bi("Node",e,"childNodes")},parentNode:function(e){return bi("Node",e,"parentNode")},parentElement:function(e){return bi("Node",e,"parentElement")},textContent:function(e){return bi("Node",e,"textContent")},contains:function(e,t){return _i("Node",e,"contains")(t)},getRootNode:function(e){return _i("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?bi("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?bi("Element",e,"shadowRoot"):null},querySelector:function(e,t){return bi("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return bi("Element",e,"querySelectorAll")(t)},nowTimestamp:i=/[1-9][0-9]{12}/.test(Date.now().toString())?i:function(){return(new Date).getTime()},mutationObserverCtor:function(){var e;return[yi("MutationObserver").constructor,null!=(e=gi.MutationObserver)?e:function(){}]},patch:function(e,t,n){try{var r,i;return t in e?("function"==typeof(i=n(r=e[t]))&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}):function(){}}catch(e){return function(){}}}};function Ei(e){return e.nodeType===e.ELEMENT_NODE}function Ci(e){var t=e&&"host"in e&&"mode"in e&&Si.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Si.shadowRoot(t)===e)}function Ri(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Oi(e){try{var t,n=e.rules||e.cssRules;return n?(!(t=e.href)&&e.ownerNode&&(t=e.ownerNode.baseURI),r=(r=Array.from(n,function(e){return Ti(e,t)}).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")?r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;"):r):null}catch(e){return null}var r}function Ti(e,t){if("styleSheet"in e){var n;try{n=Oi(e.styleSheet)||((r=(i=e).cssText).split('"').length<3?r:(r=["@import","url(".concat(JSON.stringify(i.href),")")],""===i.layerName?r.push("layer"):i.layerName&&r.push("layer(".concat(i.layerName,")")),i.supportsText&&r.push("supports(".concat(i.supportsText,")")),i.media.length&&r.push(i.media.mediaText),r.join(" ")+";"))}catch(t){n=e.cssText}return e.styleSheet.href?Ui(n,e.styleSheet.href):n}var r,i=e.cssText;return"selectorText"in e&&e.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?Ui(i,t):i}var xi=k(function e(){b(this,e),oi(this,"idNodeMap",new Map),oi(this,"nodeMetaMap",new WeakMap)},[{key:"getId",value:function(e){return e&&null!=(e=null==(e=this.getMeta(e))?void 0:e.id)?e:-1}},{key:"getNode",value:function(e){return this.idNodeMap.get(e)||null}},{key:"getIds",value:function(){return Array.from(this.idNodeMap.keys())}},{key:"getMeta",value:function(e){return this.nodeMetaMap.get(e)||null}},{key:"removeNodeFromMap",value:function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})}},{key:"has",value:function(e){return this.idNodeMap.has(e)}},{key:"hasNode",value:function(e){return this.nodeMetaMap.has(e)}},{key:"add",value:function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}},{key:"replace",value:function(e,t){var n=this.getNode(e);n&&(n=this.nodeMetaMap.get(n))&&this.nodeMetaMap.set(t,n),this.idNodeMap.set(e,t)}},{key:"reset",value:function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}]);function Mi(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.maskInputFn,e=e.value||"",i=i&&Ii(i);return e=n[r.toLowerCase()]||i&&n[i]?o?o(e,t):"*".repeat(e.length):e}function Ii(e){return e.toLowerCase()}function Ai(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ii(t):null}function Pi(e,t){var n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}t=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(n=null==t?void 0:t[1])?n:null}var Di=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Li=/^(?:[a-z+]+:)?\/\//i,Ni=/^www\..*/i,Fi=/^(data:)([^,]*),(.*)/i;function Ui(e,c){return(e||"").replace(Di,function(e,t,n,r,i,o){n=n||i||o,i=t||r||"";if(!n)return e;if(Li.test(n)||Ni.test(n))return"url(".concat(i).concat(n).concat(i,")");if(Fi.test(n))return"url(".concat(i).concat(n).concat(i,")");if("/"===n[0])return"url(".concat(i).concat((-1<(o=c).indexOf("//")?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+n).concat(i,")");var t=n.split("#")[0],r=n.substring(t.length),a=c.split("#")[0].split("/"),o=t.split("/");a.pop();var s,l=Ie(o);try{for(l.s();!(s=l.n()).done;){var u=s.value;"."!==u&&(".."===u?a.pop():a.push(u))}}catch(e){l.e(e)}finally{l.f()}return"url(".concat(i).concat(a.join("/")).concat(r).concat(i,")")})}function zi(e,t){return 1<arguments.length&&void 0!==t&&t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}var Bi,ji,Wi=1,Hi=new RegExp("[^a-z0-9-_:]");function qi(){return Wi++}var Vi=/^[^ \t\n\r\u000c]+/,Gi=/^[, \t\n\r\u000c]+/,Zi=new WeakMap;function Ji(e,t){return t&&""!==t.trim()?Ki(e,t):t}function Ki(e,t){var n=Zi.get(e);if(n||(n=e.createElement("a"),Zi.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function $i(e,t,n,r){return r&&("src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?Ji(e,r):"srcset"===n?((e,t)=>{if(""===t.trim())return t;var n=0;function r(e){var e=e.exec(t.substring(n));return e?(e=e[0],n+=e.length,e):""}for(var i=[];r(Gi),!(n>=t.length);)if(","===(a=r(Vi)).slice(-1))a=Ji(e,a.substring(0,a.length-1)),i.push(a);else for(var o="",a=Ji(e,a),s=!1;;){var l=t.charAt(n);if(""===l){i.push((a+o).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){n+=1,i.push((a+o).trim());break}"("===l&&(s=!0)}o+=l,n+=1}return i.join(", ")})(e,r):"style"===n?Ui(r,Ki(e)):"object"===t&&"data"===n?Ji(e,r):r)}function Xi(e,t){return["video","audio"].includes(e)&&"autoplay"===t}function Yi(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE)for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&Yi(Si.parentNode(e),t,n)}function Qi(e,t,n,r){var i;if(Ei(e)){if(!Si.childNodes(i=e).length)return!1}else{if(null===Si.parentElement(e))return!1;i=Si.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if(Yi(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function eo(e,t){var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.needsMask,a=t.inlineStylesheet,s=t.maskInputOptions,l=void 0===s?{}:s,u=t.maskTextFn,c=t.maskInputFn,s=t.dataURLOptions,d=void 0===s?{}:s,h=t.inlineImages,f=t.recordCanvas,N=t.keepIframeSrcFn,s=t.newlyAddedElement,F=void 0!==s&&s,s=t.cssCaptured,U=void 0!==s&&s,p=(s=n,!(t=t.mirror).hasNode(s)||1===(t=t.getId(s))?void 0:t);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:fi.Document,childNodes:[],compatMode:e.compatMode}:{type:fi.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:fi.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:p};case e.ELEMENT_NODE:for(var m,v,g,y,w,b,k=e,_=(I={doc:n,blockClass:r,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:N,newlyAddedElement:F,rootId:p}).doc,S=I.inlineStylesheet,E=void 0===(E=I.maskInputOptions)?{}:E,C=I.maskInputFn,R=void 0===(O=I.dataURLOptions)?{}:O,O=I.inlineImages,T=I.recordCanvas,x=I.keepIframeSrcFn,M=void 0!==(M=I.newlyAddedElement)&&M,z=I.rootId,I=((e,t,n)=>{try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1})(k,I.blockClass,I.blockSelector),A=(v=k)instanceof HTMLFormElement?"form":(v=Ii(v.tagName),Hi.test(v)?"div":v),P={},B=k.attributes.length,D=0;D<B;D++){var L=k.attributes[D];Xi(A,L.name)||(P[L.name]=$i(_,A,Ii(L.name),L.value))}"link"===A&&S&&(v=null,v=(S=Array.from(_.styleSheets).find(function(e){return e.href===k.href}))?Oi(S):v)&&(delete P.rel,delete P.href,P._cssText=v),"style"===A&&k.sheet&&(S=Oi(k.sheet))&&(1<k.childNodes.length&&(S=function(e,t,n){var r=2<arguments.length&&void 0!==n&&n,i=Array.from(t.childNodes),o=[],a=0;if(1<i.length&&e&&"string"==typeof e)for(var s=zi(e,r),l=s.length/e.length,u=1;u<i.length;u++)if(i[u].textContent&&"string"==typeof i[u].textContent){for(var c=zi(i[u].textContent,r),d=3;d<c.length&&(c[d].match(/[a-zA-Z0-9]/)||-1!==c.indexOf(c.substring(0,d),1));d++);for(;d<c.length;d++){var h,f=c.substring(0,d),p=s.split(f),m=-1;if(2===p.length)m=p[0].length;else if(2<p.length&&""===p[0]&&""!==i[u-1].textContent)m=s.indexOf(f,1);else if(1===p.length){if(f=f.substring(0,f.length-1),(p=s.split(f)).length<=1)return o.push(e),o;d=101}else d===c.length-1&&(m=s.indexOf(f));if(-1!==(m=2<=p.length&&100<d&&((h=i[u-1].textContent)&&"string"==typeof h&&(h=zi(h).length,m=s.indexOf(f,h)),-1===m)?p[0].length:m)){for(var v=Math.floor(m/l);0<v&&v<e.length;){if((a+=1)>50*i.length)return o.push(e),o;var g=zi(e.substring(0,v),r);if(g.length===m){o.push(e.substring(0,v)),e=e.substring(v),s=s.substring(m);break}g.length<m?v+=Math.max(1,Math.floor((m-g.length)/l)):v-=Math.max(1,Math.floor((g.length-m)*l))}break}}}return o.push(e),o}(S,k).join("/* rr_split */")),P._cssText=S),["input","textarea","select"].includes(A)&&(v=k.value,S=k.checked,"radio"!==P.type&&"checkbox"!==P.type&&"submit"!==P.type&&"button"!==P.type&&v?P.value=Mi({element:k,type:Ai(k),tagName:A,value:v,maskInputOptions:E,maskInputFn:C}):S&&(P.checked=S)),"option"===A&&(k.selected&&!E.select?P.selected=!0:delete P.selected),"dialog"===A&&k.open&&(P.rr_open_mode=k.matches("dialog:modal")?"modal":"non-modal"),"canvas"===A&&T&&("2d"===k.__context?(e=>{var t=e.getContext("2d");if(t)for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,i="__rrweb_original__"in i?i.__rrweb_original__:i;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(function(e){return 0!==e}))return}return 1})(k)||(P.rr_dataURL=k.toDataURL(R.type,R.quality)):"__context"in k||(v=k.toDataURL(R.type,R.quality),(C=_.createElement("canvas")).width=k.width,C.height=k.height,v!==C.toDataURL(R.type,R.quality)&&(P.rr_dataURL=v))),"img"===A&&O&&(Bi||(Bi=_.createElement("canvas"),ji=Bi.getContext("2d")),y=(g=k).currentSrc||g.getAttribute("src")||"<unknown-src>",w=g.crossOrigin,b=function(){g.removeEventListener("load",b);try{Bi.width=g.naturalWidth,Bi.height=g.naturalHeight,ji.drawImage(g,0,0),P.rr_dataURL=Bi.toDataURL(R.type,R.quality)}catch(e){if("anonymous"!==g.crossOrigin)return g.crossOrigin="anonymous",void(g.complete&&0!==g.naturalWidth?b():g.addEventListener("load",b));console.warn("Cannot inline img src=".concat(y,"! Error: ").concat(e))}"anonymous"===g.crossOrigin&&(w?P.crossOrigin=w:g.removeAttribute("crossorigin"))},g.complete&&0!==g.naturalWidth?b():g.addEventListener("load",b)),["audio","video"].includes(A)&&((S=P).rr_mediaState=k.paused?"paused":"played",S.rr_mediaCurrentTime=k.currentTime,S.rr_mediaPlaybackRate=k.playbackRate,S.rr_mediaMuted=k.muted,S.rr_mediaLoop=k.loop,S.rr_mediaVolume=k.volume),M||(k.scrollLeft&&(P.rr_scrollLeft=k.scrollLeft),k.scrollTop&&(P.rr_scrollTop=k.scrollTop)),I&&(T=(E=k.getBoundingClientRect()).width,C=E.height,P={class:P.class,rr_width:"".concat(T,"px"),rr_height:"".concat(C,"px")}),"iframe"!==A||x(P.src)||(k.contentDocument||(P.rr_src=P.src),delete P.src);try{customElements.get(A)&&(m=!0)}catch(k){}return{type:fi.Element,tagName:A,attributes:P,childNodes:[],isSVG:Boolean("svg"===k.tagName||k.ownerSVGElement)||void 0,needBlock:I,rootId:z,isCustom:m};case e.TEXT_NODE:return v=e,S=(O={doc:n,needsMask:o,maskTextFn:u,rootId:p,cssCaptured:U}).needsMask,M=O.maskTextFn,E=O.rootId,T=O.cssCaptured,C=(C=Si.parentNode(v))&&C.tagName,x="",I="STYLE"===C||void 0,(C="SCRIPT"===C||void 0)?x="SCRIPT_PLACEHOLDER":T||(x=Si.textContent(v),I&&(x=x&&Ui(x,Ki(O.doc)))),!I&&!C&&x&&S&&(x=M?M(x,Si.parentElement(v)):x.replace(/[\S]/g,"*")),{type:fi.Text,textContent:x||"",rootId:E};case e.CDATA_SECTION_NODE:return{type:fi.CDATA,textContent:"",rootId:p};case e.COMMENT_NODE:return{type:fi.Comment,textContent:Si.textContent(e)||"",rootId:p};default:return!1}}function N(e){return null==e?"":e.toLowerCase()}function to(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function no(t,e){var n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.maskTextClass,s=e.maskTextSelector,l=e.skipChild,l=void 0!==l&&l,u=e.inlineStylesheet,c=void 0===u||u,u=e.maskInputOptions,d=void 0===u?{}:u,h=e.maskTextFn,f=e.maskInputFn,p=e.slimDOMOptions,u=e.dataURLOptions,m=void 0===u?{}:u,u=e.inlineImages,v=void 0!==u&&u,u=e.recordCanvas,g=void 0!==u&&u,y=e.onSerialize,w=e.onIframeLoad,u=e.iframeLoadTimeout,b=void 0===u?5e3:u,k=e.onStylesheetLoad,u=e.stylesheetLoadTimeout,_=void 0===u?5e3:u,u=e.keepIframeSrcFn,S=void 0===u?function(){return!1}:u,u=e.newlyAddedElement,u=void 0!==u&&u,E=e.cssCaptured,E=void 0!==E&&E,C=e.needsMask,e=e.preserveWhiteSpace,R=void 0===e||e,C=C||Qi(t,a,s,void 0===C),e=eo(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,dataURLOptions:m,inlineImages:v,recordCanvas:g,keepIframeSrcFn:S,newlyAddedElement:u,cssCaptured:E});if(!e)return console.warn(t,"not serialized"),null;var u=r.hasNode(t)?r.getId(t):((e,t)=>{if(t.comment&&e.type===fi.Comment)return 1;if(e.type===fi.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Pi(e.attributes.href)))return 1;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(N(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===N(e.attributes.name)||"icon"===N(e.attributes.rel)||"apple-touch-icon"===N(e.attributes.rel)||"shortcut icon"===N(e.attributes.rel))))return 1;if("meta"===e.tagName){if(t.headMetaDescKeywords&&N(e.attributes.name).match(/^description|keywords$/))return 1;if(t.headMetaSocial&&(N(e.attributes.property).match(/^(og|twitter|fb):/)||N(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===N(e.attributes.name)))return 1;if(t.headMetaRobots&&("robots"===N(e.attributes.name)||"googlebot"===N(e.attributes.name)||"bingbot"===N(e.attributes.name)))return 1;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return 1;if(t.headMetaAuthorship&&("author"===N(e.attributes.name)||"generator"===N(e.attributes.name)||"framework"===N(e.attributes.name)||"publisher"===N(e.attributes.name)||"progid"===N(e.attributes.name)||N(e.attributes.property).match(/^article:/)||N(e.attributes.property).match(/^product:/)))return 1;if(t.headMetaVerification&&("google-site-verification"===N(e.attributes.name)||"yandex-verification"===N(e.attributes.name)||"csrf-token"===N(e.attributes.name)||"p:domain_verify"===N(e.attributes.name)||"verify-v1"===N(e.attributes.name)||"verification"===N(e.attributes.name)||"shopify-checkout-api-token"===N(e.attributes.name)))return 1}}})(e,p)||!R&&e.type===fi.Text&&!e.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Wi++,O=Object.assign(e,{id:u});if(r.add(t,O),-2===u)return null;y&&y(t);E=!l;if(O.type===fi.Element&&(E=E&&!O.needBlock,delete O.needBlock,e=Si.shadowRoot(t))&&Ri(e)&&(O.isShadowHost=!0),(O.type===fi.Document||O.type===fi.Element)&&E){p.headWhitespace&&O.type===fi.Element&&"head"===O.tagName&&(R=!1);var T={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S,cssCaptured:!1};if(O.type!==fi.Element||"textarea"!==O.tagName||void 0===O.attributes.value){O.type===fi.Element&&void 0!==O.attributes._cssText&&"string"==typeof O.attributes._cssText&&(T.cssCaptured=!0);for(var x=0,M=Array.from(Si.childNodes(t));x<M.length;x++){var I=no(M[x],T);I&&O.childNodes.push(I)}}var A=null;if(Ei(t)&&(A=Si.shadowRoot(t)))for(var P=0,D=Array.from(Si.childNodes(A));P<D.length;P++){var L=no(D[P],T);L&&(Ri(A)&&(L.isShadow=!0),O.childNodes.push(L))}}u=Si.parentNode(t);return u&&Ci(u)&&Ri(u)&&(O.isShadow=!0),O.type===fi.Element&&"iframe"===O.tagName&&((e,t,n)=>{var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){if("about:blank"!==r.location.href||"about:blank"===e.src||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()})}}})(t,function(){var e=t.contentDocument;e&&w&&(e=no(e,{doc:e,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S}))&&w(t,e)},b),O.type===fi.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===Pi(O.attributes.href))&&((e,t,n)=>{var r,i,o=!1;try{r=e.sheet}catch(e){return}r||(i=setTimeout(function(){o||(t(),o=!0)},n),e.addEventListener("load",function(){clearTimeout(i),o=!0,t()}))})(t,function(){var e;k&&(e=no(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:h,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S}))&&k(t,e)},_),O}var ro,io={exports:{}};var oo,ao,so,lo,uo,p=(so=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?so:("function"==typeof(lo=so.default)?(uo=function e(){return this instanceof e?Reflect.construct(lo,arguments,this.constructor):lo.apply(this,arguments)}).prototype=lo.prototype:uo={},Object.defineProperty(uo,"__esModule",{value:!0}),Object.keys(so).forEach(function(e){var t=Object.getOwnPropertyDescriptor(so,e);Object.defineProperty(uo,e,t.get?t:{enumerable:!0,get:function(){return so[e]}})}),uo);function co(){var d,h,e,t;return ao||(ao=1,ro||(ro=1,e=String,io.exports=(t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}})(),io.exports.createColors=t),d=io.exports,h=p,Gr(s,ii(Error)),t=k(s,[{key:"setMessage",value:function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}},{key:"showSourceCode",value:function(e){var r=this;if(!this.source)return"";var t=this.source;null==e&&(e=d.isColorSupported);var n,i,o,a,s,t=(t=h&&e?h(t):t).split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,t.length),c=String(u).length;return e?(e=d.createColors(!0),n=e.bold,i=e.gray,o=e.red,a=function(e){return n(o(e))},s=function(e){return i(e)}):a=s=function(e){return e},t.slice(l,u).map(function(e,t){var t=l+1+t,n=" "+(" "+t).slice(-c)+" | ";return t===r.line?(t=s(n.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," "),a(">")+s(n)+e+"\n "+t+a("^")):" "+s(n)+e}).join("\n")}},{key:"toString",value:function(){var e=(e=this.showSourceCode())&&"\n\n"+e+"\n";return this.name+": "+this.message+e}}]),(oo=t).default=t),oo;function s(e,t,n,r,i,o){var a;return b(this,s),(a=Wr(this,s,[e])).name="CssSyntaxError",a.reason=e,i&&(a.file=i),r&&(a.source=r),o&&(a.plugin=o),void 0!==t&&void 0!==n&&("number"==typeof t?(a.line=t,a.column=n):(a.line=t.line,a.column=t.column,a.endLine=n.line,a.endColumn=n.column)),a.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(a,s),a}}var ho,fo,po,mo,vo,go,yo,wo,bo,ko,_o,So,Eo,Co,Ro,Oo,To,xo,Mo,Io,Ao,Po,Do,Lo,No,Fo,Uo,zo,Bo,jo,Wo,Ho,qo,Vo,Go,Zo,Jo,Ko,$o,Xo,Yo,Qo,ea,ta,na,ra,ia,oa,aa={};function sa(){return ho||(ho=1,aa.isClean=Symbol("isClean"),aa.my=Symbol("my")),aa}function la(){var a,e;return po||(a={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!(po=1)},e=k(function e(t){b(this,e),this.builder=t},[{key:"atrule",value:function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes?this.block(e,n+r):(t=(e.raws.between||"")+(t?";":""),this.builder(n+r+t,e))}},{key:"beforeAfter",value:function(e,t){for(var n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var a=0;a<i;a++)n+=o}return n}},{key:"block",value:function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(t=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(t),this.builder("}",e,"end")}},{key:"body",value:function(e){for(var t=e.nodes.length-1;0<t&&"comment"===e.nodes[t].type;)--t;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}},{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}},{key:"decl",value:function(e,t){var n=this.raw(e,"between","colon"),n=e.prop+n+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}},{key:"document",value:function(e){this.body(e)}},{key:"raw",value:function(e,t,n){var r;if(t&&void 0!==(r=e.raws[t]))return r;var i,o=e.parent;if("before"===(n=n||t)){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}return o?((o=e.root()).rawCache||(o.rawCache={}),void 0!==o.rawCache[n]?o.rawCache[n]:"before"===n||"after"===n?this.beforeAfter(e,n):(this[i="raw"+((i=n)[0].toUpperCase()+i.slice(1))]?r=this[i](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=a[n]),o.rawCache[n]=r)):a[n]}},{key:"rawBeforeClose",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}},{key:"rawBeforeComment",value:function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeDecl"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeDecl",value:function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeRule"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeOpen",value:function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}},{key:"rawBeforeRule",value:function(t){var n;return t.walk(function(e){if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=n&&n.replace(/\S/g,"")}},{key:"rawColon",value:function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}},{key:"rawEmptyBody",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}},{key:"rawIndent",value:function(n){return n.raws.indent||(n.walk(function(e){var t=e.parent;if(t&&t!==n&&t.parent&&t.parent===n&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),r=(r=t[t.length-1]).replace(/\S/g,""),!1}),r);var r}},{key:"rawSemicolon",value:function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}},{key:"rawValue",value:function(e,t){var n=e[t],e=e.raws[t];return e&&e.value===n?e.raw:n}},{key:"root",value:function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}},{key:"rule",value:function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}},{key:"stringify",value:function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}]),(fo=e).default=e),fo}function ua(){var n;return vo||(vo=1,n=la(),(mo=e).default=e),mo;function e(e,t){new n(t).stringify(e)}}function ca(){var a,s,i,n,r,e;return yo||(yo=1,e=sa(),a=e.isClean,s=e.my,i=co(),n=la(),r=ua(),e=k(function e(){var t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(t in b(this,e),this.raws={},this[a]=!1,this[s]=!0,n)if("nodes"===t){this.nodes=[];var r,i=Ie(n[t]);try{for(i.s();!(r=i.n()).done;){var o=r.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}catch(e){i.e(e)}finally{i.f()}}else this[t]=n[t]},[{key:"addToError",value:function(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,"$&".concat(t.input.from,":").concat(t.start.line,":").concat(t.start.column,"$&"))),e}},{key:"after",value:function(e){return this.parent.insertAfter(this,e),this}},{key:"assign",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(e in t)this[e]=t[e];return this}},{key:"before",value:function(e){return this.parent.insertBefore(this,e),this}},{key:"cleanRaws",value:function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}},{key:"clone",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=function t(e,n){var r,i,o,a=new e.constructor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r&&(o=_(i=e[r]),"parent"===r&&"object"===o?n&&(a[r]=n):"source"===r?a[r]=i:Array.isArray(i)?a[r]=i.map(function(e){return t(e,a)}):("object"===o&&null!==i&&(i=t(i)),a[r]=i));return a}(this);for(e in t)n[e]=t[e];return n}},{key:"cloneAfter",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertAfter(this,e),e}},{key:"cloneBefore",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertBefore(this,e),e}},{key:"error",value:function(e){var t,n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.source?(t=(n=this.rangeBy(r)).end,this.source.input.error(e,{column:(n=n.start).column,line:n.line},{column:t.column,line:t.line},r)):new i(e)}},{key:"getProxyProcessor",value:function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}},{key:"markDirty",value:function(){if(this[a]){this[a]=!1;for(var e=this;e=e.parent;)e[a]=!1}}},{key:"next",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}},{key:"positionBy",value:function(e,t){var n=this.source.start;return e.index?n=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(n=this.positionInside(e,t)),n}},{key:"positionInside",value:function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?i+=r=1:r+=1;return{column:r,line:i}}},{key:"prev",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}},{key:"rangeBy",value:function(e){var t,n,r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};return e.word?-1!==(n=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(n,t),i=this.positionInside(n+e.word.length,t)):(e.start?r={column:e.start.column,line:e.start.line}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1))),{end:i=i.line<r.line||i.line===r.line&&i.column<=r.column?{column:r.column+1,line:r.line}:i,start:r}}},{key:"raw",value:function(e,t){return(new n).raw(this,e,t)}},{key:"remove",value:function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}},{key:"replaceWith",value:function(){if(this.parent){for(var e=this,t=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];s===this?t=!0:t?(this.parent.insertAfter(e,s),e=s):this.parent.insertBefore(e,s)}t||this.remove()}return this}},{key:"root",value:function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}},{key:"toJSON",value:function(e,t){var n,r,i,o={},a=null==t,s=(t=t||new Map,0);for(n in this)Object.prototype.hasOwnProperty.call(this,n)&&"parent"!==n&&"proxyCache"!==n&&(r=this[n],Array.isArray(r)?o[n]=r.map(function(e){return"object"===_(e)&&e.toJSON?e.toJSON(null,t):e}):"object"===_(r)&&r.toJSON?o[n]=r.toJSON(null,t):"source"===n?(null==(i=t.get(r.input))&&(i=s,t.set(r.input,s),s++),o[n]={end:r.end,inputId:i,start:r.start}):o[n]=r);return a&&(o.inputs=ti(t.keys()).map(function(e){return e.toJSON()})),o}},{key:"toProxy",value:function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r,t=(e.stringify&&(e=e.stringify),"");return e(this,function(e){t+=e}),t}},{key:"warn",value:function(e,t,n){var r,i={node:this};for(r in n)i[r]=n[r];return e.warn(t,i)}},{key:"proxyOf",get:function(){return this}}]),(go=e).default=e),go}function da(){var e;return bo||(bo=1,Gr(t,ca()),e=k(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),(wo=e).default=e),wo;function t(e){return b(this,t),(e=Wr(this,t,[e=e&&void 0!==e.value&&"string"!=typeof e.value?Ae(Ae({},e),{},{value:String(e.value)}):e])).type="decl",e}}function ha(){var r,i,t,n,o,a,e;return Eo||(Eo=1,r=p.SourceMapConsumer,i=p.SourceMapGenerator,t=p.existsSync,n=p.readFileSync,o=p.dirname,a=p.join,e=k(function e(t,n){b(this,e),!1!==n.map&&(this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:"),t=n.map?n.map.prev:void 0,t=this.loadMap(n.from,t),!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=o(this.mapFile)),t)&&(this.text=t)},[{key:"consumer",value:function(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}},{key:"decodeInline",value:function(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}},{key:"getAnnotationURL",value:function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}},{key:"isMap",value:function(e){return"object"===_(e)&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}},{key:"loadAnnotation",value:function(e){var t,n=e.match(/\/\*\s*# sourceMappingURL=/gm);n&&(n=e.lastIndexOf(n.pop()),t=e.indexOf("*/",n),-1<n)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(n,t)))}},{key:"loadFile",value:function(e){if(this.root=o(e),t(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}},{key:"loadMap",value:function(e,t){if(!1===t)return!1;if(!t)return this.inline?this.decodeInline(this.annotation):this.annotation?(n=this.annotation,e&&(n=a(o(e),n)),this.loadFile(n)):void 0;if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){t=this.loadFile(n);if(t)return t;throw new Error("Unable to load previous source map: "+n.toString())}}},{key:"startWith",value:function(e,t){return!!e&&e.substr(0,t.length)===t}},{key:"withContent",value:function(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}}]),(So=e).default=e),So}function fa(){var e,a,l,s,r,i,t,u,o,c,d,h,n;return Ro||(Ro=1,n=p.SourceMapConsumer,e=p.SourceMapGenerator,a=p.fileURLToPath,l=p.pathToFileURL,s=p.isAbsolute,r=p.resolve,i=(_o?ko:(_o=1,ko={nanoid:function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:21;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e},customAlphabet:function(n){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:21;return function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r;t--;)e+=n[Math.random()*n.length|0];return e}}})).nanoid,t=p,u=co(),o=ha(),c=Symbol("fromOffsetCache"),d=Boolean(n&&e),h=Boolean(r&&s),n=k(function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(b(this,e),null==t||"object"===_(t)&&!t.toString)throw new Error("PostCSS received ".concat(t," instead of CSS string"));this.css=t.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!h||/^\w+:\/\//.test(n.from)||s(n.from)?this.file=n.from:this.file=r(n.from)),h&&d&&(t=new o(this.css,n)).text&&(n=(this.map=t).consumer().file,!this.file)&&n&&(this.file=this.mapResolve(n)),this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)},[{key:"error",value:function(e,t,n){var r,i,o,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},s=(t&&"object"===_(t)?(s=n,n="number"==typeof(i=t).offset?(t=(o=this.fromOffset(i.offset)).line,o.col):(t=i.line,i.column),i="number"==typeof s.offset?(r=(o=this.fromOffset(s.offset)).line,o.col):(r=s.line,s.column)):n||(t=(o=this.fromOffset(t)).line,n=o.col),this.origin(t,n,r,i));return(o=s?new u(e,void 0===s.endLine?s.line:{column:s.column,line:s.line},void 0===s.endLine?s.column:{column:s.endColumn,line:s.endLine},s.source,s.file,a.plugin):new u(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,a.plugin)).input={column:n,endColumn:i,endLine:r,line:t,source:this.css},this.file&&(l&&(o.input.url=l(this.file).toString()),o.input.file=this.file),o}},{key:"fromOffset",value:function(e){if(this[c])n=this[c];else{for(var t=this.css.split("\n"),n=new Array(t.length),r=0,i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;this[c]=n}var a=0;if(e>=n[n.length-1])a=n.length-1;else for(var s,l=n.length-2;a<l;)if(e<n[s=a+(l-a>>1)])l=s-1;else{if(!(e>=n[s+1])){a=s;break}a=s+1}return{col:e-n[a]+1,line:a+1}}},{key:"mapResolve",value:function(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}},{key:"origin",value:function(e,t,n,r){if(!this.map)return!1;var i,o=this.map.consumer(),t=o.originalPositionFor({column:t,line:e});if(!t.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n}));e=s(t.source)?l(t.source):new URL(t.source,this.map.consumer().sourceRoot||l(this.map.mapFile)),r={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:e.toString()};if("file:"===e.protocol){if(!a)throw new Error("file: protocol is not available in this PostCSS build");r.file=a(e)}n=o.sourceContentFor(t.source);return n&&(r.source=n),r}},{key:"toJSON",value:function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=Ae({},this.map),e.map.consumerCache)&&(e.map.consumerCache=void 0),e}},{key:"from",get:function(){return this.file||this.id}}]),(Co=n).default=n,t&&t.registerInput&&t.registerInput(n)),Co}function pa(){if(To)return Oo;To=1;var a=p.SourceMapConsumer,t=p.SourceMapGenerator,s=p.dirname,n=p.relative,r=p.resolve,i=p.sep,o=p.pathToFileURL,l=fa(),e=Boolean(a&&t),u=Boolean(s&&r&&n&&i);return Oo=k(function e(t,n,r,i){b(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map},[{key:"addAnnotation",value:function(){var e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map",t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}},{key:"applyPrevMaps",value:function(){var e,t=Ie(this.previous());try{for(t.s();!(e=t.n()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||s(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new a(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}}catch(e){t.e(e)}finally{t.f()}}},{key:"clearAnnotation",value:function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;0<=t;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}},{key:"generate",value:function(){var t;return this.clearAnnotation(),u&&e&&this.isMap()?this.generateMap():(t="",this.stringify(this.root,function(e){t+=e}),[t])}},{key:"generateMap",value:function(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}},{key:"generateString",value:function(){var r=this;this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});var i,o=1,a=1,s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(e,t,n){r.css+=e,t&&"end"!==n&&(s.generated.line=o,s.generated.column=a-1,t.source&&t.source.start?(s.source=r.sourcePath(t),s.original.line=t.source.start.line,s.original.column=t.source.start.column-1):(s.source="<no source>",s.original.line=1,s.original.column=0),r.map.addMapping(s)),(i=e.match(/\n/g))?(o+=i.length,i=e.lastIndexOf("\n"),a=e.length-i):a+=e.length,t&&"start"!==n&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(s.source=r.sourcePath(t),s.original.line=t.source.end.line,s.original.column=t.source.end.column-1,s.generated.line=o,s.generated.column=a-2):(s.source="<no source>",s.original.line=1,s.original.column=0,s.generated.line=o,s.generated.column=a-1),r.map.addMapping(s))})}},{key:"isAnnotation",value:function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))}},{key:"isInline",value:function(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))}},{key:"isMap",value:function(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}},{key:"isSourcesContent",value:function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})}},{key:"outputFile",value:function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}},{key:"path",value:function(e){var t;return this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e)?e:this.memoizedPaths.get(e)||(t=this.opts.to?s(this.opts.to):".","string"==typeof this.mapOpts.annotation&&(t=s(r(t,this.mapOpts.annotation))),t=n(t,e),this.memoizedPaths.set(e,t),t)}},{key:"previous",value:function(){var e,t=this;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(function(e){e.source&&e.source.input.map&&(e=e.source.input.map,t.previousMaps.includes(e)||t.previousMaps.push(e))}):(e=new l(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}},{key:"setSourcesContent",value:function(){var e,n=this,r={};this.root?this.root.walk(function(e){var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=n.usesFileUrls?n.toFileUrl(t):n.toUrl(n.path(t)),n.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}},{key:"sourcePath",value:function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}},{key:"toBase64",value:function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}},{key:"toFileUrl",value:function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(o)return t=o(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}},{key:"toUrl",value:function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===i&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}}])}function ma(){var e;return Mo||(Mo=1,Gr(t,ca()),e=k(t),(xo=e).default=e),xo;function t(e){return b(this,t),(e=Wr(this,t,[e])).type="comment",e}}function va(){var u,c,d,t,e,h,f,p,m,n;return Ao||(Ao=1,e=sa(),h=e.isClean,f=e.my,p=da(),m=ma(),Gr(v,ca()),(n=k(v,[{key:"append",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o,a=i[r],s=Ie(this.normalize(a,this.last));try{for(s.s();!(o=s.n()).done;){var l=o.value;this.proxyOf.nodes.push(l)}}catch(e){s.e(e)}finally{s.f()}}return this.markDirty(),this}},{key:"cleanRaws",value:function(e){if(ei(v,"cleanRaws",this,3)([e]),this.nodes){var t,n=Ie(this.nodes);try{for(n.s();!(t=n.n()).done;)t.value.cleanRaws(e)}catch(e){n.e(e)}finally{n.f()}}}},{key:"each",value:function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}}},{key:"every",value:function(e){return this.nodes.every(e)}},{key:"getIterator",value:function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}},{key:"getProxyProcessor",value:function(){return{get:function(r,o){return"proxyOf"===o?r:r[o]&&("each"===o||"string"==typeof o&&o.startsWith("walk")?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r[o].apply(r,ti(t.map(function(n){return"function"==typeof n?function(e,t){return n(e.toProxy(),t)}:n})))}:"every"===o||"some"===o?function(i){return r[o](function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return i.apply(void 0,[e.toProxy()].concat(n))})}:"root"===o?function(){return r.root().toProxy()}:"nodes"===o?r.nodes.map(function(e){return e.toProxy()}):"first"===o||"last"===o?r[o].toProxy():r[o])},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}},{key:"index",value:function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}},{key:"insertAfter",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o+1,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"insertBefore",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<=(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"normalize",value:function(e,t){var n=this;if("string"==typeof e)e=function t(e){return e.map(function(e){return e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e})}(u(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){var r,i=Ie(e=e.slice(0));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.parent&&o.parent.removeChild(o,"ignore")}}catch(e){i.e(e)}finally{i.f()}}else if("root"===e.type&&"document"!==this.type){var a,s=Ie(e=e.nodes.slice(0));try{for(s.s();!(a=s.n()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}}catch(e){s.e(e)}finally{s.f()}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new p(e)]}else if(e.selector)e=[new c(e)];else if(e.name)e=[new d(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new m(e)]}return e.map(function(e){return e[f]||v.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[h]&&function e(t){if(t[h]=!1,t.proxyOf.nodes){var n,r=Ie(t.proxyOf.nodes);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(e){r.e(e)}finally{r.f()}}}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=n.proxyOf,e})}},{key:"prepend",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Ie(t=t.reverse());try{for(i.s();!(r=i.n()).done;){var o,a,s=r.value,l=this.normalize(s,this.first,"prepend").reverse(),u=Ie(l);try{for(u.s();!(o=u.n()).done;){var c=o.value;this.proxyOf.nodes.unshift(c)}}catch(e){u.e(e)}finally{u.f()}for(a in this.indexes)this.indexes[a]=this.indexes[a]+l.length}}catch(e){i.e(e)}finally{i.f()}return this.markDirty(),this}},{key:"push",value:function(e){return(e.parent=this).proxyOf.nodes.push(e),this}},{key:"removeAll",value:function(){var e,t=Ie(this.proxyOf.nodes);try{for(t.s();!(e=t.n()).done;)e.value.parent=void 0}catch(e){t.e(e)}finally{t.f()}return this.proxyOf.nodes=[],this.markDirty(),this}},{key:"removeChild",value:function(e){var t,n;for(n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}},{key:"replaceValues",value:function(t,n,r){return r||(r=n,n={}),this.walkDecls(function(e){n.props&&!n.props.includes(e.prop)||n.fast&&!e.value.includes(n.fast)||(e.value=e.value.replace(t,r))}),this.markDirty(),this}},{key:"some",value:function(e){return this.nodes.some(e)}},{key:"walk",value:function(r){return this.each(function(t,e){var n;try{n=r(t,e)}catch(e){throw t.addToError(e)}return n=!1!==n&&t.walk?t.walk(r):n})}},{key:"walkAtRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("atrule"===e.type&&n.test(e.name))return r(e,t)}):this.walk(function(e,t){if("atrule"===e.type&&e.name===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("atrule"===e.type)return r(e,t)}))}},{key:"walkComments",value:function(n){return this.walk(function(e,t){if("comment"===e.type)return n(e,t)})}},{key:"walkDecls",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("decl"===e.type&&n.test(e.prop))return r(e,t)}):this.walk(function(e,t){if("decl"===e.type&&e.prop===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("decl"===e.type)return r(e,t)}))}},{key:"walkRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("rule"===e.type&&n.test(e.selector))return r(e,t)}):this.walk(function(e,t){if("rule"===e.type&&e.selector===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("rule"===e.type)return r(e,t)}))}},{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}])).registerParse=function(e){u=e},n.registerRule=function(e){c=e},n.registerAtRule=function(e){d=e},n.registerRoot=function(e){t=e},((Io=n).default=n).rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,d.prototype):"rule"===e.type?Object.setPrototypeOf(e,c.prototype):"decl"===e.type?Object.setPrototypeOf(e,p.prototype):"comment"===e.type?Object.setPrototypeOf(e,m.prototype):"root"===e.type&&Object.setPrototypeOf(e,t.prototype),e[f]=!0,e.nodes&&e.nodes.forEach(function(e){n.rebuild(e)})}),Io;function v(){return b(this,v),Wr(this,v,arguments)}}function ga(){var t,n,e;return Do||(Do=1,Gr(r,va()),(e=k(r,[{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},e.registerProcessor=function(e){n=e},(Po=e).default=e),Po;function r(e){return b(this,r),(e=Wr(this,r,[Ae({type:"document"},e)])).nodes||(e.nodes=[]),e}}function ya(){if(No)return Lo;No=1;var t={};return Lo=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}}function wa(){var e;return Uo||(Uo=1,e=k(function e(t){var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(n in b(this,e),this.type="warning",this.text=t,r.node&&r.node.source&&(t=r.node.rangeBy(r),this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column),r)this[n]=r[n]},[{key:"toString",value:function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}]),(Fo=e).default=e),Fo}function ba(){var n,e;return Bo||(Bo=1,n=wa(),e=k(function e(t,n,r){b(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0},[{key:"toString",value:function(){return this.css}},{key:"warn",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin),new n(e,t));return this.messages.push(e),e}},{key:"warnings",value:function(){return this.messages.filter(function(e){return"warning"===e.type})}},{key:"content",get:function(){return this.css}}]),(zo=e).default=e),zo}function ka(){var e,t;return qo||(qo=1,Gr(r,e=va()),t=k(r,[{key:"append",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ei(r,"append",this,3)(t)}},{key:"prepend",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ei(r,"prepend",this,3)(t)}}]),(Ho=t).default=t,e.registerAtRule(t)),Ho;function r(e){return b(this,r),(e=Wr(this,r,[e])).type="atrule",e}}function _a(){var t,n,e,r;return Go||(Go=1,Gr(a,e=va()),(r=k(a,[{key:"normalize",value:function(e,t,n){var r=ei(a,"normalize",this,3)([e]);if(t)if("prepend"===n)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;)i.value.raws.before=t.raws.before}catch(e){o.e(e)}finally{o.f()}}return r}},{key:"removeChild",value:function(e,t){var n=this.index(e);return!t&&0===n&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[n].raws.before),ei(a,"removeChild",this,3)([e])}},{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},r.registerProcessor=function(e){n=e},Vo=r,e.registerRoot(r.default=r)),Vo;function a(e){return b(this,a),(e=Wr(this,a,[e])).type="root",e.nodes||(e.nodes=[]),e}}function Sa(){var t;return Jo||(Jo=1,(Zo=t={comma:function(e){return t.split(e,[","],!0)},space:function(e){return t.split(e,[" ","\n","\t"])},split:function(e,t,n){var r,i=[],o="",a=!1,s=0,l=!1,u="",c=!1,d=Ie(e);try{for(d.s();!(r=d.n()).done;){var h=r.value;c?c=!1:"\\"===h?c=!0:l?h===u&&(l=!1):'"'===h||"'"===h?(l=!0,u=h):"("===h?s+=1:")"===h?0<s&&--s:0===s&&t.includes(h)&&(a=!0),a?(""!==o&&i.push(o.trim()),o="",a=!1):o+=h}}catch(e){d.e(e)}finally{d.f()}return!n&&""===o||i.push(o.trim()),i}}).default=t),Zo}function Ea(){var e,t,n;return $o||($o=1,e=va(),t=Sa(),Gr(r,e),n=k(r,[{key:"selectors",get:function(){return t.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}}]),(Ko=n).default=n,e.registerRule(n)),Ko;function r(e){return b(this,r),(e=Wr(this,r,[e])).type="rule",e.nodes||(e.nodes=[]),e}}function Ca(){if(Yo)return Xo;Yo=1;var p=da(),e=(()=>{if(Wo)return jo;Wo=1;var w="'".charCodeAt(0),b='"'.charCodeAt(0),k="\\".charCodeAt(0),_="/".charCodeAt(0),S="\n".charCodeAt(0),E=" ".charCodeAt(0),C="\f".charCodeAt(0),R="\t".charCodeAt(0),O="\r".charCodeAt(0),T="[".charCodeAt(0),x="]".charCodeAt(0),M="(".charCodeAt(0),I=")".charCodeAt(0),A="{".charCodeAt(0),P="}".charCodeAt(0),D=";".charCodeAt(0),L="*".charCodeAt(0),N=":".charCodeAt(0),F="@".charCodeAt(0),U=/[\t\n\f\r "#'()/;[\\\]{}]/g,z=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,B=/.[\r\n"'(/\\]/,j=/[\da-f]/i;return jo=function(t){var r,i,o,a,s,l,u,c,d,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},h=t.css.valueOf(),f=e.ignoreErrors,p=h.length,m=0,v=[],g=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&p<=m},nextToken:function(e){if(g.length)return g.pop();if(!(p<=m)){var t=!!e&&e.ignoreUnclosed;switch(r=h.charCodeAt(m)){case S:case E:case R:case O:case C:for(i=m;i+=1,(r=h.charCodeAt(i))===E||r===S||r===R||r===O||r===C;);d=["space",h.slice(m,i)],m=i-1;break;case T:case x:case A:case P:case N:case D:case I:var n=String.fromCharCode(r);d=[n,n,m];break;case M:if(u=v.length?v.pop()[1]:"",c=h.charCodeAt(m+1),"url"===u&&c!==w&&c!==b&&c!==E&&c!==S&&c!==R&&c!==C&&c!==O){i=m;do{if(s=!1,-1===(i=h.indexOf(")",i+1))){if(f||t){i=m;break}y("bracket")}for(l=i;h.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["brackets",h.slice(m,i+1),m,i],m=i}else i=h.indexOf(")",m+1),u=h.slice(m,i+1),-1===i||B.test(u)?d=["(","(",m]:(d=["brackets",u,m,i],m=i);break;case w:case b:o=r===w?"'":'"',i=m;do{if(s=!1,-1===(i=h.indexOf(o,i+1))){if(f||t){i=m+1;break}y("string")}for(l=i;h.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["string",h.slice(m,i+1),m,i],m=i;break;case F:U.lastIndex=m+1,U.test(h),i=0===U.lastIndex?h.length-1:U.lastIndex-2,d=["at-word",h.slice(m,i+1),m,i],m=i;break;case k:for(i=m,a=!0;h.charCodeAt(i+1)===k;)i+=1,a=!a;if(r=h.charCodeAt(i+1),a&&r!==_&&r!==E&&r!==S&&r!==R&&r!==O&&r!==C&&(i+=1,j.test(h.charAt(i)))){for(;j.test(h.charAt(i+1));)i+=1;h.charCodeAt(i+1)===E&&(i+=1)}d=["word",h.slice(m,i+1),m,i],m=i;break;default:m=(r===_&&h.charCodeAt(m+1)===L?(0===(i=h.indexOf("*/",m+2)+1)&&(f||t?i=h.length:y("comment")),d=["comment",h.slice(m,i+1),m,i]):(z.lastIndex=m+1,z.test(h),i=0===z.lastIndex?h.length-1:z.lastIndex-2,d=["word",h.slice(m,i+1),m,i],v.push(d)),i)}return m++,d}},position:function(){return m}}}})(),n=ma(),u=ka(),r=_a(),i=Ea(),h={empty:!0,space:!0};return Xo=k(function e(t){b(this,e),this.input=t,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}},[{key:"atrule",value:function(e){var t,n,r,i=new u;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,a=!1,s=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(0<s.length){for(n=s[r=s.length-1];n&&"space"===n[0];)n=s[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}}if(s.push(e),this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(i.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(i,"params",s),o&&(e=s[s.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}},{key:"checkMissedSemicolon",value:function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;0<=i&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}}},{key:"colon",value:function(e){var t,n,r,i,o=0,a=Ie(e.entries());try{for(a.s();!(i=a.n()).done;){var s=Pe(i.value,2),l=s[0];if("("===(n=(t=s[1])[0])&&(o+=1),")"===n&&--o,0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}}catch(e){a.e(e)}finally{a.f()}return!1}},{key:"comment",value:function(e){var t=new n,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}},{key:"createTokenizer",value:function(){this.tokenizer=e(this.input)}},{key:"decl",value:function(e,t){var n=new p;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||(e=>{for(var t=e.length-1;0<=t;t--){var n=e[t],n=n[3]||n[2];if(n)return n}})(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var a,s=[];e.length&&("space"===(a=e[0][0])||"comment"===a);)s.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;0<=l;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var u=this.stringFrom(e,l);" !important"!==(u=this.spacesFromEnd(e)+u)&&(n.raws.important=u);break}if("important"===r[1].toLowerCase()){for(var c=e.slice(0),d="",h=l;0<h;h--){var f=c[h][0];if(0===d.trim().indexOf("!")&&"space"!==f)break;d=c.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=c)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=s.map(function(e){return e[1]}).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}},{key:"doubleColon",value:function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}},{key:"emptyRule",value:function(e){var t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}},{key:"end",value:function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}},{key:"endFile",value:function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}},{key:"freeSemicolon",value:function(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}},{key:"getPosition",value:function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}},{key:"init",value:function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}},{key:"other",value:function(e){for(var t,n=!1,r=!1,i=null,o=[],a=e[1].startsWith("--"),s=[],l=e;l;){if(t=l[0],s.push(l),"("===t||"["===t)i=i||l,o.push("("===t?")":"]");else if(a&&r&&"{"===t)i=i||l,o.push("}");else if(0===o.length){if(";"===t){if(r)return void this.decl(s,a);break}if("{"===t)return void this.rule(s);if("}"===t){this.tokenizer.back(s.pop()),n=!0;break}":"===t&&(r=!0)}else t===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),0<o.length&&this.unclosedBracket(i),n&&r){if(!a)for(;s.length&&("space"===(l=s[s.length-1][0])||"comment"===l);)this.tokenizer.back(s.pop());this.decl(s,a)}else this.unknownWord(s)}},{key:"parse",value:function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}},{key:"precheckMissedSemicolon",value:function(){}},{key:"raw",value:function(e,t,n,r){for(var i,o,a,s,l=n.length,u="",c=!0,d=0;d<l;d+=1)"space"===(a=(i=n[d])[0])&&d===l-1&&!r||"comment"===a&&(a=n[d-1]?n[d-1][0]:"empty",o=n[d+1]?n[d+1][0]:"empty",h[a]||h[o]||","===u.slice(-1))?c=!1:u+=i[1];c||(s=n.reduce(function(e,t){return e+t[1]},""),e.raws[t]={raw:s,value:u}),e[t]=u}},{key:"rule",value:function(e){e.pop();var t=new i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"spacesAndCommentsFromEnd",value:function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n}},{key:"spacesAndCommentsFromStart",value:function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n}},{key:"spacesFromEnd",value:function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}},{key:"stringFrom",value:function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}},{key:"unclosedBlock",value:function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}},{key:"unclosedBracket",value:function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}},{key:"unexpectedClose",value:function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}},{key:"unknownWord",value:function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}},{key:"unnamedAtrule",value:function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}])}function Ra(){var e,r,i;return ea||(ea=1,e=va(),r=Ca(),i=fa(),Qo=t,e.registerParse(t.default=t)),Qo;function t(e,t){var n=new i(e,t),n=new r(n);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}}function Oa(){var d,s,n,r,l,e,i,u,c,t,o,h,f,p,a,m;return na||(na=1,e=sa(),d=e.isClean,s=e.my,n=pa(),r=ua(),l=va(),e=ga(),i=ya(),u=ba(),c=Ra(),t=_a(),o={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0},p={},(a=k(function e(t,n,r){var i,o=this;if(b(this,e),this.stringified=!1,this.processed=!1,"object"!==_(n)||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof u)i=w(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var a=c;r.syntax&&(a=r.syntax.parse),(a=r.parser?r.parser:a).parse&&(a=a.parse);try{i=a(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[s]&&l.rebuild(i)}else i=w(n);this.result=new u(t,i,r),this.helpers=Ae(Ae({},p),{},{postcss:p,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===_(e)&&e.prepare?Ae(Ae({},e),e.prepare(o.result)):e})},[{key:"async",value:function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"getAsyncError",value:function(){throw new Error("Use process(css).then(cb) to work with async plugins")}},{key:"handleError",value:function(e,t){var n,r,i,o,a,s=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?s.postcssVersion&&"production"!==process.env.NODE_ENV&&(n=s.postcssPlugin,r=s.postcssVersion,i=this.result.processor.version,o=r.split("."),a=i.split("."),o[0]!==a[0]||parseInt(o[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below."):(e.plugin=s.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}},{key:"prepareVisitors",value:function(){var r=this;this.listeners={};function e(e,t,n){r.listeners[t]||(r.listeners[t]=[]),r.listeners[t].push([e,n])}var t,n=Ie(this.plugins);try{for(n.s();!(t=n.n()).done;){var i=t.value;if("object"===_(i))for(var o in i){if(!h[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event ".concat(o," in ").concat(i.postcssPlugin,". Try to update PostCSS (").concat(this.processor.version," now)."));if(!f[o])if("object"===_(i[o]))for(var a in i[o])e(i,"*"===a?o:o+"-"+a.toLowerCase(),i[o][a]);else"function"==typeof i[o]&&e(i,o,i[o])}}}catch(r){n.e(r)}finally{n.f()}this.hasListener=0<Object.keys(this.listeners).length}},{key:"runAsync",value:(m=jr($r().m(function e(){var t,i,n,r,o,a,s,l,u,c=this;return $r().w(function(e){for(;;)switch(e.p=e.n){case 0:this.plugin=0,t=0;case 1:if(t<this.plugins.length){if(s=this.plugins[t],v(s=this.runOnRoot(s)))return e.p=2,e.n=3,s;e.n=5}else e.n=6;break;case 3:e.n=5;break;case 4:throw e.p=4,s=e.v,this.handleError(s);case 5:t++,e.n=1;break;case 6:if(this.prepareVisitors(),!this.hasListener){e.n=21;break}i=this.result.root;case 7:if(i[d]){e.n=14;break}i[d]=!0,n=[y(i)];case 8:if(0<n.length){if(v(l=this.visitTick(n)))return e.p=9,e.n=10,l;e.n=12}else e.n=13;break;case 10:e.n=12;break;case 11:throw e.p=11,l=e.v,u=n[n.length-1].node,this.handleError(l,u);case 12:e.n=8;break;case 13:e.n=7;break;case 14:if(!this.listeners.OnceExit){e.n=21;break}r=Ie(this.listeners.OnceExit),e.p=15,a=$r().m(function e(){var t,n,r;return $r().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=Pe(o.value,2),r=n[0],t=n[1],c.result.lastPlugin=r,e.p=1,"document"===i.type)return n=i.nodes.map(function(e){return t(e,c.helpers)}),e.n=2,Promise.all(n);e.n=3;break;case 2:e.n=4;break;case 3:return e.n=4,t(i,c.helpers);case 4:e.n=6;break;case 5:throw e.p=5,r=e.v,c.handleError(r);case 6:return e.a(2)}},e,null,[[1,5]])}),r.s();case 16:if((o=r.n()).done){e.n=18;break}return e.d(Yr(a()),17);case 17:e.n=16;break;case 18:e.n=20;break;case 19:e.p=19,u=e.v,r.e(u);case 20:return e.p=20,r.f(),e.f(20);case 21:return this.processed=!0,e.a(2,this.stringify())}},e,this,[[15,19,20,21],[9,11],[2,4]])})),function(){return m.apply(this,arguments)})},{key:"runOnRoot",value:function(t){var e,n=this;this.result.lastPlugin=t;try{return"object"===_(t)&&t.Once?"document"===this.result.root.type?v((e=this.result.root.nodes.map(function(e){return t.Once(e,n.helpers)}))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}},{key:"stringify",value:function(){if(this.error)throw this.error;var e,t;return this.stringified||(this.stringified=!0,this.sync(),t=this.result.opts,e=r,t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify),t=new n(e,this.result.root,this.result.opts).generate(),this.result.css=t[0],this.result.map=t[1]),this.result}},{key:"sync",value:function(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();var e,t=Ie(this.plugins);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(v(this.runOnRoot(n)))throw this.getAsyncError()}}catch(e){t.e(e)}finally{t.f()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[d];)r[d]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type){var i,o=Ie(r.nodes);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.visitSync(this.listeners.OnceExit,a)}}catch(e){o.e(e)}finally{o.f()}}else this.visitSync(this.listeners.OnceExit,r)}}return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this.css}},{key:"visitSync",value:function(e,t){var n,r=Ie(e);try{for(r.s();!(n=r.n()).done;){var i=Pe(n.value,2),o=i[0],a=i[1],s=(this.result.lastPlugin=o,void 0);try{s=a(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(v(s))throw this.getAsyncError()}}catch(e){r.e(e)}finally{r.f()}}},{key:"visitTick",value:function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(0<r.length&&t.visitorIndex<r.length){var i=Pe(r[t.visitorIndex],2),o=i[0],i=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){for(var a,s=t.iterator;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[d])return a[d]=!0,void e.push(y(a));t.iterator=0,delete n.indexes[s]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}},{key:"walkSync",value:function(e){var t=this;e[d]=!0;var n,r=Ie(g(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[d]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}}catch(e){r.e(e)}finally{r.f()}}},{key:"warnings",value:function(){return this.sync().warnings()}},{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}])).registerPostcss=function(e){p=e},ta=a,t.registerLazyResult(a.default=a),e.registerLazyResult(a)),ta;function v(e){return"object"===_(e)&&"function"==typeof e.then}function g(e){var t=!1,n=o[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function y(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:g(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function w(e){return e[d]=!1,e.nodes&&e.nodes.forEach(w),e}}y||(y=1,i=co(),Ta=da(),y=Oa(),Tl=va(),Af||(Af=1,c||(c=1,Ja=pa(),Ka=ua(),$a=ya(),Xa=Ra(),Ya=ba(),Qa=k(function e(t,n,r){b(this,e),n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;var t=Ka,i=(this.result=new Ya(this._processor,void 0,this._opts),this.result.css=n,this),r=(Object.defineProperty(this.result,"root",{get:function(){return i.root}}),new Ja(t,void 0,this._opts,n));r.isMap()?(n=(t=Pe(r.generate(),2))[0],t=t[1],n&&(this.result.css=n),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)},[{key:"async",value:function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"sync",value:function(){if(this.error)throw this.error;return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||$a("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this._css}},{key:"warnings",value:function(){return[]}},{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=Xa;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),(ra=Qa).default=Qa),qa=ra,Va=Oa(),Qa=ga(),Ga=_a(),Za=k(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];b(this,e),this.version="8.4.38",this.plugins=this.normalize(t)},[{key:"normalize",value:function(e){var t,n=[],r=Ie(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===_(i)&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===_(i)&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else{if("object"!==_(i)||!i.parse&&!i.stringify)throw new Error(i+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"process",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Va:qa)(this,e,t)}},{key:"use",value:function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}]),(ia=Za).default=Za,Ga.registerProcessor(Za),Qa.registerProcessor(Za)),xa=ia,Ga=ua(),v||(v=1,Fa=da(),Ua=ha(),za=ma(),Ba=ka(),ja=fa(),Wa=_a(),Ha=Ea(),(oa=es).default=es),Za=oa,Ma=ga(),Af=wa(),Ia=ma(),Aa=ka(),c=ba(),v=fa(),Pa=Ra(),Da=Sa(),La=Ea(),Na=_a(),Dl=ca(),o.plugin=function(t,n){var e,r=!1;function i(){console&&console.warn&&!r&&(r=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");var e=n.apply(void 0,arguments);return e.postcssPlugin=t,e.postcssVersion=(new xa).version,e}return Object.defineProperty(i,"postcss",{get:function(){return e=e||i()}}),i.process=function(e,t,n){return o([i(n)]).process(e,t)},i},o.stringify=Ga,o.parse=Pa,o.fromJSON=Za,o.list=Da,o.comment=function(e){return new Ia(e)},o.atRule=function(e){return new Aa(e)},o.decl=function(e){return new Ta(e)},o.rule=function(e){return new La(e)},o.root=function(e){return new Na(e)},o.document=function(e){return new Ma(e)},o.CssSyntaxError=i,o.Declaration=Ta,o.Container=Tl,o.Processor=xa,o.Document=Ma,o.Comment=Ia,o.Warning=Af,o.AtRule=Aa,o.Result=c,o.Input=v,o.Rule=La,o.Root=Na,o.Node=Dl,y.registerPostcss(o),(Pa=o).default=o);var Ta,xa,Ma,Ia,Aa,Pa,Da,La,Na,Fa,Ua,za,Ba,ja,Wa,Ha,qa,Va,Ga,Za,Ja,Ka,$a,Xa,Ya,Qa,i=(Da=Pa)&&Da.__esModule&&Object.prototype.hasOwnProperty.call(Da,"default")?Da.default:Da;function es(e,t){if(Array.isArray(e))return e.map(function(e){return es(e)});var n,r=e.inputs,i=Kr(e,ai);if(r){t=[];var o,a=Ie(r);try{for(a.s();!(o=a.n()).done;){var s=Ae(Ae({},o.value),{},{__proto__:ja.prototype});s.map&&(s.map=Ae(Ae({},s.map),{},{__proto__:Ua.prototype})),t.push(s)}}catch(e){a.e(e)}finally{a.f()}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return es(e,t)})),i.source&&(n=(r=i.source).inputId,r=Kr(r,si),i.source=r,null!=n)&&(i.source.input=t[n]),"root"===i.type)return new Wa(i);if("decl"===i.type)return new Fa(i);if("rule"===i.type)return new Ha(i);if("comment"===i.type)return new za(i);if("atrule"===i.type)return new Ba(i);throw new Error("Unknown node type: "+e.type)}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new xa(t)}i.stringify;function ts(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?ns(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}var ns=Object.defineProperty;Date.now().toString();var rs,is={exports:{}};var os,as,ss,ls,us,m=(ss=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?ss:("function"==typeof(ls=ss.default)?(us=function e(){return this instanceof e?Reflect.construct(ls,arguments,this.constructor):ls.apply(this,arguments)}).prototype=ls.prototype:us={},Object.defineProperty(us,"__esModule",{value:!0}),Object.keys(ss).forEach(function(e){var t=Object.getOwnPropertyDescriptor(ss,e);Object.defineProperty(us,e,t.get?t:{enumerable:!0,get:function(){return ss[e]}})}),us);function cs(){var d,h,e,t;return as||(as=1,rs||(rs=1,e=String,is.exports=(t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}})(),is.exports.createColors=t),d=is.exports,h=m,Gr(s,ii(Error)),t=k(s,[{key:"setMessage",value:function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}},{key:"showSourceCode",value:function(e){var r=this;if(!this.source)return"";var t=this.source;null==e&&(e=d.isColorSupported);var n,i,o,a,s,t=(t=h&&e?h(t):t).split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,t.length),c=String(u).length;return e?(e=d.createColors(!0),n=e.bold,i=e.gray,o=e.red,a=function(e){return n(o(e))},s=function(e){return i(e)}):a=s=function(e){return e},t.slice(l,u).map(function(e,t){var t=l+1+t,n=" "+(" "+t).slice(-c)+" | ";return t===r.line?(t=s(n.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," "),a(">")+s(n)+e+"\n "+t+a("^")):" "+s(n)+e}).join("\n")}},{key:"toString",value:function(){var e=(e=this.showSourceCode())&&"\n\n"+e+"\n";return this.name+": "+this.message+e}}]),(os=t).default=t),os;function s(e,t,n,r,i,o){var a;return b(this,s),(a=Wr(this,s,[e])).name="CssSyntaxError",a.reason=e,i&&(a.file=i),r&&(a.source=r),o&&(a.plugin=o),void 0!==t&&void 0!==n&&("number"==typeof t?(a.line=t,a.column=n):(a.line=t.line,a.column=t.column,a.endLine=n.line,a.endColumn=n.column)),a.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(a,s),a}}var ds,hs,fs,ps,ms,vs,gs,ys,ws,bs,ks,_s,Ss,Es,Cs,Rs,Os,Ts,xs,Ms,Is,As,Ps,Ds,Ls,Ns,Fs,Us,zs,Bs,js,Ws,Hs,qs,Vs,Gs,Zs,Js,Ks,$s,Xs,Ys,Qs,el,tl,nl,rl,il,ol,al={};function sl(){return ds||(ds=1,al.isClean=Symbol("isClean"),al.my=Symbol("my")),al}function ll(){var a,e;return fs||(a={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!(fs=1)},e=k(function e(t){b(this,e),this.builder=t},[{key:"atrule",value:function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes?this.block(e,n+r):(t=(e.raws.between||"")+(t?";":""),this.builder(n+r+t,e))}},{key:"beforeAfter",value:function(e,t){for(var n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var a=0;a<i;a++)n+=o}return n}},{key:"block",value:function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(t=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(t),this.builder("}",e,"end")}},{key:"body",value:function(e){for(var t=e.nodes.length-1;0<t&&"comment"===e.nodes[t].type;)--t;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}},{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}},{key:"decl",value:function(e,t){var n=this.raw(e,"between","colon"),n=e.prop+n+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}},{key:"document",value:function(e){this.body(e)}},{key:"raw",value:function(e,t,n){var r;if(t&&void 0!==(r=e.raws[t]))return r;var i,o=e.parent;if("before"===(n=n||t)){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}return o?((o=e.root()).rawCache||(o.rawCache={}),void 0!==o.rawCache[n]?o.rawCache[n]:"before"===n||"after"===n?this.beforeAfter(e,n):(this[i="raw"+((i=n)[0].toUpperCase()+i.slice(1))]?r=this[i](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=a[n]),o.rawCache[n]=r)):a[n]}},{key:"rawBeforeClose",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}},{key:"rawBeforeComment",value:function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeDecl"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeDecl",value:function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeRule"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeOpen",value:function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}},{key:"rawBeforeRule",value:function(t){var n;return t.walk(function(e){if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=n&&n.replace(/\S/g,"")}},{key:"rawColon",value:function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}},{key:"rawEmptyBody",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}},{key:"rawIndent",value:function(n){return n.raws.indent||(n.walk(function(e){var t=e.parent;if(t&&t!==n&&t.parent&&t.parent===n&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),r=(r=t[t.length-1]).replace(/\S/g,""),!1}),r);var r}},{key:"rawSemicolon",value:function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}},{key:"rawValue",value:function(e,t){var n=e[t],e=e.raws[t];return e&&e.value===n?e.raw:n}},{key:"root",value:function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}},{key:"rule",value:function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}},{key:"stringify",value:function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}]),(hs=e).default=e),hs}function ul(){var n;return ms||(ms=1,n=ll(),(ps=e).default=e),ps;function e(e,t){new n(t).stringify(e)}}function cl(){var a,s,i,n,r,e;return gs||(gs=1,e=sl(),a=e.isClean,s=e.my,i=cs(),n=ll(),r=ul(),e=k(function e(){var t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(t in b(this,e),this.raws={},this[a]=!1,this[s]=!0,n)if("nodes"===t){this.nodes=[];var r,i=Ie(n[t]);try{for(i.s();!(r=i.n()).done;){var o=r.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}catch(e){i.e(e)}finally{i.f()}}else this[t]=n[t]},[{key:"addToError",value:function(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,"$&".concat(t.input.from,":").concat(t.start.line,":").concat(t.start.column,"$&"))),e}},{key:"after",value:function(e){return this.parent.insertAfter(this,e),this}},{key:"assign",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(e in t)this[e]=t[e];return this}},{key:"before",value:function(e){return this.parent.insertBefore(this,e),this}},{key:"cleanRaws",value:function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}},{key:"clone",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=function t(e,n){var r,i,o,a=new e.constructor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r&&(o=_(i=e[r]),"parent"===r&&"object"===o?n&&(a[r]=n):"source"===r?a[r]=i:Array.isArray(i)?a[r]=i.map(function(e){return t(e,a)}):("object"===o&&null!==i&&(i=t(i)),a[r]=i));return a}(this);for(e in t)n[e]=t[e];return n}},{key:"cloneAfter",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertAfter(this,e),e}},{key:"cloneBefore",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertBefore(this,e),e}},{key:"error",value:function(e){var t,n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.source?(t=(n=this.rangeBy(r)).end,this.source.input.error(e,{column:(n=n.start).column,line:n.line},{column:t.column,line:t.line},r)):new i(e)}},{key:"getProxyProcessor",value:function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}},{key:"markDirty",value:function(){if(this[a]){this[a]=!1;for(var e=this;e=e.parent;)e[a]=!1}}},{key:"next",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}},{key:"positionBy",value:function(e,t){var n=this.source.start;return e.index?n=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(n=this.positionInside(e,t)),n}},{key:"positionInside",value:function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?i+=r=1:r+=1;return{column:r,line:i}}},{key:"prev",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}},{key:"rangeBy",value:function(e){var t,n,r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};return e.word?-1!==(n=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(n,t),i=this.positionInside(n+e.word.length,t)):(e.start?r={column:e.start.column,line:e.start.line}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1))),{end:i=i.line<r.line||i.line===r.line&&i.column<=r.column?{column:r.column+1,line:r.line}:i,start:r}}},{key:"raw",value:function(e,t){return(new n).raw(this,e,t)}},{key:"remove",value:function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}},{key:"replaceWith",value:function(){if(this.parent){for(var e=this,t=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];s===this?t=!0:t?(this.parent.insertAfter(e,s),e=s):this.parent.insertBefore(e,s)}t||this.remove()}return this}},{key:"root",value:function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}},{key:"toJSON",value:function(e,t){var n,r,i,o={},a=null==t,s=(t=t||new Map,0);for(n in this)Object.prototype.hasOwnProperty.call(this,n)&&"parent"!==n&&"proxyCache"!==n&&(r=this[n],Array.isArray(r)?o[n]=r.map(function(e){return"object"===_(e)&&e.toJSON?e.toJSON(null,t):e}):"object"===_(r)&&r.toJSON?o[n]=r.toJSON(null,t):"source"===n?(null==(i=t.get(r.input))&&(i=s,t.set(r.input,s),s++),o[n]={end:r.end,inputId:i,start:r.start}):o[n]=r);return a&&(o.inputs=ti(t.keys()).map(function(e){return e.toJSON()})),o}},{key:"toProxy",value:function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r,t=(e.stringify&&(e=e.stringify),"");return e(this,function(e){t+=e}),t}},{key:"warn",value:function(e,t,n){var r,i={node:this};for(r in n)i[r]=n[r];return e.warn(t,i)}},{key:"proxyOf",get:function(){return this}}]),(vs=e).default=e),vs}function dl(){var e;return ws||(ws=1,Gr(t,cl()),e=k(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),(ys=e).default=e),ys;function t(e){return b(this,t),(e=Wr(this,t,[e=e&&void 0!==e.value&&"string"!=typeof e.value?Ae(Ae({},e),{},{value:String(e.value)}):e])).type="decl",e}}function hl(){var r,i,t,n,o,a,e;return Ss||(Ss=1,r=m.SourceMapConsumer,i=m.SourceMapGenerator,t=m.existsSync,n=m.readFileSync,o=m.dirname,a=m.join,e=k(function e(t,n){b(this,e),!1!==n.map&&(this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:"),t=n.map?n.map.prev:void 0,t=this.loadMap(n.from,t),!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=o(this.mapFile)),t)&&(this.text=t)},[{key:"consumer",value:function(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}},{key:"decodeInline",value:function(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}},{key:"getAnnotationURL",value:function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}},{key:"isMap",value:function(e){return"object"===_(e)&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}},{key:"loadAnnotation",value:function(e){var t,n=e.match(/\/\*\s*# sourceMappingURL=/gm);n&&(n=e.lastIndexOf(n.pop()),t=e.indexOf("*/",n),-1<n)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(n,t)))}},{key:"loadFile",value:function(e){if(this.root=o(e),t(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}},{key:"loadMap",value:function(e,t){if(!1===t)return!1;if(!t)return this.inline?this.decodeInline(this.annotation):this.annotation?(n=this.annotation,e&&(n=a(o(e),n)),this.loadFile(n)):void 0;if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){t=this.loadFile(n);if(t)return t;throw new Error("Unable to load previous source map: "+n.toString())}}},{key:"startWith",value:function(e,t){return!!e&&e.substr(0,t.length)===t}},{key:"withContent",value:function(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}}]),(_s=e).default=e),_s}function fl(){var e,a,l,s,r,i,t,u,o,c,d,h,n;return Cs||(Cs=1,n=m.SourceMapConsumer,e=m.SourceMapGenerator,a=m.fileURLToPath,l=m.pathToFileURL,s=m.isAbsolute,r=m.resolve,i=(ks?bs:(ks=1,bs={nanoid:function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:21;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e},customAlphabet:function(n){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:21;return function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r;t--;)e+=n[Math.random()*n.length|0];return e}}})).nanoid,t=m,u=cs(),o=hl(),c=Symbol("fromOffsetCache"),d=Boolean(n&&e),h=Boolean(r&&s),n=k(function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(b(this,e),null==t||"object"===_(t)&&!t.toString)throw new Error("PostCSS received ".concat(t," instead of CSS string"));this.css=t.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!h||/^\w+:\/\//.test(n.from)||s(n.from)?this.file=n.from:this.file=r(n.from)),h&&d&&(t=new o(this.css,n)).text&&(n=(this.map=t).consumer().file,!this.file)&&n&&(this.file=this.mapResolve(n)),this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)},[{key:"error",value:function(e,t,n){var r,i,o,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},s=(t&&"object"===_(t)?(s=n,n="number"==typeof(i=t).offset?(t=(o=this.fromOffset(i.offset)).line,o.col):(t=i.line,i.column),i="number"==typeof s.offset?(r=(o=this.fromOffset(s.offset)).line,o.col):(r=s.line,s.column)):n||(t=(o=this.fromOffset(t)).line,n=o.col),this.origin(t,n,r,i));return(o=s?new u(e,void 0===s.endLine?s.line:{column:s.column,line:s.line},void 0===s.endLine?s.column:{column:s.endColumn,line:s.endLine},s.source,s.file,a.plugin):new u(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,a.plugin)).input={column:n,endColumn:i,endLine:r,line:t,source:this.css},this.file&&(l&&(o.input.url=l(this.file).toString()),o.input.file=this.file),o}},{key:"fromOffset",value:function(e){if(this[c])n=this[c];else{for(var t=this.css.split("\n"),n=new Array(t.length),r=0,i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;this[c]=n}var a=0;if(e>=n[n.length-1])a=n.length-1;else for(var s,l=n.length-2;a<l;)if(e<n[s=a+(l-a>>1)])l=s-1;else{if(!(e>=n[s+1])){a=s;break}a=s+1}return{col:e-n[a]+1,line:a+1}}},{key:"mapResolve",value:function(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}},{key:"origin",value:function(e,t,n,r){if(!this.map)return!1;var i,o=this.map.consumer(),t=o.originalPositionFor({column:t,line:e});if(!t.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n}));e=s(t.source)?l(t.source):new URL(t.source,this.map.consumer().sourceRoot||l(this.map.mapFile)),r={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:e.toString()};if("file:"===e.protocol){if(!a)throw new Error("file: protocol is not available in this PostCSS build");r.file=a(e)}n=o.sourceContentFor(t.source);return n&&(r.source=n),r}},{key:"toJSON",value:function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=Ae({},this.map),e.map.consumerCache)&&(e.map.consumerCache=void 0),e}},{key:"from",get:function(){return this.file||this.id}}]),(Es=n).default=n,t&&t.registerInput&&t.registerInput(n)),Es}function pl(){if(Os)return Rs;Os=1;var a=m.SourceMapConsumer,t=m.SourceMapGenerator,s=m.dirname,n=m.relative,r=m.resolve,i=m.sep,o=m.pathToFileURL,l=fl(),e=Boolean(a&&t),u=Boolean(s&&r&&n&&i);return Rs=k(function e(t,n,r,i){b(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map},[{key:"addAnnotation",value:function(){var e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map",t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}},{key:"applyPrevMaps",value:function(){var e,t=Ie(this.previous());try{for(t.s();!(e=t.n()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||s(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new a(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}}catch(e){t.e(e)}finally{t.f()}}},{key:"clearAnnotation",value:function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;0<=t;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}},{key:"generate",value:function(){var t;return this.clearAnnotation(),u&&e&&this.isMap()?this.generateMap():(t="",this.stringify(this.root,function(e){t+=e}),[t])}},{key:"generateMap",value:function(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}},{key:"generateString",value:function(){var r=this;this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});var i,o=1,a=1,s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(e,t,n){r.css+=e,t&&"end"!==n&&(s.generated.line=o,s.generated.column=a-1,t.source&&t.source.start?(s.source=r.sourcePath(t),s.original.line=t.source.start.line,s.original.column=t.source.start.column-1):(s.source="<no source>",s.original.line=1,s.original.column=0),r.map.addMapping(s)),(i=e.match(/\n/g))?(o+=i.length,i=e.lastIndexOf("\n"),a=e.length-i):a+=e.length,t&&"start"!==n&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(s.source=r.sourcePath(t),s.original.line=t.source.end.line,s.original.column=t.source.end.column-1,s.generated.line=o,s.generated.column=a-2):(s.source="<no source>",s.original.line=1,s.original.column=0,s.generated.line=o,s.generated.column=a-1),r.map.addMapping(s))})}},{key:"isAnnotation",value:function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))}},{key:"isInline",value:function(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))}},{key:"isMap",value:function(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}},{key:"isSourcesContent",value:function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})}},{key:"outputFile",value:function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}},{key:"path",value:function(e){var t;return this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e)?e:this.memoizedPaths.get(e)||(t=this.opts.to?s(this.opts.to):".","string"==typeof this.mapOpts.annotation&&(t=s(r(t,this.mapOpts.annotation))),t=n(t,e),this.memoizedPaths.set(e,t),t)}},{key:"previous",value:function(){var e,t=this;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(function(e){e.source&&e.source.input.map&&(e=e.source.input.map,t.previousMaps.includes(e)||t.previousMaps.push(e))}):(e=new l(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}},{key:"setSourcesContent",value:function(){var e,n=this,r={};this.root?this.root.walk(function(e){var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=n.usesFileUrls?n.toFileUrl(t):n.toUrl(n.path(t)),n.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}},{key:"sourcePath",value:function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}},{key:"toBase64",value:function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}},{key:"toFileUrl",value:function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(o)return t=o(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}},{key:"toUrl",value:function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===i&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}}])}function ml(){var e;return xs||(xs=1,Gr(t,cl()),e=k(t),(Ts=e).default=e),Ts;function t(e){return b(this,t),(e=Wr(this,t,[e])).type="comment",e}}function vl(){var u,c,d,t,e,h,f,p,m,n;return Is||(Is=1,e=sl(),h=e.isClean,f=e.my,p=dl(),m=ml(),Gr(v,cl()),(n=k(v,[{key:"append",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o,a=i[r],s=Ie(this.normalize(a,this.last));try{for(s.s();!(o=s.n()).done;){var l=o.value;this.proxyOf.nodes.push(l)}}catch(e){s.e(e)}finally{s.f()}}return this.markDirty(),this}},{key:"cleanRaws",value:function(e){if(ei(v,"cleanRaws",this,3)([e]),this.nodes){var t,n=Ie(this.nodes);try{for(n.s();!(t=n.n()).done;)t.value.cleanRaws(e)}catch(e){n.e(e)}finally{n.f()}}}},{key:"each",value:function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}}},{key:"every",value:function(e){return this.nodes.every(e)}},{key:"getIterator",value:function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}},{key:"getProxyProcessor",value:function(){return{get:function(r,o){return"proxyOf"===o?r:r[o]&&("each"===o||"string"==typeof o&&o.startsWith("walk")?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r[o].apply(r,ti(t.map(function(n){return"function"==typeof n?function(e,t){return n(e.toProxy(),t)}:n})))}:"every"===o||"some"===o?function(i){return r[o](function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return i.apply(void 0,[e.toProxy()].concat(n))})}:"root"===o?function(){return r.root().toProxy()}:"nodes"===o?r.nodes.map(function(e){return e.toProxy()}):"first"===o||"last"===o?r[o].toProxy():r[o])},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}},{key:"index",value:function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}},{key:"insertAfter",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o+1,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"insertBefore",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<=(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"normalize",value:function(e,t){var n=this;if("string"==typeof e)e=function t(e){return e.map(function(e){return e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e})}(u(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){var r,i=Ie(e=e.slice(0));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.parent&&o.parent.removeChild(o,"ignore")}}catch(e){i.e(e)}finally{i.f()}}else if("root"===e.type&&"document"!==this.type){var a,s=Ie(e=e.nodes.slice(0));try{for(s.s();!(a=s.n()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}}catch(e){s.e(e)}finally{s.f()}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new p(e)]}else if(e.selector)e=[new c(e)];else if(e.name)e=[new d(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new m(e)]}return e.map(function(e){return e[f]||v.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[h]&&function e(t){if(t[h]=!1,t.proxyOf.nodes){var n,r=Ie(t.proxyOf.nodes);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(e){r.e(e)}finally{r.f()}}}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=n.proxyOf,e})}},{key:"prepend",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Ie(t=t.reverse());try{for(i.s();!(r=i.n()).done;){var o,a,s=r.value,l=this.normalize(s,this.first,"prepend").reverse(),u=Ie(l);try{for(u.s();!(o=u.n()).done;){var c=o.value;this.proxyOf.nodes.unshift(c)}}catch(e){u.e(e)}finally{u.f()}for(a in this.indexes)this.indexes[a]=this.indexes[a]+l.length}}catch(e){i.e(e)}finally{i.f()}return this.markDirty(),this}},{key:"push",value:function(e){return(e.parent=this).proxyOf.nodes.push(e),this}},{key:"removeAll",value:function(){var e,t=Ie(this.proxyOf.nodes);try{for(t.s();!(e=t.n()).done;)e.value.parent=void 0}catch(e){t.e(e)}finally{t.f()}return this.proxyOf.nodes=[],this.markDirty(),this}},{key:"removeChild",value:function(e){var t,n;for(n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}},{key:"replaceValues",value:function(t,n,r){return r||(r=n,n={}),this.walkDecls(function(e){n.props&&!n.props.includes(e.prop)||n.fast&&!e.value.includes(n.fast)||(e.value=e.value.replace(t,r))}),this.markDirty(),this}},{key:"some",value:function(e){return this.nodes.some(e)}},{key:"walk",value:function(r){return this.each(function(t,e){var n;try{n=r(t,e)}catch(e){throw t.addToError(e)}return n=!1!==n&&t.walk?t.walk(r):n})}},{key:"walkAtRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("atrule"===e.type&&n.test(e.name))return r(e,t)}):this.walk(function(e,t){if("atrule"===e.type&&e.name===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("atrule"===e.type)return r(e,t)}))}},{key:"walkComments",value:function(n){return this.walk(function(e,t){if("comment"===e.type)return n(e,t)})}},{key:"walkDecls",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("decl"===e.type&&n.test(e.prop))return r(e,t)}):this.walk(function(e,t){if("decl"===e.type&&e.prop===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("decl"===e.type)return r(e,t)}))}},{key:"walkRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("rule"===e.type&&n.test(e.selector))return r(e,t)}):this.walk(function(e,t){if("rule"===e.type&&e.selector===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("rule"===e.type)return r(e,t)}))}},{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}])).registerParse=function(e){u=e},n.registerRule=function(e){c=e},n.registerAtRule=function(e){d=e},n.registerRoot=function(e){t=e},((Ms=n).default=n).rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,d.prototype):"rule"===e.type?Object.setPrototypeOf(e,c.prototype):"decl"===e.type?Object.setPrototypeOf(e,p.prototype):"comment"===e.type?Object.setPrototypeOf(e,m.prototype):"root"===e.type&&Object.setPrototypeOf(e,t.prototype),e[f]=!0,e.nodes&&e.nodes.forEach(function(e){n.rebuild(e)})}),Ms;function v(){return b(this,v),Wr(this,v,arguments)}}function gl(){var t,n,e;return Ps||(Ps=1,Gr(r,vl()),(e=k(r,[{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},e.registerProcessor=function(e){n=e},(As=e).default=e),As;function r(e){return b(this,r),(e=Wr(this,r,[Ae({type:"document"},e)])).nodes||(e.nodes=[]),e}}function yl(){if(Ls)return Ds;Ls=1;var t={};return Ds=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}}function wl(){var e;return Fs||(Fs=1,e=k(function e(t){var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(n in b(this,e),this.type="warning",this.text=t,r.node&&r.node.source&&(t=r.node.rangeBy(r),this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column),r)this[n]=r[n]},[{key:"toString",value:function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}]),(Ns=e).default=e),Ns}function bl(){var n,e;return zs||(zs=1,n=wl(),e=k(function e(t,n,r){b(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0},[{key:"toString",value:function(){return this.css}},{key:"warn",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin),new n(e,t));return this.messages.push(e),e}},{key:"warnings",value:function(){return this.messages.filter(function(e){return"warning"===e.type})}},{key:"content",get:function(){return this.css}}]),(Us=e).default=e),Us}function kl(){var e,t;return Hs||(Hs=1,Gr(r,e=vl()),t=k(r,[{key:"append",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ei(r,"append",this,3)(t)}},{key:"prepend",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ei(r,"prepend",this,3)(t)}}]),(Ws=t).default=t,e.registerAtRule(t)),Ws;function r(e){return b(this,r),(e=Wr(this,r,[e])).type="atrule",e}}function _l(){var t,n,e,r;return Vs||(Vs=1,Gr(a,e=vl()),(r=k(a,[{key:"normalize",value:function(e,t,n){var r=ei(a,"normalize",this,3)([e]);if(t)if("prepend"===n)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;)i.value.raws.before=t.raws.before}catch(e){o.e(e)}finally{o.f()}}return r}},{key:"removeChild",value:function(e,t){var n=this.index(e);return!t&&0===n&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[n].raws.before),ei(a,"removeChild",this,3)([e])}},{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},r.registerProcessor=function(e){n=e},qs=r,e.registerRoot(r.default=r)),qs;function a(e){return b(this,a),(e=Wr(this,a,[e])).type="root",e.nodes||(e.nodes=[]),e}}function Sl(){var t;return Zs||(Zs=1,(Gs=t={comma:function(e){return t.split(e,[","],!0)},space:function(e){return t.split(e,[" ","\n","\t"])},split:function(e,t,n){var r,i=[],o="",a=!1,s=0,l=!1,u="",c=!1,d=Ie(e);try{for(d.s();!(r=d.n()).done;){var h=r.value;c?c=!1:"\\"===h?c=!0:l?h===u&&(l=!1):'"'===h||"'"===h?(l=!0,u=h):"("===h?s+=1:")"===h?0<s&&--s:0===s&&t.includes(h)&&(a=!0),a?(""!==o&&i.push(o.trim()),o="",a=!1):o+=h}}catch(e){d.e(e)}finally{d.f()}return!n&&""===o||i.push(o.trim()),i}}).default=t),Gs}function El(){var e,t,n;return Ks||(Ks=1,e=vl(),t=Sl(),Gr(r,e),n=k(r,[{key:"selectors",get:function(){return t.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}}]),(Js=n).default=n,e.registerRule(n)),Js;function r(e){return b(this,r),(e=Wr(this,r,[e])).type="rule",e.nodes||(e.nodes=[]),e}}function Cl(){if(Xs)return $s;Xs=1;var p=dl(),e=(()=>{if(js)return Bs;js=1;var w="'".charCodeAt(0),b='"'.charCodeAt(0),k="\\".charCodeAt(0),_="/".charCodeAt(0),S="\n".charCodeAt(0),E=" ".charCodeAt(0),C="\f".charCodeAt(0),R="\t".charCodeAt(0),O="\r".charCodeAt(0),T="[".charCodeAt(0),x="]".charCodeAt(0),M="(".charCodeAt(0),I=")".charCodeAt(0),A="{".charCodeAt(0),P="}".charCodeAt(0),D=";".charCodeAt(0),L="*".charCodeAt(0),N=":".charCodeAt(0),F="@".charCodeAt(0),U=/[\t\n\f\r "#'()/;[\\\]{}]/g,z=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,B=/.[\r\n"'(/\\]/,j=/[\da-f]/i;return Bs=function(t){var r,i,o,a,s,l,u,c,d,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},h=t.css.valueOf(),f=e.ignoreErrors,p=h.length,m=0,v=[],g=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&p<=m},nextToken:function(e){if(g.length)return g.pop();if(!(p<=m)){var t=!!e&&e.ignoreUnclosed;switch(r=h.charCodeAt(m)){case S:case E:case R:case O:case C:for(i=m;i+=1,(r=h.charCodeAt(i))===E||r===S||r===R||r===O||r===C;);d=["space",h.slice(m,i)],m=i-1;break;case T:case x:case A:case P:case N:case D:case I:var n=String.fromCharCode(r);d=[n,n,m];break;case M:if(u=v.length?v.pop()[1]:"",c=h.charCodeAt(m+1),"url"===u&&c!==w&&c!==b&&c!==E&&c!==S&&c!==R&&c!==C&&c!==O){i=m;do{if(s=!1,-1===(i=h.indexOf(")",i+1))){if(f||t){i=m;break}y("bracket")}for(l=i;h.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["brackets",h.slice(m,i+1),m,i],m=i}else i=h.indexOf(")",m+1),u=h.slice(m,i+1),-1===i||B.test(u)?d=["(","(",m]:(d=["brackets",u,m,i],m=i);break;case w:case b:o=r===w?"'":'"',i=m;do{if(s=!1,-1===(i=h.indexOf(o,i+1))){if(f||t){i=m+1;break}y("string")}for(l=i;h.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["string",h.slice(m,i+1),m,i],m=i;break;case F:U.lastIndex=m+1,U.test(h),i=0===U.lastIndex?h.length-1:U.lastIndex-2,d=["at-word",h.slice(m,i+1),m,i],m=i;break;case k:for(i=m,a=!0;h.charCodeAt(i+1)===k;)i+=1,a=!a;if(r=h.charCodeAt(i+1),a&&r!==_&&r!==E&&r!==S&&r!==R&&r!==O&&r!==C&&(i+=1,j.test(h.charAt(i)))){for(;j.test(h.charAt(i+1));)i+=1;h.charCodeAt(i+1)===E&&(i+=1)}d=["word",h.slice(m,i+1),m,i],m=i;break;default:m=(r===_&&h.charCodeAt(m+1)===L?(0===(i=h.indexOf("*/",m+2)+1)&&(f||t?i=h.length:y("comment")),d=["comment",h.slice(m,i+1),m,i]):(z.lastIndex=m+1,z.test(h),i=0===z.lastIndex?h.length-1:z.lastIndex-2,d=["word",h.slice(m,i+1),m,i],v.push(d)),i)}return m++,d}},position:function(){return m}}}})(),n=ml(),u=kl(),r=_l(),i=El(),h={empty:!0,space:!0};return $s=k(function e(t){b(this,e),this.input=t,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}},[{key:"atrule",value:function(e){var t,n,r,i=new u;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,a=!1,s=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(0<s.length){for(n=s[r=s.length-1];n&&"space"===n[0];)n=s[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}}if(s.push(e),this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(i.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(i,"params",s),o&&(e=s[s.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}},{key:"checkMissedSemicolon",value:function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;0<=i&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}}},{key:"colon",value:function(e){var t,n,r,i,o=0,a=Ie(e.entries());try{for(a.s();!(i=a.n()).done;){var s=Pe(i.value,2),l=s[0];if("("===(n=(t=s[1])[0])&&(o+=1),")"===n&&--o,0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}}catch(e){a.e(e)}finally{a.f()}return!1}},{key:"comment",value:function(e){var t=new n,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}},{key:"createTokenizer",value:function(){this.tokenizer=e(this.input)}},{key:"decl",value:function(e,t){var n=new p;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||(e=>{for(var t=e.length-1;0<=t;t--){var n=e[t],n=n[3]||n[2];if(n)return n}})(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var a,s=[];e.length&&("space"===(a=e[0][0])||"comment"===a);)s.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;0<=l;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var u=this.stringFrom(e,l);" !important"!==(u=this.spacesFromEnd(e)+u)&&(n.raws.important=u);break}if("important"===r[1].toLowerCase()){for(var c=e.slice(0),d="",h=l;0<h;h--){var f=c[h][0];if(0===d.trim().indexOf("!")&&"space"!==f)break;d=c.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=c)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=s.map(function(e){return e[1]}).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}},{key:"doubleColon",value:function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}},{key:"emptyRule",value:function(e){var t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}},{key:"end",value:function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}},{key:"endFile",value:function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}},{key:"freeSemicolon",value:function(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}},{key:"getPosition",value:function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}},{key:"init",value:function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}},{key:"other",value:function(e){for(var t,n=!1,r=!1,i=null,o=[],a=e[1].startsWith("--"),s=[],l=e;l;){if(t=l[0],s.push(l),"("===t||"["===t)i=i||l,o.push("("===t?")":"]");else if(a&&r&&"{"===t)i=i||l,o.push("}");else if(0===o.length){if(";"===t){if(r)return void this.decl(s,a);break}if("{"===t)return void this.rule(s);if("}"===t){this.tokenizer.back(s.pop()),n=!0;break}":"===t&&(r=!0)}else t===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),0<o.length&&this.unclosedBracket(i),n&&r){if(!a)for(;s.length&&("space"===(l=s[s.length-1][0])||"comment"===l);)this.tokenizer.back(s.pop());this.decl(s,a)}else this.unknownWord(s)}},{key:"parse",value:function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}},{key:"precheckMissedSemicolon",value:function(){}},{key:"raw",value:function(e,t,n,r){for(var i,o,a,s,l=n.length,u="",c=!0,d=0;d<l;d+=1)"space"===(a=(i=n[d])[0])&&d===l-1&&!r||"comment"===a&&(a=n[d-1]?n[d-1][0]:"empty",o=n[d+1]?n[d+1][0]:"empty",h[a]||h[o]||","===u.slice(-1))?c=!1:u+=i[1];c||(s=n.reduce(function(e,t){return e+t[1]},""),e.raws[t]={raw:s,value:u}),e[t]=u}},{key:"rule",value:function(e){e.pop();var t=new i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"spacesAndCommentsFromEnd",value:function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n}},{key:"spacesAndCommentsFromStart",value:function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n}},{key:"spacesFromEnd",value:function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}},{key:"stringFrom",value:function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}},{key:"unclosedBlock",value:function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}},{key:"unclosedBracket",value:function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}},{key:"unexpectedClose",value:function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}},{key:"unknownWord",value:function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}},{key:"unnamedAtrule",value:function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}])}function Rl(){var e,r,i;return Qs||(Qs=1,e=vl(),r=Cl(),i=fl(),Ys=t,e.registerParse(t.default=t)),Ys;function t(e,t){var n=new i(e,t),n=new r(n);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}}function Ol(){var d,s,n,r,l,e,i,u,c,t,o,h,f,p,a,m;return tl||(tl=1,e=sl(),d=e.isClean,s=e.my,n=pl(),r=ul(),l=vl(),e=gl(),i=yl(),u=bl(),c=Rl(),t=_l(),o={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0},p={},(a=k(function e(t,n,r){var i,o=this;if(b(this,e),this.stringified=!1,this.processed=!1,"object"!==_(n)||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof u)i=w(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var a=c;r.syntax&&(a=r.syntax.parse),(a=r.parser?r.parser:a).parse&&(a=a.parse);try{i=a(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[s]&&l.rebuild(i)}else i=w(n);this.result=new u(t,i,r),this.helpers=Ae(Ae({},p),{},{postcss:p,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===_(e)&&e.prepare?Ae(Ae({},e),e.prepare(o.result)):e})},[{key:"async",value:function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"getAsyncError",value:function(){throw new Error("Use process(css).then(cb) to work with async plugins")}},{key:"handleError",value:function(e,t){var n,r,i,o,a,s=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?s.postcssVersion&&"production"!==process.env.NODE_ENV&&(n=s.postcssPlugin,r=s.postcssVersion,i=this.result.processor.version,o=r.split("."),a=i.split("."),o[0]!==a[0]||parseInt(o[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below."):(e.plugin=s.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}},{key:"prepareVisitors",value:function(){var r=this;this.listeners={};function e(e,t,n){r.listeners[t]||(r.listeners[t]=[]),r.listeners[t].push([e,n])}var t,n=Ie(this.plugins);try{for(n.s();!(t=n.n()).done;){var i=t.value;if("object"===_(i))for(var o in i){if(!h[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event ".concat(o," in ").concat(i.postcssPlugin,". Try to update PostCSS (").concat(this.processor.version," now)."));if(!f[o])if("object"===_(i[o]))for(var a in i[o])e(i,"*"===a?o:o+"-"+a.toLowerCase(),i[o][a]);else"function"==typeof i[o]&&e(i,o,i[o])}}}catch(r){n.e(r)}finally{n.f()}this.hasListener=0<Object.keys(this.listeners).length}},{key:"runAsync",value:(m=jr($r().m(function e(){var t,i,n,r,o,a,s,l,u,c=this;return $r().w(function(e){for(;;)switch(e.p=e.n){case 0:this.plugin=0,t=0;case 1:if(t<this.plugins.length){if(s=this.plugins[t],v(s=this.runOnRoot(s)))return e.p=2,e.n=3,s;e.n=5}else e.n=6;break;case 3:e.n=5;break;case 4:throw e.p=4,s=e.v,this.handleError(s);case 5:t++,e.n=1;break;case 6:if(this.prepareVisitors(),!this.hasListener){e.n=21;break}i=this.result.root;case 7:if(i[d]){e.n=14;break}i[d]=!0,n=[y(i)];case 8:if(0<n.length){if(v(l=this.visitTick(n)))return e.p=9,e.n=10,l;e.n=12}else e.n=13;break;case 10:e.n=12;break;case 11:throw e.p=11,l=e.v,u=n[n.length-1].node,this.handleError(l,u);case 12:e.n=8;break;case 13:e.n=7;break;case 14:if(!this.listeners.OnceExit){e.n=21;break}r=Ie(this.listeners.OnceExit),e.p=15,a=$r().m(function e(){var t,n,r;return $r().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=Pe(o.value,2),r=n[0],t=n[1],c.result.lastPlugin=r,e.p=1,"document"===i.type)return n=i.nodes.map(function(e){return t(e,c.helpers)}),e.n=2,Promise.all(n);e.n=3;break;case 2:e.n=4;break;case 3:return e.n=4,t(i,c.helpers);case 4:e.n=6;break;case 5:throw e.p=5,r=e.v,c.handleError(r);case 6:return e.a(2)}},e,null,[[1,5]])}),r.s();case 16:if((o=r.n()).done){e.n=18;break}return e.d(Yr(a()),17);case 17:e.n=16;break;case 18:e.n=20;break;case 19:e.p=19,u=e.v,r.e(u);case 20:return e.p=20,r.f(),e.f(20);case 21:return this.processed=!0,e.a(2,this.stringify())}},e,this,[[15,19,20,21],[9,11],[2,4]])})),function(){return m.apply(this,arguments)})},{key:"runOnRoot",value:function(t){var e,n=this;this.result.lastPlugin=t;try{return"object"===_(t)&&t.Once?"document"===this.result.root.type?v((e=this.result.root.nodes.map(function(e){return t.Once(e,n.helpers)}))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}},{key:"stringify",value:function(){if(this.error)throw this.error;var e,t;return this.stringified||(this.stringified=!0,this.sync(),t=this.result.opts,e=r,t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify),t=new n(e,this.result.root,this.result.opts).generate(),this.result.css=t[0],this.result.map=t[1]),this.result}},{key:"sync",value:function(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();var e,t=Ie(this.plugins);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(v(this.runOnRoot(n)))throw this.getAsyncError()}}catch(e){t.e(e)}finally{t.f()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[d];)r[d]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type){var i,o=Ie(r.nodes);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.visitSync(this.listeners.OnceExit,a)}}catch(e){o.e(e)}finally{o.f()}}else this.visitSync(this.listeners.OnceExit,r)}}return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this.css}},{key:"visitSync",value:function(e,t){var n,r=Ie(e);try{for(r.s();!(n=r.n()).done;){var i=Pe(n.value,2),o=i[0],a=i[1],s=(this.result.lastPlugin=o,void 0);try{s=a(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(v(s))throw this.getAsyncError()}}catch(e){r.e(e)}finally{r.f()}}},{key:"visitTick",value:function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(0<r.length&&t.visitorIndex<r.length){var i=Pe(r[t.visitorIndex],2),o=i[0],i=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){for(var a,s=t.iterator;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[d])return a[d]=!0,void e.push(y(a));t.iterator=0,delete n.indexes[s]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}},{key:"walkSync",value:function(e){var t=this;e[d]=!0;var n,r=Ie(g(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[d]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}}catch(e){r.e(e)}finally{r.f()}}},{key:"warnings",value:function(){return this.sync().warnings()}},{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}])).registerPostcss=function(e){p=e},el=a,t.registerLazyResult(a.default=a),e.registerLazyResult(a)),el;function v(e){return"object"===_(e)&&"function"==typeof e.then}function g(e){var t=!1,n=o[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function y(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:g(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function w(e){return e[d]=!1,e.nodes&&e.nodes.forEach(w),e}}s||(s=1,Tl=cs(),xl=dl(),Af=Ol(),c=vl(),zh||(zh=1,op||(op=1,Jl=pl(),Kl=ul(),$l=yl(),Xl=Rl(),Yl=bl(),Ql=k(function e(t,n,r){b(this,e),n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;var t=Kl,i=(this.result=new Yl(this._processor,void 0,this._opts),this.result.css=n,this),r=(Object.defineProperty(this.result,"root",{get:function(){return i.root}}),new Jl(t,void 0,this._opts,n));r.isMap()?(n=(t=Pe(r.generate(),2))[0],t=t[1],n&&(this.result.css=n),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)},[{key:"async",value:function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"sync",value:function(){if(this.error)throw this.error;return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||$l("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this._css}},{key:"warnings",value:function(){return[]}},{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=Xl;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),(nl=Ql).default=Ql),ql=nl,Vl=Ol(),Ql=gl(),Gl=_l(),Zl=k(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];b(this,e),this.version="8.4.38",this.plugins=this.normalize(t)},[{key:"normalize",value:function(e){var t,n=[],r=Ie(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===_(i)&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===_(i)&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else{if("object"!==_(i)||!i.parse&&!i.stringify)throw new Error(i+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"process",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Vl:ql)(this,e,t)}},{key:"use",value:function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}]),(rl=Zl).default=Zl,Gl.registerProcessor(Zl),Ql.registerProcessor(Zl)),Ml=rl,Gl=ul(),eu||(eu=1,Fl=dl(),Ul=hl(),zl=ml(),Bl=kl(),jl=fl(),Wl=_l(),Hl=El(),(il=tu).default=tu),Zl=il,Il=gl(),v=wl(),Al=ml(),Pl=kl(),Dl=bl(),y=fl(),i=Rl(),s=Sl(),Ll=El(),Nl=_l(),zh=cl(),a.plugin=function(t,n){var e,r=!1;function i(){console&&console.warn&&!r&&(r=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");var e=n.apply(void 0,arguments);return e.postcssPlugin=t,e.postcssVersion=(new Ml).version,e}return Object.defineProperty(i,"postcss",{get:function(){return e=e||i()}}),i.process=function(e,t,n){return a([i(n)]).process(e,t)},i},a.stringify=Gl,a.parse=i,a.fromJSON=Zl,a.list=s,a.comment=function(e){return new Al(e)},a.atRule=function(e){return new Pl(e)},a.decl=function(e){return new xl(e)},a.rule=function(e){return new Ll(e)},a.root=function(e){return new Nl(e)},a.document=function(e){return new Il(e)},a.CssSyntaxError=Tl,a.Declaration=xl,a.Container=c,a.Processor=Ml,a.Document=Il,a.Comment=Al,a.Warning=v,a.AtRule=Pl,a.Result=Dl,a.Input=y,a.Rule=Ll,a.Root=Nl,a.Node=zh,Af.registerPostcss(a),(ol=a).default=a);var Tl,xl,Ml,Il,Al,Pl,Dl,Ll,Nl,Fl,Ul,zl,Bl,jl,Wl,Hl,ql,Vl,Gl,Zl,Jl,Kl,$l,Xl,Yl,Ql,eu=(op=ol)&&op.__esModule&&Object.prototype.hasOwnProperty.call(op,"default")?op.default:op;function tu(e,t){if(Array.isArray(e))return e.map(function(e){return tu(e)});var n,r=e.inputs,i=Kr(e,li);if(r){t=[];var o,a=Ie(r);try{for(a.s();!(o=a.n()).done;){var s=Ae(Ae({},o.value),{},{__proto__:jl.prototype});s.map&&(s.map=Ae(Ae({},s.map),{},{__proto__:Ul.prototype})),t.push(s)}}catch(e){a.e(e)}finally{a.f()}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return tu(e,t)})),i.source&&(n=(r=i.source).inputId,r=Kr(r,ui),i.source=r,null!=n)&&(i.source.input=t[n]),"root"===i.type)return new Wl(i);if("decl"===i.type)return new Fl(i);if("rule"===i.type)return new Hl(i);if("comment"===i.type)return new zl(i);if("atrule"===i.type)return new Bl(i);throw new Error("Unknown node type: "+e.type)}function a(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new Ml(t)}eu.stringify;var nu=k(su,[{key:"childNodes",get:function(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}},{key:"contains",value:function(e){if(e instanceof su&&e.ownerDocument===this.ownerDocument){if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}}return!1}},{key:"appendChild",value:function(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}},{key:"insertBefore",value:function(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}},{key:"removeChild",value:function(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}},{key:"toString",value:function(){return"RRNode"}}]),ru={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},iu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ou={},au={};function su(){b(this,su),ts(this,"parentElement",null),ts(this,"parentNode",null),ts(this,"ownerDocument"),ts(this,"firstChild",null),ts(this,"lastChild",null),ts(this,"previousSibling",null),ts(this,"nextSibling",null),ts(this,"ELEMENT_NODE",1),ts(this,"TEXT_NODE",3),ts(this,"nodeType"),ts(this,"nodeName"),ts(this,"RRNodeType")}function lu(e){if(ou[e])return ou[e];var t=globalThis[e],n=t.prototype,r=e in ru?ru[e]:void 0,r=Boolean(r&&r.every(function(e){return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(n,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),i=e in iu?iu[e]:void 0,i=Boolean(i&&i.every(function(e){return"function"==typeof n[e]&&(null==(e=n[e])?void 0:e.toString().includes("[native code]"))}));if(r&&i&&!globalThis.Zone)return ou[e]=t.prototype,t.prototype;try{var o,a,s=document.createElement("iframe"),l=(s.style.display="none",document.body.appendChild(s),s.contentWindow);return l?(o=l[e].prototype)?((a=navigator.userAgent).includes("Safari")&&!a.includes("Chrome")?(s.classList.add("rr-block"),s.setAttribute("__rrwebUntaintedMutationObserver",""),au[e]=function(){return s.remove()}):s.remove(),ou[e]=o):(s.remove(),n):t.prototype}catch(e){return n}}var uu={};function cu(e,t,n){var r="".concat(e,".").concat(String(n));return uu[r]?uu[r].call(t):(e=lu(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,n))?void 0:e.get)?(uu[r]=e).call(t):t[n])}var du={};function hu(e,t,n){var r="".concat(e,".").concat(String(n));return du[r]?du[r].bind(t):"function"!=typeof(e=lu(e)[n])?t[n]:(du[r]=e).bind(t)}function fu(){var e;return[lu("MutationObserver").constructor,null!=(e=au.MutationObserver)?e:function(){}]}var pu=Date.now;function mu(e,t,n){try{var r,i;return t in e?("function"==typeof(i=n(r=e[t]))&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}):function(){}}catch(e){return function(){}}}var De={ownerDocument:function(e){return cu("Node",e,"ownerDocument")},childNodes:function(e){return cu("Node",e,"childNodes")},parentNode:function(e){return cu("Node",e,"parentNode")},parentElement:function(e){return cu("Node",e,"parentElement")},textContent:function(e){return cu("Node",e,"textContent")},contains:function(e,t){return hu("Node",e,"contains")(t)},getRootNode:function(e){return hu("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?cu("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?cu("Element",e,"shadowRoot"):null},querySelector:function(e,t){return cu("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return cu("Element",e,"querySelectorAll")(t)},nowTimestamp:pu=/[1-9][0-9]{12}/.test(Date.now().toString())?pu:function(){return(new Date).getTime()},mutationObserverCtor:fu,patch:mu};function vu(e,t,n){var r=2<arguments.length&&void 0!==n?n:document,i={capture:!0,passive:!0};return r.addEventListener(e,t,i),function(){return r.removeEventListener(e,t,i)}}var gu="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",i={map:{},getId:function(){return console.error(gu),-1},getNode:function(){return console.error(gu),null},removeNodeFromMap:function(){console.error(gu)},has:function(){return console.error(gu),!1},reset:function(){console.error(gu)}};function yu(a,s,e){var l=2<arguments.length&&void 0!==e?e:{},u=null,c=0;return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Date.now(),i=(c||!1!==l.leading||(c=r),s-(r-c)),o=this;i<=0||s<i?(u&&(clearTimeout(u),u=null),c=r,a.apply(o,t)):u||!1===l.trailing||(u=setTimeout(function(){c=!1===l.leading?0:Date.now(),u=null,a.apply(o,t)},i))}}function wu(e,t,n,r,i){var i=4<arguments.length&&void 0!==i?i:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return wu(e,t,o||{},!0)}}function bu(e){var t,n=e.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:n.documentElement.scrollLeft||(null==n?void 0:n.body)&&(null==(t=De.parentElement(n.body))?void 0:t.scrollLeft)||(null==(t=null==n?void 0:n.body)?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==n?void 0:n.documentElement.scrollTop)||(null==n?void 0:n.body)&&(null==(t=De.parentElement(n.body))?void 0:t.scrollTop)||(null==(e=null==n?void 0:n.body)?void 0:e.scrollTop)||0}}function ku(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _u(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Su(e){return e?e.nodeType===e.ELEMENT_NODE?e:De.parentElement(e):null}function Eu(e,t,n,r){if(e){var i=Su(e);if(i){try{if("string"==typeof t){if(i.classList.contains(t))return 1;if(r&&null!==i.closest("."+t))return 1}else if(Yi(i,t,r))return 1}catch(e){}if(n){if(i.matches(n))return 1;if(r&&null!==i.closest(n))return 1}}}}function Cu(e,t,n){return"TITLE"===e.tagName&&n.headTitleMutations||-2===t.getId(e)}function Ru(e){return Boolean(e.changedTouches)}function Ou(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Tu(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function xu(e){return e&&(e instanceof nu&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(De.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&new Proxy(i,{get:function(e,t,n){return"map"===t&&console.error(gu),Reflect.get(e,t,n)}});var Mu=k(function e(){b(this,e),u(this,"id",1),u(this,"styleIDMap",new WeakMap),u(this,"idStyleMap",new Map)},[{key:"getId",value:function(e){return null!=(e=this.styleIDMap.get(e))?e:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(t=void 0===t?this.id++:t,this.styleIDMap.set(e,t),this.idStyleMap.set(t,e),t)}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]);function Iu(e){var t,n=null;return n="getRootNode"in e&&(null==(t=De.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&De.host(De.getRootNode(e))?De.host(De.getRootNode(e)):n}function Au(n){var e,t=De.ownerDocument(n);return!!t&&(e=(()=>{for(var e,t=n;e=Iu(t);)t=e;return t})(),De.contains(t,e))}function Pu(e){var t=De.ownerDocument(e);return t&&(De.contains(t,e)||Au(e))}(s={})[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s[s.Asset=7]="Asset";var Y=s,Le=((c=Le||{})[c.Mutation=0]="Mutation",c[c.MouseMove=1]="MouseMove",c[c.MouseInteraction=2]="MouseInteraction",c[c.Scroll=3]="Scroll",c[c.ViewportResize=4]="ViewportResize",c[c.Input=5]="Input",c[c.TouchMove=6]="TouchMove",c[c.MediaInteraction=7]="MediaInteraction",c[c.StyleSheetRule=8]="StyleSheetRule",c[c.CanvasMutation=9]="CanvasMutation",c[c.Font=10]="Font",c[c.Log=11]="Log",c[c.Drag=12]="Drag",c[c.StyleDeclaration=13]="StyleDeclaration",c[c.Selection=14]="Selection",c[c.AdoptedStyleSheet=15]="AdoptedStyleSheet",c[c.CustomElement=16]="CustomElement",c),Du=((v=Du||{})[v.MouseUp=0]="MouseUp",v[v.MouseDown=1]="MouseDown",v[v.Click=2]="Click",v[v.ContextMenu=3]="ContextMenu",v[v.DblClick=4]="DblClick",v[v.Focus=5]="Focus",v[v.Blur=6]="Blur",v[v.TouchStart=7]="TouchStart",v[v.TouchMove_Departed=8]="TouchMove_Departed",v[v.TouchEnd=9]="TouchEnd",v[v.TouchCancel=10]="TouchCancel",v),Lu=((y=Lu||{})[y.Mouse=0]="Mouse",y[y.Pen=1]="Pen",y[y.Touch=2]="Touch",y),Nu=((zh={})[zh["2D"]=0]="2D",zh[zh.WebGL=1]="WebGL",zh[zh.WebGL2=2]="WebGL2",zh),Fu=((Af=Fu||{})[Af.Play=0]="Play",Af[Af.Pause=1]="Pause",Af[Af.Seeked=2]="Seeked",Af[Af.VolumeChange=3]="VolumeChange",Af[Af.RateChange=4]="RateChange",Af),Uu=((op={})[op.Document=0]="Document",op[op.DocumentType=1]="DocumentType",op[op.Element=2]="Element",op[op.Text=3]="Text",op[op.CDATA=4]="CDATA",op[op.Comment=5]="Comment",op);function zu(e){return"__ln"in e}function Bu(e,t){return"".concat(e,"@").concat(t)}var ju,Wu=k(function e(){b(this,e),u(this,"length",0),u(this,"head",null),u(this,"tail",null)},[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t,n={value:e,previous:null,next:null};e.__ln=n,e.previousSibling&&zu(e.previousSibling)?(t=e.previousSibling.__ln.next,n.next=t,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,t&&(t.previous=n)):e.nextSibling&&zu(e.nextSibling)&&e.nextSibling.__ln.previous?(t=e.nextSibling.__ln.previous,n.previous=t,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,t&&(t.next=n)):(this.head&&(this.head.previous=n),n.next=this.head,this.head=n),null===n.next&&(this.tail=n),this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),Hu=k(function e(){var w=this;b(this,e),u(this,"frozen",!1),u(this,"locked",!1),u(this,"texts",[]),u(this,"attributes",[]),u(this,"attributeMap",new WeakMap),u(this,"removes",[]),u(this,"mapRemoves",[]),u(this,"movedMap",{}),u(this,"addedSet",new Set),u(this,"movedSet",new Set),u(this,"droppedSet",new Set),u(this,"removesSubTreeCache",new Set),u(this,"mutationCb"),u(this,"blockClass"),u(this,"blockSelector"),u(this,"maskTextClass"),u(this,"maskTextSelector"),u(this,"inlineStylesheet"),u(this,"maskInputOptions"),u(this,"maskTextFn"),u(this,"maskInputFn"),u(this,"keepIframeSrcFn"),u(this,"recordCanvas"),u(this,"inlineImages"),u(this,"slimDOMOptions"),u(this,"dataURLOptions"),u(this,"doc"),u(this,"mirror"),u(this,"iframeManager"),u(this,"stylesheetManager"),u(this,"shadowDomManager"),u(this,"canvasManager"),u(this,"processedNodeManager"),u(this,"unattachedDoc"),u(this,"processMutations",function(e){e.forEach(w.processMutation),w.emit()}),u(this,"emit",function(){if(!w.frozen&&!w.locked){for(var i=[],o=new Set,a=new Wu,s=function(e){for(var t=e,n=-2;-2===n;)n=(t=t&&t.nextSibling)&&w.mirror.getId(t);return n},e=function(t){var e=De.parentNode(t);if(e&&Pu(t)){var n=!1;if(t.nodeType===Node.TEXT_NODE){var r=e.tagName;if("TEXTAREA"===r)return;"STYLE"===r&&w.addedSet.has(e)&&(n=!0)}r=Ci(e)?w.mirror.getId(Iu(t)):w.mirror.getId(e),e=s(t);if(-1===r||-1===e)return a.addNode(t);n=no(t,{doc:w.doc,mirror:w.mirror,blockClass:w.blockClass,blockSelector:w.blockSelector,maskTextClass:w.maskTextClass,maskTextSelector:w.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:w.inlineStylesheet,maskInputOptions:w.maskInputOptions,maskTextFn:w.maskTextFn,maskInputFn:w.maskInputFn,slimDOMOptions:w.slimDOMOptions,dataURLOptions:w.dataURLOptions,recordCanvas:w.recordCanvas,inlineImages:w.inlineImages,onSerialize:function(e){Ou(e,w.mirror)&&w.iframeManager.addIframe(e),Tu(e,w.mirror)&&w.stylesheetManager.trackLinkElement(e),xu(t)&&w.shadowDomManager.addShadowRoot(De.shadowRoot(t),w.doc)},onIframeLoad:function(e,t){w.iframeManager.attachIframe(e,t),w.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,t){w.stylesheetManager.attachLinkElement(e,t)},cssCaptured:n});n&&(i.push({parentId:r,nextId:e,node:n}),o.add(n.id))}};w.mapRemoves.length;)w.mirror.removeNodeFromMap(w.mapRemoves.shift());var t,n=Ie(w.movedSet);try{for(n.s();!(t=n.n()).done;){var r=t.value;Vu(w.removesSubTreeCache,r,w.mirror)&&!w.movedSet.has(De.parentNode(r))||e(r)}}catch(i){n.e(i)}finally{n.f()}var l,u=Ie(w.addedSet);try{for(u.s();!(l=u.n()).done;){var c=l.value;!Gu(w.droppedSet,c)&&!Vu(w.removesSubTreeCache,c,w.mirror)||Gu(w.movedSet,c)?e(c):w.droppedSet.add(c)}}catch(i){u.e(i)}finally{u.f()}for(var d=null;a.length;){var h,f,p=null;if(!(p=d&&(h=w.mirror.getId(De.parentNode(d.value)),f=s(d.value),-1!==h)&&-1!==f?d:p))for(var m=a.tail;m;){var v=m,m=m.previous;if(v){var g=w.mirror.getId(De.parentNode(v.value));if(-1!==s(v.value)){if(-1!==g){p=v;break}g=v.value,g=De.parentNode(g);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){g=De.host(g);if(-1!==w.mirror.getId(g)){p=v;break}}}}}if(!p){for(;a.head;)a.removeNode(a.head.value);break}d=p.previous,a.removeNode(p.value),e(p.value)}var y={texts:w.texts.map(function(e){var t=e.node,n=De.parentNode(t);return n&&"TEXTAREA"===n.tagName&&w.genTextAreaValueMutation(n),{id:w.mirror.getId(t),value:e.value}}).filter(function(e){return!o.has(e.id)}).filter(function(e){return w.mirror.has(e.id)}),attributes:w.attributes.map(function(e){var t,n,r=e.attributes;return"string"==typeof r.style&&(t=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles),t.length<r.style.length)&&(t+n).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff),{id:w.mirror.getId(e.node),attributes:r}}).filter(function(e){return!o.has(e.id)}).filter(function(e){return w.mirror.has(e.id)}),removes:w.removes,adds:i};(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&(w.texts=[],w.attributes=[],w.attributeMap=new WeakMap,w.removes=[],w.addedSet=new Set,w.movedSet=new Set,w.droppedSet=new Set,w.removesSubTreeCache=new Set,w.movedMap={},w.mutationCb(y))}}),u(this,"genTextAreaValueMutation",function(e){var t=w.attributeMap.get(e),n=(t||(w.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),w.attributeMap.set(e,t)),Array.from(De.childNodes(e),function(e){return De.textContent(e)||""}).join(""));t.attributes.value=Mi({element:e,maskInputOptions:w.maskInputOptions,tagName:e.tagName,type:Ai(e),value:n,maskInputFn:w.maskInputFn})}),u(this,"processMutation",function(a){if(!Cu(a.target,w.mirror,w.slimDOMOptions))switch(a.type){case"characterData":var e=De.textContent(a.target);Eu(a.target,w.blockClass,w.blockSelector,!1)||e===a.oldValue||w.texts.push({value:Qi(a.target,w.maskTextClass,w.maskTextSelector,!0)&&e?w.maskTextFn?w.maskTextFn(e,Su(a.target)):e.replace(/[\S]/g,"*"):e,node:a.target});break;case"attributes":var t,n=a.target,e=a.attributeName,r=a.target.getAttribute(e);if("value"===e&&(t=Ai(n),r=Mi({element:n,maskInputOptions:w.maskInputOptions,tagName:n.tagName,type:t,value:r,maskInputFn:w.maskInputFn})),!Eu(a.target,w.blockClass,w.blockSelector,!1)&&r!==a.oldValue){var i=w.attributeMap.get(a.target);if("IFRAME"===n.tagName&&"src"===e&&!w.keepIframeSrcFn(r)){if(n.contentDocument)return;e="rr_src"}if(i||(i={node:a.target,attributes:{},styleDiff:{},_unchangedStyles:{}},w.attributes.push(i),w.attributeMap.set(a.target,i)),"type"===e&&"INPUT"===n.tagName&&"password"===(a.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Xi(n.tagName,e))if(i.attributes[e]=$i(w.doc,Ii(n.tagName),Ii(e),r),"style"===e){if(!w.unattachedDoc)try{w.unattachedDoc=document.implementation.createHTMLDocument()}catch(a){w.unattachedDoc=w.doc}var o=w.unattachedDoc.createElement("span");a.oldValue&&o.setAttribute("style",a.oldValue);for(var s=0,l=Array.from(n.style);s<l.length;s++){var u=l[s],c=n.style.getPropertyValue(u),d=n.style.getPropertyPriority(u);c!==o.style.getPropertyValue(u)||d!==o.style.getPropertyPriority(u)?i.styleDiff[u]=""===d?c:[c,d]:i._unchangedStyles[u]=[c,d]}for(var h=0,f=Array.from(o.style);h<f.length;h++){var p=f[h];""===n.style.getPropertyValue(p)&&(i.styleDiff[p]=!1)}}else"open"===e&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal")}break;case"childList":return Eu(a.target,w.blockClass,w.blockSelector,!0)?void 0:"TEXTAREA"===a.target.tagName?void w.genTextAreaValueMutation(a.target):(a.addedNodes.forEach(function(e){return w.genAdds(e,a.target)}),void a.removedNodes.forEach(function(e){var t=w.mirror.getId(e),n=Ci(a.target)?w.mirror.getId(De.host(a.target)):w.mirror.getId(a.target);if(!Eu(a.target,w.blockClass,w.blockSelector,!1)&&!Cu(e,w.mirror,w.slimDOMOptions)&&-1!==w.mirror.getId(e)){if(w.addedSet.has(e))qu(w.addedSet,e),w.droppedSet.add(e);else if(!(w.addedSet.has(a.target)&&-1===t||function e(t,n){var r;return!Ci(t)&&(r=n.getId(t),!n.has(r)||(!(r=De.parentNode(t))||r.nodeType!==t.DOCUMENT_NODE)&&(!r||e(r,n)))}(a.target,w.mirror)))if(w.movedSet.has(e)&&w.movedMap[Bu(t,n)])qu(w.movedSet,e);else{w.removes.push({parentId:n,id:t,isShadow:!(!Ci(a.target)||!Ri(a.target))||void 0});for(var r=w.removesSubTreeCache,i=[e];i.length;){var o=i.pop();r.has(o)||(r.add(o),De.childNodes(o).forEach(function(e){return i.push(e)}))}}w.mapRemoves.push(e)}}))}}),u(this,"genAdds",function(t,e){if(!w.processedNodeManager.inOtherBuffer(t,w)&&!w.addedSet.has(t)&&!w.movedSet.has(t)){if(w.mirror.hasNode(t)){if(Cu(t,w.mirror,w.slimDOMOptions))return;w.movedSet.add(t);var n=null;(n=e&&w.mirror.hasNode(e)?w.mirror.getId(e):n)&&-1!==n&&(w.movedMap[Bu(w.mirror.getId(t),n)]=!0)}else w.addedSet.add(t),w.droppedSet.delete(t);Eu(t,w.blockClass,w.blockSelector,!1)||(De.childNodes(t).forEach(function(e){return w.genAdds(e)}),xu(t)&&De.childNodes(De.shadowRoot(t)).forEach(function(e){w.processedNodeManager.add(e,w),w.genAdds(e,t)}))}})},[{key:"init",value:function(t){var n=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(e){n[e]=t[e]})}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]);function qu(t,e){t.delete(e),De.childNodes(e).forEach(function(e){return qu(t,e)})}function Vu(e,t){return 0!==e.size&&(e=e,t=De.parentNode(t))&&e.has(t)}function Gu(e,t){return 0!==e.size&&function e(t,n){n=De.parentNode(n);return!!n&&(!!t.has(n)||e(t,n))}(e,t)}var Ne=function(e){return ju?function(){try{return e.apply(void 0,arguments)}catch(e){if(!ju||!0!==ju(e))throw e}}:e},Zu=[];function Ju(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Ku(e,t){var n=new Hu,e=(Zu.push(n),n.init(e),Pe(fu(),2)),r=e[0],e=e[1],r=new r(Ne(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[r,e]}function $u(e){var t,r,a,s=e.mouseInteractionCb,i=e.doc,l=e.mirror,u=e.blockClass,c=e.blockSelector,e=e.sampling;return!1===e.mouseInteraction?function(){}:(t=!0===e.mouseInteraction||void 0===e.mouseInteraction?{}:e.mouseInteraction,r=[],a=null,Object.keys(Du).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==t[e]}).forEach(function(e){function t(e){var t=Ju(e);if(!Eu(t,u,c,!0)){var n=null,r=o;if("pointerType"in e){switch(e.pointerType){case"mouse":n=Lu.Mouse;break;case"touch":n=Lu.Touch;break;case"pen":n=Lu.Pen}n===Lu.Touch?Du[o]===Du.MouseDown?r="TouchStart":Du[o]===Du.MouseUp&&(r="TouchEnd"):Lu.Pen}else Ru(e)&&(n=Lu.Touch);null!==n?(a=n,(r.startsWith("Touch")&&n===Lu.Touch||r.startsWith("Mouse")&&n===Lu.Mouse)&&(n=null)):Du[o]===Du.Click&&(n=a,a=null);var i,e=Ru(e)?e.changedTouches[0]:e;e&&(t=l.getId(t),i=e.clientX,e=e.clientY,Ne(s)(Ae({type:Du[r],id:t,x:i,y:e},null!==n&&{pointerType:n})))}}var o,n=Ii(e);o=e;if(window.PointerEvent)switch(Du[e]){case Du.MouseDown:case Du.MouseUp:n=n.replace("mouse","pointer");break;case Du.TouchStart:case Du.TouchEnd:return}r.push(vu(n,t,i))}),Ne(function(){r.forEach(function(e){return e()})}))}function Xu(e){var r=e.scrollCb,i=e.doc,o=e.mirror,a=e.blockClass,s=e.blockSelector,e=e.sampling;return vu("scroll",Ne(yu(Ne(function(e){var t,n,e=Ju(e);e&&!Eu(e,a,s,!0)&&(t=o.getId(e),e===i&&i.defaultView?(n=bu(i.defaultView),r({id:t,x:n.left,y:n.top})):r({id:t,x:e.scrollLeft,y:e.scrollTop}))}),e.scroll||100)),i)}var Yu=["INPUT","TEXTAREA","SELECT"],Qu=new WeakMap;function ec(e){return function e(t,n){var r;return ic("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ic("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ic("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ic("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule?(r=Array.from(t.parentRule.cssRules).indexOf(t),n.unshift(r),e(t.parentRule,n)):(t.parentStyleSheet&&(r=Array.from(t.parentStyleSheet.cssRules).indexOf(t),n.unshift(r)),n)}(e,[])}function tc(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function nc(e,t){var n=e.mirror,r=e.stylesheetManager,i="#document"===t.nodeName?n.getId(t):n.getId(De.host(t)),n="#document"===t.nodeName?null==(e=t.defaultView)?void 0:e.Document:null==(e=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:e.ShadowRoot,o=null!=n&&n.prototype?Object.getOwnPropertyDescriptor(null==n?void 0:n.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&n&&o?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:function(){var e;return null==(e=o.get)?void 0:e.call(this)},set:function(e){var t=null==(t=o.set)?void 0:t.call(this,e);if(null!==i&&-1!==i)try{r.adoptStyleSheets(e,i)}catch(e){}return t}}),Ne(function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})})):function(){}}function rc(e){var t,n,L,N,F,U,z,B,j,W,H,q,V,G,r=e.doc.defaultView;if(!r)return function(){};t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=(R=e).mutationCb,L=R.mousemoveCb,N=R.mouseInteractionCb,F=R.scrollCb,U=R.viewportResizeCb,z=R.inputCb,B=R.mediaInteractionCb,j=R.styleSheetRuleCb,W=R.styleDeclarationCb,H=R.canvasMutationCb,q=R.fontCb,V=R.selectionCb,G=R.customElementCb,R.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},R.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),L.apply(void 0,arguments)},R.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),N.apply(void 0,arguments)},R.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),F.apply(void 0,arguments)},R.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),U.apply(void 0,arguments)},R.inputCb=function(){t.input&&t.input.apply(t,arguments),z.apply(void 0,arguments)},R.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),B.apply(void 0,arguments)},R.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),j.apply(void 0,arguments)},R.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),W.apply(void 0,arguments)},R.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),H.apply(void 0,arguments)},R.fontCb=function(){t.font&&t.font.apply(t,arguments),q.apply(void 0,arguments)},R.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),V.apply(void 0,arguments)},R.customElementCb=function(){t.customElement&&t.customElement.apply(t,arguments),G.apply(void 0,arguments)};var i,Z,J,K,$,X,Y,Q,a,ee,te,ne,re,s,l,ie,u,o,c,oe,d,h,f,p,ae,se,le,ue,m,v,g,ce,y,w,b,k,_,S,E,C,de=function(){},he=(e.recordDOM&&(R=Pe(Ku(e,e.doc),2),i=R[0],de=R[1]),le=(R=e).mousemoveCb,T=R.doc,ue=R.mirror,!1===(O=R.sampling).mousemove?function(){}:(R="number"==typeof O.mousemove?O.mousemove:50,O="number"==typeof O.mousemoveCallback?O.mousemoveCallback:500,p=[],ae=yu(Ne(function(e){var t=Date.now()-f;le(p.map(function(e){return e.timeOffset-=t,e}),e),p=[],f=null}),O),O=Ne(yu(Ne(function(e){var t=Ju(e),n=Ru(e)?e.changedTouches[0]:e,r=n.clientX,n=n.clientY;f=f||pu(),p.push({x:r,y:n,id:ue.getId(t),timeOffset:pu()-f}),ae("undefined"!=typeof DragEvent&&e instanceof DragEvent?Le.Drag:e instanceof MouseEvent?Le.MouseMove:Le.TouchMove)}),R,{trailing:!1})),se=[vu("mousemove",O,T),vu("touchmove",O,T),vu("drag",O,T)],Ne(function(){se.forEach(function(e){return e()})}))),fe=$u(e),pe=Xu(e),me=(R={win:r},oe=(O=e).viewportResizeCb,O=R.win,h=d=-1,vu("resize",Ne(yu(Ne(function(){var e=ku(),t=_u();d===e&&h===t||(oe({width:Number(t),height:Number(e)}),d=e,h=t)}),200)),O)),ve=(Q=(T=e).inputCb,a=T.doc,ee=T.mirror,te=T.blockClass,ne=T.blockSelector,re=T.ignoreClass,s=T.ignoreSelector,l=T.maskInputOptions,ie=T.maskInputFn,u=T.userTriggeredOnInput,o=("last"===T.sampling.input?["change"]:["input","change"]).map(function(e){return vu(e,Ne(_e),a)}),(c=a.defaultView)?(T=c.Object.getOwnPropertyDescriptor(c.HTMLInputElement.prototype,"value"),R=[[c.HTMLInputElement.prototype,"value"],[c.HTMLInputElement.prototype,"checked"],[c.HTMLSelectElement.prototype,"value"],[c.HTMLTextAreaElement.prototype,"value"],[c.HTMLSelectElement.prototype,"selectedIndex"],[c.HTMLOptionElement.prototype,"selected"]],T&&T.set&&o.push.apply(o,ti(R.map(function(e){return wu(e[0],e[1],{set:function(){Ne(_e)({target:this,isTrusted:!1})}},!1,c)}))),Ne(function(){o.forEach(function(e){return e()})})):function(){o.forEach(function(e){return e()})}),ge=(Z=(O=e).mediaInteractionCb,J=O.blockClass,K=O.blockSelector,$=O.mirror,X=O.sampling,O=O.doc,T=Ne(function(a){return yu(Ne(function(e){var t,n,r,i,o,e=Ju(e);e&&!Eu(e,J,K,!0)&&(t=e.currentTime,n=e.volume,r=e.muted,i=e.playbackRate,o=e.loop,Z({type:a,id:$.getId(e),currentTime:t,volume:n,muted:r,playbackRate:i,loop:o}))}),X.media||500)}),Y=[vu("play",T(Fu.Play),O),vu("pause",T(Fu.Pause),O),vu("seeked",T(Fu.Seeked),O),vu("volumechange",T(Fu.VolumeChange),O),vu("ratechange",T(Fu.RateChange),O)],Ne(function(){Y.forEach(function(e){return e()})})),ye=function(){},we=function(){},be=function(){},ke=function(){};function _e(e){var t,n,r,i=Ju(e),e=e.isTrusted,o=i&&i.tagName;!(i=i&&"OPTION"===o?De.parentElement(i):i)||!o||Yu.indexOf(o)<0||Eu(i,te,ne,!0)||i.classList.contains(re)||s&&i.matches(s)||(t=i.value,n=!1,"radio"===(r=Ai(i)||"")||"checkbox"===r?n=i.checked:(l[o.toLowerCase()]||l[r])&&(t=Mi({element:i,maskInputOptions:l,tagName:o,type:r,value:t,maskInputFn:ie})),Se(i,u?{text:t,isChecked:n,userTriggered:e}:{text:t,isChecked:n}),o=i.name,"radio"===r&&o&&n&&a.querySelectorAll('input[type="radio"][name="'.concat(o,'"]')).forEach(function(e){var t;e!==i&&(t=e.value,Se(e,u?{text:t,isChecked:!n,userTriggered:!1}:{text:t,isChecked:!n}))}))}function Se(e,t){var n=Qu.get(e);n&&n.text===t.text&&n.isChecked===t.isChecked||(Qu.set(e,t),n=ee.getId(e),Ne(Q)(Ae(Ae({},t),{},{id:n})))}e.recordDOM&&(ye=((e,t)=>{var s=e.styleSheetRuleCb,l=e.mirror,u=e.stylesheetManager,r=t.win;if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return function(){};var n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:Ne(function(e,t,n){var r=Pe(n,2),i=r[0],r=r[1],o=tc(t,l,u.styleMirror),a=o.id,o=o.styleId;return(a&&-1!==a||o&&-1!==o)&&s({id:a,styleId:o,adds:[{rule:i,index:r}]}),e.apply(t,n)})}),r.CSSStyleSheet.prototype.addRule=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.cssRules.length,e="".concat(e," { ").concat(t," }");return r.CSSStyleSheet.prototype.insertRule.apply(this,[e,n])};var i,o,a=r.CSSStyleSheet.prototype.deleteRule,c=(r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=tc(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,removes:[{index:r}]}),e.apply(t,n)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=tc(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,replace:r}),e.apply(t,n)})})),r.CSSStyleSheet.prototype.replaceSync&&(o=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(o,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=tc(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,replaceSync:r}),e.apply(t,n)})})),{}),d=(oc("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(oc("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),oc("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),oc("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule)),{});return Object.entries(c).forEach(function(e){var e=Pe(e,2),t=e[0],e=e[1];d[t]={insertRule:e.prototype.insertRule,deleteRule:e.prototype.deleteRule},e.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ne(function(e,t,n){var r=Pe(n,2),i=r[0],r=r[1],o=tc(t.parentStyleSheet,l,u.styleMirror),a=o.id,o=o.styleId;return(a&&-1!==a||o&&-1!==o)&&s({id:a,styleId:o,adds:[{rule:i,index:[].concat(ti(ec(t)),[r||0])}]}),e.apply(t,n)})}),e.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=tc(t.parentStyleSheet,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,removes:[{index:[].concat(ti(ec(t)),[r])}]}),e.apply(t,n)})})}),Ne(function(){r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=a,i&&(r.CSSStyleSheet.prototype.replace=i),o&&(r.CSSStyleSheet.prototype.replaceSync=o),Object.entries(c).forEach(function(e){var e=Pe(e,2),t=e[0],e=e[1];e.prototype.insertRule=d[t].insertRule,e.prototype.deleteRule=d[t].deleteRule})})})(e,{win:r}),we=nc(e,e.doc),R={win:r},w=(T=e).styleDeclarationCb,b=T.mirror,k=T.ignoreCSSAttributes,_=T.stylesheetManager,S=R.win,E=S.CSSStyleDeclaration.prototype.setProperty,S.CSSStyleDeclaration.prototype.setProperty=new Proxy(E,{apply:Ne(function(e,t,n){var r,i,o=Pe(n,3),a=o[0],s=o[1],o=o[2];return k.has(a)?E.apply(t,[a,s,o]):(r=(i=tc(null==(i=t.parentRule)?void 0:i.parentStyleSheet,b,_.styleMirror)).id,i=i.styleId,(r&&-1!==r||i&&-1!==i)&&w({id:r,styleId:i,set:{property:a,value:s,priority:o},index:ec(t.parentRule)}),e.apply(t,n))})}),C=S.CSSStyleDeclaration.prototype.removeProperty,S.CSSStyleDeclaration.prototype.removeProperty=new Proxy(C,{apply:Ne(function(e,t,n){var r,i,o=Pe(n,1)[0];return k.has(o)?C.apply(t,[o]):(r=(i=tc(null==(i=t.parentRule)?void 0:i.parentStyleSheet,b,_.styleMirror)).id,i=i.styleId,(r&&-1!==r||i&&-1!==i)&&w({id:r,styleId:i,remove:{property:o},index:ec(t.parentRule)}),e.apply(t,n))})}),be=Ne(function(){S.CSSStyleDeclaration.prototype.setProperty=E,S.CSSStyleDeclaration.prototype.removeProperty=C}),e.collectFonts)&&(ce=(O=e).fontCb,y=(O=O.doc).defaultView,ke=y?(m=[],v=new WeakMap,g=y.FontFace,y.FontFace=function(e,t,n){var r=new g(e,t,n);return v.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r},O=mu(O.fonts,"add",function(e){return function(t){return setTimeout(Ne(function(){var e=v.get(t);e&&(ce(e),v.delete(t))}),0),e.apply(this,[t])}}),m.push(function(){y.FontFace=g}),m.push(O),Ne(function(){m.forEach(function(e){return e()})})):function(){});Re=(T=e).doc,x=T.mirror,M=T.blockClass,I=T.blockSelector,Oe=T.selectionCb,A=!0,(T=Ne(function(){var e=Re.getSelection();if(!(!e||A&&null!=e&&e.isCollapsed)){A=e.isCollapsed||!1;for(var t=[],n=e.rangeCount||0,r=0;r<n;r++){var i=e.getRangeAt(r),o=i.startContainer,a=i.startOffset,s=i.endContainer,i=i.endOffset;Eu(o,M,I,!0)||Eu(s,M,I,!0)||t.push({start:x.getId(o),startOffset:a,end:x.getId(s),endOffset:i})}Oe({ranges:t})}}))();var Ee,R,O,Ce,T,Re,x,M,I,Oe,A,Te=vu("selectionchange",T),xe=(O=(R=e).doc,Ce=R.customElementCb,(R=O.defaultView)&&R.customElements?mu(R.customElements,"define",function(r){return function(t,e,n){try{Ce({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return r.apply(this,[t,e,n])}}):function(){}),Me=[],P=Ie(e.plugins);try{for(P.s();!(Ee=P.n()).done;){var D=Ee.value;Me.push(D.observer(D.callback,r,D.options))}}catch(e){P.e(e)}finally{P.f()}return Ne(function(){Zu.forEach(function(e){return e.reset()}),null!=i&&i.disconnect(),de(),he(),fe(),pe(),me(),ve(),ge(),ye(),we(),be(),ke(),Te(),xe(),Me.forEach(function(e){return e()})})}function ic(e){return void 0!==window[e]}function oc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var ac=k(function e(t){b(this,e),u(this,"iframeIdToRemoteIdMap",new WeakMap),u(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t},[{key:"getId",value:function(e,t,n,r){n=n||this.getIdToRemoteIdMap(e),r=r||this.getRemoteIdToIdMap(e),e=n.get(t);return e||(e=this.generateIdFn(),n.set(t,e),r.set(e,t)),e}},{key:"getIds",value:function(t,e){var n=this,r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map(function(e){return n.getId(t,e,r,i)})}},{key:"getRemoteId",value:function(e,t,n){n=n||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:n.get(t)||-1}},{key:"getRemoteIds",value:function(t,e){var n=this,r=this.getRemoteIdToIdMap(t);return e.map(function(e){return n.getRemoteId(t,e,r)})}},{key:"reset",value:function(e){e?(this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)):(this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),sc=k(function e(t){b(this,e),u(this,"iframes",new WeakMap),u(this,"crossOriginIframeMap",new WeakMap),u(this,"crossOriginIframeMirror",new ac(qi)),u(this,"crossOriginIframeStyleMirror"),u(this,"crossOriginIframeRootIdMap",new WeakMap),u(this,"mirror"),u(this,"mutationCb"),u(this,"wrappedEmit"),u(this,"loadListener"),u(this,"stylesheetManager"),u(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ac(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))},[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&null!=(t=e.contentWindow)&&t.addEventListener("message",this.handleMessage.bind(this)),null!=(t=this.loadListener)&&t.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&0<e.contentDocument.adoptedStyleSheets.length&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;"rrweb"===t.data.type&&t.origin===t.data.origin&&e.source&&(e=this.crossOriginIframeMap.get(e.source))&&(e=this.transformCrossOriginEvent(e,t.data.event))&&this.wrappedEmit(e,t.data.isCheckout)}},{key:"transformCrossOriginEvent",value:function(n,e){var t,r=this;switch(e.type){case Y.FullSnapshot:this.crossOriginIframeMirror.reset(n),this.crossOriginIframeStyleMirror.reset(n),this.replaceIdOnNode(e.data.node,n);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(n,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Y.IncrementalSnapshot,data:{source:Le.Mutation,adds:[{parentId:this.mirror.getId(n),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Y.Meta:case Y.Load:case Y.DomContentLoaded:return!1;case Y.Plugin:return e;case Y.Custom:return this.replaceIds(e.data.payload,n,["id","parentId","previousId","nextId"]),e;case Y.IncrementalSnapshot:switch(e.data.source){case Le.Mutation:return e.data.adds.forEach(function(e){r.replaceIds(e,n,["parentId","nextId","previousId"]),r.replaceIdOnNode(e.node,n);var t=r.crossOriginIframeRootIdMap.get(n);t&&r.patchRootIdOnNode(e.node,t)}),e.data.removes.forEach(function(e){r.replaceIds(e,n,["parentId","id"])}),e.data.attributes.forEach(function(e){r.replaceIds(e,n,["id"])}),e.data.texts.forEach(function(e){r.replaceIds(e,n,["id"])}),e;case Le.Drag:case Le.TouchMove:case Le.MouseMove:return e.data.positions.forEach(function(e){r.replaceIds(e,n,["id"])}),e;case Le.ViewportResize:return!1;case Le.MediaInteraction:case Le.MouseInteraction:case Le.Scroll:case Le.CanvasMutation:case Le.Input:return this.replaceIds(e.data,n,["id"]),e;case Le.StyleSheetRule:case Le.StyleDeclaration:return this.replaceIds(e.data,n,["id"]),this.replaceStyleIds(e.data,n,["styleId"]),e;case Le.Font:return e;case Le.Selection:return e.data.ranges.forEach(function(e){r.replaceIds(e,n,["start","end"])}),e;case Le.AdoptedStyleSheet:return this.replaceIds(e.data,n,["id"]),this.replaceStyleIds(e.data,n,["styleIds"]),null!=(t=e.data.styles)&&t.forEach(function(e){r.replaceStyleIds(e,n,["styleId"])}),e}}return!1}},{key:"replace",value:function(e,t,n,r){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;!Array.isArray(t[a])&&"number"!=typeof t[a]||(Array.isArray(t[a])?t[a]=e.getIds(n,t[a]):t[a]=e.getId(n,t[a]))}}catch(e){o.e(e)}finally{o.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(function(e){n.replaceIdOnNode(e,t)})}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===Uu.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(function(e){n.patchRootIdOnNode(e,t)})}}]),lc=k(function e(t){b(this,e),u(this,"shadowDoms",new WeakSet),u(this,"mutationCb"),u(this,"scrollCb"),u(this,"bypassOptions"),u(this,"mirror"),u(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()},[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n,r=this;Ri(e)&&!this.shadowDoms.has(e)&&(this.shadowDoms.add(e),n=Pe(Ku(Ae(Ae({},this.bypassOptions),{},{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),1)[0],this.restoreHandlers.push(function(){return n.disconnect()}),this.restoreHandlers.push(Xu(Ae(Ae({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(function(){e.adoptedStyleSheets&&0<e.adoptedStyleSheets.length&&r.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,r.mirror.getId(De.host(e))),r.restoreHandlers.push(nc({mirror:r.mirror,stylesheetManager:r.bypassOptions.stylesheetManager},e))},0))}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,r){var i=this;this.restoreHandlers.push(mu(e.prototype,"attachShadow",function(n){return function(e){var e=n.call(this,e),t=De.shadowRoot(this);return t&&Pu(this)&&i.addShadowRoot(t,r),e}}))}},{key:"reset",value:function(){this.restoreHandlers.forEach(function(e){try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),uc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),dc=0;dc<uc.length;dc++)cc[uc.charCodeAt(dc)]=dc;var hc=new Map,fc=function(e,t,n){var r;if(e&&(vc(e,t)||"object"===_(e)))return t=n,n=e.constructor.name,(r=hc.get(t))||(r=new Map,hc.set(t,r)),r.has(n)||r.set(n,[]),-1===(r=(t=r.get(n)).indexOf(e))&&(r=t.length,t.push(e)),r};function pc(i,t,n){return i instanceof Array?i.map(function(e){return pc(e,t,n)}):null===i?i:i instanceof Float32Array||i instanceof Float64Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Uint8Array||i instanceof Uint16Array||i instanceof Int16Array||i instanceof Int8Array||i instanceof Uint8ClampedArray?{rr_type:i.constructor.name,args:[Object.values(i)]}:i instanceof ArrayBuffer?{rr_type:i.constructor.name,base64:(()=>{for(var e=new Uint8Array(i),t=e.length,n="",r=0;r<t;r+=3)n=(n=(n=(n+=uc[e[r]>>2])+uc[(3&e[r])<<4|e[r+1]>>4])+uc[(15&e[r+1])<<2|e[r+2]>>6])+uc[63&e[r+2]];return t%3==2?n=n.substring(0,n.length-1)+"=":t%3==1&&(n=n.substring(0,n.length-2)+"=="),n})()}:i instanceof DataView?{rr_type:i.constructor.name,args:[pc(i.buffer,t,n),i.byteOffset,i.byteLength]}:i instanceof HTMLImageElement?{rr_type:i.constructor.name,src:i.src}:i instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:i.toDataURL()}:i instanceof ImageData?{rr_type:i.constructor.name,args:[pc(i.data,t,n),i.width,i.height]}:vc(i,t)||"object"===_(i)?{rr_type:i.constructor.name,index:fc(i,t,n)}:i}function mc(e,t,n){return e.map(function(e){return pc(e,t,n)})}var vc=function(t,n){var e=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(function(e){return"function"==typeof n[e]});return Boolean(e.find(function(e){return t instanceof n[e]}))};function gc(e,a,s,l){var t=[];try{var n=mu(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(e){for(var t,n=arguments.length,r=new Array(1<n?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Eu(this,a,s,!0)||(t="experimental-webgl"===(t=e)?"webgl":t,"__context"in this||(this.__context=t),l&&["webgl","webgl2"].includes(t)&&(r[0]&&"object"===_(r[0])?(t=r[0]).preserveDrawingBuffer||(t.preserveDrawingBuffer=!0):r.splice(0,1,{preserveDrawingBuffer:!0}))),o.apply(this,[e].concat(r))}});t.push(n)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){t.forEach(function(e){return e()})}}function yc(n,s,l,u,c,d){var e,r=[],t=Ie(Object.getOwnPropertyNames(n));try{for(t.s();!(e=t.n()).done;)(()=>{var a=e.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return;try{if("function"!=typeof n[a])return;var t=mu(n,a,function(o){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=o.apply(this,t);return fc(i,d,this),"tagName"in this.canvas&&!Eu(this.canvas,u,c,!0)&&(r=mc(t,d,this),l(this.canvas,{type:s,property:a,args:r})),i}});r.push(t)}catch(e){t=wu(n,a,{set:function(e){l(this.canvas,{type:s,property:a,args:[e],setter:!0})}});r.push(t)}})()}catch(n){t.e(n)}finally{t.f()}return r}var wc='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',bc="undefined"!=typeof self&&self.Blob&&new Blob([wc],{type:"text/javascript;charset=utf-8"});function kc(e){var t,n;try{if(t=bc&&(self.URL||self.webkitURL).createObjectURL(bc))return(n=new Worker(t,{name:null==e?void 0:e.name})).addEventListener("error",function(){(self.URL||self.webkitURL).revokeObjectURL(t)}),n;throw""}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(wc),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Q,_c,Sc,Ec=k(function e(t){var n=this,r=(b(this,e),u(this,"pendingCanvasMutations",new Map),u(this,"rafStamps",{latestId:0,invokeId:null}),u(this,"mirror"),u(this,"mutationCb"),u(this,"resetObservers"),u(this,"frozen",!1),u(this,"locked",!1),u(this,"processMutation",function(e,t){(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId||!n.rafStamps.invokeId)&&(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)}),t.sampling),r=void 0===r?"all":r,i=t.win,o=t.blockClass,a=t.blockSelector,s=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===r&&this.initCanvasMutationObserver(i,o,a),s&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,o,a,{dataURLOptions:l})},[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,r,i,o,a){var s=this,t=gc(r,i,o,!0),l=new Map,u=new kc;u.onmessage=function(e){var t,n=e.data.id;l.set(n,!1),"base64"in e.data&&(t=(e=e.data).base64,s.mutationCb({id:n,type:Nu["2D"],commands:[{property:"clearRect",args:[0,0,e.width,e.height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:t}],type:e.type}]},0,0]}]}))};var c=1e3/e,d=0,h=function(e){var t,n;f=(d&&e-d<c||(d=e,t=[],r.document.querySelectorAll("canvas").forEach(function(e){Eu(e,i,o,!0)||t.push(e)}),t.forEach((n=jr($r().m(function e(t){var n,r,i;return $r().w(function(e){for(;;)switch(e.n){case 0:if(n=s.mirror.getId(t),l.get(n))return e.a(2);e.n=1;break;case 1:if(0===t.width||0===t.height)return e.a(2);e.n=2;break;case 2:return l.set(n,!0),["webgl","webgl2"].includes(t.__context)&&(r=t.getContext(t.__context),!1===(null==(i=null==r?void 0:r.getContextAttributes())?void 0:i.preserveDrawingBuffer))&&r.clear(r.COLOR_BUFFER_BIT),e.n=3,createImageBitmap(t);case 3:i=e.v,u.postMessage({id:n,bitmap:i,width:t.width,height:t.height,dataURLOptions:a.dataURLOptions},[i]);case 4:return e.a(2)}},e)})),function(e){return n.apply(this,arguments)}))),requestAnimationFrame(h))},f=requestAnimationFrame(h);this.resetObservers=function(){t(),cancelAnimationFrame(f)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r,i,o=gc(e,t,n,!1),a=((a,s,l,u)=>{var e,n=[],t=Ie(Object.getOwnPropertyNames(s.CanvasRenderingContext2D.prototype));try{for(t.s();!(e=t.n()).done;)(()=>{var o=e.value;try{if("function"!=typeof s.CanvasRenderingContext2D.prototype[o])return;var t=mu(s.CanvasRenderingContext2D.prototype,o,function(i){return function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Eu(this.canvas,l,u,!0)||setTimeout(function(){var e=mc(n,s,t);a(t.canvas,{type:Nu["2D"],property:o,args:e})},0),i.apply(this,n)}});n.push(t)}catch(e){t=wu(s.CanvasRenderingContext2D.prototype,o,{set:function(e){a(this.canvas,{type:Nu["2D"],property:o,args:[e],setter:!0})}});n.push(t)}})()}catch(a){t.e(a)}finally{t.f()}return function(){n.forEach(function(e){return e()})}})(this.processMutation.bind(this),e,t,n),s=(r=this.processMutation.bind(this),t=t,n=n,i=[],void 0!==(e=e).WebGLRenderingContext&&i.push.apply(i,ti(yc(e.WebGLRenderingContext.prototype,Nu.WebGL,r,t,n,e))),void 0!==e.WebGL2RenderingContext&&i.push.apply(i,ti(yc(e.WebGL2RenderingContext.prototype,Nu.WebGL2,r,t,n,e))),function(){i.forEach(function(e){return e()})});this.resetObservers=function(){o(),a(),s()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})}},{key:"startRAFTimestamping",value:function(){function t(e){n.rafStamps.latestId=e,requestAnimationFrame(t)}var n=this;requestAnimationFrame(t)}},{key:"flushPendingCanvasMutations",value:function(){var r=this;this.pendingCanvasMutations.forEach(function(e,t){var n=r.mirror.getId(t);r.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(function(){return r.flushPendingCanvasMutations()})}},{key:"flushPendingCanvasMutationFor",value:function(e,t){var n,r;this.frozen||this.locked||(r=this.pendingCanvasMutations.get(e))&&-1!==t&&(n=r.map(function(e){return e.type,Kr(e,ci)}),r=r[0].type,this.mutationCb({id:t,type:r,commands:n}),this.pendingCanvasMutations.delete(e))}}]),Cc=k(function e(t){b(this,e),u(this,"trackedLinkElements",new WeakSet),u(this,"mutationCb"),u(this,"adoptedStyleSheetCb"),u(this,"styleMirror",new Mu),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb},[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){var r=this;if(0!==e.length){var i,o={id:t,styleIds:[]},a=[],n=Ie(e);try{for(n.s();!(i=n.n()).done;)(()=>{var e,n=i.value;r.styleMirror.has(n)?e=r.styleMirror.getId(n):(e=r.styleMirror.add(n),a.push({styleId:e,rules:Array.from(n.rules||CSSRule,function(e,t){return{rule:Ti(e,n.href),index:t}})})),o.styleIds.push(e)})()}catch(e){n.e(e)}finally{n.f()}0<a.length&&(o.styles=a),this.adoptedStyleSheetCb(o)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),Rc=k(function e(){b(this,e),u(this,"nodeMap",new WeakMap),u(this,"active",!1)},[{key:"inOtherBuffer",value:function(e,t){e=this.nodeMap.get(e);return e&&Array.from(e).some(function(e){return e!==t})}},{key:"add",value:function(e,t){var n=this;this.active||(this.active=!0,requestAnimationFrame(function(){n.nodeMap=new WeakMap,n.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"destroy",value:function(){}}]),Oc=!1;try{2!==Array.from([1],function(e){return 2*e})[0]&&(hp=document.createElement("iframe"),document.body.appendChild(hp),Array.from=(null==(up=hp.contentWindow)?void 0:up.Array.from)||Array.from,document.body.removeChild(hp))}catch(vd){console.debug("Unable to override Array.from",vd)}var Tc=new xi;function xc(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=e.emit,i=e.checkoutEveryNms,o=e.checkoutEveryNth,t=e.blockClass,l=void 0===t?"rr-block":t,t=e.blockSelector,u=void 0===t?null:t,t=e.ignoreClass,L=void 0===t?"rr-ignore":t,t=e.ignoreSelector,N=void 0===t?null:t,t=e.maskTextClass,c=void 0===t?"rr-mask":t,t=e.maskTextSelector,d=void 0===t?null:t,t=e.inlineStylesheet,h=void 0===t||t,t=e.maskAllInputs,n=e.maskInputOptions,F=e.slimDOMOptions,f=e.maskInputFn,p=e.maskTextFn,U=e.hooks,z=e.packFn,a=e.sampling,s=void 0===a?{}:a,a=e.dataURLOptions,m=void 0===a?{}:a,a=e.mousemoveWait,v=e.recordDOM,B=void 0===v||v,v=e.recordCanvas,g=void 0!==v&&v,v=e.recordCrossOriginIframes,v=void 0!==v&&v,y=e.recordAfter,j=void 0===y?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":y,y=e.userTriggeredOnInput,W=void 0!==y&&y,y=e.collectFonts,H=void 0!==y&&y,y=e.inlineImages,w=void 0!==y&&y,b=e.plugins,y=e.keepIframeSrcFn,k=void 0===y?function(){return!1}:y,y=e.ignoreCSSAttributes,q=void 0===y?new Set([]):y,_=(ju=e.errorHandler,!v||window.parent===window),S=!1;if(!_)try{window.parent.document&&(S=!1)}catch(e){S=!0}if(_&&!r)throw new Error("emit function is required");if(!_&&!S)return function(){};void 0!==a&&void 0===s.mousemove&&(s.mousemove=a),Tc.reset();var V,E=!0===t?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==n?n:{password:!0},C=to(F),R=(!function(e){"NodeList"in(e=0<arguments.length&&void 0!==e?e:window)&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}(),0),G=function(e){var t,n=Ie(b||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return e=z&&!S?z(e):e};Q=function(e,t){var n;e.timestamp=pu(),null==(n=Zu[0])||!n.isFrozen()||e.type===Y.FullSnapshot||e.type===Y.IncrementalSnapshot&&e.data.source===Le.Mutation||Zu.forEach(function(e){return e.unfreeze()}),_?null!=r&&r(G(e),t):S&&(n={type:"rrweb",event:G(e),origin:window.location.origin,isCheckout:t},window.parent.postMessage(n,"*")),e.type===Y.FullSnapshot?(V=e,R=0):e.type!==Y.IncrementalSnapshot||e.data.source===Le.Mutation&&e.data.isAttachIframe||(R++,t=o&&o<=R,n=i&&e.timestamp-V.timestamp>i,(t||n)&&_c(!0))};function O(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.Mutation},e)})}function Z(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.Scroll},e)})}function J(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.CanvasMutation},e)})}var K,T=new Cc({mutationCb:O,adoptedStyleSheetCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.AdoptedStyleSheet},e)})}}),x=new sc({mirror:Tc,mutationCb:O,stylesheetManager:T,recordCrossOriginIframes:v,wrappedEmit:Q}),M=Ie(b||[]);try{for(M.s();!(K=M.n()).done;){var $=K.value;$.getMirror&&$.getMirror({nodeMirror:Tc,crossOriginIframeMirror:x.crossOriginIframeMirror,crossOriginIframeStyleMirror:x.crossOriginIframeStyleMirror})}}catch(e){M.e(e)}finally{M.f()}var I=new Rc,A=(Sc=new Ec({recordCanvas:g,mutationCb:J,win:window,blockClass:l,blockSelector:u,mirror:Tc,sampling:s.canvas,dataURLOptions:m}),new lc({mutationCb:O,scrollCb:Z,bypassOptions:{blockClass:l,blockSelector:u,maskTextClass:c,maskTextSelector:d,inlineStylesheet:h,maskInputOptions:E,dataURLOptions:m,maskTextFn:p,maskInputFn:f,recordCanvas:g,inlineImages:w,sampling:s,slimDOMOptions:C,iframeManager:x,stylesheetManager:T,canvasManager:Sc,keepIframeSrcFn:k,processedNodeManager:I},mirror:Tc}));_c=function(){var e,t,n,r,i,o,a=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(B){Q({type:Y.Meta,data:{href:window.location.href,width:_u(),height:ku()}},a),T.reset(),A.init(),Zu.forEach(function(e){return e.lock()});s=document,r=void 0===(r=(e={mirror:Tc,blockClass:l,blockSelector:u,maskTextClass:c,maskTextSelector:d,inlineStylesheet:h,maskAllInputs:E,maskTextFn:p,maskInputFn:f,slimDOM:C,dataURLOptions:m,recordCanvas:g,inlineImages:w,onSerialize:function(e){Ou(e,Tc)&&x.addIframe(e),Tu(e,Tc)&&T.trackLinkElement(e),xu(e)&&A.addShadowRoot(De.shadowRoot(e),document)},onIframeLoad:function(e,t){x.attachIframe(e,t),A.observeAttachShadow(e)},onStylesheetLoad:function(e,t){T.attachLinkElement(e,t)},keepIframeSrcFn:k}).mirror)?new xi:r,t=e.inlineImages,n=e.recordCanvas,i=e.slimDOM,o=e.keepIframeSrcFn;var s=no(s,{doc:s,mirror:r,blockClass:void 0===(s=e.blockClass)?"rr-block":s,blockSelector:void 0===(r=e.blockSelector)?null:r,maskTextClass:void 0===(s=e.maskTextClass)?"rr-mask":s,maskTextSelector:void 0===(r=e.maskTextSelector)?null:r,skipChild:!1,inlineStylesheet:void 0===(s=e.inlineStylesheet)||s,maskInputOptions:!0===(r=void 0!==(r=e.maskAllInputs)&&r)?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===r?{password:!0}:r,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:to(void 0!==i&&i),dataURLOptions:e.dataURLOptions,inlineImages:void 0!==t&&t,recordCanvas:void 0!==n&&n,preserveWhiteSpace:e.preserveWhiteSpace,onSerialize:e.onSerialize,onIframeLoad:e.onIframeLoad,iframeLoadTimeout:e.iframeLoadTimeout,onStylesheetLoad:e.onStylesheetLoad,stylesheetLoadTimeout:e.stylesheetLoadTimeout,keepIframeSrcFn:void 0===o?function(){return!1}:o,newlyAddedElement:!1});if(!s)return console.warn("Failed to snapshot the document");Q({type:Y.FullSnapshot,data:{node:s,initialOffset:bu(window)}},a),Zu.forEach(function(e){return e.unlock()}),document.adoptedStyleSheets&&0<document.adoptedStyleSheets.length&&T.adoptStyleSheets(document.adoptedStyleSheets,Tc.getId(document))}};try{var P=[],X=function(e){return Ne(rc)({mutationCb:O,mousemoveCb:function(e,t){return Q({type:Y.IncrementalSnapshot,data:{source:t,positions:e}})},mouseInteractionCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.MouseInteraction},e)})},scrollCb:Z,viewportResizeCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.ViewportResize},e)})},inputCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.Input},e)})},mediaInteractionCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.MediaInteraction},e)})},styleSheetRuleCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.StyleSheetRule},e)})},styleDeclarationCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.StyleDeclaration},e)})},canvasMutationCb:J,fontCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.Font},e)})},selectionCb:function(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.Selection},e)})},customElementCb:function(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.CustomElement},e)})},blockClass:l,ignoreClass:L,ignoreSelector:N,maskTextClass:c,maskTextSelector:d,maskInputOptions:E,inlineStylesheet:h,sampling:s,recordDOM:B,recordCanvas:g,inlineImages:w,userTriggeredOnInput:W,collectFonts:H,doc:e,maskInputFn:f,maskTextFn:p,keepIframeSrcFn:k,blockSelector:u,slimDOMOptions:C,dataURLOptions:m,mirror:Tc,iframeManager:x,stylesheetManager:T,shadowDomManager:A,processedNodeManager:I,canvasManager:Sc,ignoreCSSAttributes:q,plugins:(null==(e=null==b?void 0:b.filter(function(e){return e.observer}))?void 0:e.map(function(t){return{observer:t.observer,options:t.options,callback:function(e){return Q({type:Y.Plugin,data:{plugin:t.name,payload:e}})}}}))||[]},U)},D=(x.addLoadListener(function(e){try{P.push(X(e.contentDocument))}catch(e){console.warn(e)}}),function(){_c(),P.push(X(document)),Oc=!0});return["interactive","complete"].includes(document.readyState)?D():(P.push(vu("DOMContentLoaded",function(){Q({type:Y.DomContentLoaded,data:{}}),"DOMContentLoaded"===j&&D()})),P.push(vu("load",function(){Q({type:Y.Load,data:{}}),"load"===j&&D()},window))),function(){P.forEach(function(e){try{e()}catch(e){String(e).toLowerCase().includes("cross-origin")||console.warn(e)}}),I.destroy(),Oc=!1,ju=void 0}}catch(e){console.warn(e)}}xc.addCustomEvent=function(e,t){if(!Oc)throw new Error("please add custom event after start recording");Q({type:Y.Custom,data:{tag:e,payload:t}})},xc.freezePage=function(){Zu.forEach(function(e){return e.freeze()})},xc.takeFullSnapshot=function(e){if(!Oc)throw new Error("please take full snapshot after start recording");_c(e)},xc.mirror=Tc;var Mc='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Ic={maskAllText:!0,maskAllInputs:!0,blockAllMedia:!0,autoDetectSensitiveData:!0,mask:[".tdem-mask","[data-tdem-mask]","[data-sensitive]",".sensitive",".private"],block:[".tdem-block","[data-tdem-block]",".secret","[data-secret]","iframe[srcdoc]:not([src])",".replayer-wrapper"],ignore:[".tdem-ignore","[data-tdem-ignore]",'input[type="file"]','input[type="password"]'],maskInputOptions:{password:!0,email:!0,tel:!0,text:!1}},Ac=(Pc.maskPhone=function(e){return e.replace(this.phoneRegex,function(e){var t=e.replace(/[^\d]/g,"");return 11===t.length?e.substring(0,3)+"****"+e.substring(7):13===t.length?e.substring(0,6)+"****"+e.substring(10):e.substring(0,3)+"****"+e.substring(e.length-4)})},Pc.maskIdCard=function(e){return e.replace(this.idCardRegex,function(e){return 18===e.length?e.substring(0,6)+"********"+e.substring(14):15===e.length?e.substring(0,6)+"******"+e.substring(12):e})},Pc.maskEmail=function(e){return e.replace(this.emailRegex,function(e){var t,n=e.indexOf("@");return n<=1?"*"+e.substring(1):(t=e.substring(0,n),e=e.substring(n),t.charAt(0)+"***"+t.charAt(t.length-1)+e)})},Pc.maskBankCard=function(e){return e.replace(this.bankCardRegex,function(e){var t=e.replace(/[^\d]/g,"");return t.length<13?e:t.substring(0,4)+" **** **** "+t.substring(t.length-4)})},Pc.maskIP=function(e){return e.replace(this.ipv4Regex,function(e){e=e.split(".");return e[0]+".*.*."+e[3]})},Pc.autoMask=function(e){var t;return e&&"string"==typeof e?(t=this.maskPhone(t=e),t=this.maskIdCard(t),t=this.maskEmail(t),this.maskBankCard(t)):e},Pc.hasSensitiveData=function(e){return!(!e||"string"!=typeof e)&&(this.phoneRegex.test(e)||this.idCardRegex.test(e)||this.emailRegex.test(e)||this.bankCardRegex.test(e))},Pc.phoneRegex=/1[3-9]\d{9}|(?:\+?86)?1[3-9]\d{9}/g,Pc.idCardRegex=/[1-9]\d{5}(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dXx]|[1-9]\d{7}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}/g,Pc.emailRegex=/[\w.-]+@[\w.-]+\.\w{2,}/g,Pc.bankCardRegex=/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{1,7}\b/g,Pc.ipv4Regex=/\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b/g,Pc);function Pc(){}function Dc(e,t){return void 0===e&&(e={}),x(x(x({},t=void 0===t?Ic:t),e),{mask:Lc(t.mask,e.mask),block:Lc(t.block,e.block),ignore:Lc(t.ignore,e.ignore),maskInputOptions:x(x({},t.maskInputOptions),e.maskInputOptions)})}function Lc(e,t){e=new Set(g(e||[],t||[]));return Array.from(e)}jc.prototype.push=function(e,t){if(this.emitFn=t,3===e.type&&this.isMutationEvent(e)){var n=e.data;if(this.buffer){if(this.enableRepeatDetection&&this.isRepeatPattern(n)){if(this.repeatCount++,3<this.repeatCount)return this.buffer=this.cloneEvent(e),void this.droppedByRepeat++}else this.repeatCount=0;this.mergeInto(n,e.timestamp),this.mergedCount++,(null!=(n=null==(n=this.buffer.data.adds)?void 0:n.length)?n:0)>=this.maxAddsPerMerge&&this.flush()}else this.buffer=this.cloneEvent(e),this.scheduleFlush()}else this.flush(),t(e)},jc.prototype.flush=function(){this.clearTimer(),this.buffer&&this.emitFn&&(this.emitFn(this.buffer),this.buffer=null,this.repeatCount=0)},jc.prototype.destroy=function(){this.flush(),this.clearTimer(),this.emitFn=null},jc.prototype.getStats=function(){return{mergedCount:this.mergedCount,droppedByRepeat:this.droppedByRepeat,cancelledByOffset:this.cancelledByOffset}},jc.prototype.isMutationEvent=function(e){return 0===(null==(e=e.data)?void 0:e.source)},jc.prototype.isRepeatPattern=function(e){var t;return!!this.buffer&&(t=null!=(t=this.buffer.data.adds)?t:[],e=null!=(e=e.adds)?e:[],0!==t.length)&&0!==e.length&&t.length===e.length&&(null==(t=t[0])?void 0:t.parentId)===(null==(t=e[0])?void 0:t.parentId)},jc.prototype.mergeInto=function(e,t){var n,r,i,o;if(this.buffer){var a=this.buffer.data;this.buffer.timestamp=Math.max(this.buffer.timestamp,t);for(var s=this,l=0,u=null!=(t=e.removes)?t:[];l<u.length;l++)(t=>{var e=(null!=(n=a.adds)?n:[]).findIndex(function(e){return(null==(e=e.node)?void 0:e.id)===t.id});0<=e?(a.adds.splice(e,1),s.cancelledByOffset++):(a.removes=null!=(n=a.removes)?n:[],a.removes.push(t))})(u[l]);for(var c=0,d=null!=(t=e.adds)?t:[];c<d.length;c++){var h=d[c];a.adds=null!=(r=a.adds)?r:[],a.adds.push(h)}for(var f=0,p=null!=(t=e.attributes)?t:[];f<p.length;f++)(t=>{a.attributes=null!=(i=a.attributes)?i:[];var e=a.attributes.findIndex(function(e){return e.id===t.id});0<=e?a.attributes[e]=t:a.attributes.push(t)})(p[f]);for(var m=0,v=null!=(t=e.texts)?t:[];m<v.length;m++)(t=>{a.texts=null!=(o=a.texts)?o:[];var e=a.texts.findIndex(function(e){return e.id===t.id});0<=e?a.texts[e]=t:a.texts.push(t)})(v[m])}},jc.prototype.cloneEvent=function(e){var t=e.data;return{type:e.type,timestamp:e.timestamp,data:{source:0,adds:g(null!=(e=t.adds)?e:[]),removes:g(null!=(e=t.removes)?e:[]),attributes:g(null!=(e=t.attributes)?e:[]),texts:g(null!=(e=t.texts)?e:[])}}},jc.prototype.scheduleFlush=function(){var e=this;this.clearTimer(),this.flushTimer=setTimeout(function(){e.flushTimer=null,e.flush()},this.windowMs)},jc.prototype.clearTimer=function(){null!==this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null)};var Nc=jc,Fc=(Bc.prototype.startRecording=function(e){var r,i,n=this;if(void 0===e&&(e={}),"recording"!==this.state){this.mutationLimitReached=!1,this.throttleCount=0,this.throttleWindowStart=Date.now(),this.throttleNotified=!1,this.mutationAddsInWindow=0;var t="buffer"===this.options.mode?12e4:3e5,t="number"==typeof e.checkoutEveryNms&&0<e.checkoutEveryNms?e.checkoutEveryNms:t,o="number"==typeof e.checkoutEveryNth&&0<e.checkoutEveryNth?e.checkoutEveryNth:void 0,a=Dc(e.privacy||{},Ic),s=x(x(x(x({emit:function(e,t){n.handleEvent(e,t)},checkoutEveryNms:t},o?{checkoutEveryNth:o}:{}),{sampling:{scroll:150,mousemove:!l.ios()&&50,mouseInteraction:!0,input:"last"},slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:!0}}),(t={},void 0!==(o=a).maskAllInputs&&(t.maskAllInputs=o.maskAllInputs),o.maskInputOptions&&(t.maskInputOptions=o.maskInputOptions),null!=(s=o.mask)&&s.length&&(t.maskTextSelector=o.mask.join(",")),null!=(s=o.block)&&s.length&&(t.blockSelector=o.block.join(",")),o.blockAllMedia&&(t.blockSelector=t.blockSelector?t.blockSelector+","+Mc:Mc,t.ignoreCSSAttributes=new Set(["background-image"])),null!=(s=o.ignore)&&s.length&&(t.ignoreSelector=o.ignore.join(",")),!o.maskTextFn&&!1===o.autoDetectSensitiveData||(t.maskTextFn=(r=o.maskTextFn,i=!1!==o.autoDetectSensitiveData,function(e,t){var n;return e&&(n=e,i&&(n=Ac.autoMask(n)),r?r(n,t):n)})),t)),e.rrwebConfig);try{this.hookMutationObserver(),this.stopRecordingFn=xc(s),this.state="recording",this.lastCheckoutTime=Date.now(),this.startCheckpointTimer(),f("RecorderManager","Recording started with config:",{maskAllText:a.maskAllText,maskAllInputs:a.maskAllInputs,autoDetectSensitiveData:a.autoDetectSensitiveData,mutationLimit:this.mutationLimit,checkpointIntervalMs:12e4})}catch(e){Ir("RecorderManager","Failed to start recording:",e),this.state="stopped"}}else Mr("RecorderManager","Already recording")},Bc.prototype.stopRecording=function(){var e;this.stopCheckpointTimer(),null!=(e=this.mutationMerger)&&e.destroy(),this.unhookMutationObserver(),this.stopRecordingFn&&(this.stopRecordingFn(),this.stopRecordingFn=void 0),this.state="stopped",f("RecorderManager","Recording stopped")},Bc.prototype.pauseRecording=function(){"recording"===this.state&&(this.stopRecording(),this.state="paused",f("RecorderManager","Recording paused"))},Bc.prototype.resumeRecording=function(e){void 0===e&&(e={}),"paused"===this.state&&(this.startRecording(e),f("RecorderManager","Recording resumed"))},Bc.prototype.hookMutationObserver=function(){try{var r,e,t=window.MutationObserver;t&&(r=this,(e=function(n){return new t(function(e,t){r.unhookMutationObserver(),r.onMutationHandler(e)&&n(e,t)})}).prototype=t.prototype,window.MutationObserver=e,this.restoreMutationObserver=function(){window.MutationObserver=t},xr("RecorderManager","MutationObserver hooked"))}catch(t){Mr("RecorderManager","Failed to hook MutationObserver:",t)}},Bc.prototype.unhookMutationObserver=function(){this.restoreMutationObserver&&(this.restoreMutationObserver(),this.restoreMutationObserver=null,xr("RecorderManager","MutationObserver restored"))},Bc.prototype.onMutationHandler=function(e){var t,n=this;return!this.mutationLimitReached&&(t=(e=e.length)>this.mutationLimit,(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(this.mutationLimitReached=!0,Ir("RecorderManager","Mutation limit reached: "+e+" > "+this.mutationLimit+". Stopping."),setTimeout(function(){var e,t;null!=(t=(e=n.options).onMutationLimitReached)&&t.call(e),n.stopRecording()},0),!1))},Bc.prototype.checkMutationLimit=function(e){var n=this;if(this.mutationLimitReached)return!1;if(3!==e.type)return!0;e=e.data;if(0!==(null==e?void 0:e.source))return!0;e=Array.isArray(e.adds)?e.adds.length:0;if(0===e)return!0;this.mutationAddsInWindow+=e;var t=e>this.mutationLimit||this.mutationAddsInWindow>2*this.mutationLimit;return(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(Ir("RecorderManager","Mutation limit: "+e+" adds (window: "+this.mutationAddsInWindow+"). Stopping."),this.mutationLimitReached=!0,setTimeout(function(){var e,t;null!=(t=(e=n.options).onMutationLimitReached)&&t.call(e),n.stopRecording()},0),!1)},Bc.prototype.emitMutationBreadcrumb=function(e,t){var n;try{null!=(n=xc.addCustomEvent)&&n.call(xc,"replay.mutations",{count:e,limit:t,timestamp:Date.now()})}catch(e){}},Bc.prototype.handleEvent=function(e,t){var n=this,r=(t&&(null!=(i=(r=this.options).onCheckout)&&i.call(r),this.lastCheckoutTime=Date.now(),null!=(i=this.mutationMerger))&&i.flush(),e.type);if(t||2===r||4===r||r<=1||this.checkEventThrottle()){if(3===r&&!this.mutationLimitReached){var i=Date.now();if(12e4<=i-this.lastCheckoutTime){this.lastCheckoutTime=i;try{var o=xc.takeFullSnapshot;"function"==typeof o&&(o(!0),xr("RecorderManager","Inline checkpoint: forced FullSnapshot"))}catch(e){Mr("RecorderManager","Inline checkpoint failed:",e)}}}this.checkMutationLimit(e)&&(this.mutationMerger?this.mutationMerger.push(e,function(e){n.options.onRecordingEvent(e)}):this.options.onRecordingEvent(e))}},Bc.prototype.checkEventThrottle=function(){var e,t=Date.now();if(5e3<t-this.throttleWindowStart&&(this.throttleCount=0,this.throttleWindowStart=t,this.throttleNotified=!1,this.mutationAddsInWindow=0),this.throttleCount++,300<this.throttleCount){if(!this.throttleNotified){this.throttleNotified=!0,Mr("RecorderManager","Event throttled: "+this.throttleCount+" events in 5000ms window");try{null!=(e=xc.addCustomEvent)&&e.call(xc,"replay.throttled",{count:this.throttleCount,window:5e3})}catch(e){}}return!1}return!0},Bc.prototype.startCheckpointTimer=function(){var t=this;this.stopCheckpointTimer(),this.checkpointTimer=setInterval(function(){if("recording"===t.state&&!t.mutationLimitReached)try{var e=xc.takeFullSnapshot;"function"==typeof e&&(e(!0),t.lastCheckoutTime=Date.now(),xr("RecorderManager","Checkpoint: forced FullSnapshot"))}catch(e){Mr("RecorderManager","Checkpoint FullSnapshot failed:",e)}},12e4)},Bc.prototype.stopCheckpointTimer=function(){null!==this.checkpointTimer&&(clearInterval(this.checkpointTimer),this.checkpointTimer=null)},Bc.prototype.getState=function(){return this.state},Bc.prototype.isRecording=function(){return"recording"===this.state},Bc.prototype.getLastCheckoutTime=function(){return this.lastCheckoutTime},Bc.prototype.takeFullSnapshot=function(){var e,t;"recording"===this.state&&this.stopRecordingFn&&(null!=(t=null==(e=this.stopRecordingFn)?void 0:e.takeFullSnapshot)&&t.call(e),this.lastCheckoutTime=Date.now())},Bc.prototype.isMutationLimitReached=function(){return this.mutationLimitReached},Bc),Uc=(zc.prototype.initializeSampling=function(){return null!==this.samplingDecision?{mode:this.currentMode,shouldRecord:!1!==this.currentMode}:Math.random()<this.config.sessionSampleRate?(this.currentMode="session",this.samplingDecision=!0,f("SamplerManager","Sampled: session mode"),{mode:"session",shouldRecord:!0}):0<this.config.errorSampleRate?(this.currentMode="buffer",this.samplingDecision=!0,f("SamplerManager","Sampled: buffer mode"),{mode:"buffer",shouldRecord:!0}):(this.currentMode=!1,this.samplingDecision=!1,f("SamplerManager","Not sampled"),{mode:!1,shouldRecord:!1})},zc.prototype.decideSamplingMode=function(){return this.initializeSampling().mode},zc.prototype.onErrorOccurred=function(e){return"buffer"===this.currentMode&&!this.hasUpgraded&&!!(Math.random()<this.config.errorSampleRate)&&(this.switchMode("session"),this.hasUpgraded=!0)},zc.prototype.switchMode=function(e){var t=this.currentMode;this.currentMode=e,this.samplingDecision=!1!==e,f("SamplerManager","Mode switched: "+t+" -> "+e)},zc.prototype.getCurrentMode=function(){return this.currentMode},zc.prototype.isSampled=function(){return!0===this.samplingDecision},zc.prototype.isSessionMode=function(){return"session"===this.currentMode},zc.prototype.isBufferMode=function(){return"buffer"===this.currentMode},zc.prototype.upgradeToSessionMode=function(){return"buffer"===this.currentMode&&Math.random()<this.config.errorSampleRate&&(this.currentMode="session",f("SamplerManager","Upgraded to session mode due to error"),!0)},zc.prototype.updateRates=function(e,t){"number"==typeof e&&(this.config.sessionSampleRate=e),"number"==typeof t&&(this.config.errorSampleRate=t)},zc.prototype.forceMode=function(e){this.currentMode=e,this.samplingDecision=!1!==e},zc.prototype.reset=function(){this.currentMode=!1,this.samplingDecision=null},zc.prototype.getConfig=function(){return x({},this.config)},zc);function zc(e){var t;void 0===e&&(e={}),this.currentMode=!1,this.samplingDecision=null,this.hasUpgraded=!1,this.config={sessionSampleRate:null!=(t=e.sessionSampleRate)?t:.1,errorSampleRate:null!=(t=e.errorSampleRate)?t:1}}function Bc(e,t){this.state="stopped",this.lastCheckoutTime=0,this.checkpointTimer=null,this.mutationLimitReached=!1,this.mutationMerger=null,this.mutationBreadcrumbLimit=750,this.mutationLimit=1e4,this.restoreMutationObserver=null,this.throttleCount=0,this.throttleWindowStart=0,this.throttleNotified=!1,this.mutationAddsInWindow=0,this.options=e,this.mutationBreadcrumbLimit=null!=(e=null==t?void 0:t.mutationBreadcrumbLimit)?e:750,this.mutationLimit=null!=(e=null==t?void 0:t.mutationLimit)?e:1e4,null!=t&&t.enableMutationMerge&&(this.mutationMerger=new Nc({windowMs:null!=(e=null==t?void 0:t.mutationMergeWindowMs)?e:200,maxAddsPerMerge:500,enableRepeatDetection:!0}))}function jc(e){var t;this.buffer=null,this.flushTimer=null,this.repeatCount=0,this.emitFn=null,this.mergedCount=0,this.droppedByRepeat=0,this.cancelledByOffset=0,this.windowMs=null!=(t=null==e?void 0:e.windowMs)?t:200,this.maxAddsPerMerge=null!=(t=null==e?void 0:e.maxAddsPerMerge)?t:500,this.enableRepeatDetection=null==(t=null==e?void 0:e.enableRepeatDetection)||t}function Wc(e){for(var t=e.length;0<=--t;)e[t]=0}var Hc=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]),qc=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]),Vc=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Gc=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Zc=new Array(576),Jc=(Wc(Zc),new Array(60)),Kc=(Wc(Jc),new Array(512)),$c=(Wc(Kc),new Array(256)),Xc=(Wc($c),new Array(29));Wc(Xc);var Yc,Qc,ed,td=new Array(30);function nd(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function rd(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Wc(td);function id(e){return e<256?Kc[e]:Kc[256+(e>>>7)]}function od(e,t,n){Rd(e,n[2*t],n[2*t+1])}function ad(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function sd(e,t,n){for(var r,i=new Array(16),o=0,a=1;a<=15;a++)o=o+n[a-1]<<1,i[a]=o;for(r=0;r<=t;r++){var s=e[2*r+1];0!==s&&(e[2*r]=ad(i[s]++,s))}}function ld(e){for(var 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}function ud(e){8<e.bi_valid?Cd(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function cd(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&Od(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Od(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function dd(e,t,n){var r,i,o,a,s=0;if(0!==e.sym_next)for(;r=255&e.pending_buf[e.sym_buf+s++],r+=(255&e.pending_buf[e.sym_buf+s++])<<8,i=e.pending_buf[e.sym_buf+s++],0==r?od(e,i,t):(o=$c[i],od(e,o+256+1,t),0!==(a=Hc[o])&&(i-=Xc[o],Rd(e,i,a)),o=id(--r),od(e,o,n),0!==(a=qc[o])&&(r-=td[o],Rd(e,r,a))),s<e.sym_next;);od(e,256,t)}function hd(e,t){var n,r,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<l;n++)0!==o[2*n]?(e.heap[++e.heap_len]=u=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=u,n=e.heap_len>>1;1<=n;n--)cd(e,o,n);for(i=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],cd(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,cd(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1];for(var c,d,h,f,p,m=e,v=t.dyn_tree,g=t.max_code,y=t.stat_desc.static_tree,w=t.stat_desc.has_stree,b=t.stat_desc.extra_bits,k=t.stat_desc.extra_base,_=t.stat_desc.max_length,S=0,E=0;E<=15;E++)m.bl_count[E]=0;for(v[2*m.heap[m.heap_max]+1]=0,c=m.heap_max+1;c<573;c++)(E=v[2*v[2*(d=m.heap[c])+1]+1]+1)>_&&(E=_,S++),v[2*d+1]=E,g<d||(m.bl_count[E]++,f=0,k<=d&&(f=b[d-k]),p=v[2*d],m.opt_len+=p*(E+f),w&&(m.static_len+=p*(y[2*d+1]+f)));if(0!==S){do{for(E=_-1;0===m.bl_count[E];)E--}while(m.bl_count[E]--,m.bl_count[E+1]+=2,m.bl_count[_]--,0<(S-=2));for(E=_;0!==E;E--)for(d=m.bl_count[E];0!==d;)(h=m.heap[--c])>g||(v[2*h+1]!==E&&(m.opt_len+=(E-v[2*h+1])*v[2*h],v[2*h+1]=E),d--)}sd(o,u,e.bl_count)}function fd(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<l&&i===a||(s<u?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=i,u=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4))}function pd(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<l&&i===a)){if(s<u)for(;od(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(od(e,i,e.bl_tree),s--),od(e,16,e.bl_tree),Rd(e,s-3,2)):s<=10?(od(e,17,e.bl_tree),Rd(e,s-3,3)):(od(e,18,e.bl_tree),Rd(e,s-11,7));o=i,u=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4)}}function md(e,t,n,r){Rd(e,0+(r?1:0),3),ud(e),Cd(e,n),Cd(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n}function vd(e,t){return e.msg=Ad[t],t}function gd(e){return 2*e-(4<e?9:0)}function yd(e,t){Ld(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,oh(e.strm)}function h(e,t){e.pending_buf[e.pending++]=t}function wd(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function bd(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,l=e.w_size-262<e.strstart?e.strstart-(e.w_size-262):0,u=e.window,c=e.w_mask,d=e.prev,h=e.strstart+258,f=u[o+a-1],p=u[o+a];e.good_match<=e.prev_length&&(i>>=2),e.lookahead<s&&(s=e.lookahead);do{if(u[(n=t)+a]===p&&u[n+a-1]===f&&u[n]===u[o]&&u[++n]===u[o+1]){for(o+=2,n++;u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<h;);if(r=258-(h-o),o=h-258,a<r){if(e.match_start=t,s<=(a=r))break;f=u[o+a-1],p=u[o+a]}}}while((t=d[t&c])>l&&0!=--i);return a<=e.lookahead?a:e.lookahead}function kd(e){var t,n,r=e.w_size;do{if(t=e.window_size-e.lookahead-e.strstart,r+(r-262)<=e.strstart&&(e.window.set(e.window.subarray(r,r+r-t),0),e.match_start-=r,e.strstart-=r,e.block_start-=r,e.strstart<e.insert&&(e.insert=e.strstart),nh(e),t+=r),0===e.strm.avail_in)break;if(t=ah(e.strm,e.window,e.strstart+e.lookahead,t),e.lookahead+=t,e.legacy_hash){if(3<=e.lookahead+e.insert)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=rh(e,e.ins_h,e.window[n+1]);e.insert&&(ih(e,n),n++,e.insert--,!(e.lookahead+e.insert<3)););}else if(3<e.lookahead+e.insert)for(n=e.strstart-e.insert;e.insert&&(ih(e,n),n++,e.insert--,!(e.lookahead+e.insert<=3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function _d(e,t){for(var n,r,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,s=e.strm.avail_in;n=65535,i=e.bi_valid+42>>3,!(e.strm.avail_out<i||(n=(i=e.strm.avail_out-i)<(n=n>(r=e.strstart-e.block_start)+e.strm.avail_in?r+e.strm.avail_in:n)?i:n)<o&&(0===n&&t!==jd||t===Ud||n!==r+e.strm.avail_in)||(a=t===jd&&n===r+e.strm.avail_in?1:0,Dd(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,oh(e.strm),r&&(n<r&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(ah(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),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.strstart<e.insert)&&(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+=e.w_size-e.insert<s?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==Ud&&t!==jd&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&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++,i+=e.w_size,e.strstart<e.insert)&&(e.insert=e.strstart),(i=i>e.strm.avail_in?e.strm.avail_in:i)&&(ah(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=e.w_size-e.insert<i?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),o=(i=65535<e.pending_buf_size-(i=e.bi_valid+42>>3)?65535:e.pending_buf_size-i)>e.w_size?e.w_size:i,((r=e.strstart-e.block_start)>=o||(r||t===jd)&&t!==Ud&&0===e.strm.avail_in&&r<=i)&&(n=i<r?i:r,a=t===jd&&0===e.strm.avail_in&&n===r?1:0,Dd(e,e.block_start,n,a),e.block_start+=n,oh(e.strm)),a?3:1)}function Sd(e,t){for(var n,r;;){if(e.lookahead<262){if(kd(e),e.lookahead<262&&t===Ud)return 1;if(0===e.lookahead)break}if((n=0)!==(n=3<=e.lookahead?ih(e,e.strstart):n)&&e.strstart-n<=e.w_size-262&&(e.match_length=bd(e,n)),3<=e.match_length)if(r=Nd(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&3<=e.lookahead){for(e.match_length--;e.strstart++,n=ih(e,e.strstart),0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=rh(e,e.ins_h,e.window[e.strstart+1]));else r=Nd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(yd(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===jd?(yd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(yd(e,!1),0===e.strm.avail_out)?1:2}function Ed(e,t){for(var n,r,i;;){if(e.lookahead<262){if(kd(e),e.lookahead<262&&t===Ud)return 1;if(0===e.lookahead)break}if(n=0,3<=e.lookahead&&(n=ih(e,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=bd(e,n),e.match_length<=5)&&(e.strategy===Kd||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2),3<=e.prev_length&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,r=Nd(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(n=ih(e,e.strstart)),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(yd(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=Nd(e,0,e.window[e.strstart-1]))&&yd(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&&(r=Nd(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===jd?(yd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(yd(e,!1),0===e.strm.avail_out)?1:2}var Cd=function(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Rd=function(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,Cd(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)},Od=function(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},Td=!1,eu=function(e){if(!Td){for(var t,n,r,i=new Array(16),o=0,a=0;a<28;a++)for(Xc[a]=o,t=0;t<1<<Hc[a];t++)$c[o++]=a;for($c[o-1]=a,a=r=0;a<16;a++)for(td[a]=r,t=0;t<1<<qc[a];t++)Kc[r++]=a;for(r>>=7;a<30;a++)for(td[a]=r<<7,t=0;t<1<<qc[a]-7;t++)Kc[256+r++]=a;for(n=0;n<=15;n++)i[n]=0;for(t=0;t<=143;)Zc[2*t+1]=8,t++,i[8]++;for(;t<=255;)Zc[2*t+1]=9,t++,i[9]++;for(;t<=279;)Zc[2*t+1]=7,t++,i[7]++;for(;t<=287;)Zc[2*t+1]=8,t++,i[8]++;for(sd(Zc,287,i),t=0;t<30;t++)Jc[2*t+1]=5,Jc[2*t]=ad(t,5);Yc=new nd(Zc,Hc,257,286,15),Qc=new nd(Jc,qc,0,30,15),ed=new nd(new Array(0),Vc,0,19,7),Td=!0}e.l_desc=new rd(e.dyn_ltree,Yc),e.d_desc=new rd(e.dyn_dtree,Qc),e.bl_desc=new rd(e.bl_tree,ed),e.bi_buf=0,e.bi_valid=0,ld(e)},i=md,s=function(e,t,n,r){var i,o,a,s=0;if(0<e.level?(2===e.strm.data_type&&(e.strm.data_type=(e=>{for(var t=4093624447,n=0;n<=31;n++,t>>>=1)if(1&t&&0!==e.dyn_ltree[2*n])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(n=32;n<256;n++)if(0!==e.dyn_ltree[2*n])return 1;return 0})(e)),hd(e,e.l_desc),hd(e,e.d_desc),s=(e=>{var t;for(fd(e,e.dyn_ltree,e.l_desc.max_code),fd(e,e.dyn_dtree,e.d_desc.max_code),hd(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*Gc[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),(o=e.static_len+3+7>>>3)<=(i=e.opt_len+3+7>>>3)&&(i=o)):i=o=n+5,n+4<=i&&-1!==t)md(e,t,n,r);else if(4===e.strategy||o===i)Rd(e,2+(r?1:0),3),dd(e,Zc,Jc);else{Rd(e,4+(r?1:0),3);var l=e,u=(t=e.l_desc.max_code+1,n=e.d_desc.max_code+1,s+1);for(Rd(l,t-257,5),Rd(l,n-1,5),Rd(l,u-4,4),a=0;a<u;a++)Rd(l,l.bl_tree[2*Gc[a]+1],3);pd(l,l.dyn_ltree,t-1),pd(l,l.dyn_dtree,n-1),dd(e,e.dyn_ltree,e.dyn_dtree)}ld(e),r&&ud(e)},c=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*($c[n]+256+1)]++,e.dyn_dtree[2*id(t)]++),e.sym_next===e.sym_end},v=function(e){Rd(e,2,3),od(e,256,Zc),16===(e=e).bi_valid?(Cd(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)},xd=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3<n?2e3:n;o=o+(i=i+t[r++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16|0},Md=new Uint32Array((()=>{for(var e=[],t=0;t<256;t++){for(var n=t,r=0;r<8;r++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return e})()),Id=function(e,t,n,r){var i=Md,o=r+n;e^=-1;for(var a=r;a<o;a++)e=e>>>8^i[255&(e^t[a])];return-1^e},Ad={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"},y={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},Pd=eu,Dd=i,Ld=s,Nd=c,Fd=v,Ud=y.Z_NO_FLUSH,zd=y.Z_PARTIAL_FLUSH,Bd=y.Z_FULL_FLUSH,jd=y.Z_FINISH,Wd=y.Z_BLOCK,Hd=y.Z_OK,qd=y.Z_STREAM_END,Vd=y.Z_STREAM_ERROR,Gd=y.Z_DATA_ERROR,Zd=y.Z_BUF_ERROR,Jd=y.Z_DEFAULT_COMPRESSION,Kd=y.Z_FILTERED,$d=y.Z_HUFFMAN_ONLY,Xd=y.Z_RLE,Yd=y.Z_FIXED,Qd=y.Z_UNKNOWN,eh=y.Z_DEFLATED,th=function(e){for(var t=e.length;0<=--t;)e[t]=0},nh=function(e){for(var t,n,r=e.w_size,i=t=e.hash_size;n=e.head[--i],e.head[i]=r<=n?n-r:0,--t;);for(i=t=r;n=e.prev[--i],e.prev[i]=r<=n?n-r:0,--t;);},rh=function(e,t,n){return(t<<e.hash_shift^n)&e.hash_mask},ih=function(e,t){n=e.legacy_hash?e.ins_h=rh(e,e.ins_h,e.window[t+3-1]):(n=(n=e.window)[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24,e.ins_h=Math.imul(n,66521)+66521>>>16&e.hash_mask);var n,r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},oh=function(e){var t=e.state,n=t.pending;0!==(n=e.avail_out<n?e.avail_out: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)},ah=function(e,t,n,r){var i=e.avail_in;return 0===(i=r<i?r:i)?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=xd(e.adler,t,i,n):2===e.state.wrap&&(e.adler=Id(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)};function sh(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var lh=[new sh(0,0,0,0,_d),new sh(4,4,8,4,Sd),new sh(4,5,16,8,Sd),new sh(4,6,32,32,Sd),new sh(4,4,16,16,Ed),new sh(8,16,32,32,Ed),new sh(8,16,128,128,Ed),new sh(8,32,128,256,Ed),new sh(32,128,258,1024,Ed),new sh(32,258,258,4096,Ed)];function uh(){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=eh,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.legacy_hash=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),th(this.dyn_ltree),th(this.dyn_dtree),th(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),th(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),th(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}function ch(e){var t;return!e||!(t=e.state)||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}function dh(e){var t=mh(e);return t===Hd&&((e=e.state).window_size=2*e.w_size,th(e.head),e.max_lazy_match=lh[e.level].max_lazy,e.good_match=lh[e.level].good_length,e.nice_match=lh[e.level].nice_length,e.max_chain_length=lh[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),t}function hh(e,t,n,r,i,o,a){if(!e)return Vd;var s=1;if(t===Jd&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),i<1||9<i||n!==eh||r<8||15<r||t<0||9<t||o<0||Yd<o||8===r&&1!==s)return vd(e,Vd);8===r&&(r=9);var l=new uh;return(e.state=l).strm=e,l.status=42,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.legacy_hash=a?1:0,l.hash_bits=i+7,!l.legacy_hash&&l.hash_bits<15&&(l.hash_bits=15),l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new Uint8Array(2*l.w_size),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<i+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=3*(l.lit_bufsize-1),l.level=t,l.strategy=o,l.method=n,dh(e)}function fh(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==_(n))throw new TypeError(n+"must be non-object");for(var r in n)kh(n,r)&&(e[r]=n[r])}}return e}function ph(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e[n].length;for(var i=new Uint8Array(t),o=0,a=0,s=e.length;o<s;o++){var l=e[o];i.set(l,a),a+=l.length}return i}var mh=function(e){if(ch(e))return vd(e,Vd);e.total_in=e.total_out=0,e.data_type=Qd;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,Pd(t),Hd},vh=hh,gh=function(e,t){return ch(e)||2!==e.state.wrap?Vd:(e.state.gzhead=t,Hd)},yh=function(e,t){if(ch(e)||Wd<t||t<0)return e?vd(e,Vd):Vd;var n=e.state;if(!e.output||0!==e.avail_in&&!e.input||666===n.status&&t!==jd)return vd(e,0===e.avail_out?Zd:Vd);var r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(oh(e),0===e.avail_out)return n.last_flush=-1,Hd}else if(0===e.avail_in&&gd(t)<=gd(r)&&t!==jd)return vd(e,Zd);if(666===n.status&&0!==e.avail_in)return vd(e,Zd);if(42===n.status&&0===n.wrap&&(n.status=113),42===n.status){r=eh+(n.w_bits-8<<4)<<8;if(r|=(n.strategy>=$d||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(r|=32),wd(n,r+=31-r%31),0!==n.strstart&&(wd(n,e.adler>>>16),wd(n,65535&e.adler)),e.adler=1,n.status=113,oh(e),0!==n.pending)return n.last_flush=-1,Hd}if(57===n.status)if(e.adler=0,h(n,31),h(n,139),h(n,8),n.gzhead)h(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)),h(n,255&n.gzhead.time),h(n,n.gzhead.time>>8&255),h(n,n.gzhead.time>>16&255),h(n,n.gzhead.time>>24&255),h(n,9===n.level?2:n.strategy>=$d||n.level<2?4:0),h(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(h(n,255&n.gzhead.extra.length),h(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Id(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(h(n,0),h(n,0),h(n,0),h(n,0),h(n,0),h(n,9===n.level?2:n.strategy>=$d||n.level<2?4:0),h(n,3),n.status=113,oh(e),0!==n.pending)return n.last_flush=-1,Hd;if(69===n.status){if(n.gzhead.extra){for(var i=n.pending,o=(65535&n.gzhead.extra.length)-n.gzindex;n.pending+o>n.pending_buf_size;){var a=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=Id(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=a,oh(e),0!==n.pending)return n.last_flush=-1,Hd;i=0,o-=a}r=new Uint8Array(n.gzhead.extra);n.pending_buf.set(r.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=Id(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){var s,l=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>l&&(e.adler=Id(e.adler,n.pending_buf,n.pending-l,l)),oh(e),0!==n.pending)return n.last_flush=-1,Hd;l=0}}while(s=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,h(n,s),0!=s);n.gzhead.hcrc&&n.pending>l&&(e.adler=Id(e.adler,n.pending_buf,n.pending-l,l)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){var u,c=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>c&&(e.adler=Id(e.adler,n.pending_buf,n.pending-c,c)),oh(e),0!==n.pending)return n.last_flush=-1,Hd;c=0}}while(u=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,h(n,u),0!=u);n.gzhead.hcrc&&n.pending>c&&(e.adler=Id(e.adler,n.pending_buf,n.pending-c,c))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(oh(e),0!==n.pending))return n.last_flush=-1,Hd;h(n,255&e.adler),h(n,e.adler>>8&255),e.adler=0}if(n.status=113,oh(e),0!==n.pending)return n.last_flush=-1,Hd}if(0!==e.avail_in||0!==n.lookahead||t!==Ud&&666!==n.status){r=0===n.level?_d(n,t):n.strategy===$d?((e,t)=>{for(var n;;){if(0===e.lookahead&&(kd(e),0===e.lookahead)){if(t===Ud)return 1;break}if(e.match_length=0,n=Nd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(yd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===jd?(yd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(yd(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===Xd?((e,t)=>{for(var n,r,i,o,a=e.window;;){if(e.lookahead<=258){if(kd(e),e.lookahead<=258&&t===Ud)return 1;if(0===e.lookahead)break}if(e.match_length=0,3<=e.lookahead&&0<e.strstart&&(r=a[i=e.strstart-1])===a[++i]&&r===a[++i]&&r===a[++i]){for(o=e.strstart+258;r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o;);e.match_length=258-(o-i),e.lookahead<e.match_length&&(e.match_length=e.lookahead)}if(3<=e.match_length?(n=Nd(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Nd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(yd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===jd?(yd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(yd(e,!1),0===e.strm.avail_out)?1:2})(n,t):lh[n.level].func(n,t);if(3!==r&&4!==r||(n.status=666),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),Hd;if(2===r&&(t===zd?Fd(n):t!==Wd&&(Dd(n,0,0,!1),t===Bd)&&(th(n.head),0===n.lookahead)&&(n.strstart=0,n.block_start=0,n.insert=0),oh(e),0===e.avail_out))return n.last_flush=-1,Hd}return t!==jd||!(n.wrap<=0)&&(2===n.wrap?(h(n,255&e.adler),h(n,e.adler>>8&255),h(n,e.adler>>16&255),h(n,e.adler>>24&255),h(n,255&e.total_in),h(n,e.total_in>>8&255),h(n,e.total_in>>16&255),h(n,e.total_in>>24&255)):(wd(n,e.adler>>>16),wd(n,65535&e.adler)),oh(e),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending)?Hd:qd},wh=function(e){var t;return ch(e)?Vd:(t=e.state.status,e.state=null,113===t?vd(e,Gd):Hd)},bh=function(e,t){var n=t.length;if(ch(e))return Vd;var r=e.state,i=r.wrap;if(2===i||1===i&&42!==r.status||r.lookahead)return Vd;1===i&&(e.adler=xd(e.adler,t,n,0)),r.wrap=0,r.w_size<=n&&(0===i&&(th(r.head),r.strstart=0,r.block_start=0,r.insert=0),(o=new Uint8Array(r.w_size)).set(t.subarray(n-r.w_size,n),0),t=o,n=r.w_size);var o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,kd(r);3<=r.lookahead;){for(var l=r.strstart,u=r.lookahead-2;ih(r,l),l++,--u;);r.strstart=l,r.lookahead=2,kd(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,Hd},kh=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},_h=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(w){_h=!1}for(var Sh=new Uint8Array(256),Eh=0;Eh<256;Eh++)Sh[Eh]=252<=Eh?6:248<=Eh?5:240<=Eh?4:224<=Eh?3:192<=Eh?2:1;Sh[254]=Sh[255]=1;function Ch(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);for(var t,n,r,i,o=e.length,a=0,s=0;s<o;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<o&&56320==(64512&(r=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(r-56320),s++),a+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(a),s=i=0;i<a;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<o&&56320==(64512&(r=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(r-56320),s++),n<128?t[i++]=n:(n<2048?t[i++]=192|n>>>6:(n<65536?t[i++]=224|n>>>12:(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63),t[i++]=128|n>>>6&63),t[i++]=128|63&n);return t}function Rh(){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}var Oh=Object.prototype.toString,Th=y.Z_NO_FLUSH,xh=y.Z_SYNC_FLUSH,Mh=y.Z_FULL_FLUSH,Ih=y.Z_FINISH,Ah=y.Z_OK,Ph=y.Z_STREAM_END,Dh={level:y.Z_DEFAULT_COMPRESSION,method:y.Z_DEFLATED,chunkSize:16384,windowBits:15,memLevel:8,strategy:y.Z_DEFAULT_STRATEGY,legacyHash:!0};function Lh(e){this.options=fh({},Dh,e||{});var e=this.options,t=(e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Rh,this.strm.avail_out=0,vh(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy,e.legacyHash));if(t!==Ah)throw new Error(Ad[t]);if(e.header&&gh(this.strm,e.header),e.dictionary){e="string"==typeof e.dictionary?Ch(e.dictionary):"[object ArrayBuffer]"===Oh.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary;if((t=bh(this.strm,e))!==Ah)throw new Error(Ad[t]);this._dict_set=!0}}function Nh(e,t){t=new Lh(t);if(t.push(e,!0),t.err)throw t.msg||Ad[t.err];return t.result}Lh.prototype.push=function(e,t){var n,r,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;for(r=t===~~t?t:!0===t?Ih:Th,"string"==typeof e?i.input=Ch(e):"[object ArrayBuffer]"===Oh.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(o),i.next_out=0,i.avail_out=o),(r===xh||r===Mh)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(yh(i,r)===Ph)return 0<i.next_out&&this.onData(i.output.subarray(0,i.next_out)),n=wh(this.strm),this.onEnd(n),this.ended=!0,n===Ah;if(0!==i.avail_out){if(0<r&&0<i.next_out)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},Lh.prototype.onData=function(e){this.chunks.push(e)},Lh.prototype.onEnd=function(e){e===Ah&&(this.result=ph(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Fh(e,t,n,r,i,o,a,s){for(var l,u,c,d,h,f,p,m,v,g=s.bits,y=0,w=0,b=0,k=0,_=0,S=0,E=0,C=0,R=0,O=0,T=null,x=new Uint16Array(16),M=new Uint16Array(16),I=null,y=0;y<=15;y++)x[y]=0;for(w=0;w<r;w++)x[t[n+w]]++;for(_=g,k=15;1<=k&&0===x[k];k--);if(k<_&&(_=k),0===k)i[o++]=20971520,i[o++]=20971520,s.bits=1;else{for(b=1;b<k&&0===x[b];b++);for(_<b&&(_=b),y=C=1;y<=15;y++)if((C=(C<<1)-x[y])<0)return-1;if(0<C&&(0===e||1!==k))return-1;for(M[1]=0,y=1;y<15;y++)M[y+1]=M[y]+x[y];for(w=0;w<r;w++)0!==t[n+w]&&(a[M[t[n+w]]++]=w);if(f=0===e?(T=I=a,20):1===e?(T=Bh,I=jh,257):(T=Wh,I=Hh,0),y=b,h=o,E=w=O=0,c=-1,d=(R=1<<(S=_))-1,1===e&&852<R||2===e&&592<R)return 1;for(;;){for(v=a[w]+1<f?(m=0,a[w]):a[w]>=f?(m=I[a[w]-f],T[a[w]-f]):(m=96,0),l=1<<(p=y-E),b=u=1<<S;i[h+(O>>E)+(u-=l)]=p<<24|m<<16|v|0,0!==u;);for(l=1<<y-1;O&l;)l>>=1;if(0!==l?O=(O&l-1)+l:O=0,w++,0==--x[y]){if(y===k)break;y=t[n+a[w]]}if(_<y&&(O&d)!==c){for(h+=b,C=1<<(S=y-(E=0===E?_:E));S+E<k&&!((C-=x[S+E])<=0);)S++,C<<=1;if(R+=1<<S,1===e&&852<R||2===e&&592<R)return 1;i[c=O&d]=_<<24|S<<16|h-o|0}}0!==O&&(i[h+O]=y-E<<24|64<<16|0),s.bits=_}return 0}function Uh(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}var zh={Deflate:Lh,deflate:Nh,deflateRaw:function(e,t){return(t=t||{}).raw=!0,Nh(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,Nh(e,t)},constants:y},Bh=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]),jh=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,199,75]),Wh=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]),Hh=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]),qh=y.Z_FINISH,Vh=y.Z_BLOCK,Gh=y.Z_TREES,Zh=y.Z_OK,Jh=y.Z_STREAM_END,Kh=y.Z_NEED_DICT,$h=y.Z_STREAM_ERROR,Xh=y.Z_DATA_ERROR,Yh=y.Z_MEM_ERROR,Qh=y.Z_BUF_ERROR,ef=y.Z_DEFLATED,ie=16209;function tf(){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}function nf(e){var t;return df(e)?$h:(t=e.state,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,Zh)}function rf(e){var t;return df(e)?$h:((t=e.state).wsize=0,t.whave=0,t.wnext=0,nf(e))}function of(e,t){var n,r;return df(e)||(r=e.state,t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t))?$h:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,rf(e))}function af(e,t){var n;return e?(n=new tf,(e.state=n).strm=e,n.window=null,n.mode=16180,(n=of(e,t))!==Zh&&(e.state=null),n):$h}function sf(e,t,n,r){var i;return null===(e=e.state).window&&(e.window=new Uint8Array(1<<e.wbits)),0===e.wsize&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0),e.wsize<=r?(e.window.set(t.subarray(n-e.wsize,n),0),e.wnext=0,e.whave=e.wsize):((i=e.wsize-e.wnext)>r&&(i=r),e.window.set(t.subarray(n-r,n-r+i),e.wnext),(r-=i)?(e.window.set(t.subarray(n-r,n),0),e.wnext=r,e.whave=e.wsize):(e.wnext+=i,e.wnext===e.wsize&&(e.wnext=0),e.whave<e.wsize&&(e.whave+=i))),0}function lf(){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}var uf,cf,df=function(e){var t;return!e||!(t=e.state)||t.strm!==e||t.mode<16180||16211<t.mode?1:0},hf=!0,ff=rf,pf=af,mf=function(e,N){var t,n,F,r,i,o,a,s,l,U,u,c,z,B,d,h,f,p,j,W,m,v,g,y,w=0,b=new Uint8Array(4),H=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(df(e)||!e.output||!e.input&&0!==e.avail_in)return $h;16191===(t=e.state).mode&&(t.mode=16192),i=e.next_out,F=e.output,r=e.next_in,n=e.input,s=t.hold,l=t.bits,U=o=e.avail_in,u=a=e.avail_out,v=Zh;e:for(;;)switch(t.mode){case 16180:if(0===t.wrap)t.mode=16192;else{for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}2&t.wrap&&35615===s?(0===t.wbits&&(t.wbits=15),b[t.check=0]=255&s,b[1]=s>>>8&255,t.check=Id(t.check,b,2,0),l=s=0,t.mode=16181):(t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&s)<<8)+(s>>8))%31?(e.msg="incorrect header check",t.mode=ie):(15&s)!==ef?(e.msg="unknown compression method",t.mode=ie):(l-=4,m=8+(15&(s>>>=4)),0===t.wbits&&(t.wbits=m),15<m||m>t.wbits?(e.msg="invalid window size",t.mode=ie):(t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=512&s?16189:16191,l=s=0)))}break;case 16181:for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(t.flags=s,(255&t.flags)!==ef){e.msg="unknown compression method",t.mode=ie;break}if(57344&t.flags){e.msg="unknown header flags set",t.mode=ie;break}t.head&&(t.head.text=s>>8&1),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,t.check=Id(t.check,b,2,0)),l=s=0,t.mode=16182;case 16182:for(;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.head&&(t.head.time=s),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,b[2]=s>>>16&255,b[3]=s>>>24&255,t.check=Id(t.check,b,4,0)),l=s=0,t.mode=16183;case 16183:for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.head&&(t.head.xflags=255&s,t.head.os=s>>8),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,t.check=Id(t.check,b,2,0)),l=s=0,t.mode=16184;case 16184:if(1024&t.flags){for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.length=s,t.head&&(t.head.extra_len=s),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,t.check=Id(t.check,b,2,0)),l=s=0}else t.head&&(t.head.extra=null);t.mode=16185;case 16185:if(1024&t.flags&&((c=(c=t.length)>o?o:c)&&(t.head&&(m=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(r,r+c),m)),512&t.flags&&4&t.wrap&&(t.check=Id(t.check,n,c,r)),o-=c,r+=c,t.length-=c),t.length))break e;t.length=0,t.mode=16186;case 16186:if(2048&t.flags){if(0===o)break e;for(c=0;m=n[r+c++],t.head&&m&&t.length<65536&&(t.head.name+=String.fromCharCode(m)),m&&c<o;);if(512&t.flags&&4&t.wrap&&(t.check=Id(t.check,n,c,r)),o-=c,r+=c,m)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=16187;case 16187:if(4096&t.flags){if(0===o)break e;for(c=0;m=n[r+c++],t.head&&m&&t.length<65536&&(t.head.comment+=String.fromCharCode(m)),m&&c<o;);if(512&t.flags&&4&t.wrap&&(t.check=Id(t.check,n,c,r)),o-=c,r+=c,m)break e}else t.head&&(t.head.comment=null);t.mode=16188;case 16188:if(512&t.flags){for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(4&t.wrap&&s!==(65535&t.check)){e.msg="header crc mismatch",t.mode=ie;break}l=s=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=16191;break;case 16189:for(;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}e.adler=t.check=Uh(s),l=s=0,t.mode=16190;case 16190:if(0===t.havedict)return e.next_out=i,e.avail_out=a,e.next_in=r,e.avail_in=o,t.hold=s,t.bits=l,Kh;e.adler=t.check=1,t.mode=16191;case 16191:if(N===Vh||N===Gh)break e;case 16192:if(t.last)s>>>=7&l,l-=7&l,t.mode=16206;else{for(;l<3;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}switch(t.last=1&s,--l,3&(s>>>=1)){case 0:t.mode=16193;break;case 1:_=k=void 0;var k=t;if(hf){uf=new Int32Array(512),cf=new Int32Array(32);for(var _=0;_<144;)k.lens[_++]=8;for(;_<256;)k.lens[_++]=9;for(;_<280;)k.lens[_++]=7;for(;_<288;)k.lens[_++]=8;for(Fh(1,k.lens,0,288,uf,0,k.work,{bits:9}),_=0;_<32;)k.lens[_++]=5;Fh(2,k.lens,0,32,cf,0,k.work,{bits:5}),hf=!1}if(k.lencode=uf,k.lenbits=9,k.distcode=cf,k.distbits=5,t.mode=16199,N!==Gh)break;s>>>=2,l-=2;break e;case 2:t.mode=16196;break;case 3:e.msg="invalid block type",t.mode=ie}s>>>=2,l-=2}break;case 16193:for(s>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if((65535&s)!=(s>>>16^65535)){e.msg="invalid stored block lengths",t.mode=ie;break}if(t.length=65535&s,l=s=0,t.mode=16194,N===Gh)break e;case 16194:t.mode=16195;case 16195:if(c=t.length){if(0===(c=a<(c=o<c?o:c)?a:c))break e;F.set(n.subarray(r,r+c),i),o-=c,r+=c,a-=c,i+=c,t.length-=c}else t.mode=16191;break;case 16196:for(;l<14;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(t.nlen=257+(31&s),s>>>=5,l-=5,t.ndist=1+(31&s),s>>>=5,l-=5,t.ncode=4+(15&s),s>>>=4,l-=4,286<t.nlen||30<t.ndist){e.msg="too many length or distance symbols",t.mode=ie;break}t.have=0,t.mode=16197;case 16197:for(;t.have<t.ncode;){for(;l<3;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.lens[H[t.have++]]=7&s,s>>>=3,l-=3}for(;t.have<19;)t.lens[H[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,g={bits:t.lenbits},v=Fh(0,t.lens,0,19,t.lencode,0,t.work,g),t.lenbits=g.bits,v){e.msg="invalid code lengths set",t.mode=ie;break}t.have=0,t.mode=16198;case 16198:for(;t.have<t.nlen+t.ndist;){for(;h=(w=t.lencode[s&(1<<t.lenbits)-1])>>>16&255,f=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(f<16)s>>>=d,l-=d,t.lens[t.have++]=f;else{if(16===f){for(y=d+2;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(s>>>=d,l-=d,0===t.have){e.msg="invalid bit length repeat",t.mode=ie;break}m=t.lens[t.have-1],c=3+(3&s),s>>>=2,l-=2}else if(17===f){for(y=d+3;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}m=0,c=3+(7&(s>>>=d)),s>>>=3,l=l-d-3}else{for(y=d+7;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}m=0,c=11+(127&(s>>>=d)),s>>>=7,l=l-d-7}if(t.have+c>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=ie;break}for(;c--;)t.lens[t.have++]=m}}if(t.mode===ie)break;if(0===t.lens[256]){e.msg="invalid code -- missing end-of-block",t.mode=ie;break}if(t.lenbits=9,g={bits:t.lenbits},v=Fh(1,t.lens,0,t.nlen,t.lencode,0,t.work,g),t.lenbits=g.bits,v){e.msg="invalid literal/lengths set",t.mode=ie;break}if(t.distbits=6,t.distcode=t.distdyn,g={bits:t.distbits},v=Fh(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,g),t.distbits=g.bits,v){e.msg="invalid distances set",t.mode=ie;break}if(t.mode=16199,N===Gh)break e;case 16199:t.mode=16200;case 16200:if(6<=o&&258<=a){e.next_out=i,e.avail_out=a,e.next_in=r,e.avail_in=o,t.hold=s,t.bits=l,M=P=V=T=O=R=C=E=S=re=ne=te=ee=L=D=Q=Y=X=$=K=J=Z=A=G=I=q=x=void 0;var S,E,C,R,O,T,x=e,q=u,M=x.state,I=x.next_in,V=x.input,G=I+(x.avail_in-5),A=x.next_out,P=x.output,Z=A-(q-x.avail_out),J=A+(x.avail_out-257),K=M.dmax,$=M.wsize,X=M.whave,Y=M.wnext,Q=M.window,D=M.hold,L=M.bits,ee=M.lencode,te=M.distcode,ne=(1<<M.lenbits)-1,re=(1<<M.distbits)-1;t:do{for(L<15&&(D+=V[I++]<<L,L+=8,D+=V[I++]<<L,L+=8),S=ee[D&ne];;){if(D>>>=E=S>>>24,L-=E,0==(E=S>>>16&255))P[A++]=65535&S;else{if(!(16&E)){if(0==(64&E)){S=ee[(65535&S)+(D&(1<<E)-1)];continue}if(32&E){M.mode=16191;break t}x.msg="invalid literal/length code",M.mode=16209;break t}for(C=65535&S,(E&=15)&&(L<E&&(D+=V[I++]<<L,L+=8),C+=D&(1<<E)-1,D>>>=E,L-=E),L<15&&(D+=V[I++]<<L,L+=8,D+=V[I++]<<L,L+=8),S=te[D&re];;){if(D>>>=E=S>>>24,L-=E,!(16&(E=S>>>16&255))){if(0==(64&E)){S=te[(65535&S)+(D&(1<<E)-1)];continue}x.msg="invalid distance code",M.mode=16209;break t}if(R=65535&S,L<(E&=15)&&(D+=V[I++]<<L,(L+=8)<E)&&(D+=V[I++]<<L,L+=8),(R+=D&(1<<E)-1)>K){x.msg="invalid distance too far back",M.mode=16209;break t}if(D>>>=E,L-=E,R>(E=A-Z)){if((E=R-E)>X&&M.sane){x.msg="invalid distance too far back",M.mode=16209;break t}if(T=Q,(O=0)===Y){if(O+=$-E,E<C){for(C-=E;P[A++]=Q[O++],--E;);O=A-R,T=P}}else if(Y<E){if(O+=$+Y-E,(E-=Y)<C){for(C-=E;P[A++]=Q[O++],--E;);if(O=0,Y<C){for(C-=E=Y;P[A++]=Q[O++],--E;);O=A-R,T=P}}}else if(O+=Y-E,E<C){for(C-=E;P[A++]=Q[O++],--E;);O=A-R,T=P}for(;2<C;)P[A++]=T[O++],P[A++]=T[O++],P[A++]=T[O++],C-=3;C&&(P[A++]=T[O++],1<C)&&(P[A++]=T[O++])}else{for(O=A-R;P[A++]=P[O++],P[A++]=P[O++],P[A++]=P[O++],2<(C-=3););C&&(P[A++]=P[O++],1<C)&&(P[A++]=P[O++])}break}}break}}while(I<G&&A<J);I-=C=L>>3,D&=(1<<(L-=C<<3))-1,x.next_in=I,x.next_out=A,x.avail_in=I<G?G-I+5:5-(I-G),x.avail_out=A<J?J-A+257:257-(A-J),M.hold=D,M.bits=L,i=e.next_out,F=e.output,a=e.avail_out,r=e.next_in,n=e.input,o=e.avail_in,s=t.hold,l=t.bits,16191===t.mode&&(t.back=-1);break}for(t.back=0;h=(w=t.lencode[s&(1<<t.lenbits)-1])>>>16&255,f=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(h&&0==(240&h)){for(p=d,j=h,W=f;h=(w=t.lencode[W+((s&(1<<p+j)-1)>>p)])>>>16&255,f=65535&w,!(p+(d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}s>>>=p,l-=p,t.back+=p}if(s>>>=d,l-=d,t.back+=d,t.length=f,0===h){t.mode=16205;break}if(32&h){t.back=-1,t.mode=16191;break}if(64&h){e.msg="invalid literal/length code",t.mode=ie;break}t.extra=15&h,t.mode=16201;case 16201:if(t.extra){for(y=t.extra;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.length+=s&(1<<t.extra)-1,s>>>=t.extra,l-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=16202;case 16202:for(;h=(w=t.distcode[s&(1<<t.distbits)-1])>>>16&255,f=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(0==(240&h)){for(p=d,j=h,W=f;h=(w=t.distcode[W+((s&(1<<p+j)-1)>>p)])>>>16&255,f=65535&w,!(p+(d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}s>>>=p,l-=p,t.back+=p}if(s>>>=d,l-=d,t.back+=d,64&h){e.msg="invalid distance code",t.mode=ie;break}t.offset=f,t.extra=15&h,t.mode=16203;case 16203:if(t.extra){for(y=t.extra;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.offset+=s&(1<<t.extra)-1,s>>>=t.extra,l-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=ie;break}t.mode=16204;case 16204:if(0===a)break e;if(t.offset>(c=u-a)){if((c=t.offset-c)>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=ie;break}z=c>t.wnext?(c-=t.wnext,t.wsize-c):t.wnext-c,c>t.length&&(c=t.length),B=t.window}else B=F,z=i-t.offset,c=t.length;for(a-=c=a<c?a:c,t.length-=c;F[i++]=B[z++],--c;);0===t.length&&(t.mode=16200);break;case 16205:if(0===a)break e;F[i++]=t.length,a--,t.mode=16200;break;case 16206:if(t.wrap){for(;l<32;){if(0===o)break e;o--,s|=n[r++]<<l,l+=8}if(u-=a,e.total_out+=u,t.total+=u,4&t.wrap&&u&&(e.adler=t.check=(t.flags?Id:xd)(t.check,F,u,i-u)),u=a,4&t.wrap&&(t.flags?s:Uh(s))!==t.check){e.msg="incorrect data check",t.mode=ie;break}l=s=0}t.mode=16207;case 16207:if(t.wrap&&t.flags){for(;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(4&t.wrap&&s!==(4294967295&t.total)){e.msg="incorrect length check",t.mode=ie;break}l=s=0}t.mode=16208;case 16208:v=Jh;break e;case ie:v=Xh;break e;case 16210:return Yh;default:return $h}return e.next_out=i,e.avail_out=a,e.next_in=r,e.avail_in=o,t.hold=s,t.bits=l,(t.wsize||u!==e.avail_out&&t.mode<ie&&(t.mode<16206||N!==qh))&&sf(e,e.output,e.next_out,u-e.avail_out),u-=e.avail_out,e.total_in+=U-=e.avail_in,e.total_out+=u,t.total+=u,4&t.wrap&&u&&(e.adler=t.check=(t.flags?Id:xd)(t.check,F,u,e.next_out-u)),e.data_type=t.bits+(t.last?64:0)+(16191===t.mode?128:0)+(16199===t.mode||16194===t.mode?256:0),v=(0==U&&0===u||N===qh)&&v===Zh?Qh:v},vf=function(e){var t;return df(e)?$h:((t=e.state).window&&(t.window=null),e.state=null,Zh)},gf=function(e,t){return df(e)||0==(2&(e=e.state).wrap)?$h:((e.head=t).done=!1,Zh)},yf=function(e,t){var n,r=t.length;return df(e)||0!==(n=e.state).wrap&&16190!==n.mode?$h:16190===n.mode&&xd(1,t,r,0)!==n.check?Xh:sf(e,t,r,r)?(n.mode=16210,Yh):(n.havedict=1,Zh)},wf=Object.prototype.toString,bf=y.Z_NO_FLUSH,kf=y.Z_FINISH,_f=y.Z_OK,Sf=y.Z_STREAM_END,Ef=y.Z_NEED_DICT,Cf=y.Z_STREAM_ERROR,Rf=y.Z_DATA_ERROR,Of=y.Z_MEM_ERROR,Tf=y.Z_BUF_ERROR,xf={chunkSize:65536,windowBits:15,to:""};function Mf(e){this.options=fh({},xf,e||{});var t=this.options,e=(t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits)&&(t.windowBits=-15),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Rh,this.strm.avail_out=0,pf(this.strm,t.windowBits));if(e!==_f)throw new Error(Ad[e]);if(this.header=new lf,gf(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Ch(t.dictionary):"[object ArrayBuffer]"===wf.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw)&&(e=yf(this.strm,t.dictionary))!==_f)throw new Error(Ad[e])}function If(e,t){t=new Mf(t);if(t.push(e,!0),t.err)throw t.msg||Ad[t.err];return t.result}Mf.prototype.push=function(e,t){var n,r,i=this.strm,o=this.options.chunkSize,a=this.options.dictionary;if(this.ended)return!1;for(r=t===~~t?t:!0===t?kf:bf,"[object ArrayBuffer]"===wf.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(o),i.next_out=0,i.avail_out=o),(n=mf(i,r))===Ef&&a&&((n=yf(i,a))===_f?n=mf(i,r):n===Rf&&(n=Ef));0<i.avail_in&&n===Sf&&2&i.state.wrap&&0!==i.state.flags&&0!==i.input[i.next_in];)ff(i),n=mf(i,r);switch(n){case Cf:case Rf:case Ef:case Of:return this.onEnd(n),!(this.ended=!0)}var s,l,u,c=i.avail_out;if(i.next_out&&(0===i.avail_out||n===Sf||0<r)&&("string"===this.options.to?(s=((e,t)=>{for(var n=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=n&&128==(192&e[n]);)n--;return!(n<0||0===n)&&n+Sh[e[n]]>t?n:t})(i.output,i.next_out),l=i.next_out-s,u=((e,t)=>{var n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));for(var r=new Array(2*n),i=0,o=0;o<n;){var a=e[o++];if(a<128)r[i++]=a;else{var s=Sh[a];if(4<s)r[i++]=65533,o+=s-1;else{for(a&=2===s?31:3===s?15:7;1<s&&o<n;)a=a<<6|63&e[o++],s--;1<s?r[i++]=65533:a<65536?r[i++]=a:(a-=65536,r[i++]=55296|a>>10&1023,r[i++]=56320|1023&a)}}}var l=r,u=i;if(u<65534&&l.subarray&&_h)return String.fromCharCode.apply(null,l.length===u?l:l.subarray(0,u));for(var c="",d=0;d<u;d++)c+=String.fromCharCode(l[d]);return c})(i.output,s),i.next_out=l,i.avail_out=o-l,l&&i.output.set(i.output.subarray(s,s+l),0),this.onData(u)):(this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out)),i.avail_out=0,i.next_out=0)),n!==_f&&n!==Tf||0!==c){if(n===Sf)return n=vf(this.strm),this.onEnd(n),this.ended=!0;if(0===i.avail_in){if(r===kf)return n=vf(this.strm),this.onEnd(n===_f?Tf:n),!(this.ended=!0);break}}}return!0},Mf.prototype.onData=function(e){this.chunks.push(e)},Mf.prototype.onEnd=function(e){e===_f&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ph(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Af={Inflate:Mf,inflate:If,inflateRaw:function(e,t){return(t=t||{}).raw=!0,If(e,t)},ungzip:If,constants:y},Pf={Deflate:zh.Deflate,deflate:zh.deflate,deflateRaw:zh.deflateRaw,gzip:zh.gzip,Inflate:Af.Inflate,inflate:Af.inflate,inflateRaw:Af.inflateRaw,ungzip:Af.ungzip,constants:y},Df=(Uf.prototype.uploadReplay=function(n){return P(this,void 0,void 0,function(){var t;return D(this,function(e){switch(e.label){case 0:if(this.isUploading)return Mr("Uploader","Upload in progress, skipping"),[2,!1];this.isUploading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),(t=this.config.beforeSend(n))?[4,this.doUploadWithRetry(t,0)]:(f("Uploader","Upload cancelled by beforeSend"),[2,!1]);case 2:return e.sent(),f("Uploader","Upload success:",{replay_id:n.replay_id,segment_id:n.segment_id}),[2,!0];case 3:return Ir("Uploader","Upload failed:",t=e.sent()),this.config.onError(t),[2,!1];case 4:return this.isUploading=!1,[7];case 5:return[2]}})})},Uf.prototype.doUploadWithRetry=function(r,i){return P(this,void 0,void 0,function(){var t,n;return D(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,5]),[4,this.doUpload(r)];case 1:return e.sent(),[3,5];case 2:return t=e.sent(),i<this.config.maxRetries?(f("Uploader","Retrying in "+(n=1e3*Math.pow(2,i))+"ms (attempt "+(i+1)+"/"+this.config.maxRetries+")"),[4,this.sleep(n)]):[3,4];case 3:return e.sent(),[2,this.doUploadWithRetry(r,i+1)];case 4:throw t;case 5:return[2]}})})},Uf.prototype.prepareUploadPayload=function(e){var t=e.replay_format||"rrweb",n=e.events_encoding||"plain_json";if("rrweb"!==t)return e;if(!this.config.eventsCompression||"gzip_base64"===n)return x(x({},e),{replay_format:t,platform:e.platform||"web",events_encoding:n});try{var r=Pf.gzip(e.events),i=this.uint8ArrayToBase64(r),o=e.events.length,a=r.length,s=i.length;return f("Uploader","Events compressed: "+Math.round(o/1024)+"KB -> gzip "+Math.round(a/1024)+"KB -> base64 "+Math.round(s/1024)+"KB"),x(x({},e),{replay_format:t,platform:e.platform||"web",events_encoding:"gzip_base64",events:i})}catch(n){return Mr("Uploader","Events compression failed, fallback to plain_json:",n),x(x({},e),{replay_format:t,platform:e.platform||"web",events_encoding:"plain_json"})}},Uf.prototype.uint8ArrayToBase64=function(e){for(var t="",n=0;n<e.length;n+=32768){for(var r=e.subarray(n,n+32768),i="",o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);t+=i}if("function"==typeof btoa)return btoa(t);if("undefined"!=typeof Buffer)return Buffer.from(e).toString("base64");throw new Error("base64 encode is not supported")},Uf.prototype.doUpload=function(i){return P(this,void 0,void 0,function(){var t,n,r;return D(this,function(e){switch(e.label){case 0:if(t=this.prepareUploadPayload(i),r=JSON.stringify(t),n={"Content-Type":"application/json","X-App-ID":this.config.appId},f("Uploader","Sending replay payload: "+Math.round(r.length/1024)+"KB, events_encoding="+(t.events_encoding||"plain_json")),r.length<65536||f("Uploader","Data size "+Math.round(r.length/1024)+"KB exceeds keepalive limit, using normal fetch"),this.config.transport)return[4,this.config.transport.request({kind:"replay",url:this.config.uploadUrl,method:"POST",headers:n,body:r})];throw new Error("Replay Transport is not configured");case 1:if(t=e.sent(),!(n=t||{ok:!1,status:0,statusText:"Transport failed"}).ok)throw new Error("HTTP "+(n.status||0)+": "+(n.statusText||"Transport failed"));if(0!==(r="string"==typeof n.body?JSON.parse(n.body):n.body).code)throw new Error("Server error (code "+r.code+"): "+r.message);return[2]}})})},Uf.prototype.sendBeacon=function(e){var t;try{var n=this.prepareUploadPayload(e),r=JSON.stringify(n);return!(null==(t=this.config.transport)||!t.handoff||(this.config.transport.handoff({kind:"replay",url:this.config.uploadUrl,method:"POST",contentType:"application/json",body:r,sendBeacon:!0}),0))}catch(e){return Ir("Uploader","sendBeacon failed:",e),!1}},Uf.prototype.isUploadInProgress=function(){return this.isUploading},Uf.prototype.sleep=function(t){return new Promise(function(e){return setTimeout(e,t)})},Uf),Lf=["a","button",'input[type="button"]','input[type="submit"]','[role="button"]',"[onclick]","[ng-click]","[v-on\\:click]"].join(","),Nf=(Ff.prototype.start=function(){this.isRunning||(document.addEventListener("pointerdown",this.handlePointerDown,!0),document.addEventListener("click",this.handleClick,!0),this.isRunning=!0,f("ClickDetector","Started"))},Ff.prototype.stop=function(){this.isRunning&&(document.removeEventListener("pointerdown",this.handlePointerDown,!0),document.removeEventListener("click",this.handleClick,!0),this.cleanupSlowClick(),this.isRunning=!1,f("ClickDetector","Stopped"))},Ff.prototype.handlePointerDown=function(e){var t,n,r=this,i=e.target;i&&i instanceof Element&&(i=this.getClickableElement(i))&&(this.cleanupSlowClick(),this.clickStartTime=Date.now(),this.clickNode=i,t=this.getNodeInfo(i),n=this.getExternalNavigationReason(e,i),this.options.onClickStart({node:t,timestamp:this.clickStartTime,target:i,event:e,effectiveActionReason:n||void 0}),n?this.markEffectiveAction(n):(this.slowClickTimeoutId=setTimeout(function(){r.handleSlowClick("timeout")},this.options.slowClickTimeout),this.startMutationObserver()))},Ff.prototype.handleClick=function(e){var t=this,n=e.target,r=Date.now();this.rageActiveTarget&&r-this.rageLastClickTime>=this.options.rageClickWindow&&(this.rageActiveTarget=null,this.rageLastClickTime=0),this.rageActiveTarget&&this.isSameTarget(this.rageActiveTarget,n)?this.rageLastClickTime=r:(this.clickHistory.push({time:r,target:n}),this.clickHistory=this.clickHistory.filter(function(e){return r-e.time<t.options.rageClickWindow}),(e=this.clickHistory.filter(function(e){return t.isSameTarget(e.target,n)})).length>=this.options.rageClickCount&&(this.options.onRageClick({node:this.getNodeInfo(n),clickCount:e.length,timeWindowMs:this.options.rageClickWindow,timestamp:r}),this.rageActiveTarget=n,this.rageLastClickTime=r))},Ff.prototype.startMutationObserver=function(){var t=this;this.clickNode&&document.body&&"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver(function(e){t.hasSignificantMutation(e)&&(t.emitEffectiveAction("dom_mutation"),t.handleSlowClick("mutation"))}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","hidden","disabled","aria-hidden","aria-disabled","aria-busy"],characterData:!0}))},Ff.prototype.hasSignificantMutation=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];if("characterData"===r.type)return!0;if("childList"===r.type&&(0<r.addedNodes.length||0<r.removedNodes.length)&&Array.from(r.addedNodes).concat(Array.from(r.removedNodes)).some(function(e){return e.nodeType===Node.ELEMENT_NODE&&!["SCRIPT","STYLE","LINK"].includes(e.tagName)}))return!0;if("attributes"===r.type){r=r.attributeName;if(["class","style","hidden","disabled","aria-hidden","aria-disabled","aria-busy"].includes(r||""))return!0}}return!1},Ff.prototype.handleSlowClick=function(e){var t;this.clickNode&&this.clickStartTime&&((t=Date.now()-this.clickStartTime)>=this.options.slowClickThreshold&&this.options.onSlowClick({node:this.getNodeInfo(this.clickNode),timeAfterClickMs:t,endReason:e,timestamp:this.clickStartTime}),this.cleanupSlowClick())},Ff.prototype.cleanupSlowClick=function(){this.slowClickTimeoutId&&(clearTimeout(this.slowClickTimeoutId),this.slowClickTimeoutId=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.clickStartTime=0,this.clickNode=null},Ff.prototype.isSameTarget=function(e,t){return e===t||e.contains(t)||t.contains(e)},Ff.prototype.markEffectiveAction=function(e){this.clickNode&&this.clickStartTime&&(this.emitEffectiveAction(e),this.cleanupSlowClick())},Ff.prototype.emitEffectiveAction=function(e){this.clickNode&&this.options.onEffectiveAction({reason:e,timestamp:Date.now(),node:this.getNodeInfo(this.clickNode)})},Ff.prototype.getClickableElement=function(e){return e.matches(Lf)?e:e.closest(Lf)},Ff.prototype.getExternalNavigationReason=function(e,t){var n=t.closest("a");if(n){if(n.download)return"download";var r=(n.getAttribute("target")||"").toLowerCase();if(r&&"_self"!==r)return"external_navigation";if(n.href&&(1===e.button||e.metaKey||e.ctrlKey||e.shiftKey))return"external_navigation"}r=t.closest("form"),n=((null==r?void 0:r.getAttribute("target"))||"").toLowerCase();return n&&"_self"!==n?"external_navigation":t.hasAttribute("data-tdem-ignore-dead-click")||t.closest("[data-tdem-ignore-dead-click]")||t.hasAttribute("data-tdem-effective-action")||t.closest("[data-tdem-effective-action]")?"custom":null},Ff.prototype.getNodeInfo=function(e){var t;return{id:(null==(t=e.__sn)?void 0:t.id)||0,tagName:e.tagName.toLowerCase(),textContent:(e.textContent||"").trim().substring(0,100),selector:this.getSelector(e)}},Ff.prototype.getSelector=function(e){for(var t=[],n=e;n&&n!==document.body&&t.length<5;){var r,i=n.tagName.toLowerCase();if(n.id){i+="#"+n.id,t.unshift(i);break}n.className&&"string"==typeof n.className&&0<(r=n.className.trim().split(/\s+/).slice(0,2)).length&&(i+="."+r.join(".")),t.unshift(i),n=n.parentElement}return t.join(" > ")},Ff.prototype.isActive=function(){return this.isRunning},Ff);function Ff(e){var t;void 0===e&&(e={}),this.isRunning=!1,this.clickStartTime=0,this.clickNode=null,this.slowClickTimeoutId=null,this.mutationObserver=null,this.clickHistory=[],this.rageActiveTarget=null,this.rageLastClickTime=0,this.options={slowClickTimeout:null!=(t=e.slowClickTimeout)?t:7e3,slowClickThreshold:null!=(t=e.slowClickThreshold)?t:3e3,rageClickCount:null!=(t=e.rageClickCount)?t:5,rageClickWindow:null!=(t=e.rageClickWindow)?t:1e3,onSlowClick:e.onSlowClick||function(){},onRageClick:e.onRageClick||function(){},onClickStart:e.onClickStart||function(){},onEffectiveAction:e.onEffectiveAction||function(){},onDeadClick:e.onDeadClick||function(){}},this.handleClick=this.handleClick.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this)}function Uf(e){var t;this.isUploading=!1,this.useCompression=!1,this.config={uploadUrl:e.uploadUrl||"/api/v1/collect/replay",appId:e.appId,maxRetries:null!=(t=e.maxRetries)?t:3,beforeSend:e.beforeSend||function(e){return e},onError:e.onError||function(){},eventsCompression:null==(t=e.eventsCompression)||t,transport:e.transport}}function zf(e){return Number.isNaN(e)?0:Math.max(0,Math.min(1,e))}function Bf(e){return zf((e=e,(Number.isNaN(e)?0:Math.max(0,Math.min(100,e)))/100))}function jf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Wf(e,t){var e=!1===(e=e)||void 0===e?{enabled:!1,sessionSampleRate:.1,errorSampleRate:1,errorTraceback:!0}:!0===e?{enabled:!0,sessionSampleRate:.1,errorSampleRate:1,errorTraceback:!0}:{enabled:!1!==e.enabled,sessionSampleRate:"number"==typeof e.sessionSampleRate?zf(e.sessionSampleRate):.1,errorSampleRate:"number"==typeof e.errorSampleRate?zf(e.errorSampleRate):1,errorTraceback:void 0===e.errorTraceback||!!e.errorTraceback},t=t&&"object"==typeof t?t:null,n=e.enabled,r=(t&&jf(t,"enabled")&&(n=e.enabled&&!!t.enabled),e.sessionSampleRate),i=e.errorSampleRate,e=e.errorTraceback;return n&&t&&(jf(t,"replay_sample_rate")&&null!=t.replay_sample_rate&&(r=Bf(Number(t.replay_sample_rate))),jf(t,"error_traceback")&&null!=t.error_traceback&&(e=!!t.error_traceback),jf(t,"error_sample_rate"))&&null!=t.error_sample_rate&&(i=Bf(Number(t.error_sample_rate))),{enabled:n,sessionSampleRate:r,errorSampleRate:e?i:0,errorTraceback:e}}function Hf(e,t){return x(x({},e),{enabled:t.enabled,sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,errorTraceback:t.errorTraceback})}function qf(e){var t=null==(t=e)?void 0:t._tdemSampleGate;if(!t)return 1;if(t.isDecided&&t.isSampled)return(!(t=e._effectiveReplayPolicy)||t.enabled)&&!1!==e._replaySampled}new e({name:"sessionReplay"});function Vf(e,t){return void 0===t&&(t=2),"number"==typeof e&&Number.isFinite(e)?(t=Math.pow(10,Math.max(0,Math.min(12,Math.floor(t)))),Math.round(e*t)/t):0}function Gf(e,t){return void 0===t&&(t=2048),"string"==typeof e&&e.trim()?e.trim().slice(0,Math.max(1,Math.floor(t))):"unknown"}function Zf(e){var t,n=dp.get(e);if(n){n.destroyed=!0;try{null!=(t=n.observer)&&t.disconnect()}catch(e){}n.observer=null,n.lagRecords.length=0,e.lifeCycle.remove("destroy",n.onDestroy),dp.delete(e)}}function Jf(e){var t=e.nodeName.toLowerCase(),n=e.id||"",r=(e="string"==typeof(e=e).className?e.className:e.getAttribute("class")||"").split(" ").filter(Boolean).map(function(e){return"."+e}).join("");return{tagName:t,id:n,className:e,selector:t+(n?"#"+n:"")+r}}function Kf(t,e){var n;if(null!=(n=null==e?void 0:e.tagName)&&n.some(function(e){return t.tagName===e.toLowerCase().trim()}))return!0;if(t.id&&null!=(n=null==e?void 0:e.id)&&n.some(function(e){return t.id===e.trim()}))return!0;if(t.className&&null!=(n=null==e?void 0:e.className)&&n.length){var r=t.className.split(" ").map(function(e){return e.trim()}).filter(Boolean);if(e.className.some(function(e){return r.includes(e.trim())}))return!0}return!1}function $f(t,e){return e.some(function(e){return t.selector.includes(e)})}function Xf(e){return{tagName:g(e.tagName||[]),id:g(e.id||[]),className:g(e.className||[])}}function Yf(){return x(x({},fp),{containers:g(fp.containers),ignoreContainers:g(fp.ignoreContainers),containerMatchers:Xf(fp.containerMatchers),ignoreMatchers:Xf(fp.ignoreMatchers),detectStartPosition:x({},fp.detectStartPosition),ignoreElesWhenDomChange:g(fp.ignoreElesWhenDomChange)})}function Qf(e,t){return void 0===t&&(t=2),t=Math.pow(10,t),Math.round(e*t)/t}function ep(e){var t,n=mp.get(e);n&&(n.destroyed=!0,n.detectTimer&&clearTimeout(n.detectTimer),n.bodyWaitTimer&&clearTimeout(n.bodyWaitTimer),null!==n.idleCallbackId&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(n.idleCallbackId),n.idleCallbackId=null),null!==n.bodyWaitFrame&&(window.cancelAnimationFrame||clearTimeout)(n.bodyWaitFrame),null!=(t=n.observer)&&t.disconnect(),e.lifeCycle.remove("errorOccurred",n.onErrorOccurred),e.lifeCycle.remove("destroy",n.onDestroy),window.removeEventListener("pagehide",n.handlePageHide),window.removeEventListener("beforeunload",n.handleBeforeUnload),document.removeEventListener("visibilitychange",n.handleVisibilityChange),mp.delete(e))}function tp(e,t,n){null!=(e=null==e?void 0:e.config)&&e.debug&&"undefined"!=typeof console&&console.warn("[TDEM] "+t+": "+n+", fallback applied")}function np(){var e;try{var t=null==(e=window.performance)?void 0:e.memory;return!t||!yp(t.usedJSHeapSize)||!yp(t.totalJSHeapSize)||!yp(t.jsHeapSizeLimit)||t.usedJSHeapSize<0||t.totalJSHeapSize<0||t.jsHeapSizeLimit<0?null:{used:t.usedJSHeapSize,total:t.totalJSHeapSize,limit:t.jsHeapSizeLimit,ratio:0<t.jsHeapSizeLimit?Math.min(1,t.usedJSHeapSize/t.jsHeapSizeLimit):0}}catch(e){return null}}function rp(e){var t=gp.get(e);t&&(t.destroyed=!0,t.reportTimer&&clearInterval(t.reportTimer),t.oomCheckTimer&&clearInterval(t.oomCheckTimer),t.records.length=0,e.lifeCycle.remove("destroy",t.onDestroy),"undefined"!=typeof window&&(window.removeEventListener("pagehide",t.onPageExit),window.removeEventListener("beforeunload",t.onPageExit)),gp.delete(e))}function ip(e,t,n){var r,i,o;t.destroyed||(i=np())&&(t.records.push(i),50<t.records.length&&t.records.shift(),o=ot(e),n={event_id:A(),event_type:n,event_category:I.PERFORMANCE,timestamp:Date.now(),page_url:(null==(r=e.getOriginFrom)?void 0:r.call(e))||window.location.href,data:x(x({measurements:x({used_js_heap_size_bytes:i.used,total_js_heap_size_bytes:i.total,js_heap_size_limit_bytes:i.limit,usage_ratio:i.ratio},n===M.MEMORY_OOM?{oom_threshold_mb:t.config.oomThreshold}:{}),event_properties:{detection_source:"performance_memory"}},o?{replay_id:o}:{}),{tags:{environment:(null==(r=e.config)?void 0:r.env)||"production",version:String((null==(i=e.config)?void 0:i.version)||"")}})},e.reportTDEMEvent(n))}var op=new e({name:"sessionReplay",sessionManager:null,eventBuffer:null,recorderManager:null,samplerManager:null,uploader:null,clickDetector:null,flushTimer:null,replayConfig:null,isInitialized:!1,errorTraceback:!0,_tdemRef:null,_isCheckoutFlushing:!1,_lastLifecycleSnapshotAt:0,init:function(e){},applyEffectivePolicy:function(e){var t,n;if(this.errorTraceback=e.errorTraceback,this.replayConfig&&(this.replayConfig=Hf(this.replayConfig,e)),this.samplerManager&&this.samplerManager.updateRates(e.sessionSampleRate,e.errorSampleRate),this.isInitialized){if(e.enabled)return(n=this.samplerManager)?0<e.sessionSampleRate||e.errorTraceback&&0<e.errorSampleRate?!e.errorTraceback&&n.isBufferMode()?(f("Plugin","Error traceback off while in buffer, stopping replay"),this.stopReplay(),null!=(t=this.eventBuffer)&&t.clear(),void n.forceMode(!1)):void(e.errorTraceback&&e.sessionSampleRate<=0&&0<e.errorSampleRate&&n.isSessionMode()&&(f("Plugin","Remote SSR=0 with traceback on: demote session→buffer"),n.forceMode("buffer"),this.flushTimer)&&(clearInterval(this.flushTimer),this.flushTimer=null)):(f("Plugin","Effective policy no longer allows recording, stopping"),this.stopReplay(),null!=(t=this.eventBuffer)&&t.clear(),void n.forceMode(!1)):void 0;f("Plugin","Effective policy disabled, stopping replay"),this.stopReplay(),null!=(e=this.eventBuffer)&&e.clear()}},shouldSkipBufferFlush:function(){var e;return!0===(null==(e=this.samplerManager)?void 0:e.isBufferMode())},onNewTdem:function(e,t){var n,r,t=this.parseConfig(t),i=null!=(i=t.debug)&&i,i=(Or=i,e._effectiveReplayPolicy);i||(i=Wf(t,(n=e._prefetchedConfigData)&&"object"==typeof n&&("replay_sample_rate"in n||"error_traceback"in n||"error_sample_rate"in n||"tdem_sample_rate"in n||"enabled"in n)?(r={},Object.prototype.hasOwnProperty.call(n,"enabled")&&(r.enabled=!!n.enabled),Object.prototype.hasOwnProperty.call(n,"replay_sample_rate")&&(r.replay_sample_rate=Number(n.replay_sample_rate)),Object.prototype.hasOwnProperty.call(n,"error_traceback")&&(r.error_traceback=!!n.error_traceback),Object.prototype.hasOwnProperty.call(n,"error_sample_rate")&&(r.error_sample_rate=Number(n.error_sample_rate)),r):null),e._effectiveReplayPolicy=i,e._replaySampled=i.enabled),i.enabled?(n=Hf(x(x({},t),{enabled:!0}),i),this.replayConfig=n,this.errorTraceback=i.errorTraceback,this._tdemRef=e,this.initializeModules(e,n),(r=this.samplerManager.initializeSampling()).shouldRecord?(this.startReplay(e,n,r.mode),this.registerReplaySamplingCheck(e,n),this.listenForErrors(e,n),this.listenForPerformance(e),this.listenForLifecycle(e,n),this.listenForUnload(e),this.isInitialized=!0):f("Plugin","Not sampled by sampler, skipping")):f("Plugin","disabled by effective policy")},registerReplaySamplingCheck:function(t,e){function n(e){clearInterval(i),e?(f("Plugin","Session/policy rejected, stopping replay and clearing buffer"),r.stopReplay(),r.eventBuffer&&r.eventBuffer.clear()):f("Plugin","Session sampled, replay continues")}var r=this,i=setInterval(function(){var e=null==(e=t)?void 0:e._tdemSampleGate;e&&e.isDecided&&(e.isSampled&&(!(e=t._effectiveReplayPolicy)||e.enabled)?n(!1):n(!0))},50);t.lifeCycle.on("destroy",function(){clearInterval(i)})},parseConfig:function(e){return!0===e?{enabled:!0}:"object"==typeof e?x(x({},e),{enabled:!1!==e.enabled}):{enabled:!1}},initializeModules:function(t,e){var n=this,r=(this.sessionManager=new Ar({stickySession:null==(r=e.stickySession)||r}),this.sessionManager.setTdemInstance(t),t.sessionManager=this.sessionManager,this.eventBuffer=new Fr({},null!=(r=e.useCompression)&&r),this.samplerManager=new Uc({sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate}),this.recorderManager=new Fc({onRecordingEvent:function(e){n.handleRecordingEvent(e,t)},onCheckout:function(){if(!n._isCheckoutFlushing){n._isCheckoutFlushing=!0;try{var e,t;n.shouldSkipBufferFlush()?f("SessionReplay","Checkout in buffer mode (error traceback), skip flush"):(e=n._tdemRef,t=n.replayConfig,e&&t&&n.eventBuffer&&!n.eventBuffer.isEmpty()&&(f("SessionReplay","Checkout triggered, flushing current buffer"),n.flushReplayData(e,t,!0)))}finally{n._isCheckoutFlushing=!1}}},mode:"session"},e),(t.config.url||t.config.hostUrl||"").replace(/\/+$/,""));this.uploader=new Df({uploadUrl:e.uploadUrl||r+"/api/v1/collect/replay",appId:String(t.config.id||""),beforeSend:e.beforeSend,onError:e.onError,eventsCompression:null==(r=e.eventsCompression)||r,transport:null==(r=t.getInternalTransport)?void 0:r.call(t)}),this.clickDetector=new Nf({slowClickTimeout:e.slowClickTimeout,slowClickThreshold:e.slowClickThreshold,rageClickCount:e.rageClickCount,rageClickWindow:e.rageClickWindow,onSlowClick:function(e){n.handleSlowClick(e,t)},onRageClick:function(e){n.handleRageClick(e,t)}}),f("Plugin","Modules initialized")},startReplay:function(e,t,n){var r;this.sessionManager&&this.recorderManager&&this.eventBuffer?(f("Plugin","Session started:",(this.sessionManager.restoreSession()||this.sessionManager.createSession(n)).id,"mode:",n),this.recorderManager.options.mode=n,r=Dc(x({maskAllText:!1!==t.maskAllInputs,maskAllInputs:t.maskAllInputs,maskTextSelector:t.maskTextSelector,blockSelector:t.blockSelector,ignoreSelector:t.ignoreSelector},t.privacy)),this.recorderManager.startRecording({privacy:r}),this.clickDetector&&this.clickDetector.start(),"session"===n?this.startFlushTimer(e,t):f("Plugin","Buffer mode - flush on error only")):Ir("Plugin","Modules not initialized")},handleRecordingEvent:function(e,t){this.eventBuffer&&this.sessionManager&&(this.sanitizeDataURLs(e),this.eventBuffer.addEvent(e),this.sessionManager.updateActivity())},sanitizeDataURLs:function(e){var t=e.type;if(2===t){var n=null==(n=e.data)?void 0:n.node;n&&this.sanitizeNodeTree(n,1024)}else if(3===t){n=e.data;if(0===(null==n?void 0:n.source)&&Array.isArray(n.adds)){for(var r=0,i=n.adds;r<i.length;r++){var o=i[r];null!=o&&o.node&&this.sanitizeNodeTree(o.node,1024)}if(Array.isArray(n.attributes))for(var a=0,s=n.attributes;a<s.length;a++){var l=s[a];if(null!=l&&l.attributes)for(var u=0,c=Object.entries(l.attributes);u<c.length;u++){var d=c[u],h=d[0],d=d[1];"string"==typeof d&&1024<d.length&&d.startsWith("data:")&&(l.attributes[h]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}}}}},sanitizeNodeTree:function(e,t){if(e){if(e.attributes)for(var n=e.attributes,r=0,i=Object.keys(n);r<i.length;r++){var o=i[r],a=n[o];"string"==typeof a&&a.length>t&&a.startsWith("data:")&&(n[o]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}if(Array.isArray(e.childNodes))for(var s=0,l=e.childNodes;s<l.length;s++){var u=l[s];this.sanitizeNodeTree(u,t)}}},handleSlowClick:function(e,t){f("ClickDetector","Slow click detected:",e.timeAfterClickMs,"ms"),this.addCustomEvent({category:"ui.slowClickDetected",message:"Slow click: "+e.timeAfterClickMs+"ms on "+e.node.tagName,data:{node:e.node,timeAfterClickMs:e.timeAfterClickMs,endReason:e.endReason}},t)},handleRageClick:function(e,t){f("ClickDetector","Rage click detected:",e.clickCount,"clicks"),this.addCustomEvent({category:"ui.multiClick",message:"Rage click: "+e.clickCount+" clicks on "+e.node.tagName,data:{node:e.node,clickCount:e.clickCount,timeWindowMs:e.timeWindowMs}},t)},addCustomEvent:function(e,t){this.eventBuffer&&(e={type:5,data:{tag:e.category,payload:x({message:e.message},e.data)},timestamp:Date.now()},this.eventBuffer.addEvent(e))},startFlushTimer:function(e,t){var n=this;this.flushTimer&&clearInterval(this.flushTimer),this.flushTimer=setInterval(function(){n.flushReplayData(e,t)},2e4)},flushReplayData:function(c,d,h){return void 0===h&&(h=!1),P(this,void 0,void 0,function(){var t,n,r,i,o,a,s,l,u;return D(this,function(e){switch(e.label){case 0:return this.sessionManager&&this.eventBuffer&&this.uploader&&qf(c)&&(t=this.sessionManager.getSession())?this.sessionManager.shouldRefreshSession()?(f("Plugin","Session expired, refreshing"),this.stopReplay(),i=this.sessionManager.refreshSession(),c.lifeCycle.emit("sessionRefreshed"),n=c._replaySampled,i.sampled&&!1!==n&&this.startReplay(c,d,i.sampled),[2]):this.eventBuffer.isEmpty()?[2]:(n=this.eventBuffer.getEventCount(),!h&&n<10?(f("Flush","Skipping flush, only "+n+" events (min: 10)"),[2]):(0!==t.segmentId||this.eventBuffer.hasCheckout()||(Mr("Flush","First segment missing FullSnapshot, triggering manual checkout"),this.recorderManager&&this.recorderManager.takeFullSnapshot()),[4,this.eventBuffer.finishAsync()])):[2];case 1:if(0===(r=e.sent()).eventCount)return[2];if(0===(i=r.events).length&&r.eventsJson)try{i=JSON.parse(r.eventsJson)}catch(e){return Ir("Flush","Failed to parse eventsJson from worker:",e),[2]}s=this.splitEventsIntoChunks(i),f("Flush","Flushing "+r.eventCount+" events in "+s.length+" chunk(s), total size: "+Math.round(r.uncompressedSize/1024)+"KB"),o=!0,a=0,s=s,e.label=2;case 2:return a<s.length?(l=s[a],l=JSON.stringify(l),l={project_key:String(c.config.id||""),session_id:t.id,replay_id:t.replayId,segment_id:this.sessionManager.incrementSegmentId(),timestamp:Date.now(),replay_start_timestamp:t.started,replay_format:"rrweb",platform:"web",events_encoding:"plain_json",events:l},[4,this.uploader.uploadReplay(l)]):[3,5];case 3:if(!e.sent())return o=!1,[3,5];e.label=4;case 4:return a++,[3,2];case 5:return l=this.eventBuffer.isUsingWorker(),u=l?"(worker)":"(sync)",f("Flush","Flushing "+r.eventCount+" events, size: "+Math.round(r.uncompressedSize/1024)+"KB "+u),o&&(this.eventBuffer.clear(),this.sessionManager.saveSession()),[2]}})})},splitEventsIntoChunks:function(e,t,n){if(void 0===t&&(t=3145728),void 0===n&&(n=5242880),0===e.length)return[];var r=JSON.stringify(e);if(r.length<=t)return[e];Mr("Split","Events size "+Math.round(r.length/1024)+"KB exceeds limit "+Math.round(t/1024)+"KB, splitting");for(var i=[],o=[],a=2,s=0,l=e;s<l.length;s++){var u,c,d=l[s],h=JSON.stringify(d).length+1;0<o.length&&t<a+h&&(i.push(o),o=[],a=2),n<h?((c=2===(u=d.type)||4===u)?Ir:Mr)("Split","Single event too large ("+Math.round(h/1024)+"KB), type="+u+(c?" (baseline snapshot, replay may become unplayable)":"")+", skipping"):(o.push(d),a+=h)}return 0<o.length&&i.push(o),i},stopReplay:function(){this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.recorderManager&&this.recorderManager.stopRecording(),this.clickDetector&&this.clickDetector.stop(),f("Plugin","Recording stopped")},listenForErrors:function(t,n){var r=this;t.lifeCycle.on("errorOccurred",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){e&&r.handleError(e,t,n)})}),t.lifeCycle.on("tdemEventCreated",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){r.isErrorTDEMEvent(e)&&r.handleError(e,t,n)})})},isErrorTDEMEvent:function(e){return!!e&&("error"===String(e.event_category||"").toLowerCase()||(e=String(e.event_type||"").toLowerCase(),["js_error","promise_error","resource_error","api_error"].includes(e)))},handleError:function(e,t,n){this.samplerManager&&(this.samplerManager.isBufferMode()&&this.samplerManager.onErrorOccurred(e)&&(f("Plugin","Converting to session mode due to error"),this.flushReplayData(t,n,!0),this.startFlushTimer(t,n)),this.addCustomEvent({category:"error",message:(null==e?void 0:e.msg)||(null==e?void 0:e.message)||"Unknown error",data:{type:(null==e?void 0:e.type)||"error",stack:null==e?void 0:e.stack}},t))},listenForPerformance:function(n){var r=this;if(n.lifeCycle.on("afterReportWebVitals",function(e){r.handlePerformanceEvent("webVitals",e,n)}),n.lifeCycle.on("afterReportPagePerformance",function(e){r.handlePerformanceEvent("pageLoad",e,n)}),"undefined"!=typeof PerformanceObserver)try{var e=new PerformanceObserver(function(e){var t,e=e.getEntries(),e=e[e.length-1];e&&r.addCustomEvent({category:"performance.lcp",message:"LCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime,element:(null==(t=e.element)?void 0:t.tagName)||"unknown",size:e.size}},n)}),t=(e.observe({type:"largest-contentful-paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){"first-contentful-paint"===e.name&&r.addCustomEvent({category:"performance.fcp",message:"FCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime}},n)})})),i=(t.observe({type:"paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){100<e.duration&&r.addCustomEvent({category:"performance.longTask",message:"Long Task: "+Math.round(e.duration)+"ms",data:{duration:e.duration,startTime:e.startTime}},n)})}));i.observe({type:"longtask",buffered:!0}),n.lifeCycle.on("destroy",function(){e.disconnect(),t.disconnect(),i.disconnect()})}catch(n){}},handlePerformanceEvent:function(e,n,r){var i=this;n&&("webVitals"===e?["LCP","FCP","FID","CLS","TTFB","TTI","INP"].forEach(function(e){var t=n[e];void 0!==t&&-1!==t&&0<t&&i.addCustomEvent({category:"performance."+e.toLowerCase(),message:e+": "+("number"==typeof t?Math.round(t):t)+("CLS"===e?"":"ms"),data:{metric:e,value:t}},r)}):"pageLoad"===e&&this.addCustomEvent({category:"performance.pageLoad",message:"Page Load: "+(n.firstScreenTiming?Math.round(n.firstScreenTiming):"N/A")+"ms",data:{dnsLookup:n.dnsLookup,tcp:n.tcp,ssl:n.ssl,ttfb:n.ttfb,contentDownload:n.contentDownload,domParse:n.domParse,resourceDownload:n.resourceDownload,firstScreenTiming:n.firstScreenTiming}},r))},listenForLifecycle:function(o,t){var n,e,a=this;"undefined"!=typeof document&&(n=function(e){var t,n=null==(n=a.sessionManager)?void 0:n.getSession(),n=(null==n?void 0:n.replayId)||"",r=(null==(r=null==(i=o)?void 0:i.getOriginFrom)?void 0:r.call(i))||("undefined"!=typeof location?location.href:""),i="undefined"!=typeof document&&document.title||"";null!=(t=o.reportTDEMEvent)&&t.call(o,{event_id:A(),event_type:e,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:r,data:{page_title:i,replay_id:n,is_effective_action:!1,tags:{environment:o.config.env||"production",version:String(o.config.version||"")},event_properties:{visibility_state:"undefined"!=typeof document?document.visibilityState:"",lifecycle_type:e}}})},document.addEventListener("visibilitychange",e=function(){var e;if("undefined"!=typeof document){if("hidden"===document.visibilityState)return n(M.TAB_HIDDEN),a.shouldSkipBufferFlush()?void f("Lifecycle","Buffer mode (error traceback), skip flush on hidden"):void a.flushReplayData(o,t,!0);"visible"===document.visibilityState&&(n(M.TAB_VISIBLE),(e=Date.now())-a._lastLifecycleSnapshotAt<5e3||(a._lastLifecycleSnapshotAt=e,null!=(e=a.recorderManager)&&e.takeFullSnapshot(),a.shouldSkipBufferFlush()?f("Lifecycle","Buffer mode (error traceback), skip flush on visible"):a.flushReplayData(o,t,!0)))}}),o.lifeCycle.on("destroy",function(){document.removeEventListener("visibilitychange",e)}))},listenForUnload:function(e){function t(){n.flushOnUnload(e)}var n=this;window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t),e.lifeCycle.on("destroy",function(){window.removeEventListener("beforeunload",t),window.removeEventListener("pagehide",t)})},flushOnUnload:function(e){if(this.sessionManager&&this.eventBuffer&&this.uploader&&qf(e))if(this.shouldSkipBufferFlush())f("Unload","Buffer mode (error traceback), skip flush on unload");else{var t=this.sessionManager.getSession();if(t&&(this.recorderManager&&this.recorderManager.stopRecording(),this.clickDetector&&this.clickDetector.stop(),!this.eventBuffer.isEmpty())){var n=this.eventBuffer.finish();if(0!==n.eventCount){for(var n=this.splitEventsIntoChunks(n.events,51200,51200),r=0,i=0,o=0,a=n;o<a.length;o++){var s=a[o],s={project_key:String(e.config.id||""),session_id:t.id,replay_id:t.replayId,segment_id:this.sessionManager.incrementSegmentId(),timestamp:Date.now(),replay_start_timestamp:t.started,replay_format:"rrweb",platform:"web",events_encoding:"plain_json",events:JSON.stringify(s)};this.uploader.sendBeacon(s)?r++:(i++,Mr("Unload","sendBeacon rejected chunk (segment_id="+s.segment_id+"), likely exceeds 64KB browser limit or queue full"))}f("SessionReplay","sendBeacon on unload: "+r+"/"+n.length+" chunk(s) queued, "+i+" rejected")}}}},destroy:function(){this.stopReplay(),this.sessionManager&&this.sessionManager.saveSession(),this.sessionManager=null,this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,this.recorderManager=null,this.samplerManager=null,this.uploader=null,this.clickDetector=null,this.replayConfig=null,this._tdemRef=null,this._isCheckoutFlushing=!1,this._lastLifecycleSnapshotAt=0,this.isInitialized=!1,f("Plugin","destroyed")}}),ap={enabled:!0,ruleVersion:"1.0.0",payloadAllowlist:[],click:{enabled:!0,deadClickWindowMs:3e3,rageClickWindowMs:1e3,rageClickCount:5,errorClickWindowMs:3e3,resolveOnDomMutation:!0,resolveOnSpaNavigation:!0,resolveOnExternalNavigation:!0,resolveOnWindowOpen:!0,resolveOnPageUnload:!0,resolveOnFormAction:!0,resolveOnApiSuccess:!0,ignoreDeadClickSelectors:[],effectiveActionSelectors:[]},performance:{enabled:!0,slowPageLcpThreshold:4e3,slowPageInpThreshold:500},form:{enabled:!0,fieldIdAttr:"data-field-id",formIdAttr:"data-form-id",longFocusThresholdMs:2e4,incompleteMinFieldRatio:.3,zigzagMinCount:2},navigation:{enabled:!0,backForwardAsStruggle:!0},custom:{enabled:!0,detector:void 0}},sp=new Set([M.JS_ERROR,M.PROMISE_ERROR,M.RESOURCE_ERROR,M.API_ERROR]),lp=new Set([M.FORM_CHANGE,M.FORM_SUBMIT,M.FORM_SUBMIT_RESULT]),up=(new e({name:"struggleMonitor"}),new e({name:"struggleMonitor",instanceStates:new Map,originalWindowOpen:null,windowOpenHooked:!1,onNewTdem:function(t){var n,r=this,e=!0===(e=this.$getConfig(t))?x({},ap):e&&"object"==typeof e?x(x(x({},ap),e),{click:x(x({},ap.click),e.click||{}),performance:x(x({},ap.performance),e.performance||{}),form:x(x({},ap.form),e.form||{}),navigation:x(x({},ap.navigation),e.navigation||{}),custom:x(x({},ap.custom),e.custom||{}),payloadAllowlist:(Array.isArray(e.payloadAllowlist)?e:ap).payloadAllowlist,enabled:!1!==e.enabled}):x(x({},ap),{enabled:!1});e.enabled&&(n={config:e,clickDetector:null,recentClicks:[],pendingDeadClicks:new Map,focusStartMap:new Map,formStateMap:new Map,removeDomListeners:[],onEventCreated:null,onDestroy:null},this.instanceStates.set(t,n),this.initClickDetector(t,n),this.initFormListeners(t,n),n.onEventCreated=function(e){r.handleEventCreated(t,n,e||[])},t.lifeCycle.on("tdemEventCreated",n.onEventCreated),n.onDestroy=function(){return r.cleanupInstance(t)},t.lifeCycle.on("destroy",n.onDestroy))},initClickDetector:function(t,n){var e,r=this;"undefined"!=typeof window&&"undefined"!=typeof document&&(n.clickDetector=new Nf({slowClickTimeout:null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,slowClickThreshold:null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,rageClickCount:null!=(e=null==(e=n.config.click)?void 0:e.rageClickCount)?e:5,rageClickWindow:null!=(e=null==(e=n.config.click)?void 0:e.rageClickWindowMs)?e:1e3,onRageClick:function(e){r.onRageClick(t,n,e)},onClickStart:function(e){r.onClickStart(t,n,e)},onEffectiveAction:function(e){r.onEffectiveAction(n,e)},onSlowClick:function(e){r.onSlowClick(t,n,e)}}),n.clickDetector.start(),this.initClickEffectiveActionListeners(n),this.initWindowOpenHook())},initClickEffectiveActionListeners:function(n){var e,t=this;"undefined"!=typeof window&&((e=function(e,t){window.addEventListener(e,t),n.removeDomListeners.push(function(){window.removeEventListener(e,t)})})("pagehide",function(){var e;!1!==(null==(e=n.config.click)?void 0:e.resolveOnPageUnload)&&(t.resolvePendingDeadClicks(n,"page_unload"),null!=(e=n.clickDetector))&&e.markEffectiveAction("page_unload")}),e("beforeunload",function(){var e;!1!==(null==(e=n.config.click)?void 0:e.resolveOnPageUnload)&&(t.resolvePendingDeadClicks(n,"page_unload"),null!=(e=n.clickDetector))&&e.markEffectiveAction("page_unload")}))},initWindowOpenHook:function(){var r,i;"undefined"==typeof window||this.windowOpenHooked||(r=window.open,this.originalWindowOpen=r,this.windowOpenHooked=!0,i=this,window.open=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.apply(window,e);return i.resolveWindowOpenActions(),n})},resolveWindowOpenActions:function(){var n=this,r=Date.now();this.instanceStates.forEach(function(e){var t;!1!==(null==(t=e.config.click)?void 0:t.resolveOnWindowOpen)&&(null!=(t=e.clickDetector)&&t.markEffectiveAction("window_open"),n.resolvePendingDeadClicks(e,"window_open",r,n.getCurrentPageUrl()))})},restoreWindowOpenHook:function(){"undefined"!=typeof window&&this.windowOpenHooked&&this.originalWindowOpen&&(window.open=this.originalWindowOpen,this.originalWindowOpen=null,this.windowOpenHooked=!1)},initFormListeners:function(r,i){var e,t,o=this;null!=(t=i.config.form)&&t.enabled&&"undefined"!=typeof document&&((t=function(e,t,n){void 0===n&&(n=!0),document.addEventListener(e,t,n),i.removeDomListeners.push(function(){document.removeEventListener(e,t,n)})})("focusin",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,M.FORM_FOCUS,e,e.form||void 0)}),t("focusout",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,M.FORM_BLUR,e,e.form||void 0)}),t("change",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,M.FORM_CHANGE,e,e.form||void 0)}),t("submit",function(e){e=e.target;e instanceof HTMLFormElement&&o.reportFormEvent(r,i,M.FORM_SUBMIT,null,e)}),t("invalid",function(e){var t,n,e=o.getTrackableField(e.target);e&&(n=e.form||void 0,n=o.buildFormBaseData(r,i,e,n),n={event_id:A(),event_type:M.FORM_SUBMIT_RESULT,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:"undefined"!=typeof window?window.location.href:(null==(t=r.getOriginFrom)?void 0:t.call(r))||"",data:x(x({},n),{event_name:"form_submit_fail",is_effective_action:!0,validation_message:e.validationMessage||void 0,event_properties:x(x({},n.event_properties||{}),{status:"fail",validation_code:!1===(null==(t=e.validity)?void 0:t.valid)?"invalid":"validation_error"})})},null!=(e=r.reportTDEMEvent))&&e.call(r,n)}),e=function(){o.reportPendingUncompletedForms(r,i,"pagehide")},"undefined"!=typeof window)&&(window.addEventListener("pagehide",e),i.removeDomListeners.push(function(){window.removeEventListener("pagehide",e)}))},getTrackableField:function(e){return!(e&&e instanceof Element)||!(e=e.closest("input, textarea, select"))||e instanceof HTMLInputElement&&["button","submit","reset","image","hidden"].includes(e.type)?null:e},buildFormBaseData:function(e,t,n,r){var n=n||null,r=r||(null==n?void 0:n.form)||void 0,i=(null==(i=t.config.form)?void 0:i.fieldIdAttr)||"data-field-id",t=(null==(t=t.config.form)?void 0:t.formIdAttr)||"data-form-id",i=n?n.getAttribute(i)||n.id||n.name||n.tagName.toLowerCase()+"_"+(n.type||"field"):void 0,t=r&&(r.getAttribute(t)||r.id||r.getAttribute("name")||r.getAttribute("action"))||void 0,o="string"==typeof(null==(o=n)?void 0:o.value)?n.value.length:0,o=0===o?"0":o<=10?"1_10":o<=50?"11_50":"51_plus";return{replay_id:ot(e),is_effective_action:!0,form_id:t,field_id:i,tags:{},event_properties:{field_name:(null==n?void 0:n.name)||"",field_type:(null==n?void 0:n.type)||(null==(e=null==n?void 0:n.tagName)?void 0:e.toLowerCase())||"",form_name:(null==r?void 0:r.getAttribute("name"))||"",is_required:String(!(null==n||!n.required)),value_length_bucket:String(o)}}},reportFormEvent:function(e,t,n,r,i){var t=this.buildFormBaseData(e,t,r,i),i="undefined"!=typeof window?window.location.href:(null==(r=e.getOriginFrom)?void 0:r.call(e))||"",r={event_id:A(),timestamp:Date.now(),page_url:i};n!==M.FORM_FOCUS?n!==M.FORM_BLUR?n!==M.FORM_CHANGE?(i=x(x({},r),{event_type:M.FORM_SUBMIT,event_category:I.BEHAVIOR,data:x(x({},t),{submit_method:"native_submit"})}),null!=(n=e.reportTDEMEvent)&&n.call(e,i)):(n=x(x({},r),{event_type:M.FORM_CHANGE,event_category:I.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,n)):(i=x(x({},r),{event_type:M.FORM_BLUR,event_category:I.BEHAVIOR,data:t}),null!=(n=e.reportTDEMEvent)&&n.call(e,i)):(n=x(x({},r),{event_type:M.FORM_FOCUS,event_category:I.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,n))},onClickStart:function(e,t,n){var r,i=t.config.click||ap.click;!1!==i.enabled&&(r=n.node.selector||n.node.tagName||"unknown",this.shouldIgnoreDeadClick(n.target,i)?this.resolvePendingDeadClicks(t,"custom",n.timestamp,this.getCurrentPageUrl()):this.scheduleDeadClick(e,t,{pendingId:"pending_"+n.timestamp+"_"+Math.random().toString(16).slice(2),timestamp:n.timestamp,pageUrl:this.getCurrentPageUrl(),ownerKey:r,node:n.node}))},onEffectiveAction:function(e,t){this.shouldResolveByReason(e,t.reason)&&this.resolvePendingDeadClicks(e,t.reason,t.timestamp,this.getCurrentPageUrl())},scheduleDeadClick:function(t,n,r){var i=this,o=null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,e=setTimeout(function(){var e=n.pendingDeadClicks.get(r.pendingId);e&&(n.pendingDeadClicks.delete(r.pendingId),i.emitDeadClick(t,n,e,o))},o);n.pendingDeadClicks.set(r.pendingId,x(x({},r),{timeout:e}))},emitDeadClick:function(e,t,n,r){var i,o=n.clickEventId?[n.clickEventId]:void 0;null!=(i=e.reportStruggle)&&i.call(e,{type:"dead_click",ownerType:"element",ownerKey:n.ownerKey,pageUrl:n.pageUrl,triggerEventId:n.clickEventId,relatedEventIds:o,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{timeout_ms:r,selector:n.node.selector||""}})},resolvePendingDeadClicks:function(r,i,o,a){void 0===o&&(o=Date.now());var e,s=null!=(e=null==(e=r.config.click)?void 0:e.deadClickWindowMs)?e:3e3;r.pendingDeadClicks.forEach(function(e,t){var n=o-e.timestamp;n<0||s<n||"spa_navigation"!==i&&"page_unload"!==i&&a&&e.pageUrl&&a!==e.pageUrl||(clearTimeout(e.timeout),r.pendingDeadClicks.delete(t))})},linkPendingDeadClickToClickEvent:function(e,n,r){var i=n.timestamp||Date.now(),o=this.getEventPageUrl(n);e.pendingDeadClicks.forEach(function(e){var t;e.clickEventId||(t=i-e.timestamp)<0||1e3<t||o&&e.pageUrl&&o!==e.pageUrl||(e.clickEventId=n.event_id,r&&"unknown"!==r&&(e.ownerKey=r))})},shouldResolveByReason:function(e,t){e=e.config.click||ap.click;return!1!==e.enabled&&("dom_mutation"===t?!1!==e.resolveOnDomMutation:"spa_navigation"===t?!1!==e.resolveOnSpaNavigation:"external_navigation"===t||"download"===t?!1!==e.resolveOnExternalNavigation:"window_open"===t?!1!==e.resolveOnWindowOpen:"page_unload"===t?!1!==e.resolveOnPageUnload:"form_change"===t||"form_submit"===t?!1!==e.resolveOnFormAction:"api_success"!==t||!1!==e.resolveOnApiSuccess)},shouldIgnoreDeadClick:function(t,e){return g(e.ignoreDeadClickSelectors||[],e.effectiveActionSelectors||[]).some(function(e){try{return!!e&&!!t.closest(e)}catch(e){return!1}})},getCurrentPageUrl:function(){return"undefined"==typeof window?"":window.location.href},getEventPageUrl:function(e){return(null==e?void 0:e.page_url)||(null==(e=null==e?void 0:e.data)?void 0:e.page_url)||""},onRageClick:function(e,t,n){var r=n.node.selector||n.node.tagName||"unknown",i=null!=(o=null==(o=t.config.click)?void 0:o.rageClickWindowMs)?o:1e3,o=t.recentClicks.filter(function(e){return n.timestamp-e.timestamp<=i}).map(function(e){return e.eventId}).filter(Boolean).slice(-10),r={type:"rage_click",ownerType:"element",ownerKey:r,pageUrl:window.location.href,triggerEventId:o[0],relatedEventIds:o.length?o:void 0,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{clickCount:n.clickCount,timeWindowMs:n.timeWindowMs,selector:n.node.selector||""}};null!=(o=e.reportStruggle)&&o.call(e,r)},onSlowClick:function(e,t,n){},handleEventCreated:function(i,o,e){var t,a=this,s=Date.now(),n=o.config.click||ap.click,r=Math.max(null!=(t=n.errorClickWindowMs)?t:3e3,null!=(t=n.rageClickWindowMs)?t:1e3,null!=(t=n.deadClickWindowMs)?t:3e3);o.recentClicks=o.recentClicks.filter(function(e){return s-e.timestamp<=r}),e.forEach(function(e){var t,n,r;e&&e.event_type!==M.STRUGGLE&&(t=e.timestamp||s,n=a.getEventPageUrl(e),e.event_type===M.CLICK?(r=(null==(r=e.data)?void 0:r.target_element)||(null==(r=e.data)?void 0:r.target_id)||(null==(r=e.data)?void 0:r.target_class)||"unknown",o.recentClicks.push({eventId:e.event_id,timestamp:t,pageUrl:n,ownerKey:r}),a.linkPendingDeadClickToClickEvent(o,e,r)):(a.isEffectiveActionEvent(o,e)&&(a.resolvePendingDeadClicks(o,a.getEffectiveActionReason(e),t,n),null!=(r=o.clickDetector)&&r.markEffectiveAction(a.getEffectiveActionReason(e))),sp.has(e.event_type)?a.tryReportErrorClick(i,o,e):e.event_type===M.PAGE_LOAD||e.event_type===M.true?a.tryReportSlowPage(i,o,e):e.event_type===M.FORM_FOCUS?(a.trackFormFocus(o,e),a.trackFormChangeAndZigzag(i,o,e)):e.event_type===M.FORM_CHANGE?a.trackFormChangeAndZigzag(i,o,e):e.event_type===M.FORM_BLUR?a.tryReportLongFocusTime(i,o,e):e.event_type===M.FORM_SUBMIT?a.trackFormSubmitResult(o,e):e.event_type===M.FORM_SUBMIT_RESULT?(a.trackFormSubmitResult(o,e),a.tryReportFormValidationError(i,o,e)):e.event_type===M.PAGE_VIEW&&null!=(n=null==(t=e.data)?void 0:t.event_properties)&&n.navigation_type&&a.tryReportBackForward(i,o,e)),a.tryReportCustomStruggle(i,o,e))})},isEffectiveActionEvent:function(e,t){var n;return!1!==(null==(n=e.config.click)?void 0:n.enabled)&&(t.event_type===M.API_CALL?!1!==(null==(n=e.config.click)?void 0:n.resolveOnApiSuccess):t.event_type===M.PAGE_VIEW&&null!=(n=null==(n=t.data)?void 0:n.event_properties)&&n.navigation_type?!1!==(null==(n=e.config.click)?void 0:n.resolveOnSpaNavigation):lp.has(t.event_type)?!1!==(null==(n=e.config.click)?void 0:n.resolveOnFormAction):!0===(null==(e=t.data)?void 0:e.is_effective_action))},getEffectiveActionReason:function(e){return e.event_type===M.API_CALL?"api_success":e.event_type===M.PAGE_VIEW?"spa_navigation":e.event_type===M.FORM_CHANGE?"form_change":e.event_type===M.FORM_SUBMIT||e.event_type===M.FORM_SUBMIT_RESULT?"form_submit":"custom"},getFormStateKey:function(e,t){return e||t||"unknown_form"},ensureFormState:function(e,t,n){var r=this.getFormStateKey(t,n);return e.formStateMap.has(r)||e.formStateMap.set(r,{formId:t||r,pageUrl:n||"",touchedFieldIds:new Set,requiredFieldIds:new Set,changedFieldIds:new Set,focusPath:[],zigzagHits:0,hasSuccessSubmit:!1,reportedZigzag:!1,reportedUncompleted:!1}),e.formStateMap.get(r)},recordFormTouch:function(e,t){var n,e=this.ensureFormState(e,null==(e=null==t?void 0:t.data)?void 0:e.form_id,null==t?void 0:t.page_url),r=String((null==(r=null==t?void 0:t.data)?void 0:r.field_id)||"");return r&&(e.touchedFieldIds.add(r),!0===(null==(n=t.data)?void 0:n.is_required)&&e.requiredFieldIds.add(r),t.event_type===M.FORM_CHANGE)&&e.changedFieldIds.add(r),null!=t&&t.page_url&&(e.pageUrl=t.page_url),e},trackFormFocus:function(e,t){var n,r=t,i=String((null==(i=null==r?void 0:r.data)?void 0:i.field_id)||"");i&&((n=this.recordFormTouch(e,r)).focusPath.push(i),12<n.focusPath.length&&n.focusPath.shift(),e.focusStartMap.set(i,{timestamp:t.timestamp||Date.now(),eventId:t.event_id,formId:null==(n=null==r?void 0:r.data)?void 0:n.form_id,pageUrl:null==r?void 0:r.page_url}))},trackFormChangeAndZigzag:function(e,t,n){var r,i,o,a,s;n.event_type!==M.FORM_CHANGE?n.event_type!==M.FORM_FOCUS||(s=(i=this.recordFormTouch(t,r=n)).focusPath).length<4||i.reportedZigzag||(o=(s=s.slice(-4))[0],a=s[1],!o)||!a||o===a||o!==s[2]||a!==s[3]||i.changedFieldIds.size<2||(i.zigzagHits+=1,s=null!=(a=null==(o=t.config.form)?void 0:o.zigzagMinCount)?a:2,i.zigzagHits<s)||(i.reportedZigzag=!0,null==(o=e.reportStruggle))||o.call(e,{type:"form_zigzag",ownerType:"form",ownerKey:i.formId,pageUrl:i.pageUrl,formId:i.formId,fieldId:String((null==(a=null==r?void 0:r.data)?void 0:a.field_id)||""),triggerEventId:r.event_id,relatedEventIds:[r.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{zigzag_hits:i.zigzagHits,changed_field_count:i.changedFieldIds.size}}):this.recordFormTouch(t,n)},trackFormSubmitResult:function(e,t){t.event_type!==M.FORM_SUBMIT&&t.event_type!==M.FORM_SUBMIT_RESULT||((e=this.recordFormTouch(e,t)).lastSubmitEventId=t.event_id,t.event_type!==M.FORM_SUBMIT_RESULT)||"success"===(null==(t=null==(t=t.data)?void 0:t.event_properties)?void 0:t.status)&&(e.hasSuccessSubmit=!0)},reportPendingUncompletedForms:function(t,n,r){var i=this;n.formStateMap.forEach(function(e){i.tryReportUncompletedForm(t,n,e,r)})},tryReportUncompletedForm:function(e,t,n,r){var i,o,a,s;n.reportedUncompleted||n.hasSuccessSubmit||0===n.touchedFieldIds.size||(a=0<(o=n.requiredFieldIds.size)?o:n.touchedFieldIds.size)<=0||(a=n.changedFieldIds.size/a)<(s=null!=(s=null==(s=t.config.form)?void 0:s.incompleteMinFieldRatio)?s:.3)||(n.reportedUncompleted=!0,null==(i=e.reportStruggle))||i.call(e,{type:"uncompleted_form",ownerType:"form",ownerKey:n.formId,pageUrl:n.pageUrl,formId:n.formId,triggerEventId:n.lastSubmitEventId,relatedEventIds:n.lastSubmitEventId?[n.lastSubmitEventId]:void 0,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{touched_field_count:n.touchedFieldIds.size,changed_field_count:n.changedFieldIds.size,required_field_count:o,changed_ratio:Number(a.toFixed(4)),threshold_ratio:s}})},tryReportLongFocusTime:function(e,t,n){var r,i,o,a,s=String((null==(s=null==n?void 0:n.data)?void 0:s.field_id)||"");s&&(i=t.focusStartMap.get(s))&&(t.focusStartMap.delete(s),o=null!=(o=null==(o=t.config.form)?void 0:o.longFocusThresholdMs)?o:2e4,(a=Math.max((n.timestamp||Date.now())-i.timestamp,0))<o||null==(r=e.reportStruggle)||r.call(e,{type:"long_focus_time",ownerType:"field",ownerKey:s,pageUrl:(null==n?void 0:n.page_url)||i.pageUrl,formId:(null==(r=null==n?void 0:n.data)?void 0:r.form_id)||i.formId,fieldId:s,triggerEventId:n.event_id,relatedEventIds:[i.eventId||"",n.event_id].filter(Boolean),detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{focus_duration_ms:a,threshold_ms:o}}))},tryReportErrorClick:function(e,t,n){var r,i,o;t.recentClicks.length&&(i=null!=(o=(t.config.click||ap.click).errorClickWindowMs)?o:3e3,o=g(t.recentClicks).reverse().find(function(e){return 0<=n.timestamp-e.timestamp&&n.timestamp-e.timestamp<=i}))&&null!=(r=e.reportStruggle)&&r.call(e,{type:"error_click",ownerType:"element",ownerKey:o.ownerKey,pageUrl:o.pageUrl||n.page_url,triggerEventId:o.eventId,relatedEventIds:[n.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{errorEventType:n.event_type}})},tryReportSlowPage:function(e,t,n){var r,i,o,a=t.config.performance||ap.performance;a.enabled&&(i=(null==(i=n.data)?void 0:i.measurements)||{},r=Number(i.lcp||0),i=Number(i.inp||0),o=null!=(o=a.slowPageLcpThreshold)?o:4e3,a=null!=(a=a.slowPageInpThreshold)?a:500,o<=r||a<=i)&&null!=(o=e.reportStruggle)&&o.call(e,{type:"slow_page",ownerType:"page",ownerKey:n.page_url||("undefined"!=typeof window?window.location.href:""),pageUrl:n.page_url,triggerEventId:n.event_id,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{lcp:r,inp:i,sourceEventType:n.event_type}})},tryReportFormValidationError:function(e,t,n){var r,i,o,a,s=(null==(s=null==n?void 0:n.data)?void 0:s.event_properties)||{},l=(null==n?void 0:n.data)||{};"fail"===String((null==s?void 0:s.status)||(null===(i=l)?void 0:i.status)||"")&&(i=String((null==s?void 0:s.field_id)||(null===(i=l)?void 0:i.field_id)||""),o=String((null==s?void 0:s.form_id)||(null===(o=l)?void 0:o.form_id)||""),a=i||o||(null==n?void 0:n.page_url)||"unknown",null!=(r=e.reportStruggle))&&r.call(e,{type:"form_validation_error",ownerType:i?"field":"form",ownerKey:a,pageUrl:null==n?void 0:n.page_url,formId:o,fieldId:i,triggerEventId:n.event_id,relatedEventIds:[n.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{validation_code:(null==s?void 0:s.validation_code)||(null===(r=l)?void 0:r.validation_code),validation_message:null==(e=null==n?void 0:n.data)?void 0:e.validation_message,sourceEventType:n.event_type}})},tryReportBackForward:function(e,t,n){var r,i,o=t.config.navigation||ap.navigation;o.enabled&&o.backForwardAsStruggle&&(n=null==(n=null==(o=n)?void 0:o.data)?void 0:n.event_properties,"back"!==(i=String((null==n?void 0:n.navigation_type)||""))&&"forward"!==i||null==(r=e.reportStruggle)||r.call(e,{type:"back_forward",ownerType:"page",ownerKey:String((null==n?void 0:n.to_page)||"")||(null==o?void 0:o.page_url)||"unknown",pageUrl:null==o?void 0:o.page_url,triggerEventId:o.event_id,relatedEventIds:[o.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{navigation_type:i,from_page:null==n?void 0:n.from_page,to_page:null==n?void 0:n.to_page}}))},tryReportCustomStruggle:function(n,r,i){var e=r.config.custom||ap.custom;e.enabled&&"function"==typeof e.detector&&(e=e.detector({event:i,tdem:n}),(Array.isArray(e)?e:e?[e]:[]).forEach(function(e){var t,e=x(x({},e),{type:(null==e?void 0:e.type)||"custom_struggle",ownerType:(null==e?void 0:e.ownerType)||"app",ownerKey:(null==e?void 0:e.ownerKey)||i.page_url||"custom",ruleVersion:(null==e?void 0:e.ruleVersion)||r.config.ruleVersion,payloadAllowlist:(null==e?void 0:e.payloadAllowlist)||r.config.payloadAllowlist,detectionSource:(null==e?void 0:e.detectionSource)||"custom"});null!=(t=n.reportStruggle)&&t.call(n,e)}))},cleanupInstance:function(e){var t=this.instanceStates.get(e);t&&(t.onEventCreated&&e.lifeCycle.remove("tdemEventCreated",t.onEventCreated),t.onDestroy&&e.lifeCycle.remove("destroy",t.onDestroy),t.clickDetector&&t.clickDetector.stop(),t.pendingDeadClicks.forEach(function(e){clearTimeout(e.timeout)}),t.pendingDeadClicks.clear(),this.reportPendingUncompletedForms(e,t,"destroy"),t.focusStartMap.clear(),t.formStateMap.clear(),t.removeDomListeners.forEach(function(e){return e()}),t.removeDomListeners=[],this.instanceStates.delete(e),0===this.instanceStates.size)&&this.restoreWindowOpenHook()},destroy:function(){var n=this;this.instanceStates.forEach(function(e,t){n.cleanupInstance(t)}),this.instanceStates.clear(),this.restoreWindowOpenHook()}})),cp={enabled:!0,threshold:2e3,noResponseThreshold:5e3,sampleRate:1},dp=new Map,hp=new e({name:"lagMonitor",onNewTdem:function(o,e){t=e,void 0===(r=null!=(n=o.config)&&n.debug?function(e,t){"undefined"!=typeof console&&console.warn&&console.warn("[TDEM] "+e+": "+t+", fallback applied")}:function(){})&&(r=function(){});var t,r,n,a=!1===t?x(x({},cp),{enabled:!1}):!0===t||void 0===t?x({},cp):!t||"object"!=typeof t||Array.isArray(t)?(r("lagMonitor","invalid_type"),x({},cp)):(n=x({},cp),void 0!==t.enabled&&("boolean"==typeof t.enabled?n.enabled=t.enabled:r("lagMonitor.enabled","invalid_type")),n.threshold=(i=function(e,t,n){return void 0===e?n:"number"!=typeof e?(r(t,"invalid_type"),n):Number.isFinite(e)?e<=0?(r(t,"out_of_range"),n):e:(r(t,"invalid_number"),n)})(t.threshold,"lagMonitor.threshold",cp.threshold),n.noResponseThreshold=i(t.noResponseThreshold,"lagMonitor.noResponseThreshold",cp.noResponseThreshold),void 0!==t.sampleRate&&("number"!=typeof t.sampleRate?r("lagMonitor.sampleRate","invalid_type"):Number.isFinite(t.sampleRate)?t.sampleRate<0||1<t.sampleRate?r("lagMonitor.sampleRate","out_of_range"):n.sampleRate=t.sampleRate:r("lagMonitor.sampleRate","invalid_number")),n.noResponseThreshold<=n.threshold&&(n.noResponseThreshold=Math.max(5e3,n.threshold+1),r("lagMonitor.noResponseThreshold","relation_conflict")),n);if(a.enabled&&"undefined"!=typeof PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")&&(i=a.sampleRate,Math.random()<i)){var i,s=[],l={observer:null,lagRecords:s,sampled:!0,destroyed:!1,onDestroy:function(){return Zf(o)}};dp.set(o,l),o.lifeCycle.on("destroy",l.onDestroy);try{l.observer=new PerformanceObserver(function(e){if(!l.destroyed)try{e.getEntries().forEach(function(e){var t,n,r,i;l.destroyed||e.duration<=a.threshold||(t=null==(t=e.scripts)?void 0:t[0],e={name:e.name,timestamp:Date.now(),entryType:e.entryType,startTime:e.startTime,duration:e.duration,invoker:null==t?void 0:t.invoker,sourceURL:null==t?void 0:t.sourceURL},s.push(e),100<s.length&&s.shift(),t=o,r=(e=e).duration>=(n=a).noResponseThreshold,i=ot(t),e={event_id:A(),event_type:r?M.NO_RESPONSE:M.LAG_DETECTED,event_category:r?I.ERROR:I.PERFORMANCE,timestamp:Date.now(),page_url:(null==(r=t.getOriginFrom)?void 0:r.call(t))||window.location.href,data:x(x({measurements:{duration:Vf(e.duration),start_time_ms:Vf(e.startTime),lag_threshold_ms:n.threshold,no_response_threshold_ms:n.noResponseThreshold},event_properties:{entry_type:e.entryType||"long-animation-frame",source_url:Gf(e.sourceURL,2048),invoker:Gf(e.invoker,256)}},i?{replay_id:i}:{}),{tags:{environment:(null==(r=t.config)?void 0:r.env)||"production",version:String((null==(n=t.config)?void 0:n.version)||"")}})},t.reportTDEMEvent(e))})}catch(e){}}),l.observer.observe({type:"long-animation-frame",buffered:!1})}catch(e){Zf(o)}}},getLagRecords:function(e){return g((null==(e=dp.get(e))?void 0:e.lagRecords)||[])},destroy:function(){Array.from(dp.keys()).forEach(Zf)}}),fp={enabled:!0,containers:["body","html","#app","#root"],ignoreContainers:[],containerMatchers:{tagName:["body","html"],id:["app","root"],className:[]},ignoreMatchers:{tagName:[],id:[],className:[]},detectStartPosition:{x:0,y:0},emptyElementsPercent:70,sameElementsPercent:70,debounceDuration:2e3,everySideSampleNumber:9,disableSameElementsCheck:!0,ignoreElesWhenDomChange:[],reDetectInterval:2e3,samePointDepth:5,customBlankScreenDector:null},pp=["canvas","img","svg","iframe"],mp=(0,new Map),eu=new e({name:"blankScreen",onNewTdem:function(_,e){var S,E,C,R,O,t,T,n,r,i,o,a,s,l,u,c,d,h,f,p,m,v=this;"undefined"!=typeof document&&document.elementsFromPoint&&(e=e,void 0===(s=null!=(m=_.config)&&m.debug?function(e,t){"undefined"!=typeof console&&console.warn&&console.warn("[TDEM] "+e+": "+t+", fallback applied")}:function(){})&&(s=function(){}),m=Yf(),(S=!1===e?x(x({},m),{enabled:!1}):!0===e||void 0===e?m:!e||"object"!=typeof e||Array.isArray(e)?(s("blankScreen","invalid_type"),m):(l="containerMatchers"in(e=e)||"ignoreMatchers"in e,p="containers"in e||"ignoreContainers"in e,u=function(e,t,n,r){return void 0===e?g(t):Array.isArray(e)&&e.length<=100&&e.every(function(e){return"string"==typeof e&&0<e.trim().length&&e.trim().length<=r})?e.map(function(e){return e.trim()}):(s(n,"invalid_array"),g(t))},f=function(e,t,n){return void 0===e?Xf(t):!e||"object"!=typeof e||Array.isArray(e)?(s(n,"invalid_type"),Xf(t)):{tagName:u((e=e).tagName,t.tagName||[],n+".tagName",128),id:u(e.id,t.id||[],n+".id",128),className:u(e.className,t.className||[],n+".className",128)}},c=function(e,t,n,r){return void 0===e?t:"number"!=typeof e?(s(n,"invalid_type"),t):Number.isFinite(e)?r(e)?e:(s(n,"out_of_range"),t):(s(n,"invalid_number"),t)},d=function(e,t,n,r,i){return c(e,t,n,function(e){return Number.isInteger(e)&&r<=e&&e<=i})},h=Yf(),void 0!==e.enabled&&("boolean"==typeof e.enabled?h.enabled=e.enabled:s("blankScreen.enabled","invalid_type")),h.containers=u(e.containers,m.containers,"blankScreen.containers",256),h.ignoreContainers=u(e.ignoreContainers,m.ignoreContainers,"blankScreen.ignoreContainers",256),h.containerMatchers=f(e.containerMatchers,m.containerMatchers,"blankScreen.containerMatchers"),h.ignoreMatchers=f(e.ignoreMatchers,m.ignoreMatchers,"blankScreen.ignoreMatchers"),p&&!l&&(h.containerMatchers={tagName:[],id:[],className:[]},h.ignoreMatchers={tagName:[],id:[],className:[]}),void 0===(f=e.detectStartPosition)||f&&"object"==typeof f&&!Array.isArray(f)?h.detectStartPosition={x:c((p=f||{}).x,m.detectStartPosition.x,"blankScreen.detectStartPosition.x",function(e){return 0<=e}),y:c(p.y,m.detectStartPosition.y,"blankScreen.detectStartPosition.y",function(e){return 0<=e})}:s("blankScreen.detectStartPosition","invalid_type"),h.emptyElementsPercent=c(e.emptyElementsPercent,m.emptyElementsPercent,"blankScreen.emptyElementsPercent",function(e){return 0<e&&e<=100}),h.sameElementsPercent=c(e.sameElementsPercent,m.sameElementsPercent,"blankScreen.sameElementsPercent",function(e){return 0<e&&e<=100}),h.debounceDuration=c(e.debounceDuration,m.debounceDuration,"blankScreen.debounceDuration",function(e){return 0<=e}),h.reDetectInterval=c(e.reDetectInterval,m.reDetectInterval,"blankScreen.reDetectInterval",function(e){return 0<e}),h.everySideSampleNumber=d(e.everySideSampleNumber,m.everySideSampleNumber,"blankScreen.everySideSampleNumber",2,50),h.samePointDepth=d(e.samePointDepth,m.samePointDepth,"blankScreen.samePointDepth",1,20),void 0!==e.disableSameElementsCheck&&("boolean"==typeof e.disableSameElementsCheck?h.disableSameElementsCheck=e.disableSameElementsCheck:s("blankScreen.disableSameElementsCheck","invalid_type")),h.ignoreElesWhenDomChange=u(e.ignoreElesWhenDomChange,m.ignoreElesWhenDomChange,"blankScreen.ignoreElesWhenDomChange",256),void 0!==e.customBlankScreenDector&&(null===e.customBlankScreenDector||"function"==typeof e.customBlankScreenDector?h.customBlankScreenDector=e.customBlankScreenDector:s("blankScreen.customBlankScreenDector","invalid_type")),h)).enabled)&&(l=((e,t,n)=>({totalSamplePoints:e=4*e-3,whitePointThreshold:Math.floor(e*t/100),samePointThreshold:Math.floor(e*n/100)}))(S.everySideSampleNumber,S.emptyElementsPercent,S.sameElementsPercent),E=l.totalSamplePoints,C=l.whitePointThreshold,R=l.samePointThreshold,O={observer:null,detectTimer:null,bodyWaitTimer:null,bodyWaitFrame:null,idleCallbackId:null,destroyed:!1,initialDetectionPending:!0,incidentStatus:"healthy",preDetectResult:null,triggerType:"dom_change",onErrorOccurred:function(){},onDestroy:function(){return ep(_)},handlePageHide:function(){},handleBeforeUnload:function(){},handleVisibilityChange:function(){}},mp.set(_,O),t=function(){return P(v,void 0,void 0,function(){var u,c,d,h,f,p,m,v,g,y,w,b,k;return D(this,function(e){var t,n,r,i,o,a,s,l;if(!O.destroyed)try{if("initial_load"===O.triggerType&&(O.initialDetectionPending=!1),u=window.innerHeight,c=window.innerWidth,d=S.detectStartPosition,h=d.x,f=d.y,c<=h||u<=f)return[2];if(p=[],v=m=0,((e,t,n,r)=>{for(var i=r.x,o=r.y,a=i+(e-i)/2,s=o+(t-o)/2,l=n+1,u=[],c=1;c<l;c+=1){var d=i+(e-i)*c/l,h=o+(t-o)*c/l;u.push({x:d,y:s}),c!==l/2&&u.push({x:a,y:h},{x:d,y:h},{x:d,y:t-h})}return u})(c,u,S.everySideSampleNumber,S.detectStartPosition).forEach(function(e){a=e.x,s=e.y,e=document.elementsFromPoint(a,s),e=(l=function(e){var t=e[0];if(t&&null!==t.shadowRoot){t=(null==(t=t.shadowRoot)?void 0:t.elementsFromPoint(a,s))||[];if(t.length>e.length)return l(t)}return e})(e),t=S.containers,n=S.ignoreContainers,r=S.containerMatchers,u=S.ignoreMatchers,e=e.map(Jf),o=e.map(function(e){return e.selector});var t,n,r,i,o,a,s,l,u=(e=e[0])?(r=(i=!(!r||!(null!=(i=r.tagName)&&i.length||null!=(i=r.id)&&i.length||null!=(i=r.className)&&i.length)))?Kf(e,r):$f(e,t),t=i?Kf(e,u):$f(e,n),{isWhitePoint:r&&!t,selectorPointers:o}):{isWhitePoint:!1,selectorPointers:o};u.isWhitePoint&&(m+=1),p.push(u.selectorPointers)}),g=C<=m,y=!1,S.disableSameElementsCheck||(w=p.map(function(e){return e.slice(0,S.samePointDepth)}),o={},w.map(function(e){return e.join(" < ")}).forEach(function(e){o[e]=o[e]?o[e]+1:1}),a=Object.keys(o).map(function(e){return[e,o[e]]}).sort(function(e,t){return t[1]-e[1]})[0]||["",0],s=a[0],b={samePointerMap:o,maximumSamePointerClass:s,maximumSamePointerCounter:a[1]},y=R<=(v=b.maximumSamePointerCounter)&&(l=b.maximumSamePointerClass,!pp.some(function(e){return l.startsWith(e)}))),k=!1,S.customBlankScreenDector)try{k=!0===S.customBlankScreenDector()}catch(e){k=!1}if(!(g||y||k))return O.incidentStatus="healthy",O.preDetectResult=null,[2];if("reported"===O.incidentStatus)return[2];if("suspect"===O.incidentStatus&&O.preDetectResult)return t=O.preDetectResult,r=t.customTriggered?"custom":t.whitePointTriggered&&t.sameElementTriggered?"both":t.whitePointTriggered?"white_point":"same_element",i=ot(_),t={event_id:A(),event_type:M.BLANK_SCREEN,event_category:I.ERROR,timestamp:Date.now(),page_url:(null==(n=_.getOriginFrom)?void 0:n.call(_))||window.location.href,data:x(x({measurements:{white_point_count:t.whitePointCount,same_point_count:t.samePointCount,total_sample_points:E,white_point_threshold:C,same_point_threshold:R,white_point_ratio:Qf(t.whitePointCount/E,6),same_point_ratio:Qf(t.samePointCount/E,6),viewport_width_px:Math.max(0,Math.round(window.innerWidth)),viewport_height_px:Math.max(0,Math.round(window.innerHeight))},event_properties:{trigger_reason:r,trigger_type:t.triggerType,detection_method:t.customTriggered?"custom_detector":"viewport_sampling",same_elements_check_enabled:String(!S.disableSameElementsCheck)}},i?{replay_id:i}:{}),{tags:{environment:(null==(n=_.config)?void 0:n.env)||"production",version:String((null==(r=_.config)?void 0:r.version)||"")}})},_.reportTDEMEvent(t),O.incidentStatus="reported",O.preDetectResult=null,[2];O.preDetectResult={whitePointCount:m,samePointCount:v,whitePointTriggered:g,sameElementTriggered:y,customTriggered:k,triggerType:O.triggerType},O.incidentStatus="suspect",O.detectTimer=setTimeout(function(){O.detectTimer=null,T()},S.reDetectInterval)}catch(e){}return[2]})})},T=function(){return P(v,void 0,void 0,function(){return D(this,function(e){switch(e.label){case 0:if(O.destroyed)return[2];if("function"!=typeof window.requestIdleCallback)return[3,5];e.label=1;case 1:return e.trys.push([1,2,,4]),O.idleCallbackId=window.requestIdleCallback(function(e){O.idleCallbackId=null,O.destroyed||(0<e.timeRemaining()?t():O.detectTimer=setTimeout(function(){O.detectTimer=null,t()},0))}),[3,4];case 2:return e.sent(),[4,t()];case 3:return e.sent(),[3,4];case 4:return[3,7];case 5:return[4,t()];case 6:e.sent(),e.label=7;case 7:return[2]}})})},n=function(e){void 0===e&&(e="dom_change"),O.destroyed||"suspect"===O.incidentStatus||"initial_load"!==e&&O.initialDetectionPending||(O.triggerType=e,O.detectTimer&&clearTimeout(O.detectTimer),O.detectTimer=setTimeout(function(){O.detectTimer=null,T()},S.debounceDuration))},O.onErrorOccurred=function(){return n("error")},_.lifeCycle.on("errorOccurred",O.onErrorOccurred),_.lifeCycle.on("destroy",O.onDestroy),r=function(){!O.destroyed&&document.body&&(O.observer=new MutationObserver(function(e){var t=null==(t=e[0])?void 0:t.target;if(1===e.length&&t instanceof Element){e=Jf(t).selector;if(S.ignoreElesWhenDomChange.includes(e))return}n("dom_change")}),O.observer.observe(document.body,{childList:!0,subtree:!0}))},document.body?r():(i=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},o=function(){document.body?(O.bodyWaitTimer&&clearTimeout(O.bodyWaitTimer),r()):O.bodyWaitFrame=i(o)},O.bodyWaitFrame=i(o),O.bodyWaitTimer=setTimeout(function(){null!==O.bodyWaitFrame&&((window.cancelAnimationFrame||clearTimeout)(O.bodyWaitFrame),O.bodyWaitFrame=null)},1e4)),O.handlePageHide=a=function(){O.destroyed||(O.detectTimer&&clearTimeout(O.detectTimer),O.triggerType="page_state",O.preDetectResult&&(O.preDetectResult.triggerType="page_state"),t())},O.handleBeforeUnload=a,O.handleVisibilityChange=function(){"hidden"===document.visibilityState&&a()},window.addEventListener("pagehide",O.handlePageHide),window.addEventListener("beforeunload",O.handleBeforeUnload),document.addEventListener("visibilitychange",O.handleVisibilityChange),n("initial_load"))},destroy:function(){Array.from(mp.keys()).forEach(ep)}}),vp={enabled:!0,enableMemoryReport:!0,enableOOMReport:!0,oomThreshold:100,memoryReportInterval:6e4,oomCheckInterval:1e4,monitorPages:[],sampleRate:1},gp=new Map,yp=function(e){return"number"==typeof e&&Number.isFinite(e)},i=new e({name:"memoryMonitor",onNewTdem:function(n,e){r=n;var r,i,o,a,t,s=!1===(e=e)?x(x({},vp),{enabled:!1}):(i=e&&"object"==typeof e?e:{},void 0===e||!0===e||e&&"object"==typeof e&&!Array.isArray(e)||tp(r,"memoryMonitor","invalid_type"),o=x(x({},vp),{oomThreshold:0<(e=(null==(e=np())?void 0:e.limit)||0)?Math.round(e/1024/1024*.9):100}),["enabled","enableMemoryReport","enableOOMReport"].forEach(function(e){void 0!==i[e]&&("boolean"==typeof i[e]?o[e]=i[e]:tp(r,"memoryMonitor."+e,"invalid_type"))}),["oomThreshold","memoryReportInterval","oomCheckInterval"].forEach(function(e){var t=i[e];void 0!==t&&(yp(t)&&0<t?o[e]=t:tp(r,"memoryMonitor."+e,yp(t)?"out_of_range":"invalid_number"))}),void 0!==i.sampleRate&&(yp(i.sampleRate)&&0<=i.sampleRate&&i.sampleRate<=1?o.sampleRate=i.sampleRate:tp(r,"memoryMonitor.sampleRate","out_of_range")),void 0!==i.monitorPages&&(Array.isArray(i.monitorPages)&&i.monitorPages.length<=100&&i.monitorPages.every(function(e){return"string"==typeof e&&!!e||e instanceof RegExp})?o.monitorPages=g(i.monitorPages):tp(r,"memoryMonitor.monitorPages","invalid_value")),o);!s.enabled||!(()=>{var e;try{return"undefined"!=typeof window&&null!=(e=window.performance)&&e.memory}catch(e){}})()||Math.random()>=s.sampleRate||(e=s.monitorPages).length&&(t="undefined"==typeof window?"":window.location.href,!e.some(function(e){return"string"==typeof e?t.includes(e):(e.lastIndex=0,e.test(t))}))||(a={config:s,reportTimer:null,oomCheckTimer:null,lastOOMTime:0,records:[],destroyed:!1,onDestroy:function(){return rp(n)},onPageExit:function(){return rp(n)}},gp.set(n,a),n.lifeCycle.on("destroy",a.onDestroy),"undefined"!=typeof window&&(window.addEventListener("pagehide",a.onPageExit),window.addEventListener("beforeunload",a.onPageExit)),s.enableMemoryReport&&(a.reportTimer=setInterval(function(){return ip(n,a,M.MEMORY_USAGE)},s.memoryReportInterval)),s.enableOOMReport&&(a.oomCheckTimer=setInterval(function(){var e=np(),t=Date.now();e&&e.used/1024/1024>s.oomThreshold&&3e5<t-a.lastOOMTime&&(a.lastOOMTime=t,ip(n,a,M.MEMORY_OOM))},s.oomCheckInterval)))},destroy:function(){Array.from(gp.keys()).forEach(rp)}});function wp(e,t,n){try{var r={projectKey:e,sampleRate:t,replaySampleRate:void 0!==n.replay_sample_rate?Number(n.replay_sample_rate):1,errorTraceback:n.error_traceback,errorSampleRate:n.error_sample_rate,remoteEnabled:n.enabled,timestamp:Date.now()};localStorage.setItem("TDEM_SAMPLE_CONFIG",JSON.stringify(r))}catch(e){}}function bp(e){return e._tdemSampleGate||null}function kp(e,t,n){e=bp(e);e?!n||t<=0?e.decide(!1):100<=t?e.decide(!0):(n=100*Math.random(),e.decide(n<t)):console.warn("[TDEM] Sample gate not found")}function _p(e,t){var t=Wf(e.config.sessionReplay,t),n=(e._effectiveReplayPolicy=t,e._replaySampled=t.enabled,null==(n=null==(e=e.constructor.installedPlugins)?void 0:e.find)?void 0:n.call(e,function(e){return e&&"sessionReplay"===e.name})),e=null==(e=null==n?void 0:n.option)?void 0:e.applyEffectivePolicy;"function"==typeof e&&e.call(n.option,t)}function Sp(e){var t={};return e&&"object"==typeof e&&(Object.prototype.hasOwnProperty.call(e,"enabled")&&(t.enabled=!!e.enabled),Object.prototype.hasOwnProperty.call(e,"replay_sample_rate")&&(t.replay_sample_rate=Number(e.replay_sample_rate)),Object.prototype.hasOwnProperty.call(e,"error_traceback")&&(t.error_traceback=!!e.error_traceback),Object.prototype.hasOwnProperty.call(e,"error_sample_rate"))&&(t.error_sample_rate=Number(e.error_sample_rate)),t}function Ep(e,t,n){var r,i=bp(e);i&&((t=t?(e=>{try{var t,n=localStorage.getItem("TDEM_SAMPLE_CONFIG");return n?(t=JSON.parse(n)).projectKey===e&&Date.now()-t.timestamp<6048e5?t:null:null}catch(e){return null}})(t):null)?(console.info("[TDEM] Using cached config, sampleRate:",t.sampleRate),n._cachedSampleRate=t.sampleRate,r={},void 0!==t.remoteEnabled&&(r.enabled=t.remoteEnabled),void 0!==t.replaySampleRate&&(r.replay_sample_rate=t.replaySampleRate),void 0!==t.errorTraceback&&(r.error_traceback=t.errorTraceback),void 0!==t.errorSampleRate&&(r.error_sample_rate=t.errorSampleRate),n._cachedRemote=r,n=void 0!==t.remoteEnabled?!!t.remoteEnabled:0<t.sampleRate,kp(e,t.sampleRate,n),_p(e,r)):(console.warn("[TDEM] No cached config, default to not report"),i.decide(!1),_p(e,null)))}s=new e({name:"tdemConfig",_cachedSampleRate:null,_cachedRemote:null,onNewTdem:function(e){var t=this,n=e._prefetchedConfigData;_p(e,n?Sp(n):null),function(l,u){P(this,void 0,void 0,function(){var n,r,i,o,a,s;return D(this,function(e){switch(e.label){case 0:if(!(n=l.config.id))return Ep(l,n,u),[2];if(r=l._prefetchedConfigData)return delete l._prefetchedConfigData,i=r.tdem_sample_rate,o=r.enabled,a=Sp(r),wp(n,i,a),u._cachedSampleRate=i,u._cachedRemote=a,kp(l,i,o),_p(l,a),[2];if(t=(l.config.url||"").replace(/\/+$/,""),!(r=t?t+"/api/v1/config":""))return Ep(l,n,u),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,l.transportRequest({kind:"config",url:r,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_key:n})})];case 2:if(!(s=e.sent()).ok)throw new Error("HTTP "+s.status);if(0===(s="string"==typeof s.body?JSON.parse(s.body):s.body).code&&s.data)return i=s.data.tdem_sample_rate,o=s.data.enabled,a=Sp(s.data),wp(n,i,a),u._cachedSampleRate=i,u._cachedRemote=a,kp(l,i,o),_p(l,a),[3,4];throw new Error("API error: code="+s.code);case 3:return s=e.sent(),console.warn("[TDEM] Failed to fetch remote config:",s),Ep(l,n,u),[3,4];case 4:return[2]}var t})})}(e,this),e.lifeCycle.on("sessionRefreshed",function(){t.onSessionRefreshed(e)})},onSessionRefreshed:function(e){var t,n=bp(e);n&&n.isDecided&&null!=(t=this._cachedSampleRate)&&(n=n.reDecide(t),t=e._effectiveReplayPolicy,e._replaySampled=n&&(!t||t.enabled),console.info("[TDEM] Session refreshed, session="+n+", replayPolicyEnabled="+(null==t?void 0:t.enabled)))}});return n.use(Bt),n.use(At),n.use(lt),n.use(cr),n.use(sr),n.use(rt),n.use(t),n.use(hr),n.use(Sr),n.use(Vt),n.use(an),n.use(Dt),n.use(s),n.use(op),n.use(up),n.use(hp),n.use(eu),n.use(i),n});
10
+ ((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).TDEM=t()})(this,function(){var w,S;function E(e){this.name="__st"+(1e9*Math.random()>>>0)+w+"__",null!=e&&e.forEach(this.add,this),w+=1}Array.prototype.find||Object.defineProperty(Array.prototype,"find",{configurable:!0,writable:!0,value:function(e){if(null===this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=t[i];if(e.call(r,o,i,t))return o;i+=1}}}),window.WeakSet||(w=Date.now()%1e9,E.prototype.add=function(e){var t=this.name;return e[t]||Object.defineProperty(e,t,{value:!0,writable:!0}),this},E.prototype.delete=function(e){return!!e[this.name]&&!(e[this.name]=void 0)},E.prototype.has=function(e){return!!e[this.name]},S=E,Object.defineProperty(window,"WeakSet",{value:function(e){return new S(e)}})),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n<arguments.length;n++)if(null!=(r=arguments[n]))for(var r=Object(r),i=Object.keys(Object(r)),o=0,a=i.length;o<a;o++){var s=i[o],l=Object.getOwnPropertyDescriptor(r,s);null!=l&&l.enumerable&&(t[s]=r[s])}return t}});var C=function(e,t){return(C=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},x=function(){return(x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function P(e,a,s,l){return new(s=s||Promise)(function(n,t){function r(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(r,i)}o((l=l.apply(e,a||[])).next())})}function D(r,i){var o,a,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,a=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!((s=0<(s=l.trys).length&&s[s.length-1])||6!==t[0]&&2!==t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3]))l.label=t[1];else if(6===t[0]&&l.label<s[1])l.label=s[1],s=t;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(t)}}t=i.call(r,l)}catch(e){t=[6,e],a=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function g(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function R(e,t){return void 0===t&&(t="https://dem.rumt-zh.com"),t=(e.url||"").replace(/\/+$/,"")||("string"==typeof t?t:"https://dem.rumt-zh.com"),e.url=t,e.hostUrl=t,e.offlineUrl=t+"/offline",e.whiteListUrl=t+"/collect/whitelist",e.pvUrl=t+"/collect/pv",e.eventUrl=t+"/collect/events",e.speedUrl=t+"/speed",e.customTimeUrl=t+"/speed/custom",e.performanceUrl=t+"/speed/performance",e.performanceUrlForHippy=t+"/speed/hippyPerformance",e.webVitalsUrl=t+"/speed/webvitals",e.setDataReportUrl=t+"/speed/miniProgramData",e}function T(e){try{return localStorage.getItem(e)}catch(e){return null}}function O(e,t){try{localStorage.setItem(e,t)}catch(e){}}function L(e,t){try{return e?JSON.parse(e):t}catch(e){return t}}var F,U=/_?t(\d)?(imestamp)?=\d+&?/g,z=["aegis.qq.com","tamaegis.com","/aegis-sdk","rumt-","/flog.core.min.js","pingfore.qq.com","pingfore.tencent.com","zhiyan.tencent-cloud.net","h.trace.qq.com","btrace.qq.com","beacon.qq.com","dmplog.qq.com","qq.com/report","svibeacon.onezapp.com","cube.weixinbridge.com","doubleclick.net","pcmgrmonitor.3g.qq.com","tdm.qq.com","report.qqweb.qq.com","tpstelemetry.tencent.com","galileotelemetry.tencent.com","insight.cloud.tencent.com","facebook.com","facebook.net","google","yahoo.com","twitter.com","ga-audiences","report.idqqimg.com","arms-retcode.aliyuncs.com","px.effirst.com","sentry","baidu.com","hot-update.json","u.c.b.r.o.w.s.e.r","report.url.cn","sockjs-node","m3u8","flv"],B=["ResizeObserver loop limit exceeded","ResizeObserver loop completed","Failed to execute 'transaction'","window.indexedDB.deleteDatabase is not a function"],j=["ext1","ext2","ext3","ext4","ext5","ext6","ext7","ext8","ext9","ext10","level","trace","tag","seq","code"],W=["static","fetch"],H="unknown",q=(V.prototype.indexOf=function(e,t){for(var n=0;n<e.length;n++)if(e[n].callback===t)return n;return-1},V.prototype.on=function(e,t,n){var r;if(void 0===n&&(n=0),this)return(r=this.eventsList[e])||(this.eventsList[e]=[],r=this.eventsList[e]),-1===this.indexOf(r,t)&&r.push({name:e,type:n||0,callback:t}),this},V.prototype.one=function(e,t){this.on(e,t,1)},V.prototype.remove=function(e,t){if(this){var n=this.eventsList[e];if(n){if(t)return n.length&&(t=this.indexOf(n,t),n.splice(t,1)),this;try{delete this.eventsList[e]}catch(e){}}return null}},V.prototype.clear=function(){this.eventsList={}},V);function V(){var a=this;this.emit=function(e,t){if(a){var n;if(null!=(r=a.eventsList[e])&&r.length)for(var r=r.slice(),i=0;i<r.length;i++){n=r[i];try{var o=n.callback.apply(a,[t]);if(1===n.type&&a.remove(e,n.callback),!1===o)break}catch(e){throw e}}return a}},this.eventsList={}}function G(e){if(null!=e){e=String(e).trim();if(e){var t=e.toLowerCase();if(t!==H&&"undefined"!==t&&"null"!==t&&"未知"!==e)return e}}}(e=F=F||{})[e.number=-1]="number",e.string="";function Z(e,t){return"number"==typeof e||"string"==typeof e?e:t?F.string:F.number}function J(e,t){return"string"==typeof e?e.split("?")[t?1:0]||"":e}function K(e,t){return void 0===t&&(t=2048),String(e).replace(U,"").slice(0,t)}function $(e){return"string"==typeof e&&/^\//.test(e)?"https:"===(null==location?void 0:location.protocol):/^https/.test(e)}function X(e,t,n){var r,i,o;try{if("function"==typeof(null==t?void 0:t.retCodeHandler))return{code:void 0===(o=(i=t.retCodeHandler(e,null==n?void 0:n.url,null==n?void 0:n.ctx,null==n?void 0:n.payload)||{}).code)?H:o,isErr:i.isErr};if(!(e="string"==typeof e?JSON.parse(e):e))return{code:H,isErr:!1};"function"==typeof(null==(r=null==t?void 0:t.ret)?void 0:r.join)&&(le=[].concat(t.ret.map(function(e){return e.toLowerCase()})));var a=Object.getOwnPropertyNames(e).filter(function(e){return-1!==le.indexOf(e.toLowerCase())});return a.length?{code:""+(o="未知"!==(o=e[a[0]])&&""!==o?o:H),isErr:0!==o&&"0"!==o&&o!==H}:{code:H,isErr:!1}}catch(e){return{code:H,isErr:!1}}}function ee(e,t,n){try{var r="function"==typeof t?t(e,null==n?void 0:n.url,null==n?void 0:n.ctx)||"":e;return de(r).slice(0,10240)}catch(e){return""}}function te(e){if("string"==typeof e)return e;try{return e instanceof Error?(JSON.stringify(e,ue(),2)||"undefined").replace(/"/gim,""):JSON.stringify(e,ue(),2)||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}}function ne(e,t){var n,r={fetch:[],static:[],bridge:[]},i=new FormData;return Array.isArray(e)?e.forEach(function(e){var t=pe(e);r[e.type].push(t)}):(n=pe(e),r[e.type].push(n)),i.append("payload",ce(x({duration:r},t))),i}function re(t,e){return"string"!=typeof t||!t||e&&-1<t.indexOf(e)||me.test(t)||z.some(function(e){return-1<t.indexOf(e)})}var oe,ae=["application/xhtml+xml","application/xml","application/pdf","application/pkcs12","application/javascript","application/x-javascript","application/ecmascript","application/vnd.mspowerpoint","application/vnd.apple.mpegurl","application/ogg","text/css","text/javascript","image","audio","video","video/mp2t"],se=/\.(json|js|css|jpg|jpeg|png|svg|apng|webp|gif|bmp|mp4|mp3|ts|mpeg|wav|webm|ogg|flv|m3u8|ttf|woff2|otf|eot|woff|html|htm|shtml|shtm|)$/i,le=["ret","retcode","code","errcode"],ue=function(){var n=new WeakSet;return function(e,t){if(t instanceof Error)return"Error.message: "+t.message+" \n Error.stack: "+t.stack;if("object"==typeof t&&null!==t){if(n.has(t))return"[Circular "+(e||"root")+"]";n.add(t)}return t}},ce=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e,ue())||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}},de=function(n,r){void 0===r&&(r=3);var i,o,a,s="";return Array.isArray(n)?(s+="[",i=n.length,n.forEach(function(e,t){s=(s+="object"==typeof e&&1<r?de(e,r-1):he(e))+(t===i-1?"":",")}),s+="]"):n instanceof Object||"object"==typeof n?(s="{",o=Object.keys(n),a=o.length,o.forEach(function(e,t){"object"==typeof n[e]&&1<r?s+='"'+e+'":'+de(n[e],r-1):s+=fe(e,n[e]),s+=t===a-1||t<a-1&&void 0===n[o[t+1]]?"":","}),s+="}"):s+=n,s},fe=function(e,t){var n=typeof t,r="";return"string"==n||"object"==n?r+='"'+e+'":"'+t+'"':"function"==typeof t?r+='"'+e+'":"function '+t.name+'"':"symbol"==typeof t?r+='"'+e+'":"symbol"':"number"!=typeof t&&"boolean"!=n||(r+='"'+e+'": '+t),r},he=function(e){var t=typeof e;return""+("undefined"==t||"symbol"==t||"function"==t?"null":"string"==t||"object"==t?'"'+e+'"':e)},pe=function(t){var n;return t.payload?(n={},Object.keys(t).forEach(function(e){"payload"!==e&&(n[e]=t[e])}),n):t},me=/data:(image|text|application|font)\/.*;base64/;(e=oe=oe||{}).LOG="log",e.SPEED="speed",e.PERFORMANCE="performance",e.OFFLINE="offline",e.WHITE_LIST="whiteList",e.VITALS="vitals",e.PV="pv",e.CUSTOM_PV="customPV",e.EVENT="event",e.CUSTOM="custom",e.SDK_ERROR="sdkError",e.SET_DATA="setData",e.LOAD_PACKAGE="loadPackage",e.MEMORY="memory";var ve,M,I,ge={maxAttempts:3,delays:[0,1e3,3e3]};function A(){return"evt_"+Date.now()+"_"+Math.random().toString(36).substring(2,8)}function ye(e){var t=[];if(e.stack)for(var n=0,r=0,i=e.stack.split("\n");r<i.length;r++){var o,a,s,l,u,c=i[r],d=c.match(/at\s+(.+?)\s+\((.+?):(\d+):(\d+)\)/);d?(o=d[1],a=d[2],s=d[3],l=d[4],u=a.split("/").pop()||a,t.push({abs_path:a,colno:parseInt(l,10),filename:u,function:o||"(anonymous)",lineno:parseInt(s,10),in_app:a.includes("node_modules")||a.includes("cdn")?0:1,stack_level:n++})):(d=c.match(/at\s+(.+?):(\d+):(\d+)/))&&(a=d[1],s=d[2],l=d[3],u=a.split("/").pop()||a,t.push({abs_path:a,colno:parseInt(l,10),filename:u,function:"(anonymous)",lineno:parseInt(s,10),in_app:a.includes("node_modules")||a.includes("cdn")?0:1,stack_level:n++}))}return t}(e=ve=ve||{}).production="production",e.development="development",e.gray="gray",e.pre="pre",e.daily="daily",e.local="local",e.test="test",e.others="others",(e=M=M||{}).JS_ERROR="js_error",e.PROMISE_ERROR="promise_error",e.RESOURCE_ERROR="resource_error",e.API_ERROR="api_error",e.BLANK_SCREEN="blank_screen",e.PAGE_LOAD="page_load",e.RESOURCE_LOAD="resource_load",e.API_CALL="api_call",e.SSE_CALL="sse_call",e.true="web_vitals",e.LAG_DETECTED="lag_detected",e.NO_RESPONSE="no_response",e.MEMORY_USAGE="memory_usage",e.APP_METRICS="app_metrics",e.PROCESS_SIGNAL="process_signal",e.MEMORY_OOM="memory_oom",e.FILE_IO="file_io",e.CLICK="click",e.SCROLL="scroll",e.LONG_PRESS="long_press",e.PAGE_VIEW="page_view",e.TAB_HIDDEN="tab_hidden",e.TAB_VISIBLE="tab_visible",e.WINDOW_BLUR="window_blur",e.WINDOW_FOCUS="window_focus",e.FORM_FOCUS="form_focus",e.FORM_BLUR="form_blur",e.FORM_CHANGE="form_change",e.FORM_SUBMIT="form_submit",e.FORM_SUBMIT_RESULT="form_submit_result",e.STRUGGLE="struggle",e.CUSTOM="custom",e.LOG="log",(e=I=I||{}).ERROR="error",e.PERFORMANCE="performance",e.BEHAVIOR="behavior",e.NETWORK="network",e.LOG="log",e.CUSTOM="custom";function we(u,c){return function(i,o){var s,a,l,e,t,n;null!=i&&i.log&&null!=i&&i.type?(s=function(e,t){var n,r,t=x(x({},u.bean),{from:t}),i=x({},u.bean);return(()=>{try{return"undefined"!=typeof FormData&&"function"==typeof FormData.prototype.append}catch(e){}})()?ne(e,t):(t=e,e=i,r={fetch:[],static:[],bridge:[]},i={},Array.isArray(t)?t.forEach(function(e){var t;null!=(t=r[e.type])&&t.push(e)}):null!=(n=r[t.type])&&n.push(t),i.payload=JSON.stringify(x({duration:r},e)),i)},a=function(e,t,n,r){switch(t){case oe.LOG:o=e;var i=(Array.isArray(o)?o:[o]).map(function(n){return Object.getOwnPropertyNames(n).reduce(function(e,t){return"ctx"!==t&&(e[t]=n[t]),e},{level:"2",msg:""})});if(!i||0===i.length)return"{}";i=Array.isArray(i)?i:[i];var o=Array.from(new Set(i.flatMap(function(e){return Object.keys(e)}))),a={};return o.forEach(function(t){a[t]=i.map(function(e){return e[t]||""})}),a.count=i.length,ce(a);case oe.SPEED:return s(e,n);case oe.EVENT:return r;default:return r||{}}var o},1!==(e=Array.isArray(i.log)?i.log:[i.log]).length?(l={},e.forEach(function(e){var t=e.from||"undefined";delete e.from,l[t]||(l[t]=[]),l[t].push(e)}),Object.keys(l).forEach(function(e){var t,n=l[e],r=null!=(r=i.url)&&r.includes("?")?"&":"?";"undefined"===e?(t=""+i.url,o(x(x({},i),{url:t,log:1===n.length?n[0]:n,data:a(n,c,e,i.data)}))):(t=i.url+r+"from="+e,o(x(x({},i),{url:t,log:1===n.length?n[0]:n,beanFilter:g(i.beanFilter||[],["from"]),data:a(n,c,e,i.data)})))})):(t=(e=e[0]).from,delete e.from,n=null!=(n=i.url)&&n.includes("?")?"&":"?",t?(n=i.url+n+"from="+t,o(x(x({},i),{url:n,log:e,beanFilter:g(i.beanFilter||[],["from"]),data:a(e,c,t,i.data)}))):(n=""+i.url,o(x(x({},i),{url:n,log:e,data:a(e,c,t,i.data)}))))):o(i)}}function be(l,u){return function(e,t){var n,r,i,o=Array.isArray(e),a=o?e:[e],s=(l.lifeCycle.emit("beforeRequest",e),l.config.beforeRequest);(a="function"==typeof s?a.map(function(t){try{var e=s({logs:t,logType:u});return(null==e?void 0:e.logType)===u&&null!=e&&e.logs?e.logs:!1!==e&&t}catch(e){return t}}).filter(function(e){return!1!==e}):a).length&&(n=a,e=j,!Array.isArray(n)||n.length<=1||(r=[],i=[],!(i="string"==typeof e?[e]:e))||i.length<=0||(i.forEach(function(t){n.forEach(function(e){null!=e&&e[t]&&r.push(t)})}),0<r.length&&(n=n.map(function(e){var t={};return r.forEach(function(e){t[e]=""}),x(x({},t),e)}))),a=n,t(o?a:a[0]))}}function ke(i){return function(e,t){i.lifeCycle.emit("modifyRequest",e);var n=i.config.modifyRequest;if("function"==typeof n)try{var r=n(e);"object"==typeof r&&"url"in r&&(e=r)}catch(e){console.error(e)}t(e)}}function _e(r){return function(e,t){null!=(n=r.lifeCycle)&&n.emit("afterRequest",e);var n=(r.config||{}).afterRequest;"function"==typeof n&&!1===n(e)||t(e)}}var Se=function(e){return e.filter(function(n,r){return"static"!==n.type||!e.find(function(e,t){return n.url===e.url&&200===n.status&&r<t})})},Ee={},Ce={},Re=function(e){return Ee[e]||(Ee[e]=setTimeout(function(){Ce[e]={},Ee[e]=null},6e4)),Ee[e]},Te={generateTraceId:xe(16),generateSpanId:xe(8)},Oe=Array(32);function xe(t){return function(){for(var e=0;e<2*t;e++)Oe[e]=Math.floor(16*Math.random())+48,58<=Oe[e]&&(Oe[e]+=39);return String.fromCharCode.apply(null,Oe.slice(0,2*t))}}function Me(){return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)})}function Fe(){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)})}function Ue(e){for(var t,n,r,i="",o=0,a=(e=String(e)).length%3;o<e.length;){if(255<(t=e.charCodeAt(o++))||255<(n=e.charCodeAt(o++))||255<(r=e.charCodeAt(o++)))throw new TypeError("Failed to execute 'btoa': The string to be encoded contains characters outside of the Latin1 range.");i+=je.charAt((t=t<<16|n<<8|r)>>18&63)+je.charAt(t>>12&63)+je.charAt(t>>6&63)+je.charAt(63&t)}return a?i.slice(0,a-3)+"===".substring(a):i}function ze(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!We.test(e))throw new TypeError("Failed to execute 'atob': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var n,r,i="",o=0;o<e.length;)t=je.indexOf(e.charAt(o++))<<18|je.indexOf(e.charAt(o++))<<12|(n=je.indexOf(e.charAt(o++)))<<6|(r=je.indexOf(e.charAt(o++))),i+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return i}function Be(e){var t,n="";return n="object"==typeof e&&(t=(e=((e,t)=>{for(var n=0;n<t.length;n++){var r=t[n],i=e[r]||"function"==typeof e.get&&e.get(r);if(i)return[r,i]}return["",""]})(e,Object.keys(qe)))[0])?qe[t](e[1]):n}var je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",We=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,He=(Ve.prototype.generate=function(e,t,n){if(void 0===t&&(t={}),this.url=e,!this.isUrlIgnored()&&this.isUrlInTraceUrls()&&this.traceType){switch(this.traceType){case"traceparent":this.traceId=this.createTraceparent();break;case"b3":this.traceId=this.createB3();break;case"sw8":this.traceId=this.createSw8(n);break;case"sentry-trace":this.traceId=this.createSentryTrace();break;default:return console.warn("this trace key "+this.traceType+" is not supported"),void(this.traceId="")}return t[this.traceType]&&(this.traceId=t[this.traceType]),{name:this.traceType,value:this.traceId}}},Ve.prototype.createTraceparent=function(){var e=Te.generateSpanId();return"00-"+Te.generateTraceId()+"-"+e+"-0"+this.traceFlag.toString(16)},Ve.prototype.createB3=function(){var e=Te.generateSpanId();return Te.generateTraceId()+"-"+e+"-"+this.traceFlag},Ve.prototype.createSw8=function(e){var t="function"==typeof btoa?btoa:Ue,e=e||{},n=e.host,n=void 0===n?"":n,e=e.pathname,e=void 0===e?"":e,r=Fe(),i=Fe();return"1-"+String(t(i))+"-"+String(t(r))+"-1-"+String(t("tdem"))+"-"+String(t("1.0.11"))+"-"+String(t(encodeURI(e)))+"-"+String(t(n))},Ve.prototype.createSentryTrace=function(){var e=Me().substring(16);return Me()+"-"+e+"-"+this.traceFlag},Ve.prototype.isUrlIgnored=function(){if(Array.isArray(this.ignoreUrls)&&0!==this.ignoreUrls.length)for(var e=0,t=this.ignoreUrls;e<t.length;e++){var n=t[e];if(this.urlMatches(this.url,n))return!0}return!1},Ve.prototype.isUrlInTraceUrls=function(){if(!this.urls)return!0;if(Array.isArray(this.urls)){if(0===this.urls.length)return!1;for(var e=0,t=this.urls;e<t.length;e++){var n=t[e];if(this.urlMatches(this.url,n))return!0}}return!1},Ve.prototype.urlMatches=function(e,t){return"string"==typeof t?e===t:!!e.match(t)},Ve),qe={sw8:function(e){var t="function"==typeof atob?atob:ze,e=e.split("-")[1];return e?t(e):""},traceparent:function(e){return e.split("-")[1]},b3:function(e){return e.split("-")[0]},"sentry-trace":function(e){return e.split("-")[0]}};function Ve(e,t,n,r){void 0===n&&(n=null),this.traceType=e,this.ignoreUrls=t,this.urls=n,this.traceFlag=null==r?1:Number(!!r)}function Ge(i){return function(e){e&&0!==e.length&&i.sendPipeline([function(t,e){var n={protocol_version:2,project_key:String(i.config.id||""),sdk:{name:i.sdkName,version:i.sdkVersion},app:{version:String(i.config.version||"1.0.0")},context:(e=>{var t=String((null==(n=null==(n=null==(t=e.sessionManager)?void 0:t.getSession)?void 0:n.call(t))?void 0:n.id)||e.bean.sessionId||""),n=String(e.config.userId||e.config.uin||""),t={session_id:t,platform:(t=String(e.runtimePlatform||e.config.platform||"web").trim().toLowerCase(),["web","miniprogram","uniapp","android","ios","electron","unknown"].includes(t)?t:["wx","my","qq","tt"].includes(t)?"miniprogram":"undefined"!=typeof window?"web":"unknown")},n=(n&&(t.user_id=n),(n=String(e.bean.aid||"").trim())&&"true"!==n&&(t.device_id=n),e.bean.runtime?String(e.bean.runtime):""),r=e.bean.processType?String(e.bean.processType):"",i=void 0!==e.bean.windowId?String(e.bean.windowId):"",o=void 0!==e.bean.webContentsId?String(e.bean.webContentsId):"",e=e.bean.appVersion?String(e.bean.appVersion):"";return n&&(t.runtime=n),r&&(t.process_type=r),i&&(t.window_id=i),o&&(t.web_contents_id=o),e&&(t.app_version=e),"undefined"!=typeof navigator&&(t.user_agent=navigator.userAgent,t.language=navigator.language),"undefined"!=typeof screen&&(t.screen_resolution=screen.width+"x"+screen.height),t})(i),events:t},r=String(i.config.url||"").replace(/\/+$/,"");r&&e({url:r+"/api/v1/collect/events",data:JSON.stringify(n),method:"POST",contentType:"application/json",addBean:!1,type:oe.EVENT,log:t,success:function(){i.lifeCycle.emit("afterReport",{success:!0,events:t})},fail:function(e){i.lifeCycle.emit("afterReport",{success:!1,error:e,events:t})}})}],oe.EVENT)(e)}}function Ze(e){e=null==(e=e)?void 0:e._tdemSampleGate;return!!e&&e.isDecided&&e.isSampled}function Je(n){if(n&&n.reduce&&n.length)return 1===n.length?function(e,t){n[0](e,t||Ye)}:n.reduce(function(n,r){return function(e,t){return void 0===t&&(t=Ye),n(e,function(e){return null==r?void 0:r(e,t)})}});throw new TypeError("createPipeline need at least one function param")}function Ke(t,n){Object.getOwnPropertyNames(t).forEach(function(e){"function"==typeof t[e]&&"constructor"!==e&&(n?n[e]="sendPipeline"===e?function(){return function(){}}:function(){}:t[e]=function(){})})}function $e(){return void 0!==window.performance&&"function"==typeof performance.getEntriesByType&&"function"==typeof performance.now}function Xe(e){var t;return-1<(null==(t=null==(t=window.PerformanceObserver)?void 0:t.supportedEntryTypes)?void 0:t.indexOf(e))}var Ye=function(){},Qe={low:1,medium:3,high:5},et=new Set(["custom_struggle_name","form_id","field_id","trigger_event_id","struggle_status","struggle_owner_type","struggle_owner_key","detection_source","rule_version"]),tt={rage_click:3,dead_click:4,error_click:4,form_validation_error:3,slow_page:3,back_forward:2,long_focus_time:2,form_zigzag:2,uncompleted_form:3,custom_struggle:3},nt={rage_click:4,dead_click:5,error_click:5,form_validation_error:4,slow_page:4,back_forward:3,long_focus_time:3,form_zigzag:3,uncompleted_form:3,custom_struggle:3},rt=(d.use=function(e){-1===d.installedPlugins.indexOf(e)&&e.tdemPlugin&&d.installedPlugins.push(e)},d.unuse=function(e){e=d.installedPlugins.indexOf(e);-1!==e&&d.installedPlugins.splice(e,1)},d.prototype.getInternalTransport=function(){return this.internalTransport},d.prototype.setInternalTransport=function(e){this.internalTransport=e},d.prototype.getInternalRetrySchedule=function(){return this.internalRetrySchedule},d.prototype.transportRequest=function(t,n){return P(this,void 0,void 0,function(){return D(this,function(e){switch(e.label){case 0:if(this.internalTransport)return[4,this.internalTransport.request(t,n)];throw new Error("Internal Transport is not configured");case 1:return[2,e.sent()||{ok:!0,request:t}]}})})},d.prototype.transportHandoff=function(t,n){return P(this,void 0,void 0,function(){return D(this,function(e){switch(e.label){case 0:if(this.internalTransport)return[4,(this.internalTransport.handoff||this.internalTransport.request).call(this.internalTransport,x(x({},t),{handoff:!0}),n)];throw new Error("Internal Transport is not configured");case 1:return[2,e.sent()||{ok:!0,request:t,handoffAccepted:!0}]}})})},d.prototype.init=function(e){this.setConfig(e),this.config=R(this.config,e.hostUrl);for(var t=0;t<d.installedPlugins.length;t++)try{d.installedPlugins[t].patch(this)}catch(e){this.sendSDKError(e)}this.lifeCycle.emit("onInited")},d.prototype.destroy=function(e){void 0===e&&(e=!1);var t,n,r=d.instances.indexOf(this);-1!==r&&d.instances.splice(r,1);for(var i=d.installedPlugins.length-1;0<=i;i--)try{d.installedPlugins[i].unpatch(this)}catch(e){this.sendSDKError(e)}if(this.lifeCycle.emit("destroy"),this.lifeCycle.clear(),e)t=this,n=Object.getOwnPropertyDescriptors(t),Object.keys(n).forEach(function(e){n[e].writable&&(t[e]=null)}),Object.setPrototypeOf(this,null);else{for(var o=this;o.constructor!==Object&&Ke(o,this),o=Object.getPrototypeOf(o););0===d.instances.length&&(r=Object.getPrototypeOf(this).constructor,Ke(r),Ke(d))}},d.prototype.setConfig=function(e){Object.assign(this.config,e);var e=this.config,t=e.id,n=e.uin,r=e.version,i=e.aid,o=e.env,a=void 0===o?"production":o,o=e.pageUrl,e=e.userId||(null!=n?String(n):""),n=this.bean.id!==t||this.bean.uin!==e||this.bean.aid!==i;return this.bean.id=t||"",this.bean.uin=e,this.bean.version=r||"1.0.11",this.bean.aid=i||"",this.bean.env=(()=>{switch(a){case ve.production:case ve.development:case ve.gray:case ve.pre:case ve.daily:case ve.local:case ve.test:case ve.others:return 1;default:return}})()?a:ve.others,o&&this.extendBean("from",encodeURIComponent(o.slice(0,2048))),n&&this.lifeCycle.emit("onConfigChange",this.config),this.config},d.prototype.extendBean=function(e,t){this.bean[e]=t},d.prototype.send=function(e,i,o){var t=this;return Je([ke(this),we(this,null==e?void 0:e.type),function(n,r){t.request(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r({isErr:!1,result:e,logType:n.type,logs:n.log}),null!=i&&i.apply(void 0,e)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r({isErr:!0,result:e,logType:n.type,logs:n.log}),null!=o&&o.apply(void 0,e)})},_e(this)])(e)},d.prototype.sendSDKError=function(e){var n=this;this.sendPipeline([function(e,t){t({url:n.config.url+"?id=1085&msg[0]="+encodeURIComponent(te(e))+"&level[0]=2&from="+n.config.id+"&count=1&version="+n.config.id+"(1.0.11)",addBean:!1,method:"get",type:oe.SDK_ERROR,log:e})}],oe.SDK_ERROR)(e)},d.prototype.sendPipeline=function(e,t){var n,o=this;return Je(g([function(e,t){if(e&&e.type===oe.EVENT)return t(e);if("number"!=typeof n.config.random&&(console.warn("random must in [0, 1], default is 1."),n.config.random=1),!n.isHidden||!n.isGetSample)if(n.isGetSample)n.isHidden||t(e);else{if(n.isGetSample=!0,Math.random()<n.config.random)return n.isHidden=!1,t(e);n.isHidden=!0}},be(n=this,t)],e,[we(this,t),ke(this),function(r,i){o.request(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;-1<(""+e[o.failRequestCount=0]).indexOf("403 forbidden")&&(n=!0,o.destroy()),i({isErr:n,result:e,logType:null==r?void 0:r.type,logs:null==r?void 0:r.log}),null!=(n=null==r?void 0:r.success)&&n.call.apply(n,g([r],e))},function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];60<=++o.failRequestCount&&o.destroy(),-1<(""+t[0]).indexOf("403 forbidden")&&o.destroy(),i({isErr:!0,result:t,logType:null==r?void 0:r.type,logs:null==r?void 0:r.log}),null!=(e=null==r?void 0:r.fail)&&e.call.apply(e,g([r],t))})},_e(this)]))},d.prototype.track=function(e,t){void 0===t&&(t={}),e&&"string"==typeof e?(e={event_id:A(),event_type:M.CUSTOM,event_category:I.CUSTOM,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(),data:{event_name:e,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(t.properties)}},this.reportTDEMEvent(e)):console.warn("track: name must be a non-empty string")},d.prototype.trackStruggle=function(e,t){void 0===t&&(t={});var n,e="string"==typeof e?e.trim():"";!e||128<e.length?console.warn("trackStruggle: name must be a non-empty string limited to 128 characters"):(n=t.severity||"medium",(n=Qe[n])?this.reportStruggle({type:"custom_struggle",ownerType:"business",ownerKey:e,severity:n,detectionSource:"custom",ruleVersion:"custom-v1",tags:t.tags,properties:x(x({},t.properties||{}),{custom_struggle_name:e})}):console.warn("trackStruggle: severity must be low, medium, or high"))},d.prototype.reportTDEMEvent=function(e){var n=this,e=Array.isArray(e)?e:[e];e.length&&(e=e.map(function(e){var t;return x(x({},e),{page_url:e.page_url||n.getCurrentEventPageUrl(),data:x(x(x({},e.data),null!=(t=e.data)&&t.replay_id||!n.getCurrentReplayId()?{}:{replay_id:n.getCurrentReplayId()}),n.mergeEventTags(null==(t=e.data)?void 0:t.tags)?{tags:n.mergeEventTags(null==(t=e.data)?void 0:t.tags)}:{})})}),this.lifeCycle.emit("tdemEventCreated",e),this.tdemEventPipeline(e))},d.prototype.measure=function(e,t,n){void 0===n&&(n={}),e&&"string"==typeof e?"number"==typeof t?t<0||2147483646<t?console.warn("measure: duration must between 0 and 2147483646"):this.submitMeasure(e,t,n):console.warn("measure: duration must be a number"):console.warn("measure: name must be a non-empty string")},d.prototype.startMeasure=function(e){"string"==typeof e&&e?this.timeMap[e]?console.warn("Measure "+e+" already exists"):this.timeMap[e]=Date.now():console.warn("startMeasure: name must be a non-empty string")},d.prototype.endMeasure=function(e,t){var n;void 0===t&&(t={}),"string"==typeof e&&e?void 0!==(n=this.getTimeEventDuration(e))?(this.submitMeasure(e,n,t),delete this.timeMap[e]):console.warn("Measure "+e+" does not exist"):console.warn("endMeasure: name must be a non-empty string")},d.prototype.captureMessage=function(e,t){var n;void 0===t&&(t={}),"string"==typeof e&&e?(n="error"===t.level?"error":"warn"===t.level?"warn":"info",n={event_id:A(),event_type:M.LOG,event_category:I.LOG,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(t.pageUrl),data:{log_level:n,replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(x({message:e},t.properties||{}))}},this.reportTDEMEvent(n)):console.warn("captureMessage: message must be a non-empty string")},d.prototype.captureException=function(e,t){void 0===t&&(t={});var e="string"==typeof e?new Error(e):e;e instanceof Error?(e={event_id:A(),event_type:M.JS_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(t.pageUrl),data:{exception_stacks:[{type:e.name||"Error",value:e.message,mechanism_type:"manual",mechanism_handled:1}],exception_frames:ye(e),replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(x(x({},t.properties||{}),t.level?{capture_level:t.level}:{}))}},this.reportTDEMEvent(e)):console.warn("captureException: error must be an Error or string")},d.prototype.setTags=function(e){e=this.sanitizeEventTags(e);this.setConfig({defaultTags:x(x({},this.config.defaultTags||{}),e||{})})},d.prototype.removeTags=function(e){var t,e=Array.isArray(e)?e:[e];e.length&&(t=x({},this.config.defaultTags||{}),e.forEach(function(e){delete t[e]}),this.setConfig({defaultTags:t}))},d.prototype.clearTags=function(){this.setConfig({defaultTags:{}})},d.prototype.setUser=function(e){"string"==typeof e&&e?this.setConfig({userId:e}):console.warn("setUser: userId must be a non-empty string")},d.prototype.clearUser=function(){this.setConfig({userId:"",uin:""})},d.prototype.reportStruggle=function(e){var t,n,r;e&&e.type&&e.ownerType&&e.ownerKey?(r=e.type,t="number"==typeof e.severity?e.severity:tt[r],n="number"==typeof e.weight?e.weight:nt[r],r={event_id:A(),event_type:M.STRUGGLE,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl),data:{event_name:r,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(e.tags),is_effective_action:!1,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),struggle_weight:n,struggle_severity:t,struggle_value:"number"==typeof e.value?e.value:n*t,event_properties:x(x({},this.sanitizeStruggleProperties(e.properties)),{form_id:e.formId||"",field_id:e.fieldId||"",trigger_event_id:e.triggerEventId||"",struggle_status:e.status||"detected",struggle_owner_type:e.ownerType,struggle_owner_key:e.ownerKey,detection_source:e.detectionSource||"sdk_auto",rule_version:e.ruleVersion||this.getDefaultRuleVersion()})}},this.reportTDEMEvent(r)):console.warn("reportStruggle params error")},d.prototype.reportFormSubmitResult=function(e){e&&e.status?(e={event_id:A(),event_type:M.FORM_SUBMIT_RESULT,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl),data:{event_name:e.eventName||"form_submit_"+e.status,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(e.tags),is_effective_action:"boolean"!=typeof e.isEffectiveAction||e.isEffectiveAction,trigger_event_id:e.triggerEventId,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),validation_message:e.validationMessage?e.validationMessage.slice(0,256):void 0,event_properties:{status:e.status,validation_code:e.validationCode||"",form_id:e.formId||"",field_id:e.fieldId||""}}},this.reportTDEMEvent(e)):console.warn("reportFormSubmitResult params error")},d.prototype.reportPageView=function(e,t){void 0===t&&(t={});e=this.getCurrentEventPageUrl(e||t.pageUrl),e={event_id:A(),event_type:M.PAGE_VIEW,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:e,data:{page_title:t.pageTitle||"",referrer:t.referrer,replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(x(x(x(x(x(x(x({},t.properties||{}),t.navigationType?{navigation_type:t.navigationType}:{}),t.fromPage?{from_page:t.fromPage}:{}),t.toPage?{to_page:t.toPage}:{}),"boolean"==typeof t.isFirstVisit?{is_first_visit:t.isFirstVisit?"1":"0"}:{}),"boolean"==typeof t.isFirstLoad?{is_first_load:t.isFirstLoad?"1":"0"}:{}),t.deviceType?{device_type:t.deviceType}:{}))}};this.reportTDEMEvent(e)},d.prototype.setPage=function(e,t){var n;e&&"string"==typeof e?(n=this._customPageUrl||this.getCurrentEventPageUrl(),this._customPageUrl=e,this.reportPageView(e,{pageTitle:null==t?void 0:t.pageTitle,navigationType:"push",fromPage:(n||"").slice(0,512),toPage:e.slice(0,512),isFirstVisit:!1,tags:x({source:"manual",environment:this.config.env||"production",version:String(this.config.version||"")},null!=t&&t.pageGroup?{page_group:t.pageGroup}:{})}),this.lifeCycle.emit("pageChanged",{pageUrl:e,previousUrl:n,source:"manual"})):console.warn("setPage: pageUrl must be a non-empty string")},d.prototype.leavePage=function(){var e;this._customPageUrl&&(e=this._customPageUrl,this._customPageUrl=null,this.lifeCycle.emit("pageChanged",{pageUrl:this.getCurrentEventPageUrl(),previousUrl:e,source:"auto"}))},d.prototype.getCurrentEventPageUrl=function(e){var t;if(e)return e;if(this._customPageUrl)return this._customPageUrl;try{return this.getOriginFrom()}catch(e){return this.config.pageUrl||"undefined"!=typeof window&&(null==(t=window.location)?void 0:t.href)||""}},d.prototype.getCurrentReplayId=function(){var e,t;return String((null==(t=null==(t=null==(e=this.sessionManager)?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"")},d.prototype.getDefaultRuleVersion=function(){var e;return(null==(e=null==(e=this.config)?void 0:e.struggleMonitor)?void 0:e.ruleVersion)||"1.0.0"},d.prototype.getEventReplayId=function(e){return e||this.getCurrentReplayId()||void 0},d.prototype.mergeEventTags=function(e){return this.sanitizeEventTags(x(x({},this.config.defaultTags||{}),e||{}))},d.prototype.sanitizeStringMap=function(n,r){var i;if(void 0===r&&(r=1024),n&&"object"==typeof n)return i={},Object.keys(n).forEach(function(e){var t=n[e];e&&null!=t&&(i[String(e)]=String(t).slice(0,r))}),Object.keys(i).length?i:void 0},d.prototype.sanitizeEventTags=function(e){return this.sanitizeStringMap(e,1024)},d.prototype.sanitizeEventProperties=function(e){return this.sanitizeStringMap(e,1024)},d.prototype.sanitizeStruggleProperties=function(e){var n=this.sanitizeEventProperties(e);if(n)return Object.keys(n).reduce(function(e,t){return et.has(t)&&"custom_struggle_name"!==t||(e[t]=n[t]),e},{})},d.prototype.sanitizeEventPayload=function(n,e){var r,i=this;if(n&&"object"==typeof n)return e=(e=this.getPayloadAllowlist(e)).length?e:Object.keys(n),r={},e.forEach(function(e){var t;Object.prototype.hasOwnProperty.call(n,e)&&void 0!==(t=i.sanitizePayloadValue(n[e]))&&(r[e]=t)}),Object.keys(r).length?r:void 0},d.prototype.sanitizePayloadValue=function(n,r){var i=this;if(void 0===r&&(r=0),null!=n){if("string"==typeof n)return n.slice(0,256);if("number"==typeof n||"boolean"==typeof n)return n;if(Array.isArray(n))return n.slice(0,10).map(function(e){e=i.sanitizePayloadValue(e,r+1);return void 0===e?null:e});if("object"!=typeof n)return String(n).slice(0,256);if(2<=r)try{return JSON.stringify(n).slice(0,256)}catch(n){return}var o={};return Object.keys(n).slice(0,20).forEach(function(e){var t=i.sanitizePayloadValue(n[e],r+1);void 0!==t&&(o[e]=t)}),Object.keys(o).length?o:void 0}},d.prototype.getPayloadAllowlist=function(e){var t=null==(t=null==(t=this.config)?void 0:t.struggleMonitor)?void 0:t.payloadAllowlist;return Array.from(new Set(g(Array.isArray(t)?t:[],Array.isArray(e)?e:[]).filter(function(e){return!!e})))},d.prototype.normalizeRelatedEventIds=function(e){return Array.isArray(e)&&e.length&&(e=Array.from(new Set(e.filter(function(e){return"string"==typeof e&&e})))).length?e:void 0},d.prototype.ready=function(e,t,n){throw new Error('You need to override "ready" method')},d.prototype.request=function(e,t,n){throw new Error('You need to override "request" method')},d.prototype.speedLogPipeline=function(e){throw new Error('You need to override "speedLogPipeline" method')},d.prototype.getOriginFrom=function(){throw new Error('You need to override "getOriginFrom" method')},Object.defineProperty(d.prototype,"__version__",{get:function(){return"1.0.11"},enumerable:!1,configurable:!0}),d.prototype.submitMeasure=function(e,t,n){void 0===n&&(n={});e={event_id:A(),event_type:M.CUSTOM,event_category:I.CUSTOM,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(n.pageUrl),data:{event_name:e,measurements:{duration:t},replay_id:this.getEventReplayId(n.replayId),tags:this.sanitizeEventTags(n.tags),payload:this.sanitizeEventPayload(n.payload),event_properties:this.sanitizeEventProperties(n.properties)}};this.reportTDEMEvent(e)},d.prototype.getTimeEventDuration=function(e){if(void 0!==e&&this.timeMap[e])return Date.now()-this.timeMap[e]},d.version="1.0.11",d.instances=[],d.environment=ve,d.installedPlugins=[],d),e=(ot.prototype.patch=function(e){this.canUse(e)&&this.exist(e)&&(this.instances.push(e),this.triggerInit(e),this.triggerOnNewTdem(e))},ot.prototype.unpatch=function(e){var t=this.instances.indexOf(e);-1!==t&&(this.instances.splice(t,1),0===this.instances.length)&&this.uninstall(e)},ot.prototype.countInstance=function(){return this.instances.length},ot.prototype.uninstall=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.destroy)&&t.apply(this,[e])},ot.prototype.walk=function(n){var r=this;this.instances.forEach(function(e){var t=r.canUse(e);t&&n(e,t)})},ot.prototype.canUse=function(e){e=this.getConfig(e);return!(!e||"object"!=typeof e)||!!e},ot.prototype.getConfig=function(e){return null==(e=e.config)?void 0:e[this.name]},ot.prototype.exist=function(e){return-1===this.instances.indexOf(e)},ot.prototype.triggerInit=function(e){var t;this.inited||(this.inited=!0,null==(t=null==(t=this.option)?void 0:t.init))||t.call(this.option,this.getConfig(e))},ot.prototype.triggerOnNewTdem=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.onNewTdem)&&t.call(this.option,e,this.getConfig(e))},ot),it=new e({name:"aid",aid:"",init:function(e){try{var t=!0!==e&&e||window.localStorage.getItem("TDEM_ID");t||(t=Fe(),window.localStorage.setItem("TDEM_ID",t)),this.aid=t}catch(e){}},onNewTdem:function(e){e.bean.aid=this.aid,e.config.aid=this.aid}});function ot(e){this.tdemPlugin=!0,this.name="",this.instances=[],this.inited=!1,e.$walk=this.walk.bind(this),e.$getConfig=this.getConfig.bind(this),this.option=e,this.name=e.name}function d(e,t){var n,r,i,o,a,s,l,u,c;void 0===t&&(t={}),this.sdkName="tdem-web-sdk",this.sdkVersion=d.version,this.isGetSample=!1,this.isHidden=!1,this.config={version:0,delay:1e3,onError:!0,repeat:60,random:1,aid:!0,device:!0,pagePerformance:!0,webVitals:!0,lagMonitor:!0,blankScreen:!0,memoryMonitor:!0,speedSample:!0,onClose:!0,reportLoadPackageSpeed:!0,env:"production",url:"",reportImmediately:!0,tdemConfig:!0,hostUrl:"https://dem.rumt-zh.com",offlineUrl:"",whiteListUrl:"",pvUrl:"",speedUrl:"",customTimeUrl:"",performanceUrl:"",performanceUrlForHippy:"",webVitalsUrl:"",eventUrl:"",setDataReportUrl:""},this.isWhiteList=!1,this.lifeCycle=new q,this.bean={},this.internalRetrySchedule=ge,this._customPageUrl=null,this.tdemEventPipeline=Je([(r=n=!1,i=[],this._tdemSampleGate={decide:function(e){n=!0,(r=e)&&i.forEach(function(e){var t=e.event;return(0,e.resolve)(t)}),i=[]},reDecide:function(e){return r=!(e<=0)&&(100<=e||100*Math.random()<e)},get isDecided(){return n},get isSampled(){return r}},function(e,t){n?r&&t(e):i.length<1e3&&i.push({event:e,resolve:t})}),(a=20,u=Math.max(Number(a)||1,1),c=[],function(e,t){function n(){for(clearTimeout(s),clearTimeout(l),l=s=void 0;0<c.length;)t(c.splice(0,u))}e=Array.isArray(e)?e:[e];c.push.apply(c,e);u<=c.length?n():(clearTimeout(s),s=setTimeout(function(){0<c.length&&n()},5e3),l=l||setTimeout(function(){0<c.length&&n()},3e4))}),function(t,n){try{var e,r=JSON.parse(JSON.stringify(t)),i=(o.lifeCycle.emit("beforeReport",r),o.config.beforeReport);"function"==typeof i?0<(e=t.filter(function(e){return!1!==i(e)})).length&&n(e):n(t)}catch(e){n(t)}},Ge(o=this)]),this.timeMap={},this.failRequestCount=0,this.internalTransport=t.transport,this.internalRetrySchedule=t.retrySchedule||ge,d.instances.push(this)}function at(e){return e=e.sessionManager,[(null==(t=null==(t=null==e?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"",null==t||t.id,!t||t.sampled,null==t||t.sampled][0];var t}function st(e){return-1!==ct.indexOf(e)}var lt=new e({name:"assets"}),ut=lt=new e({name:"assets",collectCur:0,collectEntryType:"resource",ASSETS_INITIATOR_TYPE:["img","css","script","link","audio","video"],getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},onNewTdem:function(e){var t=this;$e()&&(setTimeout(function(){t.collectSuccessLog(e),t.collectFailLog(e)},5e3),performance.onresourcetimingbufferfull=function(){"function"==typeof performance.clearResourceTimings&&(t.collectCur=0,performance.clearResourceTimings())})},processLog:function(e,t){var n=t.duration||0,r=t.transferSize||0,n={event_id:A(),event_type:M.RESOURCE_LOAD,event_category:I.NETWORK,timestamp:Date.now(),page_url:t.from||window.location.href,data:{url:t.url,resource_type:t.type||"static",measurements:{duration:n,dns_time:t.domainLookup,tcp_time:t.connectTime,transfer_size:0<r?r:void 0},replay_id:at(e),tags:{environment:e.config.env||"production",is_https:t.isHttps?"true":"false"},event_properties:{is_cached:String(0===r),protocol:t.nextHopProtocol||"",http_status:String(t.status||0)}}};null!=(r=e.reportTDEMEvent)&&r.call(e,n)},publish:function(t,n){var r=this;this.$walk(function(e){e===n&&(Array.isArray(t)?t.forEach(r.processLog):r.processLog(n,t))})},publishMany:function(e,t){for(var n=t.config,r=this.getFromParam(t),i=0,o=e.length;i<o;i++){var a=e[i];-1===this.ASSETS_INITIATOR_TYPE.indexOf(a.initiatorType)||re(a.name,n.hostUrl)||this.publish(this.generateLog(a,n,r),t)}},collectSuccessLog:function(n){var e,t,r=this;"function"==typeof window.PerformanceObserver?(this.publishMany(performance.getEntriesByType(this.collectEntryType),n),(e=new window.PerformanceObserver(function(e){r.publishMany(e.getEntries(),n)})).observe({entryTypes:[this.collectEntryType]}),n.lifeCycle.on("destroy",function(){0===lt.countInstance()&&e.disconnect()})):(t=setInterval(function(){var e=performance.getEntriesByType(r.collectEntryType),t=e.slice(r.collectCur);r.collectCur=e.length,r.publishMany(t,n)},3e3),n.lifeCycle.on("destroy",function(){0===lt.countInstance()&&clearInterval(t)}))},collectFailLog:function(i){function e(e){var t,n,r;e&&(e=e.target||e.srcElement,!(t=(null==e?void 0:e.src)||(null==e?void 0:e.href))||"string"!=typeof t||-1<window.location.href.indexOf(t)||(e="function"==typeof(null==(e=a.api)?void 0:e.resourceTypeHandler)?null==e?void 0:e.resourceTypeHandler(t):"",r=performance.getEntriesByType(o.collectEntryType).find(function(e){return e.name===t}),re(t,a.hostUrl))||(n=o.getFromParam(i),r={url:K(t),status:400,duration:Number(((null==r?void 0:r.duration)||0).toFixed(2)),method:"get",type:e||"static",isHttps:$(t),urlQuery:J(t,!0),nextHopProtocol:"",domainLookup:0,connectTime:0,from:n},o.publish(r,i)))}var o=this,a=i.config;window.document.addEventListener("error",e,!0),i.lifeCycle.on("destroy",function(){0===lt.countInstance()&&window.document.removeEventListener("error",e,!0)})},generateLog:function(e,t,n){var t="function"==typeof(null==(r=t.api)?void 0:r.resourceTypeHandler)?null==(r=t.api)?void 0:r.resourceTypeHandler(e.name):"",r=e.transferSize;return{url:K(e.name),method:"get",duration:Number(e.duration.toFixed(2)),status:200,type:t||"static",isHttps:$(e.name),nextHopProtocol:e.nextHopProtocol||"",urlQuery:J(e.name,!0),domainLookup:Z(e.domainLookupEnd-e.domainLookupStart),connectTime:Z(e.connectEnd-e.connectStart),transferSize:0<r?r:-1,from:n}},collectNotReportedLog:function(e){var t,n;$e()&&(t=(n=performance.getEntriesByType(this.collectEntryType)).length,"function"!=typeof window.PerformanceObserver)&&this.collectCur!==t&&(n=n.slice(this.collectCur),this.collectCur=t,this.publishMany(n,e))},destroy:function(){this.option.publish=function(){}}}),ct=window.navigator.userAgent.toLowerCase(),l={};l.macos=function(){return st("mac")},l.ios=function(){return l.iphone()||l.ipod()||l.ipad()},l.iphone=function(){return!l.windows()&&st("iphone")},l.ipod=function(){return st("ipod")},l.ipad=function(){var e="MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;return st("ipad")||e},l.android=function(){return!l.windows()&&st("android")},l.androidPhone=function(){return l.android()&&st("mobile")},l.androidTablet=function(){return l.android()&&!st("mobile")},l.blackberry=function(){return st("blackberry")||st("bb10")},l.blackberryPhone=function(){return l.blackberry()&&!st("tablet")},l.blackberryTablet=function(){return l.blackberry()&&st("tablet")},l.windows=function(){return st("windows")},l.windowsPhone=function(){return l.windows()&&st("phone")},l.windowsTablet=function(){return l.windows()&&st("touch")&&!l.windowsPhone()},l.fxos=function(){return(st("(mobile")||st("(tablet"))&&st(" rv:")},l.fxosPhone=function(){return l.fxos()&&st("mobile")},l.fxosTablet=function(){return l.fxos()&&st("tablet")},l.meego=function(){return st("meego")},l.cordova=function(){return window.cordova&&"file:"===location.protocol},l.nodeWebkit=function(){return"object"==typeof window.process},l.mobile=function(){return l.androidPhone()||l.iphone()||l.ipod()||l.windowsPhone()||l.blackberryPhone()||l.fxosPhone()||l.meego()},l.tablet=function(){return l.ipad()||l.androidTablet()||l.blackberryTablet()||l.windowsTablet()||l.fxosTablet()},l.desktop=function(){return!l.tablet()&&!l.mobile()};function dt(){return{host:new URL(location.href).host,pathname:location.pathname}}var ft,ht,pt,mt,vt=!(l.isIE=function(){return"ActiveXObject"in window}),gt=[],yt=/^\/[^/]/;function wt(e,t){return mt(e,t)}function bt(T,O){if(void 0===O&&(O=/\.flv(\?|$)/i),_t.find(function(e){return e.name===T.name}))throw new Error("name '"+T.name+"' is already in hackFetch option list");_t.push(T),!kt&&window.fetch&&(kt=!0,mt=window.fetch,window.fetch=function(e,t){void 0===t&&(t={});var n,i="string"==typeof e?e:e&&"object"==typeof e?"string"==typeof(n=e.url)&&n?n:"string"==typeof(n=e.href)&&n?n:"":"";if(i&&null!=(n=null==O?void 0:O.test)&&n.call(O,i))return wt(e,t);yt.test(i)&&(i=""+location.origin+i);var r,o,a,s,l,u,c,d,f=T||{},h=f.traceRequestHeader,f=f.shouldInjectTrace;if(h&&(!f||f()))try{var p=((e,t)=>(e="undefined"!=typeof Request&&"string"!=typeof e&&e instanceof Request?St(e.headers):{},x(x({},e),St(t.headers))))(e,t),m=dt(),v=m.host,g=m.pathname,y=h.generate(i,p,{host:v,pathname:g})||{},w=y.name,b=y.value;w&&b&&(r=e,o=t,a=w,s=b,u="undefined"!=typeof Headers?Headers:null,c="undefined"!=typeof Request&&"string"!=typeof r&&r instanceof Request,d=o.headers,u&&(c||d&&d instanceof u)?(l=new u(c?r.headers:void 0),d instanceof u?d.forEach(function(e,t){return l.set(t,e)}):Array.isArray(d)?d.forEach(function(e){e&&e[0]&&l.set(String(e[0]),String(e[1]))}):d&&"object"==typeof d&&Object.keys(d).forEach(function(e){l.set(e,String(d[e]))}),l.has(a)||l.set(a,s),o.headers=l):(c=St(d))[a]||c[a.toLowerCase()]||(o.headers=Object.assign({},c,((r={})[a]=s,r))))}catch(e){}for(var k=new Map,_=window.location.href,S=0;S<_t.length;S++){var E=_t[S];try{"function"==typeof E.beforeFetch&&E.beforeFetch(i,t),"function"==typeof E.getCurrentFrom&&k.set(E.name,E.getCurrentFrom())}catch(e){}}var C=Date.now(),R=Object.assign({},t,{method:(f=e,(m=t)&&m.method?String(m.method).toUpperCase():"string"!=typeof f&&f&&f.method?String(f.method).toUpperCase():"GET")});return wt(e,t).then(function(e){var t;try{t=e.clone()}catch(t){for(var n=0;n<_t.length;n++){var r=_t[n];try{"function"==typeof r.cloneError&&r.cloneError(e,Date.now()-C,i,R,C,k.get(r.name),_)}catch(e){}}return e}for(n=0;n<_t.length;n++){r=_t[n];try{"function"==typeof r.then&&r.then(t,Date.now()-C,i,R,C,k.get(r.name),_)}catch(e){}}return e}).catch(function(e){for(var t=0;t<_t.length;t++){var n=_t[t];try{"function"==typeof n.catch&&n.catch(e,Date.now()-C,i,R,C,k.get(n.name),_)}catch(e){}}throw e})})}var kt=!1,_t=[];function St(e){var n;return e?"undefined"!=typeof Headers&&e instanceof Headers?(n={},e.forEach(function(e,t){n[t]=e,n[t.toLowerCase()]=e}),n):Array.isArray(e)?e.reduce(function(e,t){return t&&t[0]&&(e[String(t[0])]=String(t[1])),e},{}):x({},e):{}}function Et(r,e,i){return null!=e&&e.length&&"object"==typeof r?e.reduce(function(e,t){var n=window.Headers&&r instanceof Headers?r.get(t):r[t];return n?e+(""===e?"":"\n\n")+i+" header "+t+": "+n:e},""):""}function Ct(e,t){return e&&-1===["null","undefined"].indexOf(e)?t+": "+e:""}function Rt(e,t,n){void 0===t&&(t="");var r,i,e="function"==typeof(null==(i=e.api)?void 0:i.resourceTypeHandler)?null==(i=e.api)?void 0:i.resourceTypeHandler(n):"";return-1===W.indexOf(e)&&(r=void 0===t?"":t,i=(void 0===n?"":n).split("?")[0],e=se.test(i)||ae.some(function(e){return-1!==String(r).indexOf(e)})?"static":"fetch"),e}function Tt(e,t){return e?It.AJAX_ERROR:t?It.RET_ERROR:It.API_RESPONSE}function Ot(e,t,n){if(!e)return!1;if(null!=(t=null==t?void 0:t.api)&&t.isSlowApi&&"function"==typeof(null==t?void 0:t.isSlowApi))try{return t.isSlowApi(n||{duration:e})}catch(e){return console.warn("[TDEM] isSlowApi function happen error:",e,", this data will not be reported."),!1}return(n=null!=(n=null==t?void 0:t.slowThreshold)?n:null==t?void 0:t.apiSlowThreshold)&&"number"==typeof n?n<e:1e3<e}function xt(e,t){if(null!=(e=e.api)&&e.usePerformanceTiming&&"string"==typeof t.url){e=null==(e=performance.getEntriesByName(t.url))?void 0:e.pop();if(e)return{url:t.url,isHttps:$(t.url),method:t.method,type:t.type,status:t.status,duration:Number(e.duration.toFixed(2)),nextHopProtocol:e.nextHopProtocol||"",domainLookup:Z(e.domainLookupEnd-e.domainLookupStart),connectTime:Z(e.connectEnd-e.connectStart)}}return{url:t.url,isHttps:$(t.url),method:t.method,type:t.type,status:t.status,duration:Number(t.duration.toFixed(2)),nextHopProtocol:"",domainLookup:F.number,connectTime:F.number}}var Mt={maxRetryCount:10,retryInterval:function(e){return 1e3*(2<<e)},whenRetryEndStillFail:"discard"},It={API_RESPONSE:"api_response",AJAX_ERROR:"ajax_error",RET_ERROR:"ret_error",SLOW_NET_REQUEST:"slow_net_request"};function At(e){return!e||"boolean"==typeof e||"number"!=typeof(e=e.sseStallThresholdMs)||!Number.isFinite(e)||e<=0?6e4:e}function Pt(e){return e&&"text/event-stream"===e.split(";")[0].trim().toLowerCase()}function Dt(e,t,n){return!e||"object"!=typeof e||"AbortError"!==e.name&&"ABORT_ERR"!==e.code&&"ECONNABORTED"!==e.code&&!0!==e.aborted?(0<t||"number"==typeof n&&200<=n&&n<400)&&((e=>{if(Lt(e)&&-1!==e.toLowerCase().indexOf("terminated"))return 1;for(var t=e,n=new Set;t&&"object"==typeof t&&!n.has(t);){n.add(t);var r=String(t.name||""),i=String(t.code||""),o=String(t.message||"").toLowerCase();if("TypeError"===r&&-1!==o.indexOf("terminated"))return 1;if("ERR_INVALID_STATE"===i)return 1;t=t.cause}})(e)||Lt(e))?"succeed":"failTransport":"cancel"}var Lt=function(e){return"string"==typeof e&&""!==e.trim()};function Nt(e){var t=String(e.requestUrl||""),n=String(e.finalUrl||""),r=t&&J(t)||t,i=n&&J(n)||n||r,n=!0===e.redirected||!!n&&!!t&&n!==t;return{url:i,originalUrl:r&&i&&r!==i?r:void 0,httpMethod:String(e.httpMethod||"GET").toUpperCase(),redirectCount:n?1:0}}function Ft(n){function r(){y();var e=n.stallThresholdMs;0<e&&(u=setTimeout(function(){t("stalled")},e))}function i(){var e,t,n=c();void 0===o?o=n:void 0!==a&&(e=n-a,(void 0===s||s<e)&&(s=e),t=f,(e=e)<500?t.gap_lt_500_count+=1:e<1e3?t.gap_500_999_count+=1:e<3e3?t.gap_1000_2999_count+=1:e<1e4?t.gap_3000_9999_count+=1:e<6e4?t.gap_10000_59999_count+=1:t.gap_ge_60000_count+=1),a=n,m+=1,r()}function t(e){if(!v){v=!0,y(),g.splice(0).forEach(function(e){try{e()}catch(e){}});var t=Math.max(0,c()-d),t=x({duration:t,redirect_count:Math.max(0,n.redirectCount||0),message_count:m,stall_threshold_ms:n.stallThresholdMs},f),e=(void 0!==o&&(t.time_to_first_message=Math.max(0,o-d)),void 0!==a&&(t.last_message_offset=Math.max(0,a-d)),void 0!==s&&(t.max_message_gap=s),{http_method:n.httpMethod||"GET",outcome:e}),t=(void 0!==l&&0<l&&(e.http_status=String(l)),n.originalUrl&&n.originalUrl!==n.url&&(e.original_url=n.originalUrl),{event_id:A(),event_type:M.SSE_CALL,event_category:I.NETWORK,timestamp:c(),page_url:n.pageUrl||"",data:{url:n.url,resource_type:"sse",measurements:t,replay_id:n.replayId||void 0,event_properties:e}});try{n.report(t)}catch(e){}}}var o,a,s,l,u,c=n.now||Date.now,d=c(),f={gap_lt_500_count:0,gap_500_999_count:0,gap_1000_2999_count:0,gap_3000_9999_count:0,gap_10000_59999_count:0,gap_ge_60000_count:0},h="",p=!1,m=0,v=!1,g=[],y=function(){void 0!==u&&(clearTimeout(u),u=void 0)};return r(),{ingestText:function(e){if(!v){e=e.replace(/\r\n/g,"\n");if(p){var t=e.indexOf("\n\n");if(-1===t)return;p=!1,e=e.slice(t+2)}for(var n=(h=(h+=e).replace(/\r\n/g,"\n")).indexOf("\n\n");-1!==n;){var r=h.slice(0,n);h=h.slice(n+2),r.replace(/\r\n/g,"\n").split("\n").some(function(e){return e.startsWith("data:")||"data"===e})&&i(),n=h.indexOf("\n\n")}1048576<h.length&&(p=!(h=""))}},ingestCompleteMessage:function(){v||i()},noteHttpStatus:function(e){0<e&&(l=e)},succeed:function(){return t("success")},failTransport:function(){return t("transport_error")},httpError:function(){return t("http_error")},cancel:function(){return t("cancelled")},pauseStall:function(){v||y()},resumeStall:function(){v||r()},onSeal:function(t){if(v){try{t()}catch(t){}return function(){}}return g.push(t),function(){var e=g.indexOf(t);-1!==e&&g.splice(e,1)}},seal:t,get sealed(){return v},get messageCount(){return m},get httpStatus(){return l}}}function Ut(u,c){var d;return P(this,void 0,void 0,function(){var t,n,r,i,o,a,s,l;return D(this,function(e){switch(e.label){case 0:if(!u||"function"!=typeof u.getReader)return c.succeed(),[2];t=u.getReader(),r=n=!1,i=function(){if(!n&&!r&&"function"==typeof t.cancel){r=!0;try{var e=t.cancel();e&&"function"==typeof e.catch&&e.catch(function(){})}catch(e){}}},o=c.onSeal(i),a="undefined"!=typeof TextDecoder?new TextDecoder:{decode:function(e){return"undefined"!=typeof Buffer?Buffer.from(e).toString("utf8"):Array.from(e).map(function(e){return String.fromCharCode(e)}).join("")}},e.label=1;case 1:e.trys.push([1,5,6,7]),e.label=2;case 2:return c.sealed?[3,4]:[4,t.read()];case 3:return s=e.sent(),l=s.done,s=s.value,l?(n=!0,c.succeed(),[2]):(s&&c.ingestText(a.decode(s,{stream:!0})),[3,2]);case 4:return[3,7];case 5:return l=e.sent(),c.sealed||c[Dt(l,c.messageCount,c.httpStatus)](),[3,7];case 6:o(),i();try{null!=(d=t.releaseLock)&&d.call(t)}catch(e){}return[7];case 7:return[2]}})})}var zt,Bt,jt=!1;function Wt(e){var t=e.__tdemXhrHooks;t&&(e.removeEventListener("readystatechange",t.onReadyStateChange),e.removeEventListener("progress",t.onProgress),e.removeEventListener("loadend",t.onLoadEnd),e.removeEventListener("abort",t.onAbort),e.removeEventListener("error",t.onError),e.removeEventListener("timeout",t.onTimeout),e.__tdemXhrHooks=void 0)}function Ht(e){var t=String(e.responseType||"").toLowerCase();if(!t||"text"===t)try{return"string"==typeof e.responseText?e.responseText:""}catch(e){}}new e({name:"api"});function qt(e){return(e=(e=>{var t="",n=e.nodeType;if(1===n||9===n||11===n){if("string"==typeof e.textContent)return e.textContent;for(var r=e.firstChild;r;r=r.nextSibling)t+=sn(e)}else if(3===n||4===n)return e.nodeValue;return t})(e))?e.replace(/^\s+|\s+$/g,""):""}var Vt,Gt,Zt,Jt=new e({name:"api",override:!1,onNewTdem:function(e){var t,n;this.override||(this.override=!0,null!=(n=e.config.api)&&n.injectTraceHeader&&(this.traceRequestHeader=new He(n.injectTraceHeader,null!=(t=null==n?void 0:n.injectTraceIgnoreUrls)?t:[],null==n?void 0:n.injectTraceUrls,null==n?void 0:n.traceFlag)),this.overrideFetch(e.config,e),this.overrideXhr(e.config,e),!1!==n&&this.overrideEventSource(e.config,e))},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},overrideFetch:function(k,_){var S=this,s=k.api,e={name:this.name,traceRequestHeader:null!=s&&s.injectTraceHeader?this.traceRequestHeader:null,shouldInjectTrace:function(){return Ze(_)},getCurrentFrom:function(){return S.getFromParam(_)},cloneError:function(e,t,n,r,i,o){var a;re(n,k.hostUrl)||(a=e.headers?e.headers.get("content-type"):"",!1!==s&&Pt(a)&&((n=Ft({url:(a=Nt({requestUrl:n,finalUrl:e&&e.url,httpMethod:null==r?void 0:r.method,redirected:!!e.redirected})).url,originalUrl:a.originalUrl,httpMethod:a.httpMethod,redirectCount:a.redirectCount,stallThresholdMs:At(s),report:function(e){var t;return null==(t=_.reportTDEMEvent)?void 0:t.call(_,e)},pageUrl:o||S.getFromParam(_),replayId:at(_)})).noteHttpStatus(e.status),400<=e.status?n.httpError():n.succeed()))},then:function(h,p,m,v,g,y,w){if(!re(m,k.hostUrl)){var e,t,n=h.headers?h.headers.get("content-type"):"";if(!1!==s&&Pt(n))return e=Nt({requestUrl:m,finalUrl:h&&h.url,httpMethod:null==v?void 0:v.method,redirected:!!h.redirected}),(t=Ft({url:e.url,originalUrl:e.originalUrl,httpMethod:e.httpMethod,redirectCount:e.redirectCount,stallThresholdMs:At(s),report:function(e){var t;return null==(t=_.reportTDEMEvent)?void 0:t.call(_,e)},pageUrl:y||S.getFromParam(_),replayId:at(_)})).noteHttpStatus(h.status),h.__tdemSseObserver=t,400<=h.status?(t.httpError(),void Ut(h.body,t).catch(function(){})):void Ut(h.body,t).catch(function(){t.sealed||t.failTransport()});var b=Rt(k,n||"",m);"fetch"===b?h.clone().text().then(function(i){var e,o=h.status<=0||400<=h.status,t=(null==(t=k.api)?void 0:t.reqHeaders)||[],a=Et(null==v?void 0:v.headers,t,"req"),t=(null==(t=k.api)?void 0:t.resHeaders)||[],s=Et(h.headers,t,"res"),l=Be(null==v?void 0:v.headers),t=X(i,k.api,{url:m,ctx:h,payload:null==v?void 0:v.body}),u=t.code,c=t.isErr,t=null==(t=k.api)?void 0:t.apiDetail,d=t?ee(null==v?void 0:v.body,null==(e=k.api)?void 0:e.reqParamHandler,{url:m}):"",f=t?ee(i,null==(e=k.api)?void 0:e.resBodyHandler,{url:m,ctx:h}):"";setTimeout(function(){var e=xt(k,{url:m,duration:p,type:b,status:h.status||0,method:(null==v?void 0:v.method)||"get"}),t=[o?"FETCH_ERROR: "+i:"","fetch req url: "+m,"res status: "+(e.status||0),"res duration: "+e.duration+"ms","res startTime: "+g,a,s,"req method: "+(e.method||"GET"),"res retcode: "+u,Ct(d,"req param"),Ct(f,"res data")].filter(function(e){return e}).join("\n\n"),t=(e.payload=null==v?void 0:v.body,e.ret=u,e.isErr=+c,e.from=y||S.getFromParam(_),{msg:t,code:u,trace:l,errorMsg:"",from:y||S.getFromParam(_),originFrom:w,level:It.API_RESPONSE}),n=Ot(null==e?void 0:e.duration,k,e),r=Tt(o,c);t.level=r===It.API_RESPONSE&&n?It.SLOW_NET_REQUEST:r,t.isErr=c,(n||t.level!==It.API_RESPONSE||_.isWhiteList||null!=(n=null==(r=_.config)?void 0:r.api)&&n.reportRequest||null!=(n=null==(r=_.config)?void 0:r.api)&&n.injectTraceHeader)&&S.publishNormalLog(t,_),S.publishSpeed(e,_)},0)}).catch(function(e){console.info("ignore something error when process resp "+e)}):setTimeout(function(){var e=xt(k,{url:m,duration:p,type:b,status:h.status||0,method:(null==v?void 0:v.method)||"get"});e.type="static",e.urlQuery=J(m,!0),e.from=y||S.getFromParam(_),S.publishSpeed(e,_)},0)}},catch:function(t,n,r,i,o,a,s){var l,e,u,c,d;if(re(r,k.hostUrl))throw t;if("AbortError"!==(t&&t.name))throw l=Rt(k,"",r),e=(null==(e=k.api)?void 0:e.reqHeaders)||[],u=Et(null==i?void 0:i.headers,e,"req"),c=Be(null==i?void 0:i.headers),d=null!=(e=k.api)&&e.apiDetail?ee(null==i?void 0:i.body,null==(e=k.api)?void 0:e.reqParamHandler,{url:r}):"",setTimeout(function(){var e=xt(k,{url:r,duration:n,type:l,status:0,method:(null==i?void 0:i.method)||"get"}),e=(e.from=a||S.getFromParam(_),S.publishSpeed(e,_),"AJAX_ERROR: "+t+"\n \nreq url: "+r+"\n \nres status: 0\n \nres duration: "+e.duration+"ms\n \nreq method: "+((null==i?void 0:i.method)||"get")+"\n \nreq param: "+d+"\n \nres startTime: "+o+"\n \n"+u);S.publishNormalLog({msg:e,level:It.AJAX_ERROR,code:-400,trace:c,errorMsg:"",from:a||S.getFromParam(_),originFrom:s},_)},0),t}};this.hackFetchOptions=e,bt(this.hackFetchOptions,null==(e=k.api)?void 0:e.ignoreHackReg)},overrideXhr:function(C,R){var i,T=this,e={name:this.name,ignoreHackReg:null==(e=C.api)?void 0:e.ignoreHackReg,traceRequestHeader:null!=(e=C.api)&&e.injectTraceHeader?this.traceRequestHeader:null,getCurrentFrom:function(){return T.getFromParam(R)},open:function(e){var t;(t=(e=e).__tdemSseObserver)&&!t.sealed&&t.cancel(),Wt(e),e.__tdemSseClaimed=!1,e.__tdemSseObserver=void 0,e.failType=void 0},send:function(b,k,_,S){function e(){b.failType="abort"}function t(){b.failType="error"}function n(){b.failType="timeout"}function r(){var e;!1===C.api||b.__tdemSseClaimed||(e=b.tdemUrl||"",re(e,C.hostUrl))||Pt(("function"==typeof b.getResponseHeader?b.getResponseHeader("content-type"):"")||"")&&(b.__tdemSseClaimed=!0,(e=Ft({url:(e=Nt({requestUrl:b.tdemUrl||"",finalUrl:("string"==typeof b.responseURL?b.responseURL:"")||void 0,httpMethod:b.tdemMethod})).url,originalUrl:e.originalUrl,httpMethod:e.httpMethod,redirectCount:e.redirectCount,stallThresholdMs:At(C.api),report:function(e){var t;return null==(t=R.reportTDEMEvent)?void 0:t.call(R,e)},pageUrl:_||T.getFromParam(R),replayId:at(R)})).noteHttpStatus(b.status),b.__tdemSseObserver=e)}function i(){r()}function o(){r();var e,t=b.__tdemSseObserver;t&&void 0!==(e=Ht(b))&&e.length>u&&(t.ingestText(e.slice(u)),u=e.length)}function a(){var e,v,g,t,y,w=b.tdemUrl||"";b.__tdemSseClaimed?((e=b.__tdemSseObserver)&&!e.sealed&&(void 0!==(t=Ht(b))&&t.length>u&&e.ingestText(t.slice(u)),e.noteHttpStatus(b.status),"abort"===b.failType?e.cancel():400<=b.status?e.httpError():b.failType?e.failTransport():e.succeed()),Wt(b)):(Wt(b),re(w,C.hostUrl)||"abort"===b.failType||(v="",(b.failType||!b.status||400<=b.status)&&(v=b.failType||"failed"),g=Date.now()-E,t=b.getResponseHeader("content-type")||"",y=Rt(C,t,w),setTimeout(function(){var a=xt(C,{url:w,duration:g,type:y,status:b.status,method:b.tdemMethod||"get"});if(a.from=_||T.getFromParam(R),"fetch"===y){var e=(null==(e=C.api)?void 0:e.reqHeaders)||[],s=Et(b.tdemXhrReqHeader,e,"req"),e=(null==(e=C.api)?void 0:e.resHeaders)||[],t=b.getAllResponseHeaders().split("\r\n").reduce(function(e,t){t=t.split(": ");return t[0]&&t[1]&&(e[t[0]]=t[1]),e},{}),l=Et(t,e,"res"),u=Be(b.tdemXhrReqHeader),e=null==(t=C.api)?void 0:t.apiDetail,c=e?ee(k,null==(t=C.api)?void 0:t.reqParamHandler,{url:w}):"",d=e?ee(b.response,null==(t=C.api)?void 0:t.resBodyHandler,{url:w}):"";try{var n,r,i,o=b.response,f=C.api,h={url:w,ctx:b,payload:k},p=function(e){var t,n=e.code,e=e.isErr,r=[v?"AJAX_ERROR: request "+v:"","fetch req url: "+w,"res status: "+(a.status||0),"res duration: "+a.duration+"ms","res startTime: "+E,s,l,"req method: "+(a.method||"GET"),"res retcode: "+n,Ct(c,"req param"),Ct(d,"res data")].filter(function(e){return e}).join("\n\n"),i=(a.ret=n,a.isErr=+e,a.payload=k,Tt(!!v,e)),o=Ot(null==a?void 0:a.duration,C,a);(i!==It.API_RESPONSE||o||R.isWhiteList||null!=(t=null==(t=R.config)?void 0:t.api)&&t.reportRequest||null!=(t=null==(t=R.config)?void 0:t.api)&&t.injectTraceHeader)&&T.publishNormalLog({msg:r,level:i===It.API_RESPONSE&&o?It.SLOW_NET_REQUEST:i,code:n,isErr:e,trace:u,errorMsg:"",from:_||T.getFromParam(R),originFrom:S},R),T.publishSpeed(a,R)};try{if("function"==typeof(null==f?void 0:f.retCodeHandlerAsync))return void f.retCodeHandlerAsync(o,null==h?void 0:h.url,null==h?void 0:h.ctx,function(e){var t=e.code;null!=p&&p({code:void 0===t?H:t,isErr:e.isErr})});if("function"==typeof(null==f?void 0:f.retCodeHandler))return void(i=(r=f.retCodeHandler(o,null==h?void 0:h.url,null==h?void 0:h.ctx,null==h?void 0:h.payload)||{}).code,null!=p&&p({code:void 0===i?H:i,isErr:r.isErr}));if(!(o="string"==typeof o?JSON.parse(o):o))return void(null!=p&&p({code:H,isErr:!1}));"function"==typeof(null==(n=null==f?void 0:f.ret)?void 0:n.join)&&(le=[].concat(f.ret.map(function(e){return e.toLowerCase()})));var m=Object.getOwnPropertyNames(o).filter(function(e){return-1!==le.indexOf(e.toLowerCase())});if(m.length)return void("未知"!==(i=o[m[0]])&&""!==i||(i=H),null!=p&&p({code:""+i,isErr:0!==i&&"0"!==i&&i!==H}));null!=p&&p({code:H,isErr:!1})}catch(o){null!=p&&p({code:H,isErr:!1})}}catch(e){a.ret=H,T.publishSpeed(a,R)}}else a.type="static",a.urlQuery=J(w,!0),T.publishSpeed(a,R)},0)))}var s,l,E=Date.now(),u=(((null==C?void 0:C.api)||{}).injectTraceHeader&&Ze(R)&&(l=(s=dt()).host,s=(l=T.traceRequestHeader.generate(b.tdemUrl,{},{host:l,pathname:s.pathname})||{}).name,l=l.value,s)&&l&&b.setRequestHeader(s,l),0);b.__tdemXhrHooks={onReadyStateChange:i,onProgress:o,onLoadEnd:a,onAbort:e,onError:t,onTimeout:n},b.addEventListener("readystatechange",i),b.addEventListener("progress",o),b.addEventListener("loadend",a),b.addEventListener("abort",e),b.addEventListener("error",t),b.addEventListener("timeout",n)}};this.hackXHROptions=e,i=this.hackXHROptions,gt.find(function(e){return e.name===i.name})||(gt.push(i),!vt&&window.XMLHttpRequest&&(ft=window.XMLHttpRequest.prototype.send,ht=window.XMLHttpRequest.prototype.open,pt=window.XMLHttpRequest.prototype.setRequestHeader,vt=!0,window.XMLHttpRequest.prototype.open=function(){this.tdemMethod=arguments[0];var e,t=arguments[1];if(yt.test(t)&&(t=""+location.origin+t),this.tdemUrl=t,null==(t=null==(e=i.ignoreHackReg)?void 0:e.test)||!t.call(e,this.tdemUrl))if(this.tdemXhrStartTime=Date.now(),this.sendByTdem)l.isIE()||(this.timeout=5e3);else for(var n=0;n<gt.length;n++){var r=gt[n];try{"function"==typeof r.open&&r.open(this)}catch(e){}}return ht.apply(this,arguments)},window.XMLHttpRequest.prototype.setRequestHeader=function(){var e,t,n;return null!=(t=null==(n=i.ignoreHackReg)?void 0:n.test)&&t.call(n,this.tdemUrl)?pt.apply(this,arguments):(t=arguments[0],n=arguments[1],this.tdemXhrReqHeader=null!=(e=this.tdemXhrReqHeader)?e:{},null!=i&&i.traceRequestHeader&&-1<["traceparent","b3","sw8","sentry-trace"].indexOf(t)&&(this.tdemXhrReqHeader[t]||(arguments[1]=n),this.tdemXhrReqHeader[t])?void 0:(this.tdemXhrReqHeader[t]=arguments[1],pt.apply(this,arguments)))},window.XMLHttpRequest.prototype.send=function(){var e,t;if(!(null!=(t=null==(e=i.ignoreHackReg)?void 0:e.test)&&t.call(e,this.tdemUrl)||this.sendByTdem))for(var n=0;n<gt.length;n++){var r=gt[n];try{"function"==typeof r.send&&r.send(this,arguments[0],"function"==typeof r.getCurrentFrom?r.getCurrentFrom():void 0,window.location.href)}catch(e){}}return ft.apply(this,arguments)}))},overrideEventSource:function(i,o){var n,a=this;function e(e,t){t=new n(e,t);try{null!=Bt&&Bt(t,String(e))}catch(e){}return t}Bt={onCreate:function(t,e){if(!re(e,i.hostUrl)){var n=Ft({url:J(e)||e,httpMethod:"GET",stallThresholdMs:At(i.api),report:function(e){var t;return null===(t=o.reportTDEMEvent)||void 0===t?void 0:t.call(o,e)},pageUrl:a.getFromParam(o),replayId:at(o)});n.pauseStall(),t.addEventListener("open",function(){return n.resumeStall()}),t.addEventListener("message",function(){return n.ingestCompleteMessage()}),t.addEventListener("error",function(){if(!n.sealed){var e=t.readyState;0!==e?2===e&&n.failTransport():n.pauseStall()}});var r=t.close.bind(t);t.close=function(){try{n.sealed||n.cancel()}finally{r()}}}}}.onCreate,"undefined"!=typeof window&&window.EventSource&&!jt&&(jt=!0,n=zt=window.EventSource,e.prototype=n.prototype,e.CONNECTING=n.CONNECTING,e.OPEN=n.OPEN,e.CLOSED=n.CLOSED,window.EventSource=e)},publishSpeed:function(e){},publishNormalLog:function(e,t){var n,r,i,o,a,s,l,u;[It.API_RESPONSE,It.AJAX_ERROR,It.RET_ERROR,It.SLOW_NET_REQUEST].includes(e.level)&&(n=(n=null==(n=e.msg)?void 0:n.match(/(?:fetch req url|req url):\s*(.+?)(?:\n|$)/))?n[1].trim():"",s=(s=null==(s=e.msg)?void 0:s.match(/req method:\s*(.+?)(?:\n|$)/i))?s[1].trim().toUpperCase():"GET",a=(a=null==(a=e.msg)?void 0:a.match(/res status:\s*(\d+)/))?parseInt(a[1],10):0,r=(r=null==(r=e.msg)?void 0:r.match(/res duration:\s*([\d.]+)ms/))?parseFloat(r[1]):0,i=(i=null==(i=e.msg)?void 0:i.match(/=+\s*res data\s*=+\s*\n([\s\S]*?)(?:\n=+|$)/))?i[1].trim().slice(0,1e3):void 0,o={},e.trace&&(o.trace_id=e.trace),(u=(l={httpStatus:a,isTransportFailure:a<=0,isBusinessError:e.level===It.RET_ERROR||!!e.isErr,businessCode:e.code}).aborted?{report:!1,eventType:null}:(u=Number(l.httpStatus),l.isTransportFailure||!Number.isFinite(u)||u<=0?{report:!0,eventType:"api_error",outcome:"transport_error"}:400<=u?{report:!0,eventType:"api_error",outcome:"http_error"}:l.isBusinessError?{report:!0,eventType:"api_error",outcome:"business_error",businessCode:G(l.businessCode)||H}:{report:!0,eventType:"api_call",businessCode:G(l.businessCode)})).report)&&u.eventType&&(l={http_method:s,http_status:String(a)},u.outcome&&(l.outcome=u.outcome),u.businessCode&&(l.business_code=u.businessCode),"api_error"===u.eventType?(a={event_id:A(),event_type:M.API_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:e.from||(null==(s=t.getOriginFrom)?void 0:s.call(t))||window.location.href,data:{url:n,measurements:{duration:r},response_body:i,replay_id:at(t),tags:0<Object.keys(o).length?o:void 0,event_properties:l}},null!=(s=t.reportTDEMEvent)&&s.call(t,a)):(s={event_id:A(),event_type:M.API_CALL,event_category:I.NETWORK,timestamp:Date.now(),page_url:e.from||(null==(i=t.getOriginFrom)?void 0:i.call(t))||window.location.href,data:{url:n,measurements:{duration:r},replay_id:at(t),tags:0<Object.keys(o).length?o:void 0,event_properties:l}},null!=(a=t.reportTDEMEvent)&&a.call(t,s)))},destroy:function(){var t,n,e;this.option.publishSpeed=function(){},this.option.publishNormalLog=function(){},this.option.hackXHROptions&&(n=this.option.hackXHROptions,-1!==(e=gt.findIndex(function(e){return e.name===n.name})))&&gt.splice(e,1),this.option.hackFetchOptions&&(t=this.option.hackFetchOptions,-1!==(e=_t.findIndex(function(e){return e.name===t.name})))&&_t.splice(e,1),zt&&(window.EventSource=zt),jt=!1,Bt=zt=void 0,this.option.override=!1}}),Kt={},$t=new e({name:"bridge",override:!1,onNewTdem:function(e){this.override||(this.override=!0,this.overrideBridge(e))},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},publishSpeed:function(t,n){this.$walk(function(e){e===n&&e.speedLogPipeline(t)})},overrideBridge:function(u){var c=this,d=u.config,e="object"==typeof d.bridge?d.bridge:void 0,t=null==e?void 0:e.target,e=null==e?void 0:e.methods;t&&null!=e&&e.length&&e.forEach(function(e){var l=t[e];Kt[e]=l,t[e]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],i=e[1],n=e[2],o=e[3],a=Date.now(),s=c.getFromParam(u);l(r,i,n,function(e){var t=X(e,d.api),n=t.code,t=t.isErr,n={url:r+"-"+i,name:r+"-"+i,duration:Date.now()-a,type:"bridge",ret:n,isErr:+t,from:s};c.publishSpeed(n,u),o(e)})}})},unHackBridge:function(e){var e="object"==typeof e.config.bridge?e.config.bridge:void 0,t=null==e?void 0:e.target;Kt=(t&&Object.keys(Kt).forEach(function(e){Kt[e]&&(t[e]=Kt[e])}),{})},destroy:function(e){this.option.publishSpeed=function(){},this.option.unHackBridge(e),this.option.override=!1}}),t=((t=Vt=Vt||{})[t.unknown=100]="unknown",t[t.wifi=1]="wifi",t[t.net2g=2]="net2g",t[t.net3g=3]="net3g",t[t.net4g=4]="net4g",t[t.net5g=5]="net5g",t[t.net6g=6]="net6g",(t=Gt=Gt||{})[t.android=1]="android",t[t.ios=2]="ios",t[t.windows=3]="windows",t[t.macos=4]="macos",t[t.linux=5]="linux",t[t.other=100]="other",(t=Zt=Zt||{})[t.unknown=100]="unknown",t[t.normal=0]="normal",t[t.weak=1]="weak",t[t.disconnected=2]="disconnected",new e({name:"device",onNewTdem:function(e){e.extendBean("platform",this.getPlatform()),e.extendBean("netType",Vt.unknown),this.getDpi(e),this.refreshNetworkTypeToBean(e),this.refreshNetworkStatusToBean(e)},getDpi:function(e){e.extendBean("vp",Math.round(window.innerWidth)+" * "+Math.round(window.innerHeight)),window.screen&&e.extendBean("sr",Math.round(window.screen.width)+" * "+Math.round(window.screen.height))},getPlatform:function(){var t={android:/\bAndroid\s*([^;]+)/,ios:/\b(iPad|iPhone|iPod)\b.*? OS ([\d_]+)/,windows:/\b(Windows NT)/,macos:/\b(Mac OS)/,linux:/\b(Linux)/i},e=Object.keys(t).find(function(e){return t[e].test(navigator.userAgent)});return e?Gt[e]:Gt.other},refreshNetworkTypeToBean:function(t){var n=this,e=t.config;e&&("function"==typeof e.getNetworkType?e.getNetworkType:Xt)(function(e){Vt[e]||(e=Vt.unknown),t.extendBean("netType",e),n.NetworkRefreshTimer=setTimeout(function(){n.refreshNetworkTypeToBean(t),clearTimeout(n.NetworkRefreshTimer)},1e4)})},refreshNetworkStatusToBean:function(t){var e,n=this,r=t.config;r&&null!=(e="function"==typeof r.getNetworkStatus?r.getNetworkStatus:e)&&e(function(e){void 0===Zt[e]&&(e=Zt.unknown),t.extendBean("netStatus",e),n.NetworkStatusRefreshTimer=setTimeout(function(){n.refreshNetworkStatusToBean(t),clearTimeout(n.NetworkStatusRefreshTimer)},1e4)})}})),Xt=function(e){var t="",n=navigator.userAgent.match(/NetType\/(\w+)/);n?t=n[1]:navigator.connection&&(t=navigator.connection.effectiveType||navigator.connection.type),e((n=t=t||H,0<=(n=String(n).toLowerCase()).indexOf("4g")?Vt.net4g:0<=n.indexOf("wifi")?Vt.wifi:0<=n.indexOf("5g")?Vt.net5g:0<=n.indexOf("6g")?Vt.net6g:0<=n.indexOf("3g")?Vt.net3g:0<=n.indexOf("2g")?Vt.net2g:Vt.unknown))},Yt=window.WebSocket,Qt=[],en={construct:function(e,t){var r=new e(t[0],t[1]);return r.originSend=r.send,r.addEventListener("error",function(e){var e=(null==e?void 0:e.currentTarget)||{},t=e.url,n=e.readyState;null!=Qt&&Qt.forEach(function(e){e=e.onErr;null!=e&&e({msg:"无法获知具体错误信息,需在浏览器控制台查看!",readyState:n,connectUrl:t})})}),Object.defineProperty(r,"send",{get:function(){return function(e){null!=(t=r.originSend)&&t.call(r,e);var t=r.readyState;if(t!==WebSocket.OPEN){var n={readyState:t,connectUrl:r.url};switch(t){case WebSocket.CLOSED:Qt.forEach(function(e){e=e.sendErr;null!=e&&e(x({msg:"消息发送失败,连接已关闭!"},n))});break;case WebSocket.CONNECTING:Qt.forEach(function(e){(0,e.sendErr)(x({msg:"消息发送失败,正在连接中!"},n))});break;case WebSocket.CLOSING:Qt.forEach(function(e){(0,e.sendErr)(x({msg:"消息发送失败,连接正在关闭!"},n))})}}}}}),r}},tn=new e({name:"onError"}),nn=tn=new e({name:"onError",onNewTdem:function(e){this.startListen(e)},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},startListen:function(l){function e(e){var t,n=e&&te(e.reason);n&&(t=[{type:(null==(t=e.reason)?void 0:t.name)||"PromiseRejection",value:(null==(t=e.reason)?void 0:t.message)||String(n),mechanism_type:"unhandledrejection",mechanism_handled:0}],n=e.reason instanceof Error?ye(e.reason):[],e={event_id:A(),event_type:M.PROMISE_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{exception_stacks:t,exception_frames:n,replay_id:at(l),tags:{environment:l.config.env||"production"}}},null!=(t=l.reportTDEMEvent))&&t.call(l,e)}function t(e){if(e=(null==e?void 0:e.target)||(null==e?void 0:e.srcElement)){var t=e.src||e.href||"",n=e.tagName,n=(void 0===n?"script":n).toLowerCase(),r=["audio","video"].includes(n);if((!r||null!=e&&e.error)&&!(re(i=t,l.config.hostUrl)||-1<window.location.href.indexOf(i))){var i="other";if(/\.js$/.test(t)||"script"===n)i="script";else if(/\.css$/.test(t)||"link"===n)i="stylesheet";else if("img"===n)i="image";else{if(!r)return;i="media"}t={event_id:A(),event_type:M.RESOURCE_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{url:t,resource_type:i,replay_id:at(l),tags:x({environment:l.config.env||"production"},r&&null!=e&&e.error?{error_code:String(e.error.code),error_message:e.error.message||""}:{}),event_properties:{element_tag:n}}};null!=(i=l.reportTDEMEvent)&&i.call(l,t)}}}var n,r,i,u=this,c=window.onerror,o=(window.onerror=function(e,t,n,r,i){var o,a,s=te(e);"string"!=typeof(o=s)||!o||B.some(function(e){return-1<o.indexOf(e)})||z.some(function(e){return-1<o.indexOf(e)})||(s=[{type:(null==i?void 0:i.name)||"Error",value:String(e),mechanism_type:"onerror",mechanism_handled:0}],a=i?ye(i):[{abs_path:t||"",colno:r||0,filename:(null==t?void 0:t.split("/").pop())||"",function:"(anonymous)",lineno:n||0,in_app:1,stack_level:0}],s={event_id:A(),event_type:M.JS_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{exception_stacks:s,exception_frames:a,replay_id:at(l),tags:{environment:l.config.env||"production",version:String(l.config.version||"")}}},null!=(a=l.reportTDEMEvent)&&a.call(l,s)),null!=c&&c.call(window,e,t,n,r,i)},window.addEventListener("unhandledrejection",e),window.document.addEventListener("error",t,!0),l.lifeCycle.on("destroy",function(){0===tn.countInstance()&&(window.removeEventListener("unhandledrejection",e),window.document.removeEventListener("error",t,!0))}),l.config.websocket);(("object"==typeof o?!1!==o.enabled:o)||l.config.websocketHack)&&(o={key:l.config.id+"-"+this.name,onErr:function(e){var t;null!=(t=u.publishWsErrorLog)&&t.call(u,e,l)},sendErr:function(e){var t;null!=(t=u.publishWsErrorLog)&&t.call(u,e,l)}},this.hackWebsocketConfig=o,o=this.hackWebsocketConfig,window.Proxy)&&window.WebSocket&&(n=window.WebSocket,window&&!n.isHack&&(r=new Proxy(WebSocket,en),n.isHack=!0,window.WebSocket=r),i=o,Qt.find(function(e){return e.key===i.key})||i&&Qt.push(i))},publishWsErrorLog:function(e,n){var t=e.connectUrl,r=e.msg,e=e.readyState,i={event_id:A(),event_type:M.JS_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:this.getFromParam(n),data:{exception_stacks:[{type:"WebSocketError",value:"WEBSOCKET_ERROR: connect: "+t+" readyState: "+e+" msg: "+r,mechanism_type:"websocket",mechanism_handled:0}],exception_frames:[],replay_id:at(n),tags:{environment:n.config.env||"production",websocket_url:t||"",websocket_ready_state:String(null!=e?e:"")}}};this.$walk(function(e){var t;e===n&&null!=(t=e.reportTDEMEvent)&&t.call(e,i)})},destroy:function(){var t,e;this.option.hackWebsocketConfig&&(t=this.option.hackWebsocketConfig,window.WebSocket=Yt,-1!==(e=Qt.findIndex(function(e){return e.key===t.key})))&&Qt.splice(e,1)}}),rn=(new e({name:"click"}),function(e){if(""!==e.id&&e.id)return'id("'+e.id+'")';if(e===document.body)return e.tagName;if(e instanceof Document)return"document";var t=0;if(e.parentNode)for(var n=e.parentNode.childNodes,r=0;r<n.length;r+=1){var i=n[r];if(i===e)return rn(e.parentNode)+"/"+e.tagName+"["+(t+1)+"]";1===i.nodeType&&i.tagName===e.tagName&&(t+=1)}return 0}),on=function(e){return e instanceof Array?new Map(e.map(function(e){return[e,!0]})):new Map},an=function(e,t){return"string"==typeof e?e.split(t):[]},sn=function(e){if(3===e.nodeType||4===e.nodeType)return e.nodeValue||"";if(1!==e.nodeType)return"";if("string"==typeof e.textContent)return e.textContent;for(var t="",n=e.firstChild;n;n=n.nextSibling)t+=sn(n);return t},ln=new e({name:"click",listeners:[],onNewTdem:function(e){this.startListen(e)},startListen:function(a){for(var e=function(o){t.listeners.push(((e,t,n,r)=>{function i(e){var t=document.documentElement;t&&n.call(t,e,e.target)}return void 0===r&&(r=!0),e.addEventListener(t,i,r),{destroy:function(){e.removeEventListener(t,i,r)}}})(document,o,function(e,t){var n,r,i;t&&!((e,t)=>{e="object"==typeof e.click?e.click:void 0,n=on((null==e?void 0:e.ignoreClasses)||[])||new Map;for(var n,r=(e={ignoreIds:on((null==e?void 0:e.ignoreIds)||[])||new Map,ignoreClasses:n}).ignoreClasses,i=e.ignoreIds,o=!(0===i.size&&0===r.size),a=t,s=(an(t.getAttribute("id")||""," "),an(t.getAttribute("class")||"",""),0),l=!1;a&&o&&a.getAttribute;){if(l)return!0;if(10<=s)break;for(var u=an(a.getAttribute("id")||""," "),c=an(a.getAttribute("class")||"",""),d=0,f=u;d<f.length;d++){var h=f[d];if(i.has(h)){l=!0;break}}for(var p=0,m=c;p<m.length;p++){var v=m[p];if(r.has(v)){l=!0;break}}s+=1,a=a.parentNode||a.parentElement}return!1})(a.config,t)&&(i=rn(t),n=qt(t),r=t.getBoundingClientRect&&t.getBoundingClientRect(),i={event_id:A(),event_type:M.CLICK,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:window.location.href,data:{target_element:String(i),target_text:n.slice(0,127),click_position:r?{x:parseInt(String(r.left+window.scrollX),10)||0,y:parseInt(String(r.top+window.scrollY),10)||0}:void 0,replay_id:at(a),tags:{environment:a.config.env||"production",event_op:o,node_name:(null==t?void 0:t.nodeName)||""},event_properties:{target_id:t.id||"",target_class:"string"==typeof t.className?t.className.slice(0,128):""}}},null!=(n=a.reportTDEMEvent))&&n.call(a,i)},!0))},t=this,n=0,r=Object.entries({click:1,longpress:2});n<r.length;n++)e(r[n][0])},destroy:function(){this.listeners.forEach(function(e){return e.destroy()}),this.listeners=[]}}),un=(new e({name:"console"}),["log","error","warn","info","debug","trace"]),cn={log:console.log,error:console.error,warn:console.warn,info:console.info,debug:console.debug,trace:console.trace};var dn,fn,hn,pn,mn,vn,gn,yn,wn,bn,kn,_n=new e({name:"console",onNewTdem:function(e){this.startListen(e)},startListen:function(e){var f,h;h="object"==typeof(f=e).config.console?f.config.console:void 0,un.forEach(function(c){var d=cn[c];console[c]=function(){for(var e,t,n,r,i,o,a,s,l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];try{d.apply(console,l),o=c,a=f.isWhiteList,("all"===(s=(null==(s=h)?void 0:s.level)||"error")||a||("error"===s?"error"===o:"warn"===s?"error"===o||"warn"===o:"info"===s?["error","warn","info"].includes(o):"log"===s?["error","warn","info","log"].includes(o):"error"===o))&&(r=l.map(function(e){if("object"==typeof e&&null!==e)try{return JSON.stringify(e)}catch(e){}return String(e)}).join(" "),i={event_id:A(),event_type:M.LOG,event_category:I.LOG,timestamp:Date.now(),page_url:(null==(e=f.getOriginFrom)?void 0:e.call(f))||("undefined"!=typeof window?null==(t=window.location)?void 0:t.href:""),data:{log_level:"error"===c?"error":"warn"===c?"warn":"info",replay_id:at(f),tags:{console_method:c},event_properties:{message:("console."+c+": "+r).slice(0,2048)}}},null!=(n=f.reportTDEMEvent)&&n.call(f,i))}catch(e){cn.error("Console hook error:",e)}}})},destroy:function(){Object.keys(cn).forEach(function(e){console[e]=cn[e]})}});function Sn(){pn=[],fn=-1,dn=null,bn(addEventListener)}mn={passive:!0,capture:!0},vn=new Date,gn=function(e,t){dn||(dn=t,fn=e,hn=new Date,bn(removeEventListener),yn())},yn=function(){var t;0<=fn&&fn<hn-vn&&(t={entryType:"first-input",name:dn.type,target:dn.target,cancelable:dn.cancelable,startTime:dn.timeStamp,processingStart:dn.timeStamp+fn},pn.forEach(function(e){e(t)}),pn=[])},wn=function(e){var t,n,r,i,o,a;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(n=t,r=e,i=function(){gn(n,r),a()},o=function(){a()},a=function(){removeEventListener("pointerup",i,mn),removeEventListener("pointercancel",o,mn)},addEventListener("pointerup",i,mn),addEventListener("pointercancel",o,mn)):gn(t,e))},bn=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,wn,mn)})},kn="hidden"===document.visibilityState?0:1/0,addEventListener("visibilitychange",function e(t){"hidden"===document.visibilityState&&(kn=t.timeStamp,removeEventListener("visibilitychange",e,!0))},!0),Sn(),self.webVitals={firstInputPolyfill:function(e){pn.push(e),yn()},resetFirstInputPolyfill:Sn,get firstHiddenTime(){return kn}};function En(e,t){var n=Vn(),r="navigate";return 0<=Hn?r="back-forward-cache":n&&(document.prerendering||0<Gn()?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}}function Cn(e,t,n){try{var r;if(PerformanceObserver.supportedEntryTypes.includes(e))return(r=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})})).observe(Object.assign({type:e,buffered:!0},n||{})),r}catch(e){}}function Rn(t,n,r,i){var o,a;return function(e){0<=n.value&&(e||i)&&((a=n.value-(o||0))||void 0===o)&&(o=n.value,n.delta=a,n.rating=(e=n.value)>r[1]?"poor":e>r[0]?"needs-improvement":"good",t(n))}}function Tn(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})}function On(t){function e(e){"pagehide"!==e.type&&"hidden"!==document.visibilityState||t(e)}addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0)}function xn(t){var n=!1;return function(e){n||(t(e),n=!0)}}function Mn(){return Zn<0&&(Zn=Jn(),$n(),qn(function(){setTimeout(function(){Zn=Jn(),$n()},0)})),{get firstHiddenTime(){return Zn}}}function In(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()}function An(o,a){a=a||{},In(function(){var t,n=Mn(),r=En("FCP"),i=Cn("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<n.firstHiddenTime)&&(r.value=Math.max(e.startTime-Gn(),0),r.entries.push(e),t(!0))})});i&&(t=Rn(o,r,Yn,a.reportAllChanges),qn(function(e){r=En("FCP"),t=Rn(o,r,Yn,a.reportAllChanges),Tn(function(){r.value=performance.now()-e.timeStamp,t(!0)})}))})}function Pn(e){var t,n,r,i,o,a;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(n=t,r=e,i=function(){nr(n,r),a()},o=function(){a()},a=function(){removeEventListener("pointerup",i,er),removeEventListener("pointercancel",o,er)},addEventListener("pointerup",i,er),addEventListener("pointercancel",o,er)):nr(t,e))}function Dn(e){e.forEach(function(e){e.interactionId&&(sr=Math.min(sr,e.interactionId),lr=Math.max(lr,e.interactionId),ar=lr?(lr-sr)/7+1:0)})}function Ln(){return ur()-dr}function Nn(e){var t=fr[fr.length-1],n=hr[e.interactionId];(n||fr.length<10||e.duration>t.latency)&&(n?(n.entries.push(e),n.latency=Math.max(n.latency,e.duration)):(t={id:e.interactionId,latency:e.duration,entries:[e]},hr[t.id]=t,fr.push(t)),fr.sort(function(e,t){return t.latency-e.latency}),fr.splice(10).forEach(function(e){delete hr[e.id]}))}function Fn(e,t){function n(t,n,r,i){function o(e){"visibilitychange"===t&&"hidden"!==document.visibilityState||(i?setTimeout(function(){return n(e)},i):n(e),r&&removeEventListener(t,o,!0))}addEventListener(t,o,!0)}var r;n("visibilitychange",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.visibilitychange),n("pagehide",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.pagehide),n("beforeunload",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.beforeunload)}var Un,zn,Bn,jn,Wn,Hn=-1,qn=function(t){addEventListener("pageshow",function(e){e.persisted&&(Hn=e.timeStamp,t(e))},!0)},Vn=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Gn=function(){var e=Vn();return e&&e.activationStart||0},Zn=-1,Jn=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Kn=function(e){"hidden"===document.visibilityState&&-1<Zn&&(Zn="visibilitychange"===e.type?e.timeStamp:0,Xn())},$n=function(){addEventListener("visibilitychange",Kn,!0),addEventListener("prerenderingchange",Kn,!0)},Xn=function(){removeEventListener("visibilitychange",Kn,!0),removeEventListener("prerenderingchange",Kn,!0)},Yn=[1800,3e3],Qn=[.1,.25],er={passive:!0,capture:!0},tr=new Date,nr=function(e,t){Un||(Un=t,zn=e,Bn=new Date,ir(removeEventListener),rr())},rr=function(){var t;0<=zn&&zn<Bn-tr&&(t={entryType:"first-input",name:Un.type,target:Un.target,cancelable:Un.cancelable,startTime:Un.timeStamp,processingStart:Un.timeStamp+zn},jn.forEach(function(e){e(t)}),jn=[])},ir=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,Pn,er)})},or=[100,300],ar=0,sr=1/0,lr=0,ur=function(){return Wn?ar:performance.interactionCount||0},cr=[200,500],dr=0,fr=[],hr={},pr=[2500,4e3],mr={},vr=(gr.prototype.start=function(){var t=this,n=new PerformanceObserver(function(e){e=e.getEntriesByName("first-contentful-paint");0<e.length&&(t.fcp=e[0].startTime,t.slientWindowStartTime=t.fcp,n.disconnect(),setTimeout(function(){t.checkTTI()},Math.max(t.slienceTimeInterval-(performance.now()-t.fcp)+20,1)))});n.observe({entryTypes:["paint"]}),this.longtaskObserver=new PerformanceObserver(function(e){e=e.getEntries();t.longTaskEntries=t.longTaskEntries.concat(e)}),this.longtaskObserver.observe({entryTypes:["longtask"]}),this.resourceObserver=new PerformanceObserver(function(e){e=e.getEntries();t.resourceEntries=t.resourceEntries.concat(e)}),this.resourceObserver.observe({entryTypes:["resource"]})},gr.prototype.checkTTI=function(){var e=this;this.hasSlientWindow()?(this.calculateTTI(),this.longtaskObserver.disconnect(),this.resourceObserver.disconnect()):setTimeout(function(){e.checkTTI()},this.checkInterval)},gr.prototype.hasSlientWindow=function(){var e,t=performance.now();return!(t-this.slientWindowStartTime<5e3||((e=this.getLastLongTaskEndTime())>this.slientWindowStartTime?(this.slientWindowStartTime=e,this.resourceEntries=[]):this.getRequestCount(this.slientWindowStartTime,t)<=2?(this.lastLongtaskEndTime=e,0):(t=this.resourceEntries.sort(function(e,t){return e.startTime-t.startTime}),this.slientWindowStartTime=t[this.resourceEntries.length-2].startTime,1)))},gr.prototype.getLastLongTaskEndTime=function(){var t;return 0===this.longTaskEntries.length?-1:(t=0,this.longTaskEntries.forEach(function(e){e.startTime+e.duration>t&&(t=e.startTime+e.duration)}),t)},gr.prototype.getRequestCount=function(t,n){var r=0;return this.resourceEntries.forEach(function(e){e.startTime>=t&&e.startTime+e.duration<=n&&(r+=1)}),r},gr.prototype.calculateTTI=function(){var e=-1===this.lastLongtaskEndTime?this.slientWindowStartTime:this.lastLongtaskEndTime,t=performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,e=Math.max(t,e);this.onTTICallback(e)},gr);function gr(e){this.slienceTimeInterval=5e3,this.checkInterval=100,this.fcp=0,this.longTaskEntries=[],this.resourceEntries=[],this.slientWindowStartTime=performance.now(),this.onTTICallback=e}new e({name:"webVitals"});function yr(e){var t=e.name;0<(e=e.value)&&(kr[t]=e)}function wr(e,t,n,r){return void 0===n&&(n=15e3),void 0===r&&(r=0),(t=void 0===t?0:t)<=e&&e<=n?e:r}var br,kr={FCP:-1,LCP:-1,FID:-1,CLS:-1,INP:-1,TTI:-1,from:void 0},_r=new Map,Sr=new e({name:"webVitals",onNewTdem:function(e){var t,n,r,o,a,s,l,u,c,d,f,i,h,p,m=this;if($e()&&"function"==typeof window.PerformanceObserver&&"function"==typeof performance.getEntriesByName)try{"function"!=typeof(p=(i=void 0===i?"undefined"==typeof window?{}:window:i).PerformanceObserver)||p.__tdemStartTimeGuard||(h=p,Object.setPrototypeOf(v,h),v.prototype=h.prototype,v.__tdemStartTimeGuard=!0,i.PerformanceObserver=v),_r.set(e,{isWebVitalsReported:!1,hasFirstEntry:!1,custom:null}),An(yr),d=yr,f={},In(function(){function e(e){(e=e[e.length-1])&&e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Gn(),0),i.entries=[e],t())}var t,n,r=Mn(),i=En("LCP"),o=Cn("largest-contentful-paint",e);o&&(t=Rn(d,i,pr,f.reportAllChanges),n=xn(function(){mr[i.id]||(e(o.takeRecords()),o.disconnect(),mr[i.id]=!0,t(!0))}),["keydown","click"].forEach(function(e){addEventListener(e,function(){return setTimeout(n,0)},!0)}),On(n),qn(function(e){i=En("LCP"),t=Rn(d,i,pr,f.reportAllChanges),Tn(function(){i.value=performance.now()-e.timeStamp,mr[i.id]=!0,t(!0)})}))}),u=yr,c={},In(function(){function t(e){e.startTime<n.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),o(!0))}function e(e){e.forEach(t)}var n=Mn(),r=En("FID"),i=Cn("first-input",e),o=Rn(u,r,or,c.reportAllChanges);i&&On(xn(function(){e(i.takeRecords()),i.disconnect()})),i&&qn(function(){r=En("FID"),o=Rn(u,r,or,c.reportAllChanges),jn=[],zn=-1,Un=null,ir(addEventListener),jn.push(t),rr()})}),s=yr,l={},An(xn(function(){function e(e){e.forEach(function(e){var t,n;e.hadRecentInput||(t=i[0],n=i[i.length-1],r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,i.push(e)):(r=e.value,i=[e]))}),r>n.value&&(n.value=r,n.entries=i,t())}var t,n=En("CLS",0),r=0,i=[],o=Cn("layout-shift",e);o&&(t=Rn(s,n,Qn,l.reportAllChanges),On(function(){e(o.takeRecords()),t(!0)}),qn(function(){n=En("CLS",r=0),t=Rn(s,n,Qn,l.reportAllChanges),Tn(function(){return t()})}),setTimeout(t,0))})),o=yr,a={},In(function(){var e;"interactionCount"in performance||(Wn=Wn||Cn("event",Dn,{type:"event",buffered:!0,durationThreshold:0}));function t(e){e.forEach(function(t){t.interactionId&&Nn(t),"first-input"!==t.entryType||fr.some(function(e){return e.entries.some(function(e){return t.duration===e.duration&&t.startTime===e.startTime})})||Nn(t)}),e=Math.min(fr.length-1,Math.floor(Ln()/50)),(e=fr[e])&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,i())}var n=En("INP"),r=Cn("event",t,{durationThreshold:null!=(e=a.durationThreshold)?e:40}),i=Rn(o,n,cr,a.reportAllChanges);r&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&r.observe({type:"first-input",buffered:!0}),On(function(){t(r.takeRecords()),n.value<0&&0<Ln()&&(n.value=0,n.entries=[]),i(!0)}),qn(function(){fr=[],dr=ur(),n=En("INP"),i=Rn(o,n,cr,a.reportAllChanges)}))}),r=function(e){yr({name:"TTI",value:e})},$e()&&new vr(r).start(),Fn(function(){m.tryReport(e,null,"onHidden")},{once:!0,delay:{visibilitychange:10}}),kr.from=(null==(n=null==(t=e)?void 0:t.getOriginFrom)?void 0:n.call(t))||window.location.href}catch(e){}function v(n){return new h(function(e,t){try{n(e,t)}catch(e){if(!(0<=(e instanceof Error?e.message:String(e||"")).indexOf("startTime")))throw e}})}},tryReport:function(t,n,r){var i=this;void 0===r&&(r="manual"),this.$walk(function(e){e===t&&("object"==typeof(e=i.$getConfig(t))&&!0===e.manualReport||"onHidden"!==r?(e=_r.get(t))&&!e.hasFirstEntry?(e.hasFirstEntry=!0,"manual"===r&&n&&(e.custom=n)):i.doReport(t,(null==e?void 0:e.custom)||n):i.doReport(t,null))})},doReport:function(o,a){var e=_r.get(o);if(e){if(null!=e&&e.isWebVitalsReported)return;e.isWebVitalsReported=!0}this.$walk(function(e){var t,n,r,i;e===o&&(t=x({},kr),a&&Object.keys(a).forEach(function(e){null!=a[e]&&(t[e]=a[e])}),n={environment:e.config.env||"production",version:String(e.config.version||"")},r={},0<t.LCP&&(r.lcp=t.LCP),0<t.FCP&&(r.fcp=t.FCP),0<t.FID&&(r.fid=t.FID),0<=t.CLS&&(r.cls=t.CLS),0<t.TTFB&&(r.ttfb=t.TTFB),0<t.TTI&&(r.tti=t.TTI),0<t.INP&&(r.inp=t.INP),i={event_id:A(),event_type:M.true,event_category:I.PERFORMANCE,timestamp:Date.now(),page_url:t.from||(null==(i=e.getOriginFrom)?void 0:i.call(e))||window.location.href,data:{measurements:r,replay_id:at(e),tags:n}},null!=(r=e.reportTDEMEvent))&&r.call(e,i)})},publish:function(e,t){this.tryReport(e,t,"manual")},destroy:function(){this.option.publish=function(){}}}),Er=(new e({name:"pagePerformance"}),3),Cr=new Map,Rr=new e({name:"pagePerformance",performanceMap:{},onNewTdem:function(t){var e;$e()&&(Cr.set(t,{isPagePerformanceReported:!1}),br?this.publish(br,t):this.startCalcPerformance(t),e=this.publishWhenObHidden.bind(this,t),Fn(e,{once:!0}),t.lifeCycle.on("destroy",function(){var e=Cr.get(t);e&&(e.isPagePerformanceReported=!1)}))},publishWhenObHidden:function(e){var t,n=Cr.get(e);if(null==n||!n.isPagePerformanceReported){n=0;if(null!=(t=e.firstScreenInfo)&&t.timing)n=e.firstScreenInfo.timing;else if(Xe("paint"))try{var r,i=performance.getEntriesByName("first-contentful-paint");i&&0<i.length&&(r=i[0])&&0<r.startTime&&(n=r.startTime)}catch(e){}(br=this.buildPerformanceLog(e,n,this.getPageUrl(e),window.location.href))&&this.publish(br,e,!0)}},buildPerformanceLog:function(e,t,n,r){var i=performance.timing;if(i)return n={from:n,originFrom:r,dnsLookup:wr(i.domainLookupEnd-i.domainLookupStart),tcp:wr(i.connectEnd-i.connectStart),ssl:wr(0===i.secureConnectionStart?0:i.requestStart-i.secureConnectionStart),ttfb:wr(i.responseStart-i.requestStart),contentDownload:wr(i.responseEnd-i.responseStart),domParse:wr(i.domInteractive-i.domLoading,0,15e3,1070),resourceDownload:wr(i.loadEventStart-i.domInteractive,0,15e3,1070),firstScreenTiming:wr(Math.floor(t),0,15e3,15e3)},(r=e.config).extraPerformanceData&&"{}"!==JSON.stringify(r.extraPerformanceData)&&(t=(i=r.extraPerformanceData).engineInit,e=i.bundleLoad,n=x(x({},n),{engineInit:wr(t,0,1e4),bundleLoad:wr(e,0,1e4)})),n},publish:function(r,i){this.$walk(function(e){var t,n;e===i&&(n=(t=performance.timing).navigationStart,t={event_id:A(),event_type:M.PAGE_LOAD,event_category:I.PERFORMANCE,timestamp:Date.now(),page_url:r.originFrom||window.location.href,data:{measurements:{lcp:kr.lcp,fcp:kr.fcp,fid:kr.fid,cls:kr.cls,ttfb:kr.ttfb||r.ttfb,dns_time:r.dnsLookup,tcp_time:r.tcp,ssl_time:r.ssl,request_time:r.ttfb,response_time:r.contentDownload,dom_parse_time:r.domParse,dom_ready:t.domContentLoadedEventEnd-n,load_complete:t.loadEventEnd-n,first_screen_time:r.firstScreenTiming},replay_id:at(e),tags:{environment:e.config.env||"production",version:String(e.config.version||"")}}},null!=(n=e.reportTDEMEvent)&&n.call(e,t),n=Cr.get(e))&&(n.isPagePerformanceReported=!0)})},getPageUrl:function(e){var t=this.$getConfig(e);if(null!=t&&t.urlHandler&&"function"==typeof(null==t?void 0:t.urlHandler)){t=null==t?void 0:t.urlHandler();if(t)return encodeURIComponent(t)}return e.getCurrentPageUrl()},startCalcPerformance:function(t){var n=this;try{var r=this.getPageUrl(t),i=t.getOriginFrom();this.getFirstScreenTiming(t,function(e){br=n.buildPerformanceLog(t,e,r,i);e=Cr.get(t);!br||null!=e&&e.isPagePerformanceReported||n.publish(br,t)})}catch(t){}},getFirstScreenTiming:function(s,l){var u=this;s.lifeCycle.on("destroy",function(){v&&clearTimeout(v)});var c,d=this,n=["script","style","link","br"],f=[],h={},p=(Xe("paint")&&(c=new PerformanceObserver(function(e){e.getEntries().forEach(function(e){var t;"paint"===e.entryType&&"first-contentful-paint"===e.name&&0<(t=document.querySelectorAll("[TDEM-FIRST-SCREEN-TIMING],[AEGIS-FIRST-SCREEN-TIMING]")).length&&s.config.id&&!u.performanceMap[s.config.id]&&(u.setFirstScreenInfo(s,e.startTime,t[0],t),null!=l&&l(e.startTime),p.disconnect(),c.disconnect(),v)&&clearTimeout(v)})})).observe({entryTypes:["paint"]}),new MutationObserver(function(e){var t={roots:[],ignores:[],rootsDomNum:[],time:performance.now()};e.forEach(function(e){e&&e.addedNodes&&Array.prototype.slice.call(e.addedNodes).forEach(function(e){d.isEleInArray(e,t.ignores)?t.ignores.push(e):1===e.nodeType&&(e.hasAttribute("TDEM-FIRST-SCREEN-TIMING")||e.hasAttribute("AEGIS-FIRST-SCREEN-TIMING"))?(Object.prototype.hasOwnProperty.apply(h,[t.time])||(h[t.time]=[]),h[t.time].push(e)):1===e.nodeType&&(d.hasAncestorOrSelfWithAttribute(e,"TDEM-IGNORE-FIRST-SCREEN-TIMING")?t.ignores.push(e):-1!==n.indexOf(e.nodeName.toLocaleLowerCase())||d.isEleInArray(e,t.roots)||(t.roots.push(e),t.rootsDomNum.push(d.walkAndCount(e)||0)))})}),t.roots.length&&f.push(t)})),m=(p.observe(document,{childList:!0,subtree:!0}),function(n){(n=void 0===n?0:n)||(r=0,(e=Object.keys(h)).length?(n=Math.max.apply(null,e),u.setFirstScreenInfo(s,n,null==(e=h[n])?void 0:e[0],h)):f.forEach(function(e){for(var t=0;t<e.roots.length;t++)e.rootsDomNum[t]>r&&d.isInFirstScreen(e.roots[t])&&(r=e.rootsDomNum[t],n=e.time,u.setFirstScreenInfo(s,n,e.roots[t]))}),f.length=0,Object.keys(h).forEach(function(e){h[e]=h[e].map(function(e){var t={tagName:e.tagName},n=e.attributes;if(!n)return e;for(var r=0;r<n.length;r++){var i=n[r];i.name&&(t[i.name]=e.getAttribute(i.name))}return t})}));var r,e=performance.timing,t=e.domInteractive-e.domLoading,i=n;v=null;for(var o=0,a=[t,e.loadEventStart-e.domInteractive,i];o<a.length;o++)if(a[o]<=0&&0<Er){v=setTimeout(function(){return m(i)},3e3);break}v?--Er:(p.disconnect(),null!=c&&c.disconnect(),null!=l&&l(n))}),v=setTimeout(function(){return m()},3e3)},setFirstScreenInfo:function(e,t,n,r){var i;e.config.id&&this.performanceMap[e.config.id]||(e.config.id&&(this.performanceMap[e.config.id]=!0),("object"!=typeof(null==(i=e.config)?void 0:i.pagePerformance)||null!=(i=e.config.pagePerformance)&&i.firstScreenInfo)&&(e.firstScreenInfo={element:n,timing:t,markDoms:r}))},isEleInArray:function(e,t){return!(!e||e===document.documentElement)&&(-1!==t.indexOf(e)||this.isEleInArray(e.parentElement,t))},isInFirstScreen:function(e){var t;return!(!e||"function"!=typeof e.getBoundingClientRect)&&(e=e.getBoundingClientRect(),t=window.innerHeight,0<=e.left)&&e.left<window.innerWidth&&0<=e.top&&e.top<t&&0<e.width&&0<e.height},walkAndCount:function(e){var t=0;if(e&&1===e.nodeType){t+=1;var n=e.children;if(null!=n&&n.length)for(var r=0;r<n.length;r++)1===n[r].nodeType&&(n[r].hasAttribute("TDEM-IGNORE-FIRST-SCREEN-TIMING")||n[r].hasAttribute("AEGIS-IGNORE-FIRST-SCREEN-TIMING"))||(t+=this.walkAndCount(n[r]))}return t},hasAncestorOrSelfWithAttribute:function(e,t){for(var n=t.replace(/^TDEM-/,"AEGIS-"),r=e;r&&r!==document.body;){if(r.hasAttribute(t)||n!==t&&r.hasAttribute(n))return!0;r=r.parentElement}return!1}}),Tr=(new e({name:"spa"}),["replaceState","pushState","popstate","hashchange"]),Or=new e({name:"spa",originFireUrl:"",lastPageUrl:"",navigationStack:[],navigationIndex:-1,onNewTdem:function(n){var r=this,e=(history.pushState=this.wr("pushState")||history.pushState,history.replaceState=this.wr("replaceState")||history.replaceState,this.sendPv=this.sendPv.bind(this),location.href);this.navigationStack.length||(this.navigationStack=[e],this.navigationIndex=0),n.config.spa&&this.sendPv(n,"reload"),Tr.forEach(function(e){var t=e;window.addEventListener(e,function(){return r.sendPv.call(r,n,t)})})},wr:function(n){var r=history[n],e="__"+n+"__hasWrittenByTamSpa";return"function"==typeof r&&!history[e]&&(Object.defineProperty(history,e,{value:!0,enumerable:!1}),function(){var e=r.apply(this,arguments),t=null;return"function"==typeof Event?t=new Event(n):(t=document.createEvent("HTMLEvents")).initEvent(n,!1,!0),window.dispatchEvent(t),e})},resolveNavigationType:function(e,t){var n;return"pushState"===e?(this.navigationIndex<this.navigationStack.length-1&&(this.navigationStack=this.navigationStack.slice(0,this.navigationIndex+1)),this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"push"):"replaceState"===e?(this.navigationIndex<0?(this.navigationStack=[t],this.navigationIndex=0):this.navigationStack[this.navigationIndex]=t,"replace"):"hashchange"===e?"hashchange":"popstate"===e?0<=(e=this.navigationStack.lastIndexOf(t))?(n=e<this.navigationIndex?"back":"forward",this.navigationIndex=e,n):(this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"forward"):"reload"},sendPv:function(s,e){var l=this;void 0===e&&(e="reload"),setTimeout(function(){s._customPageUrl=null;var r=location.pathname+location.hash+s.config.id,i=s.getOriginFrom(),o=l.lastPageUrl||void 0,a=l.resolveNavigationType(e,location.href);l.$walk(function(e){var t,n;e===s&&r&&r!==l.originFireUrl&&(n={event_id:A(),event_type:M.PAGE_VIEW,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:i,data:{page_title:document.title||"",referrer:document.referrer||void 0,is_effective_action:!0,replay_id:at(e),tags:{environment:e.config.env||"production",version:String(e.config.version||""),is_spa:"true"},event_properties:{navigation_type:a,from_page:(o||"").slice(0,512),to_page:(i||"").slice(0,512)}}},null!=(t=e.reportTDEMEvent)&&t.call(e,n),l.originFireUrl=r,l.lastPageUrl=i)})},0)},destroy:function(){this.option.sendPv=function(){}}}),xr="__MONITOR_SESSION_V1__";function Mr(e,t){"undefined"!=typeof document&&(e=[e+"="+encodeURIComponent(t),"path=/","SameSite=Lax"],"undefined"!=typeof location&&"https:"===location.protocol&&e.push("Secure"),document.cookie=e.join("; "))}function Ir(e,t,n){void 0===n&&(n=1);var r=Date.now();return{sessionId:e,createdAt:r,lastActivity:r,source:t,version:n}}function Ar(e,t){var n,r,i;return"undefined"==typeof window?Ir(t(),e):(r="undefined"!=typeof document&&(r="_tdem_s".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=document.cookie.match(new RegExp("(?:^|; )"+r+"=([^;]*)")))?decodeURIComponent(r[1]):null,n=window[xr],r?(null==n?void 0:n.sessionId)===r?(n.lastActivity=Date.now(),n):(i=Ir(r,(null==n?void 0:n.source)||e,(null==n?void 0:n.version)||1),window[xr]=i):null!=n&&n.sessionId?(n.lastActivity=Date.now(),Mr("_tdem_s",n.sessionId),n):(i=Ir(t(),e),Mr("_tdem_s",(window[xr]=i).sessionId),i))}Ur.prototype.request=function(o,a){var s=this;return void 0===a&&(a={}),o.sendBeacon||o.handoff?this.handoff(o,a):new Promise(function(n){var e,r,t,i=new XMLHttpRequest;i.sendByTdem=!0,i.addEventListener("readystatechange",function(){var e,t;4===i.readyState&&((e={ok:0<i.status&&i.status<400,status:i.status,statusText:i.statusText,body:i.response,request:o}).ok?(null!=(t=a.success)&&t.call(a,i.response),null!=(t=a.final)&&t.call(a,e),n(e)):(t=x(x({},e),{error:i.response}),null!=(e=a.fail)&&e.call(a,i.response),null!=(e=a.final)&&e.call(a,t),n(t)))}),"get"===(o.method||"GET").toLowerCase()?(i.open("get",(e=o.url,r=o.data,"string"!=typeof e?"":"object"==typeof r&&r?(t=Object.getOwnPropertyNames(r).map(function(e){var t=r[e];return e+"="+("string"==typeof t?encodeURIComponent(t):encodeURIComponent(JSON.stringify(t)))}).join("&").replace(/eval/gi,"evaI"),e+(-1===e.indexOf("?")?"?":"&")+t):e)),s.applyHeaders(i,o.headers),i.send()):(i.open("post",o.url),s.applyHeaders(i,o.headers),o.contentType&&i.setRequestHeader("Content-Type",o.contentType),t=void 0!==o.body?o.body:o.data,s.shouldSanitizeEvalKeyword(o,t)&&(t=t.replace(/eval/gi,"evaI")),i.send(t))})},Ur.prototype.shouldSanitizeEvalKeyword=function(e,t){return"string"==typeof t&&!("replay"===e.kind||(e=null!=(t=null==(t=e.headers)?void 0:t["Content-Encoding"])?t:null==(t=e.headers)?void 0:t["content-encoding"])&&/gzip/i.test(e))},Ur.prototype.handoff=function(e,t){void 0===t&&(t={});var n,r="undefined"!=typeof navigator?navigator:void 0;return r&&"function"==typeof r.sendBeacon?(n=void 0!==e.body?e.body:e.data,n={ok:r=r.sendBeacon(e.url,n),request:e,handoffAccepted:r,error:r?void 0:new Error("navigator.sendBeacon rejected the payload")},r?null!=(r=t.success)&&r.call(t,{accepted:!0}):null!=(r=t.fail)&&r.call(t,n.error),null!=(r=t.final)&&r.call(t,n),Promise.resolve(n)):(r={ok:!1,request:e,error:new Error("navigator.sendBeacon is unavailable")},null!=(n=t.fail)&&n.call(t,r.error),null!=(e=t.final)&&e.call(t,r),Promise.resolve(r))},Ur.prototype.applyHeaders=function(t,n){n&&Object.keys(n).forEach(function(e){t.setRequestHeader(e,n[e])})};var Pr,Dr,Lr=Ur,Nr=new Map,n=(C(Dr=r,n=Pr=rt),Dr.prototype=null===n?Object.create(n):(Fr.prototype=n.prototype,new Fr),r.prototype._bootstrapInit=function(e){this.setConfig(e),this.config=R(this.config,e.hostUrl),this._prefetchConfigAndInit(e)},r.prototype._initImmediately=function(e){this.init(e),this._afterInit(e)},r.prototype._prefetchConfigAndInit=function(a){return P(this,void 0,void 0,function(){var t,n,r,i,o;return D(this,function(e){switch(e.label){case 0:if(t=this.config.id,n=this._buildPrefetchConfigUrl(),r=!1,i=null,!t||!n)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transportRequest({kind:"config",url:n,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_key:t})})];case 2:return(o=e.sent()).ok&&0===(o="string"==typeof o.body?JSON.parse(o.body):o.body).code&&o.data&&(r=!!o.data.enabled,i=o.data),[3,4];case 3:return e.sent(),(o=this._loadPrefetchDataFromCache(t))&&(r=!!o.enabled,i=o),[3,4];case 4:if(r){i&&(this._prefetchedConfigData=i);try{this._initAfterPreparedConfig(a)}catch(e){console.warn(e),console.log("%cThe above error occurred in the process of initializing TDEM, which will affect your normal use of TDEM.\nIt is recommended that you contact us for feedback and thank you for your support.","color: red"),this.sendSDKError(e)}}else console.info("[TDEM] SDK disabled by remote config, skip initialization");return[2]}})})},r.prototype._buildPrefetchConfigUrl=function(){var e=(this.config.url||"").replace(/\/+$/,"");return e?e+"/api/v1/config":""},r.prototype._loadPrefetchDataFromCache=function(e){try{var t,n,r=localStorage.getItem("TDEM_SAMPLE_CONFIG");return r?!((t=JSON.parse(r)).projectKey!==e||6048e5<=Date.now()-t.timestamp)&&0<t.sampleRate?(n={enabled:void 0!==t.remoteEnabled?!!t.remoteEnabled:0<t.sampleRate,tdem_sample_rate:t.sampleRate},void 0!==t.replaySampleRate&&(n.replay_sample_rate=t.replaySampleRate),void 0!==t.errorTraceback&&(n.error_traceback=t.errorTraceback),void 0!==t.errorSampleRate&&(n.error_sample_rate=t.errorSampleRate),n):null:null}catch(e){return null}},r.prototype._initAfterPreparedConfig=function(e){for(var t=0;t<rt.installedPlugins.length;t++)try{rt.installedPlugins[t].patch(this)}catch(e){this.sendSDKError(e)}this.lifeCycle.emit("onInited"),this._afterInit(e)},r.prototype._afterInit=function(e){var t,o,n=this;this._sdkInitialized=!0,this.extendBean("sessionId",r.sessionID),this.extendBean("from",this.getCurrentPageUrl()),"undefined"!=typeof document&&this.extendBean("referer",encodeURIComponent(document.referrer||"")),t=L(T("tdem-web-retry-report-requests"),[]),(o=function(){var i;t.length&&(i=t.splice(0,1)[0],O("tdem-web-retry-report-requests",JSON.stringify(t)),n.$request(i,function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return null==(t=Nr.get(null==(e=i.extraRetryOptions)?void 0:e.success))?void 0:t.apply(i,n)}finally{o()}},function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return null==(t=Nr.get(null==(e=i.extraRetryOptions)?void 0:e.fail))?void 0:t.apply(i,n)}finally{o()}}))})()},r.prototype.getBean=function(t){var n=this;return void 0===t&&(t=[]),""+Object.getOwnPropertyNames(this.bean).filter(function(e){return-1===t.indexOf(e)}).map(function(e){return"from"===e?"from="+n.getCurrentPageUrl():e+"="+n.bean[e]}).join("&")},r.prototype.getCurrentPageUrl=function(){var e;return this._customPageUrl?encodeURIComponent(this._customPageUrl.slice(0,2048)):(e=this.config.pageUrl||location.href,e=(e="function"==typeof this.config.urlHandler?this.config.urlHandler()||location.href:e).slice(0,2048),encodeURIComponent(e))},r.prototype.getOriginFrom=function(){if(this._customPageUrl)return this._customPageUrl.slice(0,2048);try{return("undefined"!=typeof window&&window.location?window.location.href:"").slice(0,2048)}catch(e){return""}},r.prototype.ready=function(){function o(){var e,n,r,i;t.reportRequestQueue.length&&(e=t.reportRequestQueue.splice(0,1)[0],n=e.options,r=e.success,i=e.fail,t.$request(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==r?void 0:r.apply(n,e)}finally{o()}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==i?void 0:i.apply(n,e)}finally{o()}}))}var t=this;o(),this.isReportReady=!0},r.prototype.request=function(l,n,u){var c,d,f=this;this.config.reportImmediately||this.isReportReady?this.$request(l,c=function(e){var t=L(T("tdem-web-retry-report-requests"),[]);null!=t&&t.length&&l.extraRetryOptions&&(t.splice(t.findIndex(function(e){return e.extraRetryOptions.requestId===l.extraRetryOptions.requestId}),1),O("tdem-web-retry-report-requests",JSON.stringify(t)),Nr.delete(l.extraRetryOptions.success),Nr.delete(l.extraRetryOptions.fail)),null!=n&&n(e)},d=function(e){if(!f.config.reportRetry)return null==u?void 0:u(e);var t,n="boolean"==typeof f.config.reportRetry?Mt:x(x({},Mt),f.config.reportRetry),r=n.maxRetryCount,i=void 0===r?Mt.maxRetryCount:r,r=n.retryInterval,r=void 0===r?Mt.retryInterval:r,n=n.whenRetryEndStillFail,o=void 0===n?Mt.whenRetryEndStillFail:n,a=(l.extraRetryOptions||(l.extraRetryOptions={requestId:"",retriedCount:0,success:"",fail:""}),l.extraRetryOptions),s=(a.requestId=a.requestId||l.url+"-"+Date.now()+"-"+Math.random(),a.requestId),n=(a.retriedCount=a.retriedCount||0,a.success=a.success||s+"_successCallback",a.fail=a.fail||s+"_failCallback",L(T("tdem-web-retry-report-requests"),[]));n.find(function(e){return e.extraRetryOptions.requestId===s})?(t=n.findIndex(function(e){return e.extraRetryOptions.requestId===s}),n[t]=l):n.push(l),O("tdem-web-retry-report-requests",JSON.stringify(n)),setTimeout(function(){if(a.retriedCount<i)l.extraRetryOptions.retriedCount+=1,f.$request(l,c,d);else{if("discard"===o){var e=L(T("tdem-web-retry-report-requests"),[]).filter(function(e){return(null==(e=e.extraRetryOptions)?void 0:e.requestId)!==s});if(e.length)O("tdem-web-retry-report-requests",JSON.stringify(e));else try{localStorage.removeItem("tdem-web-retry-report-requests")}catch(e){}}Nr.delete(a.success),Nr.delete(a.fail)}},"function"==typeof r?r(l.extraRetryOptions.retriedCount):r),null!=u&&u(e),Nr.has(a.success)||Nr.set(a.success,c),Nr.has(a.fail)||Nr.set(a.fail,d)}):this.reportRequestQueue.push({options:l,success:n,fail:u})},r.prototype.$request=function(s,e,t){var n,r;if(s&&"string"==typeof s.url&&""!==s.url&&this.bean.id)return n=s.url,!1!==s.addBean&&(n=((e,t)=>{var n,r,i,o=e,a=s.beanFilter||[];for(n in t)-1===a.indexOf(n)&&((i=(r=new RegExp("([?&])"+n+"(=([^&]*))?(?=&|$)")).exec(o))?i[2]&&""!==i[3]&&"undefined"!==i[3]||(o=o.replace(r,"$1"+n+"="+t[n])):(i=-1<o.indexOf("?")?"&":"?",o+=i+n+"="+t[n]));return o})(n,x(x({},this.bean),{from:this.getCurrentPageUrl()}))),s.url=n,n=s.method||"get",r=this.config.onBeforeRequest,(s=r?r(s,this):s)?s.url?(r={success:e,fail:t},void((e={kind:s.type===oe.WHITE_LIST?"config":"events",url:s.url,method:n.toUpperCase(),contentType:s.contentType,data:s.data,body:s.data,sendBeacon:!!(null!=s&&s.sendBeacon||this.sendNow),source:s}).sendBeacon?this.transportHandoff(e,r):this.transportRequest(e,r))):console.warn("Please handle the parameters reasonably, options.url is necessary"):console.warn("Sending request blocked")},r.prototype.publishPluginsLogs=function(){var e=r.installedPlugins.find(function(e){return"assets"===e.name});null!=e&&e.option.collectNotReportedLog(this)},r.prototype.uploadLogs=function(e,t){var n;void 0===e&&(e={}),void 0===t&&(t={}),null!=(n=this.lifeCycle)&&n.emit("uploadLogs",e,t)},r.prototype.reportWebVitals=function(e){try{var t=r.installedPlugins.find(function(e){return"webVitals"===e.name});t&&this.config.webVitals&&this.config.webVitals.manualReport&&t.option.publish(this,e)}catch(e){}},r.sessionID=Ar("tdem",Me).sessionId,r);function r(e,t){var n,r,i,a,o,s,l,u,c,d,f=Pr.call(this,e,t=void 0===t?{}:t)||this;f.sendNow=!1,f.isReportReady=!1,f.reportRequestQueue=[],f._sdkInitialized=!1,f.speedLogPipeline=Je([(u=[],c=(o=f).config,o.lifeCycle.on("destroy",function(){u.length=0}),function(e,t){Array.isArray(e)?u=u.concat(e):u.push(e),s&&u.length>=s||o.sendNow&&0<u.length?(u=Se(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length)),l&&clearTimeout(l)):(l&&clearTimeout(l),l=setTimeout(function(){l=null,u=Se(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length))},c.delay))}),(a=f.config,function(e,t){var n,r,i,o="number"==typeof a.repeat?a.repeat:60;!a.speedSample||o<=0?t(e):(n=(null==a?void 0:a.id)||"0",r=Ce[n]||{},Array.isArray(e)?(i=e.filter(function(e){var t=!r[e.url]||r[e.url]<o;return t?(r[e.url]=1+~~r[e.url],Ce[n]=r):Ee[n]||Re(n),t})).length&&t(i):!r[e.url]||r[e.url]<o?(r[e.url]=1+~~r[e.url],Ce[n]=r,t(e)):Ee[n]||Re(n))}),(i=f,function(t,n){Xt(function(e){i.extendBean("netType",e),n(t)})}),function(e,t){null!=(n=f.lifeCycle)&&n.emit("beforeReportSpeed",e);var n,r=f.config.beforeReportSpeed;if((e="function"==typeof r?e.filter(function(e){return!1!==r(e)}):e).length)return t(e)},function(e,t){t(e.map(function(e){return void 0!==e.payload&&delete e.payload,e}))},function(e){return f.sendPipeline([function(e,t){t({type:oe.SPEED,url:""+f.config.speedUrl,method:"post",data:ne(e,x(x({},f.bean),{from:f.getCurrentPageUrl()})),log:e})}],oe.SPEED)(e)}]),f.getInternalTransport()||f.setInternalTransport(new Lr),e.asyncPlugin=!0;try{"undefined"!=typeof document&&(d=String(e.userId||e.uin||(null!=(n=document.cookie.match(/\buin=\D+(\d*)/))?n:[])[1]||(null!=(r=document.cookie.match(/\bilive_uin=\D*(\d+)/))?r:[])[1]||""),e.userId=d,e.uin=e.uin||d),f._bootstrapInit(e)}catch(e){console.warn(e),console.log("%cThe above error occurred in the process of initializing TDEM, which will affect your normal use of TDEM.\nIt is recommended that you contact us for feedback and thank you for your support.","color: red"),f.sendSDKError(e)}return f}function Fr(){this.constructor=Dr}function Ur(){}new e({name:"ie"}),new e({name:"onClose"});var zr=new e({name:"onClose",onNewTdem:function(n){var r,i=this;l.desktop()?(r=window.onunload,window.onunload=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.publishNotReportedLog(n),null!=r&&r.call.apply(r,g([window],e))}):Fn(this.publishNotReportedLog.bind(this,n),{once:!0})},publishNotReportedLog:function(t){var n=this;this.$walk(function(e){e===t&&(e.sendNow=!0,e.publishPluginsLogs(),n.publishThrottlePipeLogs(e))})},publishThrottlePipeLogs:function(e){null!=e&&e.speedLogPipeline([]),null!=e&&e.tdemEventPipeline([])}});function Br(){return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)})}new e({name:"aid"});qr.generate=function(){return"rep_"+this.uuid32()},qr.uuid32=function(){return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/x/g,function(){return Math.floor(16*Math.random()).toString(16)})};var jr=qr,Wr="[SessionReplay]",Hr=!1;function qr(){}function h(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Hr&&console.log.apply(console,g([Wr+"["+e+"]"],t))}function Vr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Hr&&console.debug.apply(console,g([Wr+"["+e+"]"],t))}function Gr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Hr&&console.log.apply(console,g([Wr+"["+e+"] WARN:"],t))}function Zr(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Hr&&console.log.apply(console,g([Wr+"["+e+"] ERROR:"],t))}Yr.prototype.setTdemInstance=function(e){this.tdemInstance=e},Yr.prototype.createSession=function(e){void 0===e&&(e="session");var t=null==(t=this.session)?void 0:t.replayId,n=Ar("tdem",Br),n=x({id:n.sessionId,replayId:jr.generate(),started:Date.now(),lastActivity:Date.now(),segmentId:0,sampled:e},t?{previousReplayId:t}:{});return this.session=n,this.syncSharedSession(n.id),h("SessionManager","Document replay session created:",n.id,n.replayId),n},Yr.prototype.restoreSession=function(){return this.session},Yr.prototype.saveSession=function(){},Yr.prototype.refreshSession=function(){var e=null!=(e=null==(e=this.session)?void 0:e.sampled)?e:"session";return this.createSession(e)},Yr.prototype.updateActivity=function(){this.session&&(this.session.lastActivity=Date.now())},Yr.prototype.incrementSegmentId=function(){var e;return this.session?(e=this.session.segmentId,this.session.segmentId+=1,e):0},Yr.prototype.shouldRefreshSession=function(){return!1},Yr.prototype.getSession=function(){return this.session},Yr.prototype.getSessionId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.id)?e:""},Yr.prototype.getReplayId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.replayId)?e:""},Yr.prototype.clearSession=function(){var e;this.session=null;try{null!=(e=window.sessionStorage)&&e.removeItem("tdem_session")}catch(e){}},Yr.prototype.syncSharedSession=function(e){var t,n,r,i;this.tdemInstance&&this.tdemInstance.extendBean("sessionId",e),e=e,t="tdem","undefined"!=typeof window&&(n=Date.now(),(r=window[xr])?(i=r.sessionId!==e,r.sessionId=e,r.version=i?r.version+1:r.version,r.source=t,i&&(r.createdAt=n),r.lastActivity=n):window[xr]=Ir(e,t),Mr("_tdem_s",e),window.dispatchEvent(new CustomEvent("monitor-session-update",{detail:{sessionId:e,source:t}})))};var Jr=Yr,Kr=((i={})[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i[i.Asset=7]="Asset",i),$r=(Xr.prototype.ensureReady=function(){return P(this,void 0,void 0,function(){return D(this,function(e){return[2,this.ready]})})},Xr.prototype.postMessage=function(n,r){var i=this,o=this.nextId++;return new Promise(function(e,t){i.pendingRequests.set(o,{resolve:e,reject:t}),i.worker.postMessage({id:o,method:n,arg:r})})},Xr.prototype.destroy=function(){this.pendingRequests.forEach(function(e){return(0,e.reject)(new Error("Worker destroyed"))}),this.pendingRequests.clear(),this.worker.terminate()},Xr);function Xr(e){var o=this;this.nextId=0,this.pendingRequests=new Map,this.worker=e,this.worker.addEventListener("message",function(e){var e=e.data,t=e.id,n=e.success,r=e.response;"init"!==e.method&&(e=o.pendingRequests.get(t))&&(o.pendingRequests.delete(t),n?e.resolve(r):e.reject(new Error(r||"Worker request failed")))}),this.ready=new Promise(function(t,n){var r=function(e){e=e.data;"init"===e.method&&e.success&&(o.worker.removeEventListener("message",r),clearTimeout(i),t())},i=(o.worker.addEventListener("message",r),o.worker.addEventListener("error",function(e){o.worker.removeEventListener("message",r),clearTimeout(i),n(new Error("Worker error: "+(e.message||"unknown")))}),setTimeout(function(){o.worker.removeEventListener("message",r),n(new Error("Worker init timeout (5s)"))},5e3))})}function Yr(e){this.session=null,this.tdemInstance=null}ei.prototype.initWorker=function(){var t=this,e=(()=>{try{var e,t,n;return"undefined"==typeof Worker||"undefined"==typeof Blob||"undefined"==typeof URL?null:(e=new Blob(["\n(function() {\n var events = [];\n var totalSize = 0;\n\n function handleMessage(data) {\n var method = data.method;\n var id = data.id;\n\n switch (method) {\n case 'addEvent':\n events.push(data.arg);\n totalSize += data.arg.length;\n return { id: id, method: method, success: true, response: totalSize };\n\n case 'finish':\n var json = '[' + events.join(',') + ']';\n events = [];\n totalSize = 0;\n // 返回原始 JSON 字符串,压缩在主线程做(pako 不好内联到 worker)\n return { id: id, method: method, success: true, response: json };\n\n case 'clear':\n events = [];\n totalSize = 0;\n return { id: id, method: method, success: true, response: void 0 };\n\n default:\n return { id: id, method: method, success: false, response: 'Unknown method' };\n }\n }\n\n self.addEventListener('message', function(e) {\n try {\n var result = handleMessage(e.data);\n self.postMessage(result);\n } catch (err) {\n self.postMessage({\n id: e.data.id,\n method: e.data.method,\n success: false,\n response: err.message || 'Worker error'\n });\n }\n });\n\n // 就绪信号\n self.postMessage({ method: 'init', success: true });\n})();\n"],{type:"application/javascript"}),t=URL.createObjectURL(e),n=new Worker(t,{name:"tdem-replay-compressor"}),URL.revokeObjectURL(t),h("CompressionWorker","Worker created successfully"),new $r(n))}catch(e){return Gr("CompressionWorker","Failed to create worker, will fallback to sync buffer:",e),null}})();e?(this.workerHandler=e,this.useWorker=!0,e.ensureReady().then(function(){t.workerReady=!0,h("EventBuffer","Worker ready, migrating buffered events"),t.migrateEventsToWorker()}).catch(function(e){Gr("EventBuffer","Worker init failed, falling back to sync buffer:",e),t.useWorker=!1,t.workerHandler=null})):h("EventBuffer","Worker not available, using sync buffer")},ei.prototype.migrateEventsToWorker=function(){if(this.workerHandler&&this.workerReady){var e=this.events;this.events=[];for(var t=0,n=e;t<n.length;t++){var r=n[t];this.addEventToWorker(r)}this.currentSize=0}},ei.prototype.addEventToWorker=function(e){if(this.workerHandler)try{var t=JSON.stringify(e);this.workerHandler.postMessage("addEvent",t),this.workerEventCount++,this.workerSize+=t.length}catch(e){Gr("EventBuffer","Failed to send event to worker:",e)}},ei.prototype.addEvent=function(e){var t;this.useWorker&&this.workerReady&&this.workerHandler?(t=this.estimateEventSize(e),this.workerSize+t>this.config.maxSize&&(Gr("EventBuffer","Worker buffer size limit exceeded, dropping old events"),this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0),this.addEventToWorker(e)):(t=this.estimateEventSize(e),this.currentSize+t>this.config.maxSize&&(Gr("EventBuffer","Size limit exceeded, removing old events"),this.trimOldEvents(t)),this.events.push(e),this.currentSize+=t)},ei.prototype.getEvents=function(){return g(this.events)},ei.prototype.getEventCount=function(){return this.useWorker&&this.workerReady?this.workerEventCount+this.events.length:this.events.length},ei.prototype.getSize=function(){return this.useWorker&&this.workerReady?this.workerSize+this.currentSize:this.currentSize},ei.prototype.isEmpty=function(){return!(this.useWorker&&this.workerReady&&0!==this.workerEventCount||0!==this.events.length)},ei.prototype.finishAsync=function(){return P(this,void 0,void 0,function(){var t,n,r;return D(this,function(e){switch(e.label){case 0:if(!(this.useWorker&&this.workerReady&&this.workerHandler&&0<this.workerEventCount))return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.workerHandler.postMessage("finish")];case 2:return t=e.sent(),r=this.workerEventCount,n=this.workerSize,this.workerEventCount=0,this.workerSize=0,[2,{events:[],eventCount:r,uncompressedSize:n,eventsJson:t}];case 3:return Gr("EventBuffer","Worker finish failed, falling back to sync:",e.sent()),[3,4];case 4:return[2,{events:r=this.getEvents(),eventCount:r.length,uncompressedSize:this.currentSize}]}})})},ei.prototype.finish=function(){var e=this.getEvents();return{events:e,eventCount:e.length,uncompressedSize:this.currentSize}},ei.prototype.clear=function(){this.events=[],this.currentSize=0,this.useWorker&&this.workerHandler&&(this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0)},ei.prototype.destroy=function(){this.clear(),this.workerHandler&&(this.workerHandler.destroy(),this.workerHandler=null),this.useWorker=!1,this.workerReady=!1},ei.prototype.estimateEventSize=function(e){try{return JSON.stringify(e).length}catch(e){return 1024}},ei.prototype.trimOldEvents=function(e){for(var t=-1,n=this.events.length-1;0<=n;n--)if(this.events[n].type===Kr.FullSnapshot){t=n;break}var r=t;if(0<r)for(n=r-1;0<=n;n--)if(this.events[n].type===Kr.Meta){r=n;break}for(var i,o=0,a=Math.max(e,.2*this.config.maxSize),s=0;s<r&&o<a;)s++,(i=this.events.shift())&&(o+=this.estimateEventSize(i));if(r<0)for(;0<this.events.length&&o<a;)(i=this.events.shift())&&(o+=this.estimateEventSize(i));this.currentSize=Math.max(0,this.currentSize-o)},ei.prototype.hasCheckout=function(){return this.events.some(function(e){return e.type===Kr.Meta||e.type===Kr.FullSnapshot})},ei.prototype.getLastCheckoutTime=function(){for(var e=this.events.length-1;0<=e;e--){var t=this.events[e];if(t.type===Kr.FullSnapshot)return t.timestamp}return null},ei.prototype.isUsingWorker=function(){return this.useWorker&&this.workerReady};var Qr=ei;function ei(e,t){void 0===e&&(e={}),void 0===t&&(t=!1),this.events=[],this.currentSize=0,this.workerHandler=null,this.useWorker=!1,this.workerReady=!1,this.workerEventCount=0,this.workerSize=0,this.config={maxSize:null!=(e=e.maxSize)?e:5242880},t&&this.initWorker()}function ti(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ni(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function ri(s){return function(){var e=this,a=arguments;return new Promise(function(t,n){var r=s.apply(e,a);function i(e){ni(r,t,n,i,o,"next",e)}function o(e){ni(r,t,n,i,o,"throw",e)}i(void 0)})}}function ii(e,t,n){t=si(t);var r=e,t=ui()?Reflect.construct(t,n||[],si(e).constructor):t.apply(e,n);if(!t||"object"!=typeof t&&"function"!=typeof t){if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");if(void 0===(t=r))throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,yi(r.key),r)}}function k(e,t,n){return t&&oi(e.prototype,t),n&&oi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ie(e,t){var n,r,i,o,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return i=!(r=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return r=e.done,e},e:function(e){i=!0,n=e},f:function(){try{r||null==a.return||a.return()}finally{if(i)throw n}}};if(Array.isArray(e)||(a=wi(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),o=0,{s:t=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ai(){return(ai="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=((e,t)=>{for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=si(e)););return e})(e,t);if(r)return(r=Object.getOwnPropertyDescriptor(r,t)).get?r.get.call(arguments.length<3?e:n):r.value}).apply(null,arguments)}function si(e){return(si=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function li(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&&mi(e,t)}function ui(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ui=function(){return!!e})()}function ci(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function Ae(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ci(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],(e=yi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):ci(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function di(e,t){if(null==e)return{};var n,r=((e,t)=>{if(null==e)return{};var n,r={};for(n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r})(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),o=0;o<i.length;o++)n=i[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function fi(){var p,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function r(e,t,n,r){var i,o,a,s,l,u,c,d,f,t=t&&t.prototype instanceof v?t:v,t=Object.create(t.prototype);return hi(t,"_invoke",(i=e,o=n,c=r||[],d=!1,f={p:u=0,n:0,v:p,a:h,f:h.bind(p,4),d:function(e,t){return a=e,s=0,l=p,f.n=t,m}},function(e,t,n){if(1<u)throw TypeError("Generator is already running");for(d&&1===t&&h(t,n),s=t,l=n;(g=s<2?p:l)||!d;){a||(s?s<3?(1<s&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(u=2,a){if(g=a[e=s?e:"next"]){if(!(g=g.call(a,l)))throw TypeError("iterator result is not an object");if(!g.done)return g;l=g.value,s<2&&(s=0)}else 1===s&&(g=a.return)&&g.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+e+"' method"),s=1);a=p}else if((g=(d=f.n<0)?l:i.call(o,f))!==m)break}catch(e){a=p,s=1,l=e}finally{u=1}}return{value:g,done:d}}),!0),t;function h(e,t){for(s=e,l=t,g=0;!d&&u&&!n&&g<c.length;g++){var n,r=c[g],i=f.p,o=r[2];3<e?(n=o===t)&&(l=r[(s=r[4])?5:s=3],r[4]=r[5]=p):r[0]<=i&&((n=e<2&&i<r[1])?(s=0,f.v=t,f.n=r[1]):i<o&&(n=e<3||r[0]>t||o<t)&&(r[4]=e,r[5]=t,f.n=o,s=0))}if(n||1<e)return m;throw d=!0,t}}var m={};function v(){}function i(){}function o(){}var g=Object.getPrototypeOf,e=[][t]?g(g([][t]())):(hi(g={},t,function(){return this}),g),a=o.prototype=v.prototype=Object.create(e);function s(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,hi(e,n,"GeneratorFunction")),e.prototype=Object.create(a),e}return hi(a,"constructor",i.prototype=o),hi(o,"constructor",i),hi(o,n,i.displayName="GeneratorFunction"),hi(a),hi(a,n,"Generator"),hi(a,t,function(){return this}),hi(a,"toString",function(){return"[object Generator]"}),(fi=function(){return{w:r,m:s}})()}function hi(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(hi=function(e,t,n,r){function i(t,n){hi(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))})(e,t,n,r)}function pi(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function mi(e,t){return(mi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Pe(e,t){return(e=>{if(Array.isArray(e))return e})(e)||((e,t)=>{var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}})(e,t)||wi(e,t)||(()=>{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 vi(e,t,n,r){var i=ai(si(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function gi(e){return(e=>{if(Array.isArray(e))return ti(e)})(e)||(()=>{if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)})()||wi(e)||(()=>{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 yi(e){e=(e=>{if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);if("object"!=typeof(t=t.call(e,"string")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e);return"symbol"==typeof e?e:e+""}function _(e){return(_="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})(e)}function wi(e,t){var n;if(e)return"string"==typeof e?ti(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ti(e,t):void 0}function bi(e){var n="function"==typeof Map?new Map:void 0;return(bi=function(e){if(null===e||!(t=>{try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}})(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return function(e,t,n){var r;return ui()?Reflect.construct.apply(null,arguments):((r=[null]).push.apply(r,t),t=new(e.bind.apply(e,r)),n&&mi(t,n.prototype),t)}(e,arguments,si(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),mi(t,e)})(e)}function u(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?Ti(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}function ki(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?Oi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}var _i=["inputs"],Si=["inputId"],Ei=["inputs"],Ci=["inputId"],Ri=["type"],Ti=Object.defineProperty,Oi=Object.defineProperty,xi=((i=xi||{})[i.Document=0]="Document",i[i.DocumentType=1]="DocumentType",i[i.Element=2]="Element",i[i.Text=3]="Text",i[i.CDATA=4]="CDATA",i[i.Comment=5]="Comment",i),Mi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ii={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ai={},Pi={};function Di(e){if(Ai[e])return Ai[e];var t=globalThis[e],n=t.prototype,r=e in Mi?Mi[e]:void 0,r=Boolean(r&&r.every(function(e){return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(n,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),i=e in Ii?Ii[e]:void 0,i=Boolean(i&&i.every(function(e){return"function"==typeof n[e]&&(null==(e=n[e])?void 0:e.toString().includes("[native code]"))}));if(r&&i&&!globalThis.Zone)return Ai[e]=t.prototype,t.prototype;try{var o,a,s=document.createElement("iframe"),l=(s.style.display="none",document.body.appendChild(s),s.contentWindow);return l?(o=l[e].prototype)?((a=navigator.userAgent).includes("Safari")&&!a.includes("Chrome")?(s.classList.add("rr-block"),s.setAttribute("__rrwebUntaintedMutationObserver",""),Pi[e]=function(){return s.remove()}):s.remove(),Ai[e]=o):(s.remove(),n):t.prototype}catch(e){return n}}var Li={};function Ni(e,t,n){var r="".concat(e,".").concat(String(n));return Li[r]?Li[r].call(t):(e=Di(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,n))?void 0:e.get)?(Li[r]=e).call(t):t[n])}var Fi={};function Ui(e,t,n){var r="".concat(e,".").concat(String(n));return Fi[r]?Fi[r].bind(t):"function"!=typeof(e=Di(e)[n])?t[n]:(Fi[r]=e).bind(t)}var i=Date.now,zi={ownerDocument:function(e){return Ni("Node",e,"ownerDocument")},childNodes:function(e){return Ni("Node",e,"childNodes")},parentNode:function(e){return Ni("Node",e,"parentNode")},parentElement:function(e){return Ni("Node",e,"parentElement")},textContent:function(e){return Ni("Node",e,"textContent")},contains:function(e,t){return Ui("Node",e,"contains")(t)},getRootNode:function(e){return Ui("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ni("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ni("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ni("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ni("Element",e,"querySelectorAll")(t)},nowTimestamp:i=/[1-9][0-9]{12}/.test(Date.now().toString())?i:function(){return(new Date).getTime()},mutationObserverCtor:function(){var e;return[Di("MutationObserver").constructor,null!=(e=Pi.MutationObserver)?e:function(){}]},patch:function(e,t,n){try{var r,i;return t in e?("function"==typeof(i=n(r=e[t]))&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}):function(){}}catch(e){return function(){}}}};function Bi(e){return e.nodeType===e.ELEMENT_NODE}function ji(e){var t=e&&"host"in e&&"mode"in e&&zi.host(e)||null;return Boolean(t&&"shadowRoot"in t&&zi.shadowRoot(t)===e)}function Wi(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Hi(e){try{var t,n=e.rules||e.cssRules;return n?(!(t=e.href)&&e.ownerNode&&(t=e.ownerNode.baseURI),r=(r=Array.from(n,function(e){return qi(e,t)}).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")?r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;"):r):null}catch(e){return null}var r}function qi(e,t){if("styleSheet"in e){var n;try{n=Hi(e.styleSheet)||((r=(i=e).cssText).split('"').length<3?r:(r=["@import","url(".concat(JSON.stringify(i.href),")")],""===i.layerName?r.push("layer"):i.layerName&&r.push("layer(".concat(i.layerName,")")),i.supportsText&&r.push("supports(".concat(i.supportsText,")")),i.media.length&&r.push(i.media.mediaText),r.join(" ")+";"))}catch(t){n=e.cssText}return e.styleSheet.href?eo(n,e.styleSheet.href):n}var r,i=e.cssText;return"selectorText"in e&&e.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?eo(i,t):i}var Vi=k(function e(){b(this,e),ki(this,"idNodeMap",new Map),ki(this,"nodeMetaMap",new WeakMap)},[{key:"getId",value:function(e){return e&&null!=(e=null==(e=this.getMeta(e))?void 0:e.id)?e:-1}},{key:"getNode",value:function(e){return this.idNodeMap.get(e)||null}},{key:"getIds",value:function(){return Array.from(this.idNodeMap.keys())}},{key:"getMeta",value:function(e){return this.nodeMetaMap.get(e)||null}},{key:"removeNodeFromMap",value:function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})}},{key:"has",value:function(e){return this.idNodeMap.has(e)}},{key:"hasNode",value:function(e){return this.nodeMetaMap.has(e)}},{key:"add",value:function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}},{key:"replace",value:function(e,t){var n=this.getNode(e);n&&(n=this.nodeMetaMap.get(n))&&this.nodeMetaMap.set(t,n),this.idNodeMap.set(e,t)}},{key:"reset",value:function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}]);function Gi(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.maskInputFn,e=e.value||"",i=i&&Zi(i);return e=n[r.toLowerCase()]||i&&n[i]?o?o(e,t):"*".repeat(e.length):e}function Zi(e){return e.toLowerCase()}function Ji(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Zi(t):null}function Ki(e,t){var n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}t=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(n=null==t?void 0:t[1])?n:null}var $i=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Xi=/^(?:[a-z+]+:)?\/\//i,Yi=/^www\..*/i,Qi=/^(data:)([^,]*),(.*)/i;function eo(e,c){return(e||"").replace($i,function(e,t,n,r,i,o){n=n||i||o,i=t||r||"";if(!n)return e;if(Xi.test(n)||Yi.test(n))return"url(".concat(i).concat(n).concat(i,")");if(Qi.test(n))return"url(".concat(i).concat(n).concat(i,")");if("/"===n[0])return"url(".concat(i).concat((-1<(o=c).indexOf("//")?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+n).concat(i,")");var t=n.split("#")[0],r=n.substring(t.length),a=c.split("#")[0].split("/"),o=t.split("/");a.pop();var s,l=Ie(o);try{for(l.s();!(s=l.n()).done;){var u=s.value;"."!==u&&(".."===u?a.pop():a.push(u))}}catch(e){l.e(e)}finally{l.f()}return"url(".concat(i).concat(a.join("/")).concat(r).concat(i,")")})}function to(e,t){return 1<arguments.length&&void 0!==t&&t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}var no,ro,io=1,oo=new RegExp("[^a-z0-9-_:]");function ao(){return io++}var so=/^[^ \t\n\r\u000c]+/,lo=/^[, \t\n\r\u000c]+/,uo=new WeakMap;function co(e,t){return t&&""!==t.trim()?fo(e,t):t}function fo(e,t){var n=uo.get(e);if(n||(n=e.createElement("a"),uo.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function ho(e,t,n,r){return r&&("src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?co(e,r):"srcset"===n?((e,t)=>{if(""===t.trim())return t;var n=0;function r(e){var e=e.exec(t.substring(n));return e?(e=e[0],n+=e.length,e):""}for(var i=[];r(lo),!(n>=t.length);)if(","===(a=r(so)).slice(-1))a=co(e,a.substring(0,a.length-1)),i.push(a);else for(var o="",a=co(e,a),s=!1;;){var l=t.charAt(n);if(""===l){i.push((a+o).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){n+=1,i.push((a+o).trim());break}"("===l&&(s=!0)}o+=l,n+=1}return i.join(", ")})(e,r):"style"===n?eo(r,fo(e)):"object"===t&&"data"===n?co(e,r):r)}function po(e,t){return["video","audio"].includes(e)&&"autoplay"===t}function mo(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE)for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&mo(zi.parentNode(e),t,n)}function vo(e,t,n,r){var i;if(Bi(e)){if(!zi.childNodes(i=e).length)return!1}else{if(null===zi.parentElement(e))return!1;i=zi.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if(mo(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function go(e,t){var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.needsMask,a=t.inlineStylesheet,s=t.maskInputOptions,l=void 0===s?{}:s,u=t.maskTextFn,c=t.maskInputFn,s=t.dataURLOptions,d=void 0===s?{}:s,f=t.inlineImages,h=t.recordCanvas,N=t.keepIframeSrcFn,s=t.newlyAddedElement,F=void 0!==s&&s,s=t.cssCaptured,U=void 0!==s&&s,p=(s=n,!(t=t.mirror).hasNode(s)||1===(t=t.getId(s))?void 0:t);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:xi.Document,childNodes:[],compatMode:e.compatMode}:{type:xi.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:xi.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:p};case e.ELEMENT_NODE:for(var m,v,g,y,w,b,k=e,_=(I={doc:n,blockClass:r,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:f,recordCanvas:h,keepIframeSrcFn:N,newlyAddedElement:F,rootId:p}).doc,S=I.inlineStylesheet,E=void 0===(E=I.maskInputOptions)?{}:E,C=I.maskInputFn,R=void 0===(T=I.dataURLOptions)?{}:T,T=I.inlineImages,O=I.recordCanvas,x=I.keepIframeSrcFn,M=void 0!==(M=I.newlyAddedElement)&&M,z=I.rootId,I=((e,t,n)=>{try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1})(k,I.blockClass,I.blockSelector),A=(v=k)instanceof HTMLFormElement?"form":(v=Zi(v.tagName),oo.test(v)?"div":v),P={},B=k.attributes.length,D=0;D<B;D++){var L=k.attributes[D];po(A,L.name)||(P[L.name]=ho(_,A,Zi(L.name),L.value))}"link"===A&&S&&(v=null,v=(S=Array.from(_.styleSheets).find(function(e){return e.href===k.href}))?Hi(S):v)&&(delete P.rel,delete P.href,P._cssText=v),"style"===A&&k.sheet&&(S=Hi(k.sheet))&&(1<k.childNodes.length&&(S=function(e,t,n){var r=2<arguments.length&&void 0!==n&&n,i=Array.from(t.childNodes),o=[],a=0;if(1<i.length&&e&&"string"==typeof e)for(var s=to(e,r),l=s.length/e.length,u=1;u<i.length;u++)if(i[u].textContent&&"string"==typeof i[u].textContent){for(var c=to(i[u].textContent,r),d=3;d<c.length&&(c[d].match(/[a-zA-Z0-9]/)||-1!==c.indexOf(c.substring(0,d),1));d++);for(;d<c.length;d++){var f,h=c.substring(0,d),p=s.split(h),m=-1;if(2===p.length)m=p[0].length;else if(2<p.length&&""===p[0]&&""!==i[u-1].textContent)m=s.indexOf(h,1);else if(1===p.length){if(h=h.substring(0,h.length-1),(p=s.split(h)).length<=1)return o.push(e),o;d=101}else d===c.length-1&&(m=s.indexOf(h));if(-1!==(m=2<=p.length&&100<d&&((f=i[u-1].textContent)&&"string"==typeof f&&(f=to(f).length,m=s.indexOf(h,f)),-1===m)?p[0].length:m)){for(var v=Math.floor(m/l);0<v&&v<e.length;){if((a+=1)>50*i.length)return o.push(e),o;var g=to(e.substring(0,v),r);if(g.length===m){o.push(e.substring(0,v)),e=e.substring(v),s=s.substring(m);break}g.length<m?v+=Math.max(1,Math.floor((m-g.length)/l)):v-=Math.max(1,Math.floor((g.length-m)*l))}break}}}return o.push(e),o}(S,k).join("/* rr_split */")),P._cssText=S),["input","textarea","select"].includes(A)&&(v=k.value,S=k.checked,"radio"!==P.type&&"checkbox"!==P.type&&"submit"!==P.type&&"button"!==P.type&&v?P.value=Gi({element:k,type:Ji(k),tagName:A,value:v,maskInputOptions:E,maskInputFn:C}):S&&(P.checked=S)),"option"===A&&(k.selected&&!E.select?P.selected=!0:delete P.selected),"dialog"===A&&k.open&&(P.rr_open_mode=k.matches("dialog:modal")?"modal":"non-modal"),"canvas"===A&&O&&("2d"===k.__context?(e=>{var t=e.getContext("2d");if(t)for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,i="__rrweb_original__"in i?i.__rrweb_original__:i;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(function(e){return 0!==e}))return}return 1})(k)||(P.rr_dataURL=k.toDataURL(R.type,R.quality)):"__context"in k||(v=k.toDataURL(R.type,R.quality),(C=_.createElement("canvas")).width=k.width,C.height=k.height,v!==C.toDataURL(R.type,R.quality)&&(P.rr_dataURL=v))),"img"===A&&T&&(no||(no=_.createElement("canvas"),ro=no.getContext("2d")),y=(g=k).currentSrc||g.getAttribute("src")||"<unknown-src>",w=g.crossOrigin,b=function(){g.removeEventListener("load",b);try{no.width=g.naturalWidth,no.height=g.naturalHeight,ro.drawImage(g,0,0),P.rr_dataURL=no.toDataURL(R.type,R.quality)}catch(e){if("anonymous"!==g.crossOrigin)return g.crossOrigin="anonymous",void(g.complete&&0!==g.naturalWidth?b():g.addEventListener("load",b));console.warn("Cannot inline img src=".concat(y,"! Error: ").concat(e))}"anonymous"===g.crossOrigin&&(w?P.crossOrigin=w:g.removeAttribute("crossorigin"))},g.complete&&0!==g.naturalWidth?b():g.addEventListener("load",b)),["audio","video"].includes(A)&&((S=P).rr_mediaState=k.paused?"paused":"played",S.rr_mediaCurrentTime=k.currentTime,S.rr_mediaPlaybackRate=k.playbackRate,S.rr_mediaMuted=k.muted,S.rr_mediaLoop=k.loop,S.rr_mediaVolume=k.volume),M||(k.scrollLeft&&(P.rr_scrollLeft=k.scrollLeft),k.scrollTop&&(P.rr_scrollTop=k.scrollTop)),I&&(O=(E=k.getBoundingClientRect()).width,C=E.height,P={class:P.class,rr_width:"".concat(O,"px"),rr_height:"".concat(C,"px")}),"iframe"!==A||x(P.src)||(k.contentDocument||(P.rr_src=P.src),delete P.src);try{customElements.get(A)&&(m=!0)}catch(k){}return{type:xi.Element,tagName:A,attributes:P,childNodes:[],isSVG:Boolean("svg"===k.tagName||k.ownerSVGElement)||void 0,needBlock:I,rootId:z,isCustom:m};case e.TEXT_NODE:return v=e,S=(T={doc:n,needsMask:o,maskTextFn:u,rootId:p,cssCaptured:U}).needsMask,M=T.maskTextFn,E=T.rootId,O=T.cssCaptured,C=(C=zi.parentNode(v))&&C.tagName,x="",I="STYLE"===C||void 0,(C="SCRIPT"===C||void 0)?x="SCRIPT_PLACEHOLDER":O||(x=zi.textContent(v),I&&(x=x&&eo(x,fo(T.doc)))),!I&&!C&&x&&S&&(x=M?M(x,zi.parentElement(v)):x.replace(/[\S]/g,"*")),{type:xi.Text,textContent:x||"",rootId:E};case e.CDATA_SECTION_NODE:return{type:xi.CDATA,textContent:"",rootId:p};case e.COMMENT_NODE:return{type:xi.Comment,textContent:zi.textContent(e)||"",rootId:p};default:return!1}}function N(e){return null==e?"":e.toLowerCase()}function yo(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function wo(t,e){var n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.maskTextClass,s=e.maskTextSelector,l=e.skipChild,l=void 0!==l&&l,u=e.inlineStylesheet,c=void 0===u||u,u=e.maskInputOptions,d=void 0===u?{}:u,f=e.maskTextFn,h=e.maskInputFn,p=e.slimDOMOptions,u=e.dataURLOptions,m=void 0===u?{}:u,u=e.inlineImages,v=void 0!==u&&u,u=e.recordCanvas,g=void 0!==u&&u,y=e.onSerialize,w=e.onIframeLoad,u=e.iframeLoadTimeout,b=void 0===u?5e3:u,k=e.onStylesheetLoad,u=e.stylesheetLoadTimeout,_=void 0===u?5e3:u,u=e.keepIframeSrcFn,S=void 0===u?function(){return!1}:u,u=e.newlyAddedElement,u=void 0!==u&&u,E=e.cssCaptured,E=void 0!==E&&E,C=e.needsMask,e=e.preserveWhiteSpace,R=void 0===e||e,C=C||vo(t,a,s,void 0===C),e=go(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,dataURLOptions:m,inlineImages:v,recordCanvas:g,keepIframeSrcFn:S,newlyAddedElement:u,cssCaptured:E});if(!e)return console.warn(t,"not serialized"),null;var u=r.hasNode(t)?r.getId(t):((e,t)=>{if(t.comment&&e.type===xi.Comment)return 1;if(e.type===xi.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Ki(e.attributes.href)))return 1;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(N(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===N(e.attributes.name)||"icon"===N(e.attributes.rel)||"apple-touch-icon"===N(e.attributes.rel)||"shortcut icon"===N(e.attributes.rel))))return 1;if("meta"===e.tagName){if(t.headMetaDescKeywords&&N(e.attributes.name).match(/^description|keywords$/))return 1;if(t.headMetaSocial&&(N(e.attributes.property).match(/^(og|twitter|fb):/)||N(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===N(e.attributes.name)))return 1;if(t.headMetaRobots&&("robots"===N(e.attributes.name)||"googlebot"===N(e.attributes.name)||"bingbot"===N(e.attributes.name)))return 1;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return 1;if(t.headMetaAuthorship&&("author"===N(e.attributes.name)||"generator"===N(e.attributes.name)||"framework"===N(e.attributes.name)||"publisher"===N(e.attributes.name)||"progid"===N(e.attributes.name)||N(e.attributes.property).match(/^article:/)||N(e.attributes.property).match(/^product:/)))return 1;if(t.headMetaVerification&&("google-site-verification"===N(e.attributes.name)||"yandex-verification"===N(e.attributes.name)||"csrf-token"===N(e.attributes.name)||"p:domain_verify"===N(e.attributes.name)||"verify-v1"===N(e.attributes.name)||"verification"===N(e.attributes.name)||"shopify-checkout-api-token"===N(e.attributes.name)))return 1}}})(e,p)||!R&&e.type===xi.Text&&!e.textContent.replace(/^\s+|\s+$/gm,"").length?-2:io++,T=Object.assign(e,{id:u});if(r.add(t,T),-2===u)return null;y&&y(t);E=!l;if(T.type===xi.Element&&(E=E&&!T.needBlock,delete T.needBlock,e=zi.shadowRoot(t))&&Wi(e)&&(T.isShadowHost=!0),(T.type===xi.Document||T.type===xi.Element)&&E){p.headWhitespace&&T.type===xi.Element&&"head"===T.tagName&&(R=!1);var O={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S,cssCaptured:!1};if(T.type!==xi.Element||"textarea"!==T.tagName||void 0===T.attributes.value){T.type===xi.Element&&void 0!==T.attributes._cssText&&"string"==typeof T.attributes._cssText&&(O.cssCaptured=!0);for(var x=0,M=Array.from(zi.childNodes(t));x<M.length;x++){var I=wo(M[x],O);I&&T.childNodes.push(I)}}var A=null;if(Bi(t)&&(A=zi.shadowRoot(t)))for(var P=0,D=Array.from(zi.childNodes(A));P<D.length;P++){var L=wo(D[P],O);L&&(Wi(A)&&(L.isShadow=!0),T.childNodes.push(L))}}u=zi.parentNode(t);return u&&ji(u)&&Wi(u)&&(T.isShadow=!0),T.type===xi.Element&&"iframe"===T.tagName&&((e,t,n)=>{var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){if("about:blank"!==r.location.href||"about:blank"===e.src||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()})}}})(t,function(){var e=t.contentDocument;e&&w&&(e=wo(e,{doc:e,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S}))&&w(t,e)},b),T.type===xi.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===Ki(T.attributes.href))&&((e,t,n)=>{var r,i,o=!1;try{r=e.sheet}catch(e){return}r||(i=setTimeout(function(){o||(t(),o=!0)},n),e.addEventListener("load",function(){clearTimeout(i),o=!0,t()}))})(t,function(){var e;k&&(e=wo(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S}))&&k(t,e)},_),T}var bo,ko={exports:{}};var _o,So,Eo,Co,Ro,p=(Eo=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?Eo:("function"==typeof(Co=Eo.default)?(Ro=function e(){return this instanceof e?Reflect.construct(Co,arguments,this.constructor):Co.apply(this,arguments)}).prototype=Co.prototype:Ro={},Object.defineProperty(Ro,"__esModule",{value:!0}),Object.keys(Eo).forEach(function(e){var t=Object.getOwnPropertyDescriptor(Eo,e);Object.defineProperty(Ro,e,t.get?t:{enumerable:!0,get:function(){return Eo[e]}})}),Ro);function To(){var d,f,e,t;return So||(So=1,bo||(bo=1,e=String,ko.exports=(t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}})(),ko.exports.createColors=t),d=ko.exports,f=p,li(s,bi(Error)),t=k(s,[{key:"setMessage",value:function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}},{key:"showSourceCode",value:function(e){var r=this;if(!this.source)return"";var t=this.source;null==e&&(e=d.isColorSupported);var n,i,o,a,s,t=(t=f&&e?f(t):t).split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,t.length),c=String(u).length;return e?(e=d.createColors(!0),n=e.bold,i=e.gray,o=e.red,a=function(e){return n(o(e))},s=function(e){return i(e)}):a=s=function(e){return e},t.slice(l,u).map(function(e,t){var t=l+1+t,n=" "+(" "+t).slice(-c)+" | ";return t===r.line?(t=s(n.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," "),a(">")+s(n)+e+"\n "+t+a("^")):" "+s(n)+e}).join("\n")}},{key:"toString",value:function(){var e=(e=this.showSourceCode())&&"\n\n"+e+"\n";return this.name+": "+this.message+e}}]),(_o=t).default=t),_o;function s(e,t,n,r,i,o){var a;return b(this,s),(a=ii(this,s,[e])).name="CssSyntaxError",a.reason=e,i&&(a.file=i),r&&(a.source=r),o&&(a.plugin=o),void 0!==t&&void 0!==n&&("number"==typeof t?(a.line=t,a.column=n):(a.line=t.line,a.column=t.column,a.endLine=n.line,a.endColumn=n.column)),a.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(a,s),a}}var Oo,xo,Mo,Io,Ao,Po,Do,Lo,No,Fo,Uo,zo,Bo,jo,Wo,Ho,qo,Vo,Go,Zo,Jo,Ko,$o,Xo,Yo,Qo,ea,ta,na,ra,ia,oa,aa,sa,la,ua,ca,da,fa,ha,pa,ma,va,ga,ya,wa,ba,ka,_a={};function Sa(){return Oo||(Oo=1,_a.isClean=Symbol("isClean"),_a.my=Symbol("my")),_a}function Ea(){var a,e;return Mo||(a={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!(Mo=1)},e=k(function e(t){b(this,e),this.builder=t},[{key:"atrule",value:function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes?this.block(e,n+r):(t=(e.raws.between||"")+(t?";":""),this.builder(n+r+t,e))}},{key:"beforeAfter",value:function(e,t){for(var n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var a=0;a<i;a++)n+=o}return n}},{key:"block",value:function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(t=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(t),this.builder("}",e,"end")}},{key:"body",value:function(e){for(var t=e.nodes.length-1;0<t&&"comment"===e.nodes[t].type;)--t;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}},{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}},{key:"decl",value:function(e,t){var n=this.raw(e,"between","colon"),n=e.prop+n+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}},{key:"document",value:function(e){this.body(e)}},{key:"raw",value:function(e,t,n){var r;if(t&&void 0!==(r=e.raws[t]))return r;var i,o=e.parent;if("before"===(n=n||t)){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}return o?((o=e.root()).rawCache||(o.rawCache={}),void 0!==o.rawCache[n]?o.rawCache[n]:"before"===n||"after"===n?this.beforeAfter(e,n):(this[i="raw"+((i=n)[0].toUpperCase()+i.slice(1))]?r=this[i](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=a[n]),o.rawCache[n]=r)):a[n]}},{key:"rawBeforeClose",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}},{key:"rawBeforeComment",value:function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeDecl"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeDecl",value:function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeRule"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeOpen",value:function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}},{key:"rawBeforeRule",value:function(t){var n;return t.walk(function(e){if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=n&&n.replace(/\S/g,"")}},{key:"rawColon",value:function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}},{key:"rawEmptyBody",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}},{key:"rawIndent",value:function(n){return n.raws.indent||(n.walk(function(e){var t=e.parent;if(t&&t!==n&&t.parent&&t.parent===n&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),r=(r=t[t.length-1]).replace(/\S/g,""),!1}),r);var r}},{key:"rawSemicolon",value:function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}},{key:"rawValue",value:function(e,t){var n=e[t],e=e.raws[t];return e&&e.value===n?e.raw:n}},{key:"root",value:function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}},{key:"rule",value:function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}},{key:"stringify",value:function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}]),(xo=e).default=e),xo}function Ca(){var n;return Ao||(Ao=1,n=Ea(),(Io=e).default=e),Io;function e(e,t){new n(t).stringify(e)}}function Ra(){var a,s,i,n,r,e;return Do||(Do=1,e=Sa(),a=e.isClean,s=e.my,i=To(),n=Ea(),r=Ca(),e=k(function e(){var t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(t in b(this,e),this.raws={},this[a]=!1,this[s]=!0,n)if("nodes"===t){this.nodes=[];var r,i=Ie(n[t]);try{for(i.s();!(r=i.n()).done;){var o=r.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}catch(e){i.e(e)}finally{i.f()}}else this[t]=n[t]},[{key:"addToError",value:function(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,"$&".concat(t.input.from,":").concat(t.start.line,":").concat(t.start.column,"$&"))),e}},{key:"after",value:function(e){return this.parent.insertAfter(this,e),this}},{key:"assign",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(e in t)this[e]=t[e];return this}},{key:"before",value:function(e){return this.parent.insertBefore(this,e),this}},{key:"cleanRaws",value:function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}},{key:"clone",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=function t(e,n){var r,i,o,a=new e.constructor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r&&(o=_(i=e[r]),"parent"===r&&"object"===o?n&&(a[r]=n):"source"===r?a[r]=i:Array.isArray(i)?a[r]=i.map(function(e){return t(e,a)}):("object"===o&&null!==i&&(i=t(i)),a[r]=i));return a}(this);for(e in t)n[e]=t[e];return n}},{key:"cloneAfter",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertAfter(this,e),e}},{key:"cloneBefore",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertBefore(this,e),e}},{key:"error",value:function(e){var t,n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.source?(t=(n=this.rangeBy(r)).end,this.source.input.error(e,{column:(n=n.start).column,line:n.line},{column:t.column,line:t.line},r)):new i(e)}},{key:"getProxyProcessor",value:function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}},{key:"markDirty",value:function(){if(this[a]){this[a]=!1;for(var e=this;e=e.parent;)e[a]=!1}}},{key:"next",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}},{key:"positionBy",value:function(e,t){var n=this.source.start;return e.index?n=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(n=this.positionInside(e,t)),n}},{key:"positionInside",value:function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?i+=r=1:r+=1;return{column:r,line:i}}},{key:"prev",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}},{key:"rangeBy",value:function(e){var t,n,r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};return e.word?-1!==(n=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(n,t),i=this.positionInside(n+e.word.length,t)):(e.start?r={column:e.start.column,line:e.start.line}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1))),{end:i=i.line<r.line||i.line===r.line&&i.column<=r.column?{column:r.column+1,line:r.line}:i,start:r}}},{key:"raw",value:function(e,t){return(new n).raw(this,e,t)}},{key:"remove",value:function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}},{key:"replaceWith",value:function(){if(this.parent){for(var e=this,t=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];s===this?t=!0:t?(this.parent.insertAfter(e,s),e=s):this.parent.insertBefore(e,s)}t||this.remove()}return this}},{key:"root",value:function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}},{key:"toJSON",value:function(e,t){var n,r,i,o={},a=null==t,s=(t=t||new Map,0);for(n in this)Object.prototype.hasOwnProperty.call(this,n)&&"parent"!==n&&"proxyCache"!==n&&(r=this[n],Array.isArray(r)?o[n]=r.map(function(e){return"object"===_(e)&&e.toJSON?e.toJSON(null,t):e}):"object"===_(r)&&r.toJSON?o[n]=r.toJSON(null,t):"source"===n?(null==(i=t.get(r.input))&&(i=s,t.set(r.input,s),s++),o[n]={end:r.end,inputId:i,start:r.start}):o[n]=r);return a&&(o.inputs=gi(t.keys()).map(function(e){return e.toJSON()})),o}},{key:"toProxy",value:function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r,t=(e.stringify&&(e=e.stringify),"");return e(this,function(e){t+=e}),t}},{key:"warn",value:function(e,t,n){var r,i={node:this};for(r in n)i[r]=n[r];return e.warn(t,i)}},{key:"proxyOf",get:function(){return this}}]),(Po=e).default=e),Po}function Ta(){var e;return No||(No=1,li(t,Ra()),e=k(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),(Lo=e).default=e),Lo;function t(e){return b(this,t),(e=ii(this,t,[e=e&&void 0!==e.value&&"string"!=typeof e.value?Ae(Ae({},e),{},{value:String(e.value)}):e])).type="decl",e}}function Oa(){var r,i,t,n,o,a,e;return Bo||(Bo=1,r=p.SourceMapConsumer,i=p.SourceMapGenerator,t=p.existsSync,n=p.readFileSync,o=p.dirname,a=p.join,e=k(function e(t,n){b(this,e),!1!==n.map&&(this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:"),t=n.map?n.map.prev:void 0,t=this.loadMap(n.from,t),!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=o(this.mapFile)),t)&&(this.text=t)},[{key:"consumer",value:function(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}},{key:"decodeInline",value:function(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}},{key:"getAnnotationURL",value:function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}},{key:"isMap",value:function(e){return"object"===_(e)&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}},{key:"loadAnnotation",value:function(e){var t,n=e.match(/\/\*\s*# sourceMappingURL=/gm);n&&(n=e.lastIndexOf(n.pop()),t=e.indexOf("*/",n),-1<n)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(n,t)))}},{key:"loadFile",value:function(e){if(this.root=o(e),t(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}},{key:"loadMap",value:function(e,t){if(!1===t)return!1;if(!t)return this.inline?this.decodeInline(this.annotation):this.annotation?(n=this.annotation,e&&(n=a(o(e),n)),this.loadFile(n)):void 0;if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){t=this.loadFile(n);if(t)return t;throw new Error("Unable to load previous source map: "+n.toString())}}},{key:"startWith",value:function(e,t){return!!e&&e.substr(0,t.length)===t}},{key:"withContent",value:function(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}}]),(zo=e).default=e),zo}function xa(){var e,a,l,s,r,i,t,u,o,c,d,f,n;return Wo||(Wo=1,n=p.SourceMapConsumer,e=p.SourceMapGenerator,a=p.fileURLToPath,l=p.pathToFileURL,s=p.isAbsolute,r=p.resolve,i=(Uo?Fo:(Uo=1,Fo={nanoid:function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:21;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e},customAlphabet:function(n){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:21;return function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r;t--;)e+=n[Math.random()*n.length|0];return e}}})).nanoid,t=p,u=To(),o=Oa(),c=Symbol("fromOffsetCache"),d=Boolean(n&&e),f=Boolean(r&&s),n=k(function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(b(this,e),null==t||"object"===_(t)&&!t.toString)throw new Error("PostCSS received ".concat(t," instead of CSS string"));this.css=t.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!f||/^\w+:\/\//.test(n.from)||s(n.from)?this.file=n.from:this.file=r(n.from)),f&&d&&(t=new o(this.css,n)).text&&(n=(this.map=t).consumer().file,!this.file)&&n&&(this.file=this.mapResolve(n)),this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)},[{key:"error",value:function(e,t,n){var r,i,o,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},s=(t&&"object"===_(t)?(s=n,n="number"==typeof(i=t).offset?(t=(o=this.fromOffset(i.offset)).line,o.col):(t=i.line,i.column),i="number"==typeof s.offset?(r=(o=this.fromOffset(s.offset)).line,o.col):(r=s.line,s.column)):n||(t=(o=this.fromOffset(t)).line,n=o.col),this.origin(t,n,r,i));return(o=s?new u(e,void 0===s.endLine?s.line:{column:s.column,line:s.line},void 0===s.endLine?s.column:{column:s.endColumn,line:s.endLine},s.source,s.file,a.plugin):new u(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,a.plugin)).input={column:n,endColumn:i,endLine:r,line:t,source:this.css},this.file&&(l&&(o.input.url=l(this.file).toString()),o.input.file=this.file),o}},{key:"fromOffset",value:function(e){if(this[c])n=this[c];else{for(var t=this.css.split("\n"),n=new Array(t.length),r=0,i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;this[c]=n}var a=0;if(e>=n[n.length-1])a=n.length-1;else for(var s,l=n.length-2;a<l;)if(e<n[s=a+(l-a>>1)])l=s-1;else{if(!(e>=n[s+1])){a=s;break}a=s+1}return{col:e-n[a]+1,line:a+1}}},{key:"mapResolve",value:function(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}},{key:"origin",value:function(e,t,n,r){if(!this.map)return!1;var i,o=this.map.consumer(),t=o.originalPositionFor({column:t,line:e});if(!t.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n}));e=s(t.source)?l(t.source):new URL(t.source,this.map.consumer().sourceRoot||l(this.map.mapFile)),r={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:e.toString()};if("file:"===e.protocol){if(!a)throw new Error("file: protocol is not available in this PostCSS build");r.file=a(e)}n=o.sourceContentFor(t.source);return n&&(r.source=n),r}},{key:"toJSON",value:function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=Ae({},this.map),e.map.consumerCache)&&(e.map.consumerCache=void 0),e}},{key:"from",get:function(){return this.file||this.id}}]),(jo=n).default=n,t&&t.registerInput&&t.registerInput(n)),jo}function Ma(){if(qo)return Ho;qo=1;var a=p.SourceMapConsumer,t=p.SourceMapGenerator,s=p.dirname,n=p.relative,r=p.resolve,i=p.sep,o=p.pathToFileURL,l=xa(),e=Boolean(a&&t),u=Boolean(s&&r&&n&&i);return Ho=k(function e(t,n,r,i){b(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map},[{key:"addAnnotation",value:function(){var e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map",t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}},{key:"applyPrevMaps",value:function(){var e,t=Ie(this.previous());try{for(t.s();!(e=t.n()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||s(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new a(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}}catch(e){t.e(e)}finally{t.f()}}},{key:"clearAnnotation",value:function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;0<=t;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}},{key:"generate",value:function(){var t;return this.clearAnnotation(),u&&e&&this.isMap()?this.generateMap():(t="",this.stringify(this.root,function(e){t+=e}),[t])}},{key:"generateMap",value:function(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}},{key:"generateString",value:function(){var r=this;this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});var i,o=1,a=1,s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(e,t,n){r.css+=e,t&&"end"!==n&&(s.generated.line=o,s.generated.column=a-1,t.source&&t.source.start?(s.source=r.sourcePath(t),s.original.line=t.source.start.line,s.original.column=t.source.start.column-1):(s.source="<no source>",s.original.line=1,s.original.column=0),r.map.addMapping(s)),(i=e.match(/\n/g))?(o+=i.length,i=e.lastIndexOf("\n"),a=e.length-i):a+=e.length,t&&"start"!==n&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(s.source=r.sourcePath(t),s.original.line=t.source.end.line,s.original.column=t.source.end.column-1,s.generated.line=o,s.generated.column=a-2):(s.source="<no source>",s.original.line=1,s.original.column=0,s.generated.line=o,s.generated.column=a-1),r.map.addMapping(s))})}},{key:"isAnnotation",value:function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))}},{key:"isInline",value:function(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))}},{key:"isMap",value:function(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}},{key:"isSourcesContent",value:function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})}},{key:"outputFile",value:function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}},{key:"path",value:function(e){var t;return this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e)?e:this.memoizedPaths.get(e)||(t=this.opts.to?s(this.opts.to):".","string"==typeof this.mapOpts.annotation&&(t=s(r(t,this.mapOpts.annotation))),t=n(t,e),this.memoizedPaths.set(e,t),t)}},{key:"previous",value:function(){var e,t=this;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(function(e){e.source&&e.source.input.map&&(e=e.source.input.map,t.previousMaps.includes(e)||t.previousMaps.push(e))}):(e=new l(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}},{key:"setSourcesContent",value:function(){var e,n=this,r={};this.root?this.root.walk(function(e){var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=n.usesFileUrls?n.toFileUrl(t):n.toUrl(n.path(t)),n.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}},{key:"sourcePath",value:function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}},{key:"toBase64",value:function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}},{key:"toFileUrl",value:function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(o)return t=o(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}},{key:"toUrl",value:function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===i&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}}])}function Ia(){var e;return Go||(Go=1,li(t,Ra()),e=k(t),(Vo=e).default=e),Vo;function t(e){return b(this,t),(e=ii(this,t,[e])).type="comment",e}}function Aa(){var u,c,d,t,e,f,h,p,m,n;return Jo||(Jo=1,e=Sa(),f=e.isClean,h=e.my,p=Ta(),m=Ia(),li(v,Ra()),(n=k(v,[{key:"append",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o,a=i[r],s=Ie(this.normalize(a,this.last));try{for(s.s();!(o=s.n()).done;){var l=o.value;this.proxyOf.nodes.push(l)}}catch(e){s.e(e)}finally{s.f()}}return this.markDirty(),this}},{key:"cleanRaws",value:function(e){if(vi(v,"cleanRaws",this,3)([e]),this.nodes){var t,n=Ie(this.nodes);try{for(n.s();!(t=n.n()).done;)t.value.cleanRaws(e)}catch(e){n.e(e)}finally{n.f()}}}},{key:"each",value:function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}}},{key:"every",value:function(e){return this.nodes.every(e)}},{key:"getIterator",value:function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}},{key:"getProxyProcessor",value:function(){return{get:function(r,o){return"proxyOf"===o?r:r[o]&&("each"===o||"string"==typeof o&&o.startsWith("walk")?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r[o].apply(r,gi(t.map(function(n){return"function"==typeof n?function(e,t){return n(e.toProxy(),t)}:n})))}:"every"===o||"some"===o?function(i){return r[o](function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return i.apply(void 0,[e.toProxy()].concat(n))})}:"root"===o?function(){return r.root().toProxy()}:"nodes"===o?r.nodes.map(function(e){return e.toProxy()}):"first"===o||"last"===o?r[o].toProxy():r[o])},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}},{key:"index",value:function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}},{key:"insertAfter",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o+1,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"insertBefore",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<=(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"normalize",value:function(e,t){var n=this;if("string"==typeof e)e=function t(e){return e.map(function(e){return e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e})}(u(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){var r,i=Ie(e=e.slice(0));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.parent&&o.parent.removeChild(o,"ignore")}}catch(e){i.e(e)}finally{i.f()}}else if("root"===e.type&&"document"!==this.type){var a,s=Ie(e=e.nodes.slice(0));try{for(s.s();!(a=s.n()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}}catch(e){s.e(e)}finally{s.f()}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new p(e)]}else if(e.selector)e=[new c(e)];else if(e.name)e=[new d(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new m(e)]}return e.map(function(e){return e[h]||v.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[f]&&function e(t){if(t[f]=!1,t.proxyOf.nodes){var n,r=Ie(t.proxyOf.nodes);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(e){r.e(e)}finally{r.f()}}}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=n.proxyOf,e})}},{key:"prepend",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Ie(t=t.reverse());try{for(i.s();!(r=i.n()).done;){var o,a,s=r.value,l=this.normalize(s,this.first,"prepend").reverse(),u=Ie(l);try{for(u.s();!(o=u.n()).done;){var c=o.value;this.proxyOf.nodes.unshift(c)}}catch(e){u.e(e)}finally{u.f()}for(a in this.indexes)this.indexes[a]=this.indexes[a]+l.length}}catch(e){i.e(e)}finally{i.f()}return this.markDirty(),this}},{key:"push",value:function(e){return(e.parent=this).proxyOf.nodes.push(e),this}},{key:"removeAll",value:function(){var e,t=Ie(this.proxyOf.nodes);try{for(t.s();!(e=t.n()).done;)e.value.parent=void 0}catch(e){t.e(e)}finally{t.f()}return this.proxyOf.nodes=[],this.markDirty(),this}},{key:"removeChild",value:function(e){var t,n;for(n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}},{key:"replaceValues",value:function(t,n,r){return r||(r=n,n={}),this.walkDecls(function(e){n.props&&!n.props.includes(e.prop)||n.fast&&!e.value.includes(n.fast)||(e.value=e.value.replace(t,r))}),this.markDirty(),this}},{key:"some",value:function(e){return this.nodes.some(e)}},{key:"walk",value:function(r){return this.each(function(t,e){var n;try{n=r(t,e)}catch(e){throw t.addToError(e)}return n=!1!==n&&t.walk?t.walk(r):n})}},{key:"walkAtRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("atrule"===e.type&&n.test(e.name))return r(e,t)}):this.walk(function(e,t){if("atrule"===e.type&&e.name===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("atrule"===e.type)return r(e,t)}))}},{key:"walkComments",value:function(n){return this.walk(function(e,t){if("comment"===e.type)return n(e,t)})}},{key:"walkDecls",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("decl"===e.type&&n.test(e.prop))return r(e,t)}):this.walk(function(e,t){if("decl"===e.type&&e.prop===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("decl"===e.type)return r(e,t)}))}},{key:"walkRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("rule"===e.type&&n.test(e.selector))return r(e,t)}):this.walk(function(e,t){if("rule"===e.type&&e.selector===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("rule"===e.type)return r(e,t)}))}},{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}])).registerParse=function(e){u=e},n.registerRule=function(e){c=e},n.registerAtRule=function(e){d=e},n.registerRoot=function(e){t=e},((Zo=n).default=n).rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,d.prototype):"rule"===e.type?Object.setPrototypeOf(e,c.prototype):"decl"===e.type?Object.setPrototypeOf(e,p.prototype):"comment"===e.type?Object.setPrototypeOf(e,m.prototype):"root"===e.type&&Object.setPrototypeOf(e,t.prototype),e[h]=!0,e.nodes&&e.nodes.forEach(function(e){n.rebuild(e)})}),Zo;function v(){return b(this,v),ii(this,v,arguments)}}function Pa(){var t,n,e;return $o||($o=1,li(r,Aa()),(e=k(r,[{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},e.registerProcessor=function(e){n=e},(Ko=e).default=e),Ko;function r(e){return b(this,r),(e=ii(this,r,[Ae({type:"document"},e)])).nodes||(e.nodes=[]),e}}function Da(){if(Yo)return Xo;Yo=1;var t={};return Xo=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}}function La(){var e;return ea||(ea=1,e=k(function e(t){var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(n in b(this,e),this.type="warning",this.text=t,r.node&&r.node.source&&(t=r.node.rangeBy(r),this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column),r)this[n]=r[n]},[{key:"toString",value:function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}]),(Qo=e).default=e),Qo}function Na(){var n,e;return na||(na=1,n=La(),e=k(function e(t,n,r){b(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0},[{key:"toString",value:function(){return this.css}},{key:"warn",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin),new n(e,t));return this.messages.push(e),e}},{key:"warnings",value:function(){return this.messages.filter(function(e){return"warning"===e.type})}},{key:"content",get:function(){return this.css}}]),(ta=e).default=e),ta}function Fa(){var e,t;return aa||(aa=1,li(r,e=Aa()),t=k(r,[{key:"append",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return vi(r,"append",this,3)(t)}},{key:"prepend",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return vi(r,"prepend",this,3)(t)}}]),(oa=t).default=t,e.registerAtRule(t)),oa;function r(e){return b(this,r),(e=ii(this,r,[e])).type="atrule",e}}function Ua(){var t,n,e,r;return la||(la=1,li(a,e=Aa()),(r=k(a,[{key:"normalize",value:function(e,t,n){var r=vi(a,"normalize",this,3)([e]);if(t)if("prepend"===n)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;)i.value.raws.before=t.raws.before}catch(e){o.e(e)}finally{o.f()}}return r}},{key:"removeChild",value:function(e,t){var n=this.index(e);return!t&&0===n&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[n].raws.before),vi(a,"removeChild",this,3)([e])}},{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},r.registerProcessor=function(e){n=e},sa=r,e.registerRoot(r.default=r)),sa;function a(e){return b(this,a),(e=ii(this,a,[e])).type="root",e.nodes||(e.nodes=[]),e}}function za(){var t;return ca||(ca=1,(ua=t={comma:function(e){return t.split(e,[","],!0)},space:function(e){return t.split(e,[" ","\n","\t"])},split:function(e,t,n){var r,i=[],o="",a=!1,s=0,l=!1,u="",c=!1,d=Ie(e);try{for(d.s();!(r=d.n()).done;){var f=r.value;c?c=!1:"\\"===f?c=!0:l?f===u&&(l=!1):'"'===f||"'"===f?(l=!0,u=f):"("===f?s+=1:")"===f?0<s&&--s:0===s&&t.includes(f)&&(a=!0),a?(""!==o&&i.push(o.trim()),o="",a=!1):o+=f}}catch(e){d.e(e)}finally{d.f()}return!n&&""===o||i.push(o.trim()),i}}).default=t),ua}function Ba(){var e,t,n;return fa||(fa=1,e=Aa(),t=za(),li(r,e),n=k(r,[{key:"selectors",get:function(){return t.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}}]),(da=n).default=n,e.registerRule(n)),da;function r(e){return b(this,r),(e=ii(this,r,[e])).type="rule",e.nodes||(e.nodes=[]),e}}function ja(){if(pa)return ha;pa=1;var p=Ta(),e=(()=>{if(ia)return ra;ia=1;var w="'".charCodeAt(0),b='"'.charCodeAt(0),k="\\".charCodeAt(0),_="/".charCodeAt(0),S="\n".charCodeAt(0),E=" ".charCodeAt(0),C="\f".charCodeAt(0),R="\t".charCodeAt(0),T="\r".charCodeAt(0),O="[".charCodeAt(0),x="]".charCodeAt(0),M="(".charCodeAt(0),I=")".charCodeAt(0),A="{".charCodeAt(0),P="}".charCodeAt(0),D=";".charCodeAt(0),L="*".charCodeAt(0),N=":".charCodeAt(0),F="@".charCodeAt(0),U=/[\t\n\f\r "#'()/;[\\\]{}]/g,z=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,B=/.[\r\n"'(/\\]/,j=/[\da-f]/i;return ra=function(t){var r,i,o,a,s,l,u,c,d,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},f=t.css.valueOf(),h=e.ignoreErrors,p=f.length,m=0,v=[],g=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&p<=m},nextToken:function(e){if(g.length)return g.pop();if(!(p<=m)){var t=!!e&&e.ignoreUnclosed;switch(r=f.charCodeAt(m)){case S:case E:case R:case T:case C:for(i=m;i+=1,(r=f.charCodeAt(i))===E||r===S||r===R||r===T||r===C;);d=["space",f.slice(m,i)],m=i-1;break;case O:case x:case A:case P:case N:case D:case I:var n=String.fromCharCode(r);d=[n,n,m];break;case M:if(u=v.length?v.pop()[1]:"",c=f.charCodeAt(m+1),"url"===u&&c!==w&&c!==b&&c!==E&&c!==S&&c!==R&&c!==C&&c!==T){i=m;do{if(s=!1,-1===(i=f.indexOf(")",i+1))){if(h||t){i=m;break}y("bracket")}for(l=i;f.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["brackets",f.slice(m,i+1),m,i],m=i}else i=f.indexOf(")",m+1),u=f.slice(m,i+1),-1===i||B.test(u)?d=["(","(",m]:(d=["brackets",u,m,i],m=i);break;case w:case b:o=r===w?"'":'"',i=m;do{if(s=!1,-1===(i=f.indexOf(o,i+1))){if(h||t){i=m+1;break}y("string")}for(l=i;f.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["string",f.slice(m,i+1),m,i],m=i;break;case F:U.lastIndex=m+1,U.test(f),i=0===U.lastIndex?f.length-1:U.lastIndex-2,d=["at-word",f.slice(m,i+1),m,i],m=i;break;case k:for(i=m,a=!0;f.charCodeAt(i+1)===k;)i+=1,a=!a;if(r=f.charCodeAt(i+1),a&&r!==_&&r!==E&&r!==S&&r!==R&&r!==T&&r!==C&&(i+=1,j.test(f.charAt(i)))){for(;j.test(f.charAt(i+1));)i+=1;f.charCodeAt(i+1)===E&&(i+=1)}d=["word",f.slice(m,i+1),m,i],m=i;break;default:m=(r===_&&f.charCodeAt(m+1)===L?(0===(i=f.indexOf("*/",m+2)+1)&&(h||t?i=f.length:y("comment")),d=["comment",f.slice(m,i+1),m,i]):(z.lastIndex=m+1,z.test(f),i=0===z.lastIndex?f.length-1:z.lastIndex-2,d=["word",f.slice(m,i+1),m,i],v.push(d)),i)}return m++,d}},position:function(){return m}}}})(),n=Ia(),u=Fa(),r=Ua(),i=Ba(),f={empty:!0,space:!0};return ha=k(function e(t){b(this,e),this.input=t,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}},[{key:"atrule",value:function(e){var t,n,r,i=new u;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,a=!1,s=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(0<s.length){for(n=s[r=s.length-1];n&&"space"===n[0];)n=s[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}}if(s.push(e),this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(i.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(i,"params",s),o&&(e=s[s.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}},{key:"checkMissedSemicolon",value:function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;0<=i&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}}},{key:"colon",value:function(e){var t,n,r,i,o=0,a=Ie(e.entries());try{for(a.s();!(i=a.n()).done;){var s=Pe(i.value,2),l=s[0];if("("===(n=(t=s[1])[0])&&(o+=1),")"===n&&--o,0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}}catch(e){a.e(e)}finally{a.f()}return!1}},{key:"comment",value:function(e){var t=new n,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}},{key:"createTokenizer",value:function(){this.tokenizer=e(this.input)}},{key:"decl",value:function(e,t){var n=new p;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||(e=>{for(var t=e.length-1;0<=t;t--){var n=e[t],n=n[3]||n[2];if(n)return n}})(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var a,s=[];e.length&&("space"===(a=e[0][0])||"comment"===a);)s.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;0<=l;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var u=this.stringFrom(e,l);" !important"!==(u=this.spacesFromEnd(e)+u)&&(n.raws.important=u);break}if("important"===r[1].toLowerCase()){for(var c=e.slice(0),d="",f=l;0<f;f--){var h=c[f][0];if(0===d.trim().indexOf("!")&&"space"!==h)break;d=c.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=c)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=s.map(function(e){return e[1]}).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}},{key:"doubleColon",value:function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}},{key:"emptyRule",value:function(e){var t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}},{key:"end",value:function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}},{key:"endFile",value:function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}},{key:"freeSemicolon",value:function(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}},{key:"getPosition",value:function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}},{key:"init",value:function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}},{key:"other",value:function(e){for(var t,n=!1,r=!1,i=null,o=[],a=e[1].startsWith("--"),s=[],l=e;l;){if(t=l[0],s.push(l),"("===t||"["===t)i=i||l,o.push("("===t?")":"]");else if(a&&r&&"{"===t)i=i||l,o.push("}");else if(0===o.length){if(";"===t){if(r)return void this.decl(s,a);break}if("{"===t)return void this.rule(s);if("}"===t){this.tokenizer.back(s.pop()),n=!0;break}":"===t&&(r=!0)}else t===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),0<o.length&&this.unclosedBracket(i),n&&r){if(!a)for(;s.length&&("space"===(l=s[s.length-1][0])||"comment"===l);)this.tokenizer.back(s.pop());this.decl(s,a)}else this.unknownWord(s)}},{key:"parse",value:function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}},{key:"precheckMissedSemicolon",value:function(){}},{key:"raw",value:function(e,t,n,r){for(var i,o,a,s,l=n.length,u="",c=!0,d=0;d<l;d+=1)"space"===(a=(i=n[d])[0])&&d===l-1&&!r||"comment"===a&&(a=n[d-1]?n[d-1][0]:"empty",o=n[d+1]?n[d+1][0]:"empty",f[a]||f[o]||","===u.slice(-1))?c=!1:u+=i[1];c||(s=n.reduce(function(e,t){return e+t[1]},""),e.raws[t]={raw:s,value:u}),e[t]=u}},{key:"rule",value:function(e){e.pop();var t=new i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"spacesAndCommentsFromEnd",value:function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n}},{key:"spacesAndCommentsFromStart",value:function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n}},{key:"spacesFromEnd",value:function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}},{key:"stringFrom",value:function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}},{key:"unclosedBlock",value:function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}},{key:"unclosedBracket",value:function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}},{key:"unexpectedClose",value:function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}},{key:"unknownWord",value:function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}},{key:"unnamedAtrule",value:function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}])}function Wa(){var e,r,i;return va||(va=1,e=Aa(),r=ja(),i=xa(),ma=t,e.registerParse(t.default=t)),ma;function t(e,t){var n=new i(e,t),n=new r(n);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}}function Ha(){var d,s,n,r,l,e,i,u,c,t,o,f,h,p,a,m;return ya||(ya=1,e=Sa(),d=e.isClean,s=e.my,n=Ma(),r=Ca(),l=Aa(),e=Pa(),i=Da(),u=Na(),c=Wa(),t=Ua(),o={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},f={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0},p={},(a=k(function e(t,n,r){var i,o=this;if(b(this,e),this.stringified=!1,this.processed=!1,"object"!==_(n)||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof u)i=w(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var a=c;r.syntax&&(a=r.syntax.parse),(a=r.parser?r.parser:a).parse&&(a=a.parse);try{i=a(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[s]&&l.rebuild(i)}else i=w(n);this.result=new u(t,i,r),this.helpers=Ae(Ae({},p),{},{postcss:p,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===_(e)&&e.prepare?Ae(Ae({},e),e.prepare(o.result)):e})},[{key:"async",value:function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"getAsyncError",value:function(){throw new Error("Use process(css).then(cb) to work with async plugins")}},{key:"handleError",value:function(e,t){var n,r,i,o,a,s=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?s.postcssVersion&&"production"!==process.env.NODE_ENV&&(n=s.postcssPlugin,r=s.postcssVersion,i=this.result.processor.version,o=r.split("."),a=i.split("."),o[0]!==a[0]||parseInt(o[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below."):(e.plugin=s.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}},{key:"prepareVisitors",value:function(){var r=this;this.listeners={};function e(e,t,n){r.listeners[t]||(r.listeners[t]=[]),r.listeners[t].push([e,n])}var t,n=Ie(this.plugins);try{for(n.s();!(t=n.n()).done;){var i=t.value;if("object"===_(i))for(var o in i){if(!f[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event ".concat(o," in ").concat(i.postcssPlugin,". Try to update PostCSS (").concat(this.processor.version," now)."));if(!h[o])if("object"===_(i[o]))for(var a in i[o])e(i,"*"===a?o:o+"-"+a.toLowerCase(),i[o][a]);else"function"==typeof i[o]&&e(i,o,i[o])}}}catch(r){n.e(r)}finally{n.f()}this.hasListener=0<Object.keys(this.listeners).length}},{key:"runAsync",value:(m=ri(fi().m(function e(){var t,i,n,r,o,a,s,l,u,c=this;return fi().w(function(e){for(;;)switch(e.p=e.n){case 0:this.plugin=0,t=0;case 1:if(t<this.plugins.length){if(s=this.plugins[t],v(s=this.runOnRoot(s)))return e.p=2,e.n=3,s;e.n=5}else e.n=6;break;case 3:e.n=5;break;case 4:throw e.p=4,s=e.v,this.handleError(s);case 5:t++,e.n=1;break;case 6:if(this.prepareVisitors(),!this.hasListener){e.n=21;break}i=this.result.root;case 7:if(i[d]){e.n=14;break}i[d]=!0,n=[y(i)];case 8:if(0<n.length){if(v(l=this.visitTick(n)))return e.p=9,e.n=10,l;e.n=12}else e.n=13;break;case 10:e.n=12;break;case 11:throw e.p=11,l=e.v,u=n[n.length-1].node,this.handleError(l,u);case 12:e.n=8;break;case 13:e.n=7;break;case 14:if(!this.listeners.OnceExit){e.n=21;break}r=Ie(this.listeners.OnceExit),e.p=15,a=fi().m(function e(){var t,n,r;return fi().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=Pe(o.value,2),r=n[0],t=n[1],c.result.lastPlugin=r,e.p=1,"document"===i.type)return n=i.nodes.map(function(e){return t(e,c.helpers)}),e.n=2,Promise.all(n);e.n=3;break;case 2:e.n=4;break;case 3:return e.n=4,t(i,c.helpers);case 4:e.n=6;break;case 5:throw e.p=5,r=e.v,c.handleError(r);case 6:return e.a(2)}},e,null,[[1,5]])}),r.s();case 16:if((o=r.n()).done){e.n=18;break}return e.d(pi(a()),17);case 17:e.n=16;break;case 18:e.n=20;break;case 19:e.p=19,u=e.v,r.e(u);case 20:return e.p=20,r.f(),e.f(20);case 21:return this.processed=!0,e.a(2,this.stringify())}},e,this,[[15,19,20,21],[9,11],[2,4]])})),function(){return m.apply(this,arguments)})},{key:"runOnRoot",value:function(t){var e,n=this;this.result.lastPlugin=t;try{return"object"===_(t)&&t.Once?"document"===this.result.root.type?v((e=this.result.root.nodes.map(function(e){return t.Once(e,n.helpers)}))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}},{key:"stringify",value:function(){if(this.error)throw this.error;var e,t;return this.stringified||(this.stringified=!0,this.sync(),t=this.result.opts,e=r,t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify),t=new n(e,this.result.root,this.result.opts).generate(),this.result.css=t[0],this.result.map=t[1]),this.result}},{key:"sync",value:function(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();var e,t=Ie(this.plugins);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(v(this.runOnRoot(n)))throw this.getAsyncError()}}catch(e){t.e(e)}finally{t.f()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[d];)r[d]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type){var i,o=Ie(r.nodes);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.visitSync(this.listeners.OnceExit,a)}}catch(e){o.e(e)}finally{o.f()}}else this.visitSync(this.listeners.OnceExit,r)}}return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this.css}},{key:"visitSync",value:function(e,t){var n,r=Ie(e);try{for(r.s();!(n=r.n()).done;){var i=Pe(n.value,2),o=i[0],a=i[1],s=(this.result.lastPlugin=o,void 0);try{s=a(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(v(s))throw this.getAsyncError()}}catch(e){r.e(e)}finally{r.f()}}},{key:"visitTick",value:function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(0<r.length&&t.visitorIndex<r.length){var i=Pe(r[t.visitorIndex],2),o=i[0],i=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){for(var a,s=t.iterator;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[d])return a[d]=!0,void e.push(y(a));t.iterator=0,delete n.indexes[s]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}},{key:"walkSync",value:function(e){var t=this;e[d]=!0;var n,r=Ie(g(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[d]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}}catch(e){r.e(e)}finally{r.f()}}},{key:"warnings",value:function(){return this.sync().warnings()}},{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}])).registerPostcss=function(e){p=e},ga=a,t.registerLazyResult(a.default=a),e.registerLazyResult(a)),ga;function v(e){return"object"===_(e)&&"function"==typeof e.then}function g(e){var t=!1,n=o[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function y(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:g(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function w(e){return e[d]=!1,e.nodes&&e.nodes.forEach(w),e}}y||(y=1,i=To(),qa=Ta(),y=Ha(),ql=Aa(),Jh||(Jh=1,c||(c=1,cs=Ma(),ds=Ca(),fs=Da(),hs=Wa(),ps=Na(),ms=k(function e(t,n,r){b(this,e),n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;var t=ds,i=(this.result=new ps(this._processor,void 0,this._opts),this.result.css=n,this),r=(Object.defineProperty(this.result,"root",{get:function(){return i.root}}),new cs(t,void 0,this._opts,n));r.isMap()?(n=(t=Pe(r.generate(),2))[0],t=t[1],n&&(this.result.css=n),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)},[{key:"async",value:function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"sync",value:function(){if(this.error)throw this.error;return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||fs("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this._css}},{key:"warnings",value:function(){return[]}},{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=hs;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),(wa=ms).default=ms),as=wa,ss=Ha(),ms=Pa(),ls=Ua(),us=k(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];b(this,e),this.version="8.4.38",this.plugins=this.normalize(t)},[{key:"normalize",value:function(e){var t,n=[],r=Ie(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===_(i)&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===_(i)&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else{if("object"!==_(i)||!i.parse&&!i.stringify)throw new Error(i+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"process",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new(this.plugins.length||t.parser||t.stringifier||t.syntax?ss:as)(this,e,t)}},{key:"use",value:function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}]),(ba=us).default=us,ls.registerProcessor(us),ms.registerProcessor(us)),Va=ba,ls=Ca(),v||(v=1,Qa=Ta(),es=Oa(),ts=Ia(),ns=Fa(),rs=xa(),is=Ua(),os=Ba(),(ka=vs).default=vs),us=ka,Ga=Pa(),Jh=La(),Za=Ia(),Ja=Fa(),c=Na(),v=xa(),Ka=Wa(),$a=za(),Xa=Ba(),Ya=Ua(),$l=Ra(),o.plugin=function(t,n){var e,r=!1;function i(){console&&console.warn&&!r&&(r=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");var e=n.apply(void 0,arguments);return e.postcssPlugin=t,e.postcssVersion=(new Va).version,e}return Object.defineProperty(i,"postcss",{get:function(){return e=e||i()}}),i.process=function(e,t,n){return o([i(n)]).process(e,t)},i},o.stringify=ls,o.parse=Ka,o.fromJSON=us,o.list=$a,o.comment=function(e){return new Za(e)},o.atRule=function(e){return new Ja(e)},o.decl=function(e){return new qa(e)},o.rule=function(e){return new Xa(e)},o.root=function(e){return new Ya(e)},o.document=function(e){return new Ga(e)},o.CssSyntaxError=i,o.Declaration=qa,o.Container=ql,o.Processor=Va,o.Document=Ga,o.Comment=Za,o.Warning=Jh,o.AtRule=Ja,o.Result=c,o.Input=v,o.Rule=Xa,o.Root=Ya,o.Node=$l,y.registerPostcss(o),(Ka=o).default=o);var qa,Va,Ga,Za,Ja,Ka,$a,Xa,Ya,Qa,es,ts,ns,rs,is,os,as,ss,ls,us,cs,ds,fs,hs,ps,ms,i=($a=Ka)&&$a.__esModule&&Object.prototype.hasOwnProperty.call($a,"default")?$a.default:$a;function vs(e,t){if(Array.isArray(e))return e.map(function(e){return vs(e)});var n,r=e.inputs,i=di(e,_i);if(r){t=[];var o,a=Ie(r);try{for(a.s();!(o=a.n()).done;){var s=Ae(Ae({},o.value),{},{__proto__:rs.prototype});s.map&&(s.map=Ae(Ae({},s.map),{},{__proto__:es.prototype})),t.push(s)}}catch(e){a.e(e)}finally{a.f()}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return vs(e,t)})),i.source&&(n=(r=i.source).inputId,r=di(r,Si),i.source=r,null!=n)&&(i.source.input=t[n]),"root"===i.type)return new is(i);if("decl"===i.type)return new Qa(i);if("rule"===i.type)return new os(i);if("comment"===i.type)return new ts(i);if("atrule"===i.type)return new ns(i);throw new Error("Unknown node type: "+e.type)}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new Va(t)}i.stringify;function gs(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}var ys=Object.defineProperty;Date.now().toString();var ws,bs={exports:{}};var ks,_s,Ss,Es,Cs,m=(Ss=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?Ss:("function"==typeof(Es=Ss.default)?(Cs=function e(){return this instanceof e?Reflect.construct(Es,arguments,this.constructor):Es.apply(this,arguments)}).prototype=Es.prototype:Cs={},Object.defineProperty(Cs,"__esModule",{value:!0}),Object.keys(Ss).forEach(function(e){var t=Object.getOwnPropertyDescriptor(Ss,e);Object.defineProperty(Cs,e,t.get?t:{enumerable:!0,get:function(){return Ss[e]}})}),Cs);function Rs(){var d,f,e,t;return _s||(_s=1,ws||(ws=1,e=String,bs.exports=(t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}})(),bs.exports.createColors=t),d=bs.exports,f=m,li(s,bi(Error)),t=k(s,[{key:"setMessage",value:function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}},{key:"showSourceCode",value:function(e){var r=this;if(!this.source)return"";var t=this.source;null==e&&(e=d.isColorSupported);var n,i,o,a,s,t=(t=f&&e?f(t):t).split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,t.length),c=String(u).length;return e?(e=d.createColors(!0),n=e.bold,i=e.gray,o=e.red,a=function(e){return n(o(e))},s=function(e){return i(e)}):a=s=function(e){return e},t.slice(l,u).map(function(e,t){var t=l+1+t,n=" "+(" "+t).slice(-c)+" | ";return t===r.line?(t=s(n.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," "),a(">")+s(n)+e+"\n "+t+a("^")):" "+s(n)+e}).join("\n")}},{key:"toString",value:function(){var e=(e=this.showSourceCode())&&"\n\n"+e+"\n";return this.name+": "+this.message+e}}]),(ks=t).default=t),ks;function s(e,t,n,r,i,o){var a;return b(this,s),(a=ii(this,s,[e])).name="CssSyntaxError",a.reason=e,i&&(a.file=i),r&&(a.source=r),o&&(a.plugin=o),void 0!==t&&void 0!==n&&("number"==typeof t?(a.line=t,a.column=n):(a.line=t.line,a.column=t.column,a.endLine=n.line,a.endColumn=n.column)),a.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(a,s),a}}var Ts,Os,xs,Ms,Is,As,Ps,Ds,Ls,Ns,Fs,Us,zs,Bs,js,Ws,Hs,qs,Vs,Gs,Zs,Js,Ks,$s,Xs,Ys,Qs,el,tl,nl,rl,il,ol,al,sl,ll,ul,cl,dl,fl,hl,pl,ml,vl,gl,yl,wl,bl,kl,_l={};function Sl(){return Ts||(Ts=1,_l.isClean=Symbol("isClean"),_l.my=Symbol("my")),_l}function El(){var a,e;return xs||(a={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!(xs=1)},e=k(function e(t){b(this,e),this.builder=t},[{key:"atrule",value:function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes?this.block(e,n+r):(t=(e.raws.between||"")+(t?";":""),this.builder(n+r+t,e))}},{key:"beforeAfter",value:function(e,t){for(var n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var a=0;a<i;a++)n+=o}return n}},{key:"block",value:function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(t=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(t),this.builder("}",e,"end")}},{key:"body",value:function(e){for(var t=e.nodes.length-1;0<t&&"comment"===e.nodes[t].type;)--t;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}},{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}},{key:"decl",value:function(e,t){var n=this.raw(e,"between","colon"),n=e.prop+n+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}},{key:"document",value:function(e){this.body(e)}},{key:"raw",value:function(e,t,n){var r;if(t&&void 0!==(r=e.raws[t]))return r;var i,o=e.parent;if("before"===(n=n||t)){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}return o?((o=e.root()).rawCache||(o.rawCache={}),void 0!==o.rawCache[n]?o.rawCache[n]:"before"===n||"after"===n?this.beforeAfter(e,n):(this[i="raw"+((i=n)[0].toUpperCase()+i.slice(1))]?r=this[i](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=a[n]),o.rawCache[n]=r)):a[n]}},{key:"rawBeforeClose",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}},{key:"rawBeforeComment",value:function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeDecl"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeDecl",value:function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeRule"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeOpen",value:function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}},{key:"rawBeforeRule",value:function(t){var n;return t.walk(function(e){if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=n&&n.replace(/\S/g,"")}},{key:"rawColon",value:function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}},{key:"rawEmptyBody",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}},{key:"rawIndent",value:function(n){return n.raws.indent||(n.walk(function(e){var t=e.parent;if(t&&t!==n&&t.parent&&t.parent===n&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),r=(r=t[t.length-1]).replace(/\S/g,""),!1}),r);var r}},{key:"rawSemicolon",value:function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}},{key:"rawValue",value:function(e,t){var n=e[t],e=e.raws[t];return e&&e.value===n?e.raw:n}},{key:"root",value:function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}},{key:"rule",value:function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}},{key:"stringify",value:function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}]),(Os=e).default=e),Os}function Cl(){var n;return Is||(Is=1,n=El(),(Ms=e).default=e),Ms;function e(e,t){new n(t).stringify(e)}}function Rl(){var a,s,i,n,r,e;return Ps||(Ps=1,e=Sl(),a=e.isClean,s=e.my,i=Rs(),n=El(),r=Cl(),e=k(function e(){var t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(t in b(this,e),this.raws={},this[a]=!1,this[s]=!0,n)if("nodes"===t){this.nodes=[];var r,i=Ie(n[t]);try{for(i.s();!(r=i.n()).done;){var o=r.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}catch(e){i.e(e)}finally{i.f()}}else this[t]=n[t]},[{key:"addToError",value:function(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,"$&".concat(t.input.from,":").concat(t.start.line,":").concat(t.start.column,"$&"))),e}},{key:"after",value:function(e){return this.parent.insertAfter(this,e),this}},{key:"assign",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(e in t)this[e]=t[e];return this}},{key:"before",value:function(e){return this.parent.insertBefore(this,e),this}},{key:"cleanRaws",value:function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}},{key:"clone",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=function t(e,n){var r,i,o,a=new e.constructor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r&&(o=_(i=e[r]),"parent"===r&&"object"===o?n&&(a[r]=n):"source"===r?a[r]=i:Array.isArray(i)?a[r]=i.map(function(e){return t(e,a)}):("object"===o&&null!==i&&(i=t(i)),a[r]=i));return a}(this);for(e in t)n[e]=t[e];return n}},{key:"cloneAfter",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertAfter(this,e),e}},{key:"cloneBefore",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertBefore(this,e),e}},{key:"error",value:function(e){var t,n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.source?(t=(n=this.rangeBy(r)).end,this.source.input.error(e,{column:(n=n.start).column,line:n.line},{column:t.column,line:t.line},r)):new i(e)}},{key:"getProxyProcessor",value:function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}},{key:"markDirty",value:function(){if(this[a]){this[a]=!1;for(var e=this;e=e.parent;)e[a]=!1}}},{key:"next",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}},{key:"positionBy",value:function(e,t){var n=this.source.start;return e.index?n=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(n=this.positionInside(e,t)),n}},{key:"positionInside",value:function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?i+=r=1:r+=1;return{column:r,line:i}}},{key:"prev",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}},{key:"rangeBy",value:function(e){var t,n,r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};return e.word?-1!==(n=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(n,t),i=this.positionInside(n+e.word.length,t)):(e.start?r={column:e.start.column,line:e.start.line}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1))),{end:i=i.line<r.line||i.line===r.line&&i.column<=r.column?{column:r.column+1,line:r.line}:i,start:r}}},{key:"raw",value:function(e,t){return(new n).raw(this,e,t)}},{key:"remove",value:function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}},{key:"replaceWith",value:function(){if(this.parent){for(var e=this,t=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];s===this?t=!0:t?(this.parent.insertAfter(e,s),e=s):this.parent.insertBefore(e,s)}t||this.remove()}return this}},{key:"root",value:function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}},{key:"toJSON",value:function(e,t){var n,r,i,o={},a=null==t,s=(t=t||new Map,0);for(n in this)Object.prototype.hasOwnProperty.call(this,n)&&"parent"!==n&&"proxyCache"!==n&&(r=this[n],Array.isArray(r)?o[n]=r.map(function(e){return"object"===_(e)&&e.toJSON?e.toJSON(null,t):e}):"object"===_(r)&&r.toJSON?o[n]=r.toJSON(null,t):"source"===n?(null==(i=t.get(r.input))&&(i=s,t.set(r.input,s),s++),o[n]={end:r.end,inputId:i,start:r.start}):o[n]=r);return a&&(o.inputs=gi(t.keys()).map(function(e){return e.toJSON()})),o}},{key:"toProxy",value:function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r,t=(e.stringify&&(e=e.stringify),"");return e(this,function(e){t+=e}),t}},{key:"warn",value:function(e,t,n){var r,i={node:this};for(r in n)i[r]=n[r];return e.warn(t,i)}},{key:"proxyOf",get:function(){return this}}]),(As=e).default=e),As}function Tl(){var e;return Ls||(Ls=1,li(t,Rl()),e=k(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),(Ds=e).default=e),Ds;function t(e){return b(this,t),(e=ii(this,t,[e=e&&void 0!==e.value&&"string"!=typeof e.value?Ae(Ae({},e),{},{value:String(e.value)}):e])).type="decl",e}}function Ol(){var r,i,t,n,o,a,e;return zs||(zs=1,r=m.SourceMapConsumer,i=m.SourceMapGenerator,t=m.existsSync,n=m.readFileSync,o=m.dirname,a=m.join,e=k(function e(t,n){b(this,e),!1!==n.map&&(this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:"),t=n.map?n.map.prev:void 0,t=this.loadMap(n.from,t),!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=o(this.mapFile)),t)&&(this.text=t)},[{key:"consumer",value:function(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}},{key:"decodeInline",value:function(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}},{key:"getAnnotationURL",value:function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}},{key:"isMap",value:function(e){return"object"===_(e)&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}},{key:"loadAnnotation",value:function(e){var t,n=e.match(/\/\*\s*# sourceMappingURL=/gm);n&&(n=e.lastIndexOf(n.pop()),t=e.indexOf("*/",n),-1<n)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(n,t)))}},{key:"loadFile",value:function(e){if(this.root=o(e),t(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}},{key:"loadMap",value:function(e,t){if(!1===t)return!1;if(!t)return this.inline?this.decodeInline(this.annotation):this.annotation?(n=this.annotation,e&&(n=a(o(e),n)),this.loadFile(n)):void 0;if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){t=this.loadFile(n);if(t)return t;throw new Error("Unable to load previous source map: "+n.toString())}}},{key:"startWith",value:function(e,t){return!!e&&e.substr(0,t.length)===t}},{key:"withContent",value:function(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}}]),(Us=e).default=e),Us}function xl(){var e,a,l,s,r,i,t,u,o,c,d,f,n;return js||(js=1,n=m.SourceMapConsumer,e=m.SourceMapGenerator,a=m.fileURLToPath,l=m.pathToFileURL,s=m.isAbsolute,r=m.resolve,i=(Fs?Ns:(Fs=1,Ns={nanoid:function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:21;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e},customAlphabet:function(n){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:21;return function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r;t--;)e+=n[Math.random()*n.length|0];return e}}})).nanoid,t=m,u=Rs(),o=Ol(),c=Symbol("fromOffsetCache"),d=Boolean(n&&e),f=Boolean(r&&s),n=k(function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(b(this,e),null==t||"object"===_(t)&&!t.toString)throw new Error("PostCSS received ".concat(t," instead of CSS string"));this.css=t.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!f||/^\w+:\/\//.test(n.from)||s(n.from)?this.file=n.from:this.file=r(n.from)),f&&d&&(t=new o(this.css,n)).text&&(n=(this.map=t).consumer().file,!this.file)&&n&&(this.file=this.mapResolve(n)),this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)},[{key:"error",value:function(e,t,n){var r,i,o,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},s=(t&&"object"===_(t)?(s=n,n="number"==typeof(i=t).offset?(t=(o=this.fromOffset(i.offset)).line,o.col):(t=i.line,i.column),i="number"==typeof s.offset?(r=(o=this.fromOffset(s.offset)).line,o.col):(r=s.line,s.column)):n||(t=(o=this.fromOffset(t)).line,n=o.col),this.origin(t,n,r,i));return(o=s?new u(e,void 0===s.endLine?s.line:{column:s.column,line:s.line},void 0===s.endLine?s.column:{column:s.endColumn,line:s.endLine},s.source,s.file,a.plugin):new u(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,a.plugin)).input={column:n,endColumn:i,endLine:r,line:t,source:this.css},this.file&&(l&&(o.input.url=l(this.file).toString()),o.input.file=this.file),o}},{key:"fromOffset",value:function(e){if(this[c])n=this[c];else{for(var t=this.css.split("\n"),n=new Array(t.length),r=0,i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;this[c]=n}var a=0;if(e>=n[n.length-1])a=n.length-1;else for(var s,l=n.length-2;a<l;)if(e<n[s=a+(l-a>>1)])l=s-1;else{if(!(e>=n[s+1])){a=s;break}a=s+1}return{col:e-n[a]+1,line:a+1}}},{key:"mapResolve",value:function(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}},{key:"origin",value:function(e,t,n,r){if(!this.map)return!1;var i,o=this.map.consumer(),t=o.originalPositionFor({column:t,line:e});if(!t.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n}));e=s(t.source)?l(t.source):new URL(t.source,this.map.consumer().sourceRoot||l(this.map.mapFile)),r={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:e.toString()};if("file:"===e.protocol){if(!a)throw new Error("file: protocol is not available in this PostCSS build");r.file=a(e)}n=o.sourceContentFor(t.source);return n&&(r.source=n),r}},{key:"toJSON",value:function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=Ae({},this.map),e.map.consumerCache)&&(e.map.consumerCache=void 0),e}},{key:"from",get:function(){return this.file||this.id}}]),(Bs=n).default=n,t&&t.registerInput&&t.registerInput(n)),Bs}function Ml(){if(Hs)return Ws;Hs=1;var a=m.SourceMapConsumer,t=m.SourceMapGenerator,s=m.dirname,n=m.relative,r=m.resolve,i=m.sep,o=m.pathToFileURL,l=xl(),e=Boolean(a&&t),u=Boolean(s&&r&&n&&i);return Ws=k(function e(t,n,r,i){b(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map},[{key:"addAnnotation",value:function(){var e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map",t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}},{key:"applyPrevMaps",value:function(){var e,t=Ie(this.previous());try{for(t.s();!(e=t.n()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||s(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new a(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}}catch(e){t.e(e)}finally{t.f()}}},{key:"clearAnnotation",value:function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;0<=t;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}},{key:"generate",value:function(){var t;return this.clearAnnotation(),u&&e&&this.isMap()?this.generateMap():(t="",this.stringify(this.root,function(e){t+=e}),[t])}},{key:"generateMap",value:function(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}},{key:"generateString",value:function(){var r=this;this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});var i,o=1,a=1,s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(e,t,n){r.css+=e,t&&"end"!==n&&(s.generated.line=o,s.generated.column=a-1,t.source&&t.source.start?(s.source=r.sourcePath(t),s.original.line=t.source.start.line,s.original.column=t.source.start.column-1):(s.source="<no source>",s.original.line=1,s.original.column=0),r.map.addMapping(s)),(i=e.match(/\n/g))?(o+=i.length,i=e.lastIndexOf("\n"),a=e.length-i):a+=e.length,t&&"start"!==n&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(s.source=r.sourcePath(t),s.original.line=t.source.end.line,s.original.column=t.source.end.column-1,s.generated.line=o,s.generated.column=a-2):(s.source="<no source>",s.original.line=1,s.original.column=0,s.generated.line=o,s.generated.column=a-1),r.map.addMapping(s))})}},{key:"isAnnotation",value:function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))}},{key:"isInline",value:function(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))}},{key:"isMap",value:function(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}},{key:"isSourcesContent",value:function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})}},{key:"outputFile",value:function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}},{key:"path",value:function(e){var t;return this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e)?e:this.memoizedPaths.get(e)||(t=this.opts.to?s(this.opts.to):".","string"==typeof this.mapOpts.annotation&&(t=s(r(t,this.mapOpts.annotation))),t=n(t,e),this.memoizedPaths.set(e,t),t)}},{key:"previous",value:function(){var e,t=this;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(function(e){e.source&&e.source.input.map&&(e=e.source.input.map,t.previousMaps.includes(e)||t.previousMaps.push(e))}):(e=new l(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}},{key:"setSourcesContent",value:function(){var e,n=this,r={};this.root?this.root.walk(function(e){var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=n.usesFileUrls?n.toFileUrl(t):n.toUrl(n.path(t)),n.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}},{key:"sourcePath",value:function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}},{key:"toBase64",value:function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}},{key:"toFileUrl",value:function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(o)return t=o(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}},{key:"toUrl",value:function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===i&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}}])}function Il(){var e;return Vs||(Vs=1,li(t,Rl()),e=k(t),(qs=e).default=e),qs;function t(e){return b(this,t),(e=ii(this,t,[e])).type="comment",e}}function Al(){var u,c,d,t,e,f,h,p,m,n;return Zs||(Zs=1,e=Sl(),f=e.isClean,h=e.my,p=Tl(),m=Il(),li(v,Rl()),(n=k(v,[{key:"append",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o,a=i[r],s=Ie(this.normalize(a,this.last));try{for(s.s();!(o=s.n()).done;){var l=o.value;this.proxyOf.nodes.push(l)}}catch(e){s.e(e)}finally{s.f()}}return this.markDirty(),this}},{key:"cleanRaws",value:function(e){if(vi(v,"cleanRaws",this,3)([e]),this.nodes){var t,n=Ie(this.nodes);try{for(n.s();!(t=n.n()).done;)t.value.cleanRaws(e)}catch(e){n.e(e)}finally{n.f()}}}},{key:"each",value:function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}}},{key:"every",value:function(e){return this.nodes.every(e)}},{key:"getIterator",value:function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}},{key:"getProxyProcessor",value:function(){return{get:function(r,o){return"proxyOf"===o?r:r[o]&&("each"===o||"string"==typeof o&&o.startsWith("walk")?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r[o].apply(r,gi(t.map(function(n){return"function"==typeof n?function(e,t){return n(e.toProxy(),t)}:n})))}:"every"===o||"some"===o?function(i){return r[o](function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return i.apply(void 0,[e.toProxy()].concat(n))})}:"root"===o?function(){return r.root().toProxy()}:"nodes"===o?r.nodes.map(function(e){return e.toProxy()}):"first"===o||"last"===o?r[o].toProxy():r[o])},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}},{key:"index",value:function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}},{key:"insertAfter",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o+1,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"insertBefore",value:function(e,t){var n,r,i,o=this.index(e),a=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e),s=Ie(a);try{for(s.s();!(n=s.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o,0,l)}}catch(e){s.e(e)}finally{s.f()}for(i in this.indexes)o<=(r=this.indexes[i])&&(this.indexes[i]=r+a.length);return this.markDirty(),this}},{key:"normalize",value:function(e,t){var n=this;if("string"==typeof e)e=function t(e){return e.map(function(e){return e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e})}(u(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){var r,i=Ie(e=e.slice(0));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.parent&&o.parent.removeChild(o,"ignore")}}catch(e){i.e(e)}finally{i.f()}}else if("root"===e.type&&"document"!==this.type){var a,s=Ie(e=e.nodes.slice(0));try{for(s.s();!(a=s.n()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}}catch(e){s.e(e)}finally{s.f()}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new p(e)]}else if(e.selector)e=[new c(e)];else if(e.name)e=[new d(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new m(e)]}return e.map(function(e){return e[h]||v.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[f]&&function e(t){if(t[f]=!1,t.proxyOf.nodes){var n,r=Ie(t.proxyOf.nodes);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(e){r.e(e)}finally{r.f()}}}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=n.proxyOf,e})}},{key:"prepend",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Ie(t=t.reverse());try{for(i.s();!(r=i.n()).done;){var o,a,s=r.value,l=this.normalize(s,this.first,"prepend").reverse(),u=Ie(l);try{for(u.s();!(o=u.n()).done;){var c=o.value;this.proxyOf.nodes.unshift(c)}}catch(e){u.e(e)}finally{u.f()}for(a in this.indexes)this.indexes[a]=this.indexes[a]+l.length}}catch(e){i.e(e)}finally{i.f()}return this.markDirty(),this}},{key:"push",value:function(e){return(e.parent=this).proxyOf.nodes.push(e),this}},{key:"removeAll",value:function(){var e,t=Ie(this.proxyOf.nodes);try{for(t.s();!(e=t.n()).done;)e.value.parent=void 0}catch(e){t.e(e)}finally{t.f()}return this.proxyOf.nodes=[],this.markDirty(),this}},{key:"removeChild",value:function(e){var t,n;for(n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}},{key:"replaceValues",value:function(t,n,r){return r||(r=n,n={}),this.walkDecls(function(e){n.props&&!n.props.includes(e.prop)||n.fast&&!e.value.includes(n.fast)||(e.value=e.value.replace(t,r))}),this.markDirty(),this}},{key:"some",value:function(e){return this.nodes.some(e)}},{key:"walk",value:function(r){return this.each(function(t,e){var n;try{n=r(t,e)}catch(e){throw t.addToError(e)}return n=!1!==n&&t.walk?t.walk(r):n})}},{key:"walkAtRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("atrule"===e.type&&n.test(e.name))return r(e,t)}):this.walk(function(e,t){if("atrule"===e.type&&e.name===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("atrule"===e.type)return r(e,t)}))}},{key:"walkComments",value:function(n){return this.walk(function(e,t){if("comment"===e.type)return n(e,t)})}},{key:"walkDecls",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("decl"===e.type&&n.test(e.prop))return r(e,t)}):this.walk(function(e,t){if("decl"===e.type&&e.prop===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("decl"===e.type)return r(e,t)}))}},{key:"walkRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("rule"===e.type&&n.test(e.selector))return r(e,t)}):this.walk(function(e,t){if("rule"===e.type&&e.selector===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("rule"===e.type)return r(e,t)}))}},{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}])).registerParse=function(e){u=e},n.registerRule=function(e){c=e},n.registerAtRule=function(e){d=e},n.registerRoot=function(e){t=e},((Gs=n).default=n).rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,d.prototype):"rule"===e.type?Object.setPrototypeOf(e,c.prototype):"decl"===e.type?Object.setPrototypeOf(e,p.prototype):"comment"===e.type?Object.setPrototypeOf(e,m.prototype):"root"===e.type&&Object.setPrototypeOf(e,t.prototype),e[h]=!0,e.nodes&&e.nodes.forEach(function(e){n.rebuild(e)})}),Gs;function v(){return b(this,v),ii(this,v,arguments)}}function Pl(){var t,n,e;return Ks||(Ks=1,li(r,Al()),(e=k(r,[{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},e.registerProcessor=function(e){n=e},(Js=e).default=e),Js;function r(e){return b(this,r),(e=ii(this,r,[Ae({type:"document"},e)])).nodes||(e.nodes=[]),e}}function Dl(){if(Xs)return $s;Xs=1;var t={};return $s=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}}function Ll(){var e;return Qs||(Qs=1,e=k(function e(t){var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(n in b(this,e),this.type="warning",this.text=t,r.node&&r.node.source&&(t=r.node.rangeBy(r),this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column),r)this[n]=r[n]},[{key:"toString",value:function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}]),(Ys=e).default=e),Ys}function Nl(){var n,e;return tl||(tl=1,n=Ll(),e=k(function e(t,n,r){b(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0},[{key:"toString",value:function(){return this.css}},{key:"warn",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin),new n(e,t));return this.messages.push(e),e}},{key:"warnings",value:function(){return this.messages.filter(function(e){return"warning"===e.type})}},{key:"content",get:function(){return this.css}}]),(el=e).default=e),el}function Fl(){var e,t;return ol||(ol=1,li(r,e=Al()),t=k(r,[{key:"append",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return vi(r,"append",this,3)(t)}},{key:"prepend",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return vi(r,"prepend",this,3)(t)}}]),(il=t).default=t,e.registerAtRule(t)),il;function r(e){return b(this,r),(e=ii(this,r,[e])).type="atrule",e}}function Ul(){var t,n,e,r;return sl||(sl=1,li(a,e=Al()),(r=k(a,[{key:"normalize",value:function(e,t,n){var r=vi(a,"normalize",this,3)([e]);if(t)if("prepend"===n)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;)i.value.raws.before=t.raws.before}catch(e){o.e(e)}finally{o.f()}}return r}},{key:"removeChild",value:function(e,t){var n=this.index(e);return!t&&0===n&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[n].raws.before),vi(a,"removeChild",this,3)([e])}},{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},r.registerProcessor=function(e){n=e},al=r,e.registerRoot(r.default=r)),al;function a(e){return b(this,a),(e=ii(this,a,[e])).type="root",e.nodes||(e.nodes=[]),e}}function zl(){var t;return ul||(ul=1,(ll=t={comma:function(e){return t.split(e,[","],!0)},space:function(e){return t.split(e,[" ","\n","\t"])},split:function(e,t,n){var r,i=[],o="",a=!1,s=0,l=!1,u="",c=!1,d=Ie(e);try{for(d.s();!(r=d.n()).done;){var f=r.value;c?c=!1:"\\"===f?c=!0:l?f===u&&(l=!1):'"'===f||"'"===f?(l=!0,u=f):"("===f?s+=1:")"===f?0<s&&--s:0===s&&t.includes(f)&&(a=!0),a?(""!==o&&i.push(o.trim()),o="",a=!1):o+=f}}catch(e){d.e(e)}finally{d.f()}return!n&&""===o||i.push(o.trim()),i}}).default=t),ll}function Bl(){var e,t,n;return dl||(dl=1,e=Al(),t=zl(),li(r,e),n=k(r,[{key:"selectors",get:function(){return t.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}}]),(cl=n).default=n,e.registerRule(n)),cl;function r(e){return b(this,r),(e=ii(this,r,[e])).type="rule",e.nodes||(e.nodes=[]),e}}function jl(){if(hl)return fl;hl=1;var p=Tl(),e=(()=>{if(rl)return nl;rl=1;var w="'".charCodeAt(0),b='"'.charCodeAt(0),k="\\".charCodeAt(0),_="/".charCodeAt(0),S="\n".charCodeAt(0),E=" ".charCodeAt(0),C="\f".charCodeAt(0),R="\t".charCodeAt(0),T="\r".charCodeAt(0),O="[".charCodeAt(0),x="]".charCodeAt(0),M="(".charCodeAt(0),I=")".charCodeAt(0),A="{".charCodeAt(0),P="}".charCodeAt(0),D=";".charCodeAt(0),L="*".charCodeAt(0),N=":".charCodeAt(0),F="@".charCodeAt(0),U=/[\t\n\f\r "#'()/;[\\\]{}]/g,z=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,B=/.[\r\n"'(/\\]/,j=/[\da-f]/i;return nl=function(t){var r,i,o,a,s,l,u,c,d,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},f=t.css.valueOf(),h=e.ignoreErrors,p=f.length,m=0,v=[],g=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&p<=m},nextToken:function(e){if(g.length)return g.pop();if(!(p<=m)){var t=!!e&&e.ignoreUnclosed;switch(r=f.charCodeAt(m)){case S:case E:case R:case T:case C:for(i=m;i+=1,(r=f.charCodeAt(i))===E||r===S||r===R||r===T||r===C;);d=["space",f.slice(m,i)],m=i-1;break;case O:case x:case A:case P:case N:case D:case I:var n=String.fromCharCode(r);d=[n,n,m];break;case M:if(u=v.length?v.pop()[1]:"",c=f.charCodeAt(m+1),"url"===u&&c!==w&&c!==b&&c!==E&&c!==S&&c!==R&&c!==C&&c!==T){i=m;do{if(s=!1,-1===(i=f.indexOf(")",i+1))){if(h||t){i=m;break}y("bracket")}for(l=i;f.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["brackets",f.slice(m,i+1),m,i],m=i}else i=f.indexOf(")",m+1),u=f.slice(m,i+1),-1===i||B.test(u)?d=["(","(",m]:(d=["brackets",u,m,i],m=i);break;case w:case b:o=r===w?"'":'"',i=m;do{if(s=!1,-1===(i=f.indexOf(o,i+1))){if(h||t){i=m+1;break}y("string")}for(l=i;f.charCodeAt(l-1)===k;)--l,s=!s}while(s);d=["string",f.slice(m,i+1),m,i],m=i;break;case F:U.lastIndex=m+1,U.test(f),i=0===U.lastIndex?f.length-1:U.lastIndex-2,d=["at-word",f.slice(m,i+1),m,i],m=i;break;case k:for(i=m,a=!0;f.charCodeAt(i+1)===k;)i+=1,a=!a;if(r=f.charCodeAt(i+1),a&&r!==_&&r!==E&&r!==S&&r!==R&&r!==T&&r!==C&&(i+=1,j.test(f.charAt(i)))){for(;j.test(f.charAt(i+1));)i+=1;f.charCodeAt(i+1)===E&&(i+=1)}d=["word",f.slice(m,i+1),m,i],m=i;break;default:m=(r===_&&f.charCodeAt(m+1)===L?(0===(i=f.indexOf("*/",m+2)+1)&&(h||t?i=f.length:y("comment")),d=["comment",f.slice(m,i+1),m,i]):(z.lastIndex=m+1,z.test(f),i=0===z.lastIndex?f.length-1:z.lastIndex-2,d=["word",f.slice(m,i+1),m,i],v.push(d)),i)}return m++,d}},position:function(){return m}}}})(),n=Il(),u=Fl(),r=Ul(),i=Bl(),f={empty:!0,space:!0};return fl=k(function e(t){b(this,e),this.input=t,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}},[{key:"atrule",value:function(e){var t,n,r,i=new u;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,a=!1,s=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(0<s.length){for(n=s[r=s.length-1];n&&"space"===n[0];)n=s[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}}if(s.push(e),this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(i.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(i,"params",s),o&&(e=s[s.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}},{key:"checkMissedSemicolon",value:function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;0<=i&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}}},{key:"colon",value:function(e){var t,n,r,i,o=0,a=Ie(e.entries());try{for(a.s();!(i=a.n()).done;){var s=Pe(i.value,2),l=s[0];if("("===(n=(t=s[1])[0])&&(o+=1),")"===n&&--o,0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}}catch(e){a.e(e)}finally{a.f()}return!1}},{key:"comment",value:function(e){var t=new n,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}},{key:"createTokenizer",value:function(){this.tokenizer=e(this.input)}},{key:"decl",value:function(e,t){var n=new p;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||(e=>{for(var t=e.length-1;0<=t;t--){var n=e[t],n=n[3]||n[2];if(n)return n}})(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var a,s=[];e.length&&("space"===(a=e[0][0])||"comment"===a);)s.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;0<=l;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var u=this.stringFrom(e,l);" !important"!==(u=this.spacesFromEnd(e)+u)&&(n.raws.important=u);break}if("important"===r[1].toLowerCase()){for(var c=e.slice(0),d="",f=l;0<f;f--){var h=c[f][0];if(0===d.trim().indexOf("!")&&"space"!==h)break;d=c.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=c)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=s.map(function(e){return e[1]}).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}},{key:"doubleColon",value:function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}},{key:"emptyRule",value:function(e){var t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}},{key:"end",value:function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}},{key:"endFile",value:function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}},{key:"freeSemicolon",value:function(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}},{key:"getPosition",value:function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}},{key:"init",value:function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}},{key:"other",value:function(e){for(var t,n=!1,r=!1,i=null,o=[],a=e[1].startsWith("--"),s=[],l=e;l;){if(t=l[0],s.push(l),"("===t||"["===t)i=i||l,o.push("("===t?")":"]");else if(a&&r&&"{"===t)i=i||l,o.push("}");else if(0===o.length){if(";"===t){if(r)return void this.decl(s,a);break}if("{"===t)return void this.rule(s);if("}"===t){this.tokenizer.back(s.pop()),n=!0;break}":"===t&&(r=!0)}else t===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),0<o.length&&this.unclosedBracket(i),n&&r){if(!a)for(;s.length&&("space"===(l=s[s.length-1][0])||"comment"===l);)this.tokenizer.back(s.pop());this.decl(s,a)}else this.unknownWord(s)}},{key:"parse",value:function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}},{key:"precheckMissedSemicolon",value:function(){}},{key:"raw",value:function(e,t,n,r){for(var i,o,a,s,l=n.length,u="",c=!0,d=0;d<l;d+=1)"space"===(a=(i=n[d])[0])&&d===l-1&&!r||"comment"===a&&(a=n[d-1]?n[d-1][0]:"empty",o=n[d+1]?n[d+1][0]:"empty",f[a]||f[o]||","===u.slice(-1))?c=!1:u+=i[1];c||(s=n.reduce(function(e,t){return e+t[1]},""),e.raws[t]={raw:s,value:u}),e[t]=u}},{key:"rule",value:function(e){e.pop();var t=new i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"spacesAndCommentsFromEnd",value:function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n}},{key:"spacesAndCommentsFromStart",value:function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n}},{key:"spacesFromEnd",value:function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}},{key:"stringFrom",value:function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}},{key:"unclosedBlock",value:function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}},{key:"unclosedBracket",value:function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}},{key:"unexpectedClose",value:function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}},{key:"unknownWord",value:function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}},{key:"unnamedAtrule",value:function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}])}function Wl(){var e,r,i;return ml||(ml=1,e=Al(),r=jl(),i=xl(),pl=t,e.registerParse(t.default=t)),pl;function t(e,t){var n=new i(e,t),n=new r(n);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}}function Hl(){var d,s,n,r,l,e,i,u,c,t,o,f,h,p,a,m;return gl||(gl=1,e=Sl(),d=e.isClean,s=e.my,n=Ml(),r=Cl(),l=Al(),e=Pl(),i=Dl(),u=Nl(),c=Wl(),t=Ul(),o={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},f={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0},p={},(a=k(function e(t,n,r){var i,o=this;if(b(this,e),this.stringified=!1,this.processed=!1,"object"!==_(n)||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof u)i=w(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var a=c;r.syntax&&(a=r.syntax.parse),(a=r.parser?r.parser:a).parse&&(a=a.parse);try{i=a(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[s]&&l.rebuild(i)}else i=w(n);this.result=new u(t,i,r),this.helpers=Ae(Ae({},p),{},{postcss:p,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===_(e)&&e.prepare?Ae(Ae({},e),e.prepare(o.result)):e})},[{key:"async",value:function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"getAsyncError",value:function(){throw new Error("Use process(css).then(cb) to work with async plugins")}},{key:"handleError",value:function(e,t){var n,r,i,o,a,s=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?s.postcssVersion&&"production"!==process.env.NODE_ENV&&(n=s.postcssPlugin,r=s.postcssVersion,i=this.result.processor.version,o=r.split("."),a=i.split("."),o[0]!==a[0]||parseInt(o[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below."):(e.plugin=s.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}},{key:"prepareVisitors",value:function(){var r=this;this.listeners={};function e(e,t,n){r.listeners[t]||(r.listeners[t]=[]),r.listeners[t].push([e,n])}var t,n=Ie(this.plugins);try{for(n.s();!(t=n.n()).done;){var i=t.value;if("object"===_(i))for(var o in i){if(!f[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event ".concat(o," in ").concat(i.postcssPlugin,". Try to update PostCSS (").concat(this.processor.version," now)."));if(!h[o])if("object"===_(i[o]))for(var a in i[o])e(i,"*"===a?o:o+"-"+a.toLowerCase(),i[o][a]);else"function"==typeof i[o]&&e(i,o,i[o])}}}catch(r){n.e(r)}finally{n.f()}this.hasListener=0<Object.keys(this.listeners).length}},{key:"runAsync",value:(m=ri(fi().m(function e(){var t,i,n,r,o,a,s,l,u,c=this;return fi().w(function(e){for(;;)switch(e.p=e.n){case 0:this.plugin=0,t=0;case 1:if(t<this.plugins.length){if(s=this.plugins[t],v(s=this.runOnRoot(s)))return e.p=2,e.n=3,s;e.n=5}else e.n=6;break;case 3:e.n=5;break;case 4:throw e.p=4,s=e.v,this.handleError(s);case 5:t++,e.n=1;break;case 6:if(this.prepareVisitors(),!this.hasListener){e.n=21;break}i=this.result.root;case 7:if(i[d]){e.n=14;break}i[d]=!0,n=[y(i)];case 8:if(0<n.length){if(v(l=this.visitTick(n)))return e.p=9,e.n=10,l;e.n=12}else e.n=13;break;case 10:e.n=12;break;case 11:throw e.p=11,l=e.v,u=n[n.length-1].node,this.handleError(l,u);case 12:e.n=8;break;case 13:e.n=7;break;case 14:if(!this.listeners.OnceExit){e.n=21;break}r=Ie(this.listeners.OnceExit),e.p=15,a=fi().m(function e(){var t,n,r;return fi().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=Pe(o.value,2),r=n[0],t=n[1],c.result.lastPlugin=r,e.p=1,"document"===i.type)return n=i.nodes.map(function(e){return t(e,c.helpers)}),e.n=2,Promise.all(n);e.n=3;break;case 2:e.n=4;break;case 3:return e.n=4,t(i,c.helpers);case 4:e.n=6;break;case 5:throw e.p=5,r=e.v,c.handleError(r);case 6:return e.a(2)}},e,null,[[1,5]])}),r.s();case 16:if((o=r.n()).done){e.n=18;break}return e.d(pi(a()),17);case 17:e.n=16;break;case 18:e.n=20;break;case 19:e.p=19,u=e.v,r.e(u);case 20:return e.p=20,r.f(),e.f(20);case 21:return this.processed=!0,e.a(2,this.stringify())}},e,this,[[15,19,20,21],[9,11],[2,4]])})),function(){return m.apply(this,arguments)})},{key:"runOnRoot",value:function(t){var e,n=this;this.result.lastPlugin=t;try{return"object"===_(t)&&t.Once?"document"===this.result.root.type?v((e=this.result.root.nodes.map(function(e){return t.Once(e,n.helpers)}))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}},{key:"stringify",value:function(){if(this.error)throw this.error;var e,t;return this.stringified||(this.stringified=!0,this.sync(),t=this.result.opts,e=r,t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify),t=new n(e,this.result.root,this.result.opts).generate(),this.result.css=t[0],this.result.map=t[1]),this.result}},{key:"sync",value:function(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();var e,t=Ie(this.plugins);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(v(this.runOnRoot(n)))throw this.getAsyncError()}}catch(e){t.e(e)}finally{t.f()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[d];)r[d]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type){var i,o=Ie(r.nodes);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.visitSync(this.listeners.OnceExit,a)}}catch(e){o.e(e)}finally{o.f()}}else this.visitSync(this.listeners.OnceExit,r)}}return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this.css}},{key:"visitSync",value:function(e,t){var n,r=Ie(e);try{for(r.s();!(n=r.n()).done;){var i=Pe(n.value,2),o=i[0],a=i[1],s=(this.result.lastPlugin=o,void 0);try{s=a(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(v(s))throw this.getAsyncError()}}catch(e){r.e(e)}finally{r.f()}}},{key:"visitTick",value:function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(0<r.length&&t.visitorIndex<r.length){var i=Pe(r[t.visitorIndex],2),o=i[0],i=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){for(var a,s=t.iterator;a=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!a[d])return a[d]=!0,void e.push(y(a));t.iterator=0,delete n.indexes[s]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}},{key:"walkSync",value:function(e){var t=this;e[d]=!0;var n,r=Ie(g(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[d]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}}catch(e){r.e(e)}finally{r.f()}}},{key:"warnings",value:function(){return this.sync().warnings()}},{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}])).registerPostcss=function(e){p=e},vl=a,t.registerLazyResult(a.default=a),e.registerLazyResult(a)),vl;function v(e){return"object"===_(e)&&"function"==typeof e.then}function g(e){var t=!1,n=o[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function y(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:g(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function w(e){return e[d]=!1,e.nodes&&e.nodes.forEach(w),e}}s||(s=1,ql=Rs(),Vl=Tl(),Jh=Hl(),c=Al(),nh||(nh=1,kp||(kp=1,cu=Ml(),du=Cl(),fu=Dl(),hu=Wl(),pu=Nl(),mu=k(function e(t,n,r){b(this,e),n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;var t=du,i=(this.result=new pu(this._processor,void 0,this._opts),this.result.css=n,this),r=(Object.defineProperty(this.result,"root",{get:function(){return i.root}}),new cu(t,void 0,this._opts,n));r.isMap()?(n=(t=Pe(r.generate(),2))[0],t=t[1],n&&(this.result.css=n),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)},[{key:"async",value:function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"sync",value:function(){if(this.error)throw this.error;return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||fu("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."),this.async().then(e,t)}},{key:"toString",value:function(){return this._css}},{key:"warnings",value:function(){return[]}},{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=hu;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),(yl=mu).default=mu),au=yl,su=Hl(),mu=Pl(),lu=Ul(),uu=k(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];b(this,e),this.version="8.4.38",this.plugins=this.normalize(t)},[{key:"normalize",value:function(e){var t,n=[],r=Ie(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===_(i)&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===_(i)&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else{if("object"!==_(i)||!i.parse&&!i.stringify)throw new Error(i+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"process",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new(this.plugins.length||t.parser||t.stringifier||t.syntax?su:au)(this,e,t)}},{key:"use",value:function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}]),(wl=uu).default=uu,lu.registerProcessor(uu),mu.registerProcessor(uu)),Gl=wl,lu=Cl(),vu||(vu=1,Ql=Tl(),eu=Ol(),tu=Il(),nu=Fl(),ru=xl(),iu=Ul(),ou=Bl(),(bl=gu).default=gu),uu=bl,Zl=Pl(),v=Ll(),Jl=Il(),Kl=Fl(),$l=Nl(),y=xl(),i=Wl(),s=zl(),Xl=Bl(),Yl=Ul(),nh=Rl(),a.plugin=function(t,n){var e,r=!1;function i(){console&&console.warn&&!r&&(r=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");var e=n.apply(void 0,arguments);return e.postcssPlugin=t,e.postcssVersion=(new Gl).version,e}return Object.defineProperty(i,"postcss",{get:function(){return e=e||i()}}),i.process=function(e,t,n){return a([i(n)]).process(e,t)},i},a.stringify=lu,a.parse=i,a.fromJSON=uu,a.list=s,a.comment=function(e){return new Jl(e)},a.atRule=function(e){return new Kl(e)},a.decl=function(e){return new Vl(e)},a.rule=function(e){return new Xl(e)},a.root=function(e){return new Yl(e)},a.document=function(e){return new Zl(e)},a.CssSyntaxError=ql,a.Declaration=Vl,a.Container=c,a.Processor=Gl,a.Document=Zl,a.Comment=Jl,a.Warning=v,a.AtRule=Kl,a.Result=$l,a.Input=y,a.Rule=Xl,a.Root=Yl,a.Node=nh,Jh.registerPostcss(a),(kl=a).default=a);var ql,Vl,Gl,Zl,Jl,Kl,$l,Xl,Yl,Ql,eu,tu,nu,ru,iu,ou,au,su,lu,uu,cu,du,fu,hu,pu,mu,vu=(kp=kl)&&kp.__esModule&&Object.prototype.hasOwnProperty.call(kp,"default")?kp.default:kp;function gu(e,t){if(Array.isArray(e))return e.map(function(e){return gu(e)});var n,r=e.inputs,i=di(e,Ei);if(r){t=[];var o,a=Ie(r);try{for(a.s();!(o=a.n()).done;){var s=Ae(Ae({},o.value),{},{__proto__:ru.prototype});s.map&&(s.map=Ae(Ae({},s.map),{},{__proto__:eu.prototype})),t.push(s)}}catch(e){a.e(e)}finally{a.f()}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return gu(e,t)})),i.source&&(n=(r=i.source).inputId,r=di(r,Ci),i.source=r,null!=n)&&(i.source.input=t[n]),"root"===i.type)return new iu(i);if("decl"===i.type)return new Ql(i);if("rule"===i.type)return new ou(i);if("comment"===i.type)return new tu(i);if("atrule"===i.type)return new nu(i);throw new Error("Unknown node type: "+e.type)}function a(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new Gl(t)}vu.stringify;var yu=k(Su,[{key:"childNodes",get:function(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}},{key:"contains",value:function(e){if(e instanceof Su&&e.ownerDocument===this.ownerDocument){if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}}return!1}},{key:"appendChild",value:function(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}},{key:"insertBefore",value:function(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}},{key:"removeChild",value:function(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}},{key:"toString",value:function(){return"RRNode"}}]),wu={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},bu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ku={},_u={};function Su(){b(this,Su),gs(this,"parentElement",null),gs(this,"parentNode",null),gs(this,"ownerDocument"),gs(this,"firstChild",null),gs(this,"lastChild",null),gs(this,"previousSibling",null),gs(this,"nextSibling",null),gs(this,"ELEMENT_NODE",1),gs(this,"TEXT_NODE",3),gs(this,"nodeType"),gs(this,"nodeName"),gs(this,"RRNodeType")}function Eu(e){if(ku[e])return ku[e];var t=globalThis[e],n=t.prototype,r=e in wu?wu[e]:void 0,r=Boolean(r&&r.every(function(e){return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(n,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),i=e in bu?bu[e]:void 0,i=Boolean(i&&i.every(function(e){return"function"==typeof n[e]&&(null==(e=n[e])?void 0:e.toString().includes("[native code]"))}));if(r&&i&&!globalThis.Zone)return ku[e]=t.prototype,t.prototype;try{var o,a,s=document.createElement("iframe"),l=(s.style.display="none",document.body.appendChild(s),s.contentWindow);return l?(o=l[e].prototype)?((a=navigator.userAgent).includes("Safari")&&!a.includes("Chrome")?(s.classList.add("rr-block"),s.setAttribute("__rrwebUntaintedMutationObserver",""),_u[e]=function(){return s.remove()}):s.remove(),ku[e]=o):(s.remove(),n):t.prototype}catch(e){return n}}var Cu={};function Ru(e,t,n){var r="".concat(e,".").concat(String(n));return Cu[r]?Cu[r].call(t):(e=Eu(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,n))?void 0:e.get)?(Cu[r]=e).call(t):t[n])}var Tu={};function Ou(e,t,n){var r="".concat(e,".").concat(String(n));return Tu[r]?Tu[r].bind(t):"function"!=typeof(e=Eu(e)[n])?t[n]:(Tu[r]=e).bind(t)}function xu(){var e;return[Eu("MutationObserver").constructor,null!=(e=_u.MutationObserver)?e:function(){}]}var Mu=Date.now;function Iu(e,t,n){try{var r,i;return t in e?("function"==typeof(i=n(r=e[t]))&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}):function(){}}catch(e){return function(){}}}var De={ownerDocument:function(e){return Ru("Node",e,"ownerDocument")},childNodes:function(e){return Ru("Node",e,"childNodes")},parentNode:function(e){return Ru("Node",e,"parentNode")},parentElement:function(e){return Ru("Node",e,"parentElement")},textContent:function(e){return Ru("Node",e,"textContent")},contains:function(e,t){return Ou("Node",e,"contains")(t)},getRootNode:function(e){return Ou("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ru("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ru("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ru("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ru("Element",e,"querySelectorAll")(t)},nowTimestamp:Mu=/[1-9][0-9]{12}/.test(Date.now().toString())?Mu:function(){return(new Date).getTime()},mutationObserverCtor:xu,patch:Iu};function Au(e,t,n){var r=2<arguments.length&&void 0!==n?n:document,i={capture:!0,passive:!0};return r.addEventListener(e,t,i),function(){return r.removeEventListener(e,t,i)}}var Pu="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",i={map:{},getId:function(){return console.error(Pu),-1},getNode:function(){return console.error(Pu),null},removeNodeFromMap:function(){console.error(Pu)},has:function(){return console.error(Pu),!1},reset:function(){console.error(Pu)}};function Du(a,s,e){var l=2<arguments.length&&void 0!==e?e:{},u=null,c=0;return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Date.now(),i=(c||!1!==l.leading||(c=r),s-(r-c)),o=this;i<=0||s<i?(u&&(clearTimeout(u),u=null),c=r,a.apply(o,t)):u||!1===l.trailing||(u=setTimeout(function(){c=!1===l.leading?0:Date.now(),u=null,a.apply(o,t)},i))}}function Lu(e,t,n,r,i){var i=4<arguments.length&&void 0!==i?i:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return Lu(e,t,o||{},!0)}}function Nu(e){var t,n=e.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:n.documentElement.scrollLeft||(null==n?void 0:n.body)&&(null==(t=De.parentElement(n.body))?void 0:t.scrollLeft)||(null==(t=null==n?void 0:n.body)?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==n?void 0:n.documentElement.scrollTop)||(null==n?void 0:n.body)&&(null==(t=De.parentElement(n.body))?void 0:t.scrollTop)||(null==(e=null==n?void 0:n.body)?void 0:e.scrollTop)||0}}function Fu(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Uu(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function zu(e){return e?e.nodeType===e.ELEMENT_NODE?e:De.parentElement(e):null}function Bu(e,t,n,r){if(e){var i=zu(e);if(i){try{if("string"==typeof t){if(i.classList.contains(t))return 1;if(r&&null!==i.closest("."+t))return 1}else if(mo(i,t,r))return 1}catch(e){}if(n){if(i.matches(n))return 1;if(r&&null!==i.closest(n))return 1}}}}function ju(e,t,n){return"TITLE"===e.tagName&&n.headTitleMutations||-2===t.getId(e)}function Wu(e){return Boolean(e.changedTouches)}function Hu(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function qu(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Vu(e){return e&&(e instanceof yu&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(De.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&new Proxy(i,{get:function(e,t,n){return"map"===t&&console.error(Pu),Reflect.get(e,t,n)}});var Gu=k(function e(){b(this,e),u(this,"id",1),u(this,"styleIDMap",new WeakMap),u(this,"idStyleMap",new Map)},[{key:"getId",value:function(e){return null!=(e=this.styleIDMap.get(e))?e:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(t=void 0===t?this.id++:t,this.styleIDMap.set(e,t),this.idStyleMap.set(t,e),t)}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]);function Zu(e){var t,n=null;return n="getRootNode"in e&&(null==(t=De.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&De.host(De.getRootNode(e))?De.host(De.getRootNode(e)):n}function Ju(n){var e,t=De.ownerDocument(n);return!!t&&(e=(()=>{for(var e,t=n;e=Zu(t);)t=e;return t})(),De.contains(t,e))}function Ku(e){var t=De.ownerDocument(e);return t&&(De.contains(t,e)||Ju(e))}(s={})[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s[s.Asset=7]="Asset";var Y=s,Le=((c=Le||{})[c.Mutation=0]="Mutation",c[c.MouseMove=1]="MouseMove",c[c.MouseInteraction=2]="MouseInteraction",c[c.Scroll=3]="Scroll",c[c.ViewportResize=4]="ViewportResize",c[c.Input=5]="Input",c[c.TouchMove=6]="TouchMove",c[c.MediaInteraction=7]="MediaInteraction",c[c.StyleSheetRule=8]="StyleSheetRule",c[c.CanvasMutation=9]="CanvasMutation",c[c.Font=10]="Font",c[c.Log=11]="Log",c[c.Drag=12]="Drag",c[c.StyleDeclaration=13]="StyleDeclaration",c[c.Selection=14]="Selection",c[c.AdoptedStyleSheet=15]="AdoptedStyleSheet",c[c.CustomElement=16]="CustomElement",c),$u=((v=$u||{})[v.MouseUp=0]="MouseUp",v[v.MouseDown=1]="MouseDown",v[v.Click=2]="Click",v[v.ContextMenu=3]="ContextMenu",v[v.DblClick=4]="DblClick",v[v.Focus=5]="Focus",v[v.Blur=6]="Blur",v[v.TouchStart=7]="TouchStart",v[v.TouchMove_Departed=8]="TouchMove_Departed",v[v.TouchEnd=9]="TouchEnd",v[v.TouchCancel=10]="TouchCancel",v),Xu=((y=Xu||{})[y.Mouse=0]="Mouse",y[y.Pen=1]="Pen",y[y.Touch=2]="Touch",y),Yu=((nh={})[nh["2D"]=0]="2D",nh[nh.WebGL=1]="WebGL",nh[nh.WebGL2=2]="WebGL2",nh),Qu=((Jh=Qu||{})[Jh.Play=0]="Play",Jh[Jh.Pause=1]="Pause",Jh[Jh.Seeked=2]="Seeked",Jh[Jh.VolumeChange=3]="VolumeChange",Jh[Jh.RateChange=4]="RateChange",Jh),ec=((kp={})[kp.Document=0]="Document",kp[kp.DocumentType=1]="DocumentType",kp[kp.Element=2]="Element",kp[kp.Text=3]="Text",kp[kp.CDATA=4]="CDATA",kp[kp.Comment=5]="Comment",kp);function tc(e){return"__ln"in e}function nc(e,t){return"".concat(e,"@").concat(t)}var rc,ic=k(function e(){b(this,e),u(this,"length",0),u(this,"head",null),u(this,"tail",null)},[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t,n={value:e,previous:null,next:null};e.__ln=n,e.previousSibling&&tc(e.previousSibling)?(t=e.previousSibling.__ln.next,n.next=t,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,t&&(t.previous=n)):e.nextSibling&&tc(e.nextSibling)&&e.nextSibling.__ln.previous?(t=e.nextSibling.__ln.previous,n.previous=t,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,t&&(t.next=n)):(this.head&&(this.head.previous=n),n.next=this.head,this.head=n),null===n.next&&(this.tail=n),this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),oc=k(function e(){var w=this;b(this,e),u(this,"frozen",!1),u(this,"locked",!1),u(this,"texts",[]),u(this,"attributes",[]),u(this,"attributeMap",new WeakMap),u(this,"removes",[]),u(this,"mapRemoves",[]),u(this,"movedMap",{}),u(this,"addedSet",new Set),u(this,"movedSet",new Set),u(this,"droppedSet",new Set),u(this,"removesSubTreeCache",new Set),u(this,"mutationCb"),u(this,"blockClass"),u(this,"blockSelector"),u(this,"maskTextClass"),u(this,"maskTextSelector"),u(this,"inlineStylesheet"),u(this,"maskInputOptions"),u(this,"maskTextFn"),u(this,"maskInputFn"),u(this,"keepIframeSrcFn"),u(this,"recordCanvas"),u(this,"inlineImages"),u(this,"slimDOMOptions"),u(this,"dataURLOptions"),u(this,"doc"),u(this,"mirror"),u(this,"iframeManager"),u(this,"stylesheetManager"),u(this,"shadowDomManager"),u(this,"canvasManager"),u(this,"processedNodeManager"),u(this,"unattachedDoc"),u(this,"processMutations",function(e){e.forEach(w.processMutation),w.emit()}),u(this,"emit",function(){if(!w.frozen&&!w.locked){for(var i=[],o=new Set,a=new ic,s=function(e){for(var t=e,n=-2;-2===n;)n=(t=t&&t.nextSibling)&&w.mirror.getId(t);return n},e=function(t){var e=De.parentNode(t);if(e&&Ku(t)){var n=!1;if(t.nodeType===Node.TEXT_NODE){var r=e.tagName;if("TEXTAREA"===r)return;"STYLE"===r&&w.addedSet.has(e)&&(n=!0)}r=ji(e)?w.mirror.getId(Zu(t)):w.mirror.getId(e),e=s(t);if(-1===r||-1===e)return a.addNode(t);n=wo(t,{doc:w.doc,mirror:w.mirror,blockClass:w.blockClass,blockSelector:w.blockSelector,maskTextClass:w.maskTextClass,maskTextSelector:w.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:w.inlineStylesheet,maskInputOptions:w.maskInputOptions,maskTextFn:w.maskTextFn,maskInputFn:w.maskInputFn,slimDOMOptions:w.slimDOMOptions,dataURLOptions:w.dataURLOptions,recordCanvas:w.recordCanvas,inlineImages:w.inlineImages,onSerialize:function(e){Hu(e,w.mirror)&&w.iframeManager.addIframe(e),qu(e,w.mirror)&&w.stylesheetManager.trackLinkElement(e),Vu(t)&&w.shadowDomManager.addShadowRoot(De.shadowRoot(t),w.doc)},onIframeLoad:function(e,t){w.iframeManager.attachIframe(e,t),w.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,t){w.stylesheetManager.attachLinkElement(e,t)},cssCaptured:n});n&&(i.push({parentId:r,nextId:e,node:n}),o.add(n.id))}};w.mapRemoves.length;)w.mirror.removeNodeFromMap(w.mapRemoves.shift());var t,n=Ie(w.movedSet);try{for(n.s();!(t=n.n()).done;){var r=t.value;sc(w.removesSubTreeCache,r,w.mirror)&&!w.movedSet.has(De.parentNode(r))||e(r)}}catch(i){n.e(i)}finally{n.f()}var l,u=Ie(w.addedSet);try{for(u.s();!(l=u.n()).done;){var c=l.value;!lc(w.droppedSet,c)&&!sc(w.removesSubTreeCache,c,w.mirror)||lc(w.movedSet,c)?e(c):w.droppedSet.add(c)}}catch(i){u.e(i)}finally{u.f()}for(var d=null;a.length;){var f,h,p=null;if(!(p=d&&(f=w.mirror.getId(De.parentNode(d.value)),h=s(d.value),-1!==f)&&-1!==h?d:p))for(var m=a.tail;m;){var v=m,m=m.previous;if(v){var g=w.mirror.getId(De.parentNode(v.value));if(-1!==s(v.value)){if(-1!==g){p=v;break}g=v.value,g=De.parentNode(g);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){g=De.host(g);if(-1!==w.mirror.getId(g)){p=v;break}}}}}if(!p){for(;a.head;)a.removeNode(a.head.value);break}d=p.previous,a.removeNode(p.value),e(p.value)}var y={texts:w.texts.map(function(e){var t=e.node,n=De.parentNode(t);return n&&"TEXTAREA"===n.tagName&&w.genTextAreaValueMutation(n),{id:w.mirror.getId(t),value:e.value}}).filter(function(e){return!o.has(e.id)}).filter(function(e){return w.mirror.has(e.id)}),attributes:w.attributes.map(function(e){var t,n,r=e.attributes;return"string"==typeof r.style&&(t=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles),t.length<r.style.length)&&(t+n).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff),{id:w.mirror.getId(e.node),attributes:r}}).filter(function(e){return!o.has(e.id)}).filter(function(e){return w.mirror.has(e.id)}),removes:w.removes,adds:i};(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&(w.texts=[],w.attributes=[],w.attributeMap=new WeakMap,w.removes=[],w.addedSet=new Set,w.movedSet=new Set,w.droppedSet=new Set,w.removesSubTreeCache=new Set,w.movedMap={},w.mutationCb(y))}}),u(this,"genTextAreaValueMutation",function(e){var t=w.attributeMap.get(e),n=(t||(w.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),w.attributeMap.set(e,t)),Array.from(De.childNodes(e),function(e){return De.textContent(e)||""}).join(""));t.attributes.value=Gi({element:e,maskInputOptions:w.maskInputOptions,tagName:e.tagName,type:Ji(e),value:n,maskInputFn:w.maskInputFn})}),u(this,"processMutation",function(a){if(!ju(a.target,w.mirror,w.slimDOMOptions))switch(a.type){case"characterData":var e=De.textContent(a.target);Bu(a.target,w.blockClass,w.blockSelector,!1)||e===a.oldValue||w.texts.push({value:vo(a.target,w.maskTextClass,w.maskTextSelector,!0)&&e?w.maskTextFn?w.maskTextFn(e,zu(a.target)):e.replace(/[\S]/g,"*"):e,node:a.target});break;case"attributes":var t,n=a.target,e=a.attributeName,r=a.target.getAttribute(e);if("value"===e&&(t=Ji(n),r=Gi({element:n,maskInputOptions:w.maskInputOptions,tagName:n.tagName,type:t,value:r,maskInputFn:w.maskInputFn})),!Bu(a.target,w.blockClass,w.blockSelector,!1)&&r!==a.oldValue){var i=w.attributeMap.get(a.target);if("IFRAME"===n.tagName&&"src"===e&&!w.keepIframeSrcFn(r)){if(n.contentDocument)return;e="rr_src"}if(i||(i={node:a.target,attributes:{},styleDiff:{},_unchangedStyles:{}},w.attributes.push(i),w.attributeMap.set(a.target,i)),"type"===e&&"INPUT"===n.tagName&&"password"===(a.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!po(n.tagName,e))if(i.attributes[e]=ho(w.doc,Zi(n.tagName),Zi(e),r),"style"===e){if(!w.unattachedDoc)try{w.unattachedDoc=document.implementation.createHTMLDocument()}catch(a){w.unattachedDoc=w.doc}var o=w.unattachedDoc.createElement("span");a.oldValue&&o.setAttribute("style",a.oldValue);for(var s=0,l=Array.from(n.style);s<l.length;s++){var u=l[s],c=n.style.getPropertyValue(u),d=n.style.getPropertyPriority(u);c!==o.style.getPropertyValue(u)||d!==o.style.getPropertyPriority(u)?i.styleDiff[u]=""===d?c:[c,d]:i._unchangedStyles[u]=[c,d]}for(var f=0,h=Array.from(o.style);f<h.length;f++){var p=h[f];""===n.style.getPropertyValue(p)&&(i.styleDiff[p]=!1)}}else"open"===e&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal")}break;case"childList":return Bu(a.target,w.blockClass,w.blockSelector,!0)?void 0:"TEXTAREA"===a.target.tagName?void w.genTextAreaValueMutation(a.target):(a.addedNodes.forEach(function(e){return w.genAdds(e,a.target)}),void a.removedNodes.forEach(function(e){var t=w.mirror.getId(e),n=ji(a.target)?w.mirror.getId(De.host(a.target)):w.mirror.getId(a.target);if(!Bu(a.target,w.blockClass,w.blockSelector,!1)&&!ju(e,w.mirror,w.slimDOMOptions)&&-1!==w.mirror.getId(e)){if(w.addedSet.has(e))ac(w.addedSet,e),w.droppedSet.add(e);else if(!(w.addedSet.has(a.target)&&-1===t||function e(t,n){var r;return!ji(t)&&(r=n.getId(t),!n.has(r)||(!(r=De.parentNode(t))||r.nodeType!==t.DOCUMENT_NODE)&&(!r||e(r,n)))}(a.target,w.mirror)))if(w.movedSet.has(e)&&w.movedMap[nc(t,n)])ac(w.movedSet,e);else{w.removes.push({parentId:n,id:t,isShadow:!(!ji(a.target)||!Wi(a.target))||void 0});for(var r=w.removesSubTreeCache,i=[e];i.length;){var o=i.pop();r.has(o)||(r.add(o),De.childNodes(o).forEach(function(e){return i.push(e)}))}}w.mapRemoves.push(e)}}))}}),u(this,"genAdds",function(t,e){if(!w.processedNodeManager.inOtherBuffer(t,w)&&!w.addedSet.has(t)&&!w.movedSet.has(t)){if(w.mirror.hasNode(t)){if(ju(t,w.mirror,w.slimDOMOptions))return;w.movedSet.add(t);var n=null;(n=e&&w.mirror.hasNode(e)?w.mirror.getId(e):n)&&-1!==n&&(w.movedMap[nc(w.mirror.getId(t),n)]=!0)}else w.addedSet.add(t),w.droppedSet.delete(t);Bu(t,w.blockClass,w.blockSelector,!1)||(De.childNodes(t).forEach(function(e){return w.genAdds(e)}),Vu(t)&&De.childNodes(De.shadowRoot(t)).forEach(function(e){w.processedNodeManager.add(e,w),w.genAdds(e,t)}))}})},[{key:"init",value:function(t){var n=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(e){n[e]=t[e]})}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]);function ac(t,e){t.delete(e),De.childNodes(e).forEach(function(e){return ac(t,e)})}function sc(e,t){return 0!==e.size&&(e=e,t=De.parentNode(t))&&e.has(t)}function lc(e,t){return 0!==e.size&&function e(t,n){n=De.parentNode(n);return!!n&&(!!t.has(n)||e(t,n))}(e,t)}var Ne=function(e){return rc?function(){try{return e.apply(void 0,arguments)}catch(e){if(!rc||!0!==rc(e))throw e}}:e},uc=[];function cc(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function dc(e,t){var n=new oc,e=(uc.push(n),n.init(e),Pe(xu(),2)),r=e[0],e=e[1],r=new r(Ne(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[r,e]}function fc(e){var t,r,a,s=e.mouseInteractionCb,i=e.doc,l=e.mirror,u=e.blockClass,c=e.blockSelector,e=e.sampling;return!1===e.mouseInteraction?function(){}:(t=!0===e.mouseInteraction||void 0===e.mouseInteraction?{}:e.mouseInteraction,r=[],a=null,Object.keys($u).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==t[e]}).forEach(function(e){function t(e){var t=cc(e);if(!Bu(t,u,c,!0)){var n=null,r=o;if("pointerType"in e){switch(e.pointerType){case"mouse":n=Xu.Mouse;break;case"touch":n=Xu.Touch;break;case"pen":n=Xu.Pen}n===Xu.Touch?$u[o]===$u.MouseDown?r="TouchStart":$u[o]===$u.MouseUp&&(r="TouchEnd"):Xu.Pen}else Wu(e)&&(n=Xu.Touch);null!==n?(a=n,(r.startsWith("Touch")&&n===Xu.Touch||r.startsWith("Mouse")&&n===Xu.Mouse)&&(n=null)):$u[o]===$u.Click&&(n=a,a=null);var i,e=Wu(e)?e.changedTouches[0]:e;e&&(t=l.getId(t),i=e.clientX,e=e.clientY,Ne(s)(Ae({type:$u[r],id:t,x:i,y:e},null!==n&&{pointerType:n})))}}var o,n=Zi(e);o=e;if(window.PointerEvent)switch($u[e]){case $u.MouseDown:case $u.MouseUp:n=n.replace("mouse","pointer");break;case $u.TouchStart:case $u.TouchEnd:return}r.push(Au(n,t,i))}),Ne(function(){r.forEach(function(e){return e()})}))}function hc(e){var r=e.scrollCb,i=e.doc,o=e.mirror,a=e.blockClass,s=e.blockSelector,e=e.sampling;return Au("scroll",Ne(Du(Ne(function(e){var t,n,e=cc(e);e&&!Bu(e,a,s,!0)&&(t=o.getId(e),e===i&&i.defaultView?(n=Nu(i.defaultView),r({id:t,x:n.left,y:n.top})):r({id:t,x:e.scrollLeft,y:e.scrollTop}))}),e.scroll||100)),i)}var pc=["INPUT","TEXTAREA","SELECT"],mc=new WeakMap;function vc(e){return function e(t,n){var r;return bc("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||bc("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||bc("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||bc("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule?(r=Array.from(t.parentRule.cssRules).indexOf(t),n.unshift(r),e(t.parentRule,n)):(t.parentStyleSheet&&(r=Array.from(t.parentStyleSheet.cssRules).indexOf(t),n.unshift(r)),n)}(e,[])}function gc(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function yc(e,t){var n=e.mirror,r=e.stylesheetManager,i="#document"===t.nodeName?n.getId(t):n.getId(De.host(t)),n="#document"===t.nodeName?null==(e=t.defaultView)?void 0:e.Document:null==(e=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:e.ShadowRoot,o=null!=n&&n.prototype?Object.getOwnPropertyDescriptor(null==n?void 0:n.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&n&&o?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:function(){var e;return null==(e=o.get)?void 0:e.call(this)},set:function(e){var t=null==(t=o.set)?void 0:t.call(this,e);if(null!==i&&-1!==i)try{r.adoptStyleSheets(e,i)}catch(e){}return t}}),Ne(function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})})):function(){}}function wc(e){var t,n,L,N,F,U,z,B,j,W,H,q,V,G,r=e.doc.defaultView;if(!r)return function(){};t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=(R=e).mutationCb,L=R.mousemoveCb,N=R.mouseInteractionCb,F=R.scrollCb,U=R.viewportResizeCb,z=R.inputCb,B=R.mediaInteractionCb,j=R.styleSheetRuleCb,W=R.styleDeclarationCb,H=R.canvasMutationCb,q=R.fontCb,V=R.selectionCb,G=R.customElementCb,R.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},R.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),L.apply(void 0,arguments)},R.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),N.apply(void 0,arguments)},R.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),F.apply(void 0,arguments)},R.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),U.apply(void 0,arguments)},R.inputCb=function(){t.input&&t.input.apply(t,arguments),z.apply(void 0,arguments)},R.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),B.apply(void 0,arguments)},R.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),j.apply(void 0,arguments)},R.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),W.apply(void 0,arguments)},R.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),H.apply(void 0,arguments)},R.fontCb=function(){t.font&&t.font.apply(t,arguments),q.apply(void 0,arguments)},R.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),V.apply(void 0,arguments)},R.customElementCb=function(){t.customElement&&t.customElement.apply(t,arguments),G.apply(void 0,arguments)};var i,Z,J,K,$,X,Y,Q,a,ee,te,ne,re,s,l,ie,u,o,c,oe,d,f,h,p,ae,se,le,ue,m,v,g,ce,y,w,b,k,_,S,E,C,de=function(){},fe=(e.recordDOM&&(R=Pe(dc(e,e.doc),2),i=R[0],de=R[1]),le=(R=e).mousemoveCb,O=R.doc,ue=R.mirror,!1===(T=R.sampling).mousemove?function(){}:(R="number"==typeof T.mousemove?T.mousemove:50,T="number"==typeof T.mousemoveCallback?T.mousemoveCallback:500,p=[],ae=Du(Ne(function(e){var t=Date.now()-h;le(p.map(function(e){return e.timeOffset-=t,e}),e),p=[],h=null}),T),T=Ne(Du(Ne(function(e){var t=cc(e),n=Wu(e)?e.changedTouches[0]:e,r=n.clientX,n=n.clientY;h=h||Mu(),p.push({x:r,y:n,id:ue.getId(t),timeOffset:Mu()-h}),ae("undefined"!=typeof DragEvent&&e instanceof DragEvent?Le.Drag:e instanceof MouseEvent?Le.MouseMove:Le.TouchMove)}),R,{trailing:!1})),se=[Au("mousemove",T,O),Au("touchmove",T,O),Au("drag",T,O)],Ne(function(){se.forEach(function(e){return e()})}))),he=fc(e),pe=hc(e),me=(R={win:r},oe=(T=e).viewportResizeCb,T=R.win,f=d=-1,Au("resize",Ne(Du(Ne(function(){var e=Fu(),t=Uu();d===e&&f===t||(oe({width:Number(t),height:Number(e)}),d=e,f=t)}),200)),T)),ve=(Q=(O=e).inputCb,a=O.doc,ee=O.mirror,te=O.blockClass,ne=O.blockSelector,re=O.ignoreClass,s=O.ignoreSelector,l=O.maskInputOptions,ie=O.maskInputFn,u=O.userTriggeredOnInput,o=("last"===O.sampling.input?["change"]:["input","change"]).map(function(e){return Au(e,Ne(_e),a)}),(c=a.defaultView)?(O=c.Object.getOwnPropertyDescriptor(c.HTMLInputElement.prototype,"value"),R=[[c.HTMLInputElement.prototype,"value"],[c.HTMLInputElement.prototype,"checked"],[c.HTMLSelectElement.prototype,"value"],[c.HTMLTextAreaElement.prototype,"value"],[c.HTMLSelectElement.prototype,"selectedIndex"],[c.HTMLOptionElement.prototype,"selected"]],O&&O.set&&o.push.apply(o,gi(R.map(function(e){return Lu(e[0],e[1],{set:function(){Ne(_e)({target:this,isTrusted:!1})}},!1,c)}))),Ne(function(){o.forEach(function(e){return e()})})):function(){o.forEach(function(e){return e()})}),ge=(Z=(T=e).mediaInteractionCb,J=T.blockClass,K=T.blockSelector,$=T.mirror,X=T.sampling,T=T.doc,O=Ne(function(a){return Du(Ne(function(e){var t,n,r,i,o,e=cc(e);e&&!Bu(e,J,K,!0)&&(t=e.currentTime,n=e.volume,r=e.muted,i=e.playbackRate,o=e.loop,Z({type:a,id:$.getId(e),currentTime:t,volume:n,muted:r,playbackRate:i,loop:o}))}),X.media||500)}),Y=[Au("play",O(Qu.Play),T),Au("pause",O(Qu.Pause),T),Au("seeked",O(Qu.Seeked),T),Au("volumechange",O(Qu.VolumeChange),T),Au("ratechange",O(Qu.RateChange),T)],Ne(function(){Y.forEach(function(e){return e()})})),ye=function(){},we=function(){},be=function(){},ke=function(){};function _e(e){var t,n,r,i=cc(e),e=e.isTrusted,o=i&&i.tagName;!(i=i&&"OPTION"===o?De.parentElement(i):i)||!o||pc.indexOf(o)<0||Bu(i,te,ne,!0)||i.classList.contains(re)||s&&i.matches(s)||(t=i.value,n=!1,"radio"===(r=Ji(i)||"")||"checkbox"===r?n=i.checked:(l[o.toLowerCase()]||l[r])&&(t=Gi({element:i,maskInputOptions:l,tagName:o,type:r,value:t,maskInputFn:ie})),Se(i,u?{text:t,isChecked:n,userTriggered:e}:{text:t,isChecked:n}),o=i.name,"radio"===r&&o&&n&&a.querySelectorAll('input[type="radio"][name="'.concat(o,'"]')).forEach(function(e){var t;e!==i&&(t=e.value,Se(e,u?{text:t,isChecked:!n,userTriggered:!1}:{text:t,isChecked:!n}))}))}function Se(e,t){var n=mc.get(e);n&&n.text===t.text&&n.isChecked===t.isChecked||(mc.set(e,t),n=ee.getId(e),Ne(Q)(Ae(Ae({},t),{},{id:n})))}e.recordDOM&&(ye=((e,t)=>{var s=e.styleSheetRuleCb,l=e.mirror,u=e.stylesheetManager,r=t.win;if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return function(){};var n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:Ne(function(e,t,n){var r=Pe(n,2),i=r[0],r=r[1],o=gc(t,l,u.styleMirror),a=o.id,o=o.styleId;return(a&&-1!==a||o&&-1!==o)&&s({id:a,styleId:o,adds:[{rule:i,index:r}]}),e.apply(t,n)})}),r.CSSStyleSheet.prototype.addRule=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.cssRules.length,e="".concat(e," { ").concat(t," }");return r.CSSStyleSheet.prototype.insertRule.apply(this,[e,n])};var i,o,a=r.CSSStyleSheet.prototype.deleteRule,c=(r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=gc(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,removes:[{index:r}]}),e.apply(t,n)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=gc(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,replace:r}),e.apply(t,n)})})),r.CSSStyleSheet.prototype.replaceSync&&(o=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(o,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=gc(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,replaceSync:r}),e.apply(t,n)})})),{}),d=(kc("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(kc("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),kc("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),kc("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule)),{});return Object.entries(c).forEach(function(e){var e=Pe(e,2),t=e[0],e=e[1];d[t]={insertRule:e.prototype.insertRule,deleteRule:e.prototype.deleteRule},e.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ne(function(e,t,n){var r=Pe(n,2),i=r[0],r=r[1],o=gc(t.parentStyleSheet,l,u.styleMirror),a=o.id,o=o.styleId;return(a&&-1!==a||o&&-1!==o)&&s({id:a,styleId:o,adds:[{rule:i,index:[].concat(gi(vc(t)),[r||0])}]}),e.apply(t,n)})}),e.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ne(function(e,t,n){var r=Pe(n,1)[0],i=gc(t.parentStyleSheet,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&s({id:o,styleId:i,removes:[{index:[].concat(gi(vc(t)),[r])}]}),e.apply(t,n)})})}),Ne(function(){r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=a,i&&(r.CSSStyleSheet.prototype.replace=i),o&&(r.CSSStyleSheet.prototype.replaceSync=o),Object.entries(c).forEach(function(e){var e=Pe(e,2),t=e[0],e=e[1];e.prototype.insertRule=d[t].insertRule,e.prototype.deleteRule=d[t].deleteRule})})})(e,{win:r}),we=yc(e,e.doc),R={win:r},w=(O=e).styleDeclarationCb,b=O.mirror,k=O.ignoreCSSAttributes,_=O.stylesheetManager,S=R.win,E=S.CSSStyleDeclaration.prototype.setProperty,S.CSSStyleDeclaration.prototype.setProperty=new Proxy(E,{apply:Ne(function(e,t,n){var r,i,o=Pe(n,3),a=o[0],s=o[1],o=o[2];return k.has(a)?E.apply(t,[a,s,o]):(r=(i=gc(null==(i=t.parentRule)?void 0:i.parentStyleSheet,b,_.styleMirror)).id,i=i.styleId,(r&&-1!==r||i&&-1!==i)&&w({id:r,styleId:i,set:{property:a,value:s,priority:o},index:vc(t.parentRule)}),e.apply(t,n))})}),C=S.CSSStyleDeclaration.prototype.removeProperty,S.CSSStyleDeclaration.prototype.removeProperty=new Proxy(C,{apply:Ne(function(e,t,n){var r,i,o=Pe(n,1)[0];return k.has(o)?C.apply(t,[o]):(r=(i=gc(null==(i=t.parentRule)?void 0:i.parentStyleSheet,b,_.styleMirror)).id,i=i.styleId,(r&&-1!==r||i&&-1!==i)&&w({id:r,styleId:i,remove:{property:o},index:vc(t.parentRule)}),e.apply(t,n))})}),be=Ne(function(){S.CSSStyleDeclaration.prototype.setProperty=E,S.CSSStyleDeclaration.prototype.removeProperty=C}),e.collectFonts)&&(ce=(T=e).fontCb,y=(T=T.doc).defaultView,ke=y?(m=[],v=new WeakMap,g=y.FontFace,y.FontFace=function(e,t,n){var r=new g(e,t,n);return v.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r},T=Iu(T.fonts,"add",function(e){return function(t){return setTimeout(Ne(function(){var e=v.get(t);e&&(ce(e),v.delete(t))}),0),e.apply(this,[t])}}),m.push(function(){y.FontFace=g}),m.push(T),Ne(function(){m.forEach(function(e){return e()})})):function(){});Re=(O=e).doc,x=O.mirror,M=O.blockClass,I=O.blockSelector,Te=O.selectionCb,A=!0,(O=Ne(function(){var e=Re.getSelection();if(!(!e||A&&null!=e&&e.isCollapsed)){A=e.isCollapsed||!1;for(var t=[],n=e.rangeCount||0,r=0;r<n;r++){var i=e.getRangeAt(r),o=i.startContainer,a=i.startOffset,s=i.endContainer,i=i.endOffset;Bu(o,M,I,!0)||Bu(s,M,I,!0)||t.push({start:x.getId(o),startOffset:a,end:x.getId(s),endOffset:i})}Te({ranges:t})}}))();var Ee,R,T,Ce,O,Re,x,M,I,Te,A,Oe=Au("selectionchange",O),xe=(T=(R=e).doc,Ce=R.customElementCb,(R=T.defaultView)&&R.customElements?Iu(R.customElements,"define",function(r){return function(t,e,n){try{Ce({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return r.apply(this,[t,e,n])}}):function(){}),Me=[],P=Ie(e.plugins);try{for(P.s();!(Ee=P.n()).done;){var D=Ee.value;Me.push(D.observer(D.callback,r,D.options))}}catch(e){P.e(e)}finally{P.f()}return Ne(function(){uc.forEach(function(e){return e.reset()}),null!=i&&i.disconnect(),de(),fe(),he(),pe(),me(),ve(),ge(),ye(),we(),be(),ke(),Oe(),xe(),Me.forEach(function(e){return e()})})}function bc(e){return void 0!==window[e]}function kc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var _c=k(function e(t){b(this,e),u(this,"iframeIdToRemoteIdMap",new WeakMap),u(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t},[{key:"getId",value:function(e,t,n,r){n=n||this.getIdToRemoteIdMap(e),r=r||this.getRemoteIdToIdMap(e),e=n.get(t);return e||(e=this.generateIdFn(),n.set(t,e),r.set(e,t)),e}},{key:"getIds",value:function(t,e){var n=this,r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map(function(e){return n.getId(t,e,r,i)})}},{key:"getRemoteId",value:function(e,t,n){n=n||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:n.get(t)||-1}},{key:"getRemoteIds",value:function(t,e){var n=this,r=this.getRemoteIdToIdMap(t);return e.map(function(e){return n.getRemoteId(t,e,r)})}},{key:"reset",value:function(e){e?(this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)):(this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),Sc=k(function e(t){b(this,e),u(this,"iframes",new WeakMap),u(this,"crossOriginIframeMap",new WeakMap),u(this,"crossOriginIframeMirror",new _c(ao)),u(this,"crossOriginIframeStyleMirror"),u(this,"crossOriginIframeRootIdMap",new WeakMap),u(this,"mirror"),u(this,"mutationCb"),u(this,"wrappedEmit"),u(this,"loadListener"),u(this,"stylesheetManager"),u(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new _c(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))},[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&null!=(t=e.contentWindow)&&t.addEventListener("message",this.handleMessage.bind(this)),null!=(t=this.loadListener)&&t.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&0<e.contentDocument.adoptedStyleSheets.length&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;"rrweb"===t.data.type&&t.origin===t.data.origin&&e.source&&(e=this.crossOriginIframeMap.get(e.source))&&(e=this.transformCrossOriginEvent(e,t.data.event))&&this.wrappedEmit(e,t.data.isCheckout)}},{key:"transformCrossOriginEvent",value:function(n,e){var t,r=this;switch(e.type){case Y.FullSnapshot:this.crossOriginIframeMirror.reset(n),this.crossOriginIframeStyleMirror.reset(n),this.replaceIdOnNode(e.data.node,n);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(n,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Y.IncrementalSnapshot,data:{source:Le.Mutation,adds:[{parentId:this.mirror.getId(n),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Y.Meta:case Y.Load:case Y.DomContentLoaded:return!1;case Y.Plugin:return e;case Y.Custom:return this.replaceIds(e.data.payload,n,["id","parentId","previousId","nextId"]),e;case Y.IncrementalSnapshot:switch(e.data.source){case Le.Mutation:return e.data.adds.forEach(function(e){r.replaceIds(e,n,["parentId","nextId","previousId"]),r.replaceIdOnNode(e.node,n);var t=r.crossOriginIframeRootIdMap.get(n);t&&r.patchRootIdOnNode(e.node,t)}),e.data.removes.forEach(function(e){r.replaceIds(e,n,["parentId","id"])}),e.data.attributes.forEach(function(e){r.replaceIds(e,n,["id"])}),e.data.texts.forEach(function(e){r.replaceIds(e,n,["id"])}),e;case Le.Drag:case Le.TouchMove:case Le.MouseMove:return e.data.positions.forEach(function(e){r.replaceIds(e,n,["id"])}),e;case Le.ViewportResize:return!1;case Le.MediaInteraction:case Le.MouseInteraction:case Le.Scroll:case Le.CanvasMutation:case Le.Input:return this.replaceIds(e.data,n,["id"]),e;case Le.StyleSheetRule:case Le.StyleDeclaration:return this.replaceIds(e.data,n,["id"]),this.replaceStyleIds(e.data,n,["styleId"]),e;case Le.Font:return e;case Le.Selection:return e.data.ranges.forEach(function(e){r.replaceIds(e,n,["start","end"])}),e;case Le.AdoptedStyleSheet:return this.replaceIds(e.data,n,["id"]),this.replaceStyleIds(e.data,n,["styleIds"]),null!=(t=e.data.styles)&&t.forEach(function(e){r.replaceStyleIds(e,n,["styleId"])}),e}}return!1}},{key:"replace",value:function(e,t,n,r){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;!Array.isArray(t[a])&&"number"!=typeof t[a]||(Array.isArray(t[a])?t[a]=e.getIds(n,t[a]):t[a]=e.getId(n,t[a]))}}catch(e){o.e(e)}finally{o.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(function(e){n.replaceIdOnNode(e,t)})}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===ec.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(function(e){n.patchRootIdOnNode(e,t)})}}]),Ec=k(function e(t){b(this,e),u(this,"shadowDoms",new WeakSet),u(this,"mutationCb"),u(this,"scrollCb"),u(this,"bypassOptions"),u(this,"mirror"),u(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()},[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n,r=this;Wi(e)&&!this.shadowDoms.has(e)&&(this.shadowDoms.add(e),n=Pe(dc(Ae(Ae({},this.bypassOptions),{},{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),1)[0],this.restoreHandlers.push(function(){return n.disconnect()}),this.restoreHandlers.push(hc(Ae(Ae({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(function(){e.adoptedStyleSheets&&0<e.adoptedStyleSheets.length&&r.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,r.mirror.getId(De.host(e))),r.restoreHandlers.push(yc({mirror:r.mirror,stylesheetManager:r.bypassOptions.stylesheetManager},e))},0))}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,r){var i=this;this.restoreHandlers.push(Iu(e.prototype,"attachShadow",function(n){return function(e){var e=n.call(this,e),t=De.shadowRoot(this);return t&&Ku(this)&&i.addShadowRoot(t,r),e}}))}},{key:"reset",value:function(){this.restoreHandlers.forEach(function(e){try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),Cc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Rc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Tc=0;Tc<Cc.length;Tc++)Rc[Cc.charCodeAt(Tc)]=Tc;var Oc=new Map,xc=function(e,t,n){var r;if(e&&(Ac(e,t)||"object"===_(e)))return t=n,n=e.constructor.name,(r=Oc.get(t))||(r=new Map,Oc.set(t,r)),r.has(n)||r.set(n,[]),-1===(r=(t=r.get(n)).indexOf(e))&&(r=t.length,t.push(e)),r};function Mc(i,t,n){return i instanceof Array?i.map(function(e){return Mc(e,t,n)}):null===i?i:i instanceof Float32Array||i instanceof Float64Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Uint8Array||i instanceof Uint16Array||i instanceof Int16Array||i instanceof Int8Array||i instanceof Uint8ClampedArray?{rr_type:i.constructor.name,args:[Object.values(i)]}:i instanceof ArrayBuffer?{rr_type:i.constructor.name,base64:(()=>{for(var e=new Uint8Array(i),t=e.length,n="",r=0;r<t;r+=3)n=(n=(n=(n+=Cc[e[r]>>2])+Cc[(3&e[r])<<4|e[r+1]>>4])+Cc[(15&e[r+1])<<2|e[r+2]>>6])+Cc[63&e[r+2]];return t%3==2?n=n.substring(0,n.length-1)+"=":t%3==1&&(n=n.substring(0,n.length-2)+"=="),n})()}:i instanceof DataView?{rr_type:i.constructor.name,args:[Mc(i.buffer,t,n),i.byteOffset,i.byteLength]}:i instanceof HTMLImageElement?{rr_type:i.constructor.name,src:i.src}:i instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:i.toDataURL()}:i instanceof ImageData?{rr_type:i.constructor.name,args:[Mc(i.data,t,n),i.width,i.height]}:Ac(i,t)||"object"===_(i)?{rr_type:i.constructor.name,index:xc(i,t,n)}:i}function Ic(e,t,n){return e.map(function(e){return Mc(e,t,n)})}var Ac=function(t,n){var e=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(function(e){return"function"==typeof n[e]});return Boolean(e.find(function(e){return t instanceof n[e]}))};function Pc(e,a,s,l){var t=[];try{var n=Iu(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(e){for(var t,n=arguments.length,r=new Array(1<n?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Bu(this,a,s,!0)||(t="experimental-webgl"===(t=e)?"webgl":t,"__context"in this||(this.__context=t),l&&["webgl","webgl2"].includes(t)&&(r[0]&&"object"===_(r[0])?(t=r[0]).preserveDrawingBuffer||(t.preserveDrawingBuffer=!0):r.splice(0,1,{preserveDrawingBuffer:!0}))),o.apply(this,[e].concat(r))}});t.push(n)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){t.forEach(function(e){return e()})}}function Dc(n,s,l,u,c,d){var e,r=[],t=Ie(Object.getOwnPropertyNames(n));try{for(t.s();!(e=t.n()).done;)(()=>{var a=e.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return;try{if("function"!=typeof n[a])return;var t=Iu(n,a,function(o){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=o.apply(this,t);return xc(i,d,this),"tagName"in this.canvas&&!Bu(this.canvas,u,c,!0)&&(r=Ic(t,d,this),l(this.canvas,{type:s,property:a,args:r})),i}});r.push(t)}catch(e){t=Lu(n,a,{set:function(e){l(this.canvas,{type:s,property:a,args:[e],setter:!0})}});r.push(t)}})()}catch(n){t.e(n)}finally{t.f()}return r}var Lc='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',Nc="undefined"!=typeof self&&self.Blob&&new Blob([Lc],{type:"text/javascript;charset=utf-8"});function Fc(e){var t,n;try{if(t=Nc&&(self.URL||self.webkitURL).createObjectURL(Nc))return(n=new Worker(t,{name:null==e?void 0:e.name})).addEventListener("error",function(){(self.URL||self.webkitURL).revokeObjectURL(t)}),n;throw""}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Lc),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Q,Uc,zc,Bc=k(function e(t){var n=this,r=(b(this,e),u(this,"pendingCanvasMutations",new Map),u(this,"rafStamps",{latestId:0,invokeId:null}),u(this,"mirror"),u(this,"mutationCb"),u(this,"resetObservers"),u(this,"frozen",!1),u(this,"locked",!1),u(this,"processMutation",function(e,t){(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId||!n.rafStamps.invokeId)&&(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)}),t.sampling),r=void 0===r?"all":r,i=t.win,o=t.blockClass,a=t.blockSelector,s=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===r&&this.initCanvasMutationObserver(i,o,a),s&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,o,a,{dataURLOptions:l})},[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,r,i,o,a){var s=this,t=Pc(r,i,o,!0),l=new Map,u=new Fc;u.onmessage=function(e){var t,n=e.data.id;l.set(n,!1),"base64"in e.data&&(t=(e=e.data).base64,s.mutationCb({id:n,type:Yu["2D"],commands:[{property:"clearRect",args:[0,0,e.width,e.height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:t}],type:e.type}]},0,0]}]}))};var c=1e3/e,d=0,f=function(e){var t,n;h=(d&&e-d<c||(d=e,t=[],r.document.querySelectorAll("canvas").forEach(function(e){Bu(e,i,o,!0)||t.push(e)}),t.forEach((n=ri(fi().m(function e(t){var n,r,i;return fi().w(function(e){for(;;)switch(e.n){case 0:if(n=s.mirror.getId(t),l.get(n))return e.a(2);e.n=1;break;case 1:if(0===t.width||0===t.height)return e.a(2);e.n=2;break;case 2:return l.set(n,!0),["webgl","webgl2"].includes(t.__context)&&(r=t.getContext(t.__context),!1===(null==(i=null==r?void 0:r.getContextAttributes())?void 0:i.preserveDrawingBuffer))&&r.clear(r.COLOR_BUFFER_BIT),e.n=3,createImageBitmap(t);case 3:i=e.v,u.postMessage({id:n,bitmap:i,width:t.width,height:t.height,dataURLOptions:a.dataURLOptions},[i]);case 4:return e.a(2)}},e)})),function(e){return n.apply(this,arguments)}))),requestAnimationFrame(f))},h=requestAnimationFrame(f);this.resetObservers=function(){t(),cancelAnimationFrame(h)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r,i,o=Pc(e,t,n,!1),a=((a,s,l,u)=>{var e,n=[],t=Ie(Object.getOwnPropertyNames(s.CanvasRenderingContext2D.prototype));try{for(t.s();!(e=t.n()).done;)(()=>{var o=e.value;try{if("function"!=typeof s.CanvasRenderingContext2D.prototype[o])return;var t=Iu(s.CanvasRenderingContext2D.prototype,o,function(i){return function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Bu(this.canvas,l,u,!0)||setTimeout(function(){var e=Ic(n,s,t);a(t.canvas,{type:Yu["2D"],property:o,args:e})},0),i.apply(this,n)}});n.push(t)}catch(e){t=Lu(s.CanvasRenderingContext2D.prototype,o,{set:function(e){a(this.canvas,{type:Yu["2D"],property:o,args:[e],setter:!0})}});n.push(t)}})()}catch(a){t.e(a)}finally{t.f()}return function(){n.forEach(function(e){return e()})}})(this.processMutation.bind(this),e,t,n),s=(r=this.processMutation.bind(this),t=t,n=n,i=[],void 0!==(e=e).WebGLRenderingContext&&i.push.apply(i,gi(Dc(e.WebGLRenderingContext.prototype,Yu.WebGL,r,t,n,e))),void 0!==e.WebGL2RenderingContext&&i.push.apply(i,gi(Dc(e.WebGL2RenderingContext.prototype,Yu.WebGL2,r,t,n,e))),function(){i.forEach(function(e){return e()})});this.resetObservers=function(){o(),a(),s()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})}},{key:"startRAFTimestamping",value:function(){function t(e){n.rafStamps.latestId=e,requestAnimationFrame(t)}var n=this;requestAnimationFrame(t)}},{key:"flushPendingCanvasMutations",value:function(){var r=this;this.pendingCanvasMutations.forEach(function(e,t){var n=r.mirror.getId(t);r.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(function(){return r.flushPendingCanvasMutations()})}},{key:"flushPendingCanvasMutationFor",value:function(e,t){var n,r;this.frozen||this.locked||(r=this.pendingCanvasMutations.get(e))&&-1!==t&&(n=r.map(function(e){return e.type,di(e,Ri)}),r=r[0].type,this.mutationCb({id:t,type:r,commands:n}),this.pendingCanvasMutations.delete(e))}}]),jc=k(function e(t){b(this,e),u(this,"trackedLinkElements",new WeakSet),u(this,"mutationCb"),u(this,"adoptedStyleSheetCb"),u(this,"styleMirror",new Gu),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb},[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){var r=this;if(0!==e.length){var i,o={id:t,styleIds:[]},a=[],n=Ie(e);try{for(n.s();!(i=n.n()).done;)(()=>{var e,n=i.value;r.styleMirror.has(n)?e=r.styleMirror.getId(n):(e=r.styleMirror.add(n),a.push({styleId:e,rules:Array.from(n.rules||CSSRule,function(e,t){return{rule:qi(e,n.href),index:t}})})),o.styleIds.push(e)})()}catch(e){n.e(e)}finally{n.f()}0<a.length&&(o.styles=a),this.adoptedStyleSheetCb(o)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),Wc=k(function e(){b(this,e),u(this,"nodeMap",new WeakMap),u(this,"active",!1)},[{key:"inOtherBuffer",value:function(e,t){e=this.nodeMap.get(e);return e&&Array.from(e).some(function(e){return e!==t})}},{key:"add",value:function(e,t){var n=this;this.active||(this.active=!0,requestAnimationFrame(function(){n.nodeMap=new WeakMap,n.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"destroy",value:function(){}}]),Hc=!1;try{2!==Array.from([1],function(e){return 2*e})[0]&&(Op=document.createElement("iframe"),document.body.appendChild(Op),Array.from=(null==(Cp=Op.contentWindow)?void 0:Cp.Array.from)||Array.from,document.body.removeChild(Op))}catch(Ad){console.debug("Unable to override Array.from",Ad)}var qc=new Vi;function Vc(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=e.emit,i=e.checkoutEveryNms,o=e.checkoutEveryNth,t=e.blockClass,l=void 0===t?"rr-block":t,t=e.blockSelector,u=void 0===t?null:t,t=e.ignoreClass,L=void 0===t?"rr-ignore":t,t=e.ignoreSelector,N=void 0===t?null:t,t=e.maskTextClass,c=void 0===t?"rr-mask":t,t=e.maskTextSelector,d=void 0===t?null:t,t=e.inlineStylesheet,f=void 0===t||t,t=e.maskAllInputs,n=e.maskInputOptions,F=e.slimDOMOptions,h=e.maskInputFn,p=e.maskTextFn,U=e.hooks,z=e.packFn,a=e.sampling,s=void 0===a?{}:a,a=e.dataURLOptions,m=void 0===a?{}:a,a=e.mousemoveWait,v=e.recordDOM,B=void 0===v||v,v=e.recordCanvas,g=void 0!==v&&v,v=e.recordCrossOriginIframes,v=void 0!==v&&v,y=e.recordAfter,j=void 0===y?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":y,y=e.userTriggeredOnInput,W=void 0!==y&&y,y=e.collectFonts,H=void 0!==y&&y,y=e.inlineImages,w=void 0!==y&&y,b=e.plugins,y=e.keepIframeSrcFn,k=void 0===y?function(){return!1}:y,y=e.ignoreCSSAttributes,q=void 0===y?new Set([]):y,_=(rc=e.errorHandler,!v||window.parent===window),S=!1;if(!_)try{window.parent.document&&(S=!1)}catch(e){S=!0}if(_&&!r)throw new Error("emit function is required");if(!_&&!S)return function(){};void 0!==a&&void 0===s.mousemove&&(s.mousemove=a),qc.reset();var V,E=!0===t?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==n?n:{password:!0},C=yo(F),R=(!function(e){"NodeList"in(e=0<arguments.length&&void 0!==e?e:window)&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}(),0),G=function(e){var t,n=Ie(b||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return e=z&&!S?z(e):e};Q=function(e,t){var n;e.timestamp=Mu(),null==(n=uc[0])||!n.isFrozen()||e.type===Y.FullSnapshot||e.type===Y.IncrementalSnapshot&&e.data.source===Le.Mutation||uc.forEach(function(e){return e.unfreeze()}),_?null!=r&&r(G(e),t):S&&(n={type:"rrweb",event:G(e),origin:window.location.origin,isCheckout:t},window.parent.postMessage(n,"*")),e.type===Y.FullSnapshot?(V=e,R=0):e.type!==Y.IncrementalSnapshot||e.data.source===Le.Mutation&&e.data.isAttachIframe||(R++,t=o&&o<=R,n=i&&e.timestamp-V.timestamp>i,(t||n)&&Uc(!0))};function T(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.Mutation},e)})}function Z(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.Scroll},e)})}function J(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.CanvasMutation},e)})}var K,O=new jc({mutationCb:T,adoptedStyleSheetCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.AdoptedStyleSheet},e)})}}),x=new Sc({mirror:qc,mutationCb:T,stylesheetManager:O,recordCrossOriginIframes:v,wrappedEmit:Q}),M=Ie(b||[]);try{for(M.s();!(K=M.n()).done;){var $=K.value;$.getMirror&&$.getMirror({nodeMirror:qc,crossOriginIframeMirror:x.crossOriginIframeMirror,crossOriginIframeStyleMirror:x.crossOriginIframeStyleMirror})}}catch(e){M.e(e)}finally{M.f()}var I=new Wc,A=(zc=new Bc({recordCanvas:g,mutationCb:J,win:window,blockClass:l,blockSelector:u,mirror:qc,sampling:s.canvas,dataURLOptions:m}),new Ec({mutationCb:T,scrollCb:Z,bypassOptions:{blockClass:l,blockSelector:u,maskTextClass:c,maskTextSelector:d,inlineStylesheet:f,maskInputOptions:E,dataURLOptions:m,maskTextFn:p,maskInputFn:h,recordCanvas:g,inlineImages:w,sampling:s,slimDOMOptions:C,iframeManager:x,stylesheetManager:O,canvasManager:zc,keepIframeSrcFn:k,processedNodeManager:I},mirror:qc}));Uc=function(){var e,t,n,r,i,o,a=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(B){Q({type:Y.Meta,data:{href:window.location.href,width:Uu(),height:Fu()}},a),O.reset(),A.init(),uc.forEach(function(e){return e.lock()});s=document,r=void 0===(r=(e={mirror:qc,blockClass:l,blockSelector:u,maskTextClass:c,maskTextSelector:d,inlineStylesheet:f,maskAllInputs:E,maskTextFn:p,maskInputFn:h,slimDOM:C,dataURLOptions:m,recordCanvas:g,inlineImages:w,onSerialize:function(e){Hu(e,qc)&&x.addIframe(e),qu(e,qc)&&O.trackLinkElement(e),Vu(e)&&A.addShadowRoot(De.shadowRoot(e),document)},onIframeLoad:function(e,t){x.attachIframe(e,t),A.observeAttachShadow(e)},onStylesheetLoad:function(e,t){O.attachLinkElement(e,t)},keepIframeSrcFn:k}).mirror)?new Vi:r,t=e.inlineImages,n=e.recordCanvas,i=e.slimDOM,o=e.keepIframeSrcFn;var s=wo(s,{doc:s,mirror:r,blockClass:void 0===(s=e.blockClass)?"rr-block":s,blockSelector:void 0===(r=e.blockSelector)?null:r,maskTextClass:void 0===(s=e.maskTextClass)?"rr-mask":s,maskTextSelector:void 0===(r=e.maskTextSelector)?null:r,skipChild:!1,inlineStylesheet:void 0===(s=e.inlineStylesheet)||s,maskInputOptions:!0===(r=void 0!==(r=e.maskAllInputs)&&r)?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===r?{password:!0}:r,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:yo(void 0!==i&&i),dataURLOptions:e.dataURLOptions,inlineImages:void 0!==t&&t,recordCanvas:void 0!==n&&n,preserveWhiteSpace:e.preserveWhiteSpace,onSerialize:e.onSerialize,onIframeLoad:e.onIframeLoad,iframeLoadTimeout:e.iframeLoadTimeout,onStylesheetLoad:e.onStylesheetLoad,stylesheetLoadTimeout:e.stylesheetLoadTimeout,keepIframeSrcFn:void 0===o?function(){return!1}:o,newlyAddedElement:!1});if(!s)return console.warn("Failed to snapshot the document");Q({type:Y.FullSnapshot,data:{node:s,initialOffset:Nu(window)}},a),uc.forEach(function(e){return e.unlock()}),document.adoptedStyleSheets&&0<document.adoptedStyleSheets.length&&O.adoptStyleSheets(document.adoptedStyleSheets,qc.getId(document))}};try{var P=[],X=function(e){return Ne(wc)({mutationCb:T,mousemoveCb:function(e,t){return Q({type:Y.IncrementalSnapshot,data:{source:t,positions:e}})},mouseInteractionCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.MouseInteraction},e)})},scrollCb:Z,viewportResizeCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.ViewportResize},e)})},inputCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.Input},e)})},mediaInteractionCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.MediaInteraction},e)})},styleSheetRuleCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.StyleSheetRule},e)})},styleDeclarationCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.StyleDeclaration},e)})},canvasMutationCb:J,fontCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.Font},e)})},selectionCb:function(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.Selection},e)})},customElementCb:function(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:Le.CustomElement},e)})},blockClass:l,ignoreClass:L,ignoreSelector:N,maskTextClass:c,maskTextSelector:d,maskInputOptions:E,inlineStylesheet:f,sampling:s,recordDOM:B,recordCanvas:g,inlineImages:w,userTriggeredOnInput:W,collectFonts:H,doc:e,maskInputFn:h,maskTextFn:p,keepIframeSrcFn:k,blockSelector:u,slimDOMOptions:C,dataURLOptions:m,mirror:qc,iframeManager:x,stylesheetManager:O,shadowDomManager:A,processedNodeManager:I,canvasManager:zc,ignoreCSSAttributes:q,plugins:(null==(e=null==b?void 0:b.filter(function(e){return e.observer}))?void 0:e.map(function(t){return{observer:t.observer,options:t.options,callback:function(e){return Q({type:Y.Plugin,data:{plugin:t.name,payload:e}})}}}))||[]},U)},D=(x.addLoadListener(function(e){try{P.push(X(e.contentDocument))}catch(e){console.warn(e)}}),function(){Uc(),P.push(X(document)),Hc=!0});return["interactive","complete"].includes(document.readyState)?D():(P.push(Au("DOMContentLoaded",function(){Q({type:Y.DomContentLoaded,data:{}}),"DOMContentLoaded"===j&&D()})),P.push(Au("load",function(){Q({type:Y.Load,data:{}}),"load"===j&&D()},window))),function(){P.forEach(function(e){try{e()}catch(e){String(e).toLowerCase().includes("cross-origin")||console.warn(e)}}),I.destroy(),Hc=!1,rc=void 0}}catch(e){console.warn(e)}}Vc.addCustomEvent=function(e,t){if(!Hc)throw new Error("please add custom event after start recording");Q({type:Y.Custom,data:{tag:e,payload:t}})},Vc.freezePage=function(){uc.forEach(function(e){return e.freeze()})},Vc.takeFullSnapshot=function(e){if(!Hc)throw new Error("please take full snapshot after start recording");Uc(e)},Vc.mirror=qc;var Gc='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Zc={maskAllText:!0,maskAllInputs:!0,blockAllMedia:!0,autoDetectSensitiveData:!0,mask:[".tdem-mask","[data-tdem-mask]","[data-sensitive]",".sensitive",".private"],block:[".tdem-block","[data-tdem-block]",".secret","[data-secret]","iframe[srcdoc]:not([src])",".replayer-wrapper"],ignore:[".tdem-ignore","[data-tdem-ignore]",'input[type="file"]','input[type="password"]'],maskInputOptions:{password:!0,email:!0,tel:!0,text:!1}},Jc=(Kc.maskPhone=function(e){return e.replace(this.phoneRegex,function(e){var t=e.replace(/[^\d]/g,"");return 11===t.length?e.substring(0,3)+"****"+e.substring(7):13===t.length?e.substring(0,6)+"****"+e.substring(10):e.substring(0,3)+"****"+e.substring(e.length-4)})},Kc.maskIdCard=function(e){return e.replace(this.idCardRegex,function(e){return 18===e.length?e.substring(0,6)+"********"+e.substring(14):15===e.length?e.substring(0,6)+"******"+e.substring(12):e})},Kc.maskEmail=function(e){return e.replace(this.emailRegex,function(e){var t,n=e.indexOf("@");return n<=1?"*"+e.substring(1):(t=e.substring(0,n),e=e.substring(n),t.charAt(0)+"***"+t.charAt(t.length-1)+e)})},Kc.maskBankCard=function(e){return e.replace(this.bankCardRegex,function(e){var t=e.replace(/[^\d]/g,"");return t.length<13?e:t.substring(0,4)+" **** **** "+t.substring(t.length-4)})},Kc.maskIP=function(e){return e.replace(this.ipv4Regex,function(e){e=e.split(".");return e[0]+".*.*."+e[3]})},Kc.autoMask=function(e){var t;return e&&"string"==typeof e?(t=this.maskPhone(t=e),t=this.maskIdCard(t),t=this.maskEmail(t),this.maskBankCard(t)):e},Kc.hasSensitiveData=function(e){return!(!e||"string"!=typeof e)&&(this.phoneRegex.test(e)||this.idCardRegex.test(e)||this.emailRegex.test(e)||this.bankCardRegex.test(e))},Kc.phoneRegex=/1[3-9]\d{9}|(?:\+?86)?1[3-9]\d{9}/g,Kc.idCardRegex=/[1-9]\d{5}(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dXx]|[1-9]\d{7}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}/g,Kc.emailRegex=/[\w.-]+@[\w.-]+\.\w{2,}/g,Kc.bankCardRegex=/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{1,7}\b/g,Kc.ipv4Regex=/\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b/g,Kc);function Kc(){}function $c(e,t){return void 0===e&&(e={}),x(x(x({},t=void 0===t?Zc:t),e),{mask:Xc(t.mask,e.mask),block:Xc(t.block,e.block),ignore:Xc(t.ignore,e.ignore),maskInputOptions:x(x({},t.maskInputOptions),e.maskInputOptions)})}function Xc(e,t){e=new Set(g(e||[],t||[]));return Array.from(e)}rd.prototype.push=function(e,t){if(this.emitFn=t,3===e.type&&this.isMutationEvent(e)){var n=e.data;if(this.buffer){if(this.enableRepeatDetection&&this.isRepeatPattern(n)){if(this.repeatCount++,3<this.repeatCount)return this.buffer=this.cloneEvent(e),void this.droppedByRepeat++}else this.repeatCount=0;this.mergeInto(n,e.timestamp),this.mergedCount++,(null!=(n=null==(n=this.buffer.data.adds)?void 0:n.length)?n:0)>=this.maxAddsPerMerge&&this.flush()}else this.buffer=this.cloneEvent(e),this.scheduleFlush()}else this.flush(),t(e)},rd.prototype.flush=function(){this.clearTimer(),this.buffer&&this.emitFn&&(this.emitFn(this.buffer),this.buffer=null,this.repeatCount=0)},rd.prototype.destroy=function(){this.flush(),this.clearTimer(),this.emitFn=null},rd.prototype.getStats=function(){return{mergedCount:this.mergedCount,droppedByRepeat:this.droppedByRepeat,cancelledByOffset:this.cancelledByOffset}},rd.prototype.isMutationEvent=function(e){return 0===(null==(e=e.data)?void 0:e.source)},rd.prototype.isRepeatPattern=function(e){var t;return!!this.buffer&&(t=null!=(t=this.buffer.data.adds)?t:[],e=null!=(e=e.adds)?e:[],0!==t.length)&&0!==e.length&&t.length===e.length&&(null==(t=t[0])?void 0:t.parentId)===(null==(t=e[0])?void 0:t.parentId)},rd.prototype.mergeInto=function(e,t){var n,r,i,o;if(this.buffer){var a=this.buffer.data;this.buffer.timestamp=Math.max(this.buffer.timestamp,t);for(var s=this,l=0,u=null!=(t=e.removes)?t:[];l<u.length;l++)(t=>{var e=(null!=(n=a.adds)?n:[]).findIndex(function(e){return(null==(e=e.node)?void 0:e.id)===t.id});0<=e?(a.adds.splice(e,1),s.cancelledByOffset++):(a.removes=null!=(n=a.removes)?n:[],a.removes.push(t))})(u[l]);for(var c=0,d=null!=(t=e.adds)?t:[];c<d.length;c++){var f=d[c];a.adds=null!=(r=a.adds)?r:[],a.adds.push(f)}for(var h=0,p=null!=(t=e.attributes)?t:[];h<p.length;h++)(t=>{a.attributes=null!=(i=a.attributes)?i:[];var e=a.attributes.findIndex(function(e){return e.id===t.id});0<=e?a.attributes[e]=t:a.attributes.push(t)})(p[h]);for(var m=0,v=null!=(t=e.texts)?t:[];m<v.length;m++)(t=>{a.texts=null!=(o=a.texts)?o:[];var e=a.texts.findIndex(function(e){return e.id===t.id});0<=e?a.texts[e]=t:a.texts.push(t)})(v[m])}},rd.prototype.cloneEvent=function(e){var t=e.data;return{type:e.type,timestamp:e.timestamp,data:{source:0,adds:g(null!=(e=t.adds)?e:[]),removes:g(null!=(e=t.removes)?e:[]),attributes:g(null!=(e=t.attributes)?e:[]),texts:g(null!=(e=t.texts)?e:[])}}},rd.prototype.scheduleFlush=function(){var e=this;this.clearTimer(),this.flushTimer=setTimeout(function(){e.flushTimer=null,e.flush()},this.windowMs)},rd.prototype.clearTimer=function(){null!==this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null)};var Yc=rd,Qc=(nd.prototype.startRecording=function(e){var r,i,n=this;if(void 0===e&&(e={}),"recording"!==this.state){this.mutationLimitReached=!1,this.throttleCount=0,this.throttleWindowStart=Date.now(),this.throttleNotified=!1,this.mutationAddsInWindow=0;var t="buffer"===this.options.mode?12e4:3e5,t="number"==typeof e.checkoutEveryNms&&0<e.checkoutEveryNms?e.checkoutEveryNms:t,o="number"==typeof e.checkoutEveryNth&&0<e.checkoutEveryNth?e.checkoutEveryNth:void 0,a=$c(e.privacy||{},Zc),s=x(x(x(x({emit:function(e,t){n.handleEvent(e,t)},checkoutEveryNms:t},o?{checkoutEveryNth:o}:{}),{sampling:{scroll:150,mousemove:!l.ios()&&50,mouseInteraction:!0,input:"last"},slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:!0}}),(t={},void 0!==(o=a).maskAllInputs&&(t.maskAllInputs=o.maskAllInputs),o.maskInputOptions&&(t.maskInputOptions=o.maskInputOptions),null!=(s=o.mask)&&s.length&&(t.maskTextSelector=o.mask.join(",")),null!=(s=o.block)&&s.length&&(t.blockSelector=o.block.join(",")),o.blockAllMedia&&(t.blockSelector=t.blockSelector?t.blockSelector+","+Gc:Gc,t.ignoreCSSAttributes=new Set(["background-image"])),null!=(s=o.ignore)&&s.length&&(t.ignoreSelector=o.ignore.join(",")),!o.maskTextFn&&!1===o.autoDetectSensitiveData||(t.maskTextFn=(r=o.maskTextFn,i=!1!==o.autoDetectSensitiveData,function(e,t){var n;return e&&(n=e,i&&(n=Jc.autoMask(n)),r?r(n,t):n)})),t)),e.rrwebConfig);try{this.hookMutationObserver(),this.stopRecordingFn=Vc(s),this.state="recording",this.lastCheckoutTime=Date.now(),this.startCheckpointTimer(),h("RecorderManager","Recording started with config:",{maskAllText:a.maskAllText,maskAllInputs:a.maskAllInputs,autoDetectSensitiveData:a.autoDetectSensitiveData,mutationLimit:this.mutationLimit,checkpointIntervalMs:12e4})}catch(e){Zr("RecorderManager","Failed to start recording:",e),this.state="stopped"}}else Gr("RecorderManager","Already recording")},nd.prototype.stopRecording=function(){var e;this.stopCheckpointTimer(),null!=(e=this.mutationMerger)&&e.destroy(),this.unhookMutationObserver(),this.stopRecordingFn&&(this.stopRecordingFn(),this.stopRecordingFn=void 0),this.state="stopped",h("RecorderManager","Recording stopped")},nd.prototype.pauseRecording=function(){"recording"===this.state&&(this.stopRecording(),this.state="paused",h("RecorderManager","Recording paused"))},nd.prototype.resumeRecording=function(e){void 0===e&&(e={}),"paused"===this.state&&(this.startRecording(e),h("RecorderManager","Recording resumed"))},nd.prototype.hookMutationObserver=function(){try{var r,e,t=window.MutationObserver;t&&(r=this,(e=function(n){return new t(function(e,t){r.unhookMutationObserver(),r.onMutationHandler(e)&&n(e,t)})}).prototype=t.prototype,window.MutationObserver=e,this.restoreMutationObserver=function(){window.MutationObserver=t},Vr("RecorderManager","MutationObserver hooked"))}catch(t){Gr("RecorderManager","Failed to hook MutationObserver:",t)}},nd.prototype.unhookMutationObserver=function(){this.restoreMutationObserver&&(this.restoreMutationObserver(),this.restoreMutationObserver=null,Vr("RecorderManager","MutationObserver restored"))},nd.prototype.onMutationHandler=function(e){var t,n=this;return!this.mutationLimitReached&&(t=(e=e.length)>this.mutationLimit,(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(this.mutationLimitReached=!0,Zr("RecorderManager","Mutation limit reached: "+e+" > "+this.mutationLimit+". Stopping."),setTimeout(function(){var e,t;null!=(t=(e=n.options).onMutationLimitReached)&&t.call(e),n.stopRecording()},0),!1))},nd.prototype.checkMutationLimit=function(e){var n=this;if(this.mutationLimitReached)return!1;if(3!==e.type)return!0;e=e.data;if(0!==(null==e?void 0:e.source))return!0;e=Array.isArray(e.adds)?e.adds.length:0;if(0===e)return!0;this.mutationAddsInWindow+=e;var t=e>this.mutationLimit||this.mutationAddsInWindow>2*this.mutationLimit;return(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(Zr("RecorderManager","Mutation limit: "+e+" adds (window: "+this.mutationAddsInWindow+"). Stopping."),this.mutationLimitReached=!0,setTimeout(function(){var e,t;null!=(t=(e=n.options).onMutationLimitReached)&&t.call(e),n.stopRecording()},0),!1)},nd.prototype.emitMutationBreadcrumb=function(e,t){var n;try{null!=(n=Vc.addCustomEvent)&&n.call(Vc,"replay.mutations",{count:e,limit:t,timestamp:Date.now()})}catch(e){}},nd.prototype.handleEvent=function(e,t){var n=this,r=(t&&(null!=(i=(r=this.options).onCheckout)&&i.call(r),this.lastCheckoutTime=Date.now(),null!=(i=this.mutationMerger))&&i.flush(),e.type);if(t||2===r||4===r||r<=1||this.checkEventThrottle()){if(3===r&&!this.mutationLimitReached){var i=Date.now();if(12e4<=i-this.lastCheckoutTime){this.lastCheckoutTime=i;try{var o=Vc.takeFullSnapshot;"function"==typeof o&&(o(!0),Vr("RecorderManager","Inline checkpoint: forced FullSnapshot"))}catch(e){Gr("RecorderManager","Inline checkpoint failed:",e)}}}this.checkMutationLimit(e)&&(this.mutationMerger?this.mutationMerger.push(e,function(e){n.options.onRecordingEvent(e)}):this.options.onRecordingEvent(e))}},nd.prototype.checkEventThrottle=function(){var e,t=Date.now();if(5e3<t-this.throttleWindowStart&&(this.throttleCount=0,this.throttleWindowStart=t,this.throttleNotified=!1,this.mutationAddsInWindow=0),this.throttleCount++,300<this.throttleCount){if(!this.throttleNotified){this.throttleNotified=!0,Gr("RecorderManager","Event throttled: "+this.throttleCount+" events in 5000ms window");try{null!=(e=Vc.addCustomEvent)&&e.call(Vc,"replay.throttled",{count:this.throttleCount,window:5e3})}catch(e){}}return!1}return!0},nd.prototype.startCheckpointTimer=function(){var t=this;this.stopCheckpointTimer(),this.checkpointTimer=setInterval(function(){if("recording"===t.state&&!t.mutationLimitReached)try{var e=Vc.takeFullSnapshot;"function"==typeof e&&(e(!0),t.lastCheckoutTime=Date.now(),Vr("RecorderManager","Checkpoint: forced FullSnapshot"))}catch(e){Gr("RecorderManager","Checkpoint FullSnapshot failed:",e)}},12e4)},nd.prototype.stopCheckpointTimer=function(){null!==this.checkpointTimer&&(clearInterval(this.checkpointTimer),this.checkpointTimer=null)},nd.prototype.getState=function(){return this.state},nd.prototype.isRecording=function(){return"recording"===this.state},nd.prototype.getLastCheckoutTime=function(){return this.lastCheckoutTime},nd.prototype.takeFullSnapshot=function(){var e,t;"recording"===this.state&&this.stopRecordingFn&&(null!=(t=null==(e=this.stopRecordingFn)?void 0:e.takeFullSnapshot)&&t.call(e),this.lastCheckoutTime=Date.now())},nd.prototype.isMutationLimitReached=function(){return this.mutationLimitReached},nd),ed=(td.prototype.initializeSampling=function(){return null!==this.samplingDecision?{mode:this.currentMode,shouldRecord:!1!==this.currentMode}:Math.random()<this.config.sessionSampleRate?(this.currentMode="session",this.samplingDecision=!0,h("SamplerManager","Sampled: session mode"),{mode:"session",shouldRecord:!0}):0<this.config.errorSampleRate?(this.currentMode="buffer",this.samplingDecision=!0,h("SamplerManager","Sampled: buffer mode"),{mode:"buffer",shouldRecord:!0}):(this.currentMode=!1,this.samplingDecision=!1,h("SamplerManager","Not sampled"),{mode:!1,shouldRecord:!1})},td.prototype.decideSamplingMode=function(){return this.initializeSampling().mode},td.prototype.onErrorOccurred=function(e){return"buffer"===this.currentMode&&!this.hasUpgraded&&!!(Math.random()<this.config.errorSampleRate)&&(this.switchMode("session"),this.hasUpgraded=!0)},td.prototype.switchMode=function(e){var t=this.currentMode;this.currentMode=e,this.samplingDecision=!1!==e,h("SamplerManager","Mode switched: "+t+" -> "+e)},td.prototype.getCurrentMode=function(){return this.currentMode},td.prototype.isSampled=function(){return!0===this.samplingDecision},td.prototype.isSessionMode=function(){return"session"===this.currentMode},td.prototype.isBufferMode=function(){return"buffer"===this.currentMode},td.prototype.upgradeToSessionMode=function(){return"buffer"===this.currentMode&&Math.random()<this.config.errorSampleRate&&(this.currentMode="session",h("SamplerManager","Upgraded to session mode due to error"),!0)},td.prototype.updateRates=function(e,t){"number"==typeof e&&(this.config.sessionSampleRate=e),"number"==typeof t&&(this.config.errorSampleRate=t)},td.prototype.forceMode=function(e){this.currentMode=e,this.samplingDecision=!1!==e},td.prototype.reset=function(){this.currentMode=!1,this.samplingDecision=null},td.prototype.getConfig=function(){return x({},this.config)},td);function td(e){var t;void 0===e&&(e={}),this.currentMode=!1,this.samplingDecision=null,this.hasUpgraded=!1,this.config={sessionSampleRate:null!=(t=e.sessionSampleRate)?t:.1,errorSampleRate:null!=(t=e.errorSampleRate)?t:1}}function nd(e,t){this.state="stopped",this.lastCheckoutTime=0,this.checkpointTimer=null,this.mutationLimitReached=!1,this.mutationMerger=null,this.mutationBreadcrumbLimit=750,this.mutationLimit=1e4,this.restoreMutationObserver=null,this.throttleCount=0,this.throttleWindowStart=0,this.throttleNotified=!1,this.mutationAddsInWindow=0,this.options=e,this.mutationBreadcrumbLimit=null!=(e=null==t?void 0:t.mutationBreadcrumbLimit)?e:750,this.mutationLimit=null!=(e=null==t?void 0:t.mutationLimit)?e:1e4,null!=t&&t.enableMutationMerge&&(this.mutationMerger=new Yc({windowMs:null!=(e=null==t?void 0:t.mutationMergeWindowMs)?e:200,maxAddsPerMerge:500,enableRepeatDetection:!0}))}function rd(e){var t;this.buffer=null,this.flushTimer=null,this.repeatCount=0,this.emitFn=null,this.mergedCount=0,this.droppedByRepeat=0,this.cancelledByOffset=0,this.windowMs=null!=(t=null==e?void 0:e.windowMs)?t:200,this.maxAddsPerMerge=null!=(t=null==e?void 0:e.maxAddsPerMerge)?t:500,this.enableRepeatDetection=null==(t=null==e?void 0:e.enableRepeatDetection)||t}function id(e){for(var t=e.length;0<=--t;)e[t]=0}var od=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]),ad=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]),sd=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ld=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ud=new Array(576),cd=(id(ud),new Array(60)),dd=(id(cd),new Array(512)),fd=(id(dd),new Array(256)),hd=(id(fd),new Array(29));id(hd);var pd,md,vd,gd=new Array(30);function yd(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function wd(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}id(gd);function bd(e){return e<256?dd[e]:dd[256+(e>>>7)]}function kd(e,t,n){Wd(e,n[2*t],n[2*t+1])}function _d(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function Sd(e,t,n){for(var r,i=new Array(16),o=0,a=1;a<=15;a++)o=o+n[a-1]<<1,i[a]=o;for(r=0;r<=t;r++){var s=e[2*r+1];0!==s&&(e[2*r]=_d(i[s]++,s))}}function Ed(e){for(var 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}function Cd(e){8<e.bi_valid?jd(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Rd(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&Hd(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Hd(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function Td(e,t,n){var r,i,o,a,s=0;if(0!==e.sym_next)for(;r=255&e.pending_buf[e.sym_buf+s++],r+=(255&e.pending_buf[e.sym_buf+s++])<<8,i=e.pending_buf[e.sym_buf+s++],0==r?kd(e,i,t):(o=fd[i],kd(e,o+256+1,t),0!==(a=od[o])&&(i-=hd[o],Wd(e,i,a)),o=bd(--r),kd(e,o,n),0!==(a=ad[o])&&(r-=gd[o],Wd(e,r,a))),s<e.sym_next;);kd(e,256,t)}function Od(e,t){var n,r,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<l;n++)0!==o[2*n]?(e.heap[++e.heap_len]=u=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=u,n=e.heap_len>>1;1<=n;n--)Rd(e,o,n);for(i=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Rd(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,Rd(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1];for(var c,d,f,h,p,m=e,v=t.dyn_tree,g=t.max_code,y=t.stat_desc.static_tree,w=t.stat_desc.has_stree,b=t.stat_desc.extra_bits,k=t.stat_desc.extra_base,_=t.stat_desc.max_length,S=0,E=0;E<=15;E++)m.bl_count[E]=0;for(v[2*m.heap[m.heap_max]+1]=0,c=m.heap_max+1;c<573;c++)(E=v[2*v[2*(d=m.heap[c])+1]+1]+1)>_&&(E=_,S++),v[2*d+1]=E,g<d||(m.bl_count[E]++,h=0,k<=d&&(h=b[d-k]),p=v[2*d],m.opt_len+=p*(E+h),w&&(m.static_len+=p*(y[2*d+1]+h)));if(0!==S){do{for(E=_-1;0===m.bl_count[E];)E--}while(m.bl_count[E]--,m.bl_count[E+1]+=2,m.bl_count[_]--,0<(S-=2));for(E=_;0!==E;E--)for(d=m.bl_count[E];0!==d;)(f=m.heap[--c])>g||(v[2*f+1]!==E&&(m.opt_len+=(E-v[2*f+1])*v[2*f],v[2*f+1]=E),d--)}Sd(o,u,e.bl_count)}function xd(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<l&&i===a||(s<u?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=i,u=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4))}function Md(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<l&&i===a)){if(s<u)for(;kd(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(kd(e,i,e.bl_tree),s--),kd(e,16,e.bl_tree),Wd(e,s-3,2)):s<=10?(kd(e,17,e.bl_tree),Wd(e,s-3,3)):(kd(e,18,e.bl_tree),Wd(e,s-11,7));o=i,u=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4)}}function Id(e,t,n,r){Wd(e,0+(r?1:0),3),Cd(e),jd(e,n),jd(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n}function Ad(e,t){return e.msg=Jd[t],t}function Pd(e){return 2*e-(4<e?9:0)}function Dd(e,t){Xd(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,_f(e.strm)}function f(e,t){e.pending_buf[e.pending++]=t}function Ld(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Nd(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,l=e.w_size-262<e.strstart?e.strstart-(e.w_size-262):0,u=e.window,c=e.w_mask,d=e.prev,f=e.strstart+258,h=u[o+a-1],p=u[o+a];e.good_match<=e.prev_length&&(i>>=2),e.lookahead<s&&(s=e.lookahead);do{if(u[(n=t)+a]===p&&u[n+a-1]===h&&u[n]===u[o]&&u[++n]===u[o+1]){for(o+=2,n++;u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<f;);if(r=258-(f-o),o=f-258,a<r){if(e.match_start=t,s<=(a=r))break;h=u[o+a-1],p=u[o+a]}}}while((t=d[t&c])>l&&0!=--i);return a<=e.lookahead?a:e.lookahead}function Fd(e){var t,n,r=e.w_size;do{if(t=e.window_size-e.lookahead-e.strstart,r+(r-262)<=e.strstart&&(e.window.set(e.window.subarray(r,r+r-t),0),e.match_start-=r,e.strstart-=r,e.block_start-=r,e.strstart<e.insert&&(e.insert=e.strstart),wf(e),t+=r),0===e.strm.avail_in)break;if(t=Sf(e.strm,e.window,e.strstart+e.lookahead,t),e.lookahead+=t,e.legacy_hash){if(3<=e.lookahead+e.insert)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=bf(e,e.ins_h,e.window[n+1]);e.insert&&(kf(e,n),n++,e.insert--,!(e.lookahead+e.insert<3)););}else if(3<e.lookahead+e.insert)for(n=e.strstart-e.insert;e.insert&&(kf(e,n),n++,e.insert--,!(e.lookahead+e.insert<=3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function Ud(e,t){for(var n,r,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,s=e.strm.avail_in;n=65535,i=e.bi_valid+42>>3,!(e.strm.avail_out<i||(n=(i=e.strm.avail_out-i)<(n=n>(r=e.strstart-e.block_start)+e.strm.avail_in?r+e.strm.avail_in:n)?i:n)<o&&(0===n&&t!==rf||t===ef||n!==r+e.strm.avail_in)||(a=t===rf&&n===r+e.strm.avail_in?1:0,$d(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,_f(e.strm),r&&(n<r&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(Sf(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),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.strstart<e.insert)&&(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+=e.w_size-e.insert<s?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==ef&&t!==rf&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&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++,i+=e.w_size,e.strstart<e.insert)&&(e.insert=e.strstart),(i=i>e.strm.avail_in?e.strm.avail_in:i)&&(Sf(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=e.w_size-e.insert<i?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),o=(i=65535<e.pending_buf_size-(i=e.bi_valid+42>>3)?65535:e.pending_buf_size-i)>e.w_size?e.w_size:i,((r=e.strstart-e.block_start)>=o||(r||t===rf)&&t!==ef&&0===e.strm.avail_in&&r<=i)&&(n=i<r?i:r,a=t===rf&&0===e.strm.avail_in&&n===r?1:0,$d(e,e.block_start,n,a),e.block_start+=n,_f(e.strm)),a?3:1)}function zd(e,t){for(var n,r;;){if(e.lookahead<262){if(Fd(e),e.lookahead<262&&t===ef)return 1;if(0===e.lookahead)break}if((n=0)!==(n=3<=e.lookahead?kf(e,e.strstart):n)&&e.strstart-n<=e.w_size-262&&(e.match_length=Nd(e,n)),3<=e.match_length)if(r=Yd(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&3<=e.lookahead){for(e.match_length--;e.strstart++,n=kf(e,e.strstart),0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=bf(e,e.ins_h,e.window[e.strstart+1]));else r=Yd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Dd(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===rf?(Dd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Dd(e,!1),0===e.strm.avail_out)?1:2}function Bd(e,t){for(var n,r,i;;){if(e.lookahead<262){if(Fd(e),e.lookahead<262&&t===ef)return 1;if(0===e.lookahead)break}if(n=0,3<=e.lookahead&&(n=kf(e,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=Nd(e,n),e.match_length<=5)&&(e.strategy===ff||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2),3<=e.prev_length&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,r=Yd(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(n=kf(e,e.strstart)),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(Dd(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=Yd(e,0,e.window[e.strstart-1]))&&Dd(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&&(r=Yd(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===rf?(Dd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Dd(e,!1),0===e.strm.avail_out)?1:2}var jd=function(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Wd=function(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,jd(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)},Hd=function(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},qd=!1,vu=function(e){if(!qd){for(var t,n,r,i=new Array(16),o=0,a=0;a<28;a++)for(hd[a]=o,t=0;t<1<<od[a];t++)fd[o++]=a;for(fd[o-1]=a,a=r=0;a<16;a++)for(gd[a]=r,t=0;t<1<<ad[a];t++)dd[r++]=a;for(r>>=7;a<30;a++)for(gd[a]=r<<7,t=0;t<1<<ad[a]-7;t++)dd[256+r++]=a;for(n=0;n<=15;n++)i[n]=0;for(t=0;t<=143;)ud[2*t+1]=8,t++,i[8]++;for(;t<=255;)ud[2*t+1]=9,t++,i[9]++;for(;t<=279;)ud[2*t+1]=7,t++,i[7]++;for(;t<=287;)ud[2*t+1]=8,t++,i[8]++;for(Sd(ud,287,i),t=0;t<30;t++)cd[2*t+1]=5,cd[2*t]=_d(t,5);pd=new yd(ud,od,257,286,15),md=new yd(cd,ad,0,30,15),vd=new yd(new Array(0),sd,0,19,7),qd=!0}e.l_desc=new wd(e.dyn_ltree,pd),e.d_desc=new wd(e.dyn_dtree,md),e.bl_desc=new wd(e.bl_tree,vd),e.bi_buf=0,e.bi_valid=0,Ed(e)},i=Id,s=function(e,t,n,r){var i,o,a,s=0;if(0<e.level?(2===e.strm.data_type&&(e.strm.data_type=(e=>{for(var t=4093624447,n=0;n<=31;n++,t>>>=1)if(1&t&&0!==e.dyn_ltree[2*n])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(n=32;n<256;n++)if(0!==e.dyn_ltree[2*n])return 1;return 0})(e)),Od(e,e.l_desc),Od(e,e.d_desc),s=(e=>{var t;for(xd(e,e.dyn_ltree,e.l_desc.max_code),xd(e,e.dyn_dtree,e.d_desc.max_code),Od(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*ld[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),(o=e.static_len+3+7>>>3)<=(i=e.opt_len+3+7>>>3)&&(i=o)):i=o=n+5,n+4<=i&&-1!==t)Id(e,t,n,r);else if(4===e.strategy||o===i)Wd(e,2+(r?1:0),3),Td(e,ud,cd);else{Wd(e,4+(r?1:0),3);var l=e,u=(t=e.l_desc.max_code+1,n=e.d_desc.max_code+1,s+1);for(Wd(l,t-257,5),Wd(l,n-1,5),Wd(l,u-4,4),a=0;a<u;a++)Wd(l,l.bl_tree[2*ld[a]+1],3);Md(l,l.dyn_ltree,t-1),Md(l,l.dyn_dtree,n-1),Td(e,e.dyn_ltree,e.dyn_dtree)}Ed(e),r&&Cd(e)},c=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*(fd[n]+256+1)]++,e.dyn_dtree[2*bd(t)]++),e.sym_next===e.sym_end},v=function(e){Wd(e,2,3),kd(e,256,ud),16===(e=e).bi_valid?(jd(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)},Vd=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3<n?2e3:n;o=o+(i=i+t[r++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16|0},Gd=new Uint32Array((()=>{for(var e=[],t=0;t<256;t++){for(var n=t,r=0;r<8;r++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return e})()),Zd=function(e,t,n,r){var i=Gd,o=r+n;e^=-1;for(var a=r;a<o;a++)e=e>>>8^i[255&(e^t[a])];return-1^e},Jd={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"},y={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},Kd=vu,$d=i,Xd=s,Yd=c,Qd=v,ef=y.Z_NO_FLUSH,tf=y.Z_PARTIAL_FLUSH,nf=y.Z_FULL_FLUSH,rf=y.Z_FINISH,of=y.Z_BLOCK,af=y.Z_OK,sf=y.Z_STREAM_END,lf=y.Z_STREAM_ERROR,uf=y.Z_DATA_ERROR,cf=y.Z_BUF_ERROR,df=y.Z_DEFAULT_COMPRESSION,ff=y.Z_FILTERED,hf=y.Z_HUFFMAN_ONLY,pf=y.Z_RLE,mf=y.Z_FIXED,vf=y.Z_UNKNOWN,gf=y.Z_DEFLATED,yf=function(e){for(var t=e.length;0<=--t;)e[t]=0},wf=function(e){for(var t,n,r=e.w_size,i=t=e.hash_size;n=e.head[--i],e.head[i]=r<=n?n-r:0,--t;);for(i=t=r;n=e.prev[--i],e.prev[i]=r<=n?n-r:0,--t;);},bf=function(e,t,n){return(t<<e.hash_shift^n)&e.hash_mask},kf=function(e,t){n=e.legacy_hash?e.ins_h=bf(e,e.ins_h,e.window[t+3-1]):(n=(n=e.window)[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24,e.ins_h=Math.imul(n,66521)+66521>>>16&e.hash_mask);var n,r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},_f=function(e){var t=e.state,n=t.pending;0!==(n=e.avail_out<n?e.avail_out: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)},Sf=function(e,t,n,r){var i=e.avail_in;return 0===(i=r<i?r:i)?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=Vd(e.adler,t,i,n):2===e.state.wrap&&(e.adler=Zd(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)};function Ef(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var Cf=[new Ef(0,0,0,0,Ud),new Ef(4,4,8,4,zd),new Ef(4,5,16,8,zd),new Ef(4,6,32,32,zd),new Ef(4,4,16,16,Bd),new Ef(8,16,32,32,Bd),new Ef(8,16,128,128,Bd),new Ef(8,32,128,256,Bd),new Ef(32,128,258,1024,Bd),new Ef(32,258,258,4096,Bd)];function Rf(){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=gf,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.legacy_hash=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),yf(this.dyn_ltree),yf(this.dyn_dtree),yf(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),yf(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),yf(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}function Tf(e){var t;return!e||!(t=e.state)||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}function Of(e){var t=Af(e);return t===af&&((e=e.state).window_size=2*e.w_size,yf(e.head),e.max_lazy_match=Cf[e.level].max_lazy,e.good_match=Cf[e.level].good_length,e.nice_match=Cf[e.level].nice_length,e.max_chain_length=Cf[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),t}function xf(e,t,n,r,i,o,a){if(!e)return lf;var s=1;if(t===df&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),i<1||9<i||n!==gf||r<8||15<r||t<0||9<t||o<0||mf<o||8===r&&1!==s)return Ad(e,lf);8===r&&(r=9);var l=new Rf;return(e.state=l).strm=e,l.status=42,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.legacy_hash=a?1:0,l.hash_bits=i+7,!l.legacy_hash&&l.hash_bits<15&&(l.hash_bits=15),l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new Uint8Array(2*l.w_size),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<i+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=3*(l.lit_bufsize-1),l.level=t,l.strategy=o,l.method=n,Of(e)}function Mf(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==_(n))throw new TypeError(n+"must be non-object");for(var r in n)Uf(n,r)&&(e[r]=n[r])}}return e}function If(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e[n].length;for(var i=new Uint8Array(t),o=0,a=0,s=e.length;o<s;o++){var l=e[o];i.set(l,a),a+=l.length}return i}var Af=function(e){if(Tf(e))return Ad(e,lf);e.total_in=e.total_out=0,e.data_type=vf;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,Kd(t),af},Pf=xf,Df=function(e,t){return Tf(e)||2!==e.state.wrap?lf:(e.state.gzhead=t,af)},Lf=function(e,t){if(Tf(e)||of<t||t<0)return e?Ad(e,lf):lf;var n=e.state;if(!e.output||0!==e.avail_in&&!e.input||666===n.status&&t!==rf)return Ad(e,0===e.avail_out?cf:lf);var r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(_f(e),0===e.avail_out)return n.last_flush=-1,af}else if(0===e.avail_in&&Pd(t)<=Pd(r)&&t!==rf)return Ad(e,cf);if(666===n.status&&0!==e.avail_in)return Ad(e,cf);if(42===n.status&&0===n.wrap&&(n.status=113),42===n.status){r=gf+(n.w_bits-8<<4)<<8;if(r|=(n.strategy>=hf||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(r|=32),Ld(n,r+=31-r%31),0!==n.strstart&&(Ld(n,e.adler>>>16),Ld(n,65535&e.adler)),e.adler=1,n.status=113,_f(e),0!==n.pending)return n.last_flush=-1,af}if(57===n.status)if(e.adler=0,f(n,31),f(n,139),f(n,8),n.gzhead)f(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)),f(n,255&n.gzhead.time),f(n,n.gzhead.time>>8&255),f(n,n.gzhead.time>>16&255),f(n,n.gzhead.time>>24&255),f(n,9===n.level?2:n.strategy>=hf||n.level<2?4:0),f(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(f(n,255&n.gzhead.extra.length),f(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Zd(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(f(n,0),f(n,0),f(n,0),f(n,0),f(n,0),f(n,9===n.level?2:n.strategy>=hf||n.level<2?4:0),f(n,3),n.status=113,_f(e),0!==n.pending)return n.last_flush=-1,af;if(69===n.status){if(n.gzhead.extra){for(var i=n.pending,o=(65535&n.gzhead.extra.length)-n.gzindex;n.pending+o>n.pending_buf_size;){var a=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=Zd(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=a,_f(e),0!==n.pending)return n.last_flush=-1,af;i=0,o-=a}r=new Uint8Array(n.gzhead.extra);n.pending_buf.set(r.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=Zd(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){var s,l=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>l&&(e.adler=Zd(e.adler,n.pending_buf,n.pending-l,l)),_f(e),0!==n.pending)return n.last_flush=-1,af;l=0}}while(s=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,f(n,s),0!=s);n.gzhead.hcrc&&n.pending>l&&(e.adler=Zd(e.adler,n.pending_buf,n.pending-l,l)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){var u,c=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>c&&(e.adler=Zd(e.adler,n.pending_buf,n.pending-c,c)),_f(e),0!==n.pending)return n.last_flush=-1,af;c=0}}while(u=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,f(n,u),0!=u);n.gzhead.hcrc&&n.pending>c&&(e.adler=Zd(e.adler,n.pending_buf,n.pending-c,c))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(_f(e),0!==n.pending))return n.last_flush=-1,af;f(n,255&e.adler),f(n,e.adler>>8&255),e.adler=0}if(n.status=113,_f(e),0!==n.pending)return n.last_flush=-1,af}if(0!==e.avail_in||0!==n.lookahead||t!==ef&&666!==n.status){r=0===n.level?Ud(n,t):n.strategy===hf?((e,t)=>{for(var n;;){if(0===e.lookahead&&(Fd(e),0===e.lookahead)){if(t===ef)return 1;break}if(e.match_length=0,n=Yd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Dd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===rf?(Dd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Dd(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===pf?((e,t)=>{for(var n,r,i,o,a=e.window;;){if(e.lookahead<=258){if(Fd(e),e.lookahead<=258&&t===ef)return 1;if(0===e.lookahead)break}if(e.match_length=0,3<=e.lookahead&&0<e.strstart&&(r=a[i=e.strstart-1])===a[++i]&&r===a[++i]&&r===a[++i]){for(o=e.strstart+258;r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o;);e.match_length=258-(o-i),e.lookahead<e.match_length&&(e.match_length=e.lookahead)}if(3<=e.match_length?(n=Yd(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Yd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Dd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===rf?(Dd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Dd(e,!1),0===e.strm.avail_out)?1:2})(n,t):Cf[n.level].func(n,t);if(3!==r&&4!==r||(n.status=666),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),af;if(2===r&&(t===tf?Qd(n):t!==of&&($d(n,0,0,!1),t===nf)&&(yf(n.head),0===n.lookahead)&&(n.strstart=0,n.block_start=0,n.insert=0),_f(e),0===e.avail_out))return n.last_flush=-1,af}return t!==rf||!(n.wrap<=0)&&(2===n.wrap?(f(n,255&e.adler),f(n,e.adler>>8&255),f(n,e.adler>>16&255),f(n,e.adler>>24&255),f(n,255&e.total_in),f(n,e.total_in>>8&255),f(n,e.total_in>>16&255),f(n,e.total_in>>24&255)):(Ld(n,e.adler>>>16),Ld(n,65535&e.adler)),_f(e),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending)?af:sf},Nf=function(e){var t;return Tf(e)?lf:(t=e.state.status,e.state=null,113===t?Ad(e,uf):af)},Ff=function(e,t){var n=t.length;if(Tf(e))return lf;var r=e.state,i=r.wrap;if(2===i||1===i&&42!==r.status||r.lookahead)return lf;1===i&&(e.adler=Vd(e.adler,t,n,0)),r.wrap=0,r.w_size<=n&&(0===i&&(yf(r.head),r.strstart=0,r.block_start=0,r.insert=0),(o=new Uint8Array(r.w_size)).set(t.subarray(n-r.w_size,n),0),t=o,n=r.w_size);var o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Fd(r);3<=r.lookahead;){for(var l=r.strstart,u=r.lookahead-2;kf(r,l),l++,--u;);r.strstart=l,r.lookahead=2,Fd(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,af},Uf=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},zf=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(w){zf=!1}for(var Bf=new Uint8Array(256),jf=0;jf<256;jf++)Bf[jf]=252<=jf?6:248<=jf?5:240<=jf?4:224<=jf?3:192<=jf?2:1;Bf[254]=Bf[255]=1;function Wf(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);for(var t,n,r,i,o=e.length,a=0,s=0;s<o;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<o&&56320==(64512&(r=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(r-56320),s++),a+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(a),s=i=0;i<a;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<o&&56320==(64512&(r=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(r-56320),s++),n<128?t[i++]=n:(n<2048?t[i++]=192|n>>>6:(n<65536?t[i++]=224|n>>>12:(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63),t[i++]=128|n>>>6&63),t[i++]=128|63&n);return t}function Hf(){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}var qf=Object.prototype.toString,Vf=y.Z_NO_FLUSH,Gf=y.Z_SYNC_FLUSH,Zf=y.Z_FULL_FLUSH,Jf=y.Z_FINISH,Kf=y.Z_OK,$f=y.Z_STREAM_END,Xf={level:y.Z_DEFAULT_COMPRESSION,method:y.Z_DEFLATED,chunkSize:16384,windowBits:15,memLevel:8,strategy:y.Z_DEFAULT_STRATEGY,legacyHash:!0};function Yf(e){this.options=Mf({},Xf,e||{});var e=this.options,t=(e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Hf,this.strm.avail_out=0,Pf(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy,e.legacyHash));if(t!==Kf)throw new Error(Jd[t]);if(e.header&&Df(this.strm,e.header),e.dictionary){e="string"==typeof e.dictionary?Wf(e.dictionary):"[object ArrayBuffer]"===qf.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary;if((t=Ff(this.strm,e))!==Kf)throw new Error(Jd[t]);this._dict_set=!0}}function Qf(e,t){t=new Yf(t);if(t.push(e,!0),t.err)throw t.msg||Jd[t.err];return t.result}Yf.prototype.push=function(e,t){var n,r,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;for(r=t===~~t?t:!0===t?Jf:Vf,"string"==typeof e?i.input=Wf(e):"[object ArrayBuffer]"===qf.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(o),i.next_out=0,i.avail_out=o),(r===Gf||r===Zf)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(Lf(i,r)===$f)return 0<i.next_out&&this.onData(i.output.subarray(0,i.next_out)),n=Nf(this.strm),this.onEnd(n),this.ended=!0,n===Kf;if(0!==i.avail_out){if(0<r&&0<i.next_out)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},Yf.prototype.onData=function(e){this.chunks.push(e)},Yf.prototype.onEnd=function(e){e===Kf&&(this.result=If(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function eh(e,t,n,r,i,o,a,s){for(var l,u,c,d,f,h,p,m,v,g=s.bits,y=0,w=0,b=0,k=0,_=0,S=0,E=0,C=0,R=0,T=0,O=null,x=new Uint16Array(16),M=new Uint16Array(16),I=null,y=0;y<=15;y++)x[y]=0;for(w=0;w<r;w++)x[t[n+w]]++;for(_=g,k=15;1<=k&&0===x[k];k--);if(k<_&&(_=k),0===k)i[o++]=20971520,i[o++]=20971520,s.bits=1;else{for(b=1;b<k&&0===x[b];b++);for(_<b&&(_=b),y=C=1;y<=15;y++)if((C=(C<<1)-x[y])<0)return-1;if(0<C&&(0===e||1!==k))return-1;for(M[1]=0,y=1;y<15;y++)M[y+1]=M[y]+x[y];for(w=0;w<r;w++)0!==t[n+w]&&(a[M[t[n+w]]++]=w);if(h=0===e?(O=I=a,20):1===e?(O=rh,I=ih,257):(O=oh,I=ah,0),y=b,f=o,E=w=T=0,c=-1,d=(R=1<<(S=_))-1,1===e&&852<R||2===e&&592<R)return 1;for(;;){for(v=a[w]+1<h?(m=0,a[w]):a[w]>=h?(m=I[a[w]-h],O[a[w]-h]):(m=96,0),l=1<<(p=y-E),b=u=1<<S;i[f+(T>>E)+(u-=l)]=p<<24|m<<16|v|0,0!==u;);for(l=1<<y-1;T&l;)l>>=1;if(0!==l?T=(T&l-1)+l:T=0,w++,0==--x[y]){if(y===k)break;y=t[n+a[w]]}if(_<y&&(T&d)!==c){for(f+=b,C=1<<(S=y-(E=0===E?_:E));S+E<k&&!((C-=x[S+E])<=0);)S++,C<<=1;if(R+=1<<S,1===e&&852<R||2===e&&592<R)return 1;i[c=T&d]=_<<24|S<<16|f-o|0}}0!==T&&(i[f+T]=y-E<<24|64<<16|0),s.bits=_}return 0}function th(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}var nh={Deflate:Yf,deflate:Qf,deflateRaw:function(e,t){return(t=t||{}).raw=!0,Qf(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,Qf(e,t)},constants:y},rh=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]),ih=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,199,75]),oh=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]),ah=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]),sh=y.Z_FINISH,lh=y.Z_BLOCK,uh=y.Z_TREES,ch=y.Z_OK,dh=y.Z_STREAM_END,fh=y.Z_NEED_DICT,hh=y.Z_STREAM_ERROR,ph=y.Z_DATA_ERROR,mh=y.Z_MEM_ERROR,vh=y.Z_BUF_ERROR,gh=y.Z_DEFLATED,ie=16209;function yh(){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}function wh(e){var t;return Th(e)?hh:(t=e.state,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,ch)}function bh(e){var t;return Th(e)?hh:((t=e.state).wsize=0,t.whave=0,t.wnext=0,wh(e))}function kh(e,t){var n,r;return Th(e)||(r=e.state,t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t))?hh:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,bh(e))}function _h(e,t){var n;return e?(n=new yh,(e.state=n).strm=e,n.window=null,n.mode=16180,(n=kh(e,t))!==ch&&(e.state=null),n):hh}function Sh(e,t,n,r){var i;return null===(e=e.state).window&&(e.window=new Uint8Array(1<<e.wbits)),0===e.wsize&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0),e.wsize<=r?(e.window.set(t.subarray(n-e.wsize,n),0),e.wnext=0,e.whave=e.wsize):((i=e.wsize-e.wnext)>r&&(i=r),e.window.set(t.subarray(n-r,n-r+i),e.wnext),(r-=i)?(e.window.set(t.subarray(n-r,n),0),e.wnext=r,e.whave=e.wsize):(e.wnext+=i,e.wnext===e.wsize&&(e.wnext=0),e.whave<e.wsize&&(e.whave+=i))),0}function Eh(){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}var Ch,Rh,Th=function(e){var t;return!e||!(t=e.state)||t.strm!==e||t.mode<16180||16211<t.mode?1:0},Oh=!0,xh=bh,Mh=_h,Ih=function(e,N){var t,n,F,r,i,o,a,s,l,U,u,c,z,B,d,f,h,p,j,W,m,v,g,y,w=0,b=new Uint8Array(4),H=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Th(e)||!e.output||!e.input&&0!==e.avail_in)return hh;16191===(t=e.state).mode&&(t.mode=16192),i=e.next_out,F=e.output,r=e.next_in,n=e.input,s=t.hold,l=t.bits,U=o=e.avail_in,u=a=e.avail_out,v=ch;e:for(;;)switch(t.mode){case 16180:if(0===t.wrap)t.mode=16192;else{for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}2&t.wrap&&35615===s?(0===t.wbits&&(t.wbits=15),b[t.check=0]=255&s,b[1]=s>>>8&255,t.check=Zd(t.check,b,2,0),l=s=0,t.mode=16181):(t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&s)<<8)+(s>>8))%31?(e.msg="incorrect header check",t.mode=ie):(15&s)!==gh?(e.msg="unknown compression method",t.mode=ie):(l-=4,m=8+(15&(s>>>=4)),0===t.wbits&&(t.wbits=m),15<m||m>t.wbits?(e.msg="invalid window size",t.mode=ie):(t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=512&s?16189:16191,l=s=0)))}break;case 16181:for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(t.flags=s,(255&t.flags)!==gh){e.msg="unknown compression method",t.mode=ie;break}if(57344&t.flags){e.msg="unknown header flags set",t.mode=ie;break}t.head&&(t.head.text=s>>8&1),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,t.check=Zd(t.check,b,2,0)),l=s=0,t.mode=16182;case 16182:for(;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.head&&(t.head.time=s),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,b[2]=s>>>16&255,b[3]=s>>>24&255,t.check=Zd(t.check,b,4,0)),l=s=0,t.mode=16183;case 16183:for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.head&&(t.head.xflags=255&s,t.head.os=s>>8),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,t.check=Zd(t.check,b,2,0)),l=s=0,t.mode=16184;case 16184:if(1024&t.flags){for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.length=s,t.head&&(t.head.extra_len=s),512&t.flags&&4&t.wrap&&(b[0]=255&s,b[1]=s>>>8&255,t.check=Zd(t.check,b,2,0)),l=s=0}else t.head&&(t.head.extra=null);t.mode=16185;case 16185:if(1024&t.flags&&((c=(c=t.length)>o?o:c)&&(t.head&&(m=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(r,r+c),m)),512&t.flags&&4&t.wrap&&(t.check=Zd(t.check,n,c,r)),o-=c,r+=c,t.length-=c),t.length))break e;t.length=0,t.mode=16186;case 16186:if(2048&t.flags){if(0===o)break e;for(c=0;m=n[r+c++],t.head&&m&&t.length<65536&&(t.head.name+=String.fromCharCode(m)),m&&c<o;);if(512&t.flags&&4&t.wrap&&(t.check=Zd(t.check,n,c,r)),o-=c,r+=c,m)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=16187;case 16187:if(4096&t.flags){if(0===o)break e;for(c=0;m=n[r+c++],t.head&&m&&t.length<65536&&(t.head.comment+=String.fromCharCode(m)),m&&c<o;);if(512&t.flags&&4&t.wrap&&(t.check=Zd(t.check,n,c,r)),o-=c,r+=c,m)break e}else t.head&&(t.head.comment=null);t.mode=16188;case 16188:if(512&t.flags){for(;l<16;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(4&t.wrap&&s!==(65535&t.check)){e.msg="header crc mismatch",t.mode=ie;break}l=s=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=16191;break;case 16189:for(;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}e.adler=t.check=th(s),l=s=0,t.mode=16190;case 16190:if(0===t.havedict)return e.next_out=i,e.avail_out=a,e.next_in=r,e.avail_in=o,t.hold=s,t.bits=l,fh;e.adler=t.check=1,t.mode=16191;case 16191:if(N===lh||N===uh)break e;case 16192:if(t.last)s>>>=7&l,l-=7&l,t.mode=16206;else{for(;l<3;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}switch(t.last=1&s,--l,3&(s>>>=1)){case 0:t.mode=16193;break;case 1:_=k=void 0;var k=t;if(Oh){Ch=new Int32Array(512),Rh=new Int32Array(32);for(var _=0;_<144;)k.lens[_++]=8;for(;_<256;)k.lens[_++]=9;for(;_<280;)k.lens[_++]=7;for(;_<288;)k.lens[_++]=8;for(eh(1,k.lens,0,288,Ch,0,k.work,{bits:9}),_=0;_<32;)k.lens[_++]=5;eh(2,k.lens,0,32,Rh,0,k.work,{bits:5}),Oh=!1}if(k.lencode=Ch,k.lenbits=9,k.distcode=Rh,k.distbits=5,t.mode=16199,N!==uh)break;s>>>=2,l-=2;break e;case 2:t.mode=16196;break;case 3:e.msg="invalid block type",t.mode=ie}s>>>=2,l-=2}break;case 16193:for(s>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if((65535&s)!=(s>>>16^65535)){e.msg="invalid stored block lengths",t.mode=ie;break}if(t.length=65535&s,l=s=0,t.mode=16194,N===uh)break e;case 16194:t.mode=16195;case 16195:if(c=t.length){if(0===(c=a<(c=o<c?o:c)?a:c))break e;F.set(n.subarray(r,r+c),i),o-=c,r+=c,a-=c,i+=c,t.length-=c}else t.mode=16191;break;case 16196:for(;l<14;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(t.nlen=257+(31&s),s>>>=5,l-=5,t.ndist=1+(31&s),s>>>=5,l-=5,t.ncode=4+(15&s),s>>>=4,l-=4,286<t.nlen||30<t.ndist){e.msg="too many length or distance symbols",t.mode=ie;break}t.have=0,t.mode=16197;case 16197:for(;t.have<t.ncode;){for(;l<3;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.lens[H[t.have++]]=7&s,s>>>=3,l-=3}for(;t.have<19;)t.lens[H[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,g={bits:t.lenbits},v=eh(0,t.lens,0,19,t.lencode,0,t.work,g),t.lenbits=g.bits,v){e.msg="invalid code lengths set",t.mode=ie;break}t.have=0,t.mode=16198;case 16198:for(;t.have<t.nlen+t.ndist;){for(;f=(w=t.lencode[s&(1<<t.lenbits)-1])>>>16&255,h=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(h<16)s>>>=d,l-=d,t.lens[t.have++]=h;else{if(16===h){for(y=d+2;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(s>>>=d,l-=d,0===t.have){e.msg="invalid bit length repeat",t.mode=ie;break}m=t.lens[t.have-1],c=3+(3&s),s>>>=2,l-=2}else if(17===h){for(y=d+3;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}m=0,c=3+(7&(s>>>=d)),s>>>=3,l=l-d-3}else{for(y=d+7;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}m=0,c=11+(127&(s>>>=d)),s>>>=7,l=l-d-7}if(t.have+c>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=ie;break}for(;c--;)t.lens[t.have++]=m}}if(t.mode===ie)break;if(0===t.lens[256]){e.msg="invalid code -- missing end-of-block",t.mode=ie;break}if(t.lenbits=9,g={bits:t.lenbits},v=eh(1,t.lens,0,t.nlen,t.lencode,0,t.work,g),t.lenbits=g.bits,v){e.msg="invalid literal/lengths set",t.mode=ie;break}if(t.distbits=6,t.distcode=t.distdyn,g={bits:t.distbits},v=eh(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,g),t.distbits=g.bits,v){e.msg="invalid distances set",t.mode=ie;break}if(t.mode=16199,N===uh)break e;case 16199:t.mode=16200;case 16200:if(6<=o&&258<=a){e.next_out=i,e.avail_out=a,e.next_in=r,e.avail_in=o,t.hold=s,t.bits=l,M=P=V=O=T=R=C=E=S=re=ne=te=ee=L=D=Q=Y=X=$=K=J=Z=A=G=I=q=x=void 0;var S,E,C,R,T,O,x=e,q=u,M=x.state,I=x.next_in,V=x.input,G=I+(x.avail_in-5),A=x.next_out,P=x.output,Z=A-(q-x.avail_out),J=A+(x.avail_out-257),K=M.dmax,$=M.wsize,X=M.whave,Y=M.wnext,Q=M.window,D=M.hold,L=M.bits,ee=M.lencode,te=M.distcode,ne=(1<<M.lenbits)-1,re=(1<<M.distbits)-1;t:do{for(L<15&&(D+=V[I++]<<L,L+=8,D+=V[I++]<<L,L+=8),S=ee[D&ne];;){if(D>>>=E=S>>>24,L-=E,0==(E=S>>>16&255))P[A++]=65535&S;else{if(!(16&E)){if(0==(64&E)){S=ee[(65535&S)+(D&(1<<E)-1)];continue}if(32&E){M.mode=16191;break t}x.msg="invalid literal/length code",M.mode=16209;break t}for(C=65535&S,(E&=15)&&(L<E&&(D+=V[I++]<<L,L+=8),C+=D&(1<<E)-1,D>>>=E,L-=E),L<15&&(D+=V[I++]<<L,L+=8,D+=V[I++]<<L,L+=8),S=te[D&re];;){if(D>>>=E=S>>>24,L-=E,!(16&(E=S>>>16&255))){if(0==(64&E)){S=te[(65535&S)+(D&(1<<E)-1)];continue}x.msg="invalid distance code",M.mode=16209;break t}if(R=65535&S,L<(E&=15)&&(D+=V[I++]<<L,(L+=8)<E)&&(D+=V[I++]<<L,L+=8),(R+=D&(1<<E)-1)>K){x.msg="invalid distance too far back",M.mode=16209;break t}if(D>>>=E,L-=E,R>(E=A-Z)){if((E=R-E)>X&&M.sane){x.msg="invalid distance too far back",M.mode=16209;break t}if(O=Q,(T=0)===Y){if(T+=$-E,E<C){for(C-=E;P[A++]=Q[T++],--E;);T=A-R,O=P}}else if(Y<E){if(T+=$+Y-E,(E-=Y)<C){for(C-=E;P[A++]=Q[T++],--E;);if(T=0,Y<C){for(C-=E=Y;P[A++]=Q[T++],--E;);T=A-R,O=P}}}else if(T+=Y-E,E<C){for(C-=E;P[A++]=Q[T++],--E;);T=A-R,O=P}for(;2<C;)P[A++]=O[T++],P[A++]=O[T++],P[A++]=O[T++],C-=3;C&&(P[A++]=O[T++],1<C)&&(P[A++]=O[T++])}else{for(T=A-R;P[A++]=P[T++],P[A++]=P[T++],P[A++]=P[T++],2<(C-=3););C&&(P[A++]=P[T++],1<C)&&(P[A++]=P[T++])}break}}break}}while(I<G&&A<J);I-=C=L>>3,D&=(1<<(L-=C<<3))-1,x.next_in=I,x.next_out=A,x.avail_in=I<G?G-I+5:5-(I-G),x.avail_out=A<J?J-A+257:257-(A-J),M.hold=D,M.bits=L,i=e.next_out,F=e.output,a=e.avail_out,r=e.next_in,n=e.input,o=e.avail_in,s=t.hold,l=t.bits,16191===t.mode&&(t.back=-1);break}for(t.back=0;f=(w=t.lencode[s&(1<<t.lenbits)-1])>>>16&255,h=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(f&&0==(240&f)){for(p=d,j=f,W=h;f=(w=t.lencode[W+((s&(1<<p+j)-1)>>p)])>>>16&255,h=65535&w,!(p+(d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}s>>>=p,l-=p,t.back+=p}if(s>>>=d,l-=d,t.back+=d,t.length=h,0===f){t.mode=16205;break}if(32&f){t.back=-1,t.mode=16191;break}if(64&f){e.msg="invalid literal/length code",t.mode=ie;break}t.extra=15&f,t.mode=16201;case 16201:if(t.extra){for(y=t.extra;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.length+=s&(1<<t.extra)-1,s>>>=t.extra,l-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=16202;case 16202:for(;f=(w=t.distcode[s&(1<<t.distbits)-1])>>>16&255,h=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(0==(240&f)){for(p=d,j=f,W=h;f=(w=t.distcode[W+((s&(1<<p+j)-1)>>p)])>>>16&255,h=65535&w,!(p+(d=w>>>24)<=l);){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}s>>>=p,l-=p,t.back+=p}if(s>>>=d,l-=d,t.back+=d,64&f){e.msg="invalid distance code",t.mode=ie;break}t.offset=h,t.extra=15&f,t.mode=16203;case 16203:if(t.extra){for(y=t.extra;l<y;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}t.offset+=s&(1<<t.extra)-1,s>>>=t.extra,l-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=ie;break}t.mode=16204;case 16204:if(0===a)break e;if(t.offset>(c=u-a)){if((c=t.offset-c)>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=ie;break}z=c>t.wnext?(c-=t.wnext,t.wsize-c):t.wnext-c,c>t.length&&(c=t.length),B=t.window}else B=F,z=i-t.offset,c=t.length;for(a-=c=a<c?a:c,t.length-=c;F[i++]=B[z++],--c;);0===t.length&&(t.mode=16200);break;case 16205:if(0===a)break e;F[i++]=t.length,a--,t.mode=16200;break;case 16206:if(t.wrap){for(;l<32;){if(0===o)break e;o--,s|=n[r++]<<l,l+=8}if(u-=a,e.total_out+=u,t.total+=u,4&t.wrap&&u&&(e.adler=t.check=(t.flags?Zd:Vd)(t.check,F,u,i-u)),u=a,4&t.wrap&&(t.flags?s:th(s))!==t.check){e.msg="incorrect data check",t.mode=ie;break}l=s=0}t.mode=16207;case 16207:if(t.wrap&&t.flags){for(;l<32;){if(0===o)break e;o--,s+=n[r++]<<l,l+=8}if(4&t.wrap&&s!==(4294967295&t.total)){e.msg="incorrect length check",t.mode=ie;break}l=s=0}t.mode=16208;case 16208:v=dh;break e;case ie:v=ph;break e;case 16210:return mh;default:return hh}return e.next_out=i,e.avail_out=a,e.next_in=r,e.avail_in=o,t.hold=s,t.bits=l,(t.wsize||u!==e.avail_out&&t.mode<ie&&(t.mode<16206||N!==sh))&&Sh(e,e.output,e.next_out,u-e.avail_out),u-=e.avail_out,e.total_in+=U-=e.avail_in,e.total_out+=u,t.total+=u,4&t.wrap&&u&&(e.adler=t.check=(t.flags?Zd:Vd)(t.check,F,u,e.next_out-u)),e.data_type=t.bits+(t.last?64:0)+(16191===t.mode?128:0)+(16199===t.mode||16194===t.mode?256:0),v=(0==U&&0===u||N===sh)&&v===ch?vh:v},Ah=function(e){var t;return Th(e)?hh:((t=e.state).window&&(t.window=null),e.state=null,ch)},Ph=function(e,t){return Th(e)||0==(2&(e=e.state).wrap)?hh:((e.head=t).done=!1,ch)},Dh=function(e,t){var n,r=t.length;return Th(e)||0!==(n=e.state).wrap&&16190!==n.mode?hh:16190===n.mode&&Vd(1,t,r,0)!==n.check?ph:Sh(e,t,r,r)?(n.mode=16210,mh):(n.havedict=1,ch)},Lh=Object.prototype.toString,Nh=y.Z_NO_FLUSH,Fh=y.Z_FINISH,Uh=y.Z_OK,zh=y.Z_STREAM_END,Bh=y.Z_NEED_DICT,jh=y.Z_STREAM_ERROR,Wh=y.Z_DATA_ERROR,Hh=y.Z_MEM_ERROR,qh=y.Z_BUF_ERROR,Vh={chunkSize:65536,windowBits:15,to:""};function Gh(e){this.options=Mf({},Vh,e||{});var t=this.options,e=(t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits)&&(t.windowBits=-15),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Hf,this.strm.avail_out=0,Mh(this.strm,t.windowBits));if(e!==Uh)throw new Error(Jd[e]);if(this.header=new Eh,Ph(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Wf(t.dictionary):"[object ArrayBuffer]"===Lh.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw)&&(e=Dh(this.strm,t.dictionary))!==Uh)throw new Error(Jd[e])}function Zh(e,t){t=new Gh(t);if(t.push(e,!0),t.err)throw t.msg||Jd[t.err];return t.result}Gh.prototype.push=function(e,t){var n,r,i=this.strm,o=this.options.chunkSize,a=this.options.dictionary;if(this.ended)return!1;for(r=t===~~t?t:!0===t?Fh:Nh,"[object ArrayBuffer]"===Lh.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(o),i.next_out=0,i.avail_out=o),(n=Ih(i,r))===Bh&&a&&((n=Dh(i,a))===Uh?n=Ih(i,r):n===Wh&&(n=Bh));0<i.avail_in&&n===zh&&2&i.state.wrap&&0!==i.state.flags&&0!==i.input[i.next_in];)xh(i),n=Ih(i,r);switch(n){case jh:case Wh:case Bh:case Hh:return this.onEnd(n),!(this.ended=!0)}var s,l,u,c=i.avail_out;if(i.next_out&&(0===i.avail_out||n===zh||0<r)&&("string"===this.options.to?(s=((e,t)=>{for(var n=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=n&&128==(192&e[n]);)n--;return!(n<0||0===n)&&n+Bf[e[n]]>t?n:t})(i.output,i.next_out),l=i.next_out-s,u=((e,t)=>{var n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));for(var r=new Array(2*n),i=0,o=0;o<n;){var a=e[o++];if(a<128)r[i++]=a;else{var s=Bf[a];if(4<s)r[i++]=65533,o+=s-1;else{for(a&=2===s?31:3===s?15:7;1<s&&o<n;)a=a<<6|63&e[o++],s--;1<s?r[i++]=65533:a<65536?r[i++]=a:(a-=65536,r[i++]=55296|a>>10&1023,r[i++]=56320|1023&a)}}}var l=r,u=i;if(u<65534&&l.subarray&&zf)return String.fromCharCode.apply(null,l.length===u?l:l.subarray(0,u));for(var c="",d=0;d<u;d++)c+=String.fromCharCode(l[d]);return c})(i.output,s),i.next_out=l,i.avail_out=o-l,l&&i.output.set(i.output.subarray(s,s+l),0),this.onData(u)):(this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out)),i.avail_out=0,i.next_out=0)),n!==Uh&&n!==qh||0!==c){if(n===zh)return n=Ah(this.strm),this.onEnd(n),this.ended=!0;if(0===i.avail_in){if(r===Fh)return n=Ah(this.strm),this.onEnd(n===Uh?qh:n),!(this.ended=!0);break}}}return!0},Gh.prototype.onData=function(e){this.chunks.push(e)},Gh.prototype.onEnd=function(e){e===Uh&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=If(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Jh={Inflate:Gh,inflate:Zh,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Zh(e,t)},ungzip:Zh,constants:y},Kh={Deflate:nh.Deflate,deflate:nh.deflate,deflateRaw:nh.deflateRaw,gzip:nh.gzip,Inflate:Jh.Inflate,inflate:Jh.inflate,inflateRaw:Jh.inflateRaw,ungzip:Jh.ungzip,constants:y},$h=(ep.prototype.uploadReplay=function(n){return P(this,void 0,void 0,function(){var t;return D(this,function(e){switch(e.label){case 0:if(this.isUploading)return Gr("Uploader","Upload in progress, skipping"),[2,!1];this.isUploading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),(t=this.config.beforeSend(n))?[4,this.doUploadWithRetry(t,0)]:(h("Uploader","Upload cancelled by beforeSend"),[2,!1]);case 2:return e.sent(),h("Uploader","Upload success:",{replay_id:n.replay_id,segment_id:n.segment_id}),[2,!0];case 3:return Zr("Uploader","Upload failed:",t=e.sent()),this.config.onError(t),[2,!1];case 4:return this.isUploading=!1,[7];case 5:return[2]}})})},ep.prototype.doUploadWithRetry=function(r,i){return P(this,void 0,void 0,function(){var t,n;return D(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,5]),[4,this.doUpload(r)];case 1:return e.sent(),[3,5];case 2:return t=e.sent(),i<this.config.maxRetries?(h("Uploader","Retrying in "+(n=1e3*Math.pow(2,i))+"ms (attempt "+(i+1)+"/"+this.config.maxRetries+")"),[4,this.sleep(n)]):[3,4];case 3:return e.sent(),[2,this.doUploadWithRetry(r,i+1)];case 4:throw t;case 5:return[2]}})})},ep.prototype.prepareUploadPayload=function(e){var t=e.replay_format||"rrweb",n=e.events_encoding||"plain_json";if("rrweb"!==t)return e;if(!this.config.eventsCompression||"gzip_base64"===n)return x(x({},e),{replay_format:t,platform:e.platform||"web",events_encoding:n});try{var r=Kh.gzip(e.events),i=this.uint8ArrayToBase64(r),o=e.events.length,a=r.length,s=i.length;return h("Uploader","Events compressed: "+Math.round(o/1024)+"KB -> gzip "+Math.round(a/1024)+"KB -> base64 "+Math.round(s/1024)+"KB"),x(x({},e),{replay_format:t,platform:e.platform||"web",events_encoding:"gzip_base64",events:i})}catch(n){return Gr("Uploader","Events compression failed, fallback to plain_json:",n),x(x({},e),{replay_format:t,platform:e.platform||"web",events_encoding:"plain_json"})}},ep.prototype.uint8ArrayToBase64=function(e){for(var t="",n=0;n<e.length;n+=32768){for(var r=e.subarray(n,n+32768),i="",o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);t+=i}if("function"==typeof btoa)return btoa(t);if("undefined"!=typeof Buffer)return Buffer.from(e).toString("base64");throw new Error("base64 encode is not supported")},ep.prototype.doUpload=function(i){return P(this,void 0,void 0,function(){var t,n,r;return D(this,function(e){switch(e.label){case 0:if(t=this.prepareUploadPayload(i),r=JSON.stringify(t),n={"Content-Type":"application/json","X-App-ID":this.config.appId},h("Uploader","Sending replay payload: "+Math.round(r.length/1024)+"KB, events_encoding="+(t.events_encoding||"plain_json")),r.length<65536||h("Uploader","Data size "+Math.round(r.length/1024)+"KB exceeds keepalive limit, using normal fetch"),this.config.transport)return[4,this.config.transport.request({kind:"replay",url:this.config.uploadUrl,method:"POST",headers:n,body:r})];throw new Error("Replay Transport is not configured");case 1:if(t=e.sent(),!(n=t||{ok:!1,status:0,statusText:"Transport failed"}).ok)throw new Error("HTTP "+(n.status||0)+": "+(n.statusText||"Transport failed"));if(0!==(r="string"==typeof n.body?JSON.parse(n.body):n.body).code)throw new Error("Server error (code "+r.code+"): "+r.message);return[2]}})})},ep.prototype.sendBeacon=function(e){var t;try{var n=this.prepareUploadPayload(e),r=JSON.stringify(n);return!(null==(t=this.config.transport)||!t.handoff||(this.config.transport.handoff({kind:"replay",url:this.config.uploadUrl,method:"POST",contentType:"application/json",body:r,sendBeacon:!0}),0))}catch(e){return Zr("Uploader","sendBeacon failed:",e),!1}},ep.prototype.isUploadInProgress=function(){return this.isUploading},ep.prototype.sleep=function(t){return new Promise(function(e){return setTimeout(e,t)})},ep),Xh=["a","button",'input[type="button"]','input[type="submit"]','[role="button"]',"[onclick]","[ng-click]","[v-on\\:click]"].join(","),Yh=(Qh.prototype.start=function(){this.isRunning||(document.addEventListener("pointerdown",this.handlePointerDown,!0),document.addEventListener("click",this.handleClick,!0),this.isRunning=!0,h("ClickDetector","Started"))},Qh.prototype.stop=function(){this.isRunning&&(document.removeEventListener("pointerdown",this.handlePointerDown,!0),document.removeEventListener("click",this.handleClick,!0),this.cleanupSlowClick(),this.isRunning=!1,h("ClickDetector","Stopped"))},Qh.prototype.handlePointerDown=function(e){var t,n,r=this,i=e.target;i&&i instanceof Element&&(i=this.getClickableElement(i))&&(this.cleanupSlowClick(),this.clickStartTime=Date.now(),this.clickNode=i,t=this.getNodeInfo(i),n=this.getExternalNavigationReason(e,i),this.options.onClickStart({node:t,timestamp:this.clickStartTime,target:i,event:e,effectiveActionReason:n||void 0}),n?this.markEffectiveAction(n):(this.slowClickTimeoutId=setTimeout(function(){r.handleSlowClick("timeout")},this.options.slowClickTimeout),this.startMutationObserver()))},Qh.prototype.handleClick=function(e){var t=this,n=e.target,r=Date.now();this.rageActiveTarget&&r-this.rageLastClickTime>=this.options.rageClickWindow&&(this.rageActiveTarget=null,this.rageLastClickTime=0),this.rageActiveTarget&&this.isSameTarget(this.rageActiveTarget,n)?this.rageLastClickTime=r:(this.clickHistory.push({time:r,target:n}),this.clickHistory=this.clickHistory.filter(function(e){return r-e.time<t.options.rageClickWindow}),(e=this.clickHistory.filter(function(e){return t.isSameTarget(e.target,n)})).length>=this.options.rageClickCount&&(this.options.onRageClick({node:this.getNodeInfo(n),clickCount:e.length,timeWindowMs:this.options.rageClickWindow,timestamp:r}),this.rageActiveTarget=n,this.rageLastClickTime=r))},Qh.prototype.startMutationObserver=function(){var t=this;this.clickNode&&document.body&&"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver(function(e){t.hasSignificantMutation(e)&&(t.emitEffectiveAction("dom_mutation"),t.handleSlowClick("mutation"))}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","hidden","disabled","aria-hidden","aria-disabled","aria-busy"],characterData:!0}))},Qh.prototype.hasSignificantMutation=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];if("characterData"===r.type)return!0;if("childList"===r.type&&(0<r.addedNodes.length||0<r.removedNodes.length)&&Array.from(r.addedNodes).concat(Array.from(r.removedNodes)).some(function(e){return e.nodeType===Node.ELEMENT_NODE&&!["SCRIPT","STYLE","LINK"].includes(e.tagName)}))return!0;if("attributes"===r.type){r=r.attributeName;if(["class","style","hidden","disabled","aria-hidden","aria-disabled","aria-busy"].includes(r||""))return!0}}return!1},Qh.prototype.handleSlowClick=function(e){var t;this.clickNode&&this.clickStartTime&&((t=Date.now()-this.clickStartTime)>=this.options.slowClickThreshold&&this.options.onSlowClick({node:this.getNodeInfo(this.clickNode),timeAfterClickMs:t,endReason:e,timestamp:this.clickStartTime}),this.cleanupSlowClick())},Qh.prototype.cleanupSlowClick=function(){this.slowClickTimeoutId&&(clearTimeout(this.slowClickTimeoutId),this.slowClickTimeoutId=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.clickStartTime=0,this.clickNode=null},Qh.prototype.isSameTarget=function(e,t){return e===t||e.contains(t)||t.contains(e)},Qh.prototype.markEffectiveAction=function(e){this.clickNode&&this.clickStartTime&&(this.emitEffectiveAction(e),this.cleanupSlowClick())},Qh.prototype.emitEffectiveAction=function(e){this.clickNode&&this.options.onEffectiveAction({reason:e,timestamp:Date.now(),node:this.getNodeInfo(this.clickNode)})},Qh.prototype.getClickableElement=function(e){return e.matches(Xh)?e:e.closest(Xh)},Qh.prototype.getExternalNavigationReason=function(e,t){var n=t.closest("a");if(n){if(n.download)return"download";var r=(n.getAttribute("target")||"").toLowerCase();if(r&&"_self"!==r)return"external_navigation";if(n.href&&(1===e.button||e.metaKey||e.ctrlKey||e.shiftKey))return"external_navigation"}r=t.closest("form"),n=((null==r?void 0:r.getAttribute("target"))||"").toLowerCase();return n&&"_self"!==n?"external_navigation":t.hasAttribute("data-tdem-ignore-dead-click")||t.closest("[data-tdem-ignore-dead-click]")||t.hasAttribute("data-tdem-effective-action")||t.closest("[data-tdem-effective-action]")?"custom":null},Qh.prototype.getNodeInfo=function(e){var t;return{id:(null==(t=e.__sn)?void 0:t.id)||0,tagName:e.tagName.toLowerCase(),textContent:(e.textContent||"").trim().substring(0,100),selector:this.getSelector(e)}},Qh.prototype.getSelector=function(e){for(var t=[],n=e;n&&n!==document.body&&t.length<5;){var r,i=n.tagName.toLowerCase();if(n.id){i+="#"+n.id,t.unshift(i);break}n.className&&"string"==typeof n.className&&0<(r=n.className.trim().split(/\s+/).slice(0,2)).length&&(i+="."+r.join(".")),t.unshift(i),n=n.parentElement}return t.join(" > ")},Qh.prototype.isActive=function(){return this.isRunning},Qh);function Qh(e){var t;void 0===e&&(e={}),this.isRunning=!1,this.clickStartTime=0,this.clickNode=null,this.slowClickTimeoutId=null,this.mutationObserver=null,this.clickHistory=[],this.rageActiveTarget=null,this.rageLastClickTime=0,this.options={slowClickTimeout:null!=(t=e.slowClickTimeout)?t:7e3,slowClickThreshold:null!=(t=e.slowClickThreshold)?t:3e3,rageClickCount:null!=(t=e.rageClickCount)?t:5,rageClickWindow:null!=(t=e.rageClickWindow)?t:1e3,onSlowClick:e.onSlowClick||function(){},onRageClick:e.onRageClick||function(){},onClickStart:e.onClickStart||function(){},onEffectiveAction:e.onEffectiveAction||function(){},onDeadClick:e.onDeadClick||function(){}},this.handleClick=this.handleClick.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this)}function ep(e){var t;this.isUploading=!1,this.useCompression=!1,this.config={uploadUrl:e.uploadUrl||"/api/v1/collect/replay",appId:e.appId,maxRetries:null!=(t=e.maxRetries)?t:3,beforeSend:e.beforeSend||function(e){return e},onError:e.onError||function(){},eventsCompression:null==(t=e.eventsCompression)||t,transport:e.transport}}function tp(e){return Number.isNaN(e)?0:Math.max(0,Math.min(1,e))}function np(e){return tp((e=e,(Number.isNaN(e)?0:Math.max(0,Math.min(100,e)))/100))}function rp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ip(e,t){var e=!1===(e=e)||void 0===e?{enabled:!1,sessionSampleRate:.1,errorSampleRate:1,errorTraceback:!0}:!0===e?{enabled:!0,sessionSampleRate:.1,errorSampleRate:1,errorTraceback:!0}:{enabled:!1!==e.enabled,sessionSampleRate:"number"==typeof e.sessionSampleRate?tp(e.sessionSampleRate):.1,errorSampleRate:"number"==typeof e.errorSampleRate?tp(e.errorSampleRate):1,errorTraceback:void 0===e.errorTraceback||!!e.errorTraceback},t=t&&"object"==typeof t?t:null,n=e.enabled,r=(t&&rp(t,"enabled")&&(n=e.enabled&&!!t.enabled),e.sessionSampleRate),i=e.errorSampleRate,e=e.errorTraceback;return n&&t&&(rp(t,"replay_sample_rate")&&null!=t.replay_sample_rate&&(r=np(Number(t.replay_sample_rate))),rp(t,"error_traceback")&&null!=t.error_traceback&&(e=!!t.error_traceback),rp(t,"error_sample_rate"))&&null!=t.error_sample_rate&&(i=np(Number(t.error_sample_rate))),{enabled:n,sessionSampleRate:r,errorSampleRate:e?i:0,errorTraceback:e}}function op(e,t){return x(x({},e),{enabled:t.enabled,sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,errorTraceback:t.errorTraceback})}function ap(e){var t=null==(t=e)?void 0:t._tdemSampleGate;if(!t)return 1;if(t.isDecided&&t.isSampled)return(!(t=e._effectiveReplayPolicy)||t.enabled)&&!1!==e._replaySampled}new e({name:"sessionReplay"});function sp(e,t){return void 0===t&&(t=2),"number"==typeof e&&Number.isFinite(e)?(t=Math.pow(10,Math.max(0,Math.min(12,Math.floor(t)))),Math.round(e*t)/t):0}function lp(e,t){return void 0===t&&(t=2048),"string"==typeof e&&e.trim()?e.trim().slice(0,Math.max(1,Math.floor(t))):"unknown"}function up(e){var t,n=Tp.get(e);if(n){n.destroyed=!0;try{null!=(t=n.observer)&&t.disconnect()}catch(e){}n.observer=null,n.lagRecords.length=0,e.lifeCycle.remove("destroy",n.onDestroy),Tp.delete(e)}}function cp(e){var t=e.nodeName.toLowerCase(),n=e.id||"",r=(e="string"==typeof(e=e).className?e.className:e.getAttribute("class")||"").split(" ").filter(Boolean).map(function(e){return"."+e}).join("");return{tagName:t,id:n,className:e,selector:t+(n?"#"+n:"")+r}}function dp(t,e){var n;if(null!=(n=null==e?void 0:e.tagName)&&n.some(function(e){return t.tagName===e.toLowerCase().trim()}))return!0;if(t.id&&null!=(n=null==e?void 0:e.id)&&n.some(function(e){return t.id===e.trim()}))return!0;if(t.className&&null!=(n=null==e?void 0:e.className)&&n.length){var r=t.className.split(" ").map(function(e){return e.trim()}).filter(Boolean);if(e.className.some(function(e){return r.includes(e.trim())}))return!0}return!1}function fp(t,e){return e.some(function(e){return t.selector.includes(e)})}function hp(e){return{tagName:g(e.tagName||[]),id:g(e.id||[]),className:g(e.className||[])}}function pp(){return x(x({},xp),{containers:g(xp.containers),ignoreContainers:g(xp.ignoreContainers),containerMatchers:hp(xp.containerMatchers),ignoreMatchers:hp(xp.ignoreMatchers),detectStartPosition:x({},xp.detectStartPosition),ignoreElesWhenDomChange:g(xp.ignoreElesWhenDomChange)})}function mp(e,t){return void 0===t&&(t=2),t=Math.pow(10,t),Math.round(e*t)/t}function vp(e){var t,n=Ip.get(e);n&&(n.destroyed=!0,n.detectTimer&&clearTimeout(n.detectTimer),n.bodyWaitTimer&&clearTimeout(n.bodyWaitTimer),null!==n.idleCallbackId&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(n.idleCallbackId),n.idleCallbackId=null),null!==n.bodyWaitFrame&&(window.cancelAnimationFrame||clearTimeout)(n.bodyWaitFrame),null!=(t=n.observer)&&t.disconnect(),e.lifeCycle.remove("errorOccurred",n.onErrorOccurred),e.lifeCycle.remove("destroy",n.onDestroy),window.removeEventListener("pagehide",n.handlePageHide),window.removeEventListener("beforeunload",n.handleBeforeUnload),document.removeEventListener("visibilitychange",n.handleVisibilityChange),Ip.delete(e))}function gp(e,t,n){null!=(e=null==e?void 0:e.config)&&e.debug&&"undefined"!=typeof console&&console.warn("[TDEM] "+t+": "+n+", fallback applied")}function yp(){var e;try{var t=null==(e=window.performance)?void 0:e.memory;return!t||!Dp(t.usedJSHeapSize)||!Dp(t.totalJSHeapSize)||!Dp(t.jsHeapSizeLimit)||t.usedJSHeapSize<0||t.totalJSHeapSize<0||t.jsHeapSizeLimit<0?null:{used:t.usedJSHeapSize,total:t.totalJSHeapSize,limit:t.jsHeapSizeLimit,ratio:0<t.jsHeapSizeLimit?Math.min(1,t.usedJSHeapSize/t.jsHeapSizeLimit):0}}catch(e){return null}}function wp(e){var t=Pp.get(e);t&&(t.destroyed=!0,t.reportTimer&&clearInterval(t.reportTimer),t.oomCheckTimer&&clearInterval(t.oomCheckTimer),t.records.length=0,e.lifeCycle.remove("destroy",t.onDestroy),"undefined"!=typeof window&&(window.removeEventListener("pagehide",t.onPageExit),window.removeEventListener("beforeunload",t.onPageExit)),Pp.delete(e))}function bp(e,t,n){var r,i,o;t.destroyed||(i=yp())&&(t.records.push(i),50<t.records.length&&t.records.shift(),o=at(e),n={event_id:A(),event_type:n,event_category:I.PERFORMANCE,timestamp:Date.now(),page_url:(null==(r=e.getOriginFrom)?void 0:r.call(e))||window.location.href,data:x(x({measurements:x({used_js_heap_size_bytes:i.used,total_js_heap_size_bytes:i.total,js_heap_size_limit_bytes:i.limit,usage_ratio:i.ratio},n===M.MEMORY_OOM?{oom_threshold_mb:t.config.oomThreshold}:{}),event_properties:{detection_source:"performance_memory"}},o?{replay_id:o}:{}),{tags:{environment:(null==(r=e.config)?void 0:r.env)||"production",version:String((null==(i=e.config)?void 0:i.version)||"")}})},e.reportTDEMEvent(n))}var kp=new e({name:"sessionReplay",sessionManager:null,eventBuffer:null,recorderManager:null,samplerManager:null,uploader:null,clickDetector:null,flushTimer:null,replayConfig:null,isInitialized:!1,errorTraceback:!0,_tdemRef:null,_isCheckoutFlushing:!1,_lastLifecycleSnapshotAt:0,init:function(e){},applyEffectivePolicy:function(e){var t,n;if(this.errorTraceback=e.errorTraceback,this.replayConfig&&(this.replayConfig=op(this.replayConfig,e)),this.samplerManager&&this.samplerManager.updateRates(e.sessionSampleRate,e.errorSampleRate),this.isInitialized){if(e.enabled)return(n=this.samplerManager)?0<e.sessionSampleRate||e.errorTraceback&&0<e.errorSampleRate?!e.errorTraceback&&n.isBufferMode()?(h("Plugin","Error traceback off while in buffer, stopping replay"),this.stopReplay(),null!=(t=this.eventBuffer)&&t.clear(),void n.forceMode(!1)):void(e.errorTraceback&&e.sessionSampleRate<=0&&0<e.errorSampleRate&&n.isSessionMode()&&(h("Plugin","Remote SSR=0 with traceback on: demote session→buffer"),n.forceMode("buffer"),this.flushTimer)&&(clearInterval(this.flushTimer),this.flushTimer=null)):(h("Plugin","Effective policy no longer allows recording, stopping"),this.stopReplay(),null!=(t=this.eventBuffer)&&t.clear(),void n.forceMode(!1)):void 0;h("Plugin","Effective policy disabled, stopping replay"),this.stopReplay(),null!=(e=this.eventBuffer)&&e.clear()}},shouldSkipBufferFlush:function(){var e;return!0===(null==(e=this.samplerManager)?void 0:e.isBufferMode())},onNewTdem:function(e,t){var n,r,t=this.parseConfig(t),i=null!=(i=t.debug)&&i,i=(Hr=i,e._effectiveReplayPolicy);i||(i=ip(t,(n=e._prefetchedConfigData)&&"object"==typeof n&&("replay_sample_rate"in n||"error_traceback"in n||"error_sample_rate"in n||"tdem_sample_rate"in n||"enabled"in n)?(r={},Object.prototype.hasOwnProperty.call(n,"enabled")&&(r.enabled=!!n.enabled),Object.prototype.hasOwnProperty.call(n,"replay_sample_rate")&&(r.replay_sample_rate=Number(n.replay_sample_rate)),Object.prototype.hasOwnProperty.call(n,"error_traceback")&&(r.error_traceback=!!n.error_traceback),Object.prototype.hasOwnProperty.call(n,"error_sample_rate")&&(r.error_sample_rate=Number(n.error_sample_rate)),r):null),e._effectiveReplayPolicy=i,e._replaySampled=i.enabled),i.enabled?(n=op(x(x({},t),{enabled:!0}),i),this.replayConfig=n,this.errorTraceback=i.errorTraceback,this._tdemRef=e,this.initializeModules(e,n),(r=this.samplerManager.initializeSampling()).shouldRecord?(this.startReplay(e,n,r.mode),this.registerReplaySamplingCheck(e,n),this.listenForErrors(e,n),this.listenForPerformance(e),this.listenForLifecycle(e,n),this.listenForUnload(e),this.isInitialized=!0):h("Plugin","Not sampled by sampler, skipping")):h("Plugin","disabled by effective policy")},registerReplaySamplingCheck:function(t,e){function n(e){clearInterval(i),e?(h("Plugin","Session/policy rejected, stopping replay and clearing buffer"),r.stopReplay(),r.eventBuffer&&r.eventBuffer.clear()):h("Plugin","Session sampled, replay continues")}var r=this,i=setInterval(function(){var e=null==(e=t)?void 0:e._tdemSampleGate;e&&e.isDecided&&(e.isSampled&&(!(e=t._effectiveReplayPolicy)||e.enabled)?n(!1):n(!0))},50);t.lifeCycle.on("destroy",function(){clearInterval(i)})},parseConfig:function(e){return!0===e?{enabled:!0}:"object"==typeof e?x(x({},e),{enabled:!1!==e.enabled}):{enabled:!1}},initializeModules:function(t,e){var n=this,r=(this.sessionManager=new Jr({stickySession:null==(r=e.stickySession)||r}),this.sessionManager.setTdemInstance(t),t.sessionManager=this.sessionManager,this.eventBuffer=new Qr({},null!=(r=e.useCompression)&&r),this.samplerManager=new ed({sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate}),this.recorderManager=new Qc({onRecordingEvent:function(e){n.handleRecordingEvent(e,t)},onCheckout:function(){if(!n._isCheckoutFlushing){n._isCheckoutFlushing=!0;try{var e,t;n.shouldSkipBufferFlush()?h("SessionReplay","Checkout in buffer mode (error traceback), skip flush"):(e=n._tdemRef,t=n.replayConfig,e&&t&&n.eventBuffer&&!n.eventBuffer.isEmpty()&&(h("SessionReplay","Checkout triggered, flushing current buffer"),n.flushReplayData(e,t,!0)))}finally{n._isCheckoutFlushing=!1}}},mode:"session"},e),(t.config.url||t.config.hostUrl||"").replace(/\/+$/,""));this.uploader=new $h({uploadUrl:e.uploadUrl||r+"/api/v1/collect/replay",appId:String(t.config.id||""),beforeSend:e.beforeSend,onError:e.onError,eventsCompression:null==(r=e.eventsCompression)||r,transport:null==(r=t.getInternalTransport)?void 0:r.call(t)}),this.clickDetector=new Yh({slowClickTimeout:e.slowClickTimeout,slowClickThreshold:e.slowClickThreshold,rageClickCount:e.rageClickCount,rageClickWindow:e.rageClickWindow,onSlowClick:function(e){n.handleSlowClick(e,t)},onRageClick:function(e){n.handleRageClick(e,t)}}),h("Plugin","Modules initialized")},startReplay:function(e,t,n){var r;this.sessionManager&&this.recorderManager&&this.eventBuffer?(h("Plugin","Session started:",(this.sessionManager.restoreSession()||this.sessionManager.createSession(n)).id,"mode:",n),this.recorderManager.options.mode=n,r=$c(x({maskAllText:!1!==t.maskAllInputs,maskAllInputs:t.maskAllInputs,maskTextSelector:t.maskTextSelector,blockSelector:t.blockSelector,ignoreSelector:t.ignoreSelector},t.privacy)),this.recorderManager.startRecording({privacy:r}),this.clickDetector&&this.clickDetector.start(),"session"===n?this.startFlushTimer(e,t):h("Plugin","Buffer mode - flush on error only")):Zr("Plugin","Modules not initialized")},handleRecordingEvent:function(e,t){this.eventBuffer&&this.sessionManager&&(this.sanitizeDataURLs(e),this.eventBuffer.addEvent(e),this.sessionManager.updateActivity())},sanitizeDataURLs:function(e){var t=e.type;if(2===t){var n=null==(n=e.data)?void 0:n.node;n&&this.sanitizeNodeTree(n,1024)}else if(3===t){n=e.data;if(0===(null==n?void 0:n.source)&&Array.isArray(n.adds)){for(var r=0,i=n.adds;r<i.length;r++){var o=i[r];null!=o&&o.node&&this.sanitizeNodeTree(o.node,1024)}if(Array.isArray(n.attributes))for(var a=0,s=n.attributes;a<s.length;a++){var l=s[a];if(null!=l&&l.attributes)for(var u=0,c=Object.entries(l.attributes);u<c.length;u++){var d=c[u],f=d[0],d=d[1];"string"==typeof d&&1024<d.length&&d.startsWith("data:")&&(l.attributes[f]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}}}}},sanitizeNodeTree:function(e,t){if(e){if(e.attributes)for(var n=e.attributes,r=0,i=Object.keys(n);r<i.length;r++){var o=i[r],a=n[o];"string"==typeof a&&a.length>t&&a.startsWith("data:")&&(n[o]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}if(Array.isArray(e.childNodes))for(var s=0,l=e.childNodes;s<l.length;s++){var u=l[s];this.sanitizeNodeTree(u,t)}}},handleSlowClick:function(e,t){h("ClickDetector","Slow click detected:",e.timeAfterClickMs,"ms"),this.addCustomEvent({category:"ui.slowClickDetected",message:"Slow click: "+e.timeAfterClickMs+"ms on "+e.node.tagName,data:{node:e.node,timeAfterClickMs:e.timeAfterClickMs,endReason:e.endReason}},t)},handleRageClick:function(e,t){h("ClickDetector","Rage click detected:",e.clickCount,"clicks"),this.addCustomEvent({category:"ui.multiClick",message:"Rage click: "+e.clickCount+" clicks on "+e.node.tagName,data:{node:e.node,clickCount:e.clickCount,timeWindowMs:e.timeWindowMs}},t)},addCustomEvent:function(e,t){this.eventBuffer&&(e={type:5,data:{tag:e.category,payload:x({message:e.message},e.data)},timestamp:Date.now()},this.eventBuffer.addEvent(e))},startFlushTimer:function(e,t){var n=this;this.flushTimer&&clearInterval(this.flushTimer),this.flushTimer=setInterval(function(){n.flushReplayData(e,t)},2e4)},flushReplayData:function(c,d,f){return void 0===f&&(f=!1),P(this,void 0,void 0,function(){var t,n,r,i,o,a,s,l,u;return D(this,function(e){switch(e.label){case 0:return this.sessionManager&&this.eventBuffer&&this.uploader&&ap(c)&&(t=this.sessionManager.getSession())?this.sessionManager.shouldRefreshSession()?(h("Plugin","Session expired, refreshing"),this.stopReplay(),i=this.sessionManager.refreshSession(),c.lifeCycle.emit("sessionRefreshed"),n=c._replaySampled,i.sampled&&!1!==n&&this.startReplay(c,d,i.sampled),[2]):this.eventBuffer.isEmpty()?[2]:(n=this.eventBuffer.getEventCount(),!f&&n<10?(h("Flush","Skipping flush, only "+n+" events (min: 10)"),[2]):(0!==t.segmentId||this.eventBuffer.hasCheckout()||(Gr("Flush","First segment missing FullSnapshot, triggering manual checkout"),this.recorderManager&&this.recorderManager.takeFullSnapshot()),[4,this.eventBuffer.finishAsync()])):[2];case 1:if(0===(r=e.sent()).eventCount)return[2];if(0===(i=r.events).length&&r.eventsJson)try{i=JSON.parse(r.eventsJson)}catch(e){return Zr("Flush","Failed to parse eventsJson from worker:",e),[2]}s=this.splitEventsIntoChunks(i),h("Flush","Flushing "+r.eventCount+" events in "+s.length+" chunk(s), total size: "+Math.round(r.uncompressedSize/1024)+"KB"),o=!0,a=0,s=s,e.label=2;case 2:return a<s.length?(l=s[a],l=JSON.stringify(l),l={project_key:String(c.config.id||""),session_id:t.id,replay_id:t.replayId,segment_id:this.sessionManager.incrementSegmentId(),timestamp:Date.now(),replay_start_timestamp:t.started,replay_format:"rrweb",platform:"web",events_encoding:"plain_json",events:l},[4,this.uploader.uploadReplay(l)]):[3,5];case 3:if(!e.sent())return o=!1,[3,5];e.label=4;case 4:return a++,[3,2];case 5:return l=this.eventBuffer.isUsingWorker(),u=l?"(worker)":"(sync)",h("Flush","Flushing "+r.eventCount+" events, size: "+Math.round(r.uncompressedSize/1024)+"KB "+u),o&&(this.eventBuffer.clear(),this.sessionManager.saveSession()),[2]}})})},splitEventsIntoChunks:function(e,t,n){if(void 0===t&&(t=3145728),void 0===n&&(n=5242880),0===e.length)return[];var r=JSON.stringify(e);if(r.length<=t)return[e];Gr("Split","Events size "+Math.round(r.length/1024)+"KB exceeds limit "+Math.round(t/1024)+"KB, splitting");for(var i=[],o=[],a=2,s=0,l=e;s<l.length;s++){var u,c,d=l[s],f=JSON.stringify(d).length+1;0<o.length&&t<a+f&&(i.push(o),o=[],a=2),n<f?((c=2===(u=d.type)||4===u)?Zr:Gr)("Split","Single event too large ("+Math.round(f/1024)+"KB), type="+u+(c?" (baseline snapshot, replay may become unplayable)":"")+", skipping"):(o.push(d),a+=f)}return 0<o.length&&i.push(o),i},stopReplay:function(){this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.recorderManager&&this.recorderManager.stopRecording(),this.clickDetector&&this.clickDetector.stop(),h("Plugin","Recording stopped")},listenForErrors:function(t,n){var r=this;t.lifeCycle.on("errorOccurred",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){e&&r.handleError(e,t,n)})}),t.lifeCycle.on("tdemEventCreated",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){r.isErrorTDEMEvent(e)&&r.handleError(e,t,n)})})},isErrorTDEMEvent:function(e){return!!e&&("error"===String(e.event_category||"").toLowerCase()||(e=String(e.event_type||"").toLowerCase(),["js_error","promise_error","resource_error","api_error"].includes(e)))},handleError:function(e,t,n){this.samplerManager&&(this.samplerManager.isBufferMode()&&this.samplerManager.onErrorOccurred(e)&&(h("Plugin","Converting to session mode due to error"),this.flushReplayData(t,n,!0),this.startFlushTimer(t,n)),this.addCustomEvent({category:"error",message:(null==e?void 0:e.msg)||(null==e?void 0:e.message)||"Unknown error",data:{type:(null==e?void 0:e.type)||"error",stack:null==e?void 0:e.stack}},t))},listenForPerformance:function(n){var r=this;if(n.lifeCycle.on("afterReportWebVitals",function(e){r.handlePerformanceEvent("webVitals",e,n)}),n.lifeCycle.on("afterReportPagePerformance",function(e){r.handlePerformanceEvent("pageLoad",e,n)}),"undefined"!=typeof PerformanceObserver)try{var e=new PerformanceObserver(function(e){var t,e=e.getEntries(),e=e[e.length-1];e&&r.addCustomEvent({category:"performance.lcp",message:"LCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime,element:(null==(t=e.element)?void 0:t.tagName)||"unknown",size:e.size}},n)}),t=(e.observe({type:"largest-contentful-paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){"first-contentful-paint"===e.name&&r.addCustomEvent({category:"performance.fcp",message:"FCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime}},n)})})),i=(t.observe({type:"paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){100<e.duration&&r.addCustomEvent({category:"performance.longTask",message:"Long Task: "+Math.round(e.duration)+"ms",data:{duration:e.duration,startTime:e.startTime}},n)})}));i.observe({type:"longtask",buffered:!0}),n.lifeCycle.on("destroy",function(){e.disconnect(),t.disconnect(),i.disconnect()})}catch(n){}},handlePerformanceEvent:function(e,n,r){var i=this;n&&("webVitals"===e?["LCP","FCP","FID","CLS","TTFB","TTI","INP"].forEach(function(e){var t=n[e];void 0!==t&&-1!==t&&0<t&&i.addCustomEvent({category:"performance."+e.toLowerCase(),message:e+": "+("number"==typeof t?Math.round(t):t)+("CLS"===e?"":"ms"),data:{metric:e,value:t}},r)}):"pageLoad"===e&&this.addCustomEvent({category:"performance.pageLoad",message:"Page Load: "+(n.firstScreenTiming?Math.round(n.firstScreenTiming):"N/A")+"ms",data:{dnsLookup:n.dnsLookup,tcp:n.tcp,ssl:n.ssl,ttfb:n.ttfb,contentDownload:n.contentDownload,domParse:n.domParse,resourceDownload:n.resourceDownload,firstScreenTiming:n.firstScreenTiming}},r))},listenForLifecycle:function(o,t){var n,e,a=this;"undefined"!=typeof document&&(n=function(e){var t,n=null==(n=a.sessionManager)?void 0:n.getSession(),n=(null==n?void 0:n.replayId)||"",r=(null==(r=null==(i=o)?void 0:i.getOriginFrom)?void 0:r.call(i))||("undefined"!=typeof location?location.href:""),i="undefined"!=typeof document&&document.title||"";null!=(t=o.reportTDEMEvent)&&t.call(o,{event_id:A(),event_type:e,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:r,data:{page_title:i,replay_id:n,is_effective_action:!1,tags:{environment:o.config.env||"production",version:String(o.config.version||"")},event_properties:{visibility_state:"undefined"!=typeof document?document.visibilityState:"",lifecycle_type:e}}})},document.addEventListener("visibilitychange",e=function(){var e;if("undefined"!=typeof document){if("hidden"===document.visibilityState)return n(M.TAB_HIDDEN),a.shouldSkipBufferFlush()?void h("Lifecycle","Buffer mode (error traceback), skip flush on hidden"):void a.flushReplayData(o,t,!0);"visible"===document.visibilityState&&(n(M.TAB_VISIBLE),(e=Date.now())-a._lastLifecycleSnapshotAt<5e3||(a._lastLifecycleSnapshotAt=e,null!=(e=a.recorderManager)&&e.takeFullSnapshot(),a.shouldSkipBufferFlush()?h("Lifecycle","Buffer mode (error traceback), skip flush on visible"):a.flushReplayData(o,t,!0)))}}),o.lifeCycle.on("destroy",function(){document.removeEventListener("visibilitychange",e)}))},listenForUnload:function(e){function t(){n.flushOnUnload(e)}var n=this;window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t),e.lifeCycle.on("destroy",function(){window.removeEventListener("beforeunload",t),window.removeEventListener("pagehide",t)})},flushOnUnload:function(e){if(this.sessionManager&&this.eventBuffer&&this.uploader&&ap(e))if(this.shouldSkipBufferFlush())h("Unload","Buffer mode (error traceback), skip flush on unload");else{var t=this.sessionManager.getSession();if(t&&(this.recorderManager&&this.recorderManager.stopRecording(),this.clickDetector&&this.clickDetector.stop(),!this.eventBuffer.isEmpty())){var n=this.eventBuffer.finish();if(0!==n.eventCount){for(var n=this.splitEventsIntoChunks(n.events,51200,51200),r=0,i=0,o=0,a=n;o<a.length;o++){var s=a[o],s={project_key:String(e.config.id||""),session_id:t.id,replay_id:t.replayId,segment_id:this.sessionManager.incrementSegmentId(),timestamp:Date.now(),replay_start_timestamp:t.started,replay_format:"rrweb",platform:"web",events_encoding:"plain_json",events:JSON.stringify(s)};this.uploader.sendBeacon(s)?r++:(i++,Gr("Unload","sendBeacon rejected chunk (segment_id="+s.segment_id+"), likely exceeds 64KB browser limit or queue full"))}h("SessionReplay","sendBeacon on unload: "+r+"/"+n.length+" chunk(s) queued, "+i+" rejected")}}}},destroy:function(){this.stopReplay(),this.sessionManager&&this.sessionManager.saveSession(),this.sessionManager=null,this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,this.recorderManager=null,this.samplerManager=null,this.uploader=null,this.clickDetector=null,this.replayConfig=null,this._tdemRef=null,this._isCheckoutFlushing=!1,this._lastLifecycleSnapshotAt=0,this.isInitialized=!1,h("Plugin","destroyed")}}),_p={enabled:!0,ruleVersion:"1.0.0",payloadAllowlist:[],click:{enabled:!0,deadClickWindowMs:3e3,rageClickWindowMs:1e3,rageClickCount:5,errorClickWindowMs:3e3,resolveOnDomMutation:!0,resolveOnSpaNavigation:!0,resolveOnExternalNavigation:!0,resolveOnWindowOpen:!0,resolveOnPageUnload:!0,resolveOnFormAction:!0,resolveOnApiSuccess:!0,ignoreDeadClickSelectors:[],effectiveActionSelectors:[]},performance:{enabled:!0,slowPageLcpThreshold:4e3,slowPageInpThreshold:500},form:{enabled:!0,fieldIdAttr:"data-field-id",formIdAttr:"data-form-id",longFocusThresholdMs:2e4,incompleteMinFieldRatio:.3,zigzagMinCount:2},navigation:{enabled:!0,backForwardAsStruggle:!0},custom:{enabled:!0,detector:void 0}},Sp=new Set([M.JS_ERROR,M.PROMISE_ERROR,M.RESOURCE_ERROR,M.API_ERROR]),Ep=new Set([M.FORM_CHANGE,M.FORM_SUBMIT,M.FORM_SUBMIT_RESULT]),Cp=(new e({name:"struggleMonitor"}),new e({name:"struggleMonitor",instanceStates:new Map,originalWindowOpen:null,windowOpenHooked:!1,onNewTdem:function(t){var n,r=this,e=!0===(e=this.$getConfig(t))?x({},_p):e&&"object"==typeof e?x(x(x({},_p),e),{click:x(x({},_p.click),e.click||{}),performance:x(x({},_p.performance),e.performance||{}),form:x(x({},_p.form),e.form||{}),navigation:x(x({},_p.navigation),e.navigation||{}),custom:x(x({},_p.custom),e.custom||{}),payloadAllowlist:(Array.isArray(e.payloadAllowlist)?e:_p).payloadAllowlist,enabled:!1!==e.enabled}):x(x({},_p),{enabled:!1});e.enabled&&(n={config:e,clickDetector:null,recentClicks:[],pendingDeadClicks:new Map,focusStartMap:new Map,formStateMap:new Map,removeDomListeners:[],onEventCreated:null,onDestroy:null},this.instanceStates.set(t,n),this.initClickDetector(t,n),this.initFormListeners(t,n),n.onEventCreated=function(e){r.handleEventCreated(t,n,e||[])},t.lifeCycle.on("tdemEventCreated",n.onEventCreated),n.onDestroy=function(){return r.cleanupInstance(t)},t.lifeCycle.on("destroy",n.onDestroy))},initClickDetector:function(t,n){var e,r=this;"undefined"!=typeof window&&"undefined"!=typeof document&&(n.clickDetector=new Yh({slowClickTimeout:null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,slowClickThreshold:null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,rageClickCount:null!=(e=null==(e=n.config.click)?void 0:e.rageClickCount)?e:5,rageClickWindow:null!=(e=null==(e=n.config.click)?void 0:e.rageClickWindowMs)?e:1e3,onRageClick:function(e){r.onRageClick(t,n,e)},onClickStart:function(e){r.onClickStart(t,n,e)},onEffectiveAction:function(e){r.onEffectiveAction(n,e)},onSlowClick:function(e){r.onSlowClick(t,n,e)}}),n.clickDetector.start(),this.initClickEffectiveActionListeners(n),this.initWindowOpenHook())},initClickEffectiveActionListeners:function(n){var e,t=this;"undefined"!=typeof window&&((e=function(e,t){window.addEventListener(e,t),n.removeDomListeners.push(function(){window.removeEventListener(e,t)})})("pagehide",function(){var e;!1!==(null==(e=n.config.click)?void 0:e.resolveOnPageUnload)&&(t.resolvePendingDeadClicks(n,"page_unload"),null!=(e=n.clickDetector))&&e.markEffectiveAction("page_unload")}),e("beforeunload",function(){var e;!1!==(null==(e=n.config.click)?void 0:e.resolveOnPageUnload)&&(t.resolvePendingDeadClicks(n,"page_unload"),null!=(e=n.clickDetector))&&e.markEffectiveAction("page_unload")}))},initWindowOpenHook:function(){var r,i;"undefined"==typeof window||this.windowOpenHooked||(r=window.open,this.originalWindowOpen=r,this.windowOpenHooked=!0,i=this,window.open=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.apply(window,e);return i.resolveWindowOpenActions(),n})},resolveWindowOpenActions:function(){var n=this,r=Date.now();this.instanceStates.forEach(function(e){var t;!1!==(null==(t=e.config.click)?void 0:t.resolveOnWindowOpen)&&(null!=(t=e.clickDetector)&&t.markEffectiveAction("window_open"),n.resolvePendingDeadClicks(e,"window_open",r,n.getCurrentPageUrl()))})},restoreWindowOpenHook:function(){"undefined"!=typeof window&&this.windowOpenHooked&&this.originalWindowOpen&&(window.open=this.originalWindowOpen,this.originalWindowOpen=null,this.windowOpenHooked=!1)},initFormListeners:function(r,i){var e,t,o=this;null!=(t=i.config.form)&&t.enabled&&"undefined"!=typeof document&&((t=function(e,t,n){void 0===n&&(n=!0),document.addEventListener(e,t,n),i.removeDomListeners.push(function(){document.removeEventListener(e,t,n)})})("focusin",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,M.FORM_FOCUS,e,e.form||void 0)}),t("focusout",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,M.FORM_BLUR,e,e.form||void 0)}),t("change",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,M.FORM_CHANGE,e,e.form||void 0)}),t("submit",function(e){e=e.target;e instanceof HTMLFormElement&&o.reportFormEvent(r,i,M.FORM_SUBMIT,null,e)}),t("invalid",function(e){var t,n,e=o.getTrackableField(e.target);e&&(n=e.form||void 0,n=o.buildFormBaseData(r,i,e,n),n={event_id:A(),event_type:M.FORM_SUBMIT_RESULT,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:"undefined"!=typeof window?window.location.href:(null==(t=r.getOriginFrom)?void 0:t.call(r))||"",data:x(x({},n),{event_name:"form_submit_fail",is_effective_action:!0,validation_message:e.validationMessage||void 0,event_properties:x(x({},n.event_properties||{}),{status:"fail",validation_code:!1===(null==(t=e.validity)?void 0:t.valid)?"invalid":"validation_error"})})},null!=(e=r.reportTDEMEvent))&&e.call(r,n)}),e=function(){o.reportPendingUncompletedForms(r,i,"pagehide")},"undefined"!=typeof window)&&(window.addEventListener("pagehide",e),i.removeDomListeners.push(function(){window.removeEventListener("pagehide",e)}))},getTrackableField:function(e){return!(e&&e instanceof Element)||!(e=e.closest("input, textarea, select"))||e instanceof HTMLInputElement&&["button","submit","reset","image","hidden"].includes(e.type)?null:e},buildFormBaseData:function(e,t,n,r){var n=n||null,r=r||(null==n?void 0:n.form)||void 0,i=(null==(i=t.config.form)?void 0:i.fieldIdAttr)||"data-field-id",t=(null==(t=t.config.form)?void 0:t.formIdAttr)||"data-form-id",i=n?n.getAttribute(i)||n.id||n.name||n.tagName.toLowerCase()+"_"+(n.type||"field"):void 0,t=r&&(r.getAttribute(t)||r.id||r.getAttribute("name")||r.getAttribute("action"))||void 0,o="string"==typeof(null==(o=n)?void 0:o.value)?n.value.length:0,o=0===o?"0":o<=10?"1_10":o<=50?"11_50":"51_plus";return{replay_id:at(e),is_effective_action:!0,form_id:t,field_id:i,tags:{},event_properties:{field_name:(null==n?void 0:n.name)||"",field_type:(null==n?void 0:n.type)||(null==(e=null==n?void 0:n.tagName)?void 0:e.toLowerCase())||"",form_name:(null==r?void 0:r.getAttribute("name"))||"",is_required:String(!(null==n||!n.required)),value_length_bucket:String(o)}}},reportFormEvent:function(e,t,n,r,i){var t=this.buildFormBaseData(e,t,r,i),i="undefined"!=typeof window?window.location.href:(null==(r=e.getOriginFrom)?void 0:r.call(e))||"",r={event_id:A(),timestamp:Date.now(),page_url:i};n!==M.FORM_FOCUS?n!==M.FORM_BLUR?n!==M.FORM_CHANGE?(i=x(x({},r),{event_type:M.FORM_SUBMIT,event_category:I.BEHAVIOR,data:x(x({},t),{submit_method:"native_submit"})}),null!=(n=e.reportTDEMEvent)&&n.call(e,i)):(n=x(x({},r),{event_type:M.FORM_CHANGE,event_category:I.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,n)):(i=x(x({},r),{event_type:M.FORM_BLUR,event_category:I.BEHAVIOR,data:t}),null!=(n=e.reportTDEMEvent)&&n.call(e,i)):(n=x(x({},r),{event_type:M.FORM_FOCUS,event_category:I.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,n))},onClickStart:function(e,t,n){var r,i=t.config.click||_p.click;!1!==i.enabled&&(r=n.node.selector||n.node.tagName||"unknown",this.shouldIgnoreDeadClick(n.target,i)?this.resolvePendingDeadClicks(t,"custom",n.timestamp,this.getCurrentPageUrl()):this.scheduleDeadClick(e,t,{pendingId:"pending_"+n.timestamp+"_"+Math.random().toString(16).slice(2),timestamp:n.timestamp,pageUrl:this.getCurrentPageUrl(),ownerKey:r,node:n.node}))},onEffectiveAction:function(e,t){this.shouldResolveByReason(e,t.reason)&&this.resolvePendingDeadClicks(e,t.reason,t.timestamp,this.getCurrentPageUrl())},scheduleDeadClick:function(t,n,r){var i=this,o=null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,e=setTimeout(function(){var e=n.pendingDeadClicks.get(r.pendingId);e&&(n.pendingDeadClicks.delete(r.pendingId),i.emitDeadClick(t,n,e,o))},o);n.pendingDeadClicks.set(r.pendingId,x(x({},r),{timeout:e}))},emitDeadClick:function(e,t,n,r){var i,o=n.clickEventId?[n.clickEventId]:void 0;null!=(i=e.reportStruggle)&&i.call(e,{type:"dead_click",ownerType:"element",ownerKey:n.ownerKey,pageUrl:n.pageUrl,triggerEventId:n.clickEventId,relatedEventIds:o,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{timeout_ms:r,selector:n.node.selector||""}})},resolvePendingDeadClicks:function(r,i,o,a){void 0===o&&(o=Date.now());var e,s=null!=(e=null==(e=r.config.click)?void 0:e.deadClickWindowMs)?e:3e3;r.pendingDeadClicks.forEach(function(e,t){var n=o-e.timestamp;n<0||s<n||"spa_navigation"!==i&&"page_unload"!==i&&a&&e.pageUrl&&a!==e.pageUrl||(clearTimeout(e.timeout),r.pendingDeadClicks.delete(t))})},linkPendingDeadClickToClickEvent:function(e,n,r){var i=n.timestamp||Date.now(),o=this.getEventPageUrl(n);e.pendingDeadClicks.forEach(function(e){var t;e.clickEventId||(t=i-e.timestamp)<0||1e3<t||o&&e.pageUrl&&o!==e.pageUrl||(e.clickEventId=n.event_id,r&&"unknown"!==r&&(e.ownerKey=r))})},shouldResolveByReason:function(e,t){e=e.config.click||_p.click;return!1!==e.enabled&&("dom_mutation"===t?!1!==e.resolveOnDomMutation:"spa_navigation"===t?!1!==e.resolveOnSpaNavigation:"external_navigation"===t||"download"===t?!1!==e.resolveOnExternalNavigation:"window_open"===t?!1!==e.resolveOnWindowOpen:"page_unload"===t?!1!==e.resolveOnPageUnload:"form_change"===t||"form_submit"===t?!1!==e.resolveOnFormAction:"api_success"!==t||!1!==e.resolveOnApiSuccess)},shouldIgnoreDeadClick:function(t,e){return g(e.ignoreDeadClickSelectors||[],e.effectiveActionSelectors||[]).some(function(e){try{return!!e&&!!t.closest(e)}catch(e){return!1}})},getCurrentPageUrl:function(){return"undefined"==typeof window?"":window.location.href},getEventPageUrl:function(e){return(null==e?void 0:e.page_url)||(null==(e=null==e?void 0:e.data)?void 0:e.page_url)||""},onRageClick:function(e,t,n){var r=n.node.selector||n.node.tagName||"unknown",i=null!=(o=null==(o=t.config.click)?void 0:o.rageClickWindowMs)?o:1e3,o=t.recentClicks.filter(function(e){return n.timestamp-e.timestamp<=i}).map(function(e){return e.eventId}).filter(Boolean).slice(-10),r={type:"rage_click",ownerType:"element",ownerKey:r,pageUrl:window.location.href,triggerEventId:o[0],relatedEventIds:o.length?o:void 0,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{clickCount:n.clickCount,timeWindowMs:n.timeWindowMs,selector:n.node.selector||""}};null!=(o=e.reportStruggle)&&o.call(e,r)},onSlowClick:function(e,t,n){},handleEventCreated:function(i,o,e){var t,a=this,s=Date.now(),n=o.config.click||_p.click,r=Math.max(null!=(t=n.errorClickWindowMs)?t:3e3,null!=(t=n.rageClickWindowMs)?t:1e3,null!=(t=n.deadClickWindowMs)?t:3e3);o.recentClicks=o.recentClicks.filter(function(e){return s-e.timestamp<=r}),e.forEach(function(e){var t,n,r;e&&e.event_type!==M.STRUGGLE&&(t=e.timestamp||s,n=a.getEventPageUrl(e),e.event_type===M.CLICK?(r=(null==(r=e.data)?void 0:r.target_element)||(null==(r=e.data)?void 0:r.target_id)||(null==(r=e.data)?void 0:r.target_class)||"unknown",o.recentClicks.push({eventId:e.event_id,timestamp:t,pageUrl:n,ownerKey:r}),a.linkPendingDeadClickToClickEvent(o,e,r)):(a.isEffectiveActionEvent(o,e)&&(a.resolvePendingDeadClicks(o,a.getEffectiveActionReason(e),t,n),null!=(r=o.clickDetector)&&r.markEffectiveAction(a.getEffectiveActionReason(e))),Sp.has(e.event_type)?a.tryReportErrorClick(i,o,e):e.event_type===M.PAGE_LOAD||e.event_type===M.true?a.tryReportSlowPage(i,o,e):e.event_type===M.FORM_FOCUS?(a.trackFormFocus(o,e),a.trackFormChangeAndZigzag(i,o,e)):e.event_type===M.FORM_CHANGE?a.trackFormChangeAndZigzag(i,o,e):e.event_type===M.FORM_BLUR?a.tryReportLongFocusTime(i,o,e):e.event_type===M.FORM_SUBMIT?a.trackFormSubmitResult(o,e):e.event_type===M.FORM_SUBMIT_RESULT?(a.trackFormSubmitResult(o,e),a.tryReportFormValidationError(i,o,e)):e.event_type===M.PAGE_VIEW&&null!=(n=null==(t=e.data)?void 0:t.event_properties)&&n.navigation_type&&a.tryReportBackForward(i,o,e)),a.tryReportCustomStruggle(i,o,e))})},isEffectiveActionEvent:function(e,t){var n;return!1!==(null==(n=e.config.click)?void 0:n.enabled)&&(t.event_type===M.API_CALL?!1!==(null==(n=e.config.click)?void 0:n.resolveOnApiSuccess):t.event_type===M.PAGE_VIEW&&null!=(n=null==(n=t.data)?void 0:n.event_properties)&&n.navigation_type?!1!==(null==(n=e.config.click)?void 0:n.resolveOnSpaNavigation):Ep.has(t.event_type)?!1!==(null==(n=e.config.click)?void 0:n.resolveOnFormAction):!0===(null==(e=t.data)?void 0:e.is_effective_action))},getEffectiveActionReason:function(e){return e.event_type===M.API_CALL?"api_success":e.event_type===M.PAGE_VIEW?"spa_navigation":e.event_type===M.FORM_CHANGE?"form_change":e.event_type===M.FORM_SUBMIT||e.event_type===M.FORM_SUBMIT_RESULT?"form_submit":"custom"},getFormStateKey:function(e,t){return e||t||"unknown_form"},ensureFormState:function(e,t,n){var r=this.getFormStateKey(t,n);return e.formStateMap.has(r)||e.formStateMap.set(r,{formId:t||r,pageUrl:n||"",touchedFieldIds:new Set,requiredFieldIds:new Set,changedFieldIds:new Set,focusPath:[],zigzagHits:0,hasSuccessSubmit:!1,reportedZigzag:!1,reportedUncompleted:!1}),e.formStateMap.get(r)},recordFormTouch:function(e,t){var n,e=this.ensureFormState(e,null==(e=null==t?void 0:t.data)?void 0:e.form_id,null==t?void 0:t.page_url),r=String((null==(r=null==t?void 0:t.data)?void 0:r.field_id)||"");return r&&(e.touchedFieldIds.add(r),!0===(null==(n=t.data)?void 0:n.is_required)&&e.requiredFieldIds.add(r),t.event_type===M.FORM_CHANGE)&&e.changedFieldIds.add(r),null!=t&&t.page_url&&(e.pageUrl=t.page_url),e},trackFormFocus:function(e,t){var n,r=t,i=String((null==(i=null==r?void 0:r.data)?void 0:i.field_id)||"");i&&((n=this.recordFormTouch(e,r)).focusPath.push(i),12<n.focusPath.length&&n.focusPath.shift(),e.focusStartMap.set(i,{timestamp:t.timestamp||Date.now(),eventId:t.event_id,formId:null==(n=null==r?void 0:r.data)?void 0:n.form_id,pageUrl:null==r?void 0:r.page_url}))},trackFormChangeAndZigzag:function(e,t,n){var r,i,o,a,s;n.event_type!==M.FORM_CHANGE?n.event_type!==M.FORM_FOCUS||(s=(i=this.recordFormTouch(t,r=n)).focusPath).length<4||i.reportedZigzag||(o=(s=s.slice(-4))[0],a=s[1],!o)||!a||o===a||o!==s[2]||a!==s[3]||i.changedFieldIds.size<2||(i.zigzagHits+=1,s=null!=(a=null==(o=t.config.form)?void 0:o.zigzagMinCount)?a:2,i.zigzagHits<s)||(i.reportedZigzag=!0,null==(o=e.reportStruggle))||o.call(e,{type:"form_zigzag",ownerType:"form",ownerKey:i.formId,pageUrl:i.pageUrl,formId:i.formId,fieldId:String((null==(a=null==r?void 0:r.data)?void 0:a.field_id)||""),triggerEventId:r.event_id,relatedEventIds:[r.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{zigzag_hits:i.zigzagHits,changed_field_count:i.changedFieldIds.size}}):this.recordFormTouch(t,n)},trackFormSubmitResult:function(e,t){t.event_type!==M.FORM_SUBMIT&&t.event_type!==M.FORM_SUBMIT_RESULT||((e=this.recordFormTouch(e,t)).lastSubmitEventId=t.event_id,t.event_type!==M.FORM_SUBMIT_RESULT)||"success"===(null==(t=null==(t=t.data)?void 0:t.event_properties)?void 0:t.status)&&(e.hasSuccessSubmit=!0)},reportPendingUncompletedForms:function(t,n,r){var i=this;n.formStateMap.forEach(function(e){i.tryReportUncompletedForm(t,n,e,r)})},tryReportUncompletedForm:function(e,t,n,r){var i,o,a,s;n.reportedUncompleted||n.hasSuccessSubmit||0===n.touchedFieldIds.size||(a=0<(o=n.requiredFieldIds.size)?o:n.touchedFieldIds.size)<=0||(a=n.changedFieldIds.size/a)<(s=null!=(s=null==(s=t.config.form)?void 0:s.incompleteMinFieldRatio)?s:.3)||(n.reportedUncompleted=!0,null==(i=e.reportStruggle))||i.call(e,{type:"uncompleted_form",ownerType:"form",ownerKey:n.formId,pageUrl:n.pageUrl,formId:n.formId,triggerEventId:n.lastSubmitEventId,relatedEventIds:n.lastSubmitEventId?[n.lastSubmitEventId]:void 0,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{touched_field_count:n.touchedFieldIds.size,changed_field_count:n.changedFieldIds.size,required_field_count:o,changed_ratio:Number(a.toFixed(4)),threshold_ratio:s}})},tryReportLongFocusTime:function(e,t,n){var r,i,o,a,s=String((null==(s=null==n?void 0:n.data)?void 0:s.field_id)||"");s&&(i=t.focusStartMap.get(s))&&(t.focusStartMap.delete(s),o=null!=(o=null==(o=t.config.form)?void 0:o.longFocusThresholdMs)?o:2e4,(a=Math.max((n.timestamp||Date.now())-i.timestamp,0))<o||null==(r=e.reportStruggle)||r.call(e,{type:"long_focus_time",ownerType:"field",ownerKey:s,pageUrl:(null==n?void 0:n.page_url)||i.pageUrl,formId:(null==(r=null==n?void 0:n.data)?void 0:r.form_id)||i.formId,fieldId:s,triggerEventId:n.event_id,relatedEventIds:[i.eventId||"",n.event_id].filter(Boolean),detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{focus_duration_ms:a,threshold_ms:o}}))},tryReportErrorClick:function(e,t,n){var r,i,o;t.recentClicks.length&&(i=null!=(o=(t.config.click||_p.click).errorClickWindowMs)?o:3e3,o=g(t.recentClicks).reverse().find(function(e){return 0<=n.timestamp-e.timestamp&&n.timestamp-e.timestamp<=i}))&&null!=(r=e.reportStruggle)&&r.call(e,{type:"error_click",ownerType:"element",ownerKey:o.ownerKey,pageUrl:o.pageUrl||n.page_url,triggerEventId:o.eventId,relatedEventIds:[n.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{errorEventType:n.event_type}})},tryReportSlowPage:function(e,t,n){var r,i,o,a=t.config.performance||_p.performance;a.enabled&&(i=(null==(i=n.data)?void 0:i.measurements)||{},r=Number(i.lcp||0),i=Number(i.inp||0),o=null!=(o=a.slowPageLcpThreshold)?o:4e3,a=null!=(a=a.slowPageInpThreshold)?a:500,o<=r||a<=i)&&null!=(o=e.reportStruggle)&&o.call(e,{type:"slow_page",ownerType:"page",ownerKey:n.page_url||("undefined"!=typeof window?window.location.href:""),pageUrl:n.page_url,triggerEventId:n.event_id,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{lcp:r,inp:i,sourceEventType:n.event_type}})},tryReportFormValidationError:function(e,t,n){var r,i,o,a,s=(null==(s=null==n?void 0:n.data)?void 0:s.event_properties)||{},l=(null==n?void 0:n.data)||{};"fail"===String((null==s?void 0:s.status)||(null===(i=l)?void 0:i.status)||"")&&(i=String((null==s?void 0:s.field_id)||(null===(i=l)?void 0:i.field_id)||""),o=String((null==s?void 0:s.form_id)||(null===(o=l)?void 0:o.form_id)||""),a=i||o||(null==n?void 0:n.page_url)||"unknown",null!=(r=e.reportStruggle))&&r.call(e,{type:"form_validation_error",ownerType:i?"field":"form",ownerKey:a,pageUrl:null==n?void 0:n.page_url,formId:o,fieldId:i,triggerEventId:n.event_id,relatedEventIds:[n.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{validation_code:(null==s?void 0:s.validation_code)||(null===(r=l)?void 0:r.validation_code),validation_message:null==(e=null==n?void 0:n.data)?void 0:e.validation_message,sourceEventType:n.event_type}})},tryReportBackForward:function(e,t,n){var r,i,o=t.config.navigation||_p.navigation;o.enabled&&o.backForwardAsStruggle&&(n=null==(n=null==(o=n)?void 0:o.data)?void 0:n.event_properties,"back"!==(i=String((null==n?void 0:n.navigation_type)||""))&&"forward"!==i||null==(r=e.reportStruggle)||r.call(e,{type:"back_forward",ownerType:"page",ownerKey:String((null==n?void 0:n.to_page)||"")||(null==o?void 0:o.page_url)||"unknown",pageUrl:null==o?void 0:o.page_url,triggerEventId:o.event_id,relatedEventIds:[o.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{navigation_type:i,from_page:null==n?void 0:n.from_page,to_page:null==n?void 0:n.to_page}}))},tryReportCustomStruggle:function(n,r,i){var e=r.config.custom||_p.custom;e.enabled&&"function"==typeof e.detector&&(e=e.detector({event:i,tdem:n}),(Array.isArray(e)?e:e?[e]:[]).forEach(function(e){var t,e=x(x({},e),{type:(null==e?void 0:e.type)||"custom_struggle",ownerType:(null==e?void 0:e.ownerType)||"app",ownerKey:(null==e?void 0:e.ownerKey)||i.page_url||"custom",ruleVersion:(null==e?void 0:e.ruleVersion)||r.config.ruleVersion,payloadAllowlist:(null==e?void 0:e.payloadAllowlist)||r.config.payloadAllowlist,detectionSource:(null==e?void 0:e.detectionSource)||"custom"});null!=(t=n.reportStruggle)&&t.call(n,e)}))},cleanupInstance:function(e){var t=this.instanceStates.get(e);t&&(t.onEventCreated&&e.lifeCycle.remove("tdemEventCreated",t.onEventCreated),t.onDestroy&&e.lifeCycle.remove("destroy",t.onDestroy),t.clickDetector&&t.clickDetector.stop(),t.pendingDeadClicks.forEach(function(e){clearTimeout(e.timeout)}),t.pendingDeadClicks.clear(),this.reportPendingUncompletedForms(e,t,"destroy"),t.focusStartMap.clear(),t.formStateMap.clear(),t.removeDomListeners.forEach(function(e){return e()}),t.removeDomListeners=[],this.instanceStates.delete(e),0===this.instanceStates.size)&&this.restoreWindowOpenHook()},destroy:function(){var n=this;this.instanceStates.forEach(function(e,t){n.cleanupInstance(t)}),this.instanceStates.clear(),this.restoreWindowOpenHook()}})),Rp={enabled:!0,threshold:2e3,noResponseThreshold:5e3,sampleRate:1},Tp=new Map,Op=new e({name:"lagMonitor",onNewTdem:function(o,e){t=e,void 0===(r=null!=(n=o.config)&&n.debug?function(e,t){"undefined"!=typeof console&&console.warn&&console.warn("[TDEM] "+e+": "+t+", fallback applied")}:function(){})&&(r=function(){});var t,r,n,a=!1===t?x(x({},Rp),{enabled:!1}):!0===t||void 0===t?x({},Rp):!t||"object"!=typeof t||Array.isArray(t)?(r("lagMonitor","invalid_type"),x({},Rp)):(n=x({},Rp),void 0!==t.enabled&&("boolean"==typeof t.enabled?n.enabled=t.enabled:r("lagMonitor.enabled","invalid_type")),n.threshold=(i=function(e,t,n){return void 0===e?n:"number"!=typeof e?(r(t,"invalid_type"),n):Number.isFinite(e)?e<=0?(r(t,"out_of_range"),n):e:(r(t,"invalid_number"),n)})(t.threshold,"lagMonitor.threshold",Rp.threshold),n.noResponseThreshold=i(t.noResponseThreshold,"lagMonitor.noResponseThreshold",Rp.noResponseThreshold),void 0!==t.sampleRate&&("number"!=typeof t.sampleRate?r("lagMonitor.sampleRate","invalid_type"):Number.isFinite(t.sampleRate)?t.sampleRate<0||1<t.sampleRate?r("lagMonitor.sampleRate","out_of_range"):n.sampleRate=t.sampleRate:r("lagMonitor.sampleRate","invalid_number")),n.noResponseThreshold<=n.threshold&&(n.noResponseThreshold=Math.max(5e3,n.threshold+1),r("lagMonitor.noResponseThreshold","relation_conflict")),n);if(a.enabled&&"undefined"!=typeof PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")&&(i=a.sampleRate,Math.random()<i)){var i,s=[],l={observer:null,lagRecords:s,sampled:!0,destroyed:!1,onDestroy:function(){return up(o)}};Tp.set(o,l),o.lifeCycle.on("destroy",l.onDestroy);try{l.observer=new PerformanceObserver(function(e){if(!l.destroyed)try{e.getEntries().forEach(function(e){var t,n,r,i;l.destroyed||e.duration<=a.threshold||(t=null==(t=e.scripts)?void 0:t[0],e={name:e.name,timestamp:Date.now(),entryType:e.entryType,startTime:e.startTime,duration:e.duration,invoker:null==t?void 0:t.invoker,sourceURL:null==t?void 0:t.sourceURL},s.push(e),100<s.length&&s.shift(),t=o,r=(e=e).duration>=(n=a).noResponseThreshold,i=at(t),e={event_id:A(),event_type:r?M.NO_RESPONSE:M.LAG_DETECTED,event_category:r?I.ERROR:I.PERFORMANCE,timestamp:Date.now(),page_url:(null==(r=t.getOriginFrom)?void 0:r.call(t))||window.location.href,data:x(x({measurements:{duration:sp(e.duration),start_time_ms:sp(e.startTime),lag_threshold_ms:n.threshold,no_response_threshold_ms:n.noResponseThreshold},event_properties:{entry_type:e.entryType||"long-animation-frame",source_url:lp(e.sourceURL,2048),invoker:lp(e.invoker,256)}},i?{replay_id:i}:{}),{tags:{environment:(null==(r=t.config)?void 0:r.env)||"production",version:String((null==(n=t.config)?void 0:n.version)||"")}})},t.reportTDEMEvent(e))})}catch(e){}}),l.observer.observe({type:"long-animation-frame",buffered:!1})}catch(e){up(o)}}},getLagRecords:function(e){return g((null==(e=Tp.get(e))?void 0:e.lagRecords)||[])},destroy:function(){Array.from(Tp.keys()).forEach(up)}}),xp={enabled:!0,containers:["body","html","#app","#root"],ignoreContainers:[],containerMatchers:{tagName:["body","html"],id:["app","root"],className:[]},ignoreMatchers:{tagName:[],id:[],className:[]},detectStartPosition:{x:0,y:0},emptyElementsPercent:70,sameElementsPercent:70,debounceDuration:2e3,everySideSampleNumber:9,disableSameElementsCheck:!0,ignoreElesWhenDomChange:[],reDetectInterval:2e3,samePointDepth:5,customBlankScreenDector:null},Mp=["canvas","img","svg","iframe"],Ip=(0,new Map),vu=new e({name:"blankScreen",onNewTdem:function(_,e){var S,E,C,R,T,t,O,n,r,i,o,a,s,l,u,c,d,f,h,p,m,v=this;"undefined"!=typeof document&&document.elementsFromPoint&&(e=e,void 0===(s=null!=(m=_.config)&&m.debug?function(e,t){"undefined"!=typeof console&&console.warn&&console.warn("[TDEM] "+e+": "+t+", fallback applied")}:function(){})&&(s=function(){}),m=pp(),(S=!1===e?x(x({},m),{enabled:!1}):!0===e||void 0===e?m:!e||"object"!=typeof e||Array.isArray(e)?(s("blankScreen","invalid_type"),m):(l="containerMatchers"in(e=e)||"ignoreMatchers"in e,p="containers"in e||"ignoreContainers"in e,u=function(e,t,n,r){return void 0===e?g(t):Array.isArray(e)&&e.length<=100&&e.every(function(e){return"string"==typeof e&&0<e.trim().length&&e.trim().length<=r})?e.map(function(e){return e.trim()}):(s(n,"invalid_array"),g(t))},h=function(e,t,n){return void 0===e?hp(t):!e||"object"!=typeof e||Array.isArray(e)?(s(n,"invalid_type"),hp(t)):{tagName:u((e=e).tagName,t.tagName||[],n+".tagName",128),id:u(e.id,t.id||[],n+".id",128),className:u(e.className,t.className||[],n+".className",128)}},c=function(e,t,n,r){return void 0===e?t:"number"!=typeof e?(s(n,"invalid_type"),t):Number.isFinite(e)?r(e)?e:(s(n,"out_of_range"),t):(s(n,"invalid_number"),t)},d=function(e,t,n,r,i){return c(e,t,n,function(e){return Number.isInteger(e)&&r<=e&&e<=i})},f=pp(),void 0!==e.enabled&&("boolean"==typeof e.enabled?f.enabled=e.enabled:s("blankScreen.enabled","invalid_type")),f.containers=u(e.containers,m.containers,"blankScreen.containers",256),f.ignoreContainers=u(e.ignoreContainers,m.ignoreContainers,"blankScreen.ignoreContainers",256),f.containerMatchers=h(e.containerMatchers,m.containerMatchers,"blankScreen.containerMatchers"),f.ignoreMatchers=h(e.ignoreMatchers,m.ignoreMatchers,"blankScreen.ignoreMatchers"),p&&!l&&(f.containerMatchers={tagName:[],id:[],className:[]},f.ignoreMatchers={tagName:[],id:[],className:[]}),void 0===(h=e.detectStartPosition)||h&&"object"==typeof h&&!Array.isArray(h)?f.detectStartPosition={x:c((p=h||{}).x,m.detectStartPosition.x,"blankScreen.detectStartPosition.x",function(e){return 0<=e}),y:c(p.y,m.detectStartPosition.y,"blankScreen.detectStartPosition.y",function(e){return 0<=e})}:s("blankScreen.detectStartPosition","invalid_type"),f.emptyElementsPercent=c(e.emptyElementsPercent,m.emptyElementsPercent,"blankScreen.emptyElementsPercent",function(e){return 0<e&&e<=100}),f.sameElementsPercent=c(e.sameElementsPercent,m.sameElementsPercent,"blankScreen.sameElementsPercent",function(e){return 0<e&&e<=100}),f.debounceDuration=c(e.debounceDuration,m.debounceDuration,"blankScreen.debounceDuration",function(e){return 0<=e}),f.reDetectInterval=c(e.reDetectInterval,m.reDetectInterval,"blankScreen.reDetectInterval",function(e){return 0<e}),f.everySideSampleNumber=d(e.everySideSampleNumber,m.everySideSampleNumber,"blankScreen.everySideSampleNumber",2,50),f.samePointDepth=d(e.samePointDepth,m.samePointDepth,"blankScreen.samePointDepth",1,20),void 0!==e.disableSameElementsCheck&&("boolean"==typeof e.disableSameElementsCheck?f.disableSameElementsCheck=e.disableSameElementsCheck:s("blankScreen.disableSameElementsCheck","invalid_type")),f.ignoreElesWhenDomChange=u(e.ignoreElesWhenDomChange,m.ignoreElesWhenDomChange,"blankScreen.ignoreElesWhenDomChange",256),void 0!==e.customBlankScreenDector&&(null===e.customBlankScreenDector||"function"==typeof e.customBlankScreenDector?f.customBlankScreenDector=e.customBlankScreenDector:s("blankScreen.customBlankScreenDector","invalid_type")),f)).enabled)&&(l=((e,t,n)=>({totalSamplePoints:e=4*e-3,whitePointThreshold:Math.floor(e*t/100),samePointThreshold:Math.floor(e*n/100)}))(S.everySideSampleNumber,S.emptyElementsPercent,S.sameElementsPercent),E=l.totalSamplePoints,C=l.whitePointThreshold,R=l.samePointThreshold,T={observer:null,detectTimer:null,bodyWaitTimer:null,bodyWaitFrame:null,idleCallbackId:null,destroyed:!1,initialDetectionPending:!0,incidentStatus:"healthy",preDetectResult:null,triggerType:"dom_change",onErrorOccurred:function(){},onDestroy:function(){return vp(_)},handlePageHide:function(){},handleBeforeUnload:function(){},handleVisibilityChange:function(){}},Ip.set(_,T),t=function(){return P(v,void 0,void 0,function(){var u,c,d,f,h,p,m,v,g,y,w,b,k;return D(this,function(e){var t,n,r,i,o,a,s,l;if(!T.destroyed)try{if("initial_load"===T.triggerType&&(T.initialDetectionPending=!1),u=window.innerHeight,c=window.innerWidth,d=S.detectStartPosition,f=d.x,h=d.y,c<=f||u<=h)return[2];if(p=[],v=m=0,((e,t,n,r)=>{for(var i=r.x,o=r.y,a=i+(e-i)/2,s=o+(t-o)/2,l=n+1,u=[],c=1;c<l;c+=1){var d=i+(e-i)*c/l,f=o+(t-o)*c/l;u.push({x:d,y:s}),c!==l/2&&u.push({x:a,y:f},{x:d,y:f},{x:d,y:t-f})}return u})(c,u,S.everySideSampleNumber,S.detectStartPosition).forEach(function(e){a=e.x,s=e.y,e=document.elementsFromPoint(a,s),e=(l=function(e){var t=e[0];if(t&&null!==t.shadowRoot){t=(null==(t=t.shadowRoot)?void 0:t.elementsFromPoint(a,s))||[];if(t.length>e.length)return l(t)}return e})(e),t=S.containers,n=S.ignoreContainers,r=S.containerMatchers,u=S.ignoreMatchers,e=e.map(cp),o=e.map(function(e){return e.selector});var t,n,r,i,o,a,s,l,u=(e=e[0])?(r=(i=!(!r||!(null!=(i=r.tagName)&&i.length||null!=(i=r.id)&&i.length||null!=(i=r.className)&&i.length)))?dp(e,r):fp(e,t),t=i?dp(e,u):fp(e,n),{isWhitePoint:r&&!t,selectorPointers:o}):{isWhitePoint:!1,selectorPointers:o};u.isWhitePoint&&(m+=1),p.push(u.selectorPointers)}),g=C<=m,y=!1,S.disableSameElementsCheck||(w=p.map(function(e){return e.slice(0,S.samePointDepth)}),o={},w.map(function(e){return e.join(" < ")}).forEach(function(e){o[e]=o[e]?o[e]+1:1}),a=Object.keys(o).map(function(e){return[e,o[e]]}).sort(function(e,t){return t[1]-e[1]})[0]||["",0],s=a[0],b={samePointerMap:o,maximumSamePointerClass:s,maximumSamePointerCounter:a[1]},y=R<=(v=b.maximumSamePointerCounter)&&(l=b.maximumSamePointerClass,!Mp.some(function(e){return l.startsWith(e)}))),k=!1,S.customBlankScreenDector)try{k=!0===S.customBlankScreenDector()}catch(e){k=!1}if(!(g||y||k))return T.incidentStatus="healthy",T.preDetectResult=null,[2];if("reported"===T.incidentStatus)return[2];if("suspect"===T.incidentStatus&&T.preDetectResult)return t=T.preDetectResult,r=t.customTriggered?"custom":t.whitePointTriggered&&t.sameElementTriggered?"both":t.whitePointTriggered?"white_point":"same_element",i=at(_),t={event_id:A(),event_type:M.BLANK_SCREEN,event_category:I.ERROR,timestamp:Date.now(),page_url:(null==(n=_.getOriginFrom)?void 0:n.call(_))||window.location.href,data:x(x({measurements:{white_point_count:t.whitePointCount,same_point_count:t.samePointCount,total_sample_points:E,white_point_threshold:C,same_point_threshold:R,white_point_ratio:mp(t.whitePointCount/E,6),same_point_ratio:mp(t.samePointCount/E,6),viewport_width_px:Math.max(0,Math.round(window.innerWidth)),viewport_height_px:Math.max(0,Math.round(window.innerHeight))},event_properties:{trigger_reason:r,trigger_type:t.triggerType,detection_method:t.customTriggered?"custom_detector":"viewport_sampling",same_elements_check_enabled:String(!S.disableSameElementsCheck)}},i?{replay_id:i}:{}),{tags:{environment:(null==(n=_.config)?void 0:n.env)||"production",version:String((null==(r=_.config)?void 0:r.version)||"")}})},_.reportTDEMEvent(t),T.incidentStatus="reported",T.preDetectResult=null,[2];T.preDetectResult={whitePointCount:m,samePointCount:v,whitePointTriggered:g,sameElementTriggered:y,customTriggered:k,triggerType:T.triggerType},T.incidentStatus="suspect",T.detectTimer=setTimeout(function(){T.detectTimer=null,O()},S.reDetectInterval)}catch(e){}return[2]})})},O=function(){return P(v,void 0,void 0,function(){return D(this,function(e){switch(e.label){case 0:if(T.destroyed)return[2];if("function"!=typeof window.requestIdleCallback)return[3,5];e.label=1;case 1:return e.trys.push([1,2,,4]),T.idleCallbackId=window.requestIdleCallback(function(e){T.idleCallbackId=null,T.destroyed||(0<e.timeRemaining()?t():T.detectTimer=setTimeout(function(){T.detectTimer=null,t()},0))}),[3,4];case 2:return e.sent(),[4,t()];case 3:return e.sent(),[3,4];case 4:return[3,7];case 5:return[4,t()];case 6:e.sent(),e.label=7;case 7:return[2]}})})},n=function(e){void 0===e&&(e="dom_change"),T.destroyed||"suspect"===T.incidentStatus||"initial_load"!==e&&T.initialDetectionPending||(T.triggerType=e,T.detectTimer&&clearTimeout(T.detectTimer),T.detectTimer=setTimeout(function(){T.detectTimer=null,O()},S.debounceDuration))},T.onErrorOccurred=function(){return n("error")},_.lifeCycle.on("errorOccurred",T.onErrorOccurred),_.lifeCycle.on("destroy",T.onDestroy),r=function(){!T.destroyed&&document.body&&(T.observer=new MutationObserver(function(e){var t=null==(t=e[0])?void 0:t.target;if(1===e.length&&t instanceof Element){e=cp(t).selector;if(S.ignoreElesWhenDomChange.includes(e))return}n("dom_change")}),T.observer.observe(document.body,{childList:!0,subtree:!0}))},document.body?r():(i=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},o=function(){document.body?(T.bodyWaitTimer&&clearTimeout(T.bodyWaitTimer),r()):T.bodyWaitFrame=i(o)},T.bodyWaitFrame=i(o),T.bodyWaitTimer=setTimeout(function(){null!==T.bodyWaitFrame&&((window.cancelAnimationFrame||clearTimeout)(T.bodyWaitFrame),T.bodyWaitFrame=null)},1e4)),T.handlePageHide=a=function(){T.destroyed||(T.detectTimer&&clearTimeout(T.detectTimer),T.triggerType="page_state",T.preDetectResult&&(T.preDetectResult.triggerType="page_state"),t())},T.handleBeforeUnload=a,T.handleVisibilityChange=function(){"hidden"===document.visibilityState&&a()},window.addEventListener("pagehide",T.handlePageHide),window.addEventListener("beforeunload",T.handleBeforeUnload),document.addEventListener("visibilitychange",T.handleVisibilityChange),n("initial_load"))},destroy:function(){Array.from(Ip.keys()).forEach(vp)}}),Ap={enabled:!0,enableMemoryReport:!0,enableOOMReport:!0,oomThreshold:100,memoryReportInterval:6e4,oomCheckInterval:1e4,monitorPages:[],sampleRate:1},Pp=new Map,Dp=function(e){return"number"==typeof e&&Number.isFinite(e)},i=new e({name:"memoryMonitor",onNewTdem:function(n,e){r=n;var r,i,o,a,t,s=!1===(e=e)?x(x({},Ap),{enabled:!1}):(i=e&&"object"==typeof e?e:{},void 0===e||!0===e||e&&"object"==typeof e&&!Array.isArray(e)||gp(r,"memoryMonitor","invalid_type"),o=x(x({},Ap),{oomThreshold:0<(e=(null==(e=yp())?void 0:e.limit)||0)?Math.round(e/1024/1024*.9):100}),["enabled","enableMemoryReport","enableOOMReport"].forEach(function(e){void 0!==i[e]&&("boolean"==typeof i[e]?o[e]=i[e]:gp(r,"memoryMonitor."+e,"invalid_type"))}),["oomThreshold","memoryReportInterval","oomCheckInterval"].forEach(function(e){var t=i[e];void 0!==t&&(Dp(t)&&0<t?o[e]=t:gp(r,"memoryMonitor."+e,Dp(t)?"out_of_range":"invalid_number"))}),void 0!==i.sampleRate&&(Dp(i.sampleRate)&&0<=i.sampleRate&&i.sampleRate<=1?o.sampleRate=i.sampleRate:gp(r,"memoryMonitor.sampleRate","out_of_range")),void 0!==i.monitorPages&&(Array.isArray(i.monitorPages)&&i.monitorPages.length<=100&&i.monitorPages.every(function(e){return"string"==typeof e&&!!e||e instanceof RegExp})?o.monitorPages=g(i.monitorPages):gp(r,"memoryMonitor.monitorPages","invalid_value")),o);!s.enabled||!(()=>{var e;try{return"undefined"!=typeof window&&null!=(e=window.performance)&&e.memory}catch(e){}})()||Math.random()>=s.sampleRate||(e=s.monitorPages).length&&(t="undefined"==typeof window?"":window.location.href,!e.some(function(e){return"string"==typeof e?t.includes(e):(e.lastIndex=0,e.test(t))}))||(a={config:s,reportTimer:null,oomCheckTimer:null,lastOOMTime:0,records:[],destroyed:!1,onDestroy:function(){return wp(n)},onPageExit:function(){return wp(n)}},Pp.set(n,a),n.lifeCycle.on("destroy",a.onDestroy),"undefined"!=typeof window&&(window.addEventListener("pagehide",a.onPageExit),window.addEventListener("beforeunload",a.onPageExit)),s.enableMemoryReport&&(a.reportTimer=setInterval(function(){return bp(n,a,M.MEMORY_USAGE)},s.memoryReportInterval)),s.enableOOMReport&&(a.oomCheckTimer=setInterval(function(){var e=yp(),t=Date.now();e&&e.used/1024/1024>s.oomThreshold&&3e5<t-a.lastOOMTime&&(a.lastOOMTime=t,bp(n,a,M.MEMORY_OOM))},s.oomCheckInterval)))},destroy:function(){Array.from(Pp.keys()).forEach(wp)}});function Lp(e,t,n){try{var r={projectKey:e,sampleRate:t,replaySampleRate:void 0!==n.replay_sample_rate?Number(n.replay_sample_rate):1,errorTraceback:n.error_traceback,errorSampleRate:n.error_sample_rate,remoteEnabled:n.enabled,timestamp:Date.now()};localStorage.setItem("TDEM_SAMPLE_CONFIG",JSON.stringify(r))}catch(e){}}function Np(e){return e._tdemSampleGate||null}function Fp(e,t,n){e=Np(e);e?!n||t<=0?e.decide(!1):100<=t?e.decide(!0):(n=100*Math.random(),e.decide(n<t)):console.warn("[TDEM] Sample gate not found")}function Up(e,t){var t=ip(e.config.sessionReplay,t),n=(e._effectiveReplayPolicy=t,e._replaySampled=t.enabled,null==(n=null==(e=e.constructor.installedPlugins)?void 0:e.find)?void 0:n.call(e,function(e){return e&&"sessionReplay"===e.name})),e=null==(e=null==n?void 0:n.option)?void 0:e.applyEffectivePolicy;"function"==typeof e&&e.call(n.option,t)}function zp(e){var t={};return e&&"object"==typeof e&&(Object.prototype.hasOwnProperty.call(e,"enabled")&&(t.enabled=!!e.enabled),Object.prototype.hasOwnProperty.call(e,"replay_sample_rate")&&(t.replay_sample_rate=Number(e.replay_sample_rate)),Object.prototype.hasOwnProperty.call(e,"error_traceback")&&(t.error_traceback=!!e.error_traceback),Object.prototype.hasOwnProperty.call(e,"error_sample_rate"))&&(t.error_sample_rate=Number(e.error_sample_rate)),t}function Bp(e,t,n){var r,i=Np(e);i&&((t=t?(e=>{try{var t,n=localStorage.getItem("TDEM_SAMPLE_CONFIG");return n?(t=JSON.parse(n)).projectKey===e&&Date.now()-t.timestamp<6048e5?t:null:null}catch(e){return null}})(t):null)?(console.info("[TDEM] Using cached config, sampleRate:",t.sampleRate),n._cachedSampleRate=t.sampleRate,r={},void 0!==t.remoteEnabled&&(r.enabled=t.remoteEnabled),void 0!==t.replaySampleRate&&(r.replay_sample_rate=t.replaySampleRate),void 0!==t.errorTraceback&&(r.error_traceback=t.errorTraceback),void 0!==t.errorSampleRate&&(r.error_sample_rate=t.errorSampleRate),n._cachedRemote=r,n=void 0!==t.remoteEnabled?!!t.remoteEnabled:0<t.sampleRate,Fp(e,t.sampleRate,n),Up(e,r)):(console.warn("[TDEM] No cached config, default to not report"),i.decide(!1),Up(e,null)))}s=new e({name:"tdemConfig",_cachedSampleRate:null,_cachedRemote:null,onNewTdem:function(e){var t=this,n=e._prefetchedConfigData;Up(e,n?zp(n):null),function(l,u){P(this,void 0,void 0,function(){var n,r,i,o,a,s;return D(this,function(e){switch(e.label){case 0:if(!(n=l.config.id))return Bp(l,n,u),[2];if(r=l._prefetchedConfigData)return delete l._prefetchedConfigData,i=r.tdem_sample_rate,o=r.enabled,a=zp(r),Lp(n,i,a),u._cachedSampleRate=i,u._cachedRemote=a,Fp(l,i,o),Up(l,a),[2];if(t=(l.config.url||"").replace(/\/+$/,""),!(r=t?t+"/api/v1/config":""))return Bp(l,n,u),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,l.transportRequest({kind:"config",url:r,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_key:n})})];case 2:if(!(s=e.sent()).ok)throw new Error("HTTP "+s.status);if(0===(s="string"==typeof s.body?JSON.parse(s.body):s.body).code&&s.data)return i=s.data.tdem_sample_rate,o=s.data.enabled,a=zp(s.data),Lp(n,i,a),u._cachedSampleRate=i,u._cachedRemote=a,Fp(l,i,o),Up(l,a),[3,4];throw new Error("API error: code="+s.code);case 3:return s=e.sent(),console.warn("[TDEM] Failed to fetch remote config:",s),Bp(l,n,u),[3,4];case 4:return[2]}var t})})}(e,this),e.lifeCycle.on("sessionRefreshed",function(){t.onSessionRefreshed(e)})},onSessionRefreshed:function(e){var t,n=Np(e);n&&n.isDecided&&null!=(t=this._cachedSampleRate)&&(n=n.reDecide(t),t=e._effectiveReplayPolicy,e._replaySampled=n&&(!t||t.enabled),console.info("[TDEM] Session refreshed, session="+n+", replayPolicyEnabled="+(null==t?void 0:t.enabled)))}});return n.use(nn),n.use(Jt),n.use(ut),n.use(Rr),n.use(Sr),n.use(it),n.use(t),n.use(Or),n.use(zr),n.use(ln),n.use(_n),n.use($t),n.use(s),n.use(kp),n.use(Cp),n.use(Op),n.use(vu),n.use(i),n});