@amplitude/unified 1.0.0-beta.4 → 1.0.0-beta.5

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.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).amplitude={})}(this,(function(e){"use strict";var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};function r(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n,i,o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function a(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function l(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function u(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function h(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function d(e){return this instanceof d?(this.v=e,this):new d(e)}function p(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",(function(e){return function(t){return Promise.resolve(t).then(e,u)}})),n[Symbol.asyncIterator]=function(){return this},n;function s(e,t){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||a(e,t)}))},t&&(n[e]=t(n[e])))}function a(e,t){try{(r=i[e](t)).value instanceof d?Promise.resolve(r.value.v).then(l,u):c(o[0][2],r)}catch(e){c(o[0][3],e)}var r}function l(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=u(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(n||(n={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(i||(i={}));var g,m="AMP",v="".concat(m,"_unsent"),y="https://api2.amplitude.com/2/httpapi",b=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!w(t,r))return!1}return!0},w=function(e,t){var r,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=u(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&b(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(null==t)return!1;if("object"==typeof t)return b(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},S=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return o({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(g.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(g.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(g.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(g.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(g.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(g.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(g.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(g.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(g.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[g.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,r){if(this._validate(e,t,r)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=r,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,r){return void 0===this._properties[g.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===g.ADD?"number"==typeof r:e===g.UNSET||e===g.REMOVE||w(t,r)))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(g||(g={}));var C,I=[g.CLEAR_ALL,g.UNSET,g.SET,g.SET_ONCE,g.ADD,g.APPEND,g.PREPEND,g.PREINSERT,g.POSTINSERT,g.REMOVE];!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(C||(C={}));var x,k=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=C.Unknown),{event:e,code:t,message:r}},E=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},O=h([],c(Array(256).keys()),!1).map((function(e){return e.toString(16).padStart(2,"0")})),A=function(e){var t,r=E();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,A)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,h([],c(n.entries()),!1).map((function(e){var t=c(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(O[n]):O[n]})).join("")},R=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){var r,n;return a(this,void 0,void 0,(function(){return l(this,(function(i){switch(i.label){case 0:return this.plugins.some((function(t){return t.name===e.name}))?(t.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2]):(void 0===e.name&&(e.name=A(),t.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!==(r=e.type)&&void 0!==r?r:"enrichment",[4,null===(n=e.setup)||void 0===n?void 0:n.call(e,t,this.client)]);case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e,t){var r;return a(this,void 0,void 0,(function(){var n,i;return l(this,(function(o){switch(o.label){case 0:return n=this.plugins.findIndex((function(t){return t.name===e})),-1===n?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[n],this.plugins.splice(n,1),[4,null===(r=i.teardown)||void 0===r?void 0:r.call(i)]);case 1:return o.sent(),[2]}}))}))},e.prototype.reset=function(e){this.applying=!1,this.plugins.map((function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)})),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise((function(r){t.queue.push([e,r]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,s,a,h,d,p,f,g,m,v,y,b,w,S,C,I,x;return l(this,(function(l){switch(l.label){case 0:if(!e)return[2];t=c(e,1),r=t[0],n=c(e,2),i=n[1],s=this.plugins.filter((function(e){return"before"===e.type})),l.label=1;case 1:l.trys.push([1,6,7,8]),a=u(s),h=a.next(),l.label=2;case 2:return h.done?[3,5]:(m=h.value).execute?[4,m.execute(o({},r))]:[3,4];case 3:if(null===(v=l.sent()))return i({event:r,code:0,message:""}),[2];r=v,l.label=4;case 4:return h=a.next(),[3,2];case 5:return[3,8];case 6:return d=l.sent(),S={error:d},[3,8];case 7:try{h&&!h.done&&(C=a.return)&&C.call(a)}finally{if(S)throw S.error}return[7];case 8:p=this.plugins.filter((function(e){return"enrichment"===e.type||void 0===e.type})),l.label=9;case 9:l.trys.push([9,14,15,16]),f=u(p),g=f.next(),l.label=10;case 10:return g.done?[3,13]:(m=g.value).execute?[4,m.execute(o({},r))]:[3,12];case 11:if(null===(v=l.sent()))return i({event:r,code:0,message:""}),[2];r=v,l.label=12;case 12:return g=f.next(),[3,10];case 13:return[3,16];case 14:return y=l.sent(),I={error:y},[3,16];case 15:try{g&&!g.done&&(x=f.return)&&x.call(f)}finally{if(I)throw I.error}return[7];case 16:return b=this.plugins.filter((function(e){return"destination"===e.type})),w=b.map((function(e){var t=o({},r);return e.execute(t).catch((function(e){return k(t,0,String(e))}))})),Promise.all(w).then((function(e){var t=c(e,1)[0]||k(r,100,"Event not tracked, no destination plugins on the instance");i(t)})),[2]}}))}))},e.prototype.flush=function(){return a(this,void 0,void 0,(function(){var e,t,r,n=this;return l(this,(function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return i.sent(),t=this.plugins.filter((function(e){return"destination"===e.type})),r=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(r)];case 2:return i.sent(),[2]}}))}))},e.prototype.onIdentityChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onIdentityChanged)||void 0===r||r.call(t,e)}))},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onSessionIdChanged)||void 0===r||r.call(t,e)}))},e.prototype.onOptOutChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onOptOutChanged)||void 0===r||r.call(t,e)}))},e}(),P=function(e,t){return o(o({},t),{event_type:i.IDENTIFY,user_properties:e.getUserProperties()})},T=function(e){return{promise:e||Promise.resolve()}},_=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new R(this),this.name=e}return e.prototype._init=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o,s,a,c;return l(this,(function(l){switch(l.label){case 0:t=this[e],this[e]=[],l.label=1;case 1:l.trys.push([1,8,9,10]),r=u(t),n=r.next(),l.label=2;case 2:return n.done?[3,7]:(i=n.value,(o=i())&&"promise"in o?[4,o.promise]:[3,4]);case 3:return l.sent(),[3,6];case 4:return[4,o];case 5:l.sent(),l.label=6;case 6:return n=r.next(),[3,2];case 7:return[3,10];case 8:return s=l.sent(),a={error:s},[3,10];case 9:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(a)throw a.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:l.sent(),l.label=12;case 12:return[2]}}))}))},e.prototype.track=function(e,t,r){var n=function(e,t,r){return o(o(o({},"string"==typeof e?{event_type:e}:e),r),t&&{event_properties:t})}(e,t,r);return T(this.dispatch(n))},e.prototype.identify=function(e,t){var r=P(e,t);return T(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var s=function(e,t,r,n){var s;return o(o({},n),{event_type:i.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(s={},s[e]=t,s)})}(e,t,r,n);return T(this.dispatch(s))},e.prototype.setGroup=function(e,t,r){var n=function(e,t,r){var n,s=new S;return s.set(e,t),o(o({},r),{event_type:i.IDENTIFY,user_properties:s.getUserProperties(),groups:(n={},n[e]=t,n)})}(e,t,r);return T(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=function(e,t){return o(o({},t),{event_type:i.REVENUE,event_properties:e.getEventProperties()})}(e,t);return T(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),T())},e.prototype._addPlugin=function(e){return T(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),T())},e.prototype._removePlugin=function(e){return T(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(k(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return a(this,void 0,void 0,(function(){var t=this;return l(this,(function(r){return this.isReady?[2,this.process(e)]:[2,new Promise((function(r){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,r))}))]}))}))},e.prototype.getOperationAppliedUserProperties=function(e){var t={};if(void 0===e)return t;var r={};return Object.keys(e).forEach((function(t){Object.values(n).includes(t)||(r[t]=e[t])})),I.forEach((function(r){if(Object.keys(e).includes(r)){var i=e[r];switch(r){case n.CLEAR_ALL:Object.keys(t).forEach((function(e){delete t[e]}));break;case n.UNSET:Object.keys(i).forEach((function(e){delete t[e]}));break;case n.SET:Object.assign(t,i)}}})),Object.assign(t,r),t},e.prototype.process=function(e){return a(this,void 0,void 0,(function(){var t,r,n,o;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),this.config.optOut?[2,k(e,0,"Event skipped due to optOut config")]:(e.event_type===i.IDENTIFY&&(t=this.getOperationAppliedUserProperties(e.user_properties),this.timeline.onIdentityChanged({userProperties:t})),[4,this.timeline.push(e)]);case 1:return 200===(o=s.sent()).code?this.config.loggerProvider.log(o.message):100===o.code?this.config.loggerProvider.warn(o.message):this.config.loggerProvider.error(o.message),[2,o];case 2:return r=s.sent(),n=String(r),this.config.loggerProvider.error(n),[2,o=k(e,0,n)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.timeline.onOptOutChanged(e),this.config.optOut=Boolean(e))},e.prototype.flush=function(){return T(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find((function(t){return t.name===e}));if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e.prototype.plugins=function(e){return this.timeline.plugins.filter((function(t){return t instanceof e}))},e}(),M=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){return b(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?o({},this.properties):{};return e[x.REVENUE_PRODUCT_ID]=this.productId,e[x.REVENUE_QUANTITY]=this.quantity,e[x.REVENUE_PRICE]=this.price,e[x.REVENUE_TYPE]=this.revenueType,e[x.REVENUE_CURRENCY]=this.currency,e[x.REVENUE]=this.revenue,e[x.RECEIPT]=this.receipt,e[x.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}(x||(x={}));var N;!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(N||(N={}));var L="Amplitude Logger ",D=function(){function e(){this.logLevel=N.None}return e.prototype.disable=function(){this.logLevel=N.None},e.prototype.enable=function(e){void 0===e&&(e=N.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<N.Verbose||console.log("".concat(L,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<N.Warn||console.warn("".concat(L,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<N.Error||console.error("".concat(L,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<N.Debug||console.log("".concat(L,"[Debug]: ").concat(e.join(" ")))},e}(),F=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:N.Warn,loggerProvider:new D,offline:!1,optOut:!1,serverUrl:y,serverZone:"US",useBatch:!1}},U=function(){function e(e){var t,r,n,i;this._optOut=!1;var o=F();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=B(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),j=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":y},B=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=F().serverZone),void 0===r&&(r=F().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:F().serverZone;return{serverZone:n,serverUrl:j(n,r)}},z=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function V(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var W=function(){function e(){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[]}return e.prototype.setup=function(e){var t;return a(this,void 0,void 0,(function(){var r,n=this;return l(this,(function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(v,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(r=i.sent())&&r.length>0&&Promise.all(r.map((function(e){return n.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=A()),new Promise((function(r){var n={event:e,attempts:0,callback:function(e){return r(e)},timeout:0};t.queue.push(n),t.schedule(t.config.flushIntervalMillis),t.saveEvents()}))},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter((function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)}))},e.prototype.scheduleEvents=function(e){var t=this;e.forEach((function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)}))},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout((function(){t.queue=t.queue.map((function(e){return e.timeout=0,e})),t.flush(!0)}),e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){var t,r,n,i=this;return l(this,(function(o){switch(o.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],r=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):r.push(e)})),s=t,u=this.config.flushQueueSize,c=Math.max(u,1),n=s.reduce((function(e,t,r){var n=Math.floor(r/c);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,n.reduce((function(t,r){return a(i,void 0,void 0,(function(){return l(this,(function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve())]);case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}var s,u,c}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),a(this,void 0,void 0,(function(){var r,n,i,o,a;return l(this,(function(l){switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,s(t,["extra"])})),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new z,l.label=1;case 1:return l.trys.push([1,3,,4]),n=B(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(n,r)];case 2:return null===(i=l.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(i,e),[3,4]):("body"in i?this.fulfillRequest(e,i.statusCode,"".concat(i.status,": ").concat(V(i))):this.fulfillRequest(e,i.statusCode,i.status),[2]);case 3:return o=l.sent(),a=(u=o)instanceof Error?u.message:String(u),this.config.loggerProvider.error(a),this.handleResponse({status:C.Failed,statusCode:0},e),[3,4];case 4:return[2]}var u}))}))},e.prototype.handleResponse=function(e,t){var r=e.status;switch(r){case C.Success:this.handleSuccessResponse(e,t);break;case C.Invalid:this.handleInvalidResponse(e,t);break;case C.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case C.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var r=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=h(h(h(h([],c(Object.values(e.body.eventsWithInvalidFields)),!1),c(Object.values(e.body.eventsWithMissingFields)),!1),c(Object.values(e.body.eventsWithInvalidIdLengths)),!1),c(e.body.silencedEvents),!1).flat(),i=new Set(n),o=t.filter((function(t,n){if(!i.has(n))return!0;r.fulfillRequest([t],e.statusCode,e.body.error)}));o.length>0&&this.config.loggerProvider.warn(V(e));var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(V(e)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(r)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var r=this,n=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),a=new Set(i),l=new Set(o),u=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return l.has(n)&&(t.timeout=r.throttleTimeout),!0;r.fulfillRequest([t],e.statusCode,e.body.error)}));u.length>0&&this.config.loggerProvider.warn(V(e));var c=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,r=e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e})),n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.fulfillRequest=function(e,t,r){this.removeEvents(e),e.forEach((function(e){return e.callback(k(e.event,t,r))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map((function(e){return e.event}));this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter((function(t){return!e.some((function(e){return e.event.insert_id===t.event.insert_id}))})),this.saveEvents()},e}(),q=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:K(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),K=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},G=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),Z=function(){return Z=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)};function Y(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function J(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var $=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Y(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!$(u,c))return!1;var h=!0;return Object.keys(e).forEach((function(r){$(e[r],t[r])||(h=!1)})),h}for(var d=0;d<e.length;d++)if(!$(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var H,X=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Z({},this.identity.userProperties),r=Z(Z({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,o,s,a,l=r.userProperties||{};try{for(var u=Y(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=J(c.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(i=void 0,Y(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=J(g.value,2),v=m[0],y=m[1];l[v]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,Y(Object.keys(p))),w=b.next();!w.done;w=b.next()){delete l[v=w.value]}}catch(e){s={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return Z({},this.identity)},e.prototype.setIdentity=function(e){var t=Z({},this.identity);this.identity=Z({},e),$(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,ee=function(){function e(){this.identityStore=new X,this.eventBridge=new G,this.applicationContextProvider=new q}return e.getInstance=function(t){return Q.analyticsConnectorInstances||(Q.analyticsConnectorInstances={}),Q.analyticsConnectorInstances[t]||(Q.analyticsConnectorInstances[t]=new e),Q.analyticsConnectorInstances[t]},e}(),te=function(e){return void 0===e&&(e="$default_instance"),ee.getInstance(e)},re=function(){function e(){this.name="identity",this.type="before",this.identityStore=te().identityStore}return e.prototype.execute=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){return e.instanceName&&(this.identityStore=te(e.instanceName).identityStore),[2]}))}))},e}(),ne=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},ie=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[m,t,e.substring(0,r)].filter(Boolean).join("_")},oe=function(){var e,t,r,n;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(n=null!==(r=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==r?r:i)&&void 0!==n?n:""},se=function(){var e,t=E();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var r=t.split("=",2),n=ae(r[0]),i=ae(r[1]);return i?(e[n]=i,e):e}),{}):{}},ae=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},le=function(e){return function(){var t=o({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},ue=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=u(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},ce=function(e,t){return function(){var r,n,i={};try{for(var o=u(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=ue(e,a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},he=function(e,t,r,n,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=r(),l=a.logger,u=a.logLevel;if(u&&u<N.Debug||!u||!l)return e.apply(i,o);var c,h={type:"invoke public method",name:t,args:o,stacktrace:(c=1,void 0===c&&(c=0),((new Error).stack||"").split("\n").slice(2+c).map((function(e){return e.trim()}))),time:{start:(new Date).toISOString()},states:{}};n&&h.states&&(h.states.before=n());var d=e.apply(i,o);return d&&d.promise?d.promise.then((function(){n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))})):(n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))),d}},de=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return[2,(t=r.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return a(this,void 0,void 0,(function(){return l(this,(function(r){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),pe=function(){function e(e){this.options=o({},e)}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){var t,r;return l(this,(function(n){switch(n.label){case 0:if(!E())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),r="AMP_TEST",n.label=1;case 1:return n.trys.push([1,4,5,7]),[4,t.set(r,e.testValue)];case 2:return n.sent(),[4,t.get(r)];case 3:return[2,n.sent()===e.testValue];case 4:return n.sent(),[2,!1];case 5:return[4,t.remove(r)];case 6:return n.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){var t;return a(this,void 0,void 0,(function(){var r,n;return l(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(r=i.sent()))return[2,void 0];try{return void 0===(n=null!==(t=fe(r))&&void 0!==t?t:ge(r))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]):[2,JSON.parse(n)]}catch(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t,r;return a(this,void 0,void 0,(function(){var n,i,o;return l(this,(function(s){return n=E(),i=null!==(r=null===(t=null==n?void 0:n.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==r?r:[],(o=i.find((function(t){return 0===t.indexOf(e+"=")})))?[2,o.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var r;return a(this,void 0,void 0,(function(){var n,i,o,s,a,u,c;return l(this,(function(l){try{n=null!==(r=this.options.expirationDays)&&void 0!==r?r:0,o=void 0,(i=null!==t?n:-1)&&((s=new Date).setTime(s.getTime()+24*i*60*60*1e3),o=s),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(u=E())&&(u.document.cookie=a)}catch(t){c=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}return[2]}))}))},e.prototype.remove=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2]}))}))},e}(),fe=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},ge=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},me=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,i,o,s,a,l,u,c,h,d,p,f,g,m,v,y,b,w,S,I;if("object"!=typeof e)return null;var x=e.code||0,k=this.buildStatus(x);switch(k){case C.Success:return{status:k,statusCode:x,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case C.Invalid:return{status:k,statusCode:x,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case C.PayloadTooLarge:return{status:k,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case C.RateLimit:return{status:k,statusCode:x,body:{error:null!==(m=e.error)&&void 0!==m?m:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(w=e.exceeded_daily_quota_devices)&&void 0!==w?w:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(I=e.throttled_events)&&void 0!==I?I:[]}};case C.Timeout:default:return{status:k,statusCode:x}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?C.Success:429===e?C.RateLimit:413===e?C.PayloadTooLarge:408===e?C.Timeout:e>=400&&e<500?C.Invalid:e>=500?C.Failed:C.Unknown},e}(),ve=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=o.sent()).text()];case 2:i=o.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}}))}))},t}(me);!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(H||(H={}));var ye=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],be="data-amp-track-",we=["div","span","h1","h2","h3","h4","h5","h6"],Se=function(){function e(e){this.request=e}return Object.defineProperty(e.prototype,"headers",{get:function(){if(this._headers)return this._headers;var e=this.request.headers;if(Array.isArray(e)){var t=e;this._headers=t.reduce((function(e,t){var r=c(t,2),n=r[0],i=r[1];return e[n]=i,e}),{})}else if(e instanceof Headers){var r={};e.forEach((function(e,t){r[t]=e})),this._headers=r}else"object"==typeof e&&(this._headers=e);return this._headers},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=E();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=Ie(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),e}(),Ce=function(){function e(e){this.body=e}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return Ie(this.body,100)},enumerable:!1,configurable:!0}),e}();function Ie(e,t){var r,n,i,o=E(),s=null==o?void 0:o.TextEncoder;if(s){var a;if("string"==typeof e)a=e,i=(new s).encode(a).length;else if(e instanceof Blob)i=(a=e).size;else if(e instanceof URLSearchParams)a=e,i=(new s).encode(a.toString()).length;else if(ArrayBuffer.isView(e))i=(a=e).byteLength;else if(e instanceof ArrayBuffer)i=(a=e).byteLength;else if(e instanceof FormData){var l=e,h=0,d=0;try{for(var p=u(l.entries()),f=p.next();!f.done;f=p.next()){var g=c(f.value,2),m=g[0],v=g[1];if(h+=m.length,"string"==typeof v)h+=(new s).encode(v).length;else{if(!(v instanceof Blob))return;h+=v.size}if(++d>=t)return}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}i=h}else if(e instanceof ReadableStream)return void(a=e);return i}}var xe=function(){function e(e){this.response=e}return Object.defineProperty(e.prototype,"headers",{get:function(){var e;if(this._headers)return this._headers;if(this.response.headers instanceof Headers){var t=this.response.headers,r={};return null===(e=null==t?void 0:t.forEach)||void 0===e||e.call(t,(function(e,t){r[t]=e})),this._headers=r,r}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var r=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),n=r?parseInt(r,10):void 0;return this._bodySize=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e}(),ke=function(){function e(e,t,r){this.statusCode=e,this.headersString=t,this.size=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){var e,t;if(this.headersString){var r={},n=this.headersString.split("\r\n");try{for(var i=u(n),o=i.next();!o.done;o=i.next()){var s=c(o.value.split(": "),2),a=s[0],l=s[1];a&&l&&(r[a]=l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r}},enumerable:!1,configurable:!0}),e}(),Ee=function(){function e(e,t,r,n,i,o,s,a,l,u,c){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=r,this.startTime=n,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=l,this.error=u,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,r,n,i={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers,requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(r=this.responseWrapper)||void 0===r?void 0:r.headers,responseBodySize:null===(n=this.responseWrapper)||void 0===n?void 0:n.bodySize};return Object.fromEntries(Object.entries(i).filter((function(e){var t=c(e,2);return t[0],void 0!==t[1]})))},e}();var Oe,Ae,Re,Pe,Te,_e=function(e,t){void 0===t&&(t=A()),this.callback=e,this.id=t},Me=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=E();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=E();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,o,s,a,l;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var u=null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.XMLHttpRequest)||void 0===n?void 0:n.prototype)||void 0===i?void 0:i.open,c=null===(a=null===(s=null===(o=this.globalScope)||void 0===o?void 0:o.XMLHttpRequest)||void 0===s?void 0:s.prototype)||void 0===a?void 0:a.send;u&&c&&this.observeXhr(u,c);var h=null===(l=this.globalScope)||void 0===l?void 0:l.fetch;h&&this.observeFetch(h),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach((function(r){var n;try{r.callback(e)}catch(e){null===(n=t.logger)||void 0===n||n.debug("an unexpected error occurred while triggering event callbacks",e)}}))},e.prototype.handleNetworkRequestEvent=function(e,t,r,n,i,o,s){var a;if(void 0!==o&&void 0!==s){var l,u,c,h="GET";!function(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}(t)?l=null===(a=null==t?void 0:t.toString)||void 0===a?void 0:a.call(t):(l=t.url,h=t.method),h=(null==r?void 0:r.method)||h,n&&(u=n.status),i&&(c={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},u=0);var d=Math.floor(performance.now()-s),p=Math.floor(o+d),f=new Ee(e,h,o,o,l,r,u,d,n,c,p);this.triggerEventCallbacks(f)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null===performance||void 0===performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(r,n){return a(t,void 0,void 0,(function(){var t,i,o,s,a,u;return l(this,(function(l){switch(l.label){case 0:try{t=this.getTimestamps()}catch(e){null===(a=this.logger)||void 0===a||a.debug("an unexpected error occurred while retrieving timestamps",e)}l.label=1;case 1:return l.trys.push([1,3,,4]),[4,e(r,n)];case 2:return i=l.sent(),[3,4];case 3:return s=l.sent(),o=s,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,n?new Se(n):void 0,i?new xe(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){null===(u=this.logger)||void 0===u||u.debug("an unexpected error occurred while handling fetch",e)}if(i)return[2,i];throw o}}))}))})},e.prototype.observeXhr=function(e,t){if(this.globalScope&&e&&t){var r=this.globalScope.XMLHttpRequest.prototype,n=this;r.open=function(){for(var t,r,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];var a=c(i,2),l=a[0],u=a[1];try{this.$$AmplitudeAnalyticsEvent=o({method:l,url:null===(t=null==u?void 0:u.toString)||void 0===t?void 0:t.call(u)},n.getTimestamps())}catch(e){null===(r=n.logger)||void 0===r||r.debug("an unexpected error occurred while calling xhr open",e)}return e.apply(this,i)},r.send=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=this,o=e[0],s=i.$$AmplitudeAnalyticsEvent;return i.addEventListener("loadend",(function(){var e;try{var t=i.getAllResponseHeaders(),r=i.getResponseHeader("content-length"),a=new ke(i.status,t,r?parseInt(r,10):void 0),l=new Ce(o);s.status=i.status,n.handleNetworkRequestEvent("xhr",{url:s.url,method:s.method},l,a,void 0,s.startTime,s.durationStart)}catch(t){null===(e=n.logger)||void 0===e||e.debug("an unexpected error occurred while handling xhr send",t)}})),t.apply(i,e)}}},e}(),Ne=new Me,Le=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},De=function(e){return Le(e,"attribution")},Fe=function(e){return Le(e,"pageViews")},Ue=function(e){return Le(e,"sessions")},je=function(e){return"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},Be=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},ze=function(e){if(Be(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},Ve=function(e){if(je(e.autocapture)){if("object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking)return e.autocapture.networkTracking;if(e.networkTrackingOptions)return e.networkTrackingOptions}},We=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return Fe(e.defaultTracking)&&(r=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:t,pageCounter:i}},qe=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,o=n.args,s=n.resolve,a=e&&e[i];if("function"==typeof a){var l=a.apply(e,o);"function"==typeof s&&s(null==l?void 0:l.promise)}}return e},Ke=function(e){return e&&void 0!==e._q},Ge="2.17.10",Ze=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat("amplitude-ts","/").concat(Ge),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,r;return a(this,void 0,void 0,(function(){var n,i,s;return l(this,(function(a){return n=(new Date).getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,s=null!==(r=e.event_id)&&void 0!==r?r:i+1,this.config.lastEventId=s,e.time||(this.config.lastEventTime=n),[2,o(o(o(o(o(o(o(o({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:n},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:oe()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:A(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:s,library:this.library,user_agent:this.userAgent})]}))}))},e}(),Ye=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return i.sent(),[4,r.get(n)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=r.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return a(this,void 0,void 0,(function(){return l(this,(function(r){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var r;return a(this,void 0,void 0,(function(){return l(this,(function(n){try{null===(r=this.storage)||void 0===r||r.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return a(this,void 0,void 0,(function(){return l(this,(function(r){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return a(this,void 0,void 0,(function(){return l(this,(function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]}))}))},e}(),Je=1e3,$e=function(e){function t(t){var r,n,i,o=this;try{i=null===(r=E())||void 0===r?void 0:r.localStorage}catch(e){null===(n=null==t?void 0:t.loggerProvider)||void 0===n||n.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return r(t,e),t.prototype.set=function(t,r){var n;return a(this,void 0,void 0,(function(){var i;return l(this,(function(o){switch(o.label){case 0:return Array.isArray(r)&&r.length>Je?(i=r.length-Je,[4,e.prototype.set.call(this,t,r.slice(0,Je))]):[3,2];case 1:return o.sent(),null===(n=this.loggerProvider)||void 0===n||n.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(Je,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,r)];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t}(Ye),He=function(e){function t(){var t;return e.call(this,null===(t=E())||void 0===t?void 0:t.sessionStorage)||this}return r(t,e),t}(Ye),Xe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return r(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var r=this;return l(this,(function(n){return[2,new Promise((function(n,i){"undefined"==typeof XMLHttpRequest&&i(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===r.state.done){var e=o.responseText;try{n(r.buildResponse(JSON.parse(e)))}catch(e){n(r.buildResponse({code:o.status}))}}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},t}(me),Qe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var r=this;return l(this,(function(n){return[2,new Promise((function(n,i){var o=E();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,JSON.stringify(t))?r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):r.buildResponse({code:500}))}catch(e){i(e)}}))]}))}))},t}(me),et=function(e,t,r){return void 0===r&&(r=!0),a(void 0,void 0,void 0,(function(){var n,i,o,s,a,u,h,d,p;return l(this,(function(l){switch(l.label){case 0:return n=function(e){return"".concat(m.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(n)];case 1:return(i=l.sent())?r?[4,t.remove(n)]:[3,3]:[2,{optOut:!1}];case 2:l.sent(),l.label=3;case 3:return o=c(i.split("."),6),s=o[0],a=o[1],u=o[2],h=o[3],d=o[4],p=o[5],[2,{deviceId:s,userId:rt(a),sessionId:tt(h),lastEventId:tt(p),lastEventTime:tt(d),optOut:Boolean(u)}]}}))}))},tt=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},rt=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},nt="[Amplitude]",it="".concat(nt," Form Started"),ot="".concat(nt," Form Submitted"),st="".concat(nt," File Downloaded"),at="session_start",lt="session_end",ut="".concat(nt," File Extension"),ct="".concat(nt," File Name"),ht="".concat(nt," Link ID"),dt="".concat(nt," Link Text"),pt="".concat(nt," Link URL"),ft="".concat(nt," Form ID"),gt="".concat(nt," Form Name"),mt="".concat(nt," Form Destination"),vt="cookie",yt=function(e){function t(t,r,n,i,o,s,a,l,u,c,h,d,p,f,g,m,v,y,b,w,S,C,I,x,k,E,O,A,R,P,T,_,M,L,F){void 0===n&&(n=new de),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===u&&(u=5),void 0===c&&(c=30),void 0===h&&(h=vt),void 0===m&&(m=new D),void 0===v&&(v=N.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===I&&(I=""),void 0===x&&(x="US"),void 0===E&&(E=18e5),void 0===O&&(O=new $e({loggerProvider:m})),void 0===A&&(A={ipAddress:!0,language:!0,platform:!0}),void 0===R&&(R="fetch"),void 0===P&&(P=!1),void 0===T&&(T=!0);var U=e.call(this,{apiKey:t,storageProvider:O,transportProvider:St(R)})||this;return U.apiKey=t,U.appVersion=r,U.cookieOptions=i,U.defaultTracking=o,U.autocapture=s,U.flushIntervalMillis=l,U.flushMaxRetries=u,U.flushQueueSize=c,U.identityStorage=h,U.ingestionMetadata=d,U.instanceName=p,U.loggerProvider=m,U.logLevel=v,U.minIdLength=y,U.offline=b,U.partnerId=S,U.plan=C,U.serverUrl=I,U.serverZone=x,U.sessionTimeout=E,U.storageProvider=O,U.trackingOptions=A,U.transport=R,U.useBatch=P,U.fetchRemoteConfig=T,U.networkTrackingOptions=F,U.version=Ge,U._optOut=!1,U._cookieStorage=n,U.deviceId=a,U.lastEventId=f,U.lastEventTime=g,U.optOut=w,U.sessionId=k,U.pageCounter=M,U.userId=_,U.debugLogsEnabled=L,U.loggerProvider.enable(L?N.Debug:U.logLevel),U.networkTrackingOptions=F,U}return r(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(ie(this.apiKey),e)},t}(U),bt=function(e,t,r){return void 0===t&&(t={}),a(void 0,void 0,void 0,(function(){var n,i,s,a,u,c,h,d,p,f,g,m,v,y,b,w,S,C,I,x,k,E,O,R,P,T,_,M,N,L,D,F,U,j,B,z,V,W,q,K,G,Z,Y;return l(this,(function(l){switch(l.label){case 0:return n=t.identityStorage||vt,I={},n===vt?[3,1]:(s="",[3,5]);case 1:return null===(k=null===(x=t.cookieOptions)||void 0===x?void 0:x.domain)||void 0===k?[3,2]:(a=k,[3,4]);case 2:return[4,Ct()];case 3:a=l.sent(),l.label=4;case 4:s=a,l.label=5;case 5:return i=o.apply(void 0,[(I.domain=s,I.expiration=365,I.sameSite="Lax",I.secure=!1,I.upgrade=!0,I),t.cookieOptions]),u=wt(t.identityStorage,i),[4,et(e,u,null===(O=null===(E=t.cookieOptions)||void 0===E?void 0:E.upgrade)||void 0===O||O)];case 6:return c=l.sent(),[4,u.get(ie(e))];case 7:return h=l.sent(),d=se(),p=null!==(M=null!==(_=null!==(T=null!==(P=null!==(R=t.deviceId)&&void 0!==R?R:d.ampDeviceId)&&void 0!==P?P:d.deviceId)&&void 0!==T?T:null==h?void 0:h.deviceId)&&void 0!==_?_:c.deviceId)&&void 0!==M?M:A(),f=null!==(N=null==h?void 0:h.lastEventId)&&void 0!==N?N:c.lastEventId,g=null!==(L=null==h?void 0:h.lastEventTime)&&void 0!==L?L:c.lastEventTime,m=null!==(F=null!==(D=t.optOut)&&void 0!==D?D:null==h?void 0:h.optOut)&&void 0!==F?F:c.optOut,v=null!==(U=null==h?void 0:h.sessionId)&&void 0!==U?U:c.sessionId,y=null!==(B=null!==(j=t.userId)&&void 0!==j?j:null==h?void 0:h.userId)&&void 0!==B?B:c.userId,r.previousSessionDeviceId=null!==(z=null==h?void 0:h.deviceId)&&void 0!==z?z:c.deviceId,r.previousSessionUserId=null!==(V=null==h?void 0:h.userId)&&void 0!==V?V:c.userId,b={ipAddress:null===(q=null===(W=t.trackingOptions)||void 0===W?void 0:W.ipAddress)||void 0===q||q,language:null===(G=null===(K=t.trackingOptions)||void 0===K?void 0:K.language)||void 0===G||G,platform:null===(Y=null===(Z=t.trackingOptions)||void 0===Z?void 0:Z.platform)||void 0===Y||Y},w=null==h?void 0:h.pageCounter,S=null==h?void 0:h.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(C=new yt(e,t.appVersion,u,i,t.defaultTracking,t.autocapture,p,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,n,t.ingestionMetadata,t.instanceName,f,g,t.loggerProvider,t.logLevel,t.minIdLength,t.offline,m,t.partnerId,t.plan,t.serverUrl,t.serverZone,v,t.sessionTimeout,t.storageProvider,b,t.transport,t.useBatch,t.fetchRemoteConfig,y,w,S,t.networkTrackingOptions)).storageProvider.isEnabled()];case 8:return l.sent()||(C.loggerProvider.warn("Storage provider ".concat(C.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),C.storageProvider=new de),[2,C]}}))}))},wt=function(e,t){switch(void 0===e&&(e=vt),void 0===t&&(t={}),e){case"localStorage":return new $e;case"sessionStorage":return new He;case"none":return new de;default:return new pe(o(o({},t),{expirationDays:t.expiration}))}},St=function(e){return"xhr"===e?new Xe:"beacon"===e?new Qe:new ve},Ct=function(e){return a(void 0,void 0,void 0,(function(){var t,r,n,i,o,s,a;return l(this,(function(l){switch(l.label){case 0:return[4,(new pe).isEnabled()];case 1:if(!l.sent()||!e&&("undefined"==typeof location||!location.hostname))return[2,""];for(t=null!=e?e:location.hostname,r=t.split("."),n=[],i="AMP_TLDTEST",o=r.length-2;o>=0;--o)n.push(r.slice(o).join("."));o=0,l.label=2;case 2:return o<n.length?(s=n[o],[4,(a=new pe({domain:"."+s})).set(i,1)]):[3,7];case 3:return l.sent(),[4,a.get(i)];case 4:return l.sent()?[4,a.remove(i)]:[3,6];case 5:return l.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}}))}))},It=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},xt=function(){var e,t=It();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var r=t.split("=",2),n=kt(r[0]),i=kt(r[1]);return i?(e[n]=i,e):e}),{}):{}},kt=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Et="dclid",Ot="fbclid",At="gbraid",Rt="gclid",Pt="ko_click_id",Tt="li_fat_id",_t="msclkid",Mt="rtd_cid",Nt="ttclid",Lt="twclid",Dt="wbraid",Ft={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Ut=function(){function e(){}return e.prototype.parse=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,o(o(o(o({},Ft),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=xt();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=xt();return(e={})[Et]=t[Et],e[Ot]=t[Ot],e[At]=t[At],e[Rt]=t[Rt],e[Pt]=t[Pt],e[Tt]=t[Tt],e[_t]=t[_t],e[Mt]=t[Mt],e[Nt]=t[Nt],e[Lt]=t[Lt],e[Dt]=t[Dt],e},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(Oe||(Oe={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"}(Ae||(Ae={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(Re||(Re={})),function(e){e.US="US",e.EU="EU"}(Pe||(Pe={})),function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(Te||(Te={}));var jt=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},Bt=function(e){var t;void 0===e&&(e={});var r,n=It(),i=void 0,s=!1,u=e.trackOn,h=e.trackHistoryChanges,d=e.eventType,p=void 0===d?"[Amplitude] Page Viewed":d,f=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},g=function(){return a(void 0,void 0,void 0,(function(){var e,t,r;return l(this,(function(n){switch(n.label){case 0:return e=f("undefined"!=typeof location&&location.href||""),r={event_type:p},t=[{}],[4,zt()];case 1:return[2,(r.event_properties=o.apply(void 0,[o.apply(void 0,t.concat([n.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&f(location.pathname)||"","[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":e.split("?")[0]}]),r)]}}))}))},m=function(){return void 0===u||"function"==typeof u&&u()},v="undefined"!=typeof location?location.href:null,y=function(){return a(void 0,void 0,void 0,(function(){var e,r,n,o;return l(this,(function(s){switch(s.label){case 0:return e=location.href,r=Wt(h,e,v||"")&&m(),v=e,r?(null==i||i.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return o=(n=t).track,[4,g()];case 2:o.apply(n,[s.sent()]),s.label=3;case 3:s.label=4;case 4:return[2]}}))}))},b=function(){y()},w={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,o){return a(void 0,void 0,void 0,(function(){var a,u;return l(this,(function(l){switch(l.label){case 0:return t=o,r=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),s=!0,n&&(n.addEventListener("popstate",b),n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,r){var n=c(r,3),i=n[0],o=n[1],a=n[2];e.apply(t,[i,o,a]),s&&y()}})),m()?(i.log("Tracking page view event"),u=(a=t).track,[4,g()]):[3,2];case 1:u.apply(a,[l.sent()]),l.label=2;case 2:return[2]}}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){var t;return l(this,(function(n){switch(n.label){case 0:return"attribution"===u&&Vt(e)?(null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,g()]):[3,2];case 1:t=n.sent(),e.event_type=t.event_type,e.event_properties=o(o({},e.event_properties),t.event_properties),n.label=2;case 2:return r&&e.event_type===p&&(r.pageCounter=r.pageCounter?r.pageCounter+1:1,e.event_properties=o(o({},e.event_properties),{"[Amplitude] Page Counter":r.pageCounter})),[2,e]}}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(e){return n&&(n.removeEventListener("popstate",b),s=!1),[2]}))}))}};return w},zt=function(){return a(void 0,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return e=jt,[4,(new Ut).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},Vt=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[Oe.SET]||{},n=t[Oe.UNSET]||{},i=h(h([],c(Object.keys(r)),!1),c(Object.keys(n)),!1);return Object.keys(Ft).every((function(e){return i.includes(e)}))}return!1},Wt=function(e,t,r){if("pathOnly"===e){if(""==r)return!0;var n=new URL(t),i=new URL(r);return n.origin+n.pathname!==i.origin+i.pathname}return t!==r},qt=function(){var e,t=[],r=function(e,r,n){e.addEventListener(r,n),t.push({element:e,type:r,handler:n})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(t,n){return a(void 0,void 0,void 0,(function(){var i,o;return l(this,(function(s){return i=function(){if(n){if("undefined"!=typeof document){var i=function(e){var t=!1;r(e,"change",(function(){var r,i=Gt(e);t||n.track(it,((r={})[ft]=Kt(e.id),r[gt]=Kt(e.name),r[mt]=i,r)),t=!0})),r(e,"submit",(function(){var r,i,o=Gt(e);t||n.track(it,((r={})[ft]=Kt(e.id),r[gt]=Kt(e.name),r[mt]=o,r)),n.track(ot,((i={})[ft]=Kt(e.id),i[gt]=Kt(e.name),i[mt]=o,i)),t=!1}))};Array.from(document.getElementsByTagName("form")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(i)}))}))})),e.observe(document.body,{subtree:!0,childList:!0}))}}else t.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?i():(o=E())?o.addEventListener("load",i):t.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(r){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)})),t=[],[2]}))}))}}},Kt=function(e){if("string"==typeof e)return e},Gt=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},Zt=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(r,n){return a(void 0,void 0,void 0,(function(){var i,o;return l(this,(function(s){return i=function(){if(n){if("undefined"!=typeof document){var i=function(e){var r;try{r=new URL(e.href,window.location.href)}catch(e){return}var i=o.exec(r.href),s=null==i?void 0:i[1];s&&function(e,r,n){e.addEventListener(r,n),t.push({element:e,type:r,handler:n})}(e,"click",(function(){var t;s&&n.track(st,((t={})[ut]=s,t[ct]=r.pathname,t[ht]=e.id,t[dt]=e.text,t[pt]=e.href,t))}))},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)}))}))})),e.observe(document.body,{subtree:!0,childList:!0}))}}else r.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(o=E())?o.addEventListener("load",i):r.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(r){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)})),t=[],[2]}))}))}}},Yt=!1,Jt=function(){var e=E(),t=[],r=function(r,n){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(r,n),t.push({type:r,handler:n}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return a(void 0,void 0,void 0,(function(){return l(this,(function(n){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,r("online",(function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout((function(){t.flush()}),e.flushIntervalMillis)})),r("offline",(function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2])}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(r){return t.forEach((function(t){var r=t.type,n=t.handler;null==e||e.removeEventListener(r,n)})),t=[],[2]}))}))}}},$t="Remote config fetch rejected due to timeout after 5 seconds",Ht="Unexpected error occurred",Xt=function(){function e(e){var t=e.localConfig,r=e.configKeys,n=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteConfig=function(e,t,r){return a(n,void 0,void 0,(function(){var n,i,o;return l(this,(function(s){switch(s.label){case 0:return n=Date.now(),[4,this.fetchWithTimeout(r)];case 1:return(i=s.sent())&&(o=i.configs&&i.configs[e])?(this.metrics.fetchTimeAPISuccess=Date.now()-n,[2,o[t]]):(this.metrics.fetchTimeAPIFail=Date.now()-n,[2,void 0])}}))}))},this.fetchWithTimeout=function(e){return a(n,void 0,void 0,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:return t=new AbortController,r=setTimeout((function(){return t.abort()}),5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return n=i.sent(),clearTimeout(r),[2,n]}}))}))},this.fetchRemoteConfig=function(e,t){return a(n,void 0,void 0,(function(){var r,n,i,s,a,c,h,d,p,f,g,m;return l(this,(function(l){switch(l.label){case 0:if(t===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:"Remote config fetch rejected due to exceeded retry count"})];if(e.aborted)return[2,this.completeRequest({err:$t})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0),l.label=1;case 1:l.trys.push([1,3,,4]),r=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(n=u(this.configKeys),i=n.next();!i.done;i=n.next())s=i.value,r.append("config_keys",s)}catch(e){f={error:e}}finally{try{i&&!i.done&&(g=n.return)&&g.call(n)}finally{if(f)throw f.error}}return t&&r.set("session_id",String(t)),a={headers:{Accept:"*/*"},method:"GET"},c="".concat(this.getServerUrl(),"?").concat(r.toString()),this.attempts+=1,[4,fetch(c,o(o({},a),{signal:e}))];case 2:if(null===(h=l.sent()))return[2,this.completeRequest({err:Ht})];switch((new me).buildStatus(h.status)){case Te.Success:return this.attempts=0,[2,this.parseAndStoreConfig(h)];case Te.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:return d=l.sent(),p=d,e.aborted?[2,this.completeRequest({err:$t})]:[2,this.completeRequest({err:null!==(m=p.message)&&void 0!==m?m:Ht})];case 4:return[2]}}))}))},this.retryFetch=function(e,t){return a(n,void 0,void 0,(function(){var r=this;return l(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(e){return setTimeout(e,r.attempts*r.retryTimeout)}))];case 1:return n.sent(),[2,this.fetchRemoteConfig(e,t)]}}))}))},this.parseAndStoreConfig=function(e){return a(n,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return[4,e.json()];case 1:return t=r.sent(),this.completeRequest({success:"Remote config successfully fetched"}),[2,t]}}))}))},this.localConfig=t,this.configKeys=r}return e.prototype.getServerUrl=function(){return this.localConfig.serverZone===Pe.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===Pe.EU?"https://sr-client-cfg.eu.amplitude.com/config":"https://sr-client-cfg.amplitude.com/config"},e.prototype.completeRequest=function(e){var t=e.err,r=e.success;if(t)throw new Error(t);r&&this.localConfig.loggerProvider.log(r)},e}(),Qt=function(e){var t=e.localConfig,r=e.configKeys;return a(void 0,void 0,void 0,(function(){return l(this,(function(e){return[2,new Xt({localConfig:t,configKeys:r})]}))}))},er=function(){function e(e){this.config=e,this.config.loggerProvider.debug("Local configuration before merging with remote config",JSON.stringify(this.config,null,2))}return e.prototype.initialize=function(){return a(this,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return e=this,[4,Qt({localConfig:this.config,configKeys:["analyticsSDK"]})];case 1:return e.remoteConfigFetch=t.sent(),[2]}}))}))},e.prototype.generateJoinedConfig=function(){var e,t,r,n,i,s;return a(this,void 0,void 0,(function(){var a,c,h,d,p,f,g,m,v,y,b,w,S;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),(c=this.remoteConfigFetch)?[4,this.remoteConfigFetch.getRemoteConfig("analyticsSDK","browserSDK",this.config.sessionId)]:[3,2];case 1:c=l.sent(),l.label=2;case 2:if(a=c,this.config.loggerProvider.debug("Remote configuration:",JSON.stringify(a,null,2)),a&&"autocapture"in a){if("boolean"==typeof a.autocapture&&(this.config.autocapture=a.autocapture),"object"==typeof a.autocapture){if(h=o({},a.autocapture),void 0===this.config.autocapture&&(this.config.autocapture=a.autocapture),"object"==typeof a.autocapture.elementInteractions&&(null===(e=a.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===e?void 0:e.length)){h.elementInteractions=o({},a.autocapture.elementInteractions),d=h.elementInteractions,p=null!==(t=d.pageUrlAllowlist)&&void 0!==t?t:[],f=[];try{for(g=u(a.autocapture.elementInteractions.pageUrlAllowlistRegex),m=g.next();!m.done;m=g.next()){v=m.value;try{f.push(new RegExp(v))}catch(e){this.config.loggerProvider.warn("Invalid regex pattern: ".concat(v),e)}}}catch(e){w={error:e}}finally{try{m&&!m.done&&(S=g.return)&&S.call(g)}finally{if(w)throw w.error}}y=p.concat(f),d.pageUrlAllowlist=y,delete d.pageUrlAllowlistRegex}"boolean"==typeof this.config.autocapture&&(this.config.autocapture=o({attribution:this.config.autocapture,fileDownloads:this.config.autocapture,formInteractions:this.config.autocapture,pageViews:this.config.autocapture,sessions:this.config.autocapture,elementInteractions:this.config.autocapture},h)),"object"==typeof this.config.autocapture&&(this.config.autocapture=o(o({},this.config.autocapture),h))}this.config.defaultTracking=this.config.autocapture}return this.config.loggerProvider.debug("Joined configuration: ",JSON.stringify(this.config,null,2)),null!==(r=(s=this.config).requestMetadata)&&void 0!==r||(s.requestMetadata=new z),(null===(n=this.remoteConfigFetch)||void 0===n?void 0:n.metrics.fetchTimeAPISuccess)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_success",this.remoteConfigFetch.metrics.fetchTimeAPISuccess),(null===(i=this.remoteConfigFetch)||void 0===i?void 0:i.metrics.fetchTimeAPIFail)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_fail",this.remoteConfigFetch.metrics.fetchTimeAPIFail),[3,4];case 3:return b=l.sent(),this.config.loggerProvider.error("Failed to fetch remote configuration because of error: ",b),[3,4];case 4:return[2,this.config]}}))}))},e}(),tr="[Amplitude] Element Clicked",rr="[Amplitude] Element Tag",nr="[Amplitude] Element Text",ir="[Amplitude] Page URL",or="https://app.amplitude.com",sr={US:or,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};function ar(e){return"function"==typeof e}function lr(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var ur=lr((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function cr(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var hr=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=u(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(ar(l))try{l()}catch(e){i=e instanceof ur?e.errors:[e]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=u(d),f=p.next();!f.done;f=p.next()){var g=f.value;try{fr(g)}catch(e){i=null!=i?i:[],e instanceof ur?i=h(h([],c(i)),c(e.errors)):i.push(e)}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}}if(i)throw new ur(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)fr(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&cr(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&cr(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),dr=hr.EMPTY;function pr(e){return e instanceof hr||e&&"closed"in e&&ar(e.remove)&&ar(e.add)&&ar(e.unsubscribe)}function fr(e){ar(e)?e():e.unsubscribe()}var gr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},mr=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,h([e,t],c(r)))};function vr(e){mr((function(){throw e}))}function yr(){}function br(e){e()}var wr=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,pr(t)&&t.add(r)):r.destination=Er,r}return r(t,e),t.create=function(e,t,r){return new xr(e,t,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(hr),Sr=Function.prototype.bind;function Cr(e,t){return Sr.call(e,t)}var Ir=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){kr(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){kr(e)}else kr(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){kr(e)}},e}(),xr=function(e){function t(t,r,n){var i,o,s=e.call(this)||this;ar(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&gr.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&Cr(t.next,o),error:t.error&&Cr(t.error,o),complete:t.complete&&Cr(t.complete,o)}):i=t;return s.destination=new Ir(i),s}return r(t,e),t}(wr);function kr(e){vr(e)}var Er={closed:!0,next:yr,error:function(e){throw e},complete:yr},Or="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ar(e){return e}var Rr=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,i=this,o=(n=e)&&n instanceof wr||function(e){return e&&ar(e.next)&&ar(e.error)&&ar(e.complete)}(n)&&pr(n)?e:new xr(e,t,r);return br((function(){var e=i,t=e.operator,r=e.source;o.add(t?t.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=Pr(t))((function(t,n){var i=new xr({next:function(t){try{e(t)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t});r.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[Or]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(0===(e=t).length?Ar:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Pr(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function Pr(e){var t;return null!==(t=null!=e?e:gr.Promise)&&void 0!==t?t:Promise}function Tr(e){return ar(null==e?void 0:e.lift)}function _r(e){return function(t){if(Tr(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function Mr(e,t,r,n,i){return new Nr(e,t,r,n,i)}var Nr=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return r(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(wr);!function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,Tr(t)&&(n.lift=t.lift),n}r(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new hr;var r=this.getSubject();t.add(this.source.subscribe(Mr(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=hr.EMPTY)}return t},t.prototype.refCount=function(){return _r((function(e,t){var r=null;e._refCount++;var n=Mr(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))(this)}}(Rr);var Lr,Dr={now:function(){return(Dr.delegate||performance).now()},delegate:void 0},Fr={schedule:function(e){var t=requestAnimationFrame,r=cancelAnimationFrame,n=t((function(t){r=void 0,e(t)}));return new hr((function(){return null==r?void 0:r(n)}))},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Fr.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,h([],c(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return cancelAnimationFrame.apply(void 0,h([],c(e)))},delegate:void 0};new Rr((function(e){var t=Lr||Dr,r=t.now(),n=0,i=function(){e.closed||(n=Fr.requestAnimationFrame((function(o){n=0;var s=t.now();e.next({timestamp:Lr?s:o,elapsed:s-r}),i()})))};return i(),function(){n&&Fr.cancelAnimationFrame(n)}}));var Ur=lr((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),jr=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return r(t,e),t.prototype.lift=function(e){var t=new Br(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ur},t.prototype.next=function(e){var t=this;br((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=u(t.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(e)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;br((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;br((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?dr:(this.currentObservers=null,o.push(e),new hr((function(){t.currentObservers=null,cr(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new Rr;return e.source=this,e},t.create=function(e,t){return new Br(e,t)},t}(Rr),Br=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return r(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:dr},t}(jr);!function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}r(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)}}(jr);var zr={now:function(){return(zr.delegate||Date).now()},delegate:void 0};!function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=zr);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}r(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,l=1;l<n.length&&n[l]<=s;l+=2)a=l;a&&n.splice(0,a+1)}}}(jr),function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}r(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))}}(jr);var Vr,Wr=function(e){function t(t,r){return e.call(this)||this}return r(t,e),t.prototype.schedule=function(e,t){return this},t}(hr),qr=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,h([e,t],c(r)))},Kr=function(e){return clearInterval(e)},Gr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return r(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),qr(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&Kr(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,cr(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Wr),Zr=1,Yr={};function Jr(e){return e in Yr&&(delete Yr[e],!0)}var $r=function(e){var t=Zr++;return Yr[t]=!0,Vr||(Vr=Promise.resolve()),Vr.then((function(){return Jr(t)&&e()})),t},Hr=function(e){Jr(e)},Xr={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Xr.delegate;return((null==r?void 0:r.setImmediate)||$r).apply(void 0,h([],c(e)))},clearImmediate:function(e){return Hr(e)},delegate:void 0},Qr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=Xr.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(Xr.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(Gr),en=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=zr.now,e}(),tn=function(e){function t(t,r){void 0===r&&(r=en.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return r(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(en),rn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(tn);new rn(Qr);var nn=new tn(Gr),on=nn,sn=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(Gr),an=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(tn);new an(sn);var ln=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=Fr.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&r===t._scheduled&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(Fr.cancelAnimationFrame(r),t._scheduled=void 0)},t}(Gr),un=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.flush=function(e){var t;this._active=!0,e?t=e.id:(t=this._scheduled,this._scheduled=void 0);var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(tn);new un(ln),function(e){function t(t,r){void 0===t&&(t=cn),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}r(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10}(tn);var cn=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return r(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return hr.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(Gr),hn=new Rr((function(e){return e.complete()}));function dn(e){return e&&ar(e.schedule)}function pn(e){return e[e.length-1]}function fn(e){return dn(pn(e))?e.pop():void 0}var gn=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function mn(e){return ar(null==e?void 0:e.then)}function vn(e){return ar(e[Or])}function yn(e){return Symbol.asyncIterator&&ar(null==e?void 0:e[Symbol.asyncIterator])}function bn(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var wn,Sn="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Cn(e){return ar(null==e?void 0:e[Sn])}function In(e){return p(this,arguments,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,d(t.read())];case 3:return r=i.sent(),n=r.value,r.done?[4,d(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,d(n)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function xn(e){return ar(null==e?void 0:e.getReader)}function kn(e){if(e instanceof Rr)return e;if(null!=e){if(vn(e))return i=e,new Rr((function(e){var t=i[Or]();if(ar(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(gn(e))return n=e,new Rr((function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()}));if(mn(e))return r=e,new Rr((function(e){r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,vr)}));if(yn(e))return En(e);if(Cn(e))return t=e,new Rr((function(e){var r,n;try{for(var i=u(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()}));if(xn(e))return En(In(e))}var t,r,n,i;throw bn(e)}function En(e){return new Rr((function(t){(function(e,t){var r,n,i,o;return a(this,void 0,void 0,(function(){var s,a;return l(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),r=f(e),l.label=1;case 1:return[4,r.next()];case 2:if((n=l.sent()).done)return[3,4];if(s=n.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),i={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function On(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}function An(e,t){return void 0===t&&(t=0),_r((function(r,n){r.subscribe(Mr(n,(function(r){return On(n,e,(function(){return n.next(r)}),t)}),(function(){return On(n,e,(function(){return n.complete()}),t)}),(function(r){return On(n,e,(function(){return n.error(r)}),t)})))}))}function Rn(e,t){return void 0===t&&(t=0),_r((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}function Pn(e,t){if(!e)throw new Error("Iterable cannot be null");return new Rr((function(r){On(r,t,(function(){var n=e[Symbol.asyncIterator]();On(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}function Tn(e,t){if(null!=e){if(vn(e))return function(e,t){return kn(e).pipe(Rn(t),An(t))}(e,t);if(gn(e))return function(e,t){return new Rr((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}(e,t);if(mn(e))return function(e,t){return kn(e).pipe(Rn(t),An(t))}(e,t);if(yn(e))return Pn(e,t);if(Cn(e))return function(e,t){return new Rr((function(r){var n;return On(r,t,(function(){n=e[Sn](),On(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return ar(null==n?void 0:n.return)&&n.return()}}))}(e,t);if(xn(e))return function(e,t){return Pn(In(e),t)}(e,t)}throw bn(e)}function _n(e,t){return t?Tn(e,t):kn(e)}function Mn(e){return e instanceof Date&&!isNaN(e)}!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(wn||(wn={})),lr((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}})),lr((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),lr((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}})),lr((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}));var Nn=lr((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function Ln(e){throw new Nn(e)}function Dn(e,t){return _r((function(r,n){var i=0;r.subscribe(Mr(n,(function(r){n.next(e.call(t,r,i++))})))}))}var Fn=Array.isArray;function Un(e){return Dn((function(t){return function(e,t){return Fn(t)?e.apply(void 0,h([],c(t))):e(t)}(e,t)}))}function jn(e,t,r){return void 0===r&&(r=1/0),ar(t)?jn((function(r,n){return Dn((function(e,i){return t(r,e,n,i)}))(kn(e(r,n)))}),r):("number"==typeof t&&(r=t),_r((function(t,n){return function(e,t,r,n,i,o,s,a){var l=[],u=0,c=0,h=!1,d=function(){!h||l.length||u||t.complete()},p=function(e){return u<n?f(e):l.push(e)},f=function(e){o&&t.next(e),u++;var a=!1;kn(r(e,c++)).subscribe(Mr(t,(function(e){null==i||i(e),o?p(e):t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{u--;for(var e=function(){var e=l.shift();s?On(t,s,(function(){return f(e)})):f(e)};l.length&&u<n;)e();d()}catch(e){t.error(e)}})))};return e.subscribe(Mr(t,p,(function(){h=!0,d()}))),function(){null==a||a()}}(t,n,e,r)})))}function Bn(e){return void 0===e&&(e=1/0),jn(Ar,e)}function zn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Bn(1)(_n(e,fn(e)))}var Vn=["addListener","removeListener"],Wn=["addEventListener","removeEventListener"],qn=["on","off"];function Kn(e,t,r,n){if(ar(r)&&(n=r,r=void 0),n)return Kn(e,t,r).pipe(Un(n));var i=c(function(e){return ar(e.addEventListener)&&ar(e.removeEventListener)}(e)?Wn.map((function(n){return function(i){return e[n](t,i,r)}})):function(e){return ar(e.addListener)&&ar(e.removeListener)}(e)?Vn.map(Gn(e,t)):function(e){return ar(e.on)&&ar(e.off)}(e)?qn.map(Gn(e,t)):[],2),o=i[0],s=i[1];if(!o&&gn(e))return jn((function(e){return Kn(e,t,r)}))(kn(e));if(!o)throw new TypeError("Invalid event target");return new Rr((function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return o(t),function(){return s(t)}}))}function Gn(e,t){return function(r){return function(n){return e[r](t,n)}}}function Zn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=fn(e),n=function(e,t){return"number"==typeof pn(e)?e.pop():t}(e,1/0),i=e;return i.length?1===i.length?kn(i[0]):Bn(n)(_n(i,r)):hn}function Yn(e,t){return _r((function(r,n){var i=0;r.subscribe(Mr(n,(function(r){return e.call(t,r,i++)&&n.next(r)})))}))}function Jn(e){return e<=0?function(){return hn}:_r((function(t,r){var n=0;t.subscribe(Mr(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}function $n(e,t){return t?function(r){return zn(t.pipe(Jn(1),_r((function(e,t){e.subscribe(Mr(t,yr))}))),r.pipe($n(e)))}:jn((function(t,r){return kn(e(t,r)).pipe(Jn(1),function(e){return Dn((function(){return e}))}(t))}))}function Hn(e,t){void 0===t&&(t=nn);var r=function(e,t,r){void 0===e&&(e=0),void 0===r&&(r=on);var n=-1;return null!=t&&(dn(t)?r=t:n=t),new Rr((function(t){var i=Mn(e)?+e-r.now():e;i<0&&(i=0);var o=0;return r.schedule((function(){t.closed||(t.next(o++),0<=n?this.schedule(void 0,n):t.complete())}),i)}))}(e,t);return $n((function(){return r}))}function Xn(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new jr}:t,n=e.resetOnError,i=void 0===n||n,o=e.resetOnComplete,s=void 0===o||o,a=e.resetOnRefCountZero,l=void 0===a||a;return function(e){var t,n,o,a=0,u=!1,c=!1,h=function(){null==n||n.unsubscribe(),n=void 0},d=function(){h(),t=o=void 0,u=c=!1},p=function(){var e=t;d(),null==e||e.unsubscribe()};return _r((function(e,f){a++,c||u||h();var g=o=null!=o?o:r();f.add((function(){0!==--a||c||u||(n=Qn(p,l))})),g.subscribe(f),!t&&a>0&&(t=new xr({next:function(e){return g.next(e)},error:function(e){c=!0,h(),n=Qn(d,i,e),g.error(e)},complete:function(){u=!0,h(),n=Qn(d,s),g.complete()}}),kn(e).subscribe(t))}))(e)}}function Qn(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(!0!==t){if(!1!==t){var i=new xr({next:function(){i.unsubscribe(),e()}});return kn(t.apply(void 0,h([],c(r)))).subscribe(i)}}else e()}new Rr(yr);var ei=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],ti=["type"],ri=["svg","path","g"],ni=["password","hidden"];var ii=function(e){var t;return e?(t=function(e,t){for(var r=0,n=0;n<e.length;n++){var i=e[n];if(null===i)r+=4;else{var o=oi(i);r+=o?Array.from(o).length:4}if(r>t)return e.slice(0,n)}return e}(function(e){var t=[];if(!e)return t;t.push(e);for(var r=e.parentElement;r&&"HTML"!==r.tagName;)t.push(r),r=r.parentElement;return t}(e).map((function(e){return function(e){var t,r,n,i,o,s;if(null===e)return null;var a=String(e.tagName).toLowerCase(),l={tag:a},c=Array.from(null!==(i=null===(n=e.parentElement)||void 0===n?void 0:n.children)&&void 0!==i?i:[]);c.length&&(l.index=c.indexOf(e),l.indexOfType=c.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var h=null===(s=null===(o=e.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===s?void 0:s.toLowerCase();h&&(l.prevSib=String(h));var d=e.getAttribute("id");d&&(l.id=String(d));var p=Array.from(e.classList);p.length&&(l.classes=p);var f={},g=Array.from(e.attributes).filter((function(e){return!ei.includes(e.name)})),m=!ui(e);if(!ni.includes(String(e.getAttribute("type")))&&!ri.includes(a))try{for(var v=u(g),y=v.next();!y.done;y=v.next()){var b=y.value;m&&!ti.includes(b.name)||(f[b.name]=String(b.value).substring(0,128))}}catch(e){t={error:e}}finally{try{y&&!y.done&&(r=v.return)&&r.call(v)}finally{if(t)throw t.error}}return Object.keys(f).length&&(l.attrs=f),l}(e)})),1024),t):[]};function oi(e,t){void 0===t&&(t=!1);try{if(null==e)return t?"None":null;if("string"==typeof e)return t?(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(e,"'"):e.includes("'")?'"'.concat(e.replace(/'/g,"\\'"),'"'):"'".concat(e,"'"):e;if("boolean"==typeof e)return e?"True":"False";if(Array.isArray(e)){var r=e.map((function(e){return oi(e,!0)}));return"[".concat(r.join(", "),"]")}if("object"==typeof e){var n=Object.entries(e).filter((function(e){return null!=c(e,1)[0]})).map((function(e){var t=c(e,2),r=t[0],n=t[1];return"".concat(String(oi(r,!0)),": ").concat(String(oi(n,!0)))})),i="{".concat(n.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return e.toString()}catch(e){return null}}var si=["input","select","textarea"],ai=function(e,t){return function(r,n){var i,o,s,a=e.pageUrlAllowlist,l=e.shouldTrackEventResolver,u=null===(o=null===(i=null==n?void 0:n.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!u)return!1;if(l)return l(r,n);if(!hi(window.location.href,a))return!1;var c=String(null==n?void 0:n.getAttribute("type"))||"";if("string"==typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}if(t){var h=t.some((function(e){var t;return!!(null===(t=null==n?void 0:n.matches)||void 0===t?void 0:t.call(n,e))}));if(!h)return!1}switch(u){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:var d=null===(s=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===s?void 0:s.call(window,n);return!(!d||"pointer"!==d.getPropertyValue("cursor")||"click"!==r)||"click"===r}}},li=function(e){if(null==e)return!1;if("string"==typeof e){if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0},ui=function(e){var t,r,n,i=null===(r=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===r?void 0:r.call(t),o=e instanceof HTMLElement&&"true"===(null===(n=e.getAttribute("contenteditable"))||void 0===n?void 0:n.toLowerCase());return!si.includes(i)&&!o},ci=function(e){var t="";return ui(e)&&e.childNodes&&e.childNodes.length&&e.childNodes.forEach((function(e){var r="";!function(e){return!!e&&3===e.nodeType}(e)?r=ci(e):e.textContent&&(r=e.textContent),t+=r.split(/(\s+)/).filter(li).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),t},hi=function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))},di=function(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(n)||(t[r]=n),t}),{})},pi=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}if(t){var n=t.textContent||"";return li(n)?n:""}return pi(r)},fi=function(e,t){return e?t.some((function(t){var r;return null===(r=null==e?void 0:e.matches)||void 0===r?void 0:r.call(e,t)}))?e:fi(null==e?void 0:e.parentElement,t):null},gi=function(e){var t,r,n;if(!e)return{};var i=null===(n=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===n?void 0:n.call(r),o=((t={})[rr]=i,t[nr]=ci(e),t[ir]=window.location.href.split("?")[0],t);return di(o)};var mi=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)},vi=function(e,t,r){var n,i,o,s=null===(o=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i),a="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},l=t.getAttribute("aria-label"),u=function(e,t){return e.getAttributeNames().reduce((function(r,n){if(n.startsWith(t)){var i=n.replace(t,""),o=e.getAttribute(n);i&&(r[i]=o||"")}return r}),{})}(t,r),c=pi(t),h=((n={})["[Amplitude] Element ID"]=t.getAttribute("id")||"",n["[Amplitude] Element Class"]=t.getAttribute("class"),n["[Amplitude] Element Hierarchy"]=ii(t),n[rr]=s,n[nr]=ci(t),n["[Amplitude] Element Position Left"]=null==a.left?null:Math.round(a.left),n["[Amplitude] Element Position Top"]=null==a.top?null:Math.round(a.top),n["[Amplitude] Element Aria Label"]=l,n["[Amplitude] Element Attributes"]=u,n["[Amplitude] Element Parent Label"]=c,n[ir]=window.location.href.split("?")[0],n["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);return"a"===s&&"click"===e&&t instanceof HTMLAnchorElement&&(h["[Amplitude] Element Href"]=t.href),di(h)},yi=function(e,t,r,n){var i={event:e,timestamp:Date.now(),type:t};if(function(e){return"click"===e.type||"change"===e.type}(i)&&null!==i.event.target){var o=fi(i.event.target,r);return o&&(i.closestTrackedAncestor=o,i.targetElementProperties=vi(i.type,o,n)),i}return i};var bi=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?or:t,n=this;this.endpoint=or,this.requestCallbacks={},this.onSelect=function(e){n.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?n.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&n.notify({action:"track-selector-moved",data:t})},this.endpoint=r}return e.prototype.notify=function(e){var t,r,n,i;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===i||i.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t},s=new Promise((function(t,s){n.requestCallbacks[i]={resolve:t,reject:s},n.notify(o),(null==r?void 0:r.timeout)>0&&setTimeout((function(){s(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete n.requestCallbacks[i]}),r.timeout)}));return s},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.setup=function(e){var t=this,r=void 0===e?{}:e,n=r.logger,i=r.endpoint,o=r.isElementSelectable,s=r.cssSelectorAllowlist,a=r.actionClickAllowlist;this.logger=n,i&&this.endpoint===or&&(this.endpoint=i);var l=null;window.addEventListener("message",(function(e){var r,n,i,u,c;if(null===(n=null===(r=t.logger)||void 0===r?void 0:r.debug)||void 0===n||n.call(r,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var h,d=null==e?void 0:e.data,p=null==d?void 0:d.action;if(p)if("id"in d)null===(u=null===(i=t.logger)||void 0===i?void 0:i.debug)||void 0===u||u.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(d);else if("ping"===p)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===p){var f=null==d?void 0:d.data;(h="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(e,t){var r;try{var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src=h,n.addEventListener("load",(function(){e({status:!0})}),{once:!0}),n.addEventListener("error",(function(){t({status:!1,message:"Failed to load the script ".concat(h)})})),null===(r=document.head)||void 0===r||r.appendChild(n)}catch(e){t(e)}}))).then((function(){var e;l=null===(e=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:gi,isElementSelectable:function(e){return!o||o((null==f?void 0:f.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:t,cssSelectorAllowlist:s,actionClickAllowlist:a}),t.notify({action:"selector-loaded"})})).catch((function(){var e;null===(e=t.logger)||void 0===e||e.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===p&&(null===(c=null==l?void 0:l.close)||void 0===c||c.call(l))}})),this.notify({action:"page-loaded"})},e}();function wi(e){var t,r,n,i=e.amplitude,o=e.allObservables,s=e.options,a=e.shouldTrackEvent,l=e.evaluateTriggers,h=o.clickObservable,d=h.pipe(_r((function(e,t){var r,n=!1;e.subscribe(Mr(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))})),Yn((function(e){var t=c(e,2),r=t[0],n=t[1],i=r.event.target!==n.event.target,o=Math.abs(n.event.screenX-r.event.screenX)<=20&&Math.abs(n.event.screenY-r.event.screenY)<=20;return i&&!o}))),p=Zn(d,h.pipe((t=s.debounceTime,void 0===r&&(r=nn),_r((function(e,n){var i=null,o=null,s=null,a=function(){if(i){i.unsubscribe(),i=null;var e=o;o=null,n.next(e)}};function l(){var e=s+t,o=r.now();if(o<e)return i=this.schedule(void 0,e-o),void n.add(i);a()}e.subscribe(Mr(n,(function(e){o=e,s=r.now(),i||(i=r.schedule(l,t),n.add(i))}),(function(){a(),n.complete()}),void 0,(function(){o=i=null})))}))),Dn((function(){return"timeout"}))));return h.pipe(Hn(0),Yn(mi),Yn((function(e){return a("click",e.closestTrackedAncestor)})),Dn((function(e){return l(e)})),(n=p,_r((function(e,t){var r=[];return e.subscribe(Mr(t,(function(e){return r.push(e)}),(function(){t.next(r),t.complete()}))),kn(n).subscribe(Mr(t,(function(){var e=r;r=[],t.next(e)}),yr)),function(){r=null}})))).subscribe((function(e){var t,r,n=(e.length,tr);try{for(var o=u(e),s=o.next();!s.done;s=o.next()){var a=s.value;null==i||i.track(n,a.targetElementProperties)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}))}function Si(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=r.clickObservable,l=r.mutationObservable,u=r.navigateObservable,d=a.pipe(Yn((function(e){return!o("click",e.closestTrackedAncestor)})),Dn((function(e){var t=fi(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e})),Yn(mi),Yn((function(e){return s("click",e.closestTrackedAncestor)}))),p=[l];u&&p.push(u);var f,g,m=Zn.apply(void 0,h([],c(p),!1)),v=d.pipe((f=function(e){return m.pipe(Jn(1),function(e,t){var r=Mn(e)?{first:e}:"number"==typeof e?{each:e}:e,n=r.first,i=r.each,o=r.with,s=void 0===o?Ln:o,a=r.scheduler,l=void 0===a?null!=t?t:nn:a,u=r.meta,c=void 0===u?null:u;if(null==n&&null==i)throw new TypeError("No timeout provided.");return _r((function(e,t){var r,o,a=null,u=0,h=function(e){o=On(t,l,(function(){try{r.unsubscribe(),kn(s({meta:c,lastValue:a,seen:u})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(Mr(t,(function(e){null==o||o.unsubscribe(),u++,t.next(a=e),i>0&&h(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),a=null}))),!u&&h(null!=n?"number"==typeof n?n:+n-l.now():i)}))}({first:500,with:function(){return hn}}),Dn((function(){return e})))},_r((function(e,t){var r=null,n=0,i=!1,o=function(){return i&&!r&&t.complete()};e.subscribe(Mr(t,(function(e){null==r||r.unsubscribe();var i=0,s=n++;kn(f(e,s)).subscribe(r=Mr(t,(function(r){return t.next(g?g(e,r,s,i++):r)}),(function(){r=null,o()})))}),(function(){i=!0,o()})))}))));return v.subscribe((function(e){null==t||t.track(tr,i("click",e.closestTrackedAncestor))}))}var Ci,Ii=function(e,t){return t.filter((function(t){return t.definition.some((function(t){return t.event_type===e.type&&t.filters.every((function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"exact"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){return console.error("Error matching event to filter",e),!1}return!1}(e,t)}))}))}))},xi=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=document.documentElement;return e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector?r.querySelector(e.selector):r}}(e,t);if(!r)return;return"TEXT"===e.elementExtractType?r.textContent:"ATTRIBUTE"===e.elementExtractType&&e.attribute?r.getAttribute(e.attribute):void 0}},ki=function(e,t){e.forEach((function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=xi(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}}))};!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable"}(Ci||(Ci={}));var Ei,Oi=function(e){var t,r,n,i,s,d,p;void 0===e&&(e={});var f=e.dataAttributePrefix,g=void 0===f?be:f,m=e.visualTaggingOptions,v=void 0===m?{enabled:!0,messenger:new bi}:m;e.cssSelectorAllowlist=null!==(t=e.cssSelectorAllowlist)&&void 0!==t?t:ye,e.actionClickAllowlist=null!==(r=e.actionClickAllowlist)&&void 0!==r?r:we,e.debounceTime=null!==(n=e.debounceTime)&&void 0!==n?n:0;var y="@amplitude/plugin-autocapture-browser",b=[],w=function(){var t,r,n=Kn(document,"click",{capture:!0}).pipe(Dn((function(t){return yi(t,"click",e.cssSelectorAllowlist,g)})),Xn()),i=Kn(document,"change",{capture:!0}).pipe(Dn((function(t){return yi(t,"change",e.cssSelectorAllowlist,g)})),Xn());window.navigation&&(r=Kn(window.navigation,"navigate").pipe(Dn((function(t){return yi(t,"navigate",e.cssSelectorAllowlist,g)})),Xn()));var o=new Rr((function(e){var t=new MutationObserver((function(t){e.next(t)}));return t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})).pipe(Dn((function(t){return yi(t,"mutation",e.cssSelectorAllowlist,g)})),Xn());return(t={})[Ci.ClickObservable]=n,t[Ci.ChangeObservable]=i,t[Ci.NavigateObservable]=r,t[Ci.MutationObservable]=o,t},S=function(e){var t,r,n,i,o,s={click:new Set,change:new Set};if(!e)return s;try{for(var a=u(e),l=a.next();!l.done;l=a.next()){var c=l.value;try{try{for(var h=(n=void 0,u(c.definition)),d=h.next();!d.done;d=h.next())null===(o=s[d.value.event_type])||void 0===o||o.add(c.id)}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==c?void 0:c.id,e)}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return s}(Object.values(null!==(s=null===(i=e.pageActions)||void 0===i?void 0:i.labeledEvents)&&void 0!==s?s:{})),C=function(e){var t,r,n,i,o=new Map;try{for(var s=u(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{for(var c=(n=void 0,u(l.conditions)),h=c.next();!h.done;h=c.next()){var d=h.value;if("LABELED_EVENT"===d.type){var p=d.match.eventId,f=o.get(p);f||(f=[],o.set(p,f)),f.push(l)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return o}(null!==(p=null===(d=e.pageActions)||void 0===d?void 0:d.triggers)&&void 0!==p?p:[]),I=function(t){var r,n,i=e.pageActions;if(!i)return t;var o=Ii(t,Array.from(S[t.type]).map((function(e){return i.labeledEvents[e]}))),s=function(e,t){var r,n,i=new Set;try{for(var o=u(e),s=o.next();!s.done;s=o.next()){var a=s.value,l=t.get(a.id);l&&l.forEach((function(e){return i.add(e)}))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return Array.from(i)}(o,C);try{for(var a=u(s),l=a.next();!l.done;l=a.next()){var c=l.value;ki(c.actions,t)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return t};return{name:y,type:"enrichment",setup:function(t,r){return a(void 0,void 0,void 0,(function(){var n,i,s,a,u,d,p,f,m,S;return l(this,(function(l){return"undefined"==typeof document||(n=ai(e,e.cssSelectorAllowlist),i=ai(e,e.actionClickAllowlist),s=w(),a=wi({allObservables:s,options:e,amplitude:r,shouldTrackEvent:n,evaluateTriggers:I}),b.push(a),u=function(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return r.changeObservable.pipe(Yn(mi),Yn((function(e){return i("change",e.closestTrackedAncestor)})),Dn((function(e){return o(e)}))).subscribe((function(e){null==t||t.track("[Amplitude] Element Changed",n("change",e.closestTrackedAncestor))}))}({allObservables:s,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return vi.apply(void 0,h(h([],c(e),!1),[g],!1))},amplitude:r,shouldTrackEvent:n,evaluateTriggers:I}),b.push(u),d=Si({allObservables:s,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return vi.apply(void 0,h(h([],c(e),!1),[g],!1))},amplitude:r,shouldTrackEvent:n,shouldTrackActionClick:i}),b.push(d),null===(m=null==t?void 0:t.loggerProvider)||void 0===m||m.log("".concat(y," has been successfully added.")),window.opener&&v.enabled&&(p=e.cssSelectorAllowlist,f=e.actionClickAllowlist,null===(S=v.messenger)||void 0===S||S.setup(o(o({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:sr[t.serverZone]}),{isElementSelectable:ai(e,h(h([],c(p),!1),c(f),!1)),cssSelectorAllowlist:p,actionClickAllowlist:f})))),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){var e,t,r,n;return l(this,(function(i){try{for(e=u(b),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]}))}))}}},Ai="500-599";function Ri(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function Pi(e,t){var r,n,i=t.split(",");try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=c(s.value.split("-").map(Number),2),l=a[0],h=a[1];if(e===l&&void 0===h)return!0;if(e>=l&&e<=h)return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}function Ti(e){var t;if(e)try{var r=null===(t=E())||void 0===t?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),o=n.hash.replace("#",""),s=n.href,a=n.host;return n.hash="",n.search="",{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:n.href,host:a}}catch(e){return}}function _i(e,t){var r;void 0===t&&(t={});var n=Ti(e.url);if(!n)return!1;var i,o=n.host;if(!1!==t.ignoreAmplitudeRequests&&(Ri(o,"*.amplitude.com")||Ri(o,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find((function(e){return Ri(o,e)})))return!1;if(!t.captureRules&&void 0!==e.status&&!Pi(e.status,Ai))return!1;if(t.captureRules&&(h([],c(t.captureRules),!1).reverse().find((function(t){return i=function(e,t,r){if(!e.hosts||e.hosts.find((function(e){return Ri(t,e)})))return!((r||0===r)&&!Pi(r,e.statusCodeRange||Ai))}(t,o,e.status),void 0!==i})),!i))return!1;return!0}!function(e){e.NetworkObservable="networkObservable"}(Ei||(Ei={}));var Mi,Ni=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=[],i=function(){var e,r=new Rr((function(e){var r=new _e((function(t){var r=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(r)}));return Ne.subscribe(r,t),function(){Ne.unsubscribe(r)}}));return(e={})[Ei.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(o,s){return a(void 0,void 0,void 0,(function(){var a,u;return l(this,(function(l){return"undefined"==typeof document||(a=i(),u=function(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude;return t.networkObservable.pipe(Yn((function(e){return _i(e.event,r)}))).subscribe((function(e){var t,r,i,o=e.event,s=Ti(o.url);if(s){var a=null===(r=o.responseWrapper)||void 0===r?void 0:r.bodySize,l=null===(i=o.requestWrapper)||void 0===i?void 0:i.bodySize,u=((t={})["[Amplitude] URL"]=s.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=s.query,t["[Amplitude] URL Fragment"]=s.fragment,t["[Amplitude] Request Method"]=o.method,t["[Amplitude] Status Code"]=o.status,t["[Amplitude] Start Time"]=o.startTime,t["[Amplitude] Completion Time"]=o.endTime,t["[Amplitude] Duration"]=o.duration,t["[Amplitude] Request Body Size"]=l,t["[Amplitude] Response Body Size"]=a,t["[Amplitude] Request Type"]=o.type,t);null==n||n.track("[Amplitude] Network Request",u)}}))}({allObservables:a,networkTrackingOptions:e,amplitude:s}),n.push(u),null==(t=null==o?void 0:o.loggerProvider)||t.log("".concat(r," has been successfully added."))),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){var e,t,r,i;return l(this,(function(o){try{for(e=u(n),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}return[2]}))}))}}},Li="dclid",Di="fbclid",Fi="gbraid",Ui="gclid",ji="ko_click_id",Bi="li_fat_id",zi="msclkid",Vi="rtd_cid",Wi="ttclid",qi="twclid",Ki="wbraid",Gi={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Zi=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Yi=function(e,t,r,n,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,a=s(e,["referrer","referring_domain"]),l=t||{};l.referrer;var u=l.referring_domain,c=s(l,["referrer","referring_domain"]);if(Ji(r.excludeReferrers,e.referring_domain))return n.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&function(e){return Object.values(e).every((function(e){return!e}))}(e)&&t)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var h=JSON.stringify(a)!==JSON.stringify(c),d=Zi(o||"")!==Zi(u||""),p=!t||h||d;return p?n.debug("This is a new campaign. An $identify event will be sent."):n.debug("This is not a new campaign because it's the same as the previous one."),p},Ji=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some((function(e){return e instanceof RegExp?e.test(t):e===t}))},$i=function(){function e(){}return e.prototype.parse=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,o(o(o(o({},Gi),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=se();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=se();return(e={})[Li]=t[Li],e[Di]=t[Di],e[Fi]=t[Fi],e[Ui]=t[Ui],e[ji]=t[ji],e[Bi]=t[Bi],e[zi]=t[zi],e[Vi]=t[Vi],e[Wi]=t[Wi],e[qi]=t[qi],e[Ki]=t[Ki],e},e}(),Hi=function(){function e(e,t){var r,n,i,s,a,l;this.shouldTrackNewCampaign=!1,this.options=o({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(n=null===(r=t.cookieOptions)||void 0===r?void 0:r.domain,i=n,i?(i.startsWith(".")&&(i=i.substring(1)),[new RegExp("".concat(i.replace(".","\\."),"$"))]):[])},e),this.storage=t.cookieStorage,this.storageKey=(s=t.apiKey,void 0===(a="MKTG")&&(a=""),void 0===l&&(l=10),[m,a,s.substring(0,l)].filter(Boolean).join("_")),this.currentCampaign=Gi,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return a(this,void 0,void 0,(function(){var e,t;return l(this,(function(r){switch(r.label){case 0:return[4,this.fetchCampaign()];case 1:return t=c.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||ne(this.sessionTimeout,this.lastEventTime),Yi(this.currentCampaign,this.previousCampaign,this.options,this.logger,e)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},e.prototype.fetchCampaign=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,Promise.all([(new $i).parse(),this.storage.get(this.storageKey)])];case 1:return[2,e.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,r,n,i,s=(t=this.currentCampaign,r=this.options,n=o(o({},Gi),t),i=Object.entries(n).reduce((function(e,t){var n,i=c(t,2),o=i[0],s=i[1];return e.setOnce("initial_".concat(o),null!==(n=null!=s?s:r.initialEmptyValue)&&void 0!==n?n:"EMPTY"),s?e.set(o,s):e.unset(o)}),new S),P(i));return e&&(s.event_id=e),s},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),Xi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.init=function(e,t,r){var n,i;return void 0===e&&(e=""),arguments.length>2?(n=t,i=r):"string"==typeof t?(n=t,i=void 0):(n=null==t?void 0:t.userId,i=t),T(this._init(o(o({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i;return a(this,void 0,void 0,(function(){var s,u,c,h,d,p=this;return l(this,(function(f){switch(f.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,bt(t.apiKey,t,this)]);case 1:return(s=f.sent()).fetchRemoteConfig?[4,(m=s,a(void 0,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return[4,(e=new er(m)).initialize()];case 1:return t.sent(),[2,e]}}))})))]:[3,4];case 2:return[4,f.sent().generateJoinedConfig()];case 3:s=f.sent(),f.label=4;case 4:return[4,e.prototype._init.call(this,s)];case 5:return f.sent(),this.logBrowserOptions(s),De(this.config.defaultTracking)?(u=function(e){return De(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?o({},e.defaultTracking.attribution):{}}(this.config),this.webAttribution=new Hi(u,this.config),[4,this.webAttribution.init()]):[3,7];case 6:f.sent(),f.label=7;case 7:return c=se(),h=Number.isNaN(Number(c.ampSessionId))?void 0:Number(c.ampSessionId),this.setSessionId(null!==(i=null!==(n=null!==(r=t.sessionId)&&void 0!==r?r:h)&&void 0!==n?n:this.config.sessionId)&&void 0!==i?i:Date.now()),(d=te(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,9]:[4,this.add(Jt()).promise];case 8:f.sent(),f.label=9;case 9:return[4,this.add(new W).promise];case 10:return f.sent(),[4,this.add(new Ze).promise];case 11:return f.sent(),[4,this.add(new re).promise];case 12:return f.sent(),function(e){Yt||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),Yt=!0)}(this.config),g=this.config.defaultTracking,Le(g,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(Zt()).promise]):[3,14];case 13:f.sent(),f.label=14;case 14:return function(e){return Le(e,"formInteractions")}(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(qt()).promise]):[3,16];case 15:f.sent(),f.label=16;case 16:return Fe(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Bt(We(this.config))).promise]):[3,18];case 17:f.sent(),f.label=18;case 18:return Be(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Oi(ze(this.config))).promise]):[3,20];case 19:f.sent(),f.label=20;case 20:return je(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(Ni(Ve(this.config))).promise]):[3,22];case 21:f.sent(),f.label=22;case 22:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 23:return f.sent(),d.eventBridge.setEventReceiver((function(e){p.track(e.eventType,e.eventProperties)})),[2]}var g,m}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),function(e,t){te(t).identityStore.editIdentity().setUserId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),function(e,t){te(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(A()),this.setUserId(void 0)},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,r=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),T(Promise.resolve());if(e===this.config.sessionId)return T(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var n=this.getSessionId();n!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,Ue(this.config.defaultTracking)&&(n&&i&&r.push(this.track(lt,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:n,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,r);return Ue(this.config.defaultTracking)&&r.push(this.track(at,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,T(Promise.all(r))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=St(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,r){if(Ke(t)){var n=t._q;t._q=[],t=qe(new S,n)}return(null==r?void 0:r.user_id)&&this.setUserId(r.user_id),(null==r?void 0:r.device_id)&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,t,r)},t.prototype.groupIdentify=function(t,r,n,i){if(Ke(n)){var o=n._q;n._q=[],n=qe(new S,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(Ke(t)){var n=t._q;t._q=[],t=qe(new M,n)}return e.prototype.revenue.call(this,t,r)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var r=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(r).promise):this.track(r),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(o){return r=Date.now(),n=ne(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===at||t.event_type===lt||t.session_id&&t.session_id!==this.getSessionId()||(n||i?(this.setSessionId(r),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]}))}))},t.prototype.logBrowserOptions=function(e){try{var t=o(o({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t}(_),Qi=Object.freeze({__proto__:null,get IdentifyOperation(){return n},get SpecialEventType(){return i},get RevenueProperty(){return x},get LogLevel(){return N},get ServerZone(){return H},OfflineDisabled:null,DEFAULT_CSS_SELECTOR_ALLOWLIST:ye,DEFAULT_DATA_ATTRIBUTE_PREFIX:be,DEFAULT_ACTION_CLICK_ALLOWLIST:we}),eo="[Amplitude]",to="".concat(eo," Session Replay ID"),ro=H.US,no="".concat(eo," Session Replay Debug"),io="amp-mask";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata"}(Mi||(Mi={}));var oo=function(){function e(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(e){var t;if(!this.logger)return function(){};var r=this.logger[e];return"function"==typeof r?(null!==(t=r.__rrweb_original__)&&void 0!==t?t:r).bind(this.logger):function(){}},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}(),so="medium";var ao,lo,uo=function(e,t,r){switch(t){case"light":if("input"!==e)return!0;var n=r?function(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}(r):"";return!!n&&(!!["password","hidden","email","tel"].includes(n)||!!r.autocomplete.startsWith("cc-"));case"medium":case"conservative":return!0;default:return uo(e,so,r)}},co=function(e,t){return function(r,n){return function(e,t,r){var n,i,o;if(void 0===t&&(t={defaultMaskLevel:so}),r){if(r.closest("."+io))return!0;var s=(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some((function(e){return r.closest(e)}));if(s)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(i=t.unmaskSelector)&&void 0!==i?i:[]).some((function(e){return r.closest(e)}));if(a)return!1}return uo(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:so,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},ho=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t|=0}return t},po=function(e,t){return t||(e===H.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===H.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},fo=function(e,t){var r,n,i,o;try{for(var s=u(t),a=s.next();!a.done;a=s.next()){var l=a.value,c=(i=l.selector,o=void 0,o=i.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,"."),new RegExp("^".concat(o,"$")));if(c.test(e))return e.replace(c,l.replacement)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e},go=function(){return a(void 0,void 0,void 0,(function(){var e,t,r,n,i,o,s;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=E())?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=a.sent(),r=t.usage,n=t.quota,i=t.usageDetails,o=r?Math.round(r/1024):0,s=r&&n?Math.round(1e3*(r/n+Number.EPSILON))/1e3:0,[2,{totalStorageSize:o,percentOfQuota:s,usageDetails:JSON.stringify(i)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}}))}))},mo=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},vo=function(){return{flushMaxRetries:2,logLevel:N.Warn,loggerProvider:new D,transportProvider:new ve}},yo=function(e){function t(t,r){var n,i,s=this,a=vo();return(s=e.call(this,o(o({transportProvider:a.transportProvider,loggerProvider:new oo(r.loggerProvider||a.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=a.flushMaxRetries?r.flushMaxRetries:a.flushMaxRetries,s.apiKey=t,s.sampleRate=r.sampleRate||0,s.serverZone=r.serverZone||ro,s.configServerUrl=r.configServerUrl,s.trackServerUrl=r.trackServerUrl,s.shouldInlineStylesheet=r.shouldInlineStylesheet,s.version=r.version,s.performanceConfig=r.performanceConfig,s.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",s.applyBackgroundColorToBlockedElements=null!==(i=r.applyBackgroundColorToBlockedElements)&&void 0!==i&&i,r.privacyConfig&&(s.privacyConfig=r.privacyConfig),r.interactionConfig&&(s.interactionConfig=r.interactionConfig,s.interactionConfig.ugcFilterRules&&function(e){if(!e.every((function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement})))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every((function(e){return"string"==typeof(t=e.selector)&&""!==t.trim()&&!!/^\/|^https?:\/\/[^\s]+$/.test(t);var t})))throw new Error("ugcFilterRules must be an array of objects with valid globs")}(s.interactionConfig.ugcFilterRules)),r.debugMode&&(s.debugMode=r.debugMode),r.experimental&&(s.experimental=r.experimental),s}return r(t,e),t}(U),bo=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(bo||{}),wo=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(wo||{});!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(ao||(ao={})),function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(lo||(lo={}));var So=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,i,o,s,a,l,u,c,h,d,p,f,g,m,v,y,b,w,S,C;if("object"!=typeof e)return null;var I=e.code||0,x=this.buildStatus(I);switch(x){case lo.Success:return{status:x,statusCode:I,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case lo.Invalid:return{status:x,statusCode:I,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case lo.PayloadTooLarge:return{status:x,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case lo.RateLimit:return{status:x,statusCode:I,body:{error:null!==(m=e.error)&&void 0!==m?m:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(w=e.exceeded_daily_quota_devices)&&void 0!==w?w:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(C=e.throttled_events)&&void 0!==C?C:[]}};case lo.Timeout:default:return{status:x,statusCode:I}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?lo.Success:429===e?lo.RateLimit:413===e?lo.PayloadTooLarge:408===e?lo.Timeout:e>=400&&e<500?lo.Invalid:e>=500?lo.Failed:lo.Unknown},e}(),Co="Remote config fetch rejected due to timeout after 5 seconds",Io="Unexpected error occurred",xo=function(){function e(e){var t=e.localConfig,r=e.configKeys,n=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteConfig=function(e,t,r){return a(n,void 0,void 0,(function(){var n,i,o;return l(this,(function(s){switch(s.label){case 0:return n=Date.now(),[4,this.fetchWithTimeout(r)];case 1:return(i=s.sent())&&(o=i.configs&&i.configs[e])?(this.metrics.fetchTimeAPISuccess=Date.now()-n,[2,o[t]]):(this.metrics.fetchTimeAPIFail=Date.now()-n,[2,void 0])}}))}))},this.fetchWithTimeout=function(e){return a(n,void 0,void 0,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:return t=new AbortController,r=setTimeout((function(){return t.abort()}),5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return n=i.sent(),clearTimeout(r),[2,n]}}))}))},this.fetchRemoteConfig=function(e,t){return a(n,void 0,void 0,(function(){var r,n,i,s,a,c,h,d,p,f,g,m;return l(this,(function(l){switch(l.label){case 0:if(t===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:"Remote config fetch rejected due to exceeded retry count"})];if(e.aborted)return[2,this.completeRequest({err:Co})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0),l.label=1;case 1:l.trys.push([1,3,,4]),r=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(n=u(this.configKeys),i=n.next();!i.done;i=n.next())s=i.value,r.append("config_keys",s)}catch(e){f={error:e}}finally{try{i&&!i.done&&(g=n.return)&&g.call(n)}finally{if(f)throw f.error}}return t&&r.set("session_id",String(t)),a={headers:{Accept:"*/*"},method:"GET"},c="".concat(this.getServerUrl(),"?").concat(r.toString()),this.attempts+=1,[4,fetch(c,o(o({},a),{signal:e}))];case 2:if(null===(h=l.sent()))return[2,this.completeRequest({err:Io})];switch((new So).buildStatus(h.status)){case lo.Success:return this.attempts=0,[2,this.parseAndStoreConfig(h)];case lo.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:return d=l.sent(),p=d,e.aborted?[2,this.completeRequest({err:Co})]:[2,this.completeRequest({err:null!==(m=p.message)&&void 0!==m?m:Io})];case 4:return[2]}}))}))},this.retryFetch=function(e,t){return a(n,void 0,void 0,(function(){var r=this;return l(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(e){return setTimeout(e,r.attempts*r.retryTimeout)}))];case 1:return n.sent(),[2,this.fetchRemoteConfig(e,t)]}}))}))},this.parseAndStoreConfig=function(e){return a(n,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return[4,e.json()];case 1:return t=r.sent(),this.completeRequest({success:"Remote config successfully fetched"}),[2,t]}}))}))},this.localConfig=t,this.configKeys=r}return e.prototype.getServerUrl=function(){return this.localConfig.configServerUrl?this.localConfig.configServerUrl:this.localConfig.serverZone===ao.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===ao.EU?"https://sr-client-cfg.eu.amplitude.com/config":"https://sr-client-cfg.amplitude.com/config"},e.prototype.completeRequest=function(e){var t=e.err,r=e.success;if(t)throw new Error(t);r&&this.localConfig.loggerProvider.log(r)},e}(),ko=function(e){var t=e.localConfig,r=e.configKeys;return a(void 0,void 0,void 0,(function(){return l(this,(function(e){return[2,new xo({localConfig:t,configKeys:r})]}))}))},Eo=function(){function e(e,t){this.localConfig=t,this.remoteConfigFetch=e}return e.prototype.generateJoinedConfig=function(e){var t,r,n,i;return a(this,void 0,void 0,(function(){var s,a,h,d,p,f,g,m,v,y,b,w,S,C,I,x,k,E,O,A,R,P;return l(this,(function(l){switch(l.label){case 0:(s=o({},this.localConfig)).optOut=this.localConfig.optOut,s.captureEnabled=!0,l.label=1;case 1:return l.trys.push([1,6,,7]),[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_sampling_config",e)];case 2:return h=l.sent(),[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_privacy_config",e)];case 3:return d=l.sent(),p=null===(t=s.interactionConfig)||void 0===t?void 0:t.ugcFilterRules,f=s,[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_interaction_config",e)];case 4:return f.interactionConfig=l.sent(),s.interactionConfig&&p&&(s.interactionConfig.ugcFilterRules=p),g=s,[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_logging_config",e)];case 5:return g.loggingConfig=l.sent(),(h||d)&&(a={},h&&(a.sr_sampling_config=h),d&&(a.sr_privacy_config=d)),[3,7];case 6:return m=l.sent(),v=m,this.localConfig.loggerProvider.warn(v.message),s.captureEnabled=!1,[3,7];case 7:if(!a)return[2,{localConfig:this.localConfig,joinedConfig:s,remoteConfig:a}];if(y=a.sr_sampling_config,b=a.sr_privacy_config,y&&Object.keys(y).length>0?(Object.prototype.hasOwnProperty.call(y,"capture_enabled")?s.captureEnabled=y.capture_enabled:s.captureEnabled=!1,Object.prototype.hasOwnProperty.call(y,"sample_rate")&&(s.sampleRate=y.sample_rate)):(s.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),b){w=null!==(r=s.privacyConfig)&&void 0!==r?r:{},S={defaultMaskLevel:null!==(i=null!==(n=b.defaultMaskLevel)&&void 0!==n?n:w.defaultMaskLevel)&&void 0!==i?i:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},C=function(e){var t,r,n,i,o,s,a,l,c,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=u(null!==(a=e.blockSelector)&&void 0!==a?a:[]),p=d.next();!p.done;p=d.next()){h[p.value]="block"}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var f=u(null!==(l=e.maskSelector)&&void 0!==l?l:[]),g=f.next();!g.done;g=f.next()){h[g.value]="mask"}}catch(e){n={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}try{for(var m=u(null!==(c=e.unmaskSelector)&&void 0!==c?c:[]),v=m.next();!v.done;v=m.next()){h[v.value]="unmask"}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}return h},I=o(o({},C(w)),C(b));try{for(x=u(Object.entries(I)),k=x.next();!k.done;k=x.next())E=c(k.value,2),O=E[0],"mask"===(A=E[1])?S.maskSelector.push(O):"block"===A?S.blockSelector.push(O):"unmask"===A&&S.unmaskSelector.push(O)}catch(e){R={error:e}}finally{try{k&&!k.done&&(P=x.return)&&P.call(x)}finally{if(R)throw R.error}}s.privacyConfig=function(e,t){var r=document.createDocumentFragment(),n=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter((function(e){try{r.querySelector(e)}catch(r){return t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})),0!==e.length)return e};return e.blockSelector=n(e.blockSelector),e.maskSelector=n(e.maskSelector),e.unmaskSelector=n(e.unmaskSelector),e}(S,this.localConfig.loggerProvider)}return this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:mo(s)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:s,remoteConfig:a}]}}))}))},e}(),Oo=function(e,t){return a(void 0,void 0,void 0,(function(){var r,n;return l(this,(function(i){switch(i.label){case 0:return r=new yo(e,t),[4,ko({localConfig:r,configKeys:["sessionReplay"]})];case 1:return n=i.sent(),[2,new Eo(n,r)]}}))}))},Ao="Failed to store session replay events in IndexedDB",Ro="1.25.0",Po=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue(o(o({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter((function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:"Session replay event batch rejected due to exceeded retry count"}),!1)})).forEach((function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout((function(){t.timeout=0,e.schedule(0)}),t.timeout):e.schedule(0)}))},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout((function(){t.flush(!0).then((function(){t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){var t,r,n=this;return l(this,(function(i){switch(i.label){case 0:return t=[],r=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):r.push(e)})),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,Promise.all(t.map((function(t){return n.send(t,e)})))];case 1:return i.sent(),[2]}}))}))},e.prototype.send=function(e,t){var r,n;return void 0===t&&(t=!0),a(this,void 0,void 0,(function(){var i,o,s,a,u,c,h,d,p,f,g,m,v;return l(this,(function(l){switch(l.label){case 0:if(!(i=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(o=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(y=E(),s=(null==y?void 0:y.location)?y.location.href:"",a=Ro,u=e.sampleRate,c=new URLSearchParams({device_id:o,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),h="".concat((null===(r=e.version)||void 0===r?void 0:r.type)||"standalone","/").concat((null===(n=e.version)||void 0===n?void 0:n.version)||a),0===(d=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];l.label=1;case 1:return l.trys.push([1,3,,4]),p={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(i),"X-Client-Version":a,"X-Client-Library":h,"X-Client-Url":s.substring(0,1e3),"X-Client-Sample-Rate":"".concat(u)},body:JSON.stringify(d),method:"POST"},f="".concat(po(e.serverZone,this.trackServerUrl),"?").concat(c.toString()),[4,fetch(f,p)];case 2:if(null===(g=l.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(g.status,e);else{m="";try{m=JSON.stringify(g.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(g.status,": ").concat(m)})}return[3,4];case 3:return v=l.sent(),this.completeRequest({context:e,err:v}),[3,4];case 4:return[2]}var y}))}))},e.prototype.handleReponse=function(e,t){switch((new me).buildStatus(e)){case C.Success:this.handleSuccessResponse(t);break;case C.Failed:this.handleOtherResponse(t);break;default:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){this.addToQueue(o(o({},e),{timeout:e.attempts*this.retryTimeout}))},e.prototype.completeRequest=function(e){var t=e.context,r=e.err,n=e.success;t.onComplete(),r?this.loggerProvider.warn(r):n&&this.loggerProvider.log(n)},e}();const To=(e,t)=>t.some((t=>e instanceof t));let _o,Mo;const No=new WeakMap,Lo=new WeakMap,Do=new WeakMap;let Fo={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return No.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return zo(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Uo(e){Fo=e(Fo)}function jo(e){return(Mo||(Mo=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Vo(this),t),zo(this.request)}:function(...t){return zo(e.apply(Vo(this),t))}}function Bo(e){return"function"==typeof e?jo(e):(e instanceof IDBTransaction&&function(e){if(No.has(e))return;const t=new Promise(((t,r)=>{const n=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),n()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)}));No.set(e,t)}(e),To(e,_o||(_o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Fo):e)}function zo(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,r)=>{const n=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(zo(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)}));return Do.set(t,e),t}(e);if(Lo.has(e))return Lo.get(e);const t=Bo(e);return t!==e&&(Lo.set(e,t),Do.set(t,e)),t}const Vo=e=>Do.get(e);function Wo(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=zo(s);return n&&s.addEventListener("upgradeneeded",(e=>{n(zo(s.result),e.oldVersion,e.newVersion,zo(s.transaction),e)})),r&&s.addEventListener("blocked",(e=>r(e.oldVersion,e.newVersion,e))),a.then((e=>{o&&e.addEventListener("close",(()=>o())),i&&e.addEventListener("versionchange",(e=>i(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a}const qo=["get","getKey","getAll","getAllKeys","count"],Ko=["put","add","delete","clear"],Go=new Map;function Zo(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Go.get(t))return Go.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=Ko.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!qo.includes(r))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let s=o.store;return n&&(s=s.index(t.shift())),(await Promise.all([s[r](...t),i&&o.done]))[0]};return Go.set(t,o),o}Uo((e=>({...e,get:(t,r,n)=>Zo(t,r)||e.get(t,r,n),has:(t,r)=>!!Zo(t,r)||e.has(t,r)})));const Yo=["continue","continuePrimaryKey","advance"],Jo={},$o=new WeakMap,Ho=new WeakMap,Xo={get(e,t){if(!Yo.includes(t))return e[t];let r=Jo[t];return r||(r=Jo[t]=function(...e){$o.set(this,Ho.get(this)[t](...e))}),r}};async function*Qo(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Xo);for(Ho.set(r,t),Do.set(r,Vo(t));t;)yield r,t=await($o.get(r)||t.continue()),$o.delete(r)}function es(e,t){return t===Symbol.asyncIterator&&To(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&To(e,[IDBIndex,IDBObjectStore])}Uo((e=>({...e,get:(t,r,n)=>es(t,r)?Qo:e.get(t,r,n),has:(t,r)=>es(t,r)||e.has(t,r)})));var ts,rs=function(){function e(e){var t,r,n,i=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=new Blob([t]).size;return new Blob(e).size+r>=i.maxPersistedEventsSize||!!(Date.now()-i.timeAtLastSplit>i.interval&&e.length)&&(i.interval=Math.min(i.maxInterval,i.interval+i.minInterval),i._timeAtLastSplit=Date.now(),!0)},this.loggerProvider=e.loggerProvider,this.minInterval=null!==(t=e.minInterval)&&void 0!==t?t:this.minInterval,this.maxInterval=null!==(r=e.maxInterval)&&void 0!==r?r:this.maxInterval,this.maxPersistedEventsSize=null!==(n=e.maxPersistedEventsSize)&&void 0!==n?n:this.maxPersistedEventsSize}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e}();!function(e){e.RECORDING="recording",e.SENT="sent"}(ts||(ts={}));var ns="sessionCurrentSequence",is="sequencesToSend",os=function(){var e=E();return new Promise((function(t,r){if(!e)return r(new Error("Global scope not found"));if(!e.indexedDB)return r(new Error("Session Replay: cannot find indexedDB"));try{var n=e.indexedDB.open("keyval-store");n.onupgradeneeded=function(){1===n.result.version&&(n.result.close(),n.transaction&&n.transaction.abort(),e.indexedDB.deleteDatabase("keyval-store"),t())},n.onsuccess=function(){t(n.result)},n.onerror=function(){r(n.error)}}catch(e){r(e)}}))},ss=function(e){return a(void 0,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return e.length>0?(t=e.splice(0,10),[4,Promise.all(t)]):[3,2];case 1:return r.sent(),[3,0];case 2:return[2]}}))}))},as=function(e){var t,r;return e.objectStoreNames.contains(ns)||(r=e.createObjectStore(ns,{keyPath:"sessionId"})),e.objectStoreNames.contains(is)||(t=e.createObjectStore(is,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},ls=function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,Wo(e,1,{upgrade:as})];case 1:return[2,t.sent()]}}))}))},us=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return a(r,void 0,void 0,(function(){var e,t,r,n,i,o;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=s.sent(),s.label=2;case 2:return t?(r=t.value,n=r.sessionId,i=r.events,e.push({events:i,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=s.sent(),[3,2];case 4:return[2,e];case 5:return o=s.sent(),this.loggerProvider.warn("".concat(Ao,": ").concat(o)),[3,6];case 6:return[2,void 0]}}))}))},r.storeCurrentSequence=function(e){return a(r,void 0,void 0,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.db.get(ns,e)];case 1:return(t=i.sent())?[4,this.db.put(is,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=i.sent(),[4,this.db.put(ns,{sessionId:e,events:[]})];case 3:return i.sent(),[2,o(o({},t),{sessionId:e,sequenceId:r})];case 4:return n=i.sent(),this.loggerProvider.warn("".concat(Ao,": ").concat(n)),[3,5];case 5:return[2,void 0]}}))}))},r.addEventToCurrentSequence=function(e,t){return a(r,void 0,void 0,(function(){var r,n,i,o,s,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,10,,11]),[4,(r=this.db.transaction(ns,"readwrite")).store.get(e)];case 1:return(n=l.sent())?[3,3]:[4,r.store.put({sessionId:e,events:[t]})];case 2:return l.sent(),[2];case 3:return i=void 0,this.shouldSplitEventsList(n.events,t)?(i=n.events,[4,r.store.put({sessionId:e,events:[t]})]):[3,5];case 4:return l.sent(),[3,7];case 5:return o=n.events.concat(t),[4,r.store.put({sessionId:e,events:o})];case 6:l.sent(),l.label=7;case 7:return[4,r.done];case 8:return l.sent(),i?[4,this.storeSendingEvents(e,i)]:[2,void 0];case 9:return(s=l.sent())?[2,{events:i,sessionId:e,sequenceId:s}]:[2,void 0];case 10:return a=l.sent(),this.loggerProvider.warn("".concat(Ao,": ").concat(a)),[3,11];case 11:return[2,void 0]}}))}))},r.storeSendingEvents=function(e,t){return a(r,void 0,void 0,(function(){var r;return l(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(is,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(Ao,": ").concat(r)),[3,3];case 3:return[2,void 0]}}))}))},r.cleanUpSessionEventsStore=function(e,t){return a(r,void 0,void 0,(function(){var e;return l(this,(function(r){switch(r.label){case 0:if(!t)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.db.delete(is,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(Ao,": ").concat(e)),[3,4];case 4:return[2]}}))}))},r.transitionFromKeyValStore=function(e){return a(r,void 0,void 0,(function(){var t,r,n,i,o,s,u,d,p=this;return l(this,(function(f){switch(f.label){case 0:return f.trys.push([0,6,,7]),[4,os()];case 1:if(!(t=f.sent()))return[2];r=function(e,t){return a(p,void 0,void 0,(function(){var r,n,i=this;return l(this,(function(o){switch(o.label){case 0:return r=t.sessionSequences,n=[],Object.keys(r).forEach((function(o){var s=parseInt(o,10),u=r[s];if(s===t.currentSequenceId){var d=u.events.map((function(t){return a(i,void 0,void 0,(function(){return l(this,(function(r){return[2,this.addEventToCurrentSequence(e,t)]}))}))}));n.push.apply(n,h([],c(d),!1))}else u.status!==ts.SENT&&n.push(i.storeSendingEvents(e,u.events))})),[4,ss(n)];case 1:return o.sent(),[2]}}))}))},n="".concat(v,"_").concat(this.apiKey.substring(0,10)),f.label=2;case 2:return f.trys.push([2,4,,5]),i=t.transaction("keyval").objectStore("keyval").getAll(n),o=new Promise((function(t){i.onsuccess=function(n){return a(p,void 0,void 0,(function(){var i,o,s,a=this;return l(this,(function(l){switch(l.label){case 0:return i=n&&n.target.result,(o=i&&i[0])?(s=[],Object.keys(o).forEach((function(t){var n=parseInt(t,10),i=o[n];if(e===n)s.push(r(n,i));else{var l=i.sessionSequences;Object.keys(l).forEach((function(e){var t=parseInt(e,10);l[t].status!==ts.SENT&&s.push(a.storeSendingEvents(n,l[t].events))}))}})),[4,ss(s)]):[3,2];case 1:l.sent(),l.label=2;case 2:return t(),[2]}}))}))}})),[4,o];case 3:return f.sent(),(s=E())&&s.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return u=f.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(u)),[3,5];case 5:return[3,7];case 6:return d=f.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(d,". For more information, visit: https://www.docs.developers.amplitude.com/session-replay/sdks/standalone/#indexeddb-best-practices")),[3,7];case 7:return[2]}}))}))},r.apiKey=t.apiKey,r.db=t.db,r}return r(t,e),t.new=function(e,r,n){return a(this,void 0,void 0,(function(){var i,s,a,u,c;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),i="replay"===e?"":"_".concat(e),s="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(i),[4,ls(s)];case 1:return a=l.sent(),[4,(u=new t(o(o({},r),{db:a}))).transitionFromKeyValStore(n)];case 2:return l.sent(),[2,u];case 3:return c=l.sent(),r.loggerProvider.warn("".concat(Ao,": ").concat(c)),[3,4];case 4:return[2]}}))}))},t.prototype.getCurrentSequenceEvents=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o,s,a;return l(this,(function(l){switch(l.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(i=l.sent())?[2,[i]]:[2,void 0];case 2:t=[],l.label=3;case 3:return l.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=u.apply(void 0,[l.sent()]),n=r.next(),l.label=5;case 5:if(n.done)return[3,7];i=n.value,t.push(i),l.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return o=l.sent(),s={error:o},[3,10];case 9:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 10:return[2,t]}}))}))},t}(rs),cs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return r(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=h([],c(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.getSequencesToSend=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,Object.entries(this.finalizedSequences).map((function(e){var t=c(e,2),r=t[0],n=t[1],i=n.sessionId,o=n.events;return{sequenceId:Number(r),sessionId:i,events:o}}))]}))}))},t.prototype.storeCurrentSequence=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]}))}))},t.prototype.addEventToCurrentSequence=function(e,t){return a(this,void 0,void 0,(function(){var r;return l(this,(function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(r=this.addSequence(e)),this.sequences[e].push(t),[2,r]}))}))},t.prototype.storeSendingEvents=function(e,t){return a(this,void 0,void 0,(function(){return l(this,(function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]}))}))},t.prototype.cleanUpSessionEventsStore=function(e,t){return a(this,void 0,void 0,(function(){return l(this,(function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]}))}))},t}(rs),hs=function(e){var t=e.config,r=e.sessionId,n=e.minInterval,i=e.maxInterval,s=e.type,u=e.payloadBatcher,c=e.storeType;return a(void 0,void 0,void 0,(function(){function e(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){return l(this,(function(t){return[2,h.flush(e)]}))}))}var h,d,p,f,g,m,v,y,b;return l(this,(function(w){switch(w.label){case 0:return h=new Po(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:u})),d=function(){return new cs({loggerProvider:t.loggerProvider,maxInterval:i,minInterval:n})},p=function(){return a(void 0,void 0,void 0,(function(){var e;return l(this,(function(o){switch(o.label){case 0:return[4,us.new(s,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:i,apiKey:t.apiKey},r)];case 1:return e=o.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:d()]}}))}))},"idb"!==c?[3,2]:[4,p()];case 1:return g=w.sent(),[3,3];case 2:g=d(),w.label=3;case 3:return f=g,m=function(e){var r=e.events,n=e.sessionId,i=e.deviceId,o=e.sequenceId;t.debugMode&&go().then((function(e){var r=e.totalStorageSize,n=e.percentOfQuota,i=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(r," KB, percentage of quota: ").concat(n,"%, usage details: ").concat(i))})).catch((function(){})),h.sendEventsList({events:r,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:i,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:s,onComplete:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(n,o)];case 1:return e.sent(),[2]}}))}))}})},v=function(e){var r=e.sessionId,n=e.deviceId;f.storeCurrentSequence(r).then((function(e){e&&m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})})).catch((function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)}))},y=function(e){var t=e.deviceId;return a(void 0,void 0,void 0,(function(){var e;return l(this,(function(r){switch(r.label){case 0:return[4,f.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach((function(e){m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})})),[2]}}))}))},b=function(e){var r=e.event,n=e.sessionId,i=e.deviceId;f.addEventToCurrentSequence(n,r.data).then((function(e){return e&&m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:i})})).catch((function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)}))},[2,{sendCurrentSequenceEvents:v,addEvent:b,sendStoredEvents:y,flush:e}]}}))}))},ds=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=new Map;e.forEach((function(e){r.set(e.name,e.manager)})),this.managers=r}return e.prototype.sendStoredEvents=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return t=[],this.managers.forEach((function(r){t.push(r.sendStoredEvents(e))})),[4,Promise.all(t)];case 1:return r.sent(),[2]}}))}))},e.prototype.addEvent=function(e){var t,r=e.sessionId,n=e.event,i=e.deviceId;null===(t=this.managers.get(n.type))||void 0===t||t.addEvent({sessionId:r,event:n,deviceId:i})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,r=e.deviceId;this.managers.forEach((function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:r})}))},e.prototype.flush=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return t=[],this.managers.forEach((function(r){t.push(r.flush(e))})),[4,Promise.all(t)];case 1:return r.sent(),[2]}}))}))},e}();const ps={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fs={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gs={};function ms(e){if(gs[e])return gs[e];const t=globalThis[e],r=t.prototype,n=e in ps?ps[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in fs?fs[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return gs[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?gs[e]=o:r}catch{return r}}const vs={};function ys(e,t,r){var n;const i=`${e}.${String(r)}`;if(vs[i])return vs[i].call(t);const o=ms(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(vs[i]=s,s.call(t)):t[r]}const bs={};function ws(e,t,r){const n=`${e}.${String(r)}`;if(bs[n])return bs[n].bind(t);const i=ms(e)[r];return"function"!=typeof i?t[r]:(bs[n]=i,i.bind(t))}const Ss={childNodes:function(e){return ys("Node",e,"childNodes")},parentNode:function(e){return ys("Node",e,"parentNode")},parentElement:function(e){return ys("Node",e,"parentElement")},textContent:function(e){return ys("Node",e,"textContent")},contains:function(e,t){return ws("Node",e,"contains")(t)},getRootNode:function(e){return ws("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ys("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ys("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ys("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ys("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ms("MutationObserver").constructor}};function Cs(){var e=E();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function Is(){var e=E();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var xs,ks,Es;function Os(e,t){if(Es=new Date,e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var r={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};xs=o(o({},r),t),ks=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(xs.root,r);var n=As(e,"all",(function(){return As(e,"two",(function(){return As(e,"one",(function(){return As(e,"none")}))}))}));if(n){var i=Us(js(n,e));return i.length>0&&(n=i[0]),Ps(n)}throw new Error("Selector was not found.")}function As(e,t,r){for(var n=null,i=[],o=e,s=0,a=function(){var e,a,l=(new Date).getTime()-Es.getTime();if(void 0!==xs.timeoutMs&&l>xs.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=Ls(function(e){var t=e.getAttribute("id");if(t&&xs.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||Ls.apply(void 0,h([],c(function(e){var t=Array.from(e.attributes).filter((function(e){return xs.attr(e.name,e.value)}));return t.map((function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}}))}(o)),!1))||Ls.apply(void 0,h([],c(function(e){var t=Array.from(e.classList).filter(xs.className);return t.map((function(e){return{name:"."+CSS.escape(e),penalty:1}}))}(o)),!1))||Ls(function(e){var t=e.tagName.toLowerCase();if(xs.tagName(t))return{name:t,penalty:2};return null}(o))||[{name:"*",penalty:3}],p=function(e){var t=e.parentNode;if(!t)return null;var r=t.firstChild;if(!r)return null;var n=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}(o);if("all"==t)p&&(d=d.concat(d.filter(Ns).map((function(e){return Ms(e,p)}))));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(Ns).map((function(e){return Ms(e,p)}))));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&Ns(f)&&(d=[Ms(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[Ms(d[0],p)]));try{for(var g=(e=void 0,u(d)),m=g.next();!m.done;m=g.next()){(f=m.value).level=s}}catch(t){e={error:t}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(e)throw e.error}}if(i.push(d),i.length>=xs.seedMinLength&&(n=Rs(i,r)))return"break";o=o.parentElement,s++};o;){if("break"===a())break}return n||(n=Rs(i,r)),!n&&r?r():n}function Rs(e,t){var r,n,i=Us(Fs(e));if(i.length>xs.threshold)return t?t():null;try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(_s(a))return a}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}function Ps(e){for(var t=e[0],r=t.name,n=1;n<e.length;n++){var i=e[n].level||0;r=t.level===i-1?"".concat(e[n].name," > ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function Ts(e){return e.map((function(e){return e.penalty})).reduce((function(e,t){return e+t}),0)}function _s(e){var t=Ps(e);switch(ks.querySelectorAll(t).length){case 0:throw new Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function Ms(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Ns(e){return"html"!==e.name&&!e.name.startsWith("#")}function Ls(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Ds);return r.length>0?r:null}function Ds(e){return null!=e}function Fs(e,t){var r,n,i,o,s,a;return void 0===t&&(t=[]),l(this,(function(l){switch(l.label){case 0:if(!(e.length>0))return[3,9];l.label=1;case 1:l.trys.push([1,6,7,8]),r=u(e[0]),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(i=n.value,[5,u(Fs(e.slice(1,e.length),t.concat(i)))]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=l.sent(),s={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:l.sent(),l.label=11;case 11:return[2]}}))}function Us(e){return h([],c(e),!1).sort((function(e,t){return Ts(e)-Ts(t)}))}function js(e,t,r){var n,i,o;return void 0===r&&(r={counter:0,visited:new Map}),l(this,(function(s){switch(s.label){case 0:if(!(e.length>2&&e.length>xs.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>xs.maxNumberOfTries?[2]:(r.counter+=1,(i=h([],c(e),!1)).splice(n,1),o=Ps(i),r.visited.has(o)?[2]:_s(i)&&function(e,t){return ks.querySelector(Ps(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,u(js(i,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}}))}var Bs=function(e){var t=e.version,r=e.events,n=[];return r.forEach((function(e){var t=JSON.parse(e);t.count=1,"click"===t.type&&n.push(t)})),{version:t,events:n}},zs=function(e){var t=e.version,r=e.events,n=[];r.forEach((function(e){var t=JSON.parse(e);"click"===t.type&&n.push(t)}));var i=n.reduce((function(e,t){var r=t.x,n=t.y,i=t.selector,s=t.timestamp,a=s-s%36e5,l="".concat(r,":").concat(n,":").concat(null!=i?i:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=o(o({},t),{timestamp:a,count:1}),e}),{});return{version:t,events:Object.values(i)}},Vs=function(e,t){var r=t.eventsManager,n=t.sessionId,i=t.deviceIdFn,o=t.mirror,s=t.ugcFilterRules;return function(t){if(t.type===wo.Click){var a=E();if(a){var l=a.location,u=a.innerHeight,c=a.innerWidth;if(l){var h=t.x,d=t.y;if(void 0!==h&&void 0!==d){var p,f=o.getNode(t.id);if(f)try{p=Os(f)}catch(t){e.debug("error resolving selector from finder")}var g=function(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null===(t=Ss.parentElement(o.body))||void 0===t?void 0:t.scrollLeft)||(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null===(n=Ss.parentElement(o.body))||void 0===n?void 0:n.scrollTop)||(null===(i=null==o?void 0:o.body)||void 0===i?void 0:i.scrollTop)||0}}(a),m={x:h+g.left,y:d+g.top,selector:p,viewportHeight:u,viewportWidth:c,pageUrl:fo(l.href,s),timestamp:Date.now(),type:"click"},v=i();v&&r.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(m)},deviceId:v})}}}}}},Ws=function(){function e(e,t){var r=E();r&&r.navigator&&"function"==typeof r.navigator.sendBeacon?this.sendBeacon=function(e,t){try{if(r.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(e,t){var r=new XMLHttpRequest;return r.open("POST",e,!0),r.setRequestHeader("Accept","*/*"),r.send(JSON.stringify(t)),!0},this.basePageUrl=po(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var r=this.context,n=r.sessionId,i=r.type,o=new URLSearchParams({device_id:e,session_id:String(n),type:String(i),api_key:this.apiKey}),s="".concat(this.basePageUrl,"?").concat(o.toString());this.sendBeacon(s,t)||this.sendXhr(s,t)},e}(),qs=function(){function e(e,t){var r=this;this.timestamp=Date.now(),this.hook=function(e){r.update(e)},this.send=function(e){return function(t){var n,i,o=e(),s=E();s&&o&&r.transport.send(o,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Cs(),viewportWidth:Is(),pageUrl:fo(s.location.href,null!==(i=null===(n=r.config.interactionConfig)||void 0===n?void 0:n.ugcFilterRules)&&void 0!==i?i:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._maxScrollWidth=Is(),this._maxScrollHeight=Cs(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new Ws(t,r),r)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(e.x>this._maxScrollX){var r=Is();this._maxScrollX=e.x;var n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){var i=Cs();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),Ks=function(e){var t=e.sessionId,r=e.deviceId;this.deviceId=r,this.sessionId=t,t&&r&&(this.sessionReplayId=function(e,t){return"".concat(t,"/").concat(e)}(t,r))},Gs=Uint8Array,Zs=Uint16Array,Ys=Uint32Array,Js=new Gs([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,0,0,0]),$s=new Gs([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,0,0]),Hs=new Gs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xs=function(e,t){for(var r=new Zs(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new Ys(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},Qs=Xs(Js,2),ea=Qs[0],ta=Qs[1];ea[28]=258,ta[258]=28;for(var ra=Xs($s,0)[1],na=new Zs(32768),ia=0;ia<32768;++ia){var oa=(43690&ia)>>>1|(21845&ia)<<1;oa=(61680&(oa=(52428&oa)>>>2|(13107&oa)<<2))>>>4|(3855&oa)<<4,na[ia]=((65280&oa)>>>8|(255&oa)<<8)>>>1}var sa=function(e,t,r){for(var n=e.length,i=0,o=new Zs(t);i<n;++i)++o[e[i]-1];var s,a=new Zs(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new Zs(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],h=a[e[i]-1]++<<c,d=h|(1<<c)-1;h<=d;++h)s[na[h]>>>l]=u}else for(s=new Zs(n),i=0;i<n;++i)s[i]=na[a[e[i]-1]++]>>>15-e[i];return s},aa=new Gs(288);for(ia=0;ia<144;++ia)aa[ia]=8;for(ia=144;ia<256;++ia)aa[ia]=9;for(ia=256;ia<280;++ia)aa[ia]=7;for(ia=280;ia<288;++ia)aa[ia]=8;var la=new Gs(32);for(ia=0;ia<32;++ia)la[ia]=5;var ua=sa(aa,9,0),ca=sa(la,5,0),ha=function(e){return(e/8|0)+(7&e&&1)},da=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Zs?Zs:e instanceof Ys?Ys:Gs)(r-t);return n.set(e.subarray(t,r)),n},pa=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},fa=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},ga=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,o=r.slice();if(!i)return[new Gs(0),0];if(1==i){var s=new Gs(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=r[r[u].f<r[h].f?u++:h++],l=r[u!=c&&r[u].f<r[h].f?u++:h++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=o[0].s;for(n=1;n<i;++n)o[n].s>d&&(d=o[n].s);var p=new Zs(d+1),f=ma(r[c-1],p,0);if(f>t){n=0;var g=0,m=f-t,v=1<<m;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<i;++n){var y=o[n].s;if(!(p[y]>t))break;g+=v-(1<<f-p[y]),p[y]=t}for(g>>>=m;g>0;){var b=o[n].s;p[b]<t?g-=1<<t-p[b]++-1:++n}for(;n>=0&&g;--n){var w=o[n].s;p[w]==t&&(--p[w],++g)}f=t}return[new Gs(p),f]},ma=function(e,t,r){return-1==e.s?Math.max(ma(e.l,t,r+1),ma(e.r,t,r+1)):t[e.s]=r},va=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Zs(++t),n=0,i=e[0],o=1,s=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[r.subarray(0,n),t]},ya=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ba=function(e,t,r){var n=r.length,i=ha(t+2);e[i]=255&n,e[i+1]=n>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<n;++o)e[i+o+4]=r[o];return 8*(i+4+n)},wa=function(e,t,r,n,i,o,s,a,l,u,c){pa(t,c++,r),++i[256];for(var h=ga(i,15),d=h[0],p=h[1],f=ga(o,15),g=f[0],m=f[1],v=va(d),y=v[0],b=v[1],w=va(g),S=w[0],C=w[1],I=new Zs(19),x=0;x<y.length;++x)I[31&y[x]]++;for(x=0;x<S.length;++x)I[31&S[x]]++;for(var k=ga(I,7),E=k[0],O=k[1],A=19;A>4&&!E[Hs[A-1]];--A);var R,P,T,_,M=u+5<<3,N=ya(i,aa)+ya(o,la)+s,L=ya(i,d)+ya(o,g)+s+14+3*A+ya(I,E)+(2*I[16]+3*I[17]+7*I[18]);if(M<=N&&M<=L)return ba(t,c,e.subarray(l,l+u));if(pa(t,c,1+(L<N)),c+=2,L<N){R=sa(d,p,0),P=d,T=sa(g,m,0),_=g;var D=sa(E,O,0);pa(t,c,b-257),pa(t,c+5,C-1),pa(t,c+10,A-4),c+=14;for(x=0;x<A;++x)pa(t,c+3*x,E[Hs[x]]);c+=3*A;for(var F=[y,S],U=0;U<2;++U){var j=F[U];for(x=0;x<j.length;++x){var B=31&j[x];pa(t,c,D[B]),c+=E[B],B>15&&(pa(t,c,j[x]>>>5&127),c+=j[x]>>>12)}}}else R=ua,P=aa,T=ca,_=la;for(x=0;x<a;++x)if(n[x]>255){B=n[x]>>>18&31;fa(t,c,R[B+257]),c+=P[B+257],B>7&&(pa(t,c,n[x]>>>23&31),c+=Js[B]);var z=31&n[x];fa(t,c,T[z]),c+=_[z],z>3&&(fa(t,c,n[x]>>>5&8191),c+=$s[z])}else fa(t,c,R[n[x]]),c+=P[n[x]];return fa(t,c,R[256]),c+P[256]},Sa=new Ys([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ca=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new Gs(n+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(n,a.length-i),u=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var h=c+65535;h<s?u=ba(l,u,e.subarray(c,h)):(l[c]=o,u=ba(l,u,e.subarray(c,s)))}else{for(var d=Sa[t-1],p=d>>>13,f=8191&d,g=(1<<r)-1,m=new Zs(32768),v=new Zs(g+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&g},S=new Ys(25e3),C=new Zs(288),I=new Zs(32),x=0,k=0,E=(c=0,0),O=0,A=0;c<s;++c){var R=w(c),P=32767&c,T=v[R];if(m[P]=T,v[R]=P,O<=c){var _=s-c;if((x>7e3||E>24576)&&_>423){u=wa(e,l,0,S,C,I,k,E,A,c-A,u),E=x=k=0,A=c;for(var M=0;M<286;++M)C[M]=0;for(M=0;M<30;++M)I[M]=0}var N=2,L=0,D=f,F=P-T&32767;if(_>2&&R==w(c-F))for(var U=Math.min(p,_)-1,j=Math.min(32767,c),B=Math.min(258,_);F<=j&&--D&&P!=T;){if(e[c+N]==e[c+N-F]){for(var z=0;z<B&&e[c+z]==e[c+z-F];++z);if(z>N){if(N=z,L=F,z>U)break;var V=Math.min(F,z-2),W=0;for(M=0;M<V;++M){var q=c-F+M+32768&32767,K=q-m[q]+32768&32767;K>W&&(W=K,T=q)}}}F+=(P=T)-(T=m[P])+32768&32767}if(L){S[E++]=268435456|ta[N]<<18|ra[L];var G=31&ta[N],Z=31&ra[L];k+=Js[G]+$s[Z],++C[257+G],++I[Z],O=c+N,++x}else S[E++]=e[c],++C[e[c]]}}u=wa(e,l,o,S,C,I,k,E,A,c-A,u)}return da(a,0,n+ha(u)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!i)};function Ia(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,o=r.length,s=0;s!=o;){for(var a=Math.min(s+5552,o);s<a;++s)i+=n+=r[s];n%=65521,i%=65521}e=n,t=i},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n,i,o,s=Ca(e,t,2,4);return n=s,i=t.level,o=0==i?0:i<6?1:9==i?3:2,n[0]=120,n[1]=o<<6|(o?32-2*o:1),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(s,s.length-4,r.d()),s}const xa=e=>{const t={...e,v:"v1"};return function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var i=e[n++];i<128||t?r+=String.fromCharCode(i):i<224?r+=String.fromCharCode((31&i)<<6|63&e[n++]):i<240?r+=String.fromCharCode((15&i)<<12|(63&e[n++])<<6|63&e[n++]):(i=((15&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}return r}(Ia(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Gs(e.length+(e.length>>>1)),i=0,o=function(e){n[i++]=e},s=0;s<r;++s){if(i+5>n.length){var a=new Gs(i+8+(r-s<<1));a.set(n),n=a}var l=e.charCodeAt(s);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return da(n,0,i)}(JSON.stringify(t))),!0)};var ka=function(){function e(e,t,r,n){var i,o,s,a=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=xa(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){a.eventsManager&&a.deviceId&&a.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:a.deviceId})},this.addCompressedEvent=function(e,t){if(a.worker)a.worker.postMessage({event:e,sessionId:t});else{var r=a.compressEvent(e);a.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=a.worker)||void 0===e||e.terminate()};var l=E();this.canUseIdleCallback=l&&"requestIdleCallback"in l,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(i=t.performanceConfig)||void 0===i?void 0:i.timeout)||2e3;var u=null!==(o={}.COMPRESSION_WEBWORKER_BODY)&&void 0!==o?o:n;if((null===(s=this.config.experimental)||void 0===s?void 0:s.useWebWorker)&&l&&l.Worker&&u){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var c=new Worker(URL.createObjectURL(new Blob([u],{type:"application/javascript"})));c.onerror=function(e){t.loggerProvider.error(e)},c.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;a.addCompressedEventToManager(r,n)},this.worker=c}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback((function(t){e.processQueue(t)}),{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var r;this.canUseIdleCallback&&(null===(r=this.config.performanceConfig)||void 0===r?void 0:r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var r=this.taskQueue.shift();if(r){var n=r.event,i=r.sessionId;this.addCompressedEvent(n,i)}}this.taskQueue.length>0?requestIdleCallback((function(e){t.processQueue(e)}),{timeout:this.timeout}):this.isProcessing=!1},e}(),Ea=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.pageLeaveFns=[],this.recordFunction=null,this.teardownEventListeners=function(t){var r=E();r&&(r.removeEventListener("blur",e.blurListener),r.removeEventListener("focus",e.focusListener),!t&&r.addEventListener("blur",e.blurListener),!t&&r.addEventListener("focus",e.focusListener),r.self&&"onpagehide"in r.self?(r.removeEventListener("pagehide",e.pageLeaveListener),!t&&r.addEventListener("pagehide",e.pageLeaveListener)):(r.removeEventListener("beforeunload",e.pageLeaveListener),!t&&r.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach((function(e){e(t)}))},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),a(e,void 0,void 0,(function(){var e,i,s,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=void 0,(i=this.config)&&t!==Mi.METADATA?(e={config:mo(i),version:Ro},n?[4,go()]:[3,2]):[3,2];case 1:s=l.sent(),e=o(o({},s),e),l.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,o(o({},r),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return a=l.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",a),[3,4];case 4:return[2]}}))}))},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop()}catch(t){var r=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new oo(new D)}return e.prototype.init=function(e,t){return T(this._init(e,t))},e.prototype._init=function(e,t){var r,n,i,o,s,u;return a(this,void 0,void 0,(function(){var a,d,p,f,g,m,v,y,b,w,S,C,I,x;return l(this,(function(l){switch(l.label){case 0:return this.loggerProvider=new oo(t.loggerProvider||new D),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new Ks({sessionId:t.sessionId,deviceId:t.deviceId}),a=this,[4,Oo(e,t)];case 1:return a.joinedConfigGenerator=l.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)];case 2:d=l.sent(),p=d.joinedConfig,f=d.localConfig,g=d.remoteConfig,this.config=p,this.setMetadata(t.sessionId,p,f,g,null===(r=t.version)||void 0===r?void 0:r.version,Ro,null===(n=t.version)||void 0===n?void 0:n.type),t.sessionId&&(null===(i=this.config.interactionConfig)||void 0===i?void 0:i.enabled)&&(m=qs.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[m.send(this.getDeviceId.bind(this)).bind(m)],this.scrollHook=m.hook.bind(m)),v=[],"idb"!==(y=this.config.storeType)||(null===(o=E())||void 0===o?void 0:o.indexedDB)||(y="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(y," for event storage.")),l.label=3;case 3:return l.trys.push([3,5,,6]),[4,hs({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:y})];case 4:return b=l.sent(),v.push({name:"replay",manager:b}),[3,6];case 5:return w=l.sent(),x=w,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(x.toString())),[3,6];case 6:if(!(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled))return[3,10];S=this.config.interactionConfig.batch?zs:Bs,l.label=7;case 7:return l.trys.push([7,9,,10]),[4,hs({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(u=this.config.interactionConfig.trackEveryNms)&&void 0!==u?u:3e4,maxInterval:6e4,payloadBatcher:S,storeType:y})];case 8:return C=l.sent(),v.push({name:"interaction",manager:C}),[3,10];case 9:return I=l.sent(),x=I,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(x.toString())),[3,10];case 10:return this.eventsManager=new(ds.bind.apply(ds,h([void 0],c(v),!1))),this.eventCompressor&&this.eventCompressor.terminate(),this.eventCompressor=new ka(this.eventsManager,this.config,this.getDeviceId()),[4,this.initializeNetworkObservers()];case 11:return l.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),this.initialize(!0),[2]}}))}))},e.prototype.setSessionId=function(e,t){return T(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t){return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(o){switch(o.label){case 0:return(r=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(r),n=t||this.getDeviceId(),this.identifiers=new Ks({sessionId:e,deviceId:n}),this.joinedConfigGenerator&&r?[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)]:[3,2];case 1:i=o.sent().joinedConfig,this.config=i,o.label=2;case 2:return this.recordEvents(),[2]}}))}))},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,r=this.identifiers;if(!t||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var n=this.getShouldRecord(),i={};return n&&((e={})[to]=r.sessionReplayId?r.sessionReplayId:null,i=e,t.debugMode&&(i[no]=JSON.stringify({appHash:ho(t.apiKey).toString()}))),this.addCustomRRWebEvent(Mi.GET_SR_PROPS,{shouldRecord:n,eventProperties:i},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,i},e.prototype.sendEvents=function(e){var t,r=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),n=this.getDeviceId();this.eventsManager&&r&&n&&this.eventsManager.sendCurrentSequenceEvents({sessionId:r,deviceId:n})},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){var r;return l(this,(function(n){return(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId)?(r=this.getDeviceId())?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()]):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])}))}))},e.prototype.shouldOptOut=function(){var e,t,r;(null===(e=this.config)||void 0===e?void 0:e.instanceName)&&(r=te(this.config.instanceName).identityStore.getIdentity().optOut);return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,r,n=(e=this.identifiers.sessionId,t=this.config.sampleRate,r=ho(e.toString()),31*Math.abs(r)%1e6/1e6<t);return n||this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate.")),n},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){var e,t,r,n;if("conservative"===(null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.defaultMaskLevel))return"*";var i=null===(n=null===(r=this.config)||void 0===r?void 0:r.privacyConfig)||void 0===n?void 0:n.maskSelector;return i||void 0},e.prototype.getRecordingPlugins=function(e){var t;return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(o){switch(o.label){case 0:if(r=[],!(null===(t=null==e?void 0:e.console)||void 0===t?void 0:t.enabled))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Promise.resolve().then((function(){return Vy}))];case 2:return n=o.sent().getRecordConsolePlugin,r.push(n({level:e.console.levels})),[3,4];case 3:return i=o.sent(),this.loggerProvider.warn("Failed to load console plugin:",i),[3,4];case 4:return[2,r.length>0?r:void 0]}}))}))},e.prototype.getRecordFunction=function(){return a(this,void 0,void 0,(function(){var e,t;return l(this,(function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.resolve().then((function(){return rR}))];case 2:return e=r.sent().record,this.recordFunction=e,[2,e];case 3:return t=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",t),[2,null];case 4:return[2]}}))}))},e.prototype.recordEvents=function(e){var t,r,n;return void 0===e&&(e=!0),a(this,void 0,void 0,(function(){var i,o,s,a,u,c,h,d,p,f,g,m,v,y=this;return l(this,(function(l){switch(l.label){case 0:return i=this.config,o=this.getShouldRecord(),s=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,o&&s&&i?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(a=l.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:l.sent(),null===(r=this.networkObservers)||void 0===r||r.start((function(e){y.addCustomRRWebEvent(Mi.FETCH_REQUEST,e)})),u=i.privacyConfig,c=i.interactionConfig,h=i.loggingConfig,d=(null==c?void 0:c.enabled)?{mouseInteraction:this.eventsManager&&Vs(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:s,deviceIdFn:this.getDeviceId.bind(this),mirror:a.mirror,ugcFilterRules:null!==(n=c.ugcFilterRules)&&void 0!==n?n:[]}),scroll:this.scrollHook}:{},p=(null==c?void 0:c.enabled)&&c.ugcFilterRules?c.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(s,".")),l.label=3;case 3:return l.trys.push([3,5,,6]),f=this,g=a,v={emit:function(e){if(y.shouldOptOut())return y.loggerProvider.log("Opting session ".concat(s," out of recording due to optOut config.")),y.stopRecordingEvents(),void y.sendEvents();e.type===bo.Meta&&(e.data.href=fo(e.data.href,p)),y.eventCompressor&&y.eventCompressor.enqueueEvent(e,s)},inlineStylesheet:i.shouldInlineStylesheet,hooks:d,maskAllInputs:!0,maskTextClass:io,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:i.applyBackgroundColorToBlockedElements,maskInputFn:co("input",u),maskTextFn:co("text",u),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return y.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(h)];case 4:return f.recordCancelCallback=g.apply(void 0,[(v.plugins=l.sent(),v)]),this.addCustomRRWebEvent(Mi.DEBUG_INFO),e&&this.addCustomRRWebEvent(Mi.METADATA,this.metadata),[3,6];case 5:return m=l.sent(),this.loggerProvider.warn("Failed to initialize session replay:",m),[3,6];case 6:return[2]}}))}))},e.prototype.getDeviceId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){return l(this,(function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]}))}))},e.prototype.shutdown=function(){this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(e,t,r,n,i,o,s){var a=(null==e?void 0:e.toString())?ho(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:r,remoteConfig:n,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(s),replaySDKVersion:i,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:o}},e.prototype.initializeNetworkObservers=function(){var e,t,r;return a(this,void 0,void 0,(function(){var n,i;return l(this,(function(o){switch(o.label){case 0:if(!(null===(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.loggingConfig)||void 0===t?void 0:t.network)||void 0===r?void 0:r.enabled)||this.networkObservers)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Promise.resolve().then((function(){return iR}))];case 2:return n=o.sent().NetworkObservers,this.networkObservers=new n,[3,4];case 3:return i=o.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",i),[3,4];case 4:return[2]}}))}))},e}(),Oa=function(e){return function(){var t=e.config||vo();return{logger:t.loggerProvider,logLevel:t.logLevel}}},Aa=function(){var e=new Ea;return{init:he(e.init.bind(e),"init",Oa(e)),setSessionId:he(e.setSessionId.bind(e),"setSessionId",Oa(e)),getSessionId:he(e.getSessionId.bind(e),"getSessionId",Oa(e)),getSessionReplayProperties:he(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",Oa(e)),flush:he(e.flush.bind(e),"flush",Oa(e)),shutdown:he(e.shutdown.bind(e),"shutdown",Oa(e))}}(),Ra=Aa.init,Pa=Aa.setSessionId,Ta=Aa.getSessionId,_a=Aa.getSessionReplayProperties,Ma=Aa.flush,Na=Aa.shutdown,La="1.19.0",Da=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.sessionReplay={flush:Ma,getSessionId:Ta,getSessionReplayProperties:_a,init:Ra,setSessionId:Pa,shutdown:Na},this.options=o({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(e,t){var r,n,i,s,u;return a(this,void 0,void 0,(function(){var t;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(La,".")),this.config=e,this.options.forceSessionTracking&&("boolean"==typeof e.defaultTracking?!1===e.defaultTracking&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=o(o({},e.defaultTracking),{sessions:!0})),this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!==(r=this.options.deviceId)&&void 0!==r?r:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl,trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(n=this.options.privacyConfig)||void 0===n?void 0:n.blockSelector,maskSelector:null===(i=this.options.privacyConfig)||void 0===i?void 0:i.maskSelector,unmaskSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.unmaskSelector,defaultMaskLevel:null===(u=this.options.privacyConfig)||void 0===u?void 0:u.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:La},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,experimental:this.options.experimental,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig},[4,this.sessionReplay.init(e.apiKey,this.srInitOptions).promise];case 1:return a.sent(),[3,3];case 2:return t=a.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(t.message)),[3,3];case 3:return[2]}}))}))},e.prototype.onSessionIdChanged=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.config.loggerProvider.debug("Analytics session id is changed to ".concat(e,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(e).promise];case 1:return t.sent(),[2]}}))}))},e.prototype.onOptOutChanged=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.config.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),e?(this.sessionReplay.shutdown(),[3,3]):[3,1];case 1:return[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},e.prototype.execute=function(e){var t;return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,8,,9]),this.options.customSessionId?(r=this.options.customSessionId(e))?r===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(r).promise]:[3,3]:[3,4];case 1:s.sent(),s.label=2;case 2:n=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),n),s.label=3;case 3:return[3,7];case 4:return(r=this.config.sessionId)&&r!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(r).promise]:[3,6];case 5:s.sent(),s.label=6;case 6:r&&r===e.session_id&&(n=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),n)),s.label=7;case 7:return[2,Promise.resolve(e)];case 8:return i=s.sent(),null===(t=this.config)||void 0===t||t.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(i.message)),[2,Promise.resolve(e)];case 9:return[2]}}))}))},e.prototype.teardown=function(){var e;return a(this,void 0,void 0,(function(){return l(this,(function(t){try{this.sessionReplay.shutdown(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]}))}))},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e}(),Fa=function(e,t){return Fa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},Fa(e,t)};function Ua(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Fa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var ja=function(){return ja=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ja.apply(this,arguments)};function Ba(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function za(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function Va(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wa(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function qa(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Ka="is",Ga="is not",Za="contains",Ya="does not contain",Ja="less",$a="less or equal",Ha="greater",Xa="greater or equal",Qa="version less",el="version less or equal",tl="version greater",rl="version greater or equal",nl="set is",il="set is not",ol="set contains",sl="set does not contain",al="set contains any",ll="set does not contain any",ul="regex match",cl="regex does not match",hl=-862048943,dl=461845907,pl=function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return Uint8Array.from(t)}(e),n=r.length,i=n>>2,o=t,s=0;s<i;s++){var a=vl(r,s<<2);o=fl(a,o)}var l=i<<2,u=0;switch(n-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,hl),u=ml(u,15),o^=u=Math.imul(u,dl);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,hl),u=ml(u,15),o^=u=Math.imul(u,dl);break;case 1:u^=r[l],u=Math.imul(u,hl),u=ml(u,15),o^=u=Math.imul(u,dl)}return gl(o^=n)>>>0},fl=function(e,t){var r=e,n=t;return r=Math.imul(r,hl),r=ml(r,15),r=Math.imul(r,dl),n=ml(n^=r,13),(n=Math.imul(n,5))+-430675100|0},gl=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},ml=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},vl=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return yl(r)},yl=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},bl=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=Va(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!s||!e||"object"!=typeof e)return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e||void 0}},wl="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),Sl=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(wl).exec(t);if(r){var n=Number(r[1]),i=Number(r[2]);if(!isNaN(n)&&!isNaN(i))return new e(n,i,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),Cl=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=Va(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},e.prototype.evaluateFlag=function(e,t){var r,n,i;try{for(var o=Va(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=ja(ja(ja({},t.metadata),a.metadata),i.metadata);i=ja(ja({},i),{metadata:l});break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.evaluateSegment=function(e,t,r){var n;return r.conditions?this.evaluateConditions(e,r.conditions)&&void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0:void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0},e.prototype.evaluateConditions=function(e,t){var r,n,i,o;try{for(var s=Va(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,Va(l)),h=c.next();!h.done;h=c.next()){var d=h.value;if(!(u=this.matchCondition(e,d)))break}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(e,t){var r=bl(e,t.selector);if(r){if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var i=this.coerceString(r);return void 0!==i&&this.matchString(i,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return pl(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(bl(e,t.bucket.selector));if(!s||0===s.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(s),l=this.getHash(a),u=l%100,c=Math.floor(l/100);try{for(var h=Va(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],g=p.range[1];if(u>=f&&u<g)try{for(var m=(i=void 0,Va(p.distributions)),v=m.next();!v.done;v=m.next()){var y=v.value,b=y.range[0],w=y.range[1];if(c>=b&&c<w)return y.variant}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case Ka:case Za:case Ja:case $a:case Ha:case Xa:case Qa:case el:case tl:case rl:case nl:case ol:case al:return r;case Ga:case Ya:case sl:case ll:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case nl:return this.setEquals(e,r);case il:return!this.setEquals(e,r);case ol:return this.matchesSetContainsAll(e,r);case sl:return!this.matchesSetContainsAll(e,r);case al:return this.matchesSetContainsAny(e,r);case ll:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Ka:return this.matchesIs(e,r);case Ga:return!this.matchesIs(e,r);case Za:return this.matchesContains(e,r);case Ya:return!this.matchesContains(e,r);case Ja:case $a:case Ha:case Xa:return this.matchesComparable(e,t,r,(function(e){return n.parseNumber(e)}),this.comparator);case Qa:case el:case tl:case rl:return this.matchesComparable(e,t,r,(function(e){return Sl.parse(e)}),this.versionComparator);case ul:return this.matchesRegex(e,r);case cl:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some((function(e){return e.toLowerCase()===r}))}return t.some((function(t){return e===t}))},e.prototype.matchesContains=function(e,t){var r,n;try{for(var i=Va(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.toLowerCase().includes(s.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,i){var o=this,s=n(e),a=r.map((function(e){return n(e)})).filter((function(e){return void 0!==e}));return void 0===s||0===a.length?r.some((function(r){return o.comparator(e,t,r)})):a.some((function(e){return i(s,t,e)}))},e.prototype.comparator=function(e,t,r){switch(t){case Ja:case Qa:return e<r;case $a:case el:return e<=r;case Ha:case tl:return e>r;case Xa:case rl:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Ja:case Qa:return n<0;case $a:case el:return n<=0;case Ha:case tl:return n>0;case Xa:case rl:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some((function(t){return Boolean(new RegExp(t).exec(e))}))},e.prototype.containsNone=function(e){return e.some((function(e){return"(none)"===e}))},e.prototype.containsBooleans=function(e){return e.some((function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}}))},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map((function(e){return t.coerceString(e)})).filter(Boolean);var r=String(e);try{var n=JSON.parse(r);return Array.isArray(n)?e.map((function(e){return t.coerceString(e)})).filter(Boolean):(i=this.coerceString(r))?[i]:void 0}catch(e){var i;return(i=this.coerceString(r))?[i]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case nl:case il:case ol:case sl:case al:case ll:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&qa([],Wa(n),!1).every((function(e){return r.has(e)}))},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var i=Va(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!this.matchesIs(s,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var i=Va(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(this.matchesIs(s,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e}(),Il=function(e,t,r){var n,i;void 0===r&&(r=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];r.push(o.key);var s=[],a=function(e){if(r.some((function(t){return t===e})))throw Error("Detected a cycle between flags ".concat(r));var n=Il(e,t,r);n&&s.push.apply(s,qa([],Wa(n),!1))};try{for(var l=Va(o.dependencies),u=l.next();!u.done;u=l.next()){a(u.value)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return s.push(o),r.pop(),delete t[o.key],s}};const xl="function"==typeof btoa,kl="function"==typeof Buffer,El=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),Ol=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Al=((e=>{let t={};e.forEach(((e,r)=>t[e]=r))})(Ol),String.fromCharCode.bind(String)),Rl=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),Pl=e=>{let t,r,n,i,o="";const s=e.length%3;for(let s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=Ol[t>>18&63]+Ol[t>>12&63]+Ol[t>>6&63]+Ol[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},Tl=xl?e=>btoa(e):kl?e=>Buffer.from(e,"binary").toString("base64"):Pl,_l=kl?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(Al.apply(null,e.subarray(r,r+4096)));return Tl(t.join(""))},Ml=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Al(192|t>>>6)+Al(128|63&t):Al(224|t>>>12&15)+Al(128|t>>>6&63)+Al(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Al(240|t>>>18&7)+Al(128|t>>>12&63)+Al(128|t>>>6&63)+Al(128|63&t)},Nl=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Ll=e=>e.replace(Nl,Ml),Dl=kl?e=>Buffer.from(e,"utf8").toString("base64"):El?e=>_l(El.encode(e)):e=>Tl(Ll(e)),Fl=(e,t=!1)=>t?Rl(Dl(e)):Dl(e),Ul=e=>Fl(e,!0),jl=Ul;var Bl=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return Ua(t,e),t}(Error),zl=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return Ua(t,e),t}(Error),Vl=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return Ba(this,void 0,void 0,(function(){var r,n,i,o;return za(this,(function(s){switch(s.label){case 0:return r=jl(JSON.stringify(e)),n={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(n["X-Amp-Exp-Flag-Keys"]=jl(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(n["X-Amp-Exp-Track"]=t.trackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:n,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=s.sent()).status)throw new Bl(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}}))}))},e}(),Wl=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return Ba(this,void 0,void 0,(function(){var t,r;return za(this,(function(n){switch(n.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=jl(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=n.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce((function(e,t){return e[t.key]=t,e}),{})]}}))}))},e}(),ql="undefined"!=typeof globalThis?globalThis:global||self,Kl=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},Gl=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=ql.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(ql.clearInterval(this.poller),this.poller=void 0)},e}(),Zl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Yl={};!function(e,t){!function(r,n){var i="function",o="undefined",s="object",a="string",l="model",u="name",c="type",h="vendor",d="version",p="architecture",f="console",g="mobile",m="tablet",v="smarttv",y="wearable",b="embedded",w="Amazon",S="Apple",C="ASUS",I="BlackBerry",x="Browser",k="Chrome",E="Firefox",O="Google",A="Huawei",R="LG",P="Microsoft",T="Motorola",_="Opera",M="Samsung",N="Sharp",L="Sony",D="Xiaomi",F="Zebra",U="Facebook",j=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},B=function(e,t){return typeof e===a&&-1!==z(t).indexOf(z(e))},z=function(e){return e.toLowerCase()},V=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},W=function(e,t){for(var r,o,a,l,u,c,h=0;h<t.length&&!u;){var d=t[h],p=t[h+1];for(r=o=0;r<d.length&&!u;)if(u=d[r++].exec(e))for(a=0;a<p.length;a++)c=u[++o],typeof(l=p[a])===s&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;h+=2}},q=function(e,t){for(var r in t)if(typeof t[r]===s&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(B(t[r][i],e))return"?"===r?n:r}else if(B(t[r],e))return"?"===r?n:r;return e},K={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},G={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,d],[/opios[\/ ]+([\w\.]+)/i],[d,[u,_+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[u,_]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[u,"UC"+x]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[d,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+x],d],[/\bfocus\/([\w\.]+)/i],[d,[u,E+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[u,_+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[u,_+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[u,"MIUI "+x]],[/fxios\/([-\w\.]+)/i],[d,[u,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+x]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+x],d],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,U],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[u,k+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,k+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[u,"Android "+x]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,d],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[d,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[d,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[d,q,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[u,E+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,d],[/(cobalt)\/([\w\.]+)/i],[u,[d,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,z]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",z]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[h,M],[c,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[h,M],[c,g]],[/((ipod|iphone)\d+,\d+)/i],[l,[h,S],[c,g]],[/(ipad\d+,\d+)/i],[l,[h,S],[c,m]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[h,S],[c,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[h,S],[c,m]],[/(macintosh);/i],[l,[h,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[h,A],[c,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[h,A],[c,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[h,D],[c,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[h,D],[c,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[h,"OPPO"],[c,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[h,"Vivo"],[c,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[h,"Realme"],[c,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[h,T],[c,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[h,T],[c,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[h,R],[c,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[h,R],[c,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[h,"Lenovo"],[c,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[h,"Nokia"],[c,g]],[/(pixel c)\b/i],[l,[h,O],[c,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[h,O],[c,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[h,L],[c,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[h,L],[c,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[h,"OnePlus"],[c,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[h,w],[c,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[h,w],[c,g]],[/(playbook);[-\w\),; ]+(rim)/i],[l,h,[c,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[h,I],[c,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[h,C],[c,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[h,C],[c,g]],[/(nexus 9)/i],[l,[h,"HTC"],[c,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[l,/_/g," "],[c,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[h,"Acer"],[c,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[h,"Meizu"],[c,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[h,N],[c,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,l,[c,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,l,[c,m]],[/(surface duo)/i],[l,[h,P],[c,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[h,"Fairphone"],[c,g]],[/(u304aa)/i],[l,[h,"AT&T"],[c,g]],[/\bsie-(\w*)/i],[l,[h,"Siemens"],[c,g]],[/\b(rct\w+) b/i],[l,[h,"RCA"],[c,m]],[/\b(venue[\d ]{2,7}) b/i],[l,[h,"Dell"],[c,m]],[/\b(q(?:mv|ta)\w+) b/i],[l,[h,"Verizon"],[c,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[h,"Barnes & Noble"],[c,m]],[/\b(tm\d{3}\w+) b/i],[l,[h,"NuVision"],[c,m]],[/\b(k88) b/i],[l,[h,"ZTE"],[c,m]],[/\b(nx\d{3}j) b/i],[l,[h,"ZTE"],[c,g]],[/\b(gen\d{3}) b.+49h/i],[l,[h,"Swiss"],[c,g]],[/\b(zur\d{3}) b/i],[l,[h,"Swiss"],[c,m]],[/\b((zeki)?tb.*\b) b/i],[l,[h,"Zeki"],[c,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],l,[c,m]],[/\b(ns-?\w{0,9}) b/i],[l,[h,"Insignia"],[c,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[h,"NextBook"],[c,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],l,[c,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],l,[c,g]],[/\b(ph-1) /i],[l,[h,"Essential"],[c,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[h,"Envizen"],[c,m]],[/\b(trio[-\w\. ]+) b/i],[l,[h,"MachSpeed"],[c,m]],[/\btu_(1491) b/i],[l,[h,"Rotor"],[c,m]],[/(shield[\w ]+) b/i],[l,[h,"Nvidia"],[c,m]],[/(sprint) (\w+)/i],[h,l,[c,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,P],[c,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[h,F],[c,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[h,F],[c,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,l,[c,f]],[/droid.+; (shield) bui/i],[l,[h,"Nvidia"],[c,f]],[/(playstation [345portablevi]+)/i],[l,[h,L],[c,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[h,P],[c,f]],[/smart-tv.+(samsung)/i],[h,[c,v]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,M],[c,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,R],[c,v]],[/(apple) ?tv/i],[h,[l,S+" TV"],[c,v]],[/crkey/i],[[l,k+"cast"],[h,O],[c,v]],[/droid.+aft(\w)( bui|\))/i],[l,[h,w],[c,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[h,N],[c,v]],[/(bravia[\w ]+)( bui|\))/i],[l,[h,L],[c,v]],[/(mitv-\w{5}) bui/i],[l,[h,D],[c,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,V],[l,V],[c,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,v]],[/((pebble))app/i],[h,l,[c,y]],[/droid.+; (glass) \d/i],[l,[h,O],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[h,F],[c,y]],[/(quest( 2)?)/i],[l,[h,U],[c,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[c,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,m]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,g]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[d,q,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[d,q,K]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[d,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,d],[/\(bb(10);/i],[d,[u,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[u,E+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[u,k+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,d],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,d]]},Z=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof Z))return new Z(e,t).getResult();var i=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),f=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(G,t):G;return this.getBrowser=function(){var e={};return e[u]=n,e[d]=n,W.call(e,i,f.browser),e.major=function(e){return typeof e===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e.version),e},this.getCPU=function(){var e={};return e[p]=n,W.call(e,i,f.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[l]=n,e[c]=n,W.call(e,i,f.device),e},this.getEngine=function(){var e={};return e[u]=n,e[d]=n,W.call(e,i,f.engine),e},this.getOS=function(){var e={};return e[u]=n,e[d]=n,W.call(e,i,f.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===a&&e.length>350?V(e,350):e,this},this.setUA(i),this};Z.VERSION="0.7.33",Z.BROWSER=j([u,d,"major"]),Z.CPU=j([p]),Z.DEVICE=j([l,h,c,f,g,v,m,y,b]),Z.ENGINE=Z.OS=j([u,d]),e.exports&&(t=e.exports=Z),t.UAParser=Z;var Y=typeof r!==o&&(r.jQuery||r.Zepto);if(Y&&!Y.ua){var J=new Z;Y.ua=J.getResult(),Y.ua.get=function(){return J.getUA()},Y.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var r in t)Y.ua[r]=t[r]}}}("object"==typeof window?window:Zl)}({get exports(){return Yl},set exports(e){Yl=e}},Yl);var Jl=function(){return Jl=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Jl.apply(this,arguments)};function $l(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function Hl(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function Xl(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ql(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function eu(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var tu=function(e,t){var r,n;void 0===t&&(t=!1);var i=ru(e,t),o=void 0,s=ql.document.cookie.split("; ");try{for(var a=Xl(s),l=a.next();!l.done;l=a.next()){var u=Ql(l.value.split("=",2),2),c=u[0],h=u[1];c===i&&(o=decodeURIComponent(h))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}if(o)try{if(t){var d=atob(o);return JSON.parse(decodeURIComponent(d))}var p=o.split("."),f=void 0;return p.length>=2&&p[1]&&(f=atob(p[1])),{deviceId:p[0],userId:f}}catch(e){return}},ru=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},nu=function(){function e(e,t,r){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return $l(this,void 0,void 0,(function(){return Hl(this,(function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener((function(){null==t||t.fetch()})),[2,this.waitForConnectorIdentity(this.timeoutMillis)]}))}))},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=tu(this.apiKey,!0);return(e||(e=tu(this.apiKey,!1))||(e=function(e){var t=ru(e,!0);try{var r=ql.localStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=ru(e,!0);try{var r=ql.sessionStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return $l(this,void 0,void 0,(function(){var t,r=this;return Hl(this,(function(n){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise((function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)})),new Promise((function(t,r){ql.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")}))])]}))}))},e}();var iu,ou,su=ql.fetch||function(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],s=[],a={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return s},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),s.push([t,r]),a[t]=a[t]?a[t]+","+r:r})),r(l())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)}))},au=function(){function e(e){this.client=e}return e.prototype.request=function(e){return $l(this,void 0,void 0,(function(){return Hl(this,(function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}}))}))},e}(),lu={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise((function(r,n){ql.setTimeout((function(){n(new zl("Request timeout after "+t+" milliseconds"))}),t),e.then(r,n)}))}($l(void 0,void 0,void 0,(function(){var i,o;return Hl(this,(function(s){switch(s.label){case 0:return[4,su(e,{method:t,headers:r,body:n})];case 1:return i=s.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=s.sent(),[2,o]}}))})),i)}};!function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(iu||(iu={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}(ou||(ou={}));var uu=function(e){return!e||e===ou.FallbackInline||e===ou.FallbackConfig||e===ou.SecondaryInitialVariants},cu={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:iu.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:lu},hu="1.15.5",du=function(){function e(e,t){var r,n=this;this.isReady=new Promise((function(e){n.resolve=e})),this.config=e,this.client=t;var i=null!==(r=e.instanceName)&&void 0!==r?r:cu.instanceName;this.queue=new fu(i),this.cache=new pu(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then((function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}),(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()})):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e){if(this.cache.shouldTrack(e)){var t=this.getExposureEvent(e);this.queue.push(t)}},e.prototype.getExposureEvent=function(e){var t,r,n,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:"web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),pu=function(){function e(e){this.isSessionStorageAvailable=gu(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&ql.sessionStorage.removeItem("EXP_sent_".concat(e))}return e.prototype.shouldTrack=function(e){var t;if("web"===(null===(t=e.metadata)||void 0===t?void 0:t.deliveryMethod))return!0;this.loadCache();var r=this.inMemoryCache[e.flag_key],n=!1;return r&&r.variant===e.variant||(n=!0,this.inMemoryCache[e.flag_key]=e),this.storeCache(),n},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=ql.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&ql.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),fu=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=function(){var e=Kl();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1}(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=ql.setInterval((function(){t.loadFlushStore()}),1e3),this.loadFlushStore()},e.prototype.flush=function(){var e,t;if(this.tracker&&0!==this.inMemoryQueue.length){try{for(var r=Xl(this.inMemoryQueue),n=r.next();!n.done;n=r.next()){var i=n.value;if(!this.tracker(i))return}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.inMemoryQueue=[],this.poller&&(ql.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=ql.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),ql.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),gu=function(){var e=Kl();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},mu=function(){function e(){this.globalScope=Kl()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),vu=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return Jl({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=Xl(Object.keys(e)),i=n.next();!i.done;i=n.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,r,n=this.storage.get(this.namespace);try{r=JSON.parse(n)||{}}catch(e){return}var i={};try{for(var o=Xl(Object.keys(r)),s=o.next();!s.done;s=o.next()){var a=s.value;try{var l=void 0;(l=this.transformer?this.transformer(r[a]):r[a])&&(i[a]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),yu=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,r=e.value,n=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var s={};return t?s.key=t:r&&(s.key=r),r&&(s.value=r),i&&(s.metadata=i),n&&(s.payload=n),o&&(s.expKey=o),s}},bu=function(){function e(){this.globalScope=Kl()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),wu=function(e){return null==e},Su=function(e){return!!wu(e)||e&&0===Object.keys(e).length},Cu=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},Iu=function(){function e(e,t,r,n){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=r,this.scalar=n}return e.prototype.start=function(e){return $l(this,void 0,void 0,(function(){return Hl(this,(function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}}))}))},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return $l(this,void 0,void 0,(function(){var n=this;return Hl(this,(function(i){return this.done||(this.timeoutHandle=ql.setTimeout((function(){return $l(n,void 0,void 0,(function(){var n,i;return Hl(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(n=t+1)<this.attempts&&(i=Math.min(r*this.scalar,this.max),this.backoff(e,n,i)),[3,3];case 3:return[2]}}))}))}),r)),[2]}))}))},e}(),xu=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},ku=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r},Eu=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),Ou=function(){function e(e){this.tracked={},this.exposureTrackingProvider=e}return e.prototype.track=function(e){var t=this.tracked[e.flag_key];t&&t.variant===e.variant||(this.tracked[e.flag_key]=e,this.exposureTrackingProvider.track(e))},e}(),Au=function(){function e(e,t){var r,n,i,o,s=this;this.engine=new Cl,this.isRunning=!1,this.apiKey=e,this.config=Jl(Jl(Jl({},cu),t),{serverUrl:(null==t?void 0:t.serverUrl)||("eu"===(null===(r=null==t?void 0:t.serverZone)||void 0===r?void 0:r.toLowerCase())?"https://api.lab.eu.amplitude.com":cu.serverUrl),flagsServerUrl:(null==t?void 0:t.flagsServerUrl)||("eu"===(null===(n=null==t?void 0:t.serverZone)||void 0===n?void 0:n.toLowerCase())?"https://flag.lab.eu.amplitude.com":cu.flagsServerUrl),flagConfigPollingIntervalMillis:t.flagConfigPollingIntervalMillis<6e4?6e4:null!==(i=t.flagConfigPollingIntervalMillis)&&void 0!==i?i:cu.flagConfigPollingIntervalMillis});var a=null===(o=this.config)||void 0===o?void 0:o.internalInstanceNameSuffix;if(this.isWebExperiment="web"===a,this.poller=new Gl((function(){return s.doFlags()}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var l in this.config.initialVariants)this.config.initialVariants[l]=yu(this.config.initialVariants[l]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new Eu(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.exposureTrackingProvider=new Ou(this.config.exposureTrackingProvider)),this.integrationManager=new du(this.config,this);var u,c=new au(this.config.httpClient||lu);this.flagApi=new Wl(this.apiKey,this.config.flagsServerUrl,c),this.evaluationApi=new Vl(this.apiKey,this.config.serverUrl,c);var h=a?"".concat(this.config.instanceName,"-").concat(a):this.config.instanceName;u=this.isWebExperiment?new bu:new mu,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new vu(i,r,yu)}(this.apiKey,h,u),this.flags=function(e,t,r){void 0===r&&(r=new mu);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new vu(i,r)}(this.apiKey,h,u);try{this.flags.load(),this.variants.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){var t;return $l(this,void 0,void 0,(function(){var r;return Hl(this,(function(n){switch(n.label){case 0:return this.isRunning?[2]:(this.isRunning=!0,this.setUser(e),r=this.doFlags(),null===(t=this.config.fetchOnStart)||void 0===t||t?[4,Promise.all([this.fetch(e),r])]:[3,2]);case 1:return n.sent(),[3,4];case 2:return[4,r];case 3:n.sent(),n.label=4;case 4:return this.config.pollOnStart&&this.poller.start(),[2]}}))}))},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(e,t){return void 0===e&&(e=this.user),$l(this,void 0,void 0,(function(){var r;return Hl(this,(function(n){switch(n.label){case 0:this.setUser(e||{}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),this.config.debug&&(r instanceof zl?console.debug(r):console.error(r)),[3,4];case 4:return[2,this]}}))}))},e.prototype.variant=function(e,t){var r,n;if(!this.apiKey)return{value:void 0};var i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.debug("[Experiment] variant for ".concat(e," is ").concat((null===(r=i.variant)||void 0===r?void 0:r.key)||(null===(n=i.variant)||void 0===n?void 0:n.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var r=this.flags.get(t);Cu(r)||delete e[t]}return Jl(Jl(Jl({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=Jl({},this.user.user_properties);return Jl(Jl({},this.user),{user_properties:t})}return Jl({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=Jl({},e.user_properties);this.user=Jl(Jl({},e),{user_properties:r})}else this.user=Jl({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach((function(t){e.flags.get(t.key)||e.flags.put(t.key,t)}))},e.prototype.evaluate=function(e){var t,r,n=this.addContext(this.user),i=function(e,t){var r,n,i=ja({},e),o=[],s=t||Object.keys(i);try{for(var a=Va(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=Il(u,i);c&&o.push.apply(o,qa([],Wa(c),!1))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}(this.flags.getAll(),e),o=function(e){var t,r,n,i;if(!e)return{};var o={user:e},s=Kl();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=Xl(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,h=e.groups[c];if(h.length>0&&h[0]){var d=h[0],p={group_name:d},f=null===(i=null===(n=e.group_properties)||void 0===n?void 0:n[c])||void 0===i?void 0:i[d];f&&Object.keys(f).length>0&&(p.group_properties=f),a[c]=p}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return Object.keys(a).length>0&&(o.groups=a),delete o.user.groups,delete o.user.group_properties,o}(n),s=this.engine.evaluate(o,i),a={};try{for(var l=Xl(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=ku(s[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return a},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===iu.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===iu.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(Cu(n)||!r.variant&&n)&&(r=this.localEvaluationVariantAndSource(e,n,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var n,i={},o=this.evaluate([t.key])[e],s=ou.LocalEvaluation,a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!wu(o)&&!a)return{variant:xu(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:xu(o),source:s,hasDefaultVariant:!0}),!wu(r))return{variant:xu(r),source:ou.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!wu(l))return{variant:xu(l),source:ou.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=xu(this.config.fallbackVariant),c={variant:u,source:ou.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return Su(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var r,n={},i=this.variants.get(e),o=null===(r=null==i?void 0:i.metadata)||void 0===r?void 0:r.default;if(!wu(i)&&!o)return{variant:xu(i),source:ou.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:xu(i),source:ou.LocalStorage,hasDefaultVariant:!0}),!wu(t))return{variant:xu(t),source:ou.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!wu(s))return{variant:xu(s),source:ou.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var a=xu(this.config.fallbackVariant),l={variant:a,source:ou.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Su(a)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!wu(i))return{variant:xu(i),source:ou.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!wu(o)&&!s)return{variant:xu(o),source:ou.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:xu(o),source:ou.LocalStorage,hasDefaultVariant:!0}),!wu(t))return{variant:xu(t),source:ou.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=xu(this.config.fallbackVariant),l={variant:a,source:ou.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Su(a)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return $l(this,void 0,void 0,(function(){var i,o;return Hl(this,(function(s){switch(s.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,this.doFetch(e,t,n)];case 2:return i=s.sent(),[4,this.storeVariants(i,n)];case 3:return s.sent(),[2,i];case 4:throw o=s.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}}))}))},e.prototype.cleanUserPropsForFetch=function(e){var t=Jl({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return $l(this,void 0,void 0,(function(){var n,i,o,s,a,l,u;return Hl(this,(function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Jl({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=Xl(Object.keys(n)),s=o.next();!s.done;s=o.next())a=s.value,i[a]=ku(n[a])}catch(e){l={error:e}}finally{try{s&&!s.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.debug("[Experiment] Received variants: ",i),[2,i]}}))}))},e.prototype.doFlags=function(){return $l(this,void 0,void 0,(function(){var e,t,r;return Hl(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=n.sent(),n.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:hu,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=n.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((r=n.sent())instanceof zl))throw r;return this.config.debug&&console.debug(r),[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}}))}))},e.prototype.storeVariants=function(e,t){return $l(this,void 0,void 0,(function(){var r,n,i,o;return Hl(this,(function(s){for(o in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),n=function(t){r=r.filter((function(e){return e!==t})),i.variants.put(t,e[t])},i=this,e)n(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.debug("[Experiment] Stored variants: ",e),[2]}))}))},e.prototype.startRetries=function(e,t){return $l(this,void 0,void 0,(function(){var r=this;return Hl(this,(function(n){return this.debug("[Experiment] Retry fetch"),this.retriesBackoff=new Iu(8,500,1e4,1.5),this.retriesBackoff.start((function(){return $l(r,void 0,void 0,(function(){return Hl(this,(function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}}))}))})),[2]}))}))},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),n=this.integrationManager.getUser(),i=Jl(Jl(Jl({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return Jl(Jl(Jl(Jl({library:"experiment-js-client/".concat(hu)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return $l(this,void 0,void 0,(function(){return Hl(this,(function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}}))}))},e.prototype.sourceVariants=function(){return this.config.source==iu.LocalStorage?this.variants.getAll():this.config.source==iu.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==iu.LocalStorage?this.config.initialVariants:this.config.source==iu.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var r,n,i,o,s,a,l,u,c;if(null===(i=null===(n=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var h={flag_key:e},d=uu(t.source);if(!d||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(h.experiment_key=null===(s=t.variant)||void 0===s?void 0:s.expKey);var p=null===(a=t.variant)||void 0===a?void 0:a.metadata;d||(null==p?void 0:p.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?h.variant=t.variant.key:(null===(u=t.variant)||void 0===u?void 0:u.value)&&(h.variant=t.variant.value)),p&&(h.metadata=p),null===(c=this.exposureTrackingProvider)||void 0===c||c.track(h),this.integrationManager.track(h)}}},e.prototype.legacyExposureInternal=function(e,t,r){var n,i,o,s,a;if(this.analyticsProvider){var l=function(e,t,r,n){var i,o=null==r?void 0:r.value,s="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:r,userProperty:s,properties:{key:t,variant:o,source:n},userProperties:(i={},i[s]=o,i)}}(this.addContext(this.getUser()),e,t,r);uu(r)||!(null==t?void 0:t.value)?null===(i=null===(n=this.analyticsProvider)||void 0===n?void 0:n.unsetUserProperty)||void 0===i||i.call(n,l):(null==t?void 0:t.value)&&(null===(s=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===s||s.call(o,l),null===(a=this.analyticsProvider)||void 0===a||a.track(l))}},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.config.debug&&console.debug.apply(console,eu([e],Ql(t),!1))},e.prototype.shouldRetryFetch=function(e){return!(e instanceof Bl)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),Ru=function(){function e(e,t){var r,n,i;this.globalScope=Kl(),this.userAgent=void 0!==(null===(r=this.globalScope)||void 0===r?void 0:r.navigator)?null===(n=this.globalScope)||void 0===n?void 0:n.navigator.userAgent:void 0,this.ua=new Yl.UAParser(this.userAgent).getResult(),this.localStorage=new mu,this.sessionStorage=new bu,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,n,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return Jl({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(i=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,n,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===n?void 0:n.cookie)||void 0===i?void 0:i.split("; ").map((function(e){return e.split("=")})))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,r;if(this.globalScope){var n={};try{var i=new URL(this.globalScope.location.href);try{for(var o=Xl(i.searchParams),s=o.next();!s.done;s=o.next()){var a=Ql(s.value,2),l=a[0],u=a[1];n[l]=eu(eu([],Ql(null!==(r=n[l])&&void 0!==r?r:[]),!1),Ql(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(n).reduce((function(e,t){var r=Ql(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e}),{})}},e}();ql.experimentInstances={};var Pu,Tu=ql.experimentInstances,_u=function(e){return(null==e?void 0:e.instanceName)||cu.instanceName},Mu=function(e,t,r){var n=function(e,t){var r=_u(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=Tu[n];return i||(i=function(e,t){return new Au(e,Jl(Jl({},t),{userProvider:new Ru(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),Tu[n]=i,i)},Nu=function(){function e(t){this.name=e.pluginName,this.config=t}return e.prototype.setup=function(e,t){var r;return a(this,void 0,void 0,(function(){return l(this,(function(t){return this.experiment=function(e,t){return Mu(e,t,(function(){return new nu(e,ee.getInstance(_u(t)),1e4)}))}((null===(r=this.config)||void 0===r?void 0:r.deploymentKey)||e.apiKey,this.config),[2]}))}))},e.pluginName="@amplitude/experiment-analytics-plugin",e}(),Lu=function(e){return new Nu(e)},Du=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"experiment",{get:function(){if(void 0!==this.config){var e=this.plugins(Nu);return 0===e.length?void this.config.loggerProvider.debug("".concat(Nu.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat(Nu.pluginName," are found."))}},enumerable:!1,configurable:!0}),t.prototype.initAll=function(t,r){return a(this,void 0,void 0,(function(){var n,i;return l(this,(function(s){switch(s.label){case 0:return n={serverZone:null==r?void 0:r.serverZone,instanceName:null==r?void 0:r.instanceName},e.prototype.add.call(this,{type:"enrichment",name:"@amplitude/unified-library-plugin",execute:function(e){var t;return a(this,void 0,void 0,(function(){return l(this,(function(r){return e.library="".concat("amplitude-ts-unified","/").concat("1.0.0-beta.2","-").concat(null!==(t=e.library)&&void 0!==t?t:""),[2,e]}))}))}}),[4,e.prototype.init.call(this,t,o(o({},null==r?void 0:r.analytics),n)).promise];case 1:return s.sent(),[4,e.prototype.add.call(this,(u=o(o({},null==r?void 0:r.sessionReplay),n),new Da(u))).promise];case 2:return s.sent(),[4,e.prototype.add.call(this,Lu(o(o({},null==r?void 0:r.experiment),n))).promise];case 3:return s.sent(),void 0===(i=this.plugin(Da.pluginName))?this.config.loggerProvider.debug("".concat(Da.pluginName," plugin is not found.")):this.sessionReplay=i.sessionReplay,[2]}var u}))}))},t.prototype.init=function(t,r,n){return void 0===t&&(t=""),e.prototype.init.call(this,t,r,n)},t}(Xi),Fu=function(){var e=new Du;return{experiment:e.experiment,sessionReplay:e.sessionReplay,initAll:he(e.initAll.bind(e),"initAll",le(e),ce(e,["config"])),init:he(e.init.bind(e),"init",le(e),ce(e,["config"])),add:he(e.add.bind(e),"add",le(e),ce(e,["config.apiKey","timeline.plugins"])),remove:he(e.remove.bind(e),"remove",le(e),ce(e,["config.apiKey","timeline.plugins"])),track:he(e.track.bind(e),"track",le(e),ce(e,["config.apiKey","timeline.queue.length"])),logEvent:he(e.logEvent.bind(e),"logEvent",le(e),ce(e,["config.apiKey","timeline.queue.length"])),identify:he(e.identify.bind(e),"identify",le(e),ce(e,["config.apiKey","timeline.queue.length"])),groupIdentify:he(e.groupIdentify.bind(e),"groupIdentify",le(e),ce(e,["config.apiKey","timeline.queue.length"])),setGroup:he(e.setGroup.bind(e),"setGroup",le(e),ce(e,["config.apiKey","timeline.queue.length"])),revenue:he(e.revenue.bind(e),"revenue",le(e),ce(e,["config.apiKey","timeline.queue.length"])),flush:he(e.flush.bind(e),"flush",le(e),ce(e,["config.apiKey","timeline.queue.length"])),getUserId:he(e.getUserId.bind(e),"getUserId",le(e),ce(e,["config","config.userId"])),setUserId:he(e.setUserId.bind(e),"setUserId",le(e),ce(e,["config","config.userId"])),getDeviceId:he(e.getDeviceId.bind(e),"getDeviceId",le(e),ce(e,["config","config.deviceId"])),setDeviceId:he(e.setDeviceId.bind(e),"setDeviceId",le(e),ce(e,["config","config.deviceId"])),reset:he(e.reset.bind(e),"reset",le(e),ce(e,["config","config.userId","config.deviceId"])),getSessionId:he(e.getSessionId.bind(e),"getSessionId",le(e),ce(e,["config"])),setSessionId:he(e.setSessionId.bind(e),"setSessionId",le(e),ce(e,["config"])),extendSession:he(e.extendSession.bind(e),"extendSession",le(e),ce(e,["config"])),setOptOut:he(e.setOptOut.bind(e),"setOptOut",le(e),ce(e,["config"])),setTransport:he(e.setTransport.bind(e),"setTransport",le(e),ce(e,["config"]))}},Uu=Fu(),ju=Uu.initAll,Bu=Uu.experiment,zu=Uu.sessionReplay,Vu=Uu.add,Wu=Uu.extendSession,qu=Uu.flush,Ku=Uu.getDeviceId,Gu=Uu.getSessionId,Zu=Uu.getUserId,Yu=Uu.groupIdentify,Ju=Uu.identify,$u=Uu.logEvent,Hu=Uu.remove,Xu=Uu.reset,Qu=Uu.revenue,ec=Uu.setDeviceId,tc=Uu.setGroup,rc=Uu.setOptOut,nc=Uu.setSessionId,ic=Uu.setTransport,oc=Uu.setUserId,sc=Uu.track,ac=Object.defineProperty,lc=(e,t,r)=>((e,t,r)=>t in e?ac(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),uc=Object.defineProperty,cc=(e,t,r)=>((e,t,r)=>t in e?uc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),hc=Object.defineProperty,dc=(e,t,r)=>((e,t,r)=>t in e?hc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const pc={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fc={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gc={};function mc(e){if(gc[e])return gc[e];const t=globalThis[e],r=t.prototype,n=e in pc?pc[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in fc?fc[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return gc[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?gc[e]=o:r}catch{return r}}const vc={};function yc(e,t,r){var n;const i=`${e}.${String(r)}`;if(vc[i])return vc[i].call(t);const o=mc(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(vc[i]=s,s.call(t)):t[r]}const bc={};function wc(e,t,r){const n=`${e}.${String(r)}`;if(bc[n])return bc[n].bind(t);const i=mc(e)[r];return"function"!=typeof i?t[r]:(bc[n]=i,i.bind(t))}const Sc={childNodes:function(e){return yc("Node",e,"childNodes")},parentNode:function(e){return yc("Node",e,"parentNode")},parentElement:function(e){return yc("Node",e,"parentElement")},textContent:function(e){return yc("Node",e,"textContent")},contains:function(e,t){return wc("Node",e,"contains")(t)},getRootNode:function(e){return wc("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?yc("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?yc("Element",e,"shadowRoot"):null},querySelector:function(e,t){return yc("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return yc("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return mc("MutationObserver").constructor}};class Cc{constructor(){dc(this,"idNodeMap",new Map),dc(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ic(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Ic(Sc.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Ic(Sc.parentNode(e),t,r)}function xc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function kc(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var Ec={exports:{}},Oc=String,Ac=function(){return{isColorSupported:!1,reset:Oc,bold:Oc,dim:Oc,italic:Oc,underline:Oc,inverse:Oc,hidden:Oc,strikethrough:Oc,black:Oc,red:Oc,green:Oc,yellow:Oc,blue:Oc,magenta:Oc,cyan:Oc,white:Oc,gray:Oc,bgBlack:Oc,bgRed:Oc,bgGreen:Oc,bgYellow:Oc,bgBlue:Oc,bgMagenta:Oc,bgCyan:Oc,bgWhite:Oc}};Ec.exports=Ac(),Ec.exports.createColors=Ac;var Rc=Ec.exports;const Pc=kc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Tc=Rc,_c=Pc,Mc=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Tc.isColorSupported),_c&&e&&(t=_c(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Tc.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Nc=Mc;Mc.default=Mc;var Lc={};Lc.isClean=Symbol("isClean"),Lc.my=Symbol("my");const Dc={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Fc=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="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");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Dc[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=Dc[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(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)}};var Uc=Fc;Fc.default=Fc;let jc=Uc;function Bc(e,t){new jc(t).stringify(e)}var zc=Bc;Bc.default=Bc;let{isClean:Vc,my:Wc}=Lc,qc=Nc,Kc=Uc,Gc=zc;function Zc(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>Zc(e,r))):("object"===o&&null!==i&&(i=Zc(i)),r[n]=i)}return r}let Yc=class{constructor(e={}){this.raws={},this[Vc]=!1,this[Wc]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Zc(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new qc(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Vc]){this[Vc]=!1;let e=this;for(;e=e.parent;)e[Vc]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Kc).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Gc){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var Jc=Yc;Yc.default=Yc;let $c=Jc,Hc=class extends $c{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Xc=Hc;Hc.default=Hc;var Qc={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:eh,SourceMapGenerator:th}=Pc,{existsSync:rh,readFileSync:nh}=Pc,{dirname:ih,join:oh}=Pc;let sh=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ih(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new eh(this.text)),this.consumerCache}decodeInline(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;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=ih(e),rh(e))return this.mapFile=e,nh(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof eh)return th.fromSourceMap(t).toString();if(t instanceof th)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=oh(ih(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var ah=sh;sh.default=sh;let{SourceMapConsumer:lh,SourceMapGenerator:uh}=Pc,{fileURLToPath:ch,pathToFileURL:hh}=Pc,{isAbsolute:dh,resolve:ph}=Pc,{nanoid:fh}=Qc,gh=Pc,mh=Nc,vh=ah,yh=Symbol("fromOffsetCache"),bh=Boolean(lh&&uh),wh=Boolean(ph&&dh),Sh=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!wh||/^\w+:\/\//.test(t.from)||dh(t.from)?this.file=t.from:this.file=ph(t.from)),wh&&bh){let e=new vh(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+fh(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new mh(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new mh(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(hh&&(i.input.url=hh(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[yh])r=this[yh];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[yh]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ph(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=dh(a.source)?hh(a.source):new URL(a.source,this.map.consumer().sourceRoot||hh(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!ch)throw new Error("file: protocol is not available in this PostCSS build");l.file=ch(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Ch=Sh;Sh.default=Sh,gh&&gh.registerInput&&gh.registerInput(Sh);let{SourceMapConsumer:Ih,SourceMapGenerator:xh}=Pc,{dirname:kh,relative:Eh,resolve:Oh,sep:Ah}=Pc,{pathToFileURL:Rh}=Pc,Ph=Ch,Th=Boolean(Ih&&xh),_h=Boolean(kh&&Oh&&Eh&&Ah);var Mh=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;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";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||kh(e.file);!1===this.mapOpts.sourcesContent?(t=new Ih(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),_h&&Th&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=xh.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new xh({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>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new xh({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?kh(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=kh(Oh(r,this.mapOpts.annotation)));let n=Eh(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new Ph(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(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))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Rh){let t=Rh(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Ah&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Nh=Jc,Lh=class extends Nh{constructor(e){super(e),this.type="comment"}};var Dh=Lh;Lh.default=Lh;let Fh,Uh,jh,Bh,{isClean:zh,my:Vh}=Lc,Wh=Xc,qh=Dh,Kh=Jc;function Gh(e){return e.map((e=>(e.nodes&&(e.nodes=Gh(e.nodes)),delete e.source,e)))}function Zh(e){if(e[zh]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Zh(t)}let Yh=class e extends Kh{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Gh(Fh(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Wh(t)]}else if(t.selector)t=[new Uh(t)];else if(t.name)t=[new jh(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new qh(t)]}return t.map((t=>(t[Vh]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[zh]&&Zh(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Yh.registerParse=e=>{Fh=e},Yh.registerRule=e=>{Uh=e},Yh.registerAtRule=e=>{jh=e},Yh.registerRoot=e=>{Bh=e};var Jh=Yh;Yh.default=Yh,Yh.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,jh.prototype):"rule"===e.type?Object.setPrototypeOf(e,Uh.prototype):"decl"===e.type?Object.setPrototypeOf(e,Wh.prototype):"comment"===e.type?Object.setPrototypeOf(e,qh.prototype):"root"===e.type&&Object.setPrototypeOf(e,Bh.prototype),e[Vh]=!0,e.nodes&&e.nodes.forEach((e=>{Yh.rebuild(e)}))};let $h,Hh,Xh=Jh,Qh=class extends Xh{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new $h(new Hh,this,e).stringify()}};Qh.registerLazyResult=e=>{$h=e},Qh.registerProcessor=e=>{Hh=e};var ed=Qh;Qh.default=Qh;let td={};var rd=function(e){td[e]||(td[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let nd=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){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}};var id=nd;nd.default=nd;let od=id,sd=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new od(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var ad=sd;sd.default=sd;const ld="'".charCodeAt(0),ud='"'.charCodeAt(0),cd="\\".charCodeAt(0),hd="/".charCodeAt(0),dd="\n".charCodeAt(0),pd=" ".charCodeAt(0),fd="\f".charCodeAt(0),gd="\t".charCodeAt(0),md="\r".charCodeAt(0),vd="[".charCodeAt(0),yd="]".charCodeAt(0),bd="(".charCodeAt(0),wd=")".charCodeAt(0),Sd="{".charCodeAt(0),Cd="}".charCodeAt(0),Id=";".charCodeAt(0),xd="*".charCodeAt(0),kd=":".charCodeAt(0),Ed="@".charCodeAt(0),Od=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ad=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Rd=/.[\r\n"'(/\\]/,Pd=/[\da-f]/i;let Td=Jh,_d=class extends Td{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Md=_d;_d.default=_d,Td.registerAtRule(_d);let Nd,Ld,Dd=Jh,Fd=class extends Dd{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Nd(new Ld,this,e).stringify()}};Fd.registerLazyResult=e=>{Nd=e},Fd.registerProcessor=e=>{Ld=e};var Ud=Fd;Fd.default=Fd,Dd.registerRoot(Fd);let jd={comma:e=>jd.split(e,[","],!0),space:e=>jd.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var Bd=jd;jd.default=jd;let zd=Jh,Vd=Bd,Wd=class extends zd{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Vd.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var qd=Wd;Wd.default=Wd,zd.registerRule(Wd);let Kd=Xc,Gd=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case dd:case pd:case gd:case md:case fd:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===pd||r===dd||r===gd||r===md||r===fd);h=["space",d.slice(g,n)],g=n-1;break;case vd:case yd:case Sd:case Cd:case kd:case Id:case wd:{let e=String.fromCharCode(r);h=[e,e,g];break}case bd:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==ld&&c!==ud&&c!==pd&&c!==dd&&c!==gd&&c!==fd&&c!==md){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===cd;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||Rd.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case ld:case ud:i=r===ld?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===cd;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Ed:Od.lastIndex=g+1,Od.test(d),n=0===Od.lastIndex?d.length-1:Od.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case cd:for(n=g,s=!0;d.charCodeAt(n+1)===cd;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==hd&&r!==pd&&r!==dd&&r!==gd&&r!==md&&r!==fd&&(n+=1,Pd.test(d.charAt(n)))){for(;Pd.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===pd&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===hd&&d.charCodeAt(g+1)===xd?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(Ad.lastIndex=g+1,Ad.test(d),n=0===Ad.lastIndex?d.length-1:Ad.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},Zd=Dh,Yd=Md,Jd=Ud,$d=qd;const Hd={empty:!0,space:!0};var Xd=class{constructor(e){this.input=e,this.root=new Jd,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,i=new Yd;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?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){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.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=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Zd;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Gd(this.input)}decl(e,t){let r=new Kd;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new $d;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(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)}endFile(){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())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(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)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[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()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",Hd[a]||Hd[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new $d;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let Qd=Jh,ep=Xd,tp=Ch;function rp(e,t){let r=new tp(e,t),n=new ep(r);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}var np=rp;rp.default=rp,Qd.registerParse(rp);let{isClean:ip,my:op}=Lc,sp=Mh,ap=zc,lp=Jh,up=ed,cp=rd,hp=ad,dp=np,pp=Ud;const fp={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},gp={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},mp={Once:!0,postcssPlugin:!0,prepare:!0};function vp(e){return"object"==typeof e&&"function"==typeof e.then}function yp(e){let t=!1,r=fp[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function bp(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:yp(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function wp(e){return e[ip]=!1,e.nodes&&e.nodes.forEach((e=>wp(e))),e}let Sp={},Cp=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof hp)i=wp(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=dp;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[op]&&lp.rebuild(i)}else i=wp(r);this.result=new hp(t,i,n),this.helpers={...Sp,postcss:Sp,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!gp[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!mp[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(vp(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ip];){e[ip]=!0;let t=[bp(e)];for(;t.length>0;){let e=this.visitTick(t);if(vp(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return vp(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=ap;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new sp(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(vp(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ip];)e[ip]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||cp("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)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(vp(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[ip])return n[ip]=!0,void e.push(bp(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[ip]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[ip]=!0;let t=yp(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[ip]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Cp.registerPostcss=e=>{Sp=e};var Ip=Cp;Cp.default=Cp,pp.registerLazyResult(Cp),up.registerLazyResult(Cp);let xp=Mh,kp=zc,Ep=rd,Op=np;const Ap=ad;let Rp=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i=kp;this.result=new Ap(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new xp(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Ep("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)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Op;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Pp=Rp;Rp.default=Rp;let Tp=Pp,_p=Ip,Mp=ed,Np=Ud,Lp=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" 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.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new _p(this,e,t):new Tp(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Dp=Lp;Lp.default=Lp,Np.registerProcessor(Lp),Mp.registerProcessor(Lp);let Fp=Xc,Up=ah,jp=Dh,Bp=Md,zp=Ch,Vp=Ud,Wp=qd;function qp(e,t){if(Array.isArray(e))return e.map((e=>qp(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:zp.prototype};r.map&&(r.map={...r.map,__proto__:Up.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>qp(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Vp(n);if("decl"===n.type)return new Fp(n);if("rule"===n.type)return new Wp(n);if("comment"===n.type)return new jp(n);if("atrule"===n.type)return new Bp(n);throw new Error("Unknown node type: "+e.type)}var Kp=qp;qp.default=qp;let Gp=Nc,Zp=Xc,Yp=Ip,Jp=Jh,$p=Dp,Hp=zc,Xp=Kp,Qp=ed,ef=id,tf=Dh,rf=Md,nf=ad,of=Ch,sf=np,af=Bd,lf=qd,uf=Ud,cf=Jc;function hf(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $p(e)}hf.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new $p).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return hf([i(r)]).process(e,t)},i},hf.stringify=Hp,hf.parse=sf,hf.fromJSON=Xp,hf.list=af,hf.comment=e=>new tf(e),hf.atRule=e=>new rf(e),hf.decl=e=>new Zp(e),hf.rule=e=>new lf(e),hf.root=e=>new uf(e),hf.document=e=>new Qp(e),hf.CssSyntaxError=Gp,hf.Declaration=Zp,hf.Container=Jp,hf.Processor=$p,hf.Document=Qp,hf.Comment=tf,hf.Warning=ef,hf.AtRule=rf,hf.Result=nf,hf.Input=of,hf.Rule=lf,hf.Root=uf,hf.Node=cf,Yp.registerPostcss(hf);var df=hf;hf.default=hf;const pf=xc(df);pf.stringify,pf.fromJSON,pf.plugin,pf.parse,pf.list,pf.document,pf.comment,pf.atRule,pf.rule,pf.decl,pf.root,pf.CssSyntaxError,pf.Declaration,pf.Container,pf.Processor,pf.Document,pf.Comment,pf.Warning,pf.AtRule,pf.Result,pf.Input,pf.Rule,pf.Root,pf.Node;var ff=Object.defineProperty,gf=(e,t,r)=>((e,t,r)=>t in e?ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function mf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function vf(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var yf={exports:{}},bf=String,wf=function(){return{isColorSupported:!1,reset:bf,bold:bf,dim:bf,italic:bf,underline:bf,inverse:bf,hidden:bf,strikethrough:bf,black:bf,red:bf,green:bf,yellow:bf,blue:bf,magenta:bf,cyan:bf,white:bf,gray:bf,bgBlack:bf,bgRed:bf,bgGreen:bf,bgYellow:bf,bgBlue:bf,bgMagenta:bf,bgCyan:bf,bgWhite:bf}};yf.exports=wf(),yf.exports.createColors=wf;var Sf=yf.exports;const Cf=vf(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let If=Sf,xf=Cf,kf=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=If.isColorSupported),xf&&e&&(t=xf(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=If.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Ef=kf;kf.default=kf;var Of={};Of.isClean=Symbol("isClean"),Of.my=Symbol("my");const Af={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Rf=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="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");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Af[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=Af[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(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)}};var Pf=Rf;Rf.default=Rf;let Tf=Pf;function _f(e,t){new Tf(t).stringify(e)}var Mf=_f;_f.default=_f;let{isClean:Nf,my:Lf}=Of,Df=Ef,Ff=Pf,Uf=Mf;function jf(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>jf(e,r))):("object"===o&&null!==i&&(i=jf(i)),r[n]=i)}return r}let Bf=class{constructor(e={}){this.raws={},this[Nf]=!1,this[Lf]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=jf(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new Df(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Nf]){this[Nf]=!1;let e=this;for(;e=e.parent;)e[Nf]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Ff).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Uf){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var zf=Bf;Bf.default=Bf;let Vf=zf,Wf=class extends Vf{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var qf=Wf;Wf.default=Wf;var Kf={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:Gf,SourceMapGenerator:Zf}=Cf,{existsSync:Yf,readFileSync:Jf}=Cf,{dirname:$f,join:Hf}=Cf;let Xf=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=$f(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Gf(this.text)),this.consumerCache}decodeInline(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;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=$f(e),Yf(e))return this.mapFile=e,Jf(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Gf)return Zf.fromSourceMap(t).toString();if(t instanceof Zf)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Hf($f(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Qf=Xf;Xf.default=Xf;let{SourceMapConsumer:eg,SourceMapGenerator:tg}=Cf,{fileURLToPath:rg,pathToFileURL:ng}=Cf,{isAbsolute:ig,resolve:og}=Cf,{nanoid:sg}=Kf,ag=Cf,lg=Ef,ug=Qf,cg=Symbol("fromOffsetCache"),hg=Boolean(eg&&tg),dg=Boolean(og&&ig),pg=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!dg||/^\w+:\/\//.test(t.from)||ig(t.from)?this.file=t.from:this.file=og(t.from)),dg&&hg){let e=new ug(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+sg(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new lg(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new lg(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(ng&&(i.input.url=ng(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[cg])r=this[cg];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[cg]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:og(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=ig(a.source)?ng(a.source):new URL(a.source,this.map.consumer().sourceRoot||ng(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!rg)throw new Error("file: protocol is not available in this PostCSS build");l.file=rg(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var fg=pg;pg.default=pg,ag&&ag.registerInput&&ag.registerInput(pg);let{SourceMapConsumer:gg,SourceMapGenerator:mg}=Cf,{dirname:vg,relative:yg,resolve:bg,sep:wg}=Cf,{pathToFileURL:Sg}=Cf,Cg=fg,Ig=Boolean(gg&&mg),xg=Boolean(vg&&bg&&yg&&wg);var kg=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;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";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||vg(e.file);!1===this.mapOpts.sourcesContent?(t=new gg(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),xg&&Ig&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=mg.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new mg({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>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new mg({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?vg(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=vg(bg(r,this.mapOpts.annotation)));let n=yg(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new Cg(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(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))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Sg){let t=Sg(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===wg&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Eg=zf,Og=class extends Eg{constructor(e){super(e),this.type="comment"}};var Ag=Og;Og.default=Og;let Rg,Pg,Tg,_g,{isClean:Mg,my:Ng}=Of,Lg=qf,Dg=Ag,Fg=zf;function Ug(e){return e.map((e=>(e.nodes&&(e.nodes=Ug(e.nodes)),delete e.source,e)))}function jg(e){if(e[Mg]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)jg(t)}let Bg=class e extends Fg{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Ug(Rg(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Lg(t)]}else if(t.selector)t=[new Pg(t)];else if(t.name)t=[new Tg(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Dg(t)]}return t.map((t=>(t[Ng]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Mg]&&jg(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Bg.registerParse=e=>{Rg=e},Bg.registerRule=e=>{Pg=e},Bg.registerAtRule=e=>{Tg=e},Bg.registerRoot=e=>{_g=e};var zg=Bg;Bg.default=Bg,Bg.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Tg.prototype):"rule"===e.type?Object.setPrototypeOf(e,Pg.prototype):"decl"===e.type?Object.setPrototypeOf(e,Lg.prototype):"comment"===e.type?Object.setPrototypeOf(e,Dg.prototype):"root"===e.type&&Object.setPrototypeOf(e,_g.prototype),e[Ng]=!0,e.nodes&&e.nodes.forEach((e=>{Bg.rebuild(e)}))};let Vg,Wg,qg=zg,Kg=class extends qg{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Vg(new Wg,this,e).stringify()}};Kg.registerLazyResult=e=>{Vg=e},Kg.registerProcessor=e=>{Wg=e};var Gg=Kg;Kg.default=Kg;let Zg={};var Yg=function(e){Zg[e]||(Zg[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Jg=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){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}};var $g=Jg;Jg.default=Jg;let Hg=$g,Xg=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Hg(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var Qg=Xg;Xg.default=Xg;const em="'".charCodeAt(0),tm='"'.charCodeAt(0),rm="\\".charCodeAt(0),nm="/".charCodeAt(0),im="\n".charCodeAt(0),om=" ".charCodeAt(0),sm="\f".charCodeAt(0),am="\t".charCodeAt(0),lm="\r".charCodeAt(0),um="[".charCodeAt(0),cm="]".charCodeAt(0),hm="(".charCodeAt(0),dm=")".charCodeAt(0),pm="{".charCodeAt(0),fm="}".charCodeAt(0),gm=";".charCodeAt(0),mm="*".charCodeAt(0),vm=":".charCodeAt(0),ym="@".charCodeAt(0),bm=/[\t\n\f\r "#'()/;[\\\]{}]/g,wm=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Sm=/.[\r\n"'(/\\]/,Cm=/[\da-f]/i;let Im=zg,xm=class extends Im{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var km=xm;xm.default=xm,Im.registerAtRule(xm);let Em,Om,Am=zg,Rm=class extends Am{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Em(new Om,this,e).stringify()}};Rm.registerLazyResult=e=>{Em=e},Rm.registerProcessor=e=>{Om=e};var Pm=Rm;Rm.default=Rm,Am.registerRoot(Rm);let Tm={comma:e=>Tm.split(e,[","],!0),space:e=>Tm.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var _m=Tm;Tm.default=Tm;let Mm=zg,Nm=_m,Lm=class extends Mm{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Nm.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Dm=Lm;Lm.default=Lm,Mm.registerRule(Lm);let Fm=qf,Um=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case im:case om:case am:case lm:case sm:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===om||r===im||r===am||r===lm||r===sm);h=["space",d.slice(g,n)],g=n-1;break;case um:case cm:case pm:case fm:case vm:case gm:case dm:{let e=String.fromCharCode(r);h=[e,e,g];break}case hm:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==em&&c!==tm&&c!==om&&c!==im&&c!==am&&c!==sm&&c!==lm){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===rm;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||Sm.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case em:case tm:i=r===em?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===rm;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case ym:bm.lastIndex=g+1,bm.test(d),n=0===bm.lastIndex?d.length-1:bm.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case rm:for(n=g,s=!0;d.charCodeAt(n+1)===rm;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==nm&&r!==om&&r!==im&&r!==am&&r!==lm&&r!==sm&&(n+=1,Cm.test(d.charAt(n)))){for(;Cm.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===om&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===nm&&d.charCodeAt(g+1)===mm?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(wm.lastIndex=g+1,wm.test(d),n=0===wm.lastIndex?d.length-1:wm.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},jm=Ag,Bm=km,zm=Pm,Vm=Dm;const Wm={empty:!0,space:!0};var qm=class{constructor(e){this.input=e,this.root=new zm,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,i=new Bm;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?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){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.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=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new jm;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Um(this.input)}decl(e,t){let r=new Fm;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Vm;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(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)}endFile(){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())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(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)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[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()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",Wm[a]||Wm[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new Vm;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let Km=zg,Gm=qm,Zm=fg;function Ym(e,t){let r=new Zm(e,t),n=new Gm(r);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}var Jm=Ym;Ym.default=Ym,Km.registerParse(Ym);let{isClean:$m,my:Hm}=Of,Xm=kg,Qm=Mf,ev=zg,tv=Gg,rv=Yg,nv=Qg,iv=Jm,ov=Pm;const sv={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},av={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},lv={Once:!0,postcssPlugin:!0,prepare:!0};function uv(e){return"object"==typeof e&&"function"==typeof e.then}function cv(e){let t=!1,r=sv[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function hv(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:cv(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function dv(e){return e[$m]=!1,e.nodes&&e.nodes.forEach((e=>dv(e))),e}let pv={},fv=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof nv)i=dv(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=iv;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[Hm]&&ev.rebuild(i)}else i=dv(r);this.result=new nv(t,i,n),this.helpers={...pv,postcss:pv,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!av[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!lv[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(uv(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[$m];){e[$m]=!0;let t=[hv(e)];for(;t.length>0;){let e=this.visitTick(t);if(uv(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return uv(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Qm;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Xm(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(uv(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[$m];)e[$m]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||rv("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)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(uv(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[$m])return n[$m]=!0,void e.push(hv(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[$m]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[$m]=!0;let t=cv(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[$m]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};fv.registerPostcss=e=>{pv=e};var gv=fv;fv.default=fv,ov.registerLazyResult(fv),tv.registerLazyResult(fv);let mv=kg,vv=Mf,yv=Yg,bv=Jm;const wv=Qg;let Sv=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i=vv;this.result=new wv(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new mv(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||yv("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)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=bv;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Cv=Sv;Sv.default=Sv;let Iv=Cv,xv=gv,kv=Gg,Ev=Pm,Ov=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" 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.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new xv(this,e,t):new Iv(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Av=Ov;Ov.default=Ov,Ev.registerProcessor(Ov),kv.registerProcessor(Ov);let Rv=qf,Pv=Qf,Tv=Ag,_v=km,Mv=fg,Nv=Pm,Lv=Dm;function Dv(e,t){if(Array.isArray(e))return e.map((e=>Dv(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Mv.prototype};r.map&&(r.map={...r.map,__proto__:Pv.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Dv(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Nv(n);if("decl"===n.type)return new Rv(n);if("rule"===n.type)return new Lv(n);if("comment"===n.type)return new Tv(n);if("atrule"===n.type)return new _v(n);throw new Error("Unknown node type: "+e.type)}var Fv=Dv;Dv.default=Dv;let Uv=Ef,jv=qf,Bv=gv,zv=zg,Vv=Av,Wv=Mf,qv=Fv,Kv=Gg,Gv=$g,Zv=Ag,Yv=km,Jv=Qg,$v=fg,Hv=Jm,Xv=_m,Qv=Dm,ey=Pm,ty=zf;function ry(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Vv(e)}ry.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new Vv).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return ry([i(r)]).process(e,t)},i},ry.stringify=Wv,ry.parse=Hv,ry.fromJSON=qv,ry.list=Xv,ry.comment=e=>new Zv(e),ry.atRule=e=>new Yv(e),ry.decl=e=>new jv(e),ry.rule=e=>new Qv(e),ry.root=e=>new ey(e),ry.document=e=>new Kv(e),ry.CssSyntaxError=Uv,ry.Declaration=jv,ry.Container=zv,ry.Processor=Vv,ry.Document=Kv,ry.Comment=Zv,ry.Warning=Gv,ry.AtRule=Yv,ry.Result=Jv,ry.Input=$v,ry.Rule=Qv,ry.Root=ey,ry.Node=ty,Bv.registerPostcss(ry);var ny=ry;ry.default=ry;const iy=mf(ny);iy.stringify,iy.fromJSON,iy.plugin,iy.parse,iy.list,iy.document,iy.comment,iy.atRule,iy.rule,iy.decl,iy.root,iy.CssSyntaxError,iy.Declaration,iy.Container,iy.Processor,iy.Document,iy.Comment,iy.Warning,iy.AtRule,iy.Result,iy.Input,iy.Rule,iy.Root,iy.Node;class oy{constructor(...e){gf(this,"parentElement",null),gf(this,"parentNode",null),gf(this,"ownerDocument"),gf(this,"firstChild",null),gf(this,"lastChild",null),gf(this,"previousSibling",null),gf(this,"nextSibling",null),gf(this,"ELEMENT_NODE",1),gf(this,"TEXT_NODE",3),gf(this,"nodeType"),gf(this,"nodeName"),gf(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof oy))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const sy={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ay={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ly={};function uy(e){if(ly[e])return ly[e];const t=globalThis[e],r=t.prototype,n=e in sy?sy[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in ay?ay[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return ly[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?ly[e]=o:r}catch{return r}}const cy={};function hy(e,t,r){var n;const i=`${e}.${String(r)}`;if(cy[i])return cy[i].call(t);const o=uy(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(cy[i]=s,s.call(t)):t[r]}const dy={};function py(e,t,r){const n=`${e}.${String(r)}`;if(dy[n])return dy[n].bind(t);const i=uy(e)[r];return"function"!=typeof i?t[r]:(dy[n]=i,i.bind(t))}const fy={childNodes:function(e){return hy("Node",e,"childNodes")},parentNode:function(e){return hy("Node",e,"parentNode")},parentElement:function(e){return hy("Node",e,"parentElement")},textContent:function(e){return hy("Node",e,"textContent")},contains:function(e,t){return py("Node",e,"contains")(t)},getRootNode:function(e){return py("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?hy("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?hy("Element",e,"shadowRoot"):null},querySelector:function(e,t){return hy("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return hy("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return uy("MutationObserver").constructor}};const gy="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.";let my={map:{},getId:()=>(console.error(gy),-1),getNode:()=>(console.error(gy),null),removeNodeFromMap(){console.error(gy)},has:()=>(console.error(gy),!1),reset(){console.error(gy)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(my=new Proxy(my,{get:(e,t,r)=>("map"===t&&console.error(gy),Reflect.get(e,t,r))}));let vy=Date.now;function yy(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:fy.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(vy=()=>(new Date).getTime());function by(e){var t;let r=null;return"getRootNode"in e&&(null==(t=fy.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&fy.host(fy.getRootNode(e))&&(r=fy.host(fy.getRootNode(e))),r}function wy(e){let t,r=e;for(;t=by(r);)r=t;return r}function Sy(e){const t=e.ownerDocument;if(!t)return!1;const r=wy(e);return fy.contains(t,r)}const Cy=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){cc(this,"id",1),cc(this,"styleIDMap",new WeakMap),cc(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return my},closestElementOfNode:yy,getBaseDimension:function e(t,r){var n,i;const o=null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=e(o,r),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){const n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){const t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:wy,getShadowHost:by,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=fy.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=fy.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof oy&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(fy.shadowRoot(e)))},hookSetter:function e(t,r,n,i,o=window){const s=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,r,s||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(fy.contains(t,e)||Sy(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&Sc.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Sc.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const i=fy.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||e(i,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const i=yy(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(Ic(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(let n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return vy},on:function(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}},polyfill:function(e=window){"NodeList"in e&&!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)},queueToResolveTrees:function(e){const t={},r=(e,r)=>{const n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(const i of e){const{nextId:e,parentId:o}=i;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,r(i,o.parent))}else{const e=n.indexOf(o);n.splice(e,0,r(i,null))}}else if(o in t){const e=t[o];e.children.push(r(i,e))}else n.push(r(i,null))}return n},shadowHostInDom:Sy,throttle:function(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();i||!1!==r.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)}),a))}},uniqueTextMutations:function(e){const t=new Set,r=[];for(let n=e.length;n--;){const i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"}));for(var Iy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xy="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ky=0;ky<64;ky++)xy[Iy.charCodeAt(ky)]=ky;var Ey,Oy,Ay;"undefined"!=typeof window&&window.Blob&&new Blob([(Ey="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(Ey),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Pu=e.contentWindow)?void 0:Pu.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new Cc,(Ay=Oy||(Oy={}))[Ay.NotStarted=0]="NotStarted",Ay[Ay.Running=1]="Running",Ay[Ay.Stopped=2]="Stopped";class Ry{constructor(e){lc(this,"fileName"),lc(this,"functionName"),lc(this,"lineNumber"),lc(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const Py=/(^|@)\S+:\d+/,Ty=/^\s*at .*(\S+:\d+|\(native\))/m,_y=/^(eval@)?(\[native code])?$/,My={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ty)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ty)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Ry({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(_y)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ry({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ry({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[];for(let e=2,i=r.length;e<i;e+=2){const i=t.exec(r[e]);i&&n.push(new Ry({fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[];for(let e=0,i=r.length;e<i;e+=2){const i=t.exec(r[e]);i&&n.push(new Ry({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Py)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ry({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Ny(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(let e=0;e<n.children.length;e++){const t=n.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===r&&i.push(t)}i.length>1&&(r+=`:eq(${i.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function Ly(e){return"[object Object]"===Object.prototype.toString.call(e)}function Dy(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Ly(e[n])&&Dy(e[n],t-1))return!0;return!1}function Fy(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){const r=n.indexOf(this);~r?n.splice(r+1):n.push(this),~r?i.splice(r,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ly(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ly(e)&&Dy(e,r.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=`${t.slice(0,r.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const r in t){const n=t[r];Array.isArray(n)?e[r]=Ny(n.length?n[0]:null):e[r]=n}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}const Uy={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function jy(e,t,r){const n=r?Object.assign({},Uy,r):Uy,i=n.logger;if(!i)return()=>{};let o;o="string"==typeof i?t[i]:i;let s=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,i=t.error,o=My.parse(i).map((e=>e.toString())),s=[Fy(r,n.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",r),l.push((()=>{t.removeEventListener("error",r)}));const i=t=>{let r,i;t.reason instanceof Error?(r=t.reason,i=[Fy(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,i=[Fy("Uncaught (in promise)",n.stringifyOptions),Fy(t.reason,n.stringifyOptions)]);const o=My.parse(r).map((e=>e.toString()));e({level:"error",trace:o,payload:i})};t.addEventListener("unhandledrejection",i),l.push((()=>{t.removeEventListener("unhandledrejection",i)}))}for(const e of n.level)l.push(u(o,e));return()=>{l.forEach((e=>e()))};function u(t,r){return t[r]?Cy.patch(t,r,(t=>(...i)=>{if(t.apply(this,i),!("assert"===r&&i[0]||a)){a=!0;try{const t=My.parse(new Error).map((e=>e.toString())).splice(1),o=("assert"===r?i.slice(1):i).map((e=>Fy(e,n.stringifyOptions)));s++,s<n.lengthThreshold?e({level:r,trace:t,payload:o}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Fy("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...i)}finally{a=!1}}})):()=>{}}}const By="rrweb/console@1";var zy,Vy=Object.freeze({__proto__:null,PLUGIN_NAME:By,getRecordConsolePlugin:e=>({name:By,observer:jy,options:e})}),Wy=Object.defineProperty,qy=(e,t,r)=>((e,t,r)=>t in e?Wy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ky=Object.defineProperty,Gy=(e,t,r)=>((e,t,r)=>t in e?Ky(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Zy=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Zy||{});const Yy={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Jy={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},$y={};function Hy(e){if($y[e])return $y[e];const t=globalThis[e],r=t.prototype,n=e in Yy?Yy[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in Jy?Jy[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return $y[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?$y[e]=o:r}catch{return r}}const Xy={};function Qy(e,t,r){var n;const i=`${e}.${String(r)}`;if(Xy[i])return Xy[i].call(t);const o=Hy(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Xy[i]=s,s.call(t)):t[r]}const eb={};function tb(e,t,r){const n=`${e}.${String(r)}`;if(eb[n])return eb[n].bind(t);const i=Hy(e)[r];return"function"!=typeof i?t[r]:(eb[n]=i,i.bind(t))}const rb={childNodes:function(e){return Qy("Node",e,"childNodes")},parentNode:function(e){return Qy("Node",e,"parentNode")},parentElement:function(e){return Qy("Node",e,"parentElement")},textContent:function(e){return Qy("Node",e,"textContent")},contains:function(e,t){return tb("Node",e,"contains")(t)},getRootNode:function(e){return tb("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Qy("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Qy("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Qy("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Qy("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Hy("MutationObserver").constructor}};function nb(e){return e.nodeType===e.ELEMENT_NODE}function ib(e){const t=e&&"host"in e&&"mode"in e&&rb.host(e)||null;return Boolean(t&&"shadowRoot"in t&&rb.shadowRoot(t)===e)}function ob(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function sb(e){try{const r=e.rules||e.cssRules;if(!r)return null;let n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);const i=Array.from(r,(e=>ab(e,n))).join("");return(t=i).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function ab(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=sb(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(r){t=e.cssText}return e.styleSheet.href?yb(t,e.styleSheet.href):t}{let r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(r)),t?yb(r,t):r}}class lb{constructor(){Gy(this,"idNodeMap",new Map),Gy(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ub({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";const a=n&&cb(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function cb(e){return e.toLowerCase()}const hb="__rrweb_original__";function db(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?cb(t):null}function pb(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(e){return null}const n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==n?void 0:n[1])??null}const fb=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,gb=/^(?:[a-z+]+:)?\/\//i,mb=/^www\..*/i,vb=/^(data:)([^,]*),(.*)/i;function yb(e,t){return(e||"").replace(fb,((e,r,n,i,o,s)=>{const a=n||o||s,l=r||i||"";if(!a)return e;if(gb.test(a)||mb.test(a))return`url(${l}${a}${l})`;if(vb.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const u=t.split("/"),c=a.split("/");u.pop();for(const e of c)"."!==e&&(".."===e?u.pop():u.push(e));return`url(${l}${u.join("/")}${l})`}))}function bb(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function wb(e,t){return function(e,t,r=!1){const n=Array.from(t.childNodes),i=[];let o=0;if(n.length>1&&e&&"string"==typeof e){let t=bb(e,r);const s=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=bb(n[a].textContent,r),u=100;let c=3;for(;c<l.length&&(l[c].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,c),1));c++);for(;c<l.length;c++){let h=l.substring(0,c),d=t.split(h),p=-1;if(2===d.length)p=d[0].length;else if(d.length>2&&""===d[0]&&""!==n[a-1].textContent)p=t.indexOf(h,1);else if(1===d.length){if(h=h.substring(0,h.length-1),d=t.split(h),d.length<=1)return i.push(e),i;c=u+1}else c===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&c>u){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=bb(e).length;p=t.indexOf(h,r)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/s);for(;a>0&&a<e.length;){if(o+=1,o>50*n.length)return i.push(e),i;const l=bb(e.substring(0,a),r);if(l.length===p){i.push(e.substring(0,a)),e=e.substring(a),t=t.substring(p);break}l.length<p?a+=Math.max(1,Math.floor((p-l.length)/s)):a-=Math.max(1,Math.floor((l.length-p)*s))}break}}}}return i.push(e),i}(e,t).join("/* rr_split */")}const Sb="lightgrey";let Cb=1;const Ib=new RegExp("[^a-z0-9-_:]");function xb(){return Cb++}let kb,Eb;const Ob=/^[^ \t\n\r\u000c]+/,Ab=/^[, \t\n\r\u000c]+/;const Rb=new WeakMap;function Pb(e,t){return t&&""!==t.trim()?_b(e,t):t}function Tb(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function _b(e,t){let r=Rb.get(e);if(r||(r=e.createElement("a"),Rb.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Mb(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Pb(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function n(e){let n;const i=e.exec(t.substring(r));return i?(n=i[0],r+=n.length,n):""}const i=[];for(;n(Ab),!(r>=t.length);){let o=n(Ob);if(","===o.slice(-1))o=Pb(e,o.substring(0,o.length-1)),i.push(o);else{let n="";o=Pb(e,o);let s=!1;for(;;){const e=t.charAt(r);if(""===e){i.push((o+n).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){r+=1,i.push((o+n).trim());break}"("===e&&(s=!0)}n+=e,r+=1}}}return i.join(", ")}(e,n):"style"===r?yb(n,_b(e)):"object"===t&&"data"===r?Pb(e,n):n:Pb(e,n):n}function Nb(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Lb(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Lb(rb.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Lb(rb.parentNode(e),t,r)}function Db(e,t,r,n){let i;if(nb(e)){if(i=e,!rb.childNodes(i).length)return!1}else{if(null===rb.parentElement(e))return!1;i=rb.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Lb(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function Fb(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:g=!1,cssCaptured:m=!1,applyBackgroundColorToBlockedElements:v=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Zy.Document,childNodes:[],compatMode:e.compatMode}:{type:Zy.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Zy.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p,applyBackgroundColorToBlockedElements:f=!1}=t,g=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,i),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=cb(e.tagName);return Ib.test(t)?"div":t}(e);let v={};const y=e.attributes.length;for(let t=0;t<y;t++){const n=e.attributes[t];Nb(m,n.name,n.value)||(v[n.name]=Mb(r,m,cb(n.name),n.value))}if("link"===m&&o){const t=Array.from(r.styleSheets).find((t=>t.href===e.href));let n=null;t&&(n=sb(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===m&&e.sheet){let t=sb(e.sheet);t&&(e.childNodes.length>1&&(t=wb(t,e)),v._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&t?v.value=ub({element:e,type:db(e),tagName:m,value:t,maskInputOptions:s,maskInputFn:a}):r&&(v.checked=r)}"option"===m&&(e.selected&&!s.select?v.selected=!0:delete v.selected);"dialog"===m&&e.open&&(v.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&c)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const i=t.getImageData,o=hb in i?i[hb]:i;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(v.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(l.type,l.quality)&&(v.rr_dataURL=t)}if("img"===m&&u){kb||(kb=r.createElement("canvas"),Eb=kb.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",i=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{kb.width=t.naturalWidth,kb.height=t.naturalHeight,Eb.drawImage(t,0,0),v.rr_dataURL=kb.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(i?v.crossOrigin=i:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===m||"video"===m){const t=v;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}d||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop));if(g){const{width:t,height:r}=e.getBoundingClientRect();v={class:v.class,rr_width:`${t}px`,rr_height:`${r}px`,...f?{rr_background_color:Sb}:{}}}"iframe"!==m||h(v.src)||(e.contentDocument||(v.rr_src=v.src),delete v.src);let b;try{customElements.get(m)&&(b=!0)}catch(e){}return{type:Zy.Element,tagName:m,attributes:v,childNodes:[],isSVG:Tb(e)||void 0,needBlock:g,rootId:p,isCustom:b}}(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:g,rootId:y,applyBackgroundColorToBlockedElements:v});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:i,cssCaptured:o}=t,s=rb.parentNode(e),a=s&&s.tagName;let l="";const u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;c?l="SCRIPT_PLACEHOLDER":o||(l=rb.textContent(e),u&&l&&(l=yb(l,_b(t.doc))));!u&&!c&&l&&r&&(l=n?n(l,rb.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Zy.Text,textContent:l||"",rootId:i}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:y,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Zy.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Zy.Comment,textContent:rb.textContent(e)||"",rootId:y};default:return!1}}function Ub(e){return null==e?"":e.toLowerCase()}function jb(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:I=!1,cssCaptured:x=!1,applyBackgroundColorToBlockedElements:k=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:O=!0}=t;if(!E){E=Db(e,s,a,void 0===E)}const A=Fb(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:E,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:x,applyBackgroundColorToBlockedElements:k});if(!A)return console.warn(e,"not serialized"),null;let R;R=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===Zy.Comment)return!0;if(e.type===Zy.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===pb(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ub(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ub(e.attributes.name)||"icon"===Ub(e.attributes.rel)||"apple-touch-icon"===Ub(e.attributes.rel)||"shortcut icon"===Ub(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ub(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ub(e.attributes.property).match(/^(og|twitter|fb):/)||Ub(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ub(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ub(e.attributes.name)||"googlebot"===Ub(e.attributes.name)||"bingbot"===Ub(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ub(e.attributes.name)||"generator"===Ub(e.attributes.name)||"framework"===Ub(e.attributes.name)||"publisher"===Ub(e.attributes.name)||"progid"===Ub(e.attributes.name)||Ub(e.attributes.property).match(/^article:/)||Ub(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ub(e.attributes.name)||"yandex-verification"===Ub(e.attributes.name)||"csrf-token"===Ub(e.attributes.name)||"p:domain_verify"===Ub(e.attributes.name)||"verify-v1"===Ub(e.attributes.name)||"verification"===Ub(e.attributes.name)||"shopify-checkout-api-token"===Ub(e.attributes.name)))return!0}}return!1}(A,p)||!O&&A.type===Zy.Text&&!A.textContent.replace(/^\s+|\s+$/gm,"").length?-2:xb();const P=Object.assign(A,{id:R});if(n.add(e,P),-2===R)return null;v&&v(e);let T=!l;if(P.type===Zy.Element){T=T&&!P.needBlock,delete P.needBlock;const t=rb.shadowRoot(e);t&&ob(t)&&(P.isShadowHost=!0)}if((P.type===Zy.Document||P.type===Zy.Element)&&T){p.headWhitespace&&P.type===Zy.Element&&"head"===P.tagName&&(O=!1);const t={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:O,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1,applyBackgroundColorToBlockedElements:k};if(P.type===Zy.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else{P.type===Zy.Element&&void 0!==P.attributes._cssText&&"string"==typeof P.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(rb.childNodes(e))){const e=jb(r,t);e&&P.childNodes.push(e)}}let I=null;if(nb(e)&&(I=rb.shadowRoot(e)))for(const e of Array.from(rb.childNodes(I))){const r=jb(e,t);r&&(ob(I)&&(r.isShadow=!0),P.childNodes.push(r))}}const _=rb.parentNode(e);return _&&ib(_)&&ob(_)&&(P.isShadow=!0),P.type===Zy.Element&&"iframe"===P.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"!==i){const n=setTimeout((()=>{o||(t(),o=!0)}),r);return void e.addEventListener("load",(()=>{clearTimeout(n),o=!0,t()}))}const s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&y){const r=jb(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:O,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&y(e,r)}}),b),P.type===Zy.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===pb(P.attributes.href))&&function(e,t,r){let n,i=!1;try{n=e.sheet}catch(e){return}if(n)return;const o=setTimeout((()=>{i||(t(),i=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}(e,(()=>{if(w){const t=jb(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:O,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&w(e,t)}}),S),P}function Bb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zb(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var Vb={exports:{}},Wb=String,qb=function(){return{isColorSupported:!1,reset:Wb,bold:Wb,dim:Wb,italic:Wb,underline:Wb,inverse:Wb,hidden:Wb,strikethrough:Wb,black:Wb,red:Wb,green:Wb,yellow:Wb,blue:Wb,magenta:Wb,cyan:Wb,white:Wb,gray:Wb,bgBlack:Wb,bgRed:Wb,bgGreen:Wb,bgYellow:Wb,bgBlue:Wb,bgMagenta:Wb,bgCyan:Wb,bgWhite:Wb}};Vb.exports=qb(),Vb.exports.createColors=qb;var Kb=Vb.exports;const Gb=zb(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Zb=Kb,Yb=Gb,Jb=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Zb.isColorSupported),Yb&&e&&(t=Yb(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Zb.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var $b=Jb;Jb.default=Jb;var Hb={};Hb.isClean=Symbol("isClean"),Hb.my=Symbol("my");const Xb={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Qb=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="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");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Xb[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=Xb[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(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)}};var ew=Qb;Qb.default=Qb;let tw=ew;function rw(e,t){new tw(t).stringify(e)}var nw=rw;rw.default=rw;let{isClean:iw,my:ow}=Hb,sw=$b,aw=ew,lw=nw;function uw(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>uw(e,r))):("object"===o&&null!==i&&(i=uw(i)),r[n]=i)}return r}let cw=class{constructor(e={}){this.raws={},this[iw]=!1,this[ow]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=uw(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new sw(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[iw]){this[iw]=!1;let e=this;for(;e=e.parent;)e[iw]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new aw).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=lw){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var hw=cw;cw.default=cw;let dw=hw,pw=class extends dw{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var fw=pw;pw.default=pw;var gw={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:mw,SourceMapGenerator:vw}=Gb,{existsSync:yw,readFileSync:bw}=Gb,{dirname:ww,join:Sw}=Gb;let Cw=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ww(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new mw(this.text)),this.consumerCache}decodeInline(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;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=ww(e),yw(e))return this.mapFile=e,bw(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof mw)return vw.fromSourceMap(t).toString();if(t instanceof vw)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Sw(ww(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Iw=Cw;Cw.default=Cw;let{SourceMapConsumer:xw,SourceMapGenerator:kw}=Gb,{fileURLToPath:Ew,pathToFileURL:Ow}=Gb,{isAbsolute:Aw,resolve:Rw}=Gb,{nanoid:Pw}=gw,Tw=Gb,_w=$b,Mw=Iw,Nw=Symbol("fromOffsetCache"),Lw=Boolean(xw&&kw),Dw=Boolean(Rw&&Aw),Fw=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Dw||/^\w+:\/\//.test(t.from)||Aw(t.from)?this.file=t.from:this.file=Rw(t.from)),Dw&&Lw){let e=new Mw(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Pw(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new _w(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new _w(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(Ow&&(i.input.url=Ow(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[Nw])r=this[Nw];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[Nw]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Rw(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=Aw(a.source)?Ow(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ow(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Ew)throw new Error("file: protocol is not available in this PostCSS build");l.file=Ew(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Uw=Fw;Fw.default=Fw,Tw&&Tw.registerInput&&Tw.registerInput(Fw);let{SourceMapConsumer:jw,SourceMapGenerator:Bw}=Gb,{dirname:zw,relative:Vw,resolve:Ww,sep:qw}=Gb,{pathToFileURL:Kw}=Gb,Gw=Uw,Zw=Boolean(jw&&Bw),Yw=Boolean(zw&&Ww&&Vw&&qw);var Jw=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;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";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||zw(e.file);!1===this.mapOpts.sourcesContent?(t=new jw(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Yw&&Zw&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Bw.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Bw({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>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Bw({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?zw(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=zw(Ww(r,this.mapOpts.annotation)));let n=Vw(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new Gw(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(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))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Kw){let t=Kw(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===qw&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let $w=hw,Hw=class extends $w{constructor(e){super(e),this.type="comment"}};var Xw=Hw;Hw.default=Hw;let Qw,eS,tS,rS,{isClean:nS,my:iS}=Hb,oS=fw,sS=Xw,aS=hw;function lS(e){return e.map((e=>(e.nodes&&(e.nodes=lS(e.nodes)),delete e.source,e)))}function uS(e){if(e[nS]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)uS(t)}let cS=class e extends aS{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=lS(Qw(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new oS(t)]}else if(t.selector)t=[new eS(t)];else if(t.name)t=[new tS(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new sS(t)]}return t.map((t=>(t[iS]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[nS]&&uS(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};cS.registerParse=e=>{Qw=e},cS.registerRule=e=>{eS=e},cS.registerAtRule=e=>{tS=e},cS.registerRoot=e=>{rS=e};var hS=cS;cS.default=cS,cS.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,tS.prototype):"rule"===e.type?Object.setPrototypeOf(e,eS.prototype):"decl"===e.type?Object.setPrototypeOf(e,oS.prototype):"comment"===e.type?Object.setPrototypeOf(e,sS.prototype):"root"===e.type&&Object.setPrototypeOf(e,rS.prototype),e[iS]=!0,e.nodes&&e.nodes.forEach((e=>{cS.rebuild(e)}))};let dS,pS,fS=hS,gS=class extends fS{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new dS(new pS,this,e).stringify()}};gS.registerLazyResult=e=>{dS=e},gS.registerProcessor=e=>{pS=e};var mS=gS;gS.default=gS;let vS={};var yS=function(e){vS[e]||(vS[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let bS=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){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}};var wS=bS;bS.default=bS;let SS=wS,CS=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new SS(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var IS=CS;CS.default=CS;const xS="'".charCodeAt(0),kS='"'.charCodeAt(0),ES="\\".charCodeAt(0),OS="/".charCodeAt(0),AS="\n".charCodeAt(0),RS=" ".charCodeAt(0),PS="\f".charCodeAt(0),TS="\t".charCodeAt(0),_S="\r".charCodeAt(0),MS="[".charCodeAt(0),NS="]".charCodeAt(0),LS="(".charCodeAt(0),DS=")".charCodeAt(0),FS="{".charCodeAt(0),US="}".charCodeAt(0),jS=";".charCodeAt(0),BS="*".charCodeAt(0),zS=":".charCodeAt(0),VS="@".charCodeAt(0),WS=/[\t\n\f\r "#'()/;[\\\]{}]/g,qS=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,KS=/.[\r\n"'(/\\]/,GS=/[\da-f]/i;let ZS=hS,YS=class extends ZS{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var JS=YS;YS.default=YS,ZS.registerAtRule(YS);let $S,HS,XS=hS,QS=class extends XS{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new $S(new HS,this,e).stringify()}};QS.registerLazyResult=e=>{$S=e},QS.registerProcessor=e=>{HS=e};var eC=QS;QS.default=QS,XS.registerRoot(QS);let tC={comma:e=>tC.split(e,[","],!0),space:e=>tC.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var rC=tC;tC.default=tC;let nC=hS,iC=rC,oC=class extends nC{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return iC.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var sC=oC;oC.default=oC,nC.registerRule(oC);let aC=fw,lC=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case AS:case RS:case TS:case _S:case PS:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===RS||r===AS||r===TS||r===_S||r===PS);h=["space",d.slice(g,n)],g=n-1;break;case MS:case NS:case FS:case US:case zS:case jS:case DS:{let e=String.fromCharCode(r);h=[e,e,g];break}case LS:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==xS&&c!==kS&&c!==RS&&c!==AS&&c!==TS&&c!==PS&&c!==_S){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===ES;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||KS.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case xS:case kS:i=r===xS?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===ES;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case VS:WS.lastIndex=g+1,WS.test(d),n=0===WS.lastIndex?d.length-1:WS.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case ES:for(n=g,s=!0;d.charCodeAt(n+1)===ES;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==OS&&r!==RS&&r!==AS&&r!==TS&&r!==_S&&r!==PS&&(n+=1,GS.test(d.charAt(n)))){for(;GS.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===RS&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===OS&&d.charCodeAt(g+1)===BS?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(qS.lastIndex=g+1,qS.test(d),n=0===qS.lastIndex?d.length-1:qS.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},uC=Xw,cC=JS,hC=eC,dC=sC;const pC={empty:!0,space:!0};var fC=class{constructor(e){this.input=e,this.root=new hC,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,i=new cC;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?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){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.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=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new uC;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=lC(this.input)}decl(e,t){let r=new aC;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new dC;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(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)}endFile(){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())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(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)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[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()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",pC[a]||pC[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new dC;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let gC=hS,mC=fC,vC=Uw;function yC(e,t){let r=new vC(e,t),n=new mC(r);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}var bC=yC;yC.default=yC,gC.registerParse(yC);let{isClean:wC,my:SC}=Hb,CC=Jw,IC=nw,xC=hS,kC=mS,EC=yS,OC=IS,AC=bC,RC=eC;const PC={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},TC={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},_C={Once:!0,postcssPlugin:!0,prepare:!0};function MC(e){return"object"==typeof e&&"function"==typeof e.then}function NC(e){let t=!1,r=PC[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function LC(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:NC(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function DC(e){return e[wC]=!1,e.nodes&&e.nodes.forEach((e=>DC(e))),e}let FC={},UC=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof OC)i=DC(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=AC;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[SC]&&xC.rebuild(i)}else i=DC(r);this.result=new OC(t,i,n),this.helpers={...FC,postcss:FC,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!TC[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!_C[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(MC(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[wC];){e[wC]=!0;let t=[LC(e)];for(;t.length>0;){let e=this.visitTick(t);if(MC(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return MC(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=IC;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new CC(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(MC(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[wC];)e[wC]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||EC("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)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(MC(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[wC])return n[wC]=!0,void e.push(LC(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[wC]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[wC]=!0;let t=NC(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[wC]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};UC.registerPostcss=e=>{FC=e};var jC=UC;UC.default=UC,RC.registerLazyResult(UC),kC.registerLazyResult(UC);let BC=Jw,zC=nw,VC=yS,WC=bC;const qC=IS;let KC=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i=zC;this.result=new qC(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new BC(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||VC("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)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=WC;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var GC=KC;KC.default=KC;let ZC=GC,YC=jC,JC=mS,$C=eC,HC=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" 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.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new YC(this,e,t):new ZC(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var XC=HC;HC.default=HC,$C.registerProcessor(HC),JC.registerProcessor(HC);let QC=fw,eI=Iw,tI=Xw,rI=JS,nI=Uw,iI=eC,oI=sC;function sI(e,t){if(Array.isArray(e))return e.map((e=>sI(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:nI.prototype};r.map&&(r.map={...r.map,__proto__:eI.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>sI(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new iI(n);if("decl"===n.type)return new QC(n);if("rule"===n.type)return new oI(n);if("comment"===n.type)return new tI(n);if("atrule"===n.type)return new rI(n);throw new Error("Unknown node type: "+e.type)}var aI=sI;sI.default=sI;let lI=$b,uI=fw,cI=jC,hI=hS,dI=XC,pI=nw,fI=aI,gI=mS,mI=wS,vI=Xw,yI=JS,bI=IS,wI=Uw,SI=bC,CI=rC,II=sC,xI=eC,kI=hw;function EI(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new dI(e)}EI.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new dI).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return EI([i(r)]).process(e,t)},i},EI.stringify=pI,EI.parse=SI,EI.fromJSON=fI,EI.list=CI,EI.comment=e=>new vI(e),EI.atRule=e=>new yI(e),EI.decl=e=>new uI(e),EI.rule=e=>new II(e),EI.root=e=>new xI(e),EI.document=e=>new gI(e),EI.CssSyntaxError=lI,EI.Declaration=uI,EI.Container=hI,EI.Processor=dI,EI.Document=gI,EI.Comment=vI,EI.Warning=mI,EI.AtRule=yI,EI.Result=bI,EI.Input=wI,EI.Rule=II,EI.Root=xI,EI.Node=kI,cI.registerPostcss(EI);var OI=EI;EI.default=EI;const AI=Bb(OI);AI.stringify,AI.fromJSON,AI.plugin,AI.parse,AI.list,AI.document,AI.comment,AI.atRule,AI.rule,AI.decl,AI.root,AI.CssSyntaxError,AI.Declaration,AI.Container,AI.Processor,AI.Document,AI.Comment,AI.Warning,AI.AtRule,AI.Result,AI.Input,AI.Rule,AI.Root,AI.Node;var RI=Object.defineProperty,PI=(e,t,r)=>((e,t,r)=>t in e?RI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function TI(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _I(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var MI={exports:{}},NI=String,LI=function(){return{isColorSupported:!1,reset:NI,bold:NI,dim:NI,italic:NI,underline:NI,inverse:NI,hidden:NI,strikethrough:NI,black:NI,red:NI,green:NI,yellow:NI,blue:NI,magenta:NI,cyan:NI,white:NI,gray:NI,bgBlack:NI,bgRed:NI,bgGreen:NI,bgYellow:NI,bgBlue:NI,bgMagenta:NI,bgCyan:NI,bgWhite:NI}};MI.exports=LI(),MI.exports.createColors=LI;var DI=MI.exports;const FI=_I(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let UI=DI,jI=FI,BI=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=UI.isColorSupported),jI&&e&&(t=jI(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=UI.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var zI=BI;BI.default=BI;var VI={};VI.isClean=Symbol("isClean"),VI.my=Symbol("my");const WI={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let qI=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="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");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return WI[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=WI[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(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)}};var KI=qI;qI.default=qI;let GI=KI;function ZI(e,t){new GI(t).stringify(e)}var YI=ZI;ZI.default=ZI;let{isClean:JI,my:$I}=VI,HI=zI,XI=KI,QI=YI;function ex(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>ex(e,r))):("object"===o&&null!==i&&(i=ex(i)),r[n]=i)}return r}let tx=class{constructor(e={}){this.raws={},this[JI]=!1,this[$I]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=ex(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new HI(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[JI]){this[JI]=!1;let e=this;for(;e=e.parent;)e[JI]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new XI).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=QI){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var rx=tx;tx.default=tx;let nx=rx,ix=class extends nx{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var ox=ix;ix.default=ix;var sx={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:ax,SourceMapGenerator:lx}=FI,{existsSync:ux,readFileSync:cx}=FI,{dirname:hx,join:dx}=FI;let px=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=hx(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ax(this.text)),this.consumerCache}decodeInline(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;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=hx(e),ux(e))return this.mapFile=e,cx(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof ax)return lx.fromSourceMap(t).toString();if(t instanceof lx)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=dx(hx(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var fx=px;px.default=px;let{SourceMapConsumer:gx,SourceMapGenerator:mx}=FI,{fileURLToPath:vx,pathToFileURL:yx}=FI,{isAbsolute:bx,resolve:wx}=FI,{nanoid:Sx}=sx,Cx=FI,Ix=zI,xx=fx,kx=Symbol("fromOffsetCache"),Ex=Boolean(gx&&mx),Ox=Boolean(wx&&bx),Ax=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Ox||/^\w+:\/\//.test(t.from)||bx(t.from)?this.file=t.from:this.file=wx(t.from)),Ox&&Ex){let e=new xx(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Sx(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new Ix(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Ix(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(yx&&(i.input.url=yx(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[kx])r=this[kx];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[kx]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:wx(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=bx(a.source)?yx(a.source):new URL(a.source,this.map.consumer().sourceRoot||yx(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!vx)throw new Error("file: protocol is not available in this PostCSS build");l.file=vx(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Rx=Ax;Ax.default=Ax,Cx&&Cx.registerInput&&Cx.registerInput(Ax);let{SourceMapConsumer:Px,SourceMapGenerator:Tx}=FI,{dirname:_x,relative:Mx,resolve:Nx,sep:Lx}=FI,{pathToFileURL:Dx}=FI,Fx=Rx,Ux=Boolean(Px&&Tx),jx=Boolean(_x&&Nx&&Mx&&Lx);var Bx=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;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";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||_x(e.file);!1===this.mapOpts.sourcesContent?(t=new Px(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),jx&&Ux&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Tx.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Tx({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>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Tx({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?_x(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=_x(Nx(r,this.mapOpts.annotation)));let n=Mx(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new Fx(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(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))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Dx){let t=Dx(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Lx&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let zx=rx,Vx=class extends zx{constructor(e){super(e),this.type="comment"}};var Wx=Vx;Vx.default=Vx;let qx,Kx,Gx,Zx,{isClean:Yx,my:Jx}=VI,$x=ox,Hx=Wx,Xx=rx;function Qx(e){return e.map((e=>(e.nodes&&(e.nodes=Qx(e.nodes)),delete e.source,e)))}function ek(e){if(e[Yx]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ek(t)}let tk=class e extends Xx{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Qx(qx(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new $x(t)]}else if(t.selector)t=[new Kx(t)];else if(t.name)t=[new Gx(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Hx(t)]}return t.map((t=>(t[Jx]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Yx]&&ek(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};tk.registerParse=e=>{qx=e},tk.registerRule=e=>{Kx=e},tk.registerAtRule=e=>{Gx=e},tk.registerRoot=e=>{Zx=e};var rk=tk;tk.default=tk,tk.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Gx.prototype):"rule"===e.type?Object.setPrototypeOf(e,Kx.prototype):"decl"===e.type?Object.setPrototypeOf(e,$x.prototype):"comment"===e.type?Object.setPrototypeOf(e,Hx.prototype):"root"===e.type&&Object.setPrototypeOf(e,Zx.prototype),e[Jx]=!0,e.nodes&&e.nodes.forEach((e=>{tk.rebuild(e)}))};let nk,ik,ok=rk,sk=class extends ok{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new nk(new ik,this,e).stringify()}};sk.registerLazyResult=e=>{nk=e},sk.registerProcessor=e=>{ik=e};var ak=sk;sk.default=sk;let lk={};var uk=function(e){lk[e]||(lk[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ck=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){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}};var hk=ck;ck.default=ck;let dk=hk,pk=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new dk(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var fk=pk;pk.default=pk;const gk="'".charCodeAt(0),mk='"'.charCodeAt(0),vk="\\".charCodeAt(0),yk="/".charCodeAt(0),bk="\n".charCodeAt(0),wk=" ".charCodeAt(0),Sk="\f".charCodeAt(0),Ck="\t".charCodeAt(0),Ik="\r".charCodeAt(0),xk="[".charCodeAt(0),kk="]".charCodeAt(0),Ek="(".charCodeAt(0),Ok=")".charCodeAt(0),Ak="{".charCodeAt(0),Rk="}".charCodeAt(0),Pk=";".charCodeAt(0),Tk="*".charCodeAt(0),_k=":".charCodeAt(0),Mk="@".charCodeAt(0),Nk=/[\t\n\f\r "#'()/;[\\\]{}]/g,Lk=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Dk=/.[\r\n"'(/\\]/,Fk=/[\da-f]/i;let Uk=rk,jk=class extends Uk{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Bk=jk;jk.default=jk,Uk.registerAtRule(jk);let zk,Vk,Wk=rk,qk=class extends Wk{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new zk(new Vk,this,e).stringify()}};qk.registerLazyResult=e=>{zk=e},qk.registerProcessor=e=>{Vk=e};var Kk=qk;qk.default=qk,Wk.registerRoot(qk);let Gk={comma:e=>Gk.split(e,[","],!0),space:e=>Gk.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var Zk=Gk;Gk.default=Gk;let Yk=rk,Jk=Zk,$k=class extends Yk{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Jk.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Hk=$k;$k.default=$k,Yk.registerRule($k);let Xk=ox,Qk=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case bk:case wk:case Ck:case Ik:case Sk:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===wk||r===bk||r===Ck||r===Ik||r===Sk);h=["space",d.slice(g,n)],g=n-1;break;case xk:case kk:case Ak:case Rk:case _k:case Pk:case Ok:{let e=String.fromCharCode(r);h=[e,e,g];break}case Ek:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==gk&&c!==mk&&c!==wk&&c!==bk&&c!==Ck&&c!==Sk&&c!==Ik){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===vk;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||Dk.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case gk:case mk:i=r===gk?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===vk;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Mk:Nk.lastIndex=g+1,Nk.test(d),n=0===Nk.lastIndex?d.length-1:Nk.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case vk:for(n=g,s=!0;d.charCodeAt(n+1)===vk;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==yk&&r!==wk&&r!==bk&&r!==Ck&&r!==Ik&&r!==Sk&&(n+=1,Fk.test(d.charAt(n)))){for(;Fk.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===wk&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===yk&&d.charCodeAt(g+1)===Tk?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(Lk.lastIndex=g+1,Lk.test(d),n=0===Lk.lastIndex?d.length-1:Lk.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},eE=Wx,tE=Bk,rE=Kk,nE=Hk;const iE={empty:!0,space:!0};var oE=class{constructor(e){this.input=e,this.root=new rE,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,i=new tE;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?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){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.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=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new eE;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Qk(this.input)}decl(e,t){let r=new Xk;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new nE;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(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)}endFile(){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())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(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)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[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()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",iE[a]||iE[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new nE;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let sE=rk,aE=oE,lE=Rx;function uE(e,t){let r=new lE(e,t),n=new aE(r);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}var cE=uE;uE.default=uE,sE.registerParse(uE);let{isClean:hE,my:dE}=VI,pE=Bx,fE=YI,gE=rk,mE=ak,vE=uk,yE=fk,bE=cE,wE=Kk;const SE={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},CE={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},IE={Once:!0,postcssPlugin:!0,prepare:!0};function xE(e){return"object"==typeof e&&"function"==typeof e.then}function kE(e){let t=!1,r=SE[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function EE(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:kE(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function OE(e){return e[hE]=!1,e.nodes&&e.nodes.forEach((e=>OE(e))),e}let AE={},RE=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof yE)i=OE(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=bE;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[dE]&&gE.rebuild(i)}else i=OE(r);this.result=new yE(t,i,n),this.helpers={...AE,postcss:AE,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!CE[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!IE[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(xE(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[hE];){e[hE]=!0;let t=[EE(e)];for(;t.length>0;){let e=this.visitTick(t);if(xE(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return xE(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=fE;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new pE(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(xE(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[hE];)e[hE]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||vE("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)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(xE(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[hE])return n[hE]=!0,void e.push(EE(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[hE]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[hE]=!0;let t=kE(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[hE]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};RE.registerPostcss=e=>{AE=e};var PE=RE;RE.default=RE,wE.registerLazyResult(RE),mE.registerLazyResult(RE);let TE=Bx,_E=YI,ME=uk,NE=cE;const LE=fk;let DE=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i=_E;this.result=new LE(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new TE(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||ME("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)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=NE;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var FE=DE;DE.default=DE;let UE=FE,jE=PE,BE=ak,zE=Kk,VE=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" 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.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new jE(this,e,t):new UE(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var WE=VE;VE.default=VE,zE.registerProcessor(VE),BE.registerProcessor(VE);let qE=ox,KE=fx,GE=Wx,ZE=Bk,YE=Rx,JE=Kk,$E=Hk;function HE(e,t){if(Array.isArray(e))return e.map((e=>HE(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:YE.prototype};r.map&&(r.map={...r.map,__proto__:KE.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>HE(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new JE(n);if("decl"===n.type)return new qE(n);if("rule"===n.type)return new $E(n);if("comment"===n.type)return new GE(n);if("atrule"===n.type)return new ZE(n);throw new Error("Unknown node type: "+e.type)}var XE=HE;HE.default=HE;let QE=zI,eO=ox,tO=PE,rO=rk,nO=WE,iO=YI,oO=XE,sO=ak,aO=hk,lO=Wx,uO=Bk,cO=fk,hO=Rx,dO=cE,pO=Zk,fO=Hk,gO=Kk,mO=rx;function vO(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new nO(e)}vO.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new nO).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return vO([i(r)]).process(e,t)},i},vO.stringify=iO,vO.parse=dO,vO.fromJSON=oO,vO.list=pO,vO.comment=e=>new lO(e),vO.atRule=e=>new uO(e),vO.decl=e=>new eO(e),vO.rule=e=>new fO(e),vO.root=e=>new gO(e),vO.document=e=>new sO(e),vO.CssSyntaxError=QE,vO.Declaration=eO,vO.Container=rO,vO.Processor=nO,vO.Document=sO,vO.Comment=lO,vO.Warning=aO,vO.AtRule=uO,vO.Result=cO,vO.Input=hO,vO.Rule=fO,vO.Root=gO,vO.Node=mO,tO.registerPostcss(vO);var yO=vO;vO.default=vO;const bO=TI(yO);bO.stringify,bO.fromJSON,bO.plugin,bO.parse,bO.list,bO.document,bO.comment,bO.atRule,bO.rule,bO.decl,bO.root,bO.CssSyntaxError,bO.Declaration,bO.Container,bO.Processor,bO.Document,bO.Comment,bO.Warning,bO.AtRule,bO.Result,bO.Input,bO.Rule,bO.Root,bO.Node;class wO{constructor(...e){PI(this,"parentElement",null),PI(this,"parentNode",null),PI(this,"ownerDocument"),PI(this,"firstChild",null),PI(this,"lastChild",null),PI(this,"previousSibling",null),PI(this,"nextSibling",null),PI(this,"ELEMENT_NODE",1),PI(this,"TEXT_NODE",3),PI(this,"nodeType"),PI(this,"nodeName"),PI(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof wO))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const SO={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},CO={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},IO={};function xO(e){if(IO[e])return IO[e];const t=globalThis[e],r=t.prototype,n=e in SO?SO[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in CO?CO[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return IO[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?IO[e]=o:r}catch{return r}}const kO={};function EO(e,t,r){var n;const i=`${e}.${String(r)}`;if(kO[i])return kO[i].call(t);const o=xO(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(kO[i]=s,s.call(t)):t[r]}const OO={};function AO(e,t,r){const n=`${e}.${String(r)}`;if(OO[n])return OO[n].bind(t);const i=xO(e)[r];return"function"!=typeof i?t[r]:(OO[n]=i,i.bind(t))}function RO(){return xO("MutationObserver").constructor}const PO={childNodes:function(e){return EO("Node",e,"childNodes")},parentNode:function(e){return EO("Node",e,"parentNode")},parentElement:function(e){return EO("Node",e,"parentElement")},textContent:function(e){return EO("Node",e,"textContent")},contains:function(e,t){return AO("Node",e,"contains")(t)},getRootNode:function(e){return AO("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?EO("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?EO("Element",e,"shadowRoot"):null},querySelector:function(e,t){return EO("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return EO("Element",e,"querySelectorAll")(t)},mutationObserver:RO};function TO(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const _O="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.";let MO={map:{},getId:()=>(console.error(_O),-1),getNode:()=>(console.error(_O),null),removeNodeFromMap(){console.error(_O)},has:()=>(console.error(_O),!1),reset(){console.error(_O)}};function NO(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();i||!1!==r.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)}),a))}}function LO(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>LO(e,t,o||{},!0)}function DO(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(MO=new Proxy(MO,{get:(e,t,r)=>("map"===t&&console.error(_O),Reflect.get(e,t,r))}));let FO=Date.now;function UO(e){var t,r,n,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=PO.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=PO.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function jO(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function BO(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function zO(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:PO.parentElement(e)}function VO(e,t,r,n){if(!e)return!1;const i=zO(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(Lb(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function WO(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function qO(e,t){if(ib(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=PO.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||qO(n,t))}function KO(e){return Boolean(e.changedTouches)}function GO(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function ZO(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function YO(e){return!!e&&(e instanceof wO&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(PO.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(FO=()=>(new Date).getTime());class JO{constructor(){qy(this,"id",1),qy(this,"styleIDMap",new WeakMap),qy(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function $O(e){var t;let r=null;return"getRootNode"in e&&(null==(t=PO.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&PO.host(PO.getRootNode(e))&&(r=PO.host(PO.getRootNode(e))),r}function HO(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=$O(r);)r=t;return r}(e);return PO.contains(t,r)}function XO(e){const t=e.ownerDocument;return!!t&&(PO.contains(t,e)||HO(e))}var QO=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(QO||{}),eA=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(eA||{}),tA=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(tA||{}),rA=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(rA||{}),nA=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(nA||{}),iA=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(iA||{}),oA=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(oA||{});function sA(e){return"__ln"in e}class aA{constructor(){qy(this,"length",0),qy(this,"head",null),qy(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&sA(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&sA(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const 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--)}}const lA=(e,t)=>`${e}@${t}`;class uA{constructor(){qy(this,"frozen",!1),qy(this,"locked",!1),qy(this,"texts",[]),qy(this,"attributes",[]),qy(this,"attributeMap",new WeakMap),qy(this,"removes",[]),qy(this,"mapRemoves",[]),qy(this,"movedMap",{}),qy(this,"addedSet",new Set),qy(this,"movedSet",new Set),qy(this,"droppedSet",new Set),qy(this,"removesSubTreeCache",new Set),qy(this,"mutationCb"),qy(this,"blockClass"),qy(this,"blockSelector"),qy(this,"maskTextClass"),qy(this,"maskTextSelector"),qy(this,"inlineStylesheet"),qy(this,"maskInputOptions"),qy(this,"maskTextFn"),qy(this,"maskInputFn"),qy(this,"keepIframeSrcFn"),qy(this,"recordCanvas"),qy(this,"inlineImages"),qy(this,"slimDOMOptions"),qy(this,"dataURLOptions"),qy(this,"doc"),qy(this,"mirror"),qy(this,"iframeManager"),qy(this,"stylesheetManager"),qy(this,"shadowDomManager"),qy(this,"canvasManager"),qy(this,"processedNodeManager"),qy(this,"unattachedDoc"),qy(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),qy(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new aA,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},i=i=>{const o=PO.parentNode(i);if(!o||!XO(i))return;let s=!1;if(i.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(s=!0)}const a=ib(o)?this.mirror.getId($O(i)):this.mirror.getId(o),l=n(i);if(-1===a||-1===l)return r.addNode(i);const u=jb(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{GO(e,this.mirror)&&this.iframeManager.addIframe(e),ZO(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),YO(i)&&this.shadowDomManager.addShadowRoot(PO.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});u&&(e.push({parentId:a,nextId:l,node:u}),t.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)hA(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(PO.parentNode(e))||i(e);for(const e of this.addedSet)dA(this.droppedSet,e)||hA(this.removesSubTreeCache,e,this.mirror)?dA(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(PO.parentNode(o.value)),r=n(o.value);-1!==t&&-1!==r&&(e=o)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(PO.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=PO.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=PO.host(n);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}o=e.previous,r.removeNode(e.value),i(e.value)}const s={texts:this.texts.map((e=>{const t=e.node,r=PO.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(s))})),qy(this,"genTextAreaValueMutation",(e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(PO.childNodes(e),(e=>PO.textContent(e)||"")).join("");t.attributes.value=ub({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:db(e),value:r,maskInputFn:this.maskInputFn})})),qy(this,"processMutation",(e=>{if(!WO(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=PO.textContent(e.target);VO(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Db(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,zO(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,n=e.target.getAttribute(r);if("value"===r){const e=db(t);n=ub({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(VO(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!Nb(t.tagName,r))if(i.attributes[r]=Mb(this.doc,cb(t.tagName),cb(r),n),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?n:[n,o]:i._unchangedStyles[e]=[n,o]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(VO(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const r=this.mirror.getId(t),n=ib(e.target)?this.mirror.getId(PO.host(e.target)):this.mirror.getId(e.target);VO(e.target,this.blockClass,this.blockSelector,!1)||WO(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(cA(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||qO(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[lA(r,n)]?cA(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!ib(e.target)||!ob(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),PO.childNodes(e).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),qy(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(WO(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[lA(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);VO(e,this.blockClass,this.blockSelector,!1)||(PO.childNodes(e).forEach((e=>this.genAdds(e))),YO(e)&&PO.childNodes(PO.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function cA(e,t){e.delete(t),PO.childNodes(t).forEach((t=>cA(e,t)))}function hA(e,t,r){return 0!==e.size&&function(e,t){const r=PO.parentNode(t);return!!r&&e.has(r)}(e,t)}function dA(e,t){return 0!==e.size&&pA(e,t)}function pA(e,t){const r=PO.parentNode(t);return!!r&&(!!e.has(r)||pA(e,r))}let fA;const gA=e=>{if(!fA)return e;return(...t)=>{try{return e(...t)}catch(e){if(fA&&!0===fA(e))return;throw e}}};function mA(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const vA=[];function yA(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function bA(e,t){const r=new uA;vA.push(r),r.init(e);const n=new(RO())(gA(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function wA({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(tA).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((o=>{let s=cb(o);const u=(t=>o=>{const s=yA(o);if(VO(s,n,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=rA.Mouse;break;case"touch":a=rA.Touch;break;case"pen":a=rA.Pen}a===rA.Touch?tA[t]===tA.MouseDown?u="TouchStart":tA[t]===tA.MouseUp&&(u="TouchEnd"):rA.Pen}else KO(o)&&(a=rA.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===rA.Touch||u.startsWith("Mouse")&&a===rA.Mouse)&&(a=null)):tA[t]===tA.Click&&(a=l,l=null);const c=KO(o)?o.changedTouches[0]:o;if(!c)return;const h=r.getId(s),{clientX:d,clientY:p}=c;gA(e)({type:tA[u],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(tA[o]){case tA.MouseDown:case tA.MouseUp:s=s.replace("mouse","pointer");break;case tA.TouchStart:case tA.TouchEnd:return}a.push(TO(s,u,t))})),gA((()=>{a.forEach((e=>e()))}))}function SA({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const s=gA(NO(gA((o=>{const s=yA(o);if(!s||VO(s,n,i,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=UO(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})})),o.scroll||100));return TO("scroll",s,t)}const CA=["INPUT","TEXTAREA","SELECT"],IA=new WeakMap;function xA(e){return function(e,t){if(AA("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||AA("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||AA("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||AA("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function kA(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function EA({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(PO.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(o=null==(i=r.ownerDocument)?void 0:i.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var r;const n=null==(r=l.set)?void 0:r.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return n}}),gA((()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function OA(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:d,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),c(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(n=bA(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const l=NO(gA((t=>{const r=Date.now()-s;e(a.map((e=>(e.timeOffset-=r,e))),t),a=[],s=null})),o),u=gA(NO(gA((e=>{const t=yA(e),{clientX:r,clientY:i}=KO(e)?e.changedTouches[0]:e;s||(s=FO()),a.push({x:r,y:i,id:n.getId(t),timeOffset:FO()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?eA.Drag:e instanceof MouseEvent?eA.MouseMove:eA.TouchMove)})),i,{trailing:!1})),c=[TO("mousemove",u,r),TO("touchmove",u,r),TO("drag",u,r)];return gA((()=>{c.forEach((e=>e()))}))}(e),o=wA(e),s=SA(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return TO("resize",gA(NO(gA((()=>{const t=jO(),i=BO();r===t&&n===i||(e({width:Number(i),height:Number(t)}),r=t,n=i)})),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(e){let r=yA(e);const u=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=PO.parentElement(r)),!r||!h||CA.indexOf(h)<0||VO(r,n,i,!0))return;if(r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,f=!1;const g=db(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=ub({element:r,maskInputOptions:a,tagName:h,type:g,value:p,maskInputFn:l})),d(r,c?{text:p,isChecked:f,userTriggered:u}:{text:p,isChecked:f});const m=r.name;"radio"===g&&m&&f&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==r){const t=e.value;d(e,c?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}}))}function d(t,n){const i=IA.get(t);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){IA.set(t,n);const i=r.getId(t);gA(e)({...n,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map((e=>TO(e,gA(h),t))),f=t.defaultView;if(!f)return()=>{p.forEach((e=>e()))};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...m.map((e=>LO(e[0],e[1],{set(){gA(h)({target:this,isTrusted:!1})}},!1,f)))),gA((()=>{p.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const s=gA((o=>NO(gA((i=>{const s=yA(i);if(!s||VO(s,t,r,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=s;e({type:o,id:n.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})})),i.media||500))),a=[TO("play",s(iA.Play),o),TO("pause",s(iA.Pause),o),TO("seeked",s(iA.Seeked),o),TO("volumechange",s(iA.VolumeChange),o),TO("ratechange",s(iA.RateChange),o)];return gA((()=>{a.forEach((e=>e()))}))}(e);let c=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(c=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:gA(((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=kA(i,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),mA((()=>n.apply(i,o)))()}))}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const i=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};const o=n.CSSStyleSheet.prototype.deleteRule;let s,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:gA(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=kA(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),mA((()=>n.apply(i,o)))()}))}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:gA(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=kA(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:s}),n.apply(i,o)}))})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:gA(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=kA(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),n.apply(i,o)}))}));const l={};RA("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(RA("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),RA("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),RA("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const u={};return Object.entries(l).forEach((([n,i])=>{u[n]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(u[n].insertRule,{apply:gA(((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=kA(i.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...xA(i),a||0]}]}),n.apply(i,o)}))}),i.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:gA(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=kA(i.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...xA(i),s]}]}),n.apply(i,o)}))})})),gA((()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach((([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule}))}))}(e,{win:r}),h=EA(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:gA(((i,s,a)=>{var l;const[u,c,h]=a;if(r.has(u))return o.apply(s,[u,c,h]);const{id:d,styleId:p}=kA(null==(l=s.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:u,value:c,priority:h},index:xA(s.parentRule)}),i.apply(s,a)}))});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:gA(((i,o,a)=>{var l;const[u]=a;if(r.has(u))return s.apply(o,[u]);const{id:c,styleId:h}=kA(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||h&&-1!==h)&&e({id:c,styleId:h,remove:{property:u},index:xA(o.parentRule)}),i.apply(o,a)}))}),gA((()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s}))}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const n=new o(e,t,r);return i.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const s=DO(t.fonts,"add",(function(t){return function(r){return setTimeout(gA((()=>{const t=i.get(r);t&&(e(t),i.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{r.FontFace=o})),n.push(s),gA((()=>{n.forEach((e=>e()))}))}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e;let s=!0;const a=gA((()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:u,endOffset:c}=o;VO(s,n,i,!0)||VO(u,n,i,!0)||a.push({start:r.getId(s),startOffset:l,end:r.getId(u),endOffset:c})}o({ranges:a})}));return a(),TO("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?DO(r.customElements,"define",(function(e){return function(r,n,i){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,i])}})):()=>{}}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,r,t.options));return gA((()=>{vA.forEach((e=>e.reset())),null==n||n.disconnect(),i(),o(),s(),a(),l(),u(),c(),h(),d(),p(),f(),g(),m.forEach((e=>e()))}))}function AA(e){return void 0!==window[e]}function RA(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class PA{constructor(e){qy(this,"iframeIdToRemoteIdMap",new WeakMap),qy(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const i=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=n.get(t);return i||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class TA{constructor(e){qy(this,"iframes",new WeakMap),qy(this,"crossOriginIframeMap",new WeakMap),qy(this,"crossOriginIframeMirror",new PA(xb)),qy(this,"crossOriginIframeStyleMirror"),qy(this,"crossOriginIframeRootIdMap",new WeakMap),qy(this,"mirror"),qy(this,"mutationCb"),qy(this,"wrappedEmit"),qy(this,"loadListener"),qy(this,"stylesheetManager"),qy(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new PA(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case QO.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:QO.IncrementalSnapshot,data:{source:eA.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case QO.Meta:case QO.Load:case QO.DomContentLoaded:return!1;case QO.Plugin:return t;case QO.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case QO.IncrementalSnapshot:switch(t.data.source){case eA.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case eA.Drag:case eA.TouchMove:case eA.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case eA.ViewportResize:return!1;case eA.MediaInteraction:case eA.MouseInteraction:case eA.Scroll:case eA.CanvasMutation:case eA.Input:return this.replaceIds(t.data,e,["id"]),t;case eA.StyleSheetRule:case eA.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case eA.Font:return t;case eA.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case eA.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(const i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===oA.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class _A{constructor(e){qy(this,"shadowDoms",new WeakSet),qy(this,"mutationCb"),qy(this,"scrollCb"),qy(this,"bypassOptions"),qy(this,"mirror"),qy(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!ob(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=bA({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(SA({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(PO.host(e))),this.restoreHandlers.push(EA({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(DO(e.prototype,"attachShadow",(function(e){return function(n){const i=e.call(this,n),o=PO.shadowRoot(this);return o&&XO(this)&&r.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var MA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",NA="undefined"==typeof Uint8Array?[]:new Uint8Array(256),LA=0;LA<64;LA++)NA[MA.charCodeAt(LA)]=LA;const DA=new Map;const FA=(e,t,r)=>{if(!e||!BA(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=DA.get(e);return r||(r=new Map,DA.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i};function UA(e,t,r){if(e instanceof Array)return e.map((e=>UA(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=MA[r[t]>>2],i+=MA[(3&r[t])<<4|r[t+1]>>4],i+=MA[(15&r[t+1])<<2|r[t+2]>>6],i+=MA[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[UA(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[UA(e.data,t,r),e.width,e.height]}}if(BA(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:FA(e,t,r)}}return e}const jA=(e,t,r)=>e.map((e=>UA(e,t,r))),BA=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function zA(e,t,r,n){const i=[];try{const o=DO(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i,...o){if(!VO(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}}));i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function VA(e,t,r,n,i,o){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=DO(e,l,(function(e){return function(...s){const a=e.apply(this,s);if(FA(a,o,this),"tagName"in this.canvas&&!VO(this.canvas,n,i,!0)){const e=jA(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}}));s.push(a)}catch{const n=LO(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(n)}return s}const WA="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",qA="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))(WA)],{type:"text/javascript;charset=utf-8"});function KA(e){let t;try{if(t=qA&&(window.URL||window.webkitURL).createObjectURL(qA),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+WA,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class GA{constructor(e){qy(this,"pendingCanvasMutations",new Map),qy(this,"rafStamps",{latestId:0,invokeId:null}),qy(this,"mirror"),qy(this,"mutationCb"),qy(this,"resetObservers"),qy(this,"frozen",!1),qy(this,"locked",!1),qy(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));const{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,n,i){const o=zA(t,r,n,!0),s=new Map,a=new KA;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:i,height:o}=e.data;this.mutationCb({id:t,type:nA["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let u,c=0;const h=e=>{c&&e-c<l||(c=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{VO(t,r,n,!0)||e.push(t)})),e})().forEach((async e=>{var t;const r=this.mirror.getId(e);if(s.get(r))return;if(0===e.width||0===e.height)return;if(s.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const n=await createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[n])}))),u=requestAnimationFrame(h)};u=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=zA(e,t,r,!1),i=function(e,t,r,n){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=DO(t.CanvasRenderingContext2D.prototype,s,(function(i){return function(...o){return VO(this.canvas,r,n,!0)||setTimeout((()=>{const r=jA(o,t,this);e(this.canvas,{type:nA["2D"],property:s,args:r})}),0),i.apply(this,o)}}));i.push(o)}catch{const r=LO(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:nA["2D"],property:s,args:[t],setter:!0})}});i.push(r)}return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){const i=[];return i.push(...VA(t.WebGLRenderingContext.prototype,nA.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...VA(t.WebGL2RenderingContext.prototype,nA.WebGL2,e,r,n,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map((e=>{const{type:t,...r}=e;return r})),{type:i}=r[0];this.mutationCb({id:t,type:i,commands:n}),this.pendingCanvasMutations.delete(e)}}class ZA{constructor(e){qy(this,"trackedLinkElements",new WeakSet),qy(this,"mutationCb"),qy(this,"adoptedStyleSheetCb"),qy(this,"styleMirror",new JO),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:ab(e,t.href),index:r})))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class YA{constructor(){qy(this,"nodeMap",new WeakMap),qy(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let JA,$A,HA,XA=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(zy=e.contentWindow)?void 0:zy.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const QA=new lb;function eR(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:g,hooks:m,packFn:v,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:k=!1,collectFonts:E=!1,inlineImages:O=!1,plugins:A,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:T,applyBackgroundColorToBlockedElements:_=!1}=e;fA=T;const M=!I||window.parent===window;let N=!1;if(!M)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(M&&!t)throw new Error("emit function is required");if(!M&&!N)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),QA.reset();const L=!0===h?{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!==d?d:{password:!0},D=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let F;!function(e=window){"NodeList"in e&&!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)}();let U=0;const j=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!N&&(e=v(e)),e};JA=(e,i)=>{var o;const s=e;if(s.timestamp=FO(),!(null==(o=vA[0])?void 0:o.isFrozen())||s.type===QO.FullSnapshot||s.type===QO.IncrementalSnapshot&&s.data.source===eA.Mutation||vA.forEach((e=>e.unfreeze())),M)null==t||t(j(s),i);else if(N){const e={type:"rrweb",event:j(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===QO.FullSnapshot)F=s,U=0;else if(s.type===QO.IncrementalSnapshot){if(s.data.source===eA.Mutation&&s.data.isAttachIframe)return;U++;const e=n&&U>=n,t=r&&s.timestamp-F.timestamp>r;(e||t)&&$A(!0)}};const B=e=>{JA({type:QO.IncrementalSnapshot,data:{source:eA.Mutation,...e}})},z=e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.Scroll,...e}}),V=e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.CanvasMutation,...e}}),W=new ZA({mutationCb:B,adoptedStyleSheetCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.AdoptedStyleSheet,...e}})}),q=new TA({mirror:QA,mutationCb:B,stylesheetManager:W,recordCrossOriginIframes:I,wrappedEmit:JA});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:QA,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});const K=new YA;HA=new GA({recordCanvas:C,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:QA,sampling:y.canvas,dataURLOptions:b});const G=new _A({mutationCb:B,scrollCb:z,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:L,dataURLOptions:b,maskTextFn:g,maskInputFn:f,recordCanvas:C,inlineImages:O,sampling:y,slimDOMOptions:D,iframeManager:q,stylesheetManager:W,canvasManager:HA,keepIframeSrcFn:R,processedNodeManager:K},mirror:QA});$A=(e=!1)=>{if(!S)return;JA({type:QO.Meta,data:{href:window.location.href,width:BO(),height:jO()}},e),W.reset(),G.init(),vA.forEach((e=>e.lock()));const t=function(e,t){const{mirror:r=new lb,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:d,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:S=()=>!1,applyBackgroundColorToBlockedElements:C=!1}=t||{};return jb(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{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===c?{password:!0}:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:S,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:C})}(document,{mirror:QA,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:L,maskTextFn:g,maskInputFn:f,slimDOM:D,dataURLOptions:b,recordCanvas:C,inlineImages:O,applyBackgroundColorToBlockedElements:_,onSerialize:e=>{GO(e,QA)&&q.addIframe(e),ZO(e,QA)&&W.trackLinkElement(e),YO(e)&&G.addShadowRoot(PO.shadowRoot(e),document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{W.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");JA({type:QO.FullSnapshot,data:{node:t,initialOffset:UO(window)}},e),vA.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,QA.getId(document))};try{const e=[],t=e=>{var t;return gA(OA)({mutationCb:B,mousemoveCb:(e,t)=>JA({type:QO.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.ViewportResize,...e}}),inputCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.Input,...e}}),mediaInteractionCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.MediaInteraction,...e}}),styleSheetRuleCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.StyleSheetRule,...e}}),styleDeclarationCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.Font,...e}}),selectionCb:e=>{JA({type:QO.IncrementalSnapshot,data:{source:eA.Selection,...e}})},customElementCb:e=>{JA({type:QO.IncrementalSnapshot,data:{source:eA.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:L,inlineStylesheet:c,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:O,userTriggeredOnInput:k,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:D,dataURLOptions:b,mirror:QA,iframeManager:q,stylesheetManager:W,shadowDomManager:G,processedNodeManager:K,canvasManager:HA,ignoreCSSAttributes:P,plugins:(null==(t=null==A?void 0:A.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>JA({type:QO.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};q.addLoadListener((r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}}));const r=()=>{$A(),e.push(t(document)),XA=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(TO("DOMContentLoaded",(()=>{JA({type:QO.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&r()}))),e.push(TO("load",(()=>{JA({type:QO.Load,data:{}}),"load"===x&&r()}),window))),()=>{e.forEach((e=>e())),K.destroy(),XA=!1,fA=void 0}}catch(e){console.warn(e)}}var tR;eR.addCustomEvent=(e,t)=>{if(!XA)throw new Error("please add custom event after start recording");JA({type:QO.Custom,data:{tag:e,payload:t}})},eR.freezePage=()=>{vA.forEach((e=>e.freeze()))},eR.takeFullSnapshot=e=>{if(!XA)throw new Error("please take full snapshot after start recording");$A(e)},eR.mirror=QA,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(tR||(tR={}));var rR=Object.freeze({__proto__:null,record:eR}),nR=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e){this.eventCallback=e,this.observeFetch()},e.prototype.stop=function(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0},e.prototype.notifyEvent=function(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=E();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return a(e,void 0,void 0,(function(){var e,i,o,s,a,u,c;return l(this,(function(l){switch(l.label){case 0:e=Date.now(),i={timestamp:e,type:"fetch",method:(null==n?void 0:n.method)||"GET",url:t.toString(),requestHeaders:null==n?void 0:n.headers},l.label=1;case 1:return l.trys.push([1,3,,4]),[4,r(t,n)];case 2:return o=l.sent(),u=Date.now(),i.status=o.status,i.duration=u-e,s={},o.headers.forEach((function(e,t){s[t]=e})),i.responseHeaders=s,this.notifyEvent(i),[2,o];case 3:throw a=l.sent(),u=Date.now(),i.duration=u-e,c=a,i.error={name:c.name||"UnknownError",message:c.message||"An unknown error occurred"},this.notifyEvent(i),a;case 4:return[2]}}))}))},this.fetchObserver=function(){t.fetch=r})}},e}(),iR=Object.freeze({__proto__:null,NetworkObservers:nR});e.Types=Qi,e.add=Vu,e.createInstance=Fu,e.experiment=Bu,e.extendSession=Wu,e.flush=qu,e.getDeviceId=Ku,e.getSessionId=Gu,e.getUserId=Zu,e.groupIdentify=Yu,e.identify=Ju,e.initAll=ju,e.logEvent=$u,e.remove=Hu,e.reset=Xu,e.revenue=Qu,e.sessionReplay=zu,e.setDeviceId=ec,e.setGroup=tc,e.setOptOut=rc,e.setSessionId=nc,e.setTransport=ic,e.setUserId=oc,e.track=sc,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).amplitude={})}(this,(function(e){"use strict";var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};function r(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n,i,o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function a(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function l(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function u(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function h(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function d(e){return this instanceof d?(this.v=e,this):new d(e)}function p(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",(function(e){return function(t){return Promise.resolve(t).then(e,u)}})),n[Symbol.asyncIterator]=function(){return this},n;function s(e,t){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||a(e,t)}))},t&&(n[e]=t(n[e])))}function a(e,t){try{(r=i[e](t)).value instanceof d?Promise.resolve(r.value.v).then(l,u):c(o[0][2],r)}catch(e){c(o[0][3],e)}var r}function l(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=u(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(n||(n={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(i||(i={}));var g,m="AMP",v="".concat(m,"_unsent"),y="https://api2.amplitude.com/2/httpapi",b=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!w(t,r))return!1}return!0},w=function(e,t){var r,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=u(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&b(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(null==t)return!1;if("object"==typeof t)return b(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},S=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return o({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(g.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(g.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(g.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(g.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(g.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(g.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(g.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(g.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(g.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[g.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,r){if(this._validate(e,t,r)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=r,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,r){return void 0===this._properties[g.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===g.ADD?"number"==typeof r:e===g.UNSET||e===g.REMOVE||w(t,r)))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(g||(g={}));var C,I=[g.CLEAR_ALL,g.UNSET,g.SET,g.SET_ONCE,g.ADD,g.APPEND,g.PREPEND,g.PREINSERT,g.POSTINSERT,g.REMOVE];!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(C||(C={}));var x,k=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=C.Unknown),{event:e,code:t,message:r}},E=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},O=h([],c(Array(256).keys()),!1).map((function(e){return e.toString(16).padStart(2,"0")})),A=function(e){var t,r=E();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,A)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,h([],c(n.entries()),!1).map((function(e){var t=c(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(O[n]):O[n]})).join("")},R=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){var r,n;return a(this,void 0,void 0,(function(){return l(this,(function(i){switch(i.label){case 0:return this.plugins.some((function(t){return t.name===e.name}))?(t.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2]):(void 0===e.name&&(e.name=A(),t.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!==(r=e.type)&&void 0!==r?r:"enrichment",[4,null===(n=e.setup)||void 0===n?void 0:n.call(e,t,this.client)]);case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e,t){var r;return a(this,void 0,void 0,(function(){var n,i;return l(this,(function(o){switch(o.label){case 0:return n=this.plugins.findIndex((function(t){return t.name===e})),-1===n?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[n],this.plugins.splice(n,1),[4,null===(r=i.teardown)||void 0===r?void 0:r.call(i)]);case 1:return o.sent(),[2]}}))}))},e.prototype.reset=function(e){this.applying=!1,this.plugins.map((function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)})),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise((function(r){t.queue.push([e,r]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,s,a,h,d,p,f,g,m,v,y,b,w,S,C,I,x;return l(this,(function(l){switch(l.label){case 0:if(!e)return[2];t=c(e,1),r=t[0],n=c(e,2),i=n[1],s=this.plugins.filter((function(e){return"before"===e.type})),l.label=1;case 1:l.trys.push([1,6,7,8]),a=u(s),h=a.next(),l.label=2;case 2:return h.done?[3,5]:(m=h.value).execute?[4,m.execute(o({},r))]:[3,4];case 3:if(null===(v=l.sent()))return i({event:r,code:0,message:""}),[2];r=v,l.label=4;case 4:return h=a.next(),[3,2];case 5:return[3,8];case 6:return d=l.sent(),S={error:d},[3,8];case 7:try{h&&!h.done&&(C=a.return)&&C.call(a)}finally{if(S)throw S.error}return[7];case 8:p=this.plugins.filter((function(e){return"enrichment"===e.type||void 0===e.type})),l.label=9;case 9:l.trys.push([9,14,15,16]),f=u(p),g=f.next(),l.label=10;case 10:return g.done?[3,13]:(m=g.value).execute?[4,m.execute(o({},r))]:[3,12];case 11:if(null===(v=l.sent()))return i({event:r,code:0,message:""}),[2];r=v,l.label=12;case 12:return g=f.next(),[3,10];case 13:return[3,16];case 14:return y=l.sent(),I={error:y},[3,16];case 15:try{g&&!g.done&&(x=f.return)&&x.call(f)}finally{if(I)throw I.error}return[7];case 16:return b=this.plugins.filter((function(e){return"destination"===e.type})),w=b.map((function(e){var t=o({},r);return e.execute(t).catch((function(e){return k(t,0,String(e))}))})),Promise.all(w).then((function(e){var t=c(e,1)[0]||k(r,100,"Event not tracked, no destination plugins on the instance");i(t)})),[2]}}))}))},e.prototype.flush=function(){return a(this,void 0,void 0,(function(){var e,t,r,n=this;return l(this,(function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return i.sent(),t=this.plugins.filter((function(e){return"destination"===e.type})),r=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(r)];case 2:return i.sent(),[2]}}))}))},e.prototype.onIdentityChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onIdentityChanged)||void 0===r||r.call(t,e)}))},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onSessionIdChanged)||void 0===r||r.call(t,e)}))},e.prototype.onOptOutChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onOptOutChanged)||void 0===r||r.call(t,e)}))},e}(),P=function(e,t){return o(o({},t),{event_type:i.IDENTIFY,user_properties:e.getUserProperties()})},T=function(e){return{promise:e||Promise.resolve()}},_=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new R(this),this.name=e}return e.prototype._init=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o,s,a,c;return l(this,(function(l){switch(l.label){case 0:t=this[e],this[e]=[],l.label=1;case 1:l.trys.push([1,8,9,10]),r=u(t),n=r.next(),l.label=2;case 2:return n.done?[3,7]:(i=n.value,(o=i())&&"promise"in o?[4,o.promise]:[3,4]);case 3:return l.sent(),[3,6];case 4:return[4,o];case 5:l.sent(),l.label=6;case 6:return n=r.next(),[3,2];case 7:return[3,10];case 8:return s=l.sent(),a={error:s},[3,10];case 9:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(a)throw a.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:l.sent(),l.label=12;case 12:return[2]}}))}))},e.prototype.track=function(e,t,r){var n=function(e,t,r){return o(o(o({},"string"==typeof e?{event_type:e}:e),r),t&&{event_properties:t})}(e,t,r);return T(this.dispatch(n))},e.prototype.identify=function(e,t){var r=P(e,t);return T(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var s=function(e,t,r,n){var s;return o(o({},n),{event_type:i.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(s={},s[e]=t,s)})}(e,t,r,n);return T(this.dispatch(s))},e.prototype.setGroup=function(e,t,r){var n=function(e,t,r){var n,s=new S;return s.set(e,t),o(o({},r),{event_type:i.IDENTIFY,user_properties:s.getUserProperties(),groups:(n={},n[e]=t,n)})}(e,t,r);return T(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=function(e,t){return o(o({},t),{event_type:i.REVENUE,event_properties:e.getEventProperties()})}(e,t);return T(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),T())},e.prototype._addPlugin=function(e){return T(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),T())},e.prototype._removePlugin=function(e){return T(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(k(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return a(this,void 0,void 0,(function(){var t=this;return l(this,(function(r){return this.isReady?[2,this.process(e)]:[2,new Promise((function(r){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,r))}))]}))}))},e.prototype.getOperationAppliedUserProperties=function(e){var t={};if(void 0===e)return t;var r={};return Object.keys(e).forEach((function(t){Object.values(n).includes(t)||(r[t]=e[t])})),I.forEach((function(r){if(Object.keys(e).includes(r)){var i=e[r];switch(r){case n.CLEAR_ALL:Object.keys(t).forEach((function(e){delete t[e]}));break;case n.UNSET:Object.keys(i).forEach((function(e){delete t[e]}));break;case n.SET:Object.assign(t,i)}}})),Object.assign(t,r),t},e.prototype.process=function(e){return a(this,void 0,void 0,(function(){var t,r,n,o;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),this.config.optOut?[2,k(e,0,"Event skipped due to optOut config")]:(e.event_type===i.IDENTIFY&&(t=this.getOperationAppliedUserProperties(e.user_properties),this.timeline.onIdentityChanged({userProperties:t})),[4,this.timeline.push(e)]);case 1:return 200===(o=s.sent()).code?this.config.loggerProvider.log(o.message):100===o.code?this.config.loggerProvider.warn(o.message):this.config.loggerProvider.error(o.message),[2,o];case 2:return r=s.sent(),n=String(r),this.config.loggerProvider.error(n),[2,o=k(e,0,n)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.timeline.onOptOutChanged(e),this.config.optOut=Boolean(e))},e.prototype.flush=function(){return T(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find((function(t){return t.name===e}));if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e.prototype.plugins=function(e){return this.timeline.plugins.filter((function(t){return t instanceof e}))},e}(),M=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){return b(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?o({},this.properties):{};return e[x.REVENUE_PRODUCT_ID]=this.productId,e[x.REVENUE_QUANTITY]=this.quantity,e[x.REVENUE_PRICE]=this.price,e[x.REVENUE_TYPE]=this.revenueType,e[x.REVENUE_CURRENCY]=this.currency,e[x.REVENUE]=this.revenue,e[x.RECEIPT]=this.receipt,e[x.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}(x||(x={}));var N;!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(N||(N={}));var L="Amplitude Logger ",D=function(){function e(){this.logLevel=N.None}return e.prototype.disable=function(){this.logLevel=N.None},e.prototype.enable=function(e){void 0===e&&(e=N.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<N.Verbose||console.log("".concat(L,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<N.Warn||console.warn("".concat(L,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<N.Error||console.error("".concat(L,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<N.Debug||console.log("".concat(L,"[Debug]: ").concat(e.join(" ")))},e}(),F=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:N.Warn,loggerProvider:new D,offline:!1,optOut:!1,serverUrl:y,serverZone:"US",useBatch:!1}},U=function(){function e(e){var t,r,n,i;this._optOut=!1;var o=F();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=B(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),j=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":y},B=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=F().serverZone),void 0===r&&(r=F().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:F().serverZone;return{serverZone:n,serverUrl:j(n,r)}},z=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function V(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var W=function(){function e(){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[]}return e.prototype.setup=function(e){var t;return a(this,void 0,void 0,(function(){var r,n=this;return l(this,(function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(v,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(r=i.sent())&&r.length>0&&Promise.all(r.map((function(e){return n.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=A()),new Promise((function(r){var n={event:e,attempts:0,callback:function(e){return r(e)},timeout:0};t.queue.push(n),t.schedule(t.config.flushIntervalMillis),t.saveEvents()}))},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter((function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)}))},e.prototype.scheduleEvents=function(e){var t=this;e.forEach((function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)}))},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout((function(){t.queue=t.queue.map((function(e){return e.timeout=0,e})),t.flush(!0)}),e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){var t,r,n,i=this;return l(this,(function(o){switch(o.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],r=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):r.push(e)})),s=t,u=this.config.flushQueueSize,c=Math.max(u,1),n=s.reduce((function(e,t,r){var n=Math.floor(r/c);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,n.reduce((function(t,r){return a(i,void 0,void 0,(function(){return l(this,(function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve())]);case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}var s,u,c}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),a(this,void 0,void 0,(function(){var r,n,i,o,a;return l(this,(function(l){switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,s(t,["extra"])})),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new z,l.label=1;case 1:return l.trys.push([1,3,,4]),n=B(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(n,r)];case 2:return null===(i=l.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(i,e),[3,4]):("body"in i?this.fulfillRequest(e,i.statusCode,"".concat(i.status,": ").concat(V(i))):this.fulfillRequest(e,i.statusCode,i.status),[2]);case 3:return o=l.sent(),a=(u=o)instanceof Error?u.message:String(u),this.config.loggerProvider.error(a),this.handleResponse({status:C.Failed,statusCode:0},e),[3,4];case 4:return[2]}var u}))}))},e.prototype.handleResponse=function(e,t){var r=e.status;switch(r){case C.Success:this.handleSuccessResponse(e,t);break;case C.Invalid:this.handleInvalidResponse(e,t);break;case C.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case C.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var r=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=h(h(h(h([],c(Object.values(e.body.eventsWithInvalidFields)),!1),c(Object.values(e.body.eventsWithMissingFields)),!1),c(Object.values(e.body.eventsWithInvalidIdLengths)),!1),c(e.body.silencedEvents),!1).flat(),i=new Set(n),o=t.filter((function(t,n){if(!i.has(n))return!0;r.fulfillRequest([t],e.statusCode,e.body.error)}));o.length>0&&this.config.loggerProvider.warn(V(e));var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(V(e)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(r)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var r=this,n=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),a=new Set(i),l=new Set(o),u=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return l.has(n)&&(t.timeout=r.throttleTimeout),!0;r.fulfillRequest([t],e.statusCode,e.body.error)}));u.length>0&&this.config.loggerProvider.warn(V(e));var c=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,r=e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e})),n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.fulfillRequest=function(e,t,r){this.removeEvents(e),e.forEach((function(e){return e.callback(k(e.event,t,r))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map((function(e){return e.event}));this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter((function(t){return!e.some((function(e){return e.event.insert_id===t.event.insert_id}))})),this.saveEvents()},e}(),q=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:K(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),K=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},G=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),Z=function(){return Z=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)};function Y(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function J(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var $=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Y(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!$(u,c))return!1;var h=!0;return Object.keys(e).forEach((function(r){$(e[r],t[r])||(h=!1)})),h}for(var d=0;d<e.length;d++)if(!$(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var H,X=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Z({},this.identity.userProperties),r=Z(Z({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,o,s,a,l=r.userProperties||{};try{for(var u=Y(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=J(c.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(i=void 0,Y(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=J(g.value,2),v=m[0],y=m[1];l[v]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,Y(Object.keys(p))),w=b.next();!w.done;w=b.next()){delete l[v=w.value]}}catch(e){s={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return Z({},this.identity)},e.prototype.setIdentity=function(e){var t=Z({},this.identity);this.identity=Z({},e),$(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,ee=function(){function e(){this.identityStore=new X,this.eventBridge=new G,this.applicationContextProvider=new q}return e.getInstance=function(t){return Q.analyticsConnectorInstances||(Q.analyticsConnectorInstances={}),Q.analyticsConnectorInstances[t]||(Q.analyticsConnectorInstances[t]=new e),Q.analyticsConnectorInstances[t]},e}(),te=function(e){return void 0===e&&(e="$default_instance"),ee.getInstance(e)},re=function(){function e(){this.name="identity",this.type="before",this.identityStore=te().identityStore}return e.prototype.execute=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){return e.instanceName&&(this.identityStore=te(e.instanceName).identityStore),[2]}))}))},e}(),ne=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},ie=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[m,t,e.substring(0,r)].filter(Boolean).join("_")},oe=function(){var e,t,r,n;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(n=null!==(r=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==r?r:i)&&void 0!==n?n:""},se=function(){var e,t=E();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var r=t.split("=",2),n=ae(r[0]),i=ae(r[1]);return i?(e[n]=i,e):e}),{}):{}},ae=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},le=function(e){return function(){var t=o({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},ue=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=u(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},ce=function(e,t){return function(){var r,n,i={};try{for(var o=u(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=ue(e,a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},he=function(e,t,r,n,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=r(),l=a.logger,u=a.logLevel;if(u&&u<N.Debug||!u||!l)return e.apply(i,o);var c,h={type:"invoke public method",name:t,args:o,stacktrace:(c=1,void 0===c&&(c=0),((new Error).stack||"").split("\n").slice(2+c).map((function(e){return e.trim()}))),time:{start:(new Date).toISOString()},states:{}};n&&h.states&&(h.states.before=n());var d=e.apply(i,o);return d&&d.promise?d.promise.then((function(){n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))})):(n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))),d}},de=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return[2,(t=r.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return a(this,void 0,void 0,(function(){return l(this,(function(r){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),pe=function(){function e(e){this.options=o({},e)}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){var t,r;return l(this,(function(n){switch(n.label){case 0:if(!E())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),r="AMP_TEST",n.label=1;case 1:return n.trys.push([1,4,5,7]),[4,t.set(r,e.testValue)];case 2:return n.sent(),[4,t.get(r)];case 3:return[2,n.sent()===e.testValue];case 4:return n.sent(),[2,!1];case 5:return[4,t.remove(r)];case 6:return n.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){var t;return a(this,void 0,void 0,(function(){var r,n;return l(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(r=i.sent()))return[2,void 0];try{return void 0===(n=null!==(t=fe(r))&&void 0!==t?t:ge(r))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]):[2,JSON.parse(n)]}catch(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t,r;return a(this,void 0,void 0,(function(){var n,i,o;return l(this,(function(s){return n=E(),i=null!==(r=null===(t=null==n?void 0:n.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==r?r:[],(o=i.find((function(t){return 0===t.indexOf(e+"=")})))?[2,o.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var r;return a(this,void 0,void 0,(function(){var n,i,o,s,a,u,c;return l(this,(function(l){try{n=null!==(r=this.options.expirationDays)&&void 0!==r?r:0,o=void 0,(i=null!==t?n:-1)&&((s=new Date).setTime(s.getTime()+24*i*60*60*1e3),o=s),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(u=E())&&(u.document.cookie=a)}catch(t){c=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}return[2]}))}))},e.prototype.remove=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2]}))}))},e}(),fe=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},ge=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},me=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,i,o,s,a,l,u,c,h,d,p,f,g,m,v,y,b,w,S,I;if("object"!=typeof e)return null;var x=e.code||0,k=this.buildStatus(x);switch(k){case C.Success:return{status:k,statusCode:x,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case C.Invalid:return{status:k,statusCode:x,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case C.PayloadTooLarge:return{status:k,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case C.RateLimit:return{status:k,statusCode:x,body:{error:null!==(m=e.error)&&void 0!==m?m:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(w=e.exceeded_daily_quota_devices)&&void 0!==w?w:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(I=e.throttled_events)&&void 0!==I?I:[]}};case C.Timeout:default:return{status:k,statusCode:x}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?C.Success:429===e?C.RateLimit:413===e?C.PayloadTooLarge:408===e?C.Timeout:e>=400&&e<500?C.Invalid:e>=500?C.Failed:C.Unknown},e}(),ve=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=o.sent()).text()];case 2:i=o.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}}))}))},t}(me);!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(H||(H={}));var ye=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],be="data-amp-track-",we=["div","span","h1","h2","h3","h4","h5","h6"],Se=function(){function e(e){this.request=e}return Object.defineProperty(e.prototype,"headers",{get:function(){if(this._headers)return this._headers;var e=this.request.headers;if(Array.isArray(e)){var t=e;this._headers=t.reduce((function(e,t){var r=c(t,2),n=r[0],i=r[1];return e[n]=i,e}),{})}else if(e instanceof Headers){var r={};e.forEach((function(e,t){r[t]=e})),this._headers=r}else"object"==typeof e&&(this._headers=e);return this._headers},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=E();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=Ie(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),e}(),Ce=function(){function e(e){this.body=e}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return Ie(this.body,100)},enumerable:!1,configurable:!0}),e}();function Ie(e,t){var r,n,i,o=E(),s=null==o?void 0:o.TextEncoder;if(s){var a;if("string"==typeof e)a=e,i=(new s).encode(a).length;else if(e instanceof Blob)i=(a=e).size;else if(e instanceof URLSearchParams)a=e,i=(new s).encode(a.toString()).length;else if(ArrayBuffer.isView(e))i=(a=e).byteLength;else if(e instanceof ArrayBuffer)i=(a=e).byteLength;else if(e instanceof FormData){var l=e,h=0,d=0;try{for(var p=u(l.entries()),f=p.next();!f.done;f=p.next()){var g=c(f.value,2),m=g[0],v=g[1];if(h+=m.length,"string"==typeof v)h+=(new s).encode(v).length;else{if(!(v instanceof Blob))return;h+=v.size}if(++d>=t)return}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}i=h}else if(e instanceof ReadableStream)return void(a=e);return i}}var xe=function(){function e(e){this.response=e}return Object.defineProperty(e.prototype,"headers",{get:function(){var e;if(this._headers)return this._headers;if(this.response.headers instanceof Headers){var t=this.response.headers,r={};return null===(e=null==t?void 0:t.forEach)||void 0===e||e.call(t,(function(e,t){r[t]=e})),this._headers=r,r}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var r=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),n=r?parseInt(r,10):void 0;return this._bodySize=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e}(),ke=function(){function e(e,t,r){this.statusCode=e,this.headersString=t,this.size=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){var e,t;if(this.headersString){var r={},n=this.headersString.split("\r\n");try{for(var i=u(n),o=i.next();!o.done;o=i.next()){var s=c(o.value.split(": "),2),a=s[0],l=s[1];a&&l&&(r[a]=l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r}},enumerable:!1,configurable:!0}),e}(),Ee=function(){function e(e,t,r,n,i,o,s,a,l,u,c){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=r,this.startTime=n,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=l,this.error=u,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,r,n,i={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers,requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(r=this.responseWrapper)||void 0===r?void 0:r.headers,responseBodySize:null===(n=this.responseWrapper)||void 0===n?void 0:n.bodySize};return Object.fromEntries(Object.entries(i).filter((function(e){var t=c(e,2);return t[0],void 0!==t[1]})))},e}();var Oe,Ae,Re,Pe,Te,_e=function(e,t){void 0===t&&(t=A()),this.callback=e,this.id=t},Me=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=E();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=E();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,o,s,a,l;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var u=null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.XMLHttpRequest)||void 0===n?void 0:n.prototype)||void 0===i?void 0:i.open,c=null===(a=null===(s=null===(o=this.globalScope)||void 0===o?void 0:o.XMLHttpRequest)||void 0===s?void 0:s.prototype)||void 0===a?void 0:a.send;u&&c&&this.observeXhr(u,c);var h=null===(l=this.globalScope)||void 0===l?void 0:l.fetch;h&&this.observeFetch(h),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach((function(r){var n;try{r.callback(e)}catch(e){null===(n=t.logger)||void 0===n||n.debug("an unexpected error occurred while triggering event callbacks",e)}}))},e.prototype.handleNetworkRequestEvent=function(e,t,r,n,i,o,s){var a;if(void 0!==o&&void 0!==s){var l,u,c,h="GET";!function(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}(t)?l=null===(a=null==t?void 0:t.toString)||void 0===a?void 0:a.call(t):(l=t.url,h=t.method),h=(null==r?void 0:r.method)||h,n&&(u=n.status),i&&(c={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},u=0);var d=Math.floor(performance.now()-s),p=Math.floor(o+d),f=new Ee(e,h,o,o,l,r,u,d,n,c,p);this.triggerEventCallbacks(f)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null===performance||void 0===performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(r,n){return a(t,void 0,void 0,(function(){var t,i,o,s,a,u;return l(this,(function(l){switch(l.label){case 0:try{t=this.getTimestamps()}catch(e){null===(a=this.logger)||void 0===a||a.debug("an unexpected error occurred while retrieving timestamps",e)}l.label=1;case 1:return l.trys.push([1,3,,4]),[4,e(r,n)];case 2:return i=l.sent(),[3,4];case 3:return s=l.sent(),o=s,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,n?new Se(n):void 0,i?new xe(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){null===(u=this.logger)||void 0===u||u.debug("an unexpected error occurred while handling fetch",e)}if(i)return[2,i];throw o}}))}))})},e.prototype.observeXhr=function(e,t){if(this.globalScope&&e&&t){var r=this.globalScope.XMLHttpRequest.prototype,n=this;r.open=function(){for(var t,r,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];var a=c(i,2),l=a[0],u=a[1];try{this.$$AmplitudeAnalyticsEvent=o({method:l,url:null===(t=null==u?void 0:u.toString)||void 0===t?void 0:t.call(u)},n.getTimestamps())}catch(e){null===(r=n.logger)||void 0===r||r.debug("an unexpected error occurred while calling xhr open",e)}return e.apply(this,i)},r.send=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=this,o=e[0],s=i.$$AmplitudeAnalyticsEvent;return i.addEventListener("loadend",(function(){var e;try{var t=i.getAllResponseHeaders(),r=i.getResponseHeader("content-length"),a=new ke(i.status,t,r?parseInt(r,10):void 0),l=new Ce(o);s.status=i.status,n.handleNetworkRequestEvent("xhr",{url:s.url,method:s.method},l,a,void 0,s.startTime,s.durationStart)}catch(t){null===(e=n.logger)||void 0===e||e.debug("an unexpected error occurred while handling xhr send",t)}})),t.apply(i,e)}}},e}(),Ne=new Me,Le=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},De=function(e){return Le(e,"attribution")},Fe=function(e){return Le(e,"pageViews")},Ue=function(e){return Le(e,"sessions")},je=function(e){return"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},Be=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},ze=function(e){if(Be(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},Ve=function(e){if(je(e.autocapture)){if("object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking)return e.autocapture.networkTracking;if(e.networkTrackingOptions)return e.networkTrackingOptions}},We=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return Fe(e.defaultTracking)&&(r=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:t,pageCounter:i}},qe=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,o=n.args,s=n.resolve,a=e&&e[i];if("function"==typeof a){var l=a.apply(e,o);"function"==typeof s&&s(null==l?void 0:l.promise)}}return e},Ke=function(e){return e&&void 0!==e._q},Ge="2.17.10",Ze=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat("amplitude-ts","/").concat(Ge),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,r;return a(this,void 0,void 0,(function(){var n,i,s;return l(this,(function(a){return n=(new Date).getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,s=null!==(r=e.event_id)&&void 0!==r?r:i+1,this.config.lastEventId=s,e.time||(this.config.lastEventTime=n),[2,o(o(o(o(o(o(o(o({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:n},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:oe()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:A(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:s,library:this.library,user_agent:this.userAgent})]}))}))},e}(),Ye=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return i.sent(),[4,r.get(n)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=r.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return a(this,void 0,void 0,(function(){return l(this,(function(r){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var r;return a(this,void 0,void 0,(function(){return l(this,(function(n){try{null===(r=this.storage)||void 0===r||r.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return a(this,void 0,void 0,(function(){return l(this,(function(r){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return a(this,void 0,void 0,(function(){return l(this,(function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]}))}))},e}(),Je=1e3,$e=function(e){function t(t){var r,n,i,o=this;try{i=null===(r=E())||void 0===r?void 0:r.localStorage}catch(e){null===(n=null==t?void 0:t.loggerProvider)||void 0===n||n.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return r(t,e),t.prototype.set=function(t,r){var n;return a(this,void 0,void 0,(function(){var i;return l(this,(function(o){switch(o.label){case 0:return Array.isArray(r)&&r.length>Je?(i=r.length-Je,[4,e.prototype.set.call(this,t,r.slice(0,Je))]):[3,2];case 1:return o.sent(),null===(n=this.loggerProvider)||void 0===n||n.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(Je,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,r)];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t}(Ye),He=function(e){function t(){var t;return e.call(this,null===(t=E())||void 0===t?void 0:t.sessionStorage)||this}return r(t,e),t}(Ye),Xe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return r(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var r=this;return l(this,(function(n){return[2,new Promise((function(n,i){"undefined"==typeof XMLHttpRequest&&i(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===r.state.done){var e=o.responseText;try{n(r.buildResponse(JSON.parse(e)))}catch(e){n(r.buildResponse({code:o.status}))}}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},t}(me),Qe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,(function(){var r=this;return l(this,(function(n){return[2,new Promise((function(n,i){var o=E();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,JSON.stringify(t))?r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):r.buildResponse({code:500}))}catch(e){i(e)}}))]}))}))},t}(me),et=function(e,t,r){return void 0===r&&(r=!0),a(void 0,void 0,void 0,(function(){var n,i,o,s,a,u,h,d,p;return l(this,(function(l){switch(l.label){case 0:return n=function(e){return"".concat(m.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(n)];case 1:return(i=l.sent())?r?[4,t.remove(n)]:[3,3]:[2,{optOut:!1}];case 2:l.sent(),l.label=3;case 3:return o=c(i.split("."),6),s=o[0],a=o[1],u=o[2],h=o[3],d=o[4],p=o[5],[2,{deviceId:s,userId:rt(a),sessionId:tt(h),lastEventId:tt(p),lastEventTime:tt(d),optOut:Boolean(u)}]}}))}))},tt=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},rt=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},nt="[Amplitude]",it="".concat(nt," Form Started"),ot="".concat(nt," Form Submitted"),st="".concat(nt," File Downloaded"),at="session_start",lt="session_end",ut="".concat(nt," File Extension"),ct="".concat(nt," File Name"),ht="".concat(nt," Link ID"),dt="".concat(nt," Link Text"),pt="".concat(nt," Link URL"),ft="".concat(nt," Form ID"),gt="".concat(nt," Form Name"),mt="".concat(nt," Form Destination"),vt="cookie",yt=function(e){function t(t,r,n,i,o,s,a,l,u,c,h,d,p,f,g,m,v,y,b,w,S,C,I,x,k,E,O,A,R,P,T,_,M,L,F){void 0===n&&(n=new de),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===u&&(u=5),void 0===c&&(c=30),void 0===h&&(h=vt),void 0===m&&(m=new D),void 0===v&&(v=N.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===I&&(I=""),void 0===x&&(x="US"),void 0===E&&(E=18e5),void 0===O&&(O=new $e({loggerProvider:m})),void 0===A&&(A={ipAddress:!0,language:!0,platform:!0}),void 0===R&&(R="fetch"),void 0===P&&(P=!1),void 0===T&&(T=!0);var U=e.call(this,{apiKey:t,storageProvider:O,transportProvider:St(R)})||this;return U.apiKey=t,U.appVersion=r,U.cookieOptions=i,U.defaultTracking=o,U.autocapture=s,U.flushIntervalMillis=l,U.flushMaxRetries=u,U.flushQueueSize=c,U.identityStorage=h,U.ingestionMetadata=d,U.instanceName=p,U.loggerProvider=m,U.logLevel=v,U.minIdLength=y,U.offline=b,U.partnerId=S,U.plan=C,U.serverUrl=I,U.serverZone=x,U.sessionTimeout=E,U.storageProvider=O,U.trackingOptions=A,U.transport=R,U.useBatch=P,U.fetchRemoteConfig=T,U.networkTrackingOptions=F,U.version=Ge,U._optOut=!1,U._cookieStorage=n,U.deviceId=a,U.lastEventId=f,U.lastEventTime=g,U.optOut=w,U.sessionId=k,U.pageCounter=M,U.userId=_,U.debugLogsEnabled=L,U.loggerProvider.enable(L?N.Debug:U.logLevel),U.networkTrackingOptions=F,U}return r(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(ie(this.apiKey),e)},t}(U),bt=function(e,t,r){return void 0===t&&(t={}),a(void 0,void 0,void 0,(function(){var n,i,s,a,u,c,h,d,p,f,g,m,v,y,b,w,S,C,I,x,k,E,O,R,P,T,_,M,N,L,D,F,U,j,B,z,V,W,q,K,G,Z,Y;return l(this,(function(l){switch(l.label){case 0:return n=t.identityStorage||vt,I={},n===vt?[3,1]:(s="",[3,5]);case 1:return null===(k=null===(x=t.cookieOptions)||void 0===x?void 0:x.domain)||void 0===k?[3,2]:(a=k,[3,4]);case 2:return[4,Ct()];case 3:a=l.sent(),l.label=4;case 4:s=a,l.label=5;case 5:return i=o.apply(void 0,[(I.domain=s,I.expiration=365,I.sameSite="Lax",I.secure=!1,I.upgrade=!0,I),t.cookieOptions]),u=wt(t.identityStorage,i),[4,et(e,u,null===(O=null===(E=t.cookieOptions)||void 0===E?void 0:E.upgrade)||void 0===O||O)];case 6:return c=l.sent(),[4,u.get(ie(e))];case 7:return h=l.sent(),d=se(),p=null!==(M=null!==(_=null!==(T=null!==(P=null!==(R=t.deviceId)&&void 0!==R?R:d.ampDeviceId)&&void 0!==P?P:d.deviceId)&&void 0!==T?T:null==h?void 0:h.deviceId)&&void 0!==_?_:c.deviceId)&&void 0!==M?M:A(),f=null!==(N=null==h?void 0:h.lastEventId)&&void 0!==N?N:c.lastEventId,g=null!==(L=null==h?void 0:h.lastEventTime)&&void 0!==L?L:c.lastEventTime,m=null!==(F=null!==(D=t.optOut)&&void 0!==D?D:null==h?void 0:h.optOut)&&void 0!==F?F:c.optOut,v=null!==(U=null==h?void 0:h.sessionId)&&void 0!==U?U:c.sessionId,y=null!==(B=null!==(j=t.userId)&&void 0!==j?j:null==h?void 0:h.userId)&&void 0!==B?B:c.userId,r.previousSessionDeviceId=null!==(z=null==h?void 0:h.deviceId)&&void 0!==z?z:c.deviceId,r.previousSessionUserId=null!==(V=null==h?void 0:h.userId)&&void 0!==V?V:c.userId,b={ipAddress:null===(q=null===(W=t.trackingOptions)||void 0===W?void 0:W.ipAddress)||void 0===q||q,language:null===(G=null===(K=t.trackingOptions)||void 0===K?void 0:K.language)||void 0===G||G,platform:null===(Y=null===(Z=t.trackingOptions)||void 0===Z?void 0:Z.platform)||void 0===Y||Y},w=null==h?void 0:h.pageCounter,S=null==h?void 0:h.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(C=new yt(e,t.appVersion,u,i,t.defaultTracking,t.autocapture,p,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,n,t.ingestionMetadata,t.instanceName,f,g,t.loggerProvider,t.logLevel,t.minIdLength,t.offline,m,t.partnerId,t.plan,t.serverUrl,t.serverZone,v,t.sessionTimeout,t.storageProvider,b,t.transport,t.useBatch,t.fetchRemoteConfig,y,w,S,t.networkTrackingOptions)).storageProvider.isEnabled()];case 8:return l.sent()||(C.loggerProvider.warn("Storage provider ".concat(C.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),C.storageProvider=new de),[2,C]}}))}))},wt=function(e,t){switch(void 0===e&&(e=vt),void 0===t&&(t={}),e){case"localStorage":return new $e;case"sessionStorage":return new He;case"none":return new de;default:return new pe(o(o({},t),{expirationDays:t.expiration}))}},St=function(e){return"xhr"===e?new Xe:"beacon"===e?new Qe:new ve},Ct=function(e){return a(void 0,void 0,void 0,(function(){var t,r,n,i,o,s,a;return l(this,(function(l){switch(l.label){case 0:return[4,(new pe).isEnabled()];case 1:if(!l.sent()||!e&&("undefined"==typeof location||!location.hostname))return[2,""];for(t=null!=e?e:location.hostname,r=t.split("."),n=[],i="AMP_TLDTEST",o=r.length-2;o>=0;--o)n.push(r.slice(o).join("."));o=0,l.label=2;case 2:return o<n.length?(s=n[o],[4,(a=new pe({domain:"."+s})).set(i,1)]):[3,7];case 3:return l.sent(),[4,a.get(i)];case 4:return l.sent()?[4,a.remove(i)]:[3,6];case 5:return l.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}}))}))},It=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},xt=function(){var e,t=It();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var r=t.split("=",2),n=kt(r[0]),i=kt(r[1]);return i?(e[n]=i,e):e}),{}):{}},kt=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Et="dclid",Ot="fbclid",At="gbraid",Rt="gclid",Pt="ko_click_id",Tt="li_fat_id",_t="msclkid",Mt="rtd_cid",Nt="ttclid",Lt="twclid",Dt="wbraid",Ft={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Ut=function(){function e(){}return e.prototype.parse=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,o(o(o(o({},Ft),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=xt();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=xt();return(e={})[Et]=t[Et],e[Ot]=t[Ot],e[At]=t[At],e[Rt]=t[Rt],e[Pt]=t[Pt],e[Tt]=t[Tt],e[_t]=t[_t],e[Mt]=t[Mt],e[Nt]=t[Nt],e[Lt]=t[Lt],e[Dt]=t[Dt],e},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(Oe||(Oe={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"}(Ae||(Ae={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(Re||(Re={})),function(e){e.US="US",e.EU="EU"}(Pe||(Pe={})),function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(Te||(Te={}));var jt=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},Bt=function(e){var t;void 0===e&&(e={});var r,n=It(),i=void 0,s=!1,u=e.trackOn,h=e.trackHistoryChanges,d=e.eventType,p=void 0===d?"[Amplitude] Page Viewed":d,f=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},g=function(){return a(void 0,void 0,void 0,(function(){var e,t,r;return l(this,(function(n){switch(n.label){case 0:return e=f("undefined"!=typeof location&&location.href||""),r={event_type:p},t=[{}],[4,zt()];case 1:return[2,(r.event_properties=o.apply(void 0,[o.apply(void 0,t.concat([n.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&f(location.pathname)||"","[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":e.split("?")[0]}]),r)]}}))}))},m=function(){return void 0===u||"function"==typeof u&&u()},v="undefined"!=typeof location?location.href:null,y=function(){return a(void 0,void 0,void 0,(function(){var e,r,n,o;return l(this,(function(s){switch(s.label){case 0:return e=location.href,r=Wt(h,e,v||"")&&m(),v=e,r?(null==i||i.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return o=(n=t).track,[4,g()];case 2:o.apply(n,[s.sent()]),s.label=3;case 3:s.label=4;case 4:return[2]}}))}))},b=function(){y()},w={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,o){return a(void 0,void 0,void 0,(function(){var a,u;return l(this,(function(l){switch(l.label){case 0:return t=o,r=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),s=!0,n&&(n.addEventListener("popstate",b),n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,r){var n=c(r,3),i=n[0],o=n[1],a=n[2];e.apply(t,[i,o,a]),s&&y()}})),m()?(i.log("Tracking page view event"),u=(a=t).track,[4,g()]):[3,2];case 1:u.apply(a,[l.sent()]),l.label=2;case 2:return[2]}}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){var t;return l(this,(function(n){switch(n.label){case 0:return"attribution"===u&&Vt(e)?(null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,g()]):[3,2];case 1:t=n.sent(),e.event_type=t.event_type,e.event_properties=o(o({},e.event_properties),t.event_properties),n.label=2;case 2:return r&&e.event_type===p&&(r.pageCounter=r.pageCounter?r.pageCounter+1:1,e.event_properties=o(o({},e.event_properties),{"[Amplitude] Page Counter":r.pageCounter})),[2,e]}}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(e){return n&&(n.removeEventListener("popstate",b),s=!1),[2]}))}))}};return w},zt=function(){return a(void 0,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return e=jt,[4,(new Ut).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},Vt=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[Oe.SET]||{},n=t[Oe.UNSET]||{},i=h(h([],c(Object.keys(r)),!1),c(Object.keys(n)),!1);return Object.keys(Ft).every((function(e){return i.includes(e)}))}return!1},Wt=function(e,t,r){if("pathOnly"===e){if(""==r)return!0;var n=new URL(t),i=new URL(r);return n.origin+n.pathname!==i.origin+i.pathname}return t!==r},qt=function(){var e,t=[],r=function(e,r,n){e.addEventListener(r,n),t.push({element:e,type:r,handler:n})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(t,n){return a(void 0,void 0,void 0,(function(){var i,o;return l(this,(function(s){return i=function(){if(n){if("undefined"!=typeof document){var i=function(e){var t=!1;r(e,"change",(function(){var r,i=Gt(e);t||n.track(it,((r={})[ft]=Kt(e.id),r[gt]=Kt(e.name),r[mt]=i,r)),t=!0})),r(e,"submit",(function(){var r,i,o=Gt(e);t||n.track(it,((r={})[ft]=Kt(e.id),r[gt]=Kt(e.name),r[mt]=o,r)),n.track(ot,((i={})[ft]=Kt(e.id),i[gt]=Kt(e.name),i[mt]=o,i)),t=!1}))};Array.from(document.getElementsByTagName("form")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(i)}))}))})),e.observe(document.body,{subtree:!0,childList:!0}))}}else t.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?i():(o=E())?o.addEventListener("load",i):t.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(r){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)})),t=[],[2]}))}))}}},Kt=function(e){if("string"==typeof e)return e},Gt=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},Zt=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(r,n){return a(void 0,void 0,void 0,(function(){var i,o;return l(this,(function(s){return i=function(){if(n){if("undefined"!=typeof document){var i=function(e){var r;try{r=new URL(e.href,window.location.href)}catch(e){return}var i=o.exec(r.href),s=null==i?void 0:i[1];s&&function(e,r,n){e.addEventListener(r,n),t.push({element:e,type:r,handler:n})}(e,"click",(function(){var t;s&&n.track(st,((t={})[ut]=s,t[ct]=r.pathname,t[ht]=e.id,t[dt]=e.text,t[pt]=e.href,t))}))},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)}))}))})),e.observe(document.body,{subtree:!0,childList:!0}))}}else r.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(o=E())?o.addEventListener("load",i):r.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(r){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)})),t=[],[2]}))}))}}},Yt=!1,Jt=function(){var e=E(),t=[],r=function(r,n){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(r,n),t.push({type:r,handler:n}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return a(void 0,void 0,void 0,(function(){return l(this,(function(n){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,r("online",(function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout((function(){t.flush()}),e.flushIntervalMillis)})),r("offline",(function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2])}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(r){return t.forEach((function(t){var r=t.type,n=t.handler;null==e||e.removeEventListener(r,n)})),t=[],[2]}))}))}}},$t="Remote config fetch rejected due to timeout after 5 seconds",Ht="Unexpected error occurred",Xt=function(){function e(e){var t=e.localConfig,r=e.configKeys,n=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteConfig=function(e,t,r){return a(n,void 0,void 0,(function(){var n,i,o;return l(this,(function(s){switch(s.label){case 0:return n=Date.now(),[4,this.fetchWithTimeout(r)];case 1:return(i=s.sent())&&(o=i.configs&&i.configs[e])?(this.metrics.fetchTimeAPISuccess=Date.now()-n,[2,o[t]]):(this.metrics.fetchTimeAPIFail=Date.now()-n,[2,void 0])}}))}))},this.fetchWithTimeout=function(e){return a(n,void 0,void 0,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:return t=new AbortController,r=setTimeout((function(){return t.abort()}),5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return n=i.sent(),clearTimeout(r),[2,n]}}))}))},this.fetchRemoteConfig=function(e,t){return a(n,void 0,void 0,(function(){var r,n,i,s,a,c,h,d,p,f,g,m;return l(this,(function(l){switch(l.label){case 0:if(t===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:"Remote config fetch rejected due to exceeded retry count"})];if(e.aborted)return[2,this.completeRequest({err:$t})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0),l.label=1;case 1:l.trys.push([1,3,,4]),r=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(n=u(this.configKeys),i=n.next();!i.done;i=n.next())s=i.value,r.append("config_keys",s)}catch(e){f={error:e}}finally{try{i&&!i.done&&(g=n.return)&&g.call(n)}finally{if(f)throw f.error}}return t&&r.set("session_id",String(t)),a={headers:{Accept:"*/*"},method:"GET"},c="".concat(this.getServerUrl(),"?").concat(r.toString()),this.attempts+=1,[4,fetch(c,o(o({},a),{signal:e}))];case 2:if(null===(h=l.sent()))return[2,this.completeRequest({err:Ht})];switch((new me).buildStatus(h.status)){case Te.Success:return this.attempts=0,[2,this.parseAndStoreConfig(h)];case Te.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:return d=l.sent(),p=d,e.aborted?[2,this.completeRequest({err:$t})]:[2,this.completeRequest({err:null!==(m=p.message)&&void 0!==m?m:Ht})];case 4:return[2]}}))}))},this.retryFetch=function(e,t){return a(n,void 0,void 0,(function(){var r=this;return l(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(e){return setTimeout(e,r.attempts*r.retryTimeout)}))];case 1:return n.sent(),[2,this.fetchRemoteConfig(e,t)]}}))}))},this.parseAndStoreConfig=function(e){return a(n,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return[4,e.json()];case 1:return t=r.sent(),this.completeRequest({success:"Remote config successfully fetched"}),[2,t]}}))}))},this.localConfig=t,this.configKeys=r}return e.prototype.getServerUrl=function(){return this.localConfig.serverZone===Pe.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===Pe.EU?"https://sr-client-cfg.eu.amplitude.com/config":"https://sr-client-cfg.amplitude.com/config"},e.prototype.completeRequest=function(e){var t=e.err,r=e.success;if(t)throw new Error(t);r&&this.localConfig.loggerProvider.log(r)},e}(),Qt=function(e){var t=e.localConfig,r=e.configKeys;return a(void 0,void 0,void 0,(function(){return l(this,(function(e){return[2,new Xt({localConfig:t,configKeys:r})]}))}))},er=function(){function e(e){this.config=e,this.config.loggerProvider.debug("Local configuration before merging with remote config",JSON.stringify(this.config,null,2))}return e.prototype.initialize=function(){return a(this,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return e=this,[4,Qt({localConfig:this.config,configKeys:["analyticsSDK"]})];case 1:return e.remoteConfigFetch=t.sent(),[2]}}))}))},e.prototype.generateJoinedConfig=function(){var e,t,r,n,i,s;return a(this,void 0,void 0,(function(){var a,c,h,d,p,f,g,m,v,y,b,w,S;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),(c=this.remoteConfigFetch)?[4,this.remoteConfigFetch.getRemoteConfig("analyticsSDK","browserSDK",this.config.sessionId)]:[3,2];case 1:c=l.sent(),l.label=2;case 2:if(a=c,this.config.loggerProvider.debug("Remote configuration:",JSON.stringify(a,null,2)),a&&"autocapture"in a){if("boolean"==typeof a.autocapture&&(this.config.autocapture=a.autocapture),"object"==typeof a.autocapture){if(h=o({},a.autocapture),void 0===this.config.autocapture&&(this.config.autocapture=a.autocapture),"object"==typeof a.autocapture.elementInteractions&&(null===(e=a.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===e?void 0:e.length)){h.elementInteractions=o({},a.autocapture.elementInteractions),d=h.elementInteractions,p=null!==(t=d.pageUrlAllowlist)&&void 0!==t?t:[],f=[];try{for(g=u(a.autocapture.elementInteractions.pageUrlAllowlistRegex),m=g.next();!m.done;m=g.next()){v=m.value;try{f.push(new RegExp(v))}catch(e){this.config.loggerProvider.warn("Invalid regex pattern: ".concat(v),e)}}}catch(e){w={error:e}}finally{try{m&&!m.done&&(S=g.return)&&S.call(g)}finally{if(w)throw w.error}}y=p.concat(f),d.pageUrlAllowlist=y,delete d.pageUrlAllowlistRegex}"boolean"==typeof this.config.autocapture&&(this.config.autocapture=o({attribution:this.config.autocapture,fileDownloads:this.config.autocapture,formInteractions:this.config.autocapture,pageViews:this.config.autocapture,sessions:this.config.autocapture,elementInteractions:this.config.autocapture},h)),"object"==typeof this.config.autocapture&&(this.config.autocapture=o(o({},this.config.autocapture),h))}this.config.defaultTracking=this.config.autocapture}return this.config.loggerProvider.debug("Joined configuration: ",JSON.stringify(this.config,null,2)),null!==(r=(s=this.config).requestMetadata)&&void 0!==r||(s.requestMetadata=new z),(null===(n=this.remoteConfigFetch)||void 0===n?void 0:n.metrics.fetchTimeAPISuccess)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_success",this.remoteConfigFetch.metrics.fetchTimeAPISuccess),(null===(i=this.remoteConfigFetch)||void 0===i?void 0:i.metrics.fetchTimeAPIFail)&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_fail",this.remoteConfigFetch.metrics.fetchTimeAPIFail),[3,4];case 3:return b=l.sent(),this.config.loggerProvider.error("Failed to fetch remote configuration because of error: ",b),[3,4];case 4:return[2,this.config]}}))}))},e}(),tr="[Amplitude] Element Clicked",rr="[Amplitude] Element Tag",nr="[Amplitude] Element Text",ir="[Amplitude] Page URL",or="https://app.amplitude.com",sr={US:or,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};function ar(e){return"function"==typeof e}function lr(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var ur=lr((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function cr(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var hr=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=u(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(ar(l))try{l()}catch(e){i=e instanceof ur?e.errors:[e]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=u(d),f=p.next();!f.done;f=p.next()){var g=f.value;try{fr(g)}catch(e){i=null!=i?i:[],e instanceof ur?i=h(h([],c(i)),c(e.errors)):i.push(e)}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}}if(i)throw new ur(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)fr(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&cr(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&cr(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),dr=hr.EMPTY;function pr(e){return e instanceof hr||e&&"closed"in e&&ar(e.remove)&&ar(e.add)&&ar(e.unsubscribe)}function fr(e){ar(e)?e():e.unsubscribe()}var gr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},mr=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,h([e,t],c(r)))};function vr(e){mr((function(){throw e}))}function yr(){}function br(e){e()}var wr=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,pr(t)&&t.add(r)):r.destination=Er,r}return r(t,e),t.create=function(e,t,r){return new xr(e,t,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(hr),Sr=Function.prototype.bind;function Cr(e,t){return Sr.call(e,t)}var Ir=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){kr(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){kr(e)}else kr(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){kr(e)}},e}(),xr=function(e){function t(t,r,n){var i,o,s=e.call(this)||this;ar(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&gr.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&Cr(t.next,o),error:t.error&&Cr(t.error,o),complete:t.complete&&Cr(t.complete,o)}):i=t;return s.destination=new Ir(i),s}return r(t,e),t}(wr);function kr(e){vr(e)}var Er={closed:!0,next:yr,error:function(e){throw e},complete:yr},Or="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ar(e){return e}var Rr=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,i=this,o=(n=e)&&n instanceof wr||function(e){return e&&ar(e.next)&&ar(e.error)&&ar(e.complete)}(n)&&pr(n)?e:new xr(e,t,r);return br((function(){var e=i,t=e.operator,r=e.source;o.add(t?t.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=Pr(t))((function(t,n){var i=new xr({next:function(t){try{e(t)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t});r.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[Or]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(0===(e=t).length?Ar:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Pr(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function Pr(e){var t;return null!==(t=null!=e?e:gr.Promise)&&void 0!==t?t:Promise}function Tr(e){return ar(null==e?void 0:e.lift)}function _r(e){return function(t){if(Tr(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function Mr(e,t,r,n,i){return new Nr(e,t,r,n,i)}var Nr=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return r(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(wr);!function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,Tr(t)&&(n.lift=t.lift),n}r(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new hr;var r=this.getSubject();t.add(this.source.subscribe(Mr(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=hr.EMPTY)}return t},t.prototype.refCount=function(){return _r((function(e,t){var r=null;e._refCount++;var n=Mr(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))(this)}}(Rr);var Lr,Dr={now:function(){return(Dr.delegate||performance).now()},delegate:void 0},Fr={schedule:function(e){var t=requestAnimationFrame,r=cancelAnimationFrame,n=t((function(t){r=void 0,e(t)}));return new hr((function(){return null==r?void 0:r(n)}))},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Fr.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,h([],c(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return cancelAnimationFrame.apply(void 0,h([],c(e)))},delegate:void 0};new Rr((function(e){var t=Lr||Dr,r=t.now(),n=0,i=function(){e.closed||(n=Fr.requestAnimationFrame((function(o){n=0;var s=t.now();e.next({timestamp:Lr?s:o,elapsed:s-r}),i()})))};return i(),function(){n&&Fr.cancelAnimationFrame(n)}}));var Ur=lr((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),jr=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return r(t,e),t.prototype.lift=function(e){var t=new Br(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ur},t.prototype.next=function(e){var t=this;br((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=u(t.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(e)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;br((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;br((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?dr:(this.currentObservers=null,o.push(e),new hr((function(){t.currentObservers=null,cr(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new Rr;return e.source=this,e},t.create=function(e,t){return new Br(e,t)},t}(Rr),Br=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return r(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:dr},t}(jr);!function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}r(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)}}(jr);var zr={now:function(){return(zr.delegate||Date).now()},delegate:void 0};!function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=zr);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}r(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,l=1;l<n.length&&n[l]<=s;l+=2)a=l;a&&n.splice(0,a+1)}}}(jr),function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}r(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))}}(jr);var Vr,Wr=function(e){function t(t,r){return e.call(this)||this}return r(t,e),t.prototype.schedule=function(e,t){return this},t}(hr),qr=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,h([e,t],c(r)))},Kr=function(e){return clearInterval(e)},Gr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return r(t,e),t.prototype.schedule=function(e,t){var r;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),qr(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&Kr(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,cr(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Wr),Zr=1,Yr={};function Jr(e){return e in Yr&&(delete Yr[e],!0)}var $r=function(e){var t=Zr++;return Yr[t]=!0,Vr||(Vr=Promise.resolve()),Vr.then((function(){return Jr(t)&&e()})),t},Hr=function(e){Jr(e)},Xr={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Xr.delegate;return((null==r?void 0:r.setImmediate)||$r).apply(void 0,h([],c(e)))},clearImmediate:function(e){return Hr(e)},delegate:void 0},Qr=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=Xr.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(Xr.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(Gr),en=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=zr.now,e}(),tn=function(e){function t(t,r){void 0===r&&(r=en.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return r(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(en),rn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(tn);new rn(Qr);var nn=new tn(Gr),on=nn,sn=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.flush(this),0)},t}(Gr),an=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(tn);new an(sn);var ln=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=Fr.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){var i;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);var o=t.actions;null!=r&&r===t._scheduled&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==r&&(Fr.cancelAnimationFrame(r),t._scheduled=void 0)},t}(Gr),un=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.flush=function(e){var t;this._active=!0,e?t=e.id:(t=this._scheduled,this._scheduled=void 0);var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(tn);new un(ln),function(e){function t(t,r){void 0===t&&(t=cn),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}r(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10}(tn);var cn=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return r(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return hr.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),1},t.prototype.recycleAsyncId=function(e,t,r){},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(Gr),hn=new Rr((function(e){return e.complete()}));function dn(e){return e&&ar(e.schedule)}function pn(e){return e[e.length-1]}function fn(e){return dn(pn(e))?e.pop():void 0}var gn=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function mn(e){return ar(null==e?void 0:e.then)}function vn(e){return ar(e[Or])}function yn(e){return Symbol.asyncIterator&&ar(null==e?void 0:e[Symbol.asyncIterator])}function bn(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var wn,Sn="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Cn(e){return ar(null==e?void 0:e[Sn])}function In(e){return p(this,arguments,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,d(t.read())];case 3:return r=i.sent(),n=r.value,r.done?[4,d(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,d(n)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function xn(e){return ar(null==e?void 0:e.getReader)}function kn(e){if(e instanceof Rr)return e;if(null!=e){if(vn(e))return i=e,new Rr((function(e){var t=i[Or]();if(ar(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(gn(e))return n=e,new Rr((function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()}));if(mn(e))return r=e,new Rr((function(e){r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,vr)}));if(yn(e))return En(e);if(Cn(e))return t=e,new Rr((function(e){var r,n;try{for(var i=u(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()}));if(xn(e))return En(In(e))}var t,r,n,i;throw bn(e)}function En(e){return new Rr((function(t){(function(e,t){var r,n,i,o;return a(this,void 0,void 0,(function(){var s,a;return l(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),r=f(e),l.label=1;case 1:return[4,r.next()];case 2:if((n=l.sent()).done)return[3,4];if(s=n.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),i={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function On(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}function An(e,t){return void 0===t&&(t=0),_r((function(r,n){r.subscribe(Mr(n,(function(r){return On(n,e,(function(){return n.next(r)}),t)}),(function(){return On(n,e,(function(){return n.complete()}),t)}),(function(r){return On(n,e,(function(){return n.error(r)}),t)})))}))}function Rn(e,t){return void 0===t&&(t=0),_r((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}function Pn(e,t){if(!e)throw new Error("Iterable cannot be null");return new Rr((function(r){On(r,t,(function(){var n=e[Symbol.asyncIterator]();On(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}function Tn(e,t){if(null!=e){if(vn(e))return function(e,t){return kn(e).pipe(Rn(t),An(t))}(e,t);if(gn(e))return function(e,t){return new Rr((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}(e,t);if(mn(e))return function(e,t){return kn(e).pipe(Rn(t),An(t))}(e,t);if(yn(e))return Pn(e,t);if(Cn(e))return function(e,t){return new Rr((function(r){var n;return On(r,t,(function(){n=e[Sn](),On(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return ar(null==n?void 0:n.return)&&n.return()}}))}(e,t);if(xn(e))return function(e,t){return Pn(In(e),t)}(e,t)}throw bn(e)}function _n(e,t){return t?Tn(e,t):kn(e)}function Mn(e){return e instanceof Date&&!isNaN(e)}!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(wn||(wn={})),lr((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}})),lr((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),lr((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}})),lr((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}));var Nn=lr((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function Ln(e){throw new Nn(e)}function Dn(e,t){return _r((function(r,n){var i=0;r.subscribe(Mr(n,(function(r){n.next(e.call(t,r,i++))})))}))}var Fn=Array.isArray;function Un(e){return Dn((function(t){return function(e,t){return Fn(t)?e.apply(void 0,h([],c(t))):e(t)}(e,t)}))}function jn(e,t,r){return void 0===r&&(r=1/0),ar(t)?jn((function(r,n){return Dn((function(e,i){return t(r,e,n,i)}))(kn(e(r,n)))}),r):("number"==typeof t&&(r=t),_r((function(t,n){return function(e,t,r,n,i,o,s,a){var l=[],u=0,c=0,h=!1,d=function(){!h||l.length||u||t.complete()},p=function(e){return u<n?f(e):l.push(e)},f=function(e){o&&t.next(e),u++;var a=!1;kn(r(e,c++)).subscribe(Mr(t,(function(e){null==i||i(e),o?p(e):t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{u--;for(var e=function(){var e=l.shift();s?On(t,s,(function(){return f(e)})):f(e)};l.length&&u<n;)e();d()}catch(e){t.error(e)}})))};return e.subscribe(Mr(t,p,(function(){h=!0,d()}))),function(){null==a||a()}}(t,n,e,r)})))}function Bn(e){return void 0===e&&(e=1/0),jn(Ar,e)}function zn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Bn(1)(_n(e,fn(e)))}var Vn=["addListener","removeListener"],Wn=["addEventListener","removeEventListener"],qn=["on","off"];function Kn(e,t,r,n){if(ar(r)&&(n=r,r=void 0),n)return Kn(e,t,r).pipe(Un(n));var i=c(function(e){return ar(e.addEventListener)&&ar(e.removeEventListener)}(e)?Wn.map((function(n){return function(i){return e[n](t,i,r)}})):function(e){return ar(e.addListener)&&ar(e.removeListener)}(e)?Vn.map(Gn(e,t)):function(e){return ar(e.on)&&ar(e.off)}(e)?qn.map(Gn(e,t)):[],2),o=i[0],s=i[1];if(!o&&gn(e))return jn((function(e){return Kn(e,t,r)}))(kn(e));if(!o)throw new TypeError("Invalid event target");return new Rr((function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return o(t),function(){return s(t)}}))}function Gn(e,t){return function(r){return function(n){return e[r](t,n)}}}function Zn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=fn(e),n=function(e,t){return"number"==typeof pn(e)?e.pop():t}(e,1/0),i=e;return i.length?1===i.length?kn(i[0]):Bn(n)(_n(i,r)):hn}function Yn(e,t){return _r((function(r,n){var i=0;r.subscribe(Mr(n,(function(r){return e.call(t,r,i++)&&n.next(r)})))}))}function Jn(e){return e<=0?function(){return hn}:_r((function(t,r){var n=0;t.subscribe(Mr(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}function $n(e,t){return t?function(r){return zn(t.pipe(Jn(1),_r((function(e,t){e.subscribe(Mr(t,yr))}))),r.pipe($n(e)))}:jn((function(t,r){return kn(e(t,r)).pipe(Jn(1),function(e){return Dn((function(){return e}))}(t))}))}function Hn(e,t){void 0===t&&(t=nn);var r=function(e,t,r){void 0===e&&(e=0),void 0===r&&(r=on);var n=-1;return null!=t&&(dn(t)?r=t:n=t),new Rr((function(t){var i=Mn(e)?+e-r.now():e;i<0&&(i=0);var o=0;return r.schedule((function(){t.closed||(t.next(o++),0<=n?this.schedule(void 0,n):t.complete())}),i)}))}(e,t);return $n((function(){return r}))}function Xn(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new jr}:t,n=e.resetOnError,i=void 0===n||n,o=e.resetOnComplete,s=void 0===o||o,a=e.resetOnRefCountZero,l=void 0===a||a;return function(e){var t,n,o,a=0,u=!1,c=!1,h=function(){null==n||n.unsubscribe(),n=void 0},d=function(){h(),t=o=void 0,u=c=!1},p=function(){var e=t;d(),null==e||e.unsubscribe()};return _r((function(e,f){a++,c||u||h();var g=o=null!=o?o:r();f.add((function(){0!==--a||c||u||(n=Qn(p,l))})),g.subscribe(f),!t&&a>0&&(t=new xr({next:function(e){return g.next(e)},error:function(e){c=!0,h(),n=Qn(d,i,e),g.error(e)},complete:function(){u=!0,h(),n=Qn(d,s),g.complete()}}),kn(e).subscribe(t))}))(e)}}function Qn(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(!0!==t){if(!1!==t){var i=new xr({next:function(){i.unsubscribe(),e()}});return kn(t.apply(void 0,h([],c(r)))).subscribe(i)}}else e()}new Rr(yr);var ei=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],ti=["type"],ri=["svg","path","g"],ni=["password","hidden"];var ii=function(e){var t;return e?(t=function(e,t){for(var r=0,n=0;n<e.length;n++){var i=e[n];if(null===i)r+=4;else{var o=oi(i);r+=o?Array.from(o).length:4}if(r>t)return e.slice(0,n)}return e}(function(e){var t=[];if(!e)return t;t.push(e);for(var r=e.parentElement;r&&"HTML"!==r.tagName;)t.push(r),r=r.parentElement;return t}(e).map((function(e){return function(e){var t,r,n,i,o,s;if(null===e)return null;var a=String(e.tagName).toLowerCase(),l={tag:a},c=Array.from(null!==(i=null===(n=e.parentElement)||void 0===n?void 0:n.children)&&void 0!==i?i:[]);c.length&&(l.index=c.indexOf(e),l.indexOfType=c.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var h=null===(s=null===(o=e.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===s?void 0:s.toLowerCase();h&&(l.prevSib=String(h));var d=e.getAttribute("id");d&&(l.id=String(d));var p=Array.from(e.classList);p.length&&(l.classes=p);var f={},g=Array.from(e.attributes).filter((function(e){return!ei.includes(e.name)})),m=!ui(e);if(!ni.includes(String(e.getAttribute("type")))&&!ri.includes(a))try{for(var v=u(g),y=v.next();!y.done;y=v.next()){var b=y.value;m&&!ti.includes(b.name)||(f[b.name]=String(b.value).substring(0,128))}}catch(e){t={error:e}}finally{try{y&&!y.done&&(r=v.return)&&r.call(v)}finally{if(t)throw t.error}}return Object.keys(f).length&&(l.attrs=f),l}(e)})),1024),t):[]};function oi(e,t){void 0===t&&(t=!1);try{if(null==e)return t?"None":null;if("string"==typeof e)return t?(e=e.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(e,"'"):e.includes("'")?'"'.concat(e.replace(/'/g,"\\'"),'"'):"'".concat(e,"'"):e;if("boolean"==typeof e)return e?"True":"False";if(Array.isArray(e)){var r=e.map((function(e){return oi(e,!0)}));return"[".concat(r.join(", "),"]")}if("object"==typeof e){var n=Object.entries(e).filter((function(e){return null!=c(e,1)[0]})).map((function(e){var t=c(e,2),r=t[0],n=t[1];return"".concat(String(oi(r,!0)),": ").concat(String(oi(n,!0)))})),i="{".concat(n.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return e.toString()}catch(e){return null}}var si=["input","select","textarea"],ai=function(e,t){return function(r,n){var i,o,s,a=e.pageUrlAllowlist,l=e.shouldTrackEventResolver,u=null===(o=null===(i=null==n?void 0:n.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!u)return!1;if(l)return l(r,n);if(!hi(window.location.href,a))return!1;var c=String(null==n?void 0:n.getAttribute("type"))||"";if("string"==typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}if(t){var h=t.some((function(e){var t;return!!(null===(t=null==n?void 0:n.matches)||void 0===t?void 0:t.call(n,e))}));if(!h)return!1}switch(u){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:var d=null===(s=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===s?void 0:s.call(window,n);return!(!d||"pointer"!==d.getPropertyValue("cursor")||"click"!==r)||"click"===r}}},li=function(e){if(null==e)return!1;if("string"==typeof e){if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0},ui=function(e){var t,r,n,i=null===(r=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===r?void 0:r.call(t),o=e instanceof HTMLElement&&"true"===(null===(n=e.getAttribute("contenteditable"))||void 0===n?void 0:n.toLowerCase());return!si.includes(i)&&!o},ci=function(e){var t="";return ui(e)&&e.childNodes&&e.childNodes.length&&e.childNodes.forEach((function(e){var r="";!function(e){return!!e&&3===e.nodeType}(e)?r=ci(e):e.textContent&&(r=e.textContent),t+=r.split(/(\s+)/).filter(li).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),t},hi=function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))},di=function(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(n)||(t[r]=n),t}),{})},pi=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}if(t){var n=t.textContent||"";return li(n)?n:""}return pi(r)},fi=function(e,t){return e?t.some((function(t){var r;return null===(r=null==e?void 0:e.matches)||void 0===r?void 0:r.call(e,t)}))?e:fi(null==e?void 0:e.parentElement,t):null},gi=function(e){var t,r,n;if(!e)return{};var i=null===(n=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===n?void 0:n.call(r),o=((t={})[rr]=i,t[nr]=ci(e),t[ir]=window.location.href.split("?")[0],t);return di(o)};var mi=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)},vi=function(e,t,r){var n,i,o,s=null===(o=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i),a="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},l=t.getAttribute("aria-label"),u=function(e,t){return e.getAttributeNames().reduce((function(r,n){if(n.startsWith(t)){var i=n.replace(t,""),o=e.getAttribute(n);i&&(r[i]=o||"")}return r}),{})}(t,r),c=pi(t),h=((n={})["[Amplitude] Element ID"]=t.getAttribute("id")||"",n["[Amplitude] Element Class"]=t.getAttribute("class"),n["[Amplitude] Element Hierarchy"]=ii(t),n[rr]=s,n[nr]=ci(t),n["[Amplitude] Element Position Left"]=null==a.left?null:Math.round(a.left),n["[Amplitude] Element Position Top"]=null==a.top?null:Math.round(a.top),n["[Amplitude] Element Aria Label"]=l,n["[Amplitude] Element Attributes"]=u,n["[Amplitude] Element Parent Label"]=c,n[ir]=window.location.href.split("?")[0],n["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);return"a"===s&&"click"===e&&t instanceof HTMLAnchorElement&&(h["[Amplitude] Element Href"]=t.href),di(h)},yi=function(e,t,r,n){var i={event:e,timestamp:Date.now(),type:t};if(function(e){return"click"===e.type||"change"===e.type}(i)&&null!==i.event.target){var o=fi(i.event.target,r);return o&&(i.closestTrackedAncestor=o,i.targetElementProperties=vi(i.type,o,n)),i}return i};var bi=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?or:t,n=this;this.endpoint=or,this.requestCallbacks={},this.onSelect=function(e){n.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?n.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&n.notify({action:"track-selector-moved",data:t})},this.endpoint=r}return e.prototype.notify=function(e){var t,r,n,i;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===i||i.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t},s=new Promise((function(t,s){n.requestCallbacks[i]={resolve:t,reject:s},n.notify(o),(null==r?void 0:r.timeout)>0&&setTimeout((function(){s(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete n.requestCallbacks[i]}),r.timeout)}));return s},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.setup=function(e){var t=this,r=void 0===e?{}:e,n=r.logger,i=r.endpoint,o=r.isElementSelectable,s=r.cssSelectorAllowlist,a=r.actionClickAllowlist;this.logger=n,i&&this.endpoint===or&&(this.endpoint=i);var l=null;window.addEventListener("message",(function(e){var r,n,i,u,c;if(null===(n=null===(r=t.logger)||void 0===r?void 0:r.debug)||void 0===n||n.call(r,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var h,d=null==e?void 0:e.data,p=null==d?void 0:d.action;if(p)if("id"in d)null===(u=null===(i=t.logger)||void 0===i?void 0:i.debug)||void 0===u||u.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(d);else if("ping"===p)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===p){var f=null==d?void 0:d.data;(h="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(e,t){var r;try{var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src=h,n.addEventListener("load",(function(){e({status:!0})}),{once:!0}),n.addEventListener("error",(function(){t({status:!1,message:"Failed to load the script ".concat(h)})})),null===(r=document.head)||void 0===r||r.appendChild(n)}catch(e){t(e)}}))).then((function(){var e;l=null===(e=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:gi,isElementSelectable:function(e){return!o||o((null==f?void 0:f.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:t,cssSelectorAllowlist:s,actionClickAllowlist:a}),t.notify({action:"selector-loaded"})})).catch((function(){var e;null===(e=t.logger)||void 0===e||e.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===p&&(null===(c=null==l?void 0:l.close)||void 0===c||c.call(l))}})),this.notify({action:"page-loaded"})},e}();function wi(e){var t,r,n,i=e.amplitude,o=e.allObservables,s=e.options,a=e.shouldTrackEvent,l=e.evaluateTriggers,h=o.clickObservable,d=h.pipe(_r((function(e,t){var r,n=!1;e.subscribe(Mr(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))})),Yn((function(e){var t=c(e,2),r=t[0],n=t[1],i=r.event.target!==n.event.target,o=Math.abs(n.event.screenX-r.event.screenX)<=20&&Math.abs(n.event.screenY-r.event.screenY)<=20;return i&&!o}))),p=Zn(d,h.pipe((t=s.debounceTime,void 0===r&&(r=nn),_r((function(e,n){var i=null,o=null,s=null,a=function(){if(i){i.unsubscribe(),i=null;var e=o;o=null,n.next(e)}};function l(){var e=s+t,o=r.now();if(o<e)return i=this.schedule(void 0,e-o),void n.add(i);a()}e.subscribe(Mr(n,(function(e){o=e,s=r.now(),i||(i=r.schedule(l,t),n.add(i))}),(function(){a(),n.complete()}),void 0,(function(){o=i=null})))}))),Dn((function(){return"timeout"}))));return h.pipe(Hn(0),Yn(mi),Yn((function(e){return a("click",e.closestTrackedAncestor)})),Dn((function(e){return l(e)})),(n=p,_r((function(e,t){var r=[];return e.subscribe(Mr(t,(function(e){return r.push(e)}),(function(){t.next(r),t.complete()}))),kn(n).subscribe(Mr(t,(function(){var e=r;r=[],t.next(e)}),yr)),function(){r=null}})))).subscribe((function(e){var t,r,n=(e.length,tr);try{for(var o=u(e),s=o.next();!s.done;s=o.next()){var a=s.value;null==i||i.track(n,a.targetElementProperties)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}))}function Si(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=r.clickObservable,l=r.mutationObservable,u=r.navigateObservable,d=a.pipe(Yn((function(e){return!o("click",e.closestTrackedAncestor)})),Dn((function(e){var t=fi(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e})),Yn(mi),Yn((function(e){return s("click",e.closestTrackedAncestor)}))),p=[l];u&&p.push(u);var f,g,m=Zn.apply(void 0,h([],c(p),!1)),v=d.pipe((f=function(e){return m.pipe(Jn(1),function(e,t){var r=Mn(e)?{first:e}:"number"==typeof e?{each:e}:e,n=r.first,i=r.each,o=r.with,s=void 0===o?Ln:o,a=r.scheduler,l=void 0===a?null!=t?t:nn:a,u=r.meta,c=void 0===u?null:u;if(null==n&&null==i)throw new TypeError("No timeout provided.");return _r((function(e,t){var r,o,a=null,u=0,h=function(e){o=On(t,l,(function(){try{r.unsubscribe(),kn(s({meta:c,lastValue:a,seen:u})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(Mr(t,(function(e){null==o||o.unsubscribe(),u++,t.next(a=e),i>0&&h(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),a=null}))),!u&&h(null!=n?"number"==typeof n?n:+n-l.now():i)}))}({first:500,with:function(){return hn}}),Dn((function(){return e})))},_r((function(e,t){var r=null,n=0,i=!1,o=function(){return i&&!r&&t.complete()};e.subscribe(Mr(t,(function(e){null==r||r.unsubscribe();var i=0,s=n++;kn(f(e,s)).subscribe(r=Mr(t,(function(r){return t.next(g?g(e,r,s,i++):r)}),(function(){r=null,o()})))}),(function(){i=!0,o()})))}))));return v.subscribe((function(e){null==t||t.track(tr,i("click",e.closestTrackedAncestor))}))}var Ci,Ii=function(e,t){return t.filter((function(t){return t.definition.some((function(t){return t.event_type===e.type&&t.filters.every((function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"exact"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){return console.error("Error matching event to filter",e),!1}return!1}(e,t)}))}))}))},xi=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=document.documentElement;return e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector?r.querySelector(e.selector):r}}(e,t);if(!r)return;return"TEXT"===e.elementExtractType?r.textContent:"ATTRIBUTE"===e.elementExtractType&&e.attribute?r.getAttribute(e.attribute):void 0}},ki=function(e,t){e.forEach((function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=xi(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}}))};!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable"}(Ci||(Ci={}));var Ei,Oi=function(e){var t,r,n,i,s,d,p;void 0===e&&(e={});var f=e.dataAttributePrefix,g=void 0===f?be:f,m=e.visualTaggingOptions,v=void 0===m?{enabled:!0,messenger:new bi}:m;e.cssSelectorAllowlist=null!==(t=e.cssSelectorAllowlist)&&void 0!==t?t:ye,e.actionClickAllowlist=null!==(r=e.actionClickAllowlist)&&void 0!==r?r:we,e.debounceTime=null!==(n=e.debounceTime)&&void 0!==n?n:0;var y="@amplitude/plugin-autocapture-browser",b=[],w=function(){var t,r,n=Kn(document,"click",{capture:!0}).pipe(Dn((function(t){return yi(t,"click",e.cssSelectorAllowlist,g)})),Xn()),i=Kn(document,"change",{capture:!0}).pipe(Dn((function(t){return yi(t,"change",e.cssSelectorAllowlist,g)})),Xn());window.navigation&&(r=Kn(window.navigation,"navigate").pipe(Dn((function(t){return yi(t,"navigate",e.cssSelectorAllowlist,g)})),Xn()));var o=new Rr((function(e){var t=new MutationObserver((function(t){e.next(t)}));return t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})).pipe(Dn((function(t){return yi(t,"mutation",e.cssSelectorAllowlist,g)})),Xn());return(t={})[Ci.ClickObservable]=n,t[Ci.ChangeObservable]=i,t[Ci.NavigateObservable]=r,t[Ci.MutationObservable]=o,t},S=function(e){var t,r,n,i,o,s={click:new Set,change:new Set};if(!e)return s;try{for(var a=u(e),l=a.next();!l.done;l=a.next()){var c=l.value;try{try{for(var h=(n=void 0,u(c.definition)),d=h.next();!d.done;d=h.next())null===(o=s[d.value.event_type])||void 0===o||o.add(c.id)}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==c?void 0:c.id,e)}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return s}(Object.values(null!==(s=null===(i=e.pageActions)||void 0===i?void 0:i.labeledEvents)&&void 0!==s?s:{})),C=function(e){var t,r,n,i,o=new Map;try{for(var s=u(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{for(var c=(n=void 0,u(l.conditions)),h=c.next();!h.done;h=c.next()){var d=h.value;if("LABELED_EVENT"===d.type){var p=d.match.eventId,f=o.get(p);f||(f=[],o.set(p,f)),f.push(l)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return o}(null!==(p=null===(d=e.pageActions)||void 0===d?void 0:d.triggers)&&void 0!==p?p:[]),I=function(t){var r,n,i=e.pageActions;if(!i)return t;var o=Ii(t,Array.from(S[t.type]).map((function(e){return i.labeledEvents[e]}))),s=function(e,t){var r,n,i=new Set;try{for(var o=u(e),s=o.next();!s.done;s=o.next()){var a=s.value,l=t.get(a.id);l&&l.forEach((function(e){return i.add(e)}))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return Array.from(i)}(o,C);try{for(var a=u(s),l=a.next();!l.done;l=a.next()){var c=l.value;ki(c.actions,t)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return t};return{name:y,type:"enrichment",setup:function(t,r){return a(void 0,void 0,void 0,(function(){var n,i,s,a,u,d,p,f,m,S;return l(this,(function(l){return"undefined"==typeof document||(n=ai(e,e.cssSelectorAllowlist),i=ai(e,e.actionClickAllowlist),s=w(),a=wi({allObservables:s,options:e,amplitude:r,shouldTrackEvent:n,evaluateTriggers:I}),b.push(a),u=function(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return r.changeObservable.pipe(Yn(mi),Yn((function(e){return i("change",e.closestTrackedAncestor)})),Dn((function(e){return o(e)}))).subscribe((function(e){null==t||t.track("[Amplitude] Element Changed",n("change",e.closestTrackedAncestor))}))}({allObservables:s,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return vi.apply(void 0,h(h([],c(e),!1),[g],!1))},amplitude:r,shouldTrackEvent:n,evaluateTriggers:I}),b.push(u),d=Si({allObservables:s,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return vi.apply(void 0,h(h([],c(e),!1),[g],!1))},amplitude:r,shouldTrackEvent:n,shouldTrackActionClick:i}),b.push(d),null===(m=null==t?void 0:t.loggerProvider)||void 0===m||m.log("".concat(y," has been successfully added.")),window.opener&&v.enabled&&(p=e.cssSelectorAllowlist,f=e.actionClickAllowlist,null===(S=v.messenger)||void 0===S||S.setup(o(o({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:sr[t.serverZone]}),{isElementSelectable:ai(e,h(h([],c(p),!1),c(f),!1)),cssSelectorAllowlist:p,actionClickAllowlist:f})))),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){var e,t,r,n;return l(this,(function(i){try{for(e=u(b),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]}))}))}}},Ai="500-599";function Ri(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function Pi(e,t){var r,n,i=t.split(",");try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=c(s.value.split("-").map(Number),2),l=a[0],h=a[1];if(e===l&&void 0===h)return!0;if(e>=l&&e<=h)return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}function Ti(e){var t;if(e)try{var r=null===(t=E())||void 0===t?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),o=n.hash.replace("#",""),s=n.href,a=n.host;return n.hash="",n.search="",{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:n.href,host:a}}catch(e){return}}function _i(e,t){var r;void 0===t&&(t={});var n=Ti(e.url);if(!n)return!1;var i,o=n.host;if(!1!==t.ignoreAmplitudeRequests&&(Ri(o,"*.amplitude.com")||Ri(o,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find((function(e){return Ri(o,e)})))return!1;if(!t.captureRules&&void 0!==e.status&&!Pi(e.status,Ai))return!1;if(t.captureRules&&(h([],c(t.captureRules),!1).reverse().find((function(t){return i=function(e,t,r){if(!e.hosts||e.hosts.find((function(e){return Ri(t,e)})))return!((r||0===r)&&!Pi(r,e.statusCodeRange||Ai))}(t,o,e.status),void 0!==i})),!i))return!1;return!0}!function(e){e.NetworkObservable="networkObservable"}(Ei||(Ei={}));var Mi,Ni=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=[],i=function(){var e,r=new Rr((function(e){var r=new _e((function(t){var r=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(r)}));return Ne.subscribe(r,t),function(){Ne.unsubscribe(r)}}));return(e={})[Ei.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(o,s){return a(void 0,void 0,void 0,(function(){var a,u;return l(this,(function(l){return"undefined"==typeof document||(a=i(),u=function(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude;return t.networkObservable.pipe(Yn((function(e){return _i(e.event,r)}))).subscribe((function(e){var t,r,i,o=e.event,s=Ti(o.url);if(s){var a=null===(r=o.responseWrapper)||void 0===r?void 0:r.bodySize,l=null===(i=o.requestWrapper)||void 0===i?void 0:i.bodySize,u=((t={})["[Amplitude] URL"]=s.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=s.query,t["[Amplitude] URL Fragment"]=s.fragment,t["[Amplitude] Request Method"]=o.method,t["[Amplitude] Status Code"]=o.status,t["[Amplitude] Start Time"]=o.startTime,t["[Amplitude] Completion Time"]=o.endTime,t["[Amplitude] Duration"]=o.duration,t["[Amplitude] Request Body Size"]=l,t["[Amplitude] Response Body Size"]=a,t["[Amplitude] Request Type"]=o.type,t);null==n||n.track("[Amplitude] Network Request",u)}}))}({allObservables:a,networkTrackingOptions:e,amplitude:s}),n.push(u),null==(t=null==o?void 0:o.loggerProvider)||t.log("".concat(r," has been successfully added."))),[2]}))}))},execute:function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){return[2,e]}))}))},teardown:function(){return a(void 0,void 0,void 0,(function(){var e,t,r,i;return l(this,(function(o){try{for(e=u(n),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}return[2]}))}))}}},Li="dclid",Di="fbclid",Fi="gbraid",Ui="gclid",ji="ko_click_id",Bi="li_fat_id",zi="msclkid",Vi="rtd_cid",Wi="ttclid",qi="twclid",Ki="wbraid",Gi={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Zi=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Yi=function(e,t,r,n,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,a=s(e,["referrer","referring_domain"]),l=t||{};l.referrer;var u=l.referring_domain,c=s(l,["referrer","referring_domain"]);if(Ji(r.excludeReferrers,e.referring_domain))return n.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&function(e){return Object.values(e).every((function(e){return!e}))}(e)&&t)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var h=JSON.stringify(a)!==JSON.stringify(c),d=Zi(o||"")!==Zi(u||""),p=!t||h||d;return p?n.debug("This is a new campaign. An $identify event will be sent."):n.debug("This is not a new campaign because it's the same as the previous one."),p},Ji=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some((function(e){return e instanceof RegExp?e.test(t):e===t}))},$i=function(){function e(){}return e.prototype.parse=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,o(o(o(o({},Gi),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=se();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=se();return(e={})[Li]=t[Li],e[Di]=t[Di],e[Fi]=t[Fi],e[Ui]=t[Ui],e[ji]=t[ji],e[Bi]=t[Bi],e[zi]=t[zi],e[Vi]=t[Vi],e[Wi]=t[Wi],e[qi]=t[qi],e[Ki]=t[Ki],e},e}(),Hi=function(){function e(e,t){var r,n,i,s,a,l;this.shouldTrackNewCampaign=!1,this.options=o({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(n=null===(r=t.cookieOptions)||void 0===r?void 0:r.domain,i=n,i?(i.startsWith(".")&&(i=i.substring(1)),[new RegExp("".concat(i.replace(".","\\."),"$"))]):[])},e),this.storage=t.cookieStorage,this.storageKey=(s=t.apiKey,void 0===(a="MKTG")&&(a=""),void 0===l&&(l=10),[m,a,s.substring(0,l)].filter(Boolean).join("_")),this.currentCampaign=Gi,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return a(this,void 0,void 0,(function(){var e,t;return l(this,(function(r){switch(r.label){case 0:return[4,this.fetchCampaign()];case 1:return t=c.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||ne(this.sessionTimeout,this.lastEventTime),Yi(this.currentCampaign,this.previousCampaign,this.options,this.logger,e)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},e.prototype.fetchCampaign=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,Promise.all([(new $i).parse(),this.storage.get(this.storageKey)])];case 1:return[2,e.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,r,n,i,s=(t=this.currentCampaign,r=this.options,n=o(o({},Gi),t),i=Object.entries(n).reduce((function(e,t){var n,i=c(t,2),o=i[0],s=i[1];return e.setOnce("initial_".concat(o),null!==(n=null!=s?s:r.initialEmptyValue)&&void 0!==n?n:"EMPTY"),s?e.set(o,s):e.unset(o)}),new S),P(i));return e&&(s.event_id=e),s},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),Xi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.init=function(e,t,r){var n,i;return void 0===e&&(e=""),arguments.length>2?(n=t,i=r):"string"==typeof t?(n=t,i=void 0):(n=null==t?void 0:t.userId,i=t),T(this._init(o(o({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i;return a(this,void 0,void 0,(function(){var s,u,c,h,d,p=this;return l(this,(function(f){switch(f.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,bt(t.apiKey,t,this)]);case 1:return(s=f.sent()).fetchRemoteConfig?[4,(m=s,a(void 0,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return[4,(e=new er(m)).initialize()];case 1:return t.sent(),[2,e]}}))})))]:[3,4];case 2:return[4,f.sent().generateJoinedConfig()];case 3:s=f.sent(),f.label=4;case 4:return[4,e.prototype._init.call(this,s)];case 5:return f.sent(),this.logBrowserOptions(s),De(this.config.defaultTracking)?(u=function(e){return De(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?o({},e.defaultTracking.attribution):{}}(this.config),this.webAttribution=new Hi(u,this.config),[4,this.webAttribution.init()]):[3,7];case 6:f.sent(),f.label=7;case 7:return c=se(),h=Number.isNaN(Number(c.ampSessionId))?void 0:Number(c.ampSessionId),this.setSessionId(null!==(i=null!==(n=null!==(r=t.sessionId)&&void 0!==r?r:h)&&void 0!==n?n:this.config.sessionId)&&void 0!==i?i:Date.now()),(d=te(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,9]:[4,this.add(Jt()).promise];case 8:f.sent(),f.label=9;case 9:return[4,this.add(new W).promise];case 10:return f.sent(),[4,this.add(new Ze).promise];case 11:return f.sent(),[4,this.add(new re).promise];case 12:return f.sent(),function(e){Yt||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),Yt=!0)}(this.config),g=this.config.defaultTracking,Le(g,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(Zt()).promise]):[3,14];case 13:f.sent(),f.label=14;case 14:return function(e){return Le(e,"formInteractions")}(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(qt()).promise]):[3,16];case 15:f.sent(),f.label=16;case 16:return Fe(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Bt(We(this.config))).promise]):[3,18];case 17:f.sent(),f.label=18;case 18:return Be(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Oi(ze(this.config))).promise]):[3,20];case 19:f.sent(),f.label=20;case 20:return je(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(Ni(Ve(this.config))).promise]):[3,22];case 21:f.sent(),f.label=22;case 22:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 23:return f.sent(),d.eventBridge.setEventReceiver((function(e){p.track(e.eventType,e.eventProperties)})),[2]}var g,m}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),function(e,t){te(t).identityStore.editIdentity().setUserId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),function(e,t){te(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(A()),this.setUserId(void 0)},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,r=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),T(Promise.resolve());if(e===this.config.sessionId)return T(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var n=this.getSessionId();n!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,Ue(this.config.defaultTracking)&&(n&&i&&r.push(this.track(lt,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:n,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,r);return Ue(this.config.defaultTracking)&&r.push(this.track(at,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,T(Promise.all(r))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=St(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,r){if(Ke(t)){var n=t._q;t._q=[],t=qe(new S,n)}return(null==r?void 0:r.user_id)&&this.setUserId(r.user_id),(null==r?void 0:r.device_id)&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,t,r)},t.prototype.groupIdentify=function(t,r,n,i){if(Ke(n)){var o=n._q;n._q=[],n=qe(new S,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(Ke(t)){var n=t._q;t._q=[],t=qe(new M,n)}return e.prototype.revenue.call(this,t,r)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var r=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(r).promise):this.track(r),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(o){return r=Date.now(),n=ne(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===at||t.event_type===lt||t.session_id&&t.session_id!==this.getSessionId()||(n||i?(this.setSessionId(r),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]}))}))},t.prototype.logBrowserOptions=function(e){try{var t=o(o({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t}(_),Qi=Object.freeze({__proto__:null,get IdentifyOperation(){return n},get SpecialEventType(){return i},get RevenueProperty(){return x},get LogLevel(){return N},get ServerZone(){return H},OfflineDisabled:null,DEFAULT_CSS_SELECTOR_ALLOWLIST:ye,DEFAULT_DATA_ATTRIBUTE_PREFIX:be,DEFAULT_ACTION_CLICK_ALLOWLIST:we}),eo="[Amplitude]",to="".concat(eo," Session Replay ID"),ro=H.US,no="".concat(eo," Session Replay Debug"),io="amp-mask";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata"}(Mi||(Mi={}));var oo=function(){function e(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(e){var t;if(!this.logger)return function(){};var r=this.logger[e];return"function"==typeof r?(null!==(t=r.__rrweb_original__)&&void 0!==t?t:r).bind(this.logger):function(){}},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}(),so="medium";var ao,lo,uo=function(e,t,r){switch(t){case"light":if("input"!==e)return!0;var n=r?function(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}(r):"";return!!n&&(!!["password","hidden","email","tel"].includes(n)||!!r.autocomplete.startsWith("cc-"));case"medium":case"conservative":return!0;default:return uo(e,so,r)}},co=function(e,t){return function(r,n){return function(e,t,r){var n,i,o;if(void 0===t&&(t={defaultMaskLevel:so}),r){if(r.closest("."+io))return!0;var s=(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some((function(e){return r.closest(e)}));if(s)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(i=t.unmaskSelector)&&void 0!==i?i:[]).some((function(e){return r.closest(e)}));if(a)return!1}return uo(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:so,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},ho=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t|=0}return t},po=function(e,t){return t||(e===H.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===H.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},fo=function(e,t){var r,n,i,o;try{for(var s=u(t),a=s.next();!a.done;a=s.next()){var l=a.value,c=(i=l.selector,o=void 0,o=i.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,"."),new RegExp("^".concat(o,"$")));if(c.test(e))return e.replace(c,l.replacement)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e},go=function(){return a(void 0,void 0,void 0,(function(){var e,t,r,n,i,o,s;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=E())?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=a.sent(),r=t.usage,n=t.quota,i=t.usageDetails,o=r?Math.round(r/1024):0,s=r&&n?Math.round(1e3*(r/n+Number.EPSILON))/1e3:0,[2,{totalStorageSize:o,percentOfQuota:s,usageDetails:JSON.stringify(i)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}}))}))},mo=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},vo=function(){return{flushMaxRetries:2,logLevel:N.Warn,loggerProvider:new D,transportProvider:new ve}},yo=function(e){function t(t,r){var n,i,s=this,a=vo();return(s=e.call(this,o(o({transportProvider:a.transportProvider,loggerProvider:new oo(r.loggerProvider||a.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=a.flushMaxRetries?r.flushMaxRetries:a.flushMaxRetries,s.apiKey=t,s.sampleRate=r.sampleRate||0,s.serverZone=r.serverZone||ro,s.configServerUrl=r.configServerUrl,s.trackServerUrl=r.trackServerUrl,s.shouldInlineStylesheet=r.shouldInlineStylesheet,s.version=r.version,s.performanceConfig=r.performanceConfig,s.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",s.applyBackgroundColorToBlockedElements=null!==(i=r.applyBackgroundColorToBlockedElements)&&void 0!==i&&i,r.privacyConfig&&(s.privacyConfig=r.privacyConfig),r.interactionConfig&&(s.interactionConfig=r.interactionConfig,s.interactionConfig.ugcFilterRules&&function(e){if(!e.every((function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement})))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every((function(e){return"string"==typeof(t=e.selector)&&""!==t.trim()&&!!/^\/|^https?:\/\/[^\s]+$/.test(t);var t})))throw new Error("ugcFilterRules must be an array of objects with valid globs")}(s.interactionConfig.ugcFilterRules)),r.debugMode&&(s.debugMode=r.debugMode),r.experimental&&(s.experimental=r.experimental),s}return r(t,e),t}(U),bo=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(bo||{}),wo=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(wo||{});!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(ao||(ao={})),function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(lo||(lo={}));var So=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,i,o,s,a,l,u,c,h,d,p,f,g,m,v,y,b,w,S,C;if("object"!=typeof e)return null;var I=e.code||0,x=this.buildStatus(I);switch(x){case lo.Success:return{status:x,statusCode:I,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case lo.Invalid:return{status:x,statusCode:I,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case lo.PayloadTooLarge:return{status:x,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case lo.RateLimit:return{status:x,statusCode:I,body:{error:null!==(m=e.error)&&void 0!==m?m:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(w=e.exceeded_daily_quota_devices)&&void 0!==w?w:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(C=e.throttled_events)&&void 0!==C?C:[]}};case lo.Timeout:default:return{status:x,statusCode:I}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?lo.Success:429===e?lo.RateLimit:413===e?lo.PayloadTooLarge:408===e?lo.Timeout:e>=400&&e<500?lo.Invalid:e>=500?lo.Failed:lo.Unknown},e}(),Co="Remote config fetch rejected due to timeout after 5 seconds",Io="Unexpected error occurred",xo=function(){function e(e){var t=e.localConfig,r=e.configKeys,n=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteConfig=function(e,t,r){return a(n,void 0,void 0,(function(){var n,i,o;return l(this,(function(s){switch(s.label){case 0:return n=Date.now(),[4,this.fetchWithTimeout(r)];case 1:return(i=s.sent())&&(o=i.configs&&i.configs[e])?(this.metrics.fetchTimeAPISuccess=Date.now()-n,[2,o[t]]):(this.metrics.fetchTimeAPIFail=Date.now()-n,[2,void 0])}}))}))},this.fetchWithTimeout=function(e){return a(n,void 0,void 0,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:return t=new AbortController,r=setTimeout((function(){return t.abort()}),5e3),[4,this.fetchRemoteConfig(t.signal,e)];case 1:return n=i.sent(),clearTimeout(r),[2,n]}}))}))},this.fetchRemoteConfig=function(e,t){return a(n,void 0,void 0,(function(){var r,n,i,s,a,c,h,d,p,f,g,m;return l(this,(function(l){switch(l.label){case 0:if(t===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:"Remote config fetch rejected due to exceeded retry count"})];if(e.aborted)return[2,this.completeRequest({err:Co})];t!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=t,this.attempts=0),l.label=1;case 1:l.trys.push([1,3,,4]),r=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(n=u(this.configKeys),i=n.next();!i.done;i=n.next())s=i.value,r.append("config_keys",s)}catch(e){f={error:e}}finally{try{i&&!i.done&&(g=n.return)&&g.call(n)}finally{if(f)throw f.error}}return t&&r.set("session_id",String(t)),a={headers:{Accept:"*/*"},method:"GET"},c="".concat(this.getServerUrl(),"?").concat(r.toString()),this.attempts+=1,[4,fetch(c,o(o({},a),{signal:e}))];case 2:if(null===(h=l.sent()))return[2,this.completeRequest({err:Io})];switch((new So).buildStatus(h.status)){case lo.Success:return this.attempts=0,[2,this.parseAndStoreConfig(h)];case lo.Failed:return[2,this.retryFetch(e,t)];default:return[2,this.completeRequest({err:"Network error occurred, remote config fetch failed"})]}case 3:return d=l.sent(),p=d,e.aborted?[2,this.completeRequest({err:Co})]:[2,this.completeRequest({err:null!==(m=p.message)&&void 0!==m?m:Io})];case 4:return[2]}}))}))},this.retryFetch=function(e,t){return a(n,void 0,void 0,(function(){var r=this;return l(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(e){return setTimeout(e,r.attempts*r.retryTimeout)}))];case 1:return n.sent(),[2,this.fetchRemoteConfig(e,t)]}}))}))},this.parseAndStoreConfig=function(e){return a(n,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return[4,e.json()];case 1:return t=r.sent(),this.completeRequest({success:"Remote config successfully fetched"}),[2,t]}}))}))},this.localConfig=t,this.configKeys=r}return e.prototype.getServerUrl=function(){return this.localConfig.configServerUrl?this.localConfig.configServerUrl:this.localConfig.serverZone===ao.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===ao.EU?"https://sr-client-cfg.eu.amplitude.com/config":"https://sr-client-cfg.amplitude.com/config"},e.prototype.completeRequest=function(e){var t=e.err,r=e.success;if(t)throw new Error(t);r&&this.localConfig.loggerProvider.log(r)},e}(),ko=function(e){var t=e.localConfig,r=e.configKeys;return a(void 0,void 0,void 0,(function(){return l(this,(function(e){return[2,new xo({localConfig:t,configKeys:r})]}))}))},Eo=function(){function e(e,t){this.localConfig=t,this.remoteConfigFetch=e}return e.prototype.generateJoinedConfig=function(e){var t,r,n,i;return a(this,void 0,void 0,(function(){var s,a,h,d,p,f,g,m,v,y,b,w,S,C,I,x,k,E,O,A,R,P;return l(this,(function(l){switch(l.label){case 0:(s=o({},this.localConfig)).optOut=this.localConfig.optOut,s.captureEnabled=!0,l.label=1;case 1:return l.trys.push([1,6,,7]),[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_sampling_config",e)];case 2:return h=l.sent(),[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_privacy_config",e)];case 3:return d=l.sent(),p=null===(t=s.interactionConfig)||void 0===t?void 0:t.ugcFilterRules,f=s,[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_interaction_config",e)];case 4:return f.interactionConfig=l.sent(),s.interactionConfig&&p&&(s.interactionConfig.ugcFilterRules=p),g=s,[4,this.remoteConfigFetch.getRemoteConfig("sessionReplay","sr_logging_config",e)];case 5:return g.loggingConfig=l.sent(),(h||d)&&(a={},h&&(a.sr_sampling_config=h),d&&(a.sr_privacy_config=d)),[3,7];case 6:return m=l.sent(),v=m,this.localConfig.loggerProvider.warn(v.message),s.captureEnabled=!1,[3,7];case 7:if(!a)return[2,{localConfig:this.localConfig,joinedConfig:s,remoteConfig:a}];if(y=a.sr_sampling_config,b=a.sr_privacy_config,y&&Object.keys(y).length>0?(Object.prototype.hasOwnProperty.call(y,"capture_enabled")?s.captureEnabled=y.capture_enabled:s.captureEnabled=!1,Object.prototype.hasOwnProperty.call(y,"sample_rate")&&(s.sampleRate=y.sample_rate)):(s.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),b){w=null!==(r=s.privacyConfig)&&void 0!==r?r:{},S={defaultMaskLevel:null!==(i=null!==(n=b.defaultMaskLevel)&&void 0!==n?n:w.defaultMaskLevel)&&void 0!==i?i:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},C=function(e){var t,r,n,i,o,s,a,l,c,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=u(null!==(a=e.blockSelector)&&void 0!==a?a:[]),p=d.next();!p.done;p=d.next()){h[p.value]="block"}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var f=u(null!==(l=e.maskSelector)&&void 0!==l?l:[]),g=f.next();!g.done;g=f.next()){h[g.value]="mask"}}catch(e){n={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}try{for(var m=u(null!==(c=e.unmaskSelector)&&void 0!==c?c:[]),v=m.next();!v.done;v=m.next()){h[v.value]="unmask"}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}return h},I=o(o({},C(w)),C(b));try{for(x=u(Object.entries(I)),k=x.next();!k.done;k=x.next())E=c(k.value,2),O=E[0],"mask"===(A=E[1])?S.maskSelector.push(O):"block"===A?S.blockSelector.push(O):"unmask"===A&&S.unmaskSelector.push(O)}catch(e){R={error:e}}finally{try{k&&!k.done&&(P=x.return)&&P.call(x)}finally{if(R)throw R.error}}s.privacyConfig=function(e,t){var r=document.createDocumentFragment(),n=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter((function(e){try{r.querySelector(e)}catch(r){return t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})),0!==e.length)return e};return e.blockSelector=n(e.blockSelector),e.maskSelector=n(e.maskSelector),e.unmaskSelector=n(e.unmaskSelector),e}(S,this.localConfig.loggerProvider)}return this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:mo(s)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:s,remoteConfig:a}]}}))}))},e}(),Oo=function(e,t){return a(void 0,void 0,void 0,(function(){var r,n;return l(this,(function(i){switch(i.label){case 0:return r=new yo(e,t),[4,ko({localConfig:r,configKeys:["sessionReplay"]})];case 1:return n=i.sent(),[2,new Eo(n,r)]}}))}))},Ao="Failed to store session replay events in IndexedDB",Ro="1.25.0",Po=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue(o(o({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter((function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:"Session replay event batch rejected due to exceeded retry count"}),!1)})).forEach((function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout((function(){t.timeout=0,e.schedule(0)}),t.timeout):e.schedule(0)}))},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout((function(){t.flush(!0).then((function(){t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){var t,r,n=this;return l(this,(function(i){switch(i.label){case 0:return t=[],r=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):r.push(e)})),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,Promise.all(t.map((function(t){return n.send(t,e)})))];case 1:return i.sent(),[2]}}))}))},e.prototype.send=function(e,t){var r,n;return void 0===t&&(t=!0),a(this,void 0,void 0,(function(){var i,o,s,a,u,c,h,d,p,f,g,m,v;return l(this,(function(l){switch(l.label){case 0:if(!(i=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(o=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(y=E(),s=(null==y?void 0:y.location)?y.location.href:"",a=Ro,u=e.sampleRate,c=new URLSearchParams({device_id:o,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),h="".concat((null===(r=e.version)||void 0===r?void 0:r.type)||"standalone","/").concat((null===(n=e.version)||void 0===n?void 0:n.version)||a),0===(d=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];l.label=1;case 1:return l.trys.push([1,3,,4]),p={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(i),"X-Client-Version":a,"X-Client-Library":h,"X-Client-Url":s.substring(0,1e3),"X-Client-Sample-Rate":"".concat(u)},body:JSON.stringify(d),method:"POST"},f="".concat(po(e.serverZone,this.trackServerUrl),"?").concat(c.toString()),[4,fetch(f,p)];case 2:if(null===(g=l.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(g.status,e);else{m="";try{m=JSON.stringify(g.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(g.status,": ").concat(m)})}return[3,4];case 3:return v=l.sent(),this.completeRequest({context:e,err:v}),[3,4];case 4:return[2]}var y}))}))},e.prototype.handleReponse=function(e,t){switch((new me).buildStatus(e)){case C.Success:this.handleSuccessResponse(t);break;case C.Failed:this.handleOtherResponse(t);break;default:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){this.addToQueue(o(o({},e),{timeout:e.attempts*this.retryTimeout}))},e.prototype.completeRequest=function(e){var t=e.context,r=e.err,n=e.success;t.onComplete(),r?this.loggerProvider.warn(r):n&&this.loggerProvider.log(n)},e}();const To=(e,t)=>t.some((t=>e instanceof t));let _o,Mo;const No=new WeakMap,Lo=new WeakMap,Do=new WeakMap;let Fo={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return No.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return zo(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Uo(e){Fo=e(Fo)}function jo(e){return(Mo||(Mo=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Vo(this),t),zo(this.request)}:function(...t){return zo(e.apply(Vo(this),t))}}function Bo(e){return"function"==typeof e?jo(e):(e instanceof IDBTransaction&&function(e){if(No.has(e))return;const t=new Promise(((t,r)=>{const n=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),n()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)}));No.set(e,t)}(e),To(e,_o||(_o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Fo):e)}function zo(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,r)=>{const n=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(zo(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)}));return Do.set(t,e),t}(e);if(Lo.has(e))return Lo.get(e);const t=Bo(e);return t!==e&&(Lo.set(e,t),Do.set(t,e)),t}const Vo=e=>Do.get(e);function Wo(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=zo(s);return n&&s.addEventListener("upgradeneeded",(e=>{n(zo(s.result),e.oldVersion,e.newVersion,zo(s.transaction),e)})),r&&s.addEventListener("blocked",(e=>r(e.oldVersion,e.newVersion,e))),a.then((e=>{o&&e.addEventListener("close",(()=>o())),i&&e.addEventListener("versionchange",(e=>i(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a}const qo=["get","getKey","getAll","getAllKeys","count"],Ko=["put","add","delete","clear"],Go=new Map;function Zo(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Go.get(t))return Go.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=Ko.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!qo.includes(r))return;const o=async function(e,...t){const o=this.transaction(e,i?"readwrite":"readonly");let s=o.store;return n&&(s=s.index(t.shift())),(await Promise.all([s[r](...t),i&&o.done]))[0]};return Go.set(t,o),o}Uo((e=>({...e,get:(t,r,n)=>Zo(t,r)||e.get(t,r,n),has:(t,r)=>!!Zo(t,r)||e.has(t,r)})));const Yo=["continue","continuePrimaryKey","advance"],Jo={},$o=new WeakMap,Ho=new WeakMap,Xo={get(e,t){if(!Yo.includes(t))return e[t];let r=Jo[t];return r||(r=Jo[t]=function(...e){$o.set(this,Ho.get(this)[t](...e))}),r}};async function*Qo(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Xo);for(Ho.set(r,t),Do.set(r,Vo(t));t;)yield r,t=await($o.get(r)||t.continue()),$o.delete(r)}function es(e,t){return t===Symbol.asyncIterator&&To(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&To(e,[IDBIndex,IDBObjectStore])}Uo((e=>({...e,get:(t,r,n)=>es(t,r)?Qo:e.get(t,r,n),has:(t,r)=>es(t,r)||e.has(t,r)})));var ts,rs=function(){function e(e){var t,r,n,i=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=new Blob([t]).size;return new Blob(e).size+r>=i.maxPersistedEventsSize||!!(Date.now()-i.timeAtLastSplit>i.interval&&e.length)&&(i.interval=Math.min(i.maxInterval,i.interval+i.minInterval),i._timeAtLastSplit=Date.now(),!0)},this.loggerProvider=e.loggerProvider,this.minInterval=null!==(t=e.minInterval)&&void 0!==t?t:this.minInterval,this.maxInterval=null!==(r=e.maxInterval)&&void 0!==r?r:this.maxInterval,this.maxPersistedEventsSize=null!==(n=e.maxPersistedEventsSize)&&void 0!==n?n:this.maxPersistedEventsSize}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e}();!function(e){e.RECORDING="recording",e.SENT="sent"}(ts||(ts={}));var ns="sessionCurrentSequence",is="sequencesToSend",os=function(){var e=E();return new Promise((function(t,r){if(!e)return r(new Error("Global scope not found"));if(!e.indexedDB)return r(new Error("Session Replay: cannot find indexedDB"));try{var n=e.indexedDB.open("keyval-store");n.onupgradeneeded=function(){1===n.result.version&&(n.result.close(),n.transaction&&n.transaction.abort(),e.indexedDB.deleteDatabase("keyval-store"),t())},n.onsuccess=function(){t(n.result)},n.onerror=function(){r(n.error)}}catch(e){r(e)}}))},ss=function(e){return a(void 0,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return e.length>0?(t=e.splice(0,10),[4,Promise.all(t)]):[3,2];case 1:return r.sent(),[3,0];case 2:return[2]}}))}))},as=function(e){var t,r;return e.objectStoreNames.contains(ns)||(r=e.createObjectStore(ns,{keyPath:"sessionId"})),e.objectStoreNames.contains(is)||(t=e.createObjectStore(is,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},ls=function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,Wo(e,1,{upgrade:as})];case 1:return[2,t.sent()]}}))}))},us=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return a(r,void 0,void 0,(function(){var e,t,r,n,i,o;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=s.sent(),s.label=2;case 2:return t?(r=t.value,n=r.sessionId,i=r.events,e.push({events:i,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=s.sent(),[3,2];case 4:return[2,e];case 5:return o=s.sent(),this.loggerProvider.warn("".concat(Ao,": ").concat(o)),[3,6];case 6:return[2,void 0]}}))}))},r.storeCurrentSequence=function(e){return a(r,void 0,void 0,(function(){var t,r,n;return l(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.db.get(ns,e)];case 1:return(t=i.sent())?[4,this.db.put(is,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=i.sent(),[4,this.db.put(ns,{sessionId:e,events:[]})];case 3:return i.sent(),[2,o(o({},t),{sessionId:e,sequenceId:r})];case 4:return n=i.sent(),this.loggerProvider.warn("".concat(Ao,": ").concat(n)),[3,5];case 5:return[2,void 0]}}))}))},r.addEventToCurrentSequence=function(e,t){return a(r,void 0,void 0,(function(){var r,n,i,o,s,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,10,,11]),[4,(r=this.db.transaction(ns,"readwrite")).store.get(e)];case 1:return(n=l.sent())?[3,3]:[4,r.store.put({sessionId:e,events:[t]})];case 2:return l.sent(),[2];case 3:return i=void 0,this.shouldSplitEventsList(n.events,t)?(i=n.events,[4,r.store.put({sessionId:e,events:[t]})]):[3,5];case 4:return l.sent(),[3,7];case 5:return o=n.events.concat(t),[4,r.store.put({sessionId:e,events:o})];case 6:l.sent(),l.label=7;case 7:return[4,r.done];case 8:return l.sent(),i?[4,this.storeSendingEvents(e,i)]:[2,void 0];case 9:return(s=l.sent())?[2,{events:i,sessionId:e,sequenceId:s}]:[2,void 0];case 10:return a=l.sent(),this.loggerProvider.warn("".concat(Ao,": ").concat(a)),[3,11];case 11:return[2,void 0]}}))}))},r.storeSendingEvents=function(e,t){return a(r,void 0,void 0,(function(){var r;return l(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(is,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(Ao,": ").concat(r)),[3,3];case 3:return[2,void 0]}}))}))},r.cleanUpSessionEventsStore=function(e,t){return a(r,void 0,void 0,(function(){var e;return l(this,(function(r){switch(r.label){case 0:if(!t)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.db.delete(is,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(Ao,": ").concat(e)),[3,4];case 4:return[2]}}))}))},r.transitionFromKeyValStore=function(e){return a(r,void 0,void 0,(function(){var t,r,n,i,o,s,u,d,p=this;return l(this,(function(f){switch(f.label){case 0:return f.trys.push([0,6,,7]),[4,os()];case 1:if(!(t=f.sent()))return[2];r=function(e,t){return a(p,void 0,void 0,(function(){var r,n,i=this;return l(this,(function(o){switch(o.label){case 0:return r=t.sessionSequences,n=[],Object.keys(r).forEach((function(o){var s=parseInt(o,10),u=r[s];if(s===t.currentSequenceId){var d=u.events.map((function(t){return a(i,void 0,void 0,(function(){return l(this,(function(r){return[2,this.addEventToCurrentSequence(e,t)]}))}))}));n.push.apply(n,h([],c(d),!1))}else u.status!==ts.SENT&&n.push(i.storeSendingEvents(e,u.events))})),[4,ss(n)];case 1:return o.sent(),[2]}}))}))},n="".concat(v,"_").concat(this.apiKey.substring(0,10)),f.label=2;case 2:return f.trys.push([2,4,,5]),i=t.transaction("keyval").objectStore("keyval").getAll(n),o=new Promise((function(t){i.onsuccess=function(n){return a(p,void 0,void 0,(function(){var i,o,s,a=this;return l(this,(function(l){switch(l.label){case 0:return i=n&&n.target.result,(o=i&&i[0])?(s=[],Object.keys(o).forEach((function(t){var n=parseInt(t,10),i=o[n];if(e===n)s.push(r(n,i));else{var l=i.sessionSequences;Object.keys(l).forEach((function(e){var t=parseInt(e,10);l[t].status!==ts.SENT&&s.push(a.storeSendingEvents(n,l[t].events))}))}})),[4,ss(s)]):[3,2];case 1:l.sent(),l.label=2;case 2:return t(),[2]}}))}))}})),[4,o];case 3:return f.sent(),(s=E())&&s.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return u=f.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(u)),[3,5];case 5:return[3,7];case 6:return d=f.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(d,". For more information, visit: https://www.docs.developers.amplitude.com/session-replay/sdks/standalone/#indexeddb-best-practices")),[3,7];case 7:return[2]}}))}))},r.apiKey=t.apiKey,r.db=t.db,r}return r(t,e),t.new=function(e,r,n){return a(this,void 0,void 0,(function(){var i,s,a,u,c;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),i="replay"===e?"":"_".concat(e),s="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(i),[4,ls(s)];case 1:return a=l.sent(),[4,(u=new t(o(o({},r),{db:a}))).transitionFromKeyValStore(n)];case 2:return l.sent(),[2,u];case 3:return c=l.sent(),r.loggerProvider.warn("".concat(Ao,": ").concat(c)),[3,4];case 4:return[2]}}))}))},t.prototype.getCurrentSequenceEvents=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o,s,a;return l(this,(function(l){switch(l.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(i=l.sent())?[2,[i]]:[2,void 0];case 2:t=[],l.label=3;case 3:return l.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=u.apply(void 0,[l.sent()]),n=r.next(),l.label=5;case 5:if(n.done)return[3,7];i=n.value,t.push(i),l.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return o=l.sent(),s={error:o},[3,10];case 9:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 10:return[2,t]}}))}))},t}(rs),cs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return r(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=h([],c(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.getSequencesToSend=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return[2,Object.entries(this.finalizedSequences).map((function(e){var t=c(e,2),r=t[0],n=t[1],i=n.sessionId,o=n.events;return{sequenceId:Number(r),sessionId:i,events:o}}))]}))}))},t.prototype.storeCurrentSequence=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]}))}))},t.prototype.addEventToCurrentSequence=function(e,t){return a(this,void 0,void 0,(function(){var r;return l(this,(function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(r=this.addSequence(e)),this.sequences[e].push(t),[2,r]}))}))},t.prototype.storeSendingEvents=function(e,t){return a(this,void 0,void 0,(function(){return l(this,(function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]}))}))},t.prototype.cleanUpSessionEventsStore=function(e,t){return a(this,void 0,void 0,(function(){return l(this,(function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]}))}))},t}(rs),hs=function(e){var t=e.config,r=e.sessionId,n=e.minInterval,i=e.maxInterval,s=e.type,u=e.payloadBatcher,c=e.storeType;return a(void 0,void 0,void 0,(function(){function e(e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){return l(this,(function(t){return[2,h.flush(e)]}))}))}var h,d,p,f,g,m,v,y,b;return l(this,(function(w){switch(w.label){case 0:return h=new Po(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:u})),d=function(){return new cs({loggerProvider:t.loggerProvider,maxInterval:i,minInterval:n})},p=function(){return a(void 0,void 0,void 0,(function(){var e;return l(this,(function(o){switch(o.label){case 0:return[4,us.new(s,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:i,apiKey:t.apiKey},r)];case 1:return e=o.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:d()]}}))}))},"idb"!==c?[3,2]:[4,p()];case 1:return g=w.sent(),[3,3];case 2:g=d(),w.label=3;case 3:return f=g,m=function(e){var r=e.events,n=e.sessionId,i=e.deviceId,o=e.sequenceId;t.debugMode&&go().then((function(e){var r=e.totalStorageSize,n=e.percentOfQuota,i=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(r," KB, percentage of quota: ").concat(n,"%, usage details: ").concat(i))})).catch((function(){})),h.sendEventsList({events:r,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:i,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:s,onComplete:function(){return a(void 0,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(n,o)];case 1:return e.sent(),[2]}}))}))}})},v=function(e){var r=e.sessionId,n=e.deviceId;f.storeCurrentSequence(r).then((function(e){e&&m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})})).catch((function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)}))},y=function(e){var t=e.deviceId;return a(void 0,void 0,void 0,(function(){var e;return l(this,(function(r){switch(r.label){case 0:return[4,f.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach((function(e){m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})})),[2]}}))}))},b=function(e){var r=e.event,n=e.sessionId,i=e.deviceId;f.addEventToCurrentSequence(n,r.data).then((function(e){return e&&m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:i})})).catch((function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)}))},[2,{sendCurrentSequenceEvents:v,addEvent:b,sendStoredEvents:y,flush:e}]}}))}))},ds=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=new Map;e.forEach((function(e){r.set(e.name,e.manager)})),this.managers=r}return e.prototype.sendStoredEvents=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return t=[],this.managers.forEach((function(r){t.push(r.sendStoredEvents(e))})),[4,Promise.all(t)];case 1:return r.sent(),[2]}}))}))},e.prototype.addEvent=function(e){var t,r=e.sessionId,n=e.event,i=e.deviceId;null===(t=this.managers.get(n.type))||void 0===t||t.addEvent({sessionId:r,event:n,deviceId:i})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,r=e.deviceId;this.managers.forEach((function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:r})}))},e.prototype.flush=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return t=[],this.managers.forEach((function(r){t.push(r.flush(e))})),[4,Promise.all(t)];case 1:return r.sent(),[2]}}))}))},e}();const ps={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fs={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gs={};function ms(e){if(gs[e])return gs[e];const t=globalThis[e],r=t.prototype,n=e in ps?ps[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in fs?fs[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return gs[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?gs[e]=o:r}catch{return r}}const vs={};function ys(e,t,r){var n;const i=`${e}.${String(r)}`;if(vs[i])return vs[i].call(t);const o=ms(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(vs[i]=s,s.call(t)):t[r]}const bs={};function ws(e,t,r){const n=`${e}.${String(r)}`;if(bs[n])return bs[n].bind(t);const i=ms(e)[r];return"function"!=typeof i?t[r]:(bs[n]=i,i.bind(t))}const Ss={childNodes:function(e){return ys("Node",e,"childNodes")},parentNode:function(e){return ys("Node",e,"parentNode")},parentElement:function(e){return ys("Node",e,"parentElement")},textContent:function(e){return ys("Node",e,"textContent")},contains:function(e,t){return ws("Node",e,"contains")(t)},getRootNode:function(e){return ws("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ys("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ys("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ys("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ys("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ms("MutationObserver").constructor}};function Cs(){var e=E();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function Is(){var e=E();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var xs,ks,Es;function Os(e,t){if(Es=new Date,e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var r={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};xs=o(o({},r),t),ks=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(xs.root,r);var n=As(e,"all",(function(){return As(e,"two",(function(){return As(e,"one",(function(){return As(e,"none")}))}))}));if(n){var i=Us(js(n,e));return i.length>0&&(n=i[0]),Ps(n)}throw new Error("Selector was not found.")}function As(e,t,r){for(var n=null,i=[],o=e,s=0,a=function(){var e,a,l=(new Date).getTime()-Es.getTime();if(void 0!==xs.timeoutMs&&l>xs.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=Ls(function(e){var t=e.getAttribute("id");if(t&&xs.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||Ls.apply(void 0,h([],c(function(e){var t=Array.from(e.attributes).filter((function(e){return xs.attr(e.name,e.value)}));return t.map((function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}}))}(o)),!1))||Ls.apply(void 0,h([],c(function(e){var t=Array.from(e.classList).filter(xs.className);return t.map((function(e){return{name:"."+CSS.escape(e),penalty:1}}))}(o)),!1))||Ls(function(e){var t=e.tagName.toLowerCase();if(xs.tagName(t))return{name:t,penalty:2};return null}(o))||[{name:"*",penalty:3}],p=function(e){var t=e.parentNode;if(!t)return null;var r=t.firstChild;if(!r)return null;var n=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}(o);if("all"==t)p&&(d=d.concat(d.filter(Ns).map((function(e){return Ms(e,p)}))));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(Ns).map((function(e){return Ms(e,p)}))));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&Ns(f)&&(d=[Ms(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[Ms(d[0],p)]));try{for(var g=(e=void 0,u(d)),m=g.next();!m.done;m=g.next()){(f=m.value).level=s}}catch(t){e={error:t}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(e)throw e.error}}if(i.push(d),i.length>=xs.seedMinLength&&(n=Rs(i,r)))return"break";o=o.parentElement,s++};o;){if("break"===a())break}return n||(n=Rs(i,r)),!n&&r?r():n}function Rs(e,t){var r,n,i=Us(Fs(e));if(i.length>xs.threshold)return t?t():null;try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(_s(a))return a}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}function Ps(e){for(var t=e[0],r=t.name,n=1;n<e.length;n++){var i=e[n].level||0;r=t.level===i-1?"".concat(e[n].name," > ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function Ts(e){return e.map((function(e){return e.penalty})).reduce((function(e,t){return e+t}),0)}function _s(e){var t=Ps(e);switch(ks.querySelectorAll(t).length){case 0:throw new Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function Ms(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Ns(e){return"html"!==e.name&&!e.name.startsWith("#")}function Ls(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Ds);return r.length>0?r:null}function Ds(e){return null!=e}function Fs(e,t){var r,n,i,o,s,a;return void 0===t&&(t=[]),l(this,(function(l){switch(l.label){case 0:if(!(e.length>0))return[3,9];l.label=1;case 1:l.trys.push([1,6,7,8]),r=u(e[0]),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(i=n.value,[5,u(Fs(e.slice(1,e.length),t.concat(i)))]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return o=l.sent(),s={error:o},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:l.sent(),l.label=11;case 11:return[2]}}))}function Us(e){return h([],c(e),!1).sort((function(e,t){return Ts(e)-Ts(t)}))}function js(e,t,r){var n,i,o;return void 0===r&&(r={counter:0,visited:new Map}),l(this,(function(s){switch(s.label){case 0:if(!(e.length>2&&e.length>xs.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>xs.maxNumberOfTries?[2]:(r.counter+=1,(i=h([],c(e),!1)).splice(n,1),o=Ps(i),r.visited.has(o)?[2]:_s(i)&&function(e,t){return ks.querySelector(Ps(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,u(js(i,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}}))}var Bs=function(e){var t=e.version,r=e.events,n=[];return r.forEach((function(e){var t=JSON.parse(e);t.count=1,"click"===t.type&&n.push(t)})),{version:t,events:n}},zs=function(e){var t=e.version,r=e.events,n=[];r.forEach((function(e){var t=JSON.parse(e);"click"===t.type&&n.push(t)}));var i=n.reduce((function(e,t){var r=t.x,n=t.y,i=t.selector,s=t.timestamp,a=s-s%36e5,l="".concat(r,":").concat(n,":").concat(null!=i?i:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=o(o({},t),{timestamp:a,count:1}),e}),{});return{version:t,events:Object.values(i)}},Vs=function(e,t){var r=t.eventsManager,n=t.sessionId,i=t.deviceIdFn,o=t.mirror,s=t.ugcFilterRules;return function(t){if(t.type===wo.Click){var a=E();if(a){var l=a.location,u=a.innerHeight,c=a.innerWidth;if(l){var h=t.x,d=t.y;if(void 0!==h&&void 0!==d){var p,f=o.getNode(t.id);if(f)try{p=Os(f)}catch(t){e.debug("error resolving selector from finder")}var g=function(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null===(t=Ss.parentElement(o.body))||void 0===t?void 0:t.scrollLeft)||(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null===(n=Ss.parentElement(o.body))||void 0===n?void 0:n.scrollTop)||(null===(i=null==o?void 0:o.body)||void 0===i?void 0:i.scrollTop)||0}}(a),m={x:h+g.left,y:d+g.top,selector:p,viewportHeight:u,viewportWidth:c,pageUrl:fo(l.href,s),timestamp:Date.now(),type:"click"},v=i();v&&r.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(m)},deviceId:v})}}}}}},Ws=function(){function e(e,t){var r=E();r&&r.navigator&&"function"==typeof r.navigator.sendBeacon?this.sendBeacon=function(e,t){try{if(r.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(e,t){var r=new XMLHttpRequest;return r.open("POST",e,!0),r.setRequestHeader("Accept","*/*"),r.send(JSON.stringify(t)),!0},this.basePageUrl=po(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var r=this.context,n=r.sessionId,i=r.type,o=new URLSearchParams({device_id:e,session_id:String(n),type:String(i),api_key:this.apiKey}),s="".concat(this.basePageUrl,"?").concat(o.toString());this.sendBeacon(s,t)||this.sendXhr(s,t)},e}(),qs=function(){function e(e,t){var r=this;this.timestamp=Date.now(),this.hook=function(e){r.update(e)},this.send=function(e){return function(t){var n,i,o=e(),s=E();s&&o&&r.transport.send(o,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Cs(),viewportWidth:Is(),pageUrl:fo(s.location.href,null!==(i=null===(n=r.config.interactionConfig)||void 0===n?void 0:n.ugcFilterRules)&&void 0!==i?i:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._maxScrollWidth=Is(),this._maxScrollHeight=Cs(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new Ws(t,r),r)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(e.x>this._maxScrollX){var r=Is();this._maxScrollX=e.x;var n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){var i=Cs();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),Ks=function(e){var t=e.sessionId,r=e.deviceId;this.deviceId=r,this.sessionId=t,t&&r&&(this.sessionReplayId=function(e,t){return"".concat(t,"/").concat(e)}(t,r))},Gs=Uint8Array,Zs=Uint16Array,Ys=Uint32Array,Js=new Gs([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,0,0,0]),$s=new Gs([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,0,0]),Hs=new Gs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xs=function(e,t){for(var r=new Zs(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new Ys(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},Qs=Xs(Js,2),ea=Qs[0],ta=Qs[1];ea[28]=258,ta[258]=28;for(var ra=Xs($s,0)[1],na=new Zs(32768),ia=0;ia<32768;++ia){var oa=(43690&ia)>>>1|(21845&ia)<<1;oa=(61680&(oa=(52428&oa)>>>2|(13107&oa)<<2))>>>4|(3855&oa)<<4,na[ia]=((65280&oa)>>>8|(255&oa)<<8)>>>1}var sa=function(e,t,r){for(var n=e.length,i=0,o=new Zs(t);i<n;++i)++o[e[i]-1];var s,a=new Zs(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new Zs(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],h=a[e[i]-1]++<<c,d=h|(1<<c)-1;h<=d;++h)s[na[h]>>>l]=u}else for(s=new Zs(n),i=0;i<n;++i)s[i]=na[a[e[i]-1]++]>>>15-e[i];return s},aa=new Gs(288);for(ia=0;ia<144;++ia)aa[ia]=8;for(ia=144;ia<256;++ia)aa[ia]=9;for(ia=256;ia<280;++ia)aa[ia]=7;for(ia=280;ia<288;++ia)aa[ia]=8;var la=new Gs(32);for(ia=0;ia<32;++ia)la[ia]=5;var ua=sa(aa,9,0),ca=sa(la,5,0),ha=function(e){return(e/8|0)+(7&e&&1)},da=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Zs?Zs:e instanceof Ys?Ys:Gs)(r-t);return n.set(e.subarray(t,r)),n},pa=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},fa=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},ga=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,o=r.slice();if(!i)return[new Gs(0),0];if(1==i){var s=new Gs(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=r[r[u].f<r[h].f?u++:h++],l=r[u!=c&&r[u].f<r[h].f?u++:h++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=o[0].s;for(n=1;n<i;++n)o[n].s>d&&(d=o[n].s);var p=new Zs(d+1),f=ma(r[c-1],p,0);if(f>t){n=0;var g=0,m=f-t,v=1<<m;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<i;++n){var y=o[n].s;if(!(p[y]>t))break;g+=v-(1<<f-p[y]),p[y]=t}for(g>>>=m;g>0;){var b=o[n].s;p[b]<t?g-=1<<t-p[b]++-1:++n}for(;n>=0&&g;--n){var w=o[n].s;p[w]==t&&(--p[w],++g)}f=t}return[new Gs(p),f]},ma=function(e,t,r){return-1==e.s?Math.max(ma(e.l,t,r+1),ma(e.r,t,r+1)):t[e.s]=r},va=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Zs(++t),n=0,i=e[0],o=1,s=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[r.subarray(0,n),t]},ya=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ba=function(e,t,r){var n=r.length,i=ha(t+2);e[i]=255&n,e[i+1]=n>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<n;++o)e[i+o+4]=r[o];return 8*(i+4+n)},wa=function(e,t,r,n,i,o,s,a,l,u,c){pa(t,c++,r),++i[256];for(var h=ga(i,15),d=h[0],p=h[1],f=ga(o,15),g=f[0],m=f[1],v=va(d),y=v[0],b=v[1],w=va(g),S=w[0],C=w[1],I=new Zs(19),x=0;x<y.length;++x)I[31&y[x]]++;for(x=0;x<S.length;++x)I[31&S[x]]++;for(var k=ga(I,7),E=k[0],O=k[1],A=19;A>4&&!E[Hs[A-1]];--A);var R,P,T,_,M=u+5<<3,N=ya(i,aa)+ya(o,la)+s,L=ya(i,d)+ya(o,g)+s+14+3*A+ya(I,E)+(2*I[16]+3*I[17]+7*I[18]);if(M<=N&&M<=L)return ba(t,c,e.subarray(l,l+u));if(pa(t,c,1+(L<N)),c+=2,L<N){R=sa(d,p,0),P=d,T=sa(g,m,0),_=g;var D=sa(E,O,0);pa(t,c,b-257),pa(t,c+5,C-1),pa(t,c+10,A-4),c+=14;for(x=0;x<A;++x)pa(t,c+3*x,E[Hs[x]]);c+=3*A;for(var F=[y,S],U=0;U<2;++U){var j=F[U];for(x=0;x<j.length;++x){var B=31&j[x];pa(t,c,D[B]),c+=E[B],B>15&&(pa(t,c,j[x]>>>5&127),c+=j[x]>>>12)}}}else R=ua,P=aa,T=ca,_=la;for(x=0;x<a;++x)if(n[x]>255){B=n[x]>>>18&31;fa(t,c,R[B+257]),c+=P[B+257],B>7&&(pa(t,c,n[x]>>>23&31),c+=Js[B]);var z=31&n[x];fa(t,c,T[z]),c+=_[z],z>3&&(fa(t,c,n[x]>>>5&8191),c+=$s[z])}else fa(t,c,R[n[x]]),c+=P[n[x]];return fa(t,c,R[256]),c+P[256]},Sa=new Ys([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ca=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new Gs(n+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(n,a.length-i),u=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var h=c+65535;h<s?u=ba(l,u,e.subarray(c,h)):(l[c]=o,u=ba(l,u,e.subarray(c,s)))}else{for(var d=Sa[t-1],p=d>>>13,f=8191&d,g=(1<<r)-1,m=new Zs(32768),v=new Zs(g+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&g},S=new Ys(25e3),C=new Zs(288),I=new Zs(32),x=0,k=0,E=(c=0,0),O=0,A=0;c<s;++c){var R=w(c),P=32767&c,T=v[R];if(m[P]=T,v[R]=P,O<=c){var _=s-c;if((x>7e3||E>24576)&&_>423){u=wa(e,l,0,S,C,I,k,E,A,c-A,u),E=x=k=0,A=c;for(var M=0;M<286;++M)C[M]=0;for(M=0;M<30;++M)I[M]=0}var N=2,L=0,D=f,F=P-T&32767;if(_>2&&R==w(c-F))for(var U=Math.min(p,_)-1,j=Math.min(32767,c),B=Math.min(258,_);F<=j&&--D&&P!=T;){if(e[c+N]==e[c+N-F]){for(var z=0;z<B&&e[c+z]==e[c+z-F];++z);if(z>N){if(N=z,L=F,z>U)break;var V=Math.min(F,z-2),W=0;for(M=0;M<V;++M){var q=c-F+M+32768&32767,K=q-m[q]+32768&32767;K>W&&(W=K,T=q)}}}F+=(P=T)-(T=m[P])+32768&32767}if(L){S[E++]=268435456|ta[N]<<18|ra[L];var G=31&ta[N],Z=31&ra[L];k+=Js[G]+$s[Z],++C[257+G],++I[Z],O=c+N,++x}else S[E++]=e[c],++C[e[c]]}}u=wa(e,l,o,S,C,I,k,E,A,c-A,u)}return da(a,0,n+ha(u)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!i)};function Ia(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,o=r.length,s=0;s!=o;){for(var a=Math.min(s+5552,o);s<a;++s)i+=n+=r[s];n%=65521,i%=65521}e=n,t=i},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n,i,o,s=Ca(e,t,2,4);return n=s,i=t.level,o=0==i?0:i<6?1:9==i?3:2,n[0]=120,n[1]=o<<6|(o?32-2*o:1),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(s,s.length-4,r.d()),s}const xa=e=>{const t={...e,v:"v1"};return function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var i=e[n++];i<128||t?r+=String.fromCharCode(i):i<224?r+=String.fromCharCode((31&i)<<6|63&e[n++]):i<240?r+=String.fromCharCode((15&i)<<12|(63&e[n++])<<6|63&e[n++]):(i=((15&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}return r}(Ia(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Gs(e.length+(e.length>>>1)),i=0,o=function(e){n[i++]=e},s=0;s<r;++s){if(i+5>n.length){var a=new Gs(i+8+(r-s<<1));a.set(n),n=a}var l=e.charCodeAt(s);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return da(n,0,i)}(JSON.stringify(t))),!0)};var ka=function(){function e(e,t,r,n){var i,o,s,a=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=xa(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){a.eventsManager&&a.deviceId&&a.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:a.deviceId})},this.addCompressedEvent=function(e,t){if(a.worker)a.worker.postMessage({event:e,sessionId:t});else{var r=a.compressEvent(e);a.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=a.worker)||void 0===e||e.terminate()};var l=E();this.canUseIdleCallback=l&&"requestIdleCallback"in l,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(i=t.performanceConfig)||void 0===i?void 0:i.timeout)||2e3;var u=null!==(o={}.COMPRESSION_WEBWORKER_BODY)&&void 0!==o?o:n;if((null===(s=this.config.experimental)||void 0===s?void 0:s.useWebWorker)&&l&&l.Worker&&u){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var c=new Worker(URL.createObjectURL(new Blob([u],{type:"application/javascript"})));c.onerror=function(e){t.loggerProvider.error(e)},c.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;a.addCompressedEventToManager(r,n)},this.worker=c}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback((function(t){e.processQueue(t)}),{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var r;this.canUseIdleCallback&&(null===(r=this.config.performanceConfig)||void 0===r?void 0:r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var r=this.taskQueue.shift();if(r){var n=r.event,i=r.sessionId;this.addCompressedEvent(n,i)}}this.taskQueue.length>0?requestIdleCallback((function(e){t.processQueue(e)}),{timeout:this.timeout}):this.isProcessing=!1},e}(),Ea=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.pageLeaveFns=[],this.recordFunction=null,this.teardownEventListeners=function(t){var r=E();r&&(r.removeEventListener("blur",e.blurListener),r.removeEventListener("focus",e.focusListener),!t&&r.addEventListener("blur",e.blurListener),!t&&r.addEventListener("focus",e.focusListener),r.self&&"onpagehide"in r.self?(r.removeEventListener("pagehide",e.pageLeaveListener),!t&&r.addEventListener("pagehide",e.pageLeaveListener)):(r.removeEventListener("beforeunload",e.pageLeaveListener),!t&&r.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach((function(e){e(t)}))},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),a(e,void 0,void 0,(function(){var e,i,s,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=void 0,(i=this.config)&&t!==Mi.METADATA?(e={config:mo(i),version:Ro},n?[4,go()]:[3,2]):[3,2];case 1:s=l.sent(),e=o(o({},s),e),l.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,o(o({},r),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return a=l.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",a),[3,4];case 4:return[2]}}))}))},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop()}catch(t){var r=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new oo(new D)}return e.prototype.init=function(e,t){return T(this._init(e,t))},e.prototype._init=function(e,t){var r,n,i,o,s,u;return a(this,void 0,void 0,(function(){var a,d,p,f,g,m,v,y,b,w,S,C,I,x;return l(this,(function(l){switch(l.label){case 0:return this.loggerProvider=new oo(t.loggerProvider||new D),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new Ks({sessionId:t.sessionId,deviceId:t.deviceId}),a=this,[4,Oo(e,t)];case 1:return a.joinedConfigGenerator=l.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)];case 2:d=l.sent(),p=d.joinedConfig,f=d.localConfig,g=d.remoteConfig,this.config=p,this.setMetadata(t.sessionId,p,f,g,null===(r=t.version)||void 0===r?void 0:r.version,Ro,null===(n=t.version)||void 0===n?void 0:n.type),t.sessionId&&(null===(i=this.config.interactionConfig)||void 0===i?void 0:i.enabled)&&(m=qs.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[m.send(this.getDeviceId.bind(this)).bind(m)],this.scrollHook=m.hook.bind(m)),v=[],"idb"!==(y=this.config.storeType)||(null===(o=E())||void 0===o?void 0:o.indexedDB)||(y="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(y," for event storage.")),l.label=3;case 3:return l.trys.push([3,5,,6]),[4,hs({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:y})];case 4:return b=l.sent(),v.push({name:"replay",manager:b}),[3,6];case 5:return w=l.sent(),x=w,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(x.toString())),[3,6];case 6:if(!(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled))return[3,10];S=this.config.interactionConfig.batch?zs:Bs,l.label=7;case 7:return l.trys.push([7,9,,10]),[4,hs({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(u=this.config.interactionConfig.trackEveryNms)&&void 0!==u?u:3e4,maxInterval:6e4,payloadBatcher:S,storeType:y})];case 8:return C=l.sent(),v.push({name:"interaction",manager:C}),[3,10];case 9:return I=l.sent(),x=I,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(x.toString())),[3,10];case 10:return this.eventsManager=new(ds.bind.apply(ds,h([void 0],c(v),!1))),this.eventCompressor&&this.eventCompressor.terminate(),this.eventCompressor=new ka(this.eventsManager,this.config,this.getDeviceId()),[4,this.initializeNetworkObservers()];case 11:return l.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),this.initialize(!0),[2]}}))}))},e.prototype.setSessionId=function(e,t){return T(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t){return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(o){switch(o.label){case 0:return(r=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(r),n=t||this.getDeviceId(),this.identifiers=new Ks({sessionId:e,deviceId:n}),this.joinedConfigGenerator&&r?[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)]:[3,2];case 1:i=o.sent().joinedConfig,this.config=i,o.label=2;case 2:return this.recordEvents(),[2]}}))}))},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,r=this.identifiers;if(!t||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var n=this.getShouldRecord(),i={};return n&&((e={})[to]=r.sessionReplayId?r.sessionReplayId:null,i=e,t.debugMode&&(i[no]=JSON.stringify({appHash:ho(t.apiKey).toString()}))),this.addCustomRRWebEvent(Mi.GET_SR_PROPS,{shouldRecord:n,eventProperties:i},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,i},e.prototype.sendEvents=function(e){var t,r=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),n=this.getDeviceId();this.eventsManager&&r&&n&&this.eventsManager.sendCurrentSequenceEvents({sessionId:r,deviceId:n})},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){var r;return l(this,(function(n){return(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId)?(r=this.getDeviceId())?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()]):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])}))}))},e.prototype.shouldOptOut=function(){var e,t,r;(null===(e=this.config)||void 0===e?void 0:e.instanceName)&&(r=te(this.config.instanceName).identityStore.getIdentity().optOut);return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,r,n=(e=this.identifiers.sessionId,t=this.config.sampleRate,r=ho(e.toString()),31*Math.abs(r)%1e6/1e6<t);return n||this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate.")),n},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){var e,t,r,n;if("conservative"===(null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.defaultMaskLevel))return"*";var i=null===(n=null===(r=this.config)||void 0===r?void 0:r.privacyConfig)||void 0===n?void 0:n.maskSelector;return i||void 0},e.prototype.getRecordingPlugins=function(e){var t;return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(o){switch(o.label){case 0:if(r=[],!(null===(t=null==e?void 0:e.console)||void 0===t?void 0:t.enabled))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Promise.resolve().then((function(){return Vy}))];case 2:return n=o.sent().getRecordConsolePlugin,r.push(n({level:e.console.levels})),[3,4];case 3:return i=o.sent(),this.loggerProvider.warn("Failed to load console plugin:",i),[3,4];case 4:return[2,r.length>0?r:void 0]}}))}))},e.prototype.getRecordFunction=function(){return a(this,void 0,void 0,(function(){var e,t;return l(this,(function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.resolve().then((function(){return rR}))];case 2:return e=r.sent().record,this.recordFunction=e,[2,e];case 3:return t=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",t),[2,null];case 4:return[2]}}))}))},e.prototype.recordEvents=function(e){var t,r,n;return void 0===e&&(e=!0),a(this,void 0,void 0,(function(){var i,o,s,a,u,c,h,d,p,f,g,m,v,y=this;return l(this,(function(l){switch(l.label){case 0:return i=this.config,o=this.getShouldRecord(),s=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,o&&s&&i?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(a=l.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:l.sent(),null===(r=this.networkObservers)||void 0===r||r.start((function(e){y.addCustomRRWebEvent(Mi.FETCH_REQUEST,e)})),u=i.privacyConfig,c=i.interactionConfig,h=i.loggingConfig,d=(null==c?void 0:c.enabled)?{mouseInteraction:this.eventsManager&&Vs(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:s,deviceIdFn:this.getDeviceId.bind(this),mirror:a.mirror,ugcFilterRules:null!==(n=c.ugcFilterRules)&&void 0!==n?n:[]}),scroll:this.scrollHook}:{},p=(null==c?void 0:c.enabled)&&c.ugcFilterRules?c.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(s,".")),l.label=3;case 3:return l.trys.push([3,5,,6]),f=this,g=a,v={emit:function(e){if(y.shouldOptOut())return y.loggerProvider.log("Opting session ".concat(s," out of recording due to optOut config.")),y.stopRecordingEvents(),void y.sendEvents();e.type===bo.Meta&&(e.data.href=fo(e.data.href,p)),y.eventCompressor&&y.eventCompressor.enqueueEvent(e,s)},inlineStylesheet:i.shouldInlineStylesheet,hooks:d,maskAllInputs:!0,maskTextClass:io,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:i.applyBackgroundColorToBlockedElements,maskInputFn:co("input",u),maskTextFn:co("text",u),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return y.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(h)];case 4:return f.recordCancelCallback=g.apply(void 0,[(v.plugins=l.sent(),v)]),this.addCustomRRWebEvent(Mi.DEBUG_INFO),e&&this.addCustomRRWebEvent(Mi.METADATA,this.metadata),[3,6];case 5:return m=l.sent(),this.loggerProvider.warn("Failed to initialize session replay:",m),[3,6];case 6:return[2]}}))}))},e.prototype.getDeviceId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){return l(this,(function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]}))}))},e.prototype.shutdown=function(){this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(e,t,r,n,i,o,s){var a=(null==e?void 0:e.toString())?ho(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:r,remoteConfig:n,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(s),replaySDKVersion:i,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:o}},e.prototype.initializeNetworkObservers=function(){var e,t,r;return a(this,void 0,void 0,(function(){var n,i;return l(this,(function(o){switch(o.label){case 0:if(!(null===(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.loggingConfig)||void 0===t?void 0:t.network)||void 0===r?void 0:r.enabled)||this.networkObservers)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Promise.resolve().then((function(){return iR}))];case 2:return n=o.sent().NetworkObservers,this.networkObservers=new n,[3,4];case 3:return i=o.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",i),[3,4];case 4:return[2]}}))}))},e}(),Oa=function(e){return function(){var t=e.config||vo();return{logger:t.loggerProvider,logLevel:t.logLevel}}},Aa=function(){var e=new Ea;return{init:he(e.init.bind(e),"init",Oa(e)),setSessionId:he(e.setSessionId.bind(e),"setSessionId",Oa(e)),getSessionId:he(e.getSessionId.bind(e),"getSessionId",Oa(e)),getSessionReplayProperties:he(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",Oa(e)),flush:he(e.flush.bind(e),"flush",Oa(e)),shutdown:he(e.shutdown.bind(e),"shutdown",Oa(e))}}(),Ra=Aa.init,Pa=Aa.setSessionId,Ta=Aa.getSessionId,_a=Aa.getSessionReplayProperties,Ma=Aa.flush,Na=Aa.shutdown,La="1.19.0",Da=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.sessionReplay={flush:Ma,getSessionId:Ta,getSessionReplayProperties:_a,init:Ra,setSessionId:Pa,shutdown:Na},this.options=o({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(e,t){var r,n,i,s,u;return a(this,void 0,void 0,(function(){var t;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(La,".")),this.config=e,this.options.forceSessionTracking&&("boolean"==typeof e.defaultTracking?!1===e.defaultTracking&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=o(o({},e.defaultTracking),{sessions:!0})),this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!==(r=this.options.deviceId)&&void 0!==r?r:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl,trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(n=this.options.privacyConfig)||void 0===n?void 0:n.blockSelector,maskSelector:null===(i=this.options.privacyConfig)||void 0===i?void 0:i.maskSelector,unmaskSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.unmaskSelector,defaultMaskLevel:null===(u=this.options.privacyConfig)||void 0===u?void 0:u.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:La},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,experimental:this.options.experimental,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig},[4,this.sessionReplay.init(e.apiKey,this.srInitOptions).promise];case 1:return a.sent(),[3,3];case 2:return t=a.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(t.message)),[3,3];case 3:return[2]}}))}))},e.prototype.onSessionIdChanged=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.config.loggerProvider.debug("Analytics session id is changed to ".concat(e,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(e).promise];case 1:return t.sent(),[2]}}))}))},e.prototype.onOptOutChanged=function(e){return a(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.config.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),e?(this.sessionReplay.shutdown(),[3,3]):[3,1];case 1:return[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},e.prototype.execute=function(e){var t;return a(this,void 0,void 0,(function(){var r,n,i;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,8,,9]),this.options.customSessionId?(r=this.options.customSessionId(e))?r===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(r).promise]:[3,3]:[3,4];case 1:s.sent(),s.label=2;case 2:n=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),n),s.label=3;case 3:return[3,7];case 4:return(r=this.config.sessionId)&&r!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(r).promise]:[3,6];case 5:s.sent(),s.label=6;case 6:r&&r===e.session_id&&(n=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),n)),s.label=7;case 7:return[2,Promise.resolve(e)];case 8:return i=s.sent(),null===(t=this.config)||void 0===t||t.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(i.message)),[2,Promise.resolve(e)];case 9:return[2]}}))}))},e.prototype.teardown=function(){var e;return a(this,void 0,void 0,(function(){return l(this,(function(t){try{this.sessionReplay.shutdown(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]}))}))},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e}(),Fa=function(e,t){return Fa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},Fa(e,t)};function Ua(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Fa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var ja=function(){return ja=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ja.apply(this,arguments)};function Ba(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function za(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function Va(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wa(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function qa(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Ka="is",Ga="is not",Za="contains",Ya="does not contain",Ja="less",$a="less or equal",Ha="greater",Xa="greater or equal",Qa="version less",el="version less or equal",tl="version greater",rl="version greater or equal",nl="set is",il="set is not",ol="set contains",sl="set does not contain",al="set contains any",ll="set does not contain any",ul="regex match",cl="regex does not match",hl=-862048943,dl=461845907,pl=function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return Uint8Array.from(t)}(e),n=r.length,i=n>>2,o=t,s=0;s<i;s++){var a=vl(r,s<<2);o=fl(a,o)}var l=i<<2,u=0;switch(n-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,hl),u=ml(u,15),o^=u=Math.imul(u,dl);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,hl),u=ml(u,15),o^=u=Math.imul(u,dl);break;case 1:u^=r[l],u=Math.imul(u,hl),u=ml(u,15),o^=u=Math.imul(u,dl)}return gl(o^=n)>>>0},fl=function(e,t){var r=e,n=t;return r=Math.imul(r,hl),r=ml(r,15),r=Math.imul(r,dl),n=ml(n^=r,13),(n=Math.imul(n,5))+-430675100|0},gl=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},ml=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},vl=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return yl(r)},yl=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},bl=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=Va(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!s||!e||"object"!=typeof e)return;e=e[s]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e||void 0}},wl="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),Sl=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(wl).exec(t);if(r){var n=Number(r[1]),i=Number(r[2]);if(!isNaN(n)&&!isNaN(i))return new e(n,i,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),Cl=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=Va(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},e.prototype.evaluateFlag=function(e,t){var r,n,i;try{for(var o=Va(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=ja(ja(ja({},t.metadata),a.metadata),i.metadata);i=ja(ja({},i),{metadata:l});break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.evaluateSegment=function(e,t,r){var n;return r.conditions?this.evaluateConditions(e,r.conditions)&&void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0:void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0},e.prototype.evaluateConditions=function(e,t){var r,n,i,o;try{for(var s=Va(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,Va(l)),h=c.next();!h.done;h=c.next()){var d=h.value;if(!(u=this.matchCondition(e,d)))break}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(e,t){var r=bl(e,t.selector);if(r){if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var i=this.coerceString(r);return void 0!==i&&this.matchString(i,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return pl(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(bl(e,t.bucket.selector));if(!s||0===s.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(s),l=this.getHash(a),u=l%100,c=Math.floor(l/100);try{for(var h=Va(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],g=p.range[1];if(u>=f&&u<g)try{for(var m=(i=void 0,Va(p.distributions)),v=m.next();!v.done;v=m.next()){var y=v.value,b=y.range[0],w=y.range[1];if(c>=b&&c<w)return y.variant}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case Ka:case Za:case Ja:case $a:case Ha:case Xa:case Qa:case el:case tl:case rl:case nl:case ol:case al:return r;case Ga:case Ya:case sl:case ll:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case nl:return this.setEquals(e,r);case il:return!this.setEquals(e,r);case ol:return this.matchesSetContainsAll(e,r);case sl:return!this.matchesSetContainsAll(e,r);case al:return this.matchesSetContainsAny(e,r);case ll:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Ka:return this.matchesIs(e,r);case Ga:return!this.matchesIs(e,r);case Za:return this.matchesContains(e,r);case Ya:return!this.matchesContains(e,r);case Ja:case $a:case Ha:case Xa:return this.matchesComparable(e,t,r,(function(e){return n.parseNumber(e)}),this.comparator);case Qa:case el:case tl:case rl:return this.matchesComparable(e,t,r,(function(e){return Sl.parse(e)}),this.versionComparator);case ul:return this.matchesRegex(e,r);case cl:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some((function(e){return e.toLowerCase()===r}))}return t.some((function(t){return e===t}))},e.prototype.matchesContains=function(e,t){var r,n;try{for(var i=Va(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.toLowerCase().includes(s.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,i){var o=this,s=n(e),a=r.map((function(e){return n(e)})).filter((function(e){return void 0!==e}));return void 0===s||0===a.length?r.some((function(r){return o.comparator(e,t,r)})):a.some((function(e){return i(s,t,e)}))},e.prototype.comparator=function(e,t,r){switch(t){case Ja:case Qa:return e<r;case $a:case el:return e<=r;case Ha:case tl:return e>r;case Xa:case rl:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Ja:case Qa:return n<0;case $a:case el:return n<=0;case Ha:case tl:return n>0;case Xa:case rl:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some((function(t){return Boolean(new RegExp(t).exec(e))}))},e.prototype.containsNone=function(e){return e.some((function(e){return"(none)"===e}))},e.prototype.containsBooleans=function(e){return e.some((function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}}))},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map((function(e){return t.coerceString(e)})).filter(Boolean);var r=String(e);try{var n=JSON.parse(r);return Array.isArray(n)?e.map((function(e){return t.coerceString(e)})).filter(Boolean):(i=this.coerceString(r))?[i]:void 0}catch(e){var i;return(i=this.coerceString(r))?[i]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case nl:case il:case ol:case sl:case al:case ll:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&qa([],Wa(n),!1).every((function(e){return r.has(e)}))},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var i=Va(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!this.matchesIs(s,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var i=Va(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(this.matchesIs(s,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e}(),Il=function(e,t,r){var n,i;void 0===r&&(r=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];r.push(o.key);var s=[],a=function(e){if(r.some((function(t){return t===e})))throw Error("Detected a cycle between flags ".concat(r));var n=Il(e,t,r);n&&s.push.apply(s,qa([],Wa(n),!1))};try{for(var l=Va(o.dependencies),u=l.next();!u.done;u=l.next()){a(u.value)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return s.push(o),r.pop(),delete t[o.key],s}};const xl="function"==typeof btoa,kl="function"==typeof Buffer,El=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),Ol=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Al=((e=>{let t={};e.forEach(((e,r)=>t[e]=r))})(Ol),String.fromCharCode.bind(String)),Rl=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),Pl=e=>{let t,r,n,i,o="";const s=e.length%3;for(let s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=Ol[t>>18&63]+Ol[t>>12&63]+Ol[t>>6&63]+Ol[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},Tl=xl?e=>btoa(e):kl?e=>Buffer.from(e,"binary").toString("base64"):Pl,_l=kl?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(Al.apply(null,e.subarray(r,r+4096)));return Tl(t.join(""))},Ml=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Al(192|t>>>6)+Al(128|63&t):Al(224|t>>>12&15)+Al(128|t>>>6&63)+Al(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Al(240|t>>>18&7)+Al(128|t>>>12&63)+Al(128|t>>>6&63)+Al(128|63&t)},Nl=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Ll=e=>e.replace(Nl,Ml),Dl=kl?e=>Buffer.from(e,"utf8").toString("base64"):El?e=>_l(El.encode(e)):e=>Tl(Ll(e)),Fl=(e,t=!1)=>t?Rl(Dl(e)):Dl(e),Ul=e=>Fl(e,!0),jl=Ul;var Bl=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return Ua(t,e),t}(Error),zl=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return Ua(t,e),t}(Error),Vl=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return Ba(this,void 0,void 0,(function(){var r,n,i,o;return za(this,(function(s){switch(s.label){case 0:return r=jl(JSON.stringify(e)),n={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(n["X-Amp-Exp-Flag-Keys"]=jl(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(n["X-Amp-Exp-Track"]=t.trackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:n,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=s.sent()).status)throw new Bl(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}}))}))},e}(),Wl=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return Ba(this,void 0,void 0,(function(){var t,r;return za(this,(function(n){switch(n.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=jl(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=n.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce((function(e,t){return e[t.key]=t,e}),{})]}}))}))},e}(),ql="undefined"!=typeof globalThis?globalThis:global||self,Kl=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},Gl=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=ql.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(ql.clearInterval(this.poller),this.poller=void 0)},e}(),Zl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Yl={};!function(e,t){!function(r,n){var i="function",o="undefined",s="object",a="string",l="model",u="name",c="type",h="vendor",d="version",p="architecture",f="console",g="mobile",m="tablet",v="smarttv",y="wearable",b="embedded",w="Amazon",S="Apple",C="ASUS",I="BlackBerry",x="Browser",k="Chrome",E="Firefox",O="Google",A="Huawei",R="LG",P="Microsoft",T="Motorola",_="Opera",M="Samsung",N="Sharp",L="Sony",D="Xiaomi",F="Zebra",U="Facebook",j=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},B=function(e,t){return typeof e===a&&-1!==z(t).indexOf(z(e))},z=function(e){return e.toLowerCase()},V=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},W=function(e,t){for(var r,o,a,l,u,c,h=0;h<t.length&&!u;){var d=t[h],p=t[h+1];for(r=o=0;r<d.length&&!u;)if(u=d[r++].exec(e))for(a=0;a<p.length;a++)c=u[++o],typeof(l=p[a])===s&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;h+=2}},q=function(e,t){for(var r in t)if(typeof t[r]===s&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(B(t[r][i],e))return"?"===r?n:r}else if(B(t[r],e))return"?"===r?n:r;return e},K={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},G={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,d],[/opios[\/ ]+([\w\.]+)/i],[d,[u,_+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[u,_]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[u,"UC"+x]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[d,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+x],d],[/\bfocus\/([\w\.]+)/i],[d,[u,E+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[u,_+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[u,_+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[u,"MIUI "+x]],[/fxios\/([-\w\.]+)/i],[d,[u,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+x]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+x],d],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,U],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[u,k+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,k+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[u,"Android "+x]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,d],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[d,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[d,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[d,q,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[u,E+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,d],[/(cobalt)\/([\w\.]+)/i],[u,[d,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,z]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",z]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[h,M],[c,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[h,M],[c,g]],[/((ipod|iphone)\d+,\d+)/i],[l,[h,S],[c,g]],[/(ipad\d+,\d+)/i],[l,[h,S],[c,m]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[h,S],[c,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[h,S],[c,m]],[/(macintosh);/i],[l,[h,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[h,A],[c,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[h,A],[c,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[h,D],[c,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[h,D],[c,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[h,"OPPO"],[c,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[h,"Vivo"],[c,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[h,"Realme"],[c,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[h,T],[c,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[h,T],[c,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[h,R],[c,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[h,R],[c,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[h,"Lenovo"],[c,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[h,"Nokia"],[c,g]],[/(pixel c)\b/i],[l,[h,O],[c,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[h,O],[c,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[h,L],[c,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[h,L],[c,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[h,"OnePlus"],[c,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[h,w],[c,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[h,w],[c,g]],[/(playbook);[-\w\),; ]+(rim)/i],[l,h,[c,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[h,I],[c,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[h,C],[c,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[h,C],[c,g]],[/(nexus 9)/i],[l,[h,"HTC"],[c,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[l,/_/g," "],[c,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[h,"Acer"],[c,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[h,"Meizu"],[c,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[h,N],[c,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,l,[c,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,l,[c,m]],[/(surface duo)/i],[l,[h,P],[c,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[h,"Fairphone"],[c,g]],[/(u304aa)/i],[l,[h,"AT&T"],[c,g]],[/\bsie-(\w*)/i],[l,[h,"Siemens"],[c,g]],[/\b(rct\w+) b/i],[l,[h,"RCA"],[c,m]],[/\b(venue[\d ]{2,7}) b/i],[l,[h,"Dell"],[c,m]],[/\b(q(?:mv|ta)\w+) b/i],[l,[h,"Verizon"],[c,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[h,"Barnes & Noble"],[c,m]],[/\b(tm\d{3}\w+) b/i],[l,[h,"NuVision"],[c,m]],[/\b(k88) b/i],[l,[h,"ZTE"],[c,m]],[/\b(nx\d{3}j) b/i],[l,[h,"ZTE"],[c,g]],[/\b(gen\d{3}) b.+49h/i],[l,[h,"Swiss"],[c,g]],[/\b(zur\d{3}) b/i],[l,[h,"Swiss"],[c,m]],[/\b((zeki)?tb.*\b) b/i],[l,[h,"Zeki"],[c,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],l,[c,m]],[/\b(ns-?\w{0,9}) b/i],[l,[h,"Insignia"],[c,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[h,"NextBook"],[c,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],l,[c,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],l,[c,g]],[/\b(ph-1) /i],[l,[h,"Essential"],[c,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[h,"Envizen"],[c,m]],[/\b(trio[-\w\. ]+) b/i],[l,[h,"MachSpeed"],[c,m]],[/\btu_(1491) b/i],[l,[h,"Rotor"],[c,m]],[/(shield[\w ]+) b/i],[l,[h,"Nvidia"],[c,m]],[/(sprint) (\w+)/i],[h,l,[c,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,P],[c,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[h,F],[c,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[h,F],[c,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,l,[c,f]],[/droid.+; (shield) bui/i],[l,[h,"Nvidia"],[c,f]],[/(playstation [345portablevi]+)/i],[l,[h,L],[c,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[h,P],[c,f]],[/smart-tv.+(samsung)/i],[h,[c,v]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,M],[c,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,R],[c,v]],[/(apple) ?tv/i],[h,[l,S+" TV"],[c,v]],[/crkey/i],[[l,k+"cast"],[h,O],[c,v]],[/droid.+aft(\w)( bui|\))/i],[l,[h,w],[c,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[h,N],[c,v]],[/(bravia[\w ]+)( bui|\))/i],[l,[h,L],[c,v]],[/(mitv-\w{5}) bui/i],[l,[h,D],[c,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,V],[l,V],[c,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,v]],[/((pebble))app/i],[h,l,[c,y]],[/droid.+; (glass) \d/i],[l,[h,O],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[h,F],[c,y]],[/(quest( 2)?)/i],[l,[h,U],[c,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[c,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,m]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,g]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[d,q,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[d,q,K]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[d,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,d],[/\(bb(10);/i],[d,[u,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[u,E+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[u,k+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,d],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,d]]},Z=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof Z))return new Z(e,t).getResult();var i=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),f=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(G,t):G;return this.getBrowser=function(){var e={};return e[u]=n,e[d]=n,W.call(e,i,f.browser),e.major=function(e){return typeof e===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e.version),e},this.getCPU=function(){var e={};return e[p]=n,W.call(e,i,f.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[l]=n,e[c]=n,W.call(e,i,f.device),e},this.getEngine=function(){var e={};return e[u]=n,e[d]=n,W.call(e,i,f.engine),e},this.getOS=function(){var e={};return e[u]=n,e[d]=n,W.call(e,i,f.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===a&&e.length>350?V(e,350):e,this},this.setUA(i),this};Z.VERSION="0.7.33",Z.BROWSER=j([u,d,"major"]),Z.CPU=j([p]),Z.DEVICE=j([l,h,c,f,g,v,m,y,b]),Z.ENGINE=Z.OS=j([u,d]),e.exports&&(t=e.exports=Z),t.UAParser=Z;var Y=typeof r!==o&&(r.jQuery||r.Zepto);if(Y&&!Y.ua){var J=new Z;Y.ua=J.getResult(),Y.ua.get=function(){return J.getUA()},Y.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var r in t)Y.ua[r]=t[r]}}}("object"==typeof window?window:Zl)}({get exports(){return Yl},set exports(e){Yl=e}},Yl);var Jl=function(){return Jl=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Jl.apply(this,arguments)};function $l(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function Hl(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function Xl(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ql(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function eu(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var tu=function(e,t){var r,n;void 0===t&&(t=!1);var i=ru(e,t),o=void 0,s=ql.document.cookie.split("; ");try{for(var a=Xl(s),l=a.next();!l.done;l=a.next()){var u=Ql(l.value.split("=",2),2),c=u[0],h=u[1];c===i&&(o=decodeURIComponent(h))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}if(o)try{if(t){var d=atob(o);return JSON.parse(decodeURIComponent(d))}var p=o.split("."),f=void 0;return p.length>=2&&p[1]&&(f=atob(p[1])),{deviceId:p[0],userId:f}}catch(e){return}},ru=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},nu=function(){function e(e,t,r){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return $l(this,void 0,void 0,(function(){return Hl(this,(function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener((function(){null==t||t.fetch()})),[2,this.waitForConnectorIdentity(this.timeoutMillis)]}))}))},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=tu(this.apiKey,!0);return(e||(e=tu(this.apiKey,!1))||(e=function(e){var t=ru(e,!0);try{var r=ql.localStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=ru(e,!0);try{var r=ql.sessionStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return $l(this,void 0,void 0,(function(){var t,r=this;return Hl(this,(function(n){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise((function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)})),new Promise((function(t,r){ql.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")}))])]}))}))},e}();var iu,ou,su=ql.fetch||function(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],s=[],a={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return s},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),s.push([t,r]),a[t]=a[t]?a[t]+","+r:r})),r(l())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)}))},au=function(){function e(e){this.client=e}return e.prototype.request=function(e){return $l(this,void 0,void 0,(function(){return Hl(this,(function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}}))}))},e}(),lu={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise((function(r,n){ql.setTimeout((function(){n(new zl("Request timeout after "+t+" milliseconds"))}),t),e.then(r,n)}))}($l(void 0,void 0,void 0,(function(){var i,o;return Hl(this,(function(s){switch(s.label){case 0:return[4,su(e,{method:t,headers:r,body:n})];case 1:return i=s.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=s.sent(),[2,o]}}))})),i)}};!function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(iu||(iu={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}(ou||(ou={}));var uu=function(e){return!e||e===ou.FallbackInline||e===ou.FallbackConfig||e===ou.SecondaryInitialVariants},cu={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:iu.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:lu},hu="1.15.5",du=function(){function e(e,t){var r,n=this;this.isReady=new Promise((function(e){n.resolve=e})),this.config=e,this.client=t;var i=null!==(r=e.instanceName)&&void 0!==r?r:cu.instanceName;this.queue=new fu(i),this.cache=new pu(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then((function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}),(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()})):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e){if(this.cache.shouldTrack(e)){var t=this.getExposureEvent(e);this.queue.push(t)}},e.prototype.getExposureEvent=function(e){var t,r,n,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:"web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),pu=function(){function e(e){this.isSessionStorageAvailable=gu(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&ql.sessionStorage.removeItem("EXP_sent_".concat(e))}return e.prototype.shouldTrack=function(e){var t;if("web"===(null===(t=e.metadata)||void 0===t?void 0:t.deliveryMethod))return!0;this.loadCache();var r=this.inMemoryCache[e.flag_key],n=!1;return r&&r.variant===e.variant||(n=!0,this.inMemoryCache[e.flag_key]=e),this.storeCache(),n},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=ql.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&ql.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),fu=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=function(){var e=Kl();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1}(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=ql.setInterval((function(){t.loadFlushStore()}),1e3),this.loadFlushStore()},e.prototype.flush=function(){var e,t;if(this.tracker&&0!==this.inMemoryQueue.length){try{for(var r=Xl(this.inMemoryQueue),n=r.next();!n.done;n=r.next()){var i=n.value;if(!this.tracker(i))return}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.inMemoryQueue=[],this.poller&&(ql.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=ql.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),ql.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),gu=function(){var e=Kl();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},mu=function(){function e(){this.globalScope=Kl()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),vu=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return Jl({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=Xl(Object.keys(e)),i=n.next();!i.done;i=n.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,r,n=this.storage.get(this.namespace);try{r=JSON.parse(n)||{}}catch(e){return}var i={};try{for(var o=Xl(Object.keys(r)),s=o.next();!s.done;s=o.next()){var a=s.value;try{var l=void 0;(l=this.transformer?this.transformer(r[a]):r[a])&&(i[a]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),yu=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,r=e.value,n=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var s={};return t?s.key=t:r&&(s.key=r),r&&(s.value=r),i&&(s.metadata=i),n&&(s.payload=n),o&&(s.expKey=o),s}},bu=function(){function e(){this.globalScope=Kl()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),wu=function(e){return null==e},Su=function(e){return!!wu(e)||e&&0===Object.keys(e).length},Cu=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},Iu=function(){function e(e,t,r,n){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=r,this.scalar=n}return e.prototype.start=function(e){return $l(this,void 0,void 0,(function(){return Hl(this,(function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}}))}))},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return $l(this,void 0,void 0,(function(){var n=this;return Hl(this,(function(i){return this.done||(this.timeoutHandle=ql.setTimeout((function(){return $l(n,void 0,void 0,(function(){var n,i;return Hl(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(n=t+1)<this.attempts&&(i=Math.min(r*this.scalar,this.max),this.backoff(e,n,i)),[3,3];case 3:return[2]}}))}))}),r)),[2]}))}))},e}(),xu=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},ku=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r},Eu=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),Ou=function(){function e(e){this.tracked={},this.exposureTrackingProvider=e}return e.prototype.track=function(e){var t=this.tracked[e.flag_key];t&&t.variant===e.variant||(this.tracked[e.flag_key]=e,this.exposureTrackingProvider.track(e))},e}(),Au=function(){function e(e,t){var r,n,i,o,s=this;this.engine=new Cl,this.isRunning=!1,this.apiKey=e,this.config=Jl(Jl(Jl({},cu),t),{serverUrl:(null==t?void 0:t.serverUrl)||("eu"===(null===(r=null==t?void 0:t.serverZone)||void 0===r?void 0:r.toLowerCase())?"https://api.lab.eu.amplitude.com":cu.serverUrl),flagsServerUrl:(null==t?void 0:t.flagsServerUrl)||("eu"===(null===(n=null==t?void 0:t.serverZone)||void 0===n?void 0:n.toLowerCase())?"https://flag.lab.eu.amplitude.com":cu.flagsServerUrl),flagConfigPollingIntervalMillis:t.flagConfigPollingIntervalMillis<6e4?6e4:null!==(i=t.flagConfigPollingIntervalMillis)&&void 0!==i?i:cu.flagConfigPollingIntervalMillis});var a=null===(o=this.config)||void 0===o?void 0:o.internalInstanceNameSuffix;if(this.isWebExperiment="web"===a,this.poller=new Gl((function(){return s.doFlags()}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var l in this.config.initialVariants)this.config.initialVariants[l]=yu(this.config.initialVariants[l]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new Eu(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.exposureTrackingProvider=new Ou(this.config.exposureTrackingProvider)),this.integrationManager=new du(this.config,this);var u,c=new au(this.config.httpClient||lu);this.flagApi=new Wl(this.apiKey,this.config.flagsServerUrl,c),this.evaluationApi=new Vl(this.apiKey,this.config.serverUrl,c);var h=a?"".concat(this.config.instanceName,"-").concat(a):this.config.instanceName;u=this.isWebExperiment?new bu:new mu,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new vu(i,r,yu)}(this.apiKey,h,u),this.flags=function(e,t,r){void 0===r&&(r=new mu);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new vu(i,r)}(this.apiKey,h,u);try{this.flags.load(),this.variants.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){var t;return $l(this,void 0,void 0,(function(){var r;return Hl(this,(function(n){switch(n.label){case 0:return this.isRunning?[2]:(this.isRunning=!0,this.setUser(e),r=this.doFlags(),null===(t=this.config.fetchOnStart)||void 0===t||t?[4,Promise.all([this.fetch(e),r])]:[3,2]);case 1:return n.sent(),[3,4];case 2:return[4,r];case 3:n.sent(),n.label=4;case 4:return this.config.pollOnStart&&this.poller.start(),[2]}}))}))},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(e,t){return void 0===e&&(e=this.user),$l(this,void 0,void 0,(function(){var r;return Hl(this,(function(n){switch(n.label){case 0:this.setUser(e||{}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),this.config.debug&&(r instanceof zl?console.debug(r):console.error(r)),[3,4];case 4:return[2,this]}}))}))},e.prototype.variant=function(e,t){var r,n;if(!this.apiKey)return{value:void 0};var i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.debug("[Experiment] variant for ".concat(e," is ").concat((null===(r=i.variant)||void 0===r?void 0:r.key)||(null===(n=i.variant)||void 0===n?void 0:n.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var r=this.flags.get(t);Cu(r)||delete e[t]}return Jl(Jl(Jl({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=Jl({},this.user.user_properties);return Jl(Jl({},this.user),{user_properties:t})}return Jl({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=Jl({},e.user_properties);this.user=Jl(Jl({},e),{user_properties:r})}else this.user=Jl({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach((function(t){e.flags.get(t.key)||e.flags.put(t.key,t)}))},e.prototype.evaluate=function(e){var t,r,n=this.addContext(this.user),i=function(e,t){var r,n,i=ja({},e),o=[],s=t||Object.keys(i);try{for(var a=Va(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=Il(u,i);c&&o.push.apply(o,qa([],Wa(c),!1))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}(this.flags.getAll(),e),o=function(e){var t,r,n,i;if(!e)return{};var o={user:e},s=Kl();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=Xl(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,h=e.groups[c];if(h.length>0&&h[0]){var d=h[0],p={group_name:d},f=null===(i=null===(n=e.group_properties)||void 0===n?void 0:n[c])||void 0===i?void 0:i[d];f&&Object.keys(f).length>0&&(p.group_properties=f),a[c]=p}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return Object.keys(a).length>0&&(o.groups=a),delete o.user.groups,delete o.user.group_properties,o}(n),s=this.engine.evaluate(o,i),a={};try{for(var l=Xl(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=ku(s[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return a},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===iu.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===iu.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(Cu(n)||!r.variant&&n)&&(r=this.localEvaluationVariantAndSource(e,n,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var n,i={},o=this.evaluate([t.key])[e],s=ou.LocalEvaluation,a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!wu(o)&&!a)return{variant:xu(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:xu(o),source:s,hasDefaultVariant:!0}),!wu(r))return{variant:xu(r),source:ou.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!wu(l))return{variant:xu(l),source:ou.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=xu(this.config.fallbackVariant),c={variant:u,source:ou.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return Su(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var r,n={},i=this.variants.get(e),o=null===(r=null==i?void 0:i.metadata)||void 0===r?void 0:r.default;if(!wu(i)&&!o)return{variant:xu(i),source:ou.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:xu(i),source:ou.LocalStorage,hasDefaultVariant:!0}),!wu(t))return{variant:xu(t),source:ou.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!wu(s))return{variant:xu(s),source:ou.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var a=xu(this.config.fallbackVariant),l={variant:a,source:ou.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Su(a)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!wu(i))return{variant:xu(i),source:ou.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!wu(o)&&!s)return{variant:xu(o),source:ou.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:xu(o),source:ou.LocalStorage,hasDefaultVariant:!0}),!wu(t))return{variant:xu(t),source:ou.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=xu(this.config.fallbackVariant),l={variant:a,source:ou.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Su(a)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return $l(this,void 0,void 0,(function(){var i,o;return Hl(this,(function(s){switch(s.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,this.doFetch(e,t,n)];case 2:return i=s.sent(),[4,this.storeVariants(i,n)];case 3:return s.sent(),[2,i];case 4:throw o=s.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}}))}))},e.prototype.cleanUserPropsForFetch=function(e){var t=Jl({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return $l(this,void 0,void 0,(function(){var n,i,o,s,a,l,u;return Hl(this,(function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Jl({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=Xl(Object.keys(n)),s=o.next();!s.done;s=o.next())a=s.value,i[a]=ku(n[a])}catch(e){l={error:e}}finally{try{s&&!s.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.debug("[Experiment] Received variants: ",i),[2,i]}}))}))},e.prototype.doFlags=function(){return $l(this,void 0,void 0,(function(){var e,t,r;return Hl(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=n.sent(),n.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:hu,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=n.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((r=n.sent())instanceof zl))throw r;return this.config.debug&&console.debug(r),[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}}))}))},e.prototype.storeVariants=function(e,t){return $l(this,void 0,void 0,(function(){var r,n,i,o;return Hl(this,(function(s){for(o in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),n=function(t){r=r.filter((function(e){return e!==t})),i.variants.put(t,e[t])},i=this,e)n(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.debug("[Experiment] Stored variants: ",e),[2]}))}))},e.prototype.startRetries=function(e,t){return $l(this,void 0,void 0,(function(){var r=this;return Hl(this,(function(n){return this.debug("[Experiment] Retry fetch"),this.retriesBackoff=new Iu(8,500,1e4,1.5),this.retriesBackoff.start((function(){return $l(r,void 0,void 0,(function(){return Hl(this,(function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}}))}))})),[2]}))}))},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),n=this.integrationManager.getUser(),i=Jl(Jl(Jl({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return Jl(Jl(Jl(Jl({library:"experiment-js-client/".concat(hu)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return $l(this,void 0,void 0,(function(){return Hl(this,(function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}}))}))},e.prototype.sourceVariants=function(){return this.config.source==iu.LocalStorage?this.variants.getAll():this.config.source==iu.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==iu.LocalStorage?this.config.initialVariants:this.config.source==iu.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var r,n,i,o,s,a,l,u,c;if(null===(i=null===(n=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var h={flag_key:e},d=uu(t.source);if(!d||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(h.experiment_key=null===(s=t.variant)||void 0===s?void 0:s.expKey);var p=null===(a=t.variant)||void 0===a?void 0:a.metadata;d||(null==p?void 0:p.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?h.variant=t.variant.key:(null===(u=t.variant)||void 0===u?void 0:u.value)&&(h.variant=t.variant.value)),p&&(h.metadata=p),null===(c=this.exposureTrackingProvider)||void 0===c||c.track(h),this.integrationManager.track(h)}}},e.prototype.legacyExposureInternal=function(e,t,r){var n,i,o,s,a;if(this.analyticsProvider){var l=function(e,t,r,n){var i,o=null==r?void 0:r.value,s="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:r,userProperty:s,properties:{key:t,variant:o,source:n},userProperties:(i={},i[s]=o,i)}}(this.addContext(this.getUser()),e,t,r);uu(r)||!(null==t?void 0:t.value)?null===(i=null===(n=this.analyticsProvider)||void 0===n?void 0:n.unsetUserProperty)||void 0===i||i.call(n,l):(null==t?void 0:t.value)&&(null===(s=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===s||s.call(o,l),null===(a=this.analyticsProvider)||void 0===a||a.track(l))}},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.config.debug&&console.debug.apply(console,eu([e],Ql(t),!1))},e.prototype.shouldRetryFetch=function(e){return!(e instanceof Bl)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),Ru=function(){function e(e,t){var r,n,i;this.globalScope=Kl(),this.userAgent=void 0!==(null===(r=this.globalScope)||void 0===r?void 0:r.navigator)?null===(n=this.globalScope)||void 0===n?void 0:n.navigator.userAgent:void 0,this.ua=new Yl.UAParser(this.userAgent).getResult(),this.localStorage=new mu,this.sessionStorage=new bu,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,n,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return Jl({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(i=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,n,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===n?void 0:n.cookie)||void 0===i?void 0:i.split("; ").map((function(e){return e.split("=")})))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,r;if(this.globalScope){var n={};try{var i=new URL(this.globalScope.location.href);try{for(var o=Xl(i.searchParams),s=o.next();!s.done;s=o.next()){var a=Ql(s.value,2),l=a[0],u=a[1];n[l]=eu(eu([],Ql(null!==(r=n[l])&&void 0!==r?r:[]),!1),Ql(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(n).reduce((function(e,t){var r=Ql(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e}),{})}},e}();ql.experimentInstances={};var Pu,Tu=ql.experimentInstances,_u=function(e){return(null==e?void 0:e.instanceName)||cu.instanceName},Mu=function(e,t,r){var n=function(e,t){var r=_u(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=Tu[n];return i||(i=function(e,t){return new Au(e,Jl(Jl({},t),{userProvider:new Ru(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),Tu[n]=i,i)},Nu=function(){function e(t){this.name=e.pluginName,this.config=t}return e.prototype.setup=function(e,t){var r;return a(this,void 0,void 0,(function(){return l(this,(function(t){return this.experiment=function(e,t){return Mu(e,t,(function(){return new nu(e,ee.getInstance(_u(t)),1e4)}))}((null===(r=this.config)||void 0===r?void 0:r.deploymentKey)||e.apiKey,this.config),[2]}))}))},e.pluginName="@amplitude/experiment-analytics-plugin",e}(),Lu=function(e){return new Nu(e)},Du=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"experiment",{get:function(){if(void 0!==this.config){var e=this.plugins(Nu);return 0===e.length?void this.config.loggerProvider.debug("".concat(Nu.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat(Nu.pluginName," are found."))}},enumerable:!1,configurable:!0}),t.prototype.initAll=function(t,r){return a(this,void 0,void 0,(function(){var n,i;return l(this,(function(s){switch(s.label){case 0:return n={serverZone:null==r?void 0:r.serverZone,instanceName:null==r?void 0:r.instanceName},e.prototype.add.call(this,{type:"enrichment",name:"@amplitude/unified-library-plugin",execute:function(e){var t;return a(this,void 0,void 0,(function(){return l(this,(function(r){return e.library="".concat("amplitude-ts-unified","/").concat("1.0.0-beta.5","-").concat(null!==(t=e.library)&&void 0!==t?t:""),[2,e]}))}))}}),[4,e.prototype.init.call(this,t,o(o({},null==r?void 0:r.analytics),n)).promise];case 1:return s.sent(),[4,e.prototype.add.call(this,(u=o(o({},null==r?void 0:r.sessionReplay),n),new Da(u))).promise];case 2:return s.sent(),[4,e.prototype.add.call(this,Lu(o(o({},null==r?void 0:r.experiment),n))).promise];case 3:return s.sent(),void 0===(i=this.plugin(Da.pluginName))?this.config.loggerProvider.debug("".concat(Da.pluginName," plugin is not found.")):this.sessionReplay=i.sessionReplay,[2]}var u}))}))},t.prototype.init=function(t,r,n){return void 0===t&&(t=""),e.prototype.init.call(this,t,r,n)},t}(Xi),Fu=function(){var e=new Du;return{experiment:e.experiment,sessionReplay:e.sessionReplay,initAll:he(e.initAll.bind(e),"initAll",le(e),ce(e,["config"])),init:he(e.init.bind(e),"init",le(e),ce(e,["config"])),add:he(e.add.bind(e),"add",le(e),ce(e,["config.apiKey","timeline.plugins"])),remove:he(e.remove.bind(e),"remove",le(e),ce(e,["config.apiKey","timeline.plugins"])),track:he(e.track.bind(e),"track",le(e),ce(e,["config.apiKey","timeline.queue.length"])),logEvent:he(e.logEvent.bind(e),"logEvent",le(e),ce(e,["config.apiKey","timeline.queue.length"])),identify:he(e.identify.bind(e),"identify",le(e),ce(e,["config.apiKey","timeline.queue.length"])),groupIdentify:he(e.groupIdentify.bind(e),"groupIdentify",le(e),ce(e,["config.apiKey","timeline.queue.length"])),setGroup:he(e.setGroup.bind(e),"setGroup",le(e),ce(e,["config.apiKey","timeline.queue.length"])),revenue:he(e.revenue.bind(e),"revenue",le(e),ce(e,["config.apiKey","timeline.queue.length"])),flush:he(e.flush.bind(e),"flush",le(e),ce(e,["config.apiKey","timeline.queue.length"])),getUserId:he(e.getUserId.bind(e),"getUserId",le(e),ce(e,["config","config.userId"])),setUserId:he(e.setUserId.bind(e),"setUserId",le(e),ce(e,["config","config.userId"])),getDeviceId:he(e.getDeviceId.bind(e),"getDeviceId",le(e),ce(e,["config","config.deviceId"])),setDeviceId:he(e.setDeviceId.bind(e),"setDeviceId",le(e),ce(e,["config","config.deviceId"])),reset:he(e.reset.bind(e),"reset",le(e),ce(e,["config","config.userId","config.deviceId"])),getSessionId:he(e.getSessionId.bind(e),"getSessionId",le(e),ce(e,["config"])),setSessionId:he(e.setSessionId.bind(e),"setSessionId",le(e),ce(e,["config"])),extendSession:he(e.extendSession.bind(e),"extendSession",le(e),ce(e,["config"])),setOptOut:he(e.setOptOut.bind(e),"setOptOut",le(e),ce(e,["config"])),setTransport:he(e.setTransport.bind(e),"setTransport",le(e),ce(e,["config"]))}},Uu=Fu(),ju=Uu.initAll,Bu=Uu.experiment,zu=Uu.sessionReplay,Vu=Uu.add,Wu=Uu.extendSession,qu=Uu.flush,Ku=Uu.getDeviceId,Gu=Uu.getSessionId,Zu=Uu.getUserId,Yu=Uu.groupIdentify,Ju=Uu.identify,$u=Uu.logEvent,Hu=Uu.remove,Xu=Uu.reset,Qu=Uu.revenue,ec=Uu.setDeviceId,tc=Uu.setGroup,rc=Uu.setOptOut,nc=Uu.setSessionId,ic=Uu.setTransport,oc=Uu.setUserId,sc=Uu.track,ac=Object.defineProperty,lc=(e,t,r)=>((e,t,r)=>t in e?ac(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),uc=Object.defineProperty,cc=(e,t,r)=>((e,t,r)=>t in e?uc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),hc=Object.defineProperty,dc=(e,t,r)=>((e,t,r)=>t in e?hc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const pc={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fc={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gc={};function mc(e){if(gc[e])return gc[e];const t=globalThis[e],r=t.prototype,n=e in pc?pc[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in fc?fc[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return gc[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?gc[e]=o:r}catch{return r}}const vc={};function yc(e,t,r){var n;const i=`${e}.${String(r)}`;if(vc[i])return vc[i].call(t);const o=mc(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(vc[i]=s,s.call(t)):t[r]}const bc={};function wc(e,t,r){const n=`${e}.${String(r)}`;if(bc[n])return bc[n].bind(t);const i=mc(e)[r];return"function"!=typeof i?t[r]:(bc[n]=i,i.bind(t))}const Sc={childNodes:function(e){return yc("Node",e,"childNodes")},parentNode:function(e){return yc("Node",e,"parentNode")},parentElement:function(e){return yc("Node",e,"parentElement")},textContent:function(e){return yc("Node",e,"textContent")},contains:function(e,t){return wc("Node",e,"contains")(t)},getRootNode:function(e){return wc("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?yc("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?yc("Element",e,"shadowRoot"):null},querySelector:function(e,t){return yc("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return yc("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return mc("MutationObserver").constructor}};class Cc{constructor(){dc(this,"idNodeMap",new Map),dc(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ic(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Ic(Sc.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Ic(Sc.parentNode(e),t,r)}function xc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function kc(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var Ec={exports:{}},Oc=String,Ac=function(){return{isColorSupported:!1,reset:Oc,bold:Oc,dim:Oc,italic:Oc,underline:Oc,inverse:Oc,hidden:Oc,strikethrough:Oc,black:Oc,red:Oc,green:Oc,yellow:Oc,blue:Oc,magenta:Oc,cyan:Oc,white:Oc,gray:Oc,bgBlack:Oc,bgRed:Oc,bgGreen:Oc,bgYellow:Oc,bgBlue:Oc,bgMagenta:Oc,bgCyan:Oc,bgWhite:Oc}};Ec.exports=Ac(),Ec.exports.createColors=Ac;var Rc=Ec.exports;const Pc=kc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Tc=Rc,_c=Pc,Mc=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Tc.isColorSupported),_c&&e&&(t=_c(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Tc.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Nc=Mc;Mc.default=Mc;var Lc={};Lc.isClean=Symbol("isClean"),Lc.my=Symbol("my");const Dc={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Fc=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="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");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Dc[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=Dc[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(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)}};var Uc=Fc;Fc.default=Fc;let jc=Uc;function Bc(e,t){new jc(t).stringify(e)}var zc=Bc;Bc.default=Bc;let{isClean:Vc,my:Wc}=Lc,qc=Nc,Kc=Uc,Gc=zc;function Zc(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>Zc(e,r))):("object"===o&&null!==i&&(i=Zc(i)),r[n]=i)}return r}let Yc=class{constructor(e={}){this.raws={},this[Vc]=!1,this[Wc]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Zc(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new qc(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Vc]){this[Vc]=!1;let e=this;for(;e=e.parent;)e[Vc]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Kc).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Gc){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var Jc=Yc;Yc.default=Yc;let $c=Jc,Hc=class extends $c{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Xc=Hc;Hc.default=Hc;var Qc={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:eh,SourceMapGenerator:th}=Pc,{existsSync:rh,readFileSync:nh}=Pc,{dirname:ih,join:oh}=Pc;let sh=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ih(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new eh(this.text)),this.consumerCache}decodeInline(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;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=ih(e),rh(e))return this.mapFile=e,nh(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof eh)return th.fromSourceMap(t).toString();if(t instanceof th)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=oh(ih(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var ah=sh;sh.default=sh;let{SourceMapConsumer:lh,SourceMapGenerator:uh}=Pc,{fileURLToPath:ch,pathToFileURL:hh}=Pc,{isAbsolute:dh,resolve:ph}=Pc,{nanoid:fh}=Qc,gh=Pc,mh=Nc,vh=ah,yh=Symbol("fromOffsetCache"),bh=Boolean(lh&&uh),wh=Boolean(ph&&dh),Sh=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!wh||/^\w+:\/\//.test(t.from)||dh(t.from)?this.file=t.from:this.file=ph(t.from)),wh&&bh){let e=new vh(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+fh(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new mh(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new mh(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(hh&&(i.input.url=hh(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[yh])r=this[yh];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[yh]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ph(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=dh(a.source)?hh(a.source):new URL(a.source,this.map.consumer().sourceRoot||hh(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!ch)throw new Error("file: protocol is not available in this PostCSS build");l.file=ch(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Ch=Sh;Sh.default=Sh,gh&&gh.registerInput&&gh.registerInput(Sh);let{SourceMapConsumer:Ih,SourceMapGenerator:xh}=Pc,{dirname:kh,relative:Eh,resolve:Oh,sep:Ah}=Pc,{pathToFileURL:Rh}=Pc,Ph=Ch,Th=Boolean(Ih&&xh),_h=Boolean(kh&&Oh&&Eh&&Ah);var Mh=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;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";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||kh(e.file);!1===this.mapOpts.sourcesContent?(t=new Ih(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),_h&&Th&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=xh.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new xh({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>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new xh({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?kh(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=kh(Oh(r,this.mapOpts.annotation)));let n=Eh(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new Ph(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(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))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Rh){let t=Rh(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Ah&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Nh=Jc,Lh=class extends Nh{constructor(e){super(e),this.type="comment"}};var Dh=Lh;Lh.default=Lh;let Fh,Uh,jh,Bh,{isClean:zh,my:Vh}=Lc,Wh=Xc,qh=Dh,Kh=Jc;function Gh(e){return e.map((e=>(e.nodes&&(e.nodes=Gh(e.nodes)),delete e.source,e)))}function Zh(e){if(e[zh]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Zh(t)}let Yh=class e extends Kh{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Gh(Fh(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Wh(t)]}else if(t.selector)t=[new Uh(t)];else if(t.name)t=[new jh(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new qh(t)]}return t.map((t=>(t[Vh]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[zh]&&Zh(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Yh.registerParse=e=>{Fh=e},Yh.registerRule=e=>{Uh=e},Yh.registerAtRule=e=>{jh=e},Yh.registerRoot=e=>{Bh=e};var Jh=Yh;Yh.default=Yh,Yh.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,jh.prototype):"rule"===e.type?Object.setPrototypeOf(e,Uh.prototype):"decl"===e.type?Object.setPrototypeOf(e,Wh.prototype):"comment"===e.type?Object.setPrototypeOf(e,qh.prototype):"root"===e.type&&Object.setPrototypeOf(e,Bh.prototype),e[Vh]=!0,e.nodes&&e.nodes.forEach((e=>{Yh.rebuild(e)}))};let $h,Hh,Xh=Jh,Qh=class extends Xh{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new $h(new Hh,this,e).stringify()}};Qh.registerLazyResult=e=>{$h=e},Qh.registerProcessor=e=>{Hh=e};var ed=Qh;Qh.default=Qh;let td={};var rd=function(e){td[e]||(td[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let nd=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){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}};var id=nd;nd.default=nd;let od=id,sd=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new od(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var ad=sd;sd.default=sd;const ld="'".charCodeAt(0),ud='"'.charCodeAt(0),cd="\\".charCodeAt(0),hd="/".charCodeAt(0),dd="\n".charCodeAt(0),pd=" ".charCodeAt(0),fd="\f".charCodeAt(0),gd="\t".charCodeAt(0),md="\r".charCodeAt(0),vd="[".charCodeAt(0),yd="]".charCodeAt(0),bd="(".charCodeAt(0),wd=")".charCodeAt(0),Sd="{".charCodeAt(0),Cd="}".charCodeAt(0),Id=";".charCodeAt(0),xd="*".charCodeAt(0),kd=":".charCodeAt(0),Ed="@".charCodeAt(0),Od=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ad=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Rd=/.[\r\n"'(/\\]/,Pd=/[\da-f]/i;let Td=Jh,_d=class extends Td{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Md=_d;_d.default=_d,Td.registerAtRule(_d);let Nd,Ld,Dd=Jh,Fd=class extends Dd{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Nd(new Ld,this,e).stringify()}};Fd.registerLazyResult=e=>{Nd=e},Fd.registerProcessor=e=>{Ld=e};var Ud=Fd;Fd.default=Fd,Dd.registerRoot(Fd);let jd={comma:e=>jd.split(e,[","],!0),space:e=>jd.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var Bd=jd;jd.default=jd;let zd=Jh,Vd=Bd,Wd=class extends zd{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Vd.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var qd=Wd;Wd.default=Wd,zd.registerRule(Wd);let Kd=Xc,Gd=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case dd:case pd:case gd:case md:case fd:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===pd||r===dd||r===gd||r===md||r===fd);h=["space",d.slice(g,n)],g=n-1;break;case vd:case yd:case Sd:case Cd:case kd:case Id:case wd:{let e=String.fromCharCode(r);h=[e,e,g];break}case bd:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==ld&&c!==ud&&c!==pd&&c!==dd&&c!==gd&&c!==fd&&c!==md){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===cd;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||Rd.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case ld:case ud:i=r===ld?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===cd;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Ed:Od.lastIndex=g+1,Od.test(d),n=0===Od.lastIndex?d.length-1:Od.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case cd:for(n=g,s=!0;d.charCodeAt(n+1)===cd;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==hd&&r!==pd&&r!==dd&&r!==gd&&r!==md&&r!==fd&&(n+=1,Pd.test(d.charAt(n)))){for(;Pd.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===pd&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===hd&&d.charCodeAt(g+1)===xd?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(Ad.lastIndex=g+1,Ad.test(d),n=0===Ad.lastIndex?d.length-1:Ad.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},Zd=Dh,Yd=Md,Jd=Ud,$d=qd;const Hd={empty:!0,space:!0};var Xd=class{constructor(e){this.input=e,this.root=new Jd,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,i=new Yd;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?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){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.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=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Zd;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Gd(this.input)}decl(e,t){let r=new Kd;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new $d;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(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)}endFile(){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())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(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)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[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()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",Hd[a]||Hd[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new $d;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let Qd=Jh,ep=Xd,tp=Ch;function rp(e,t){let r=new tp(e,t),n=new ep(r);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}var np=rp;rp.default=rp,Qd.registerParse(rp);let{isClean:ip,my:op}=Lc,sp=Mh,ap=zc,lp=Jh,up=ed,cp=rd,hp=ad,dp=np,pp=Ud;const fp={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},gp={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},mp={Once:!0,postcssPlugin:!0,prepare:!0};function vp(e){return"object"==typeof e&&"function"==typeof e.then}function yp(e){let t=!1,r=fp[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function bp(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:yp(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function wp(e){return e[ip]=!1,e.nodes&&e.nodes.forEach((e=>wp(e))),e}let Sp={},Cp=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof hp)i=wp(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=dp;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[op]&&lp.rebuild(i)}else i=wp(r);this.result=new hp(t,i,n),this.helpers={...Sp,postcss:Sp,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!gp[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!mp[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(vp(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ip];){e[ip]=!0;let t=[bp(e)];for(;t.length>0;){let e=this.visitTick(t);if(vp(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return vp(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=ap;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new sp(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(vp(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ip];)e[ip]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||cp("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)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(vp(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[ip])return n[ip]=!0,void e.push(bp(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[ip]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[ip]=!0;let t=yp(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[ip]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Cp.registerPostcss=e=>{Sp=e};var Ip=Cp;Cp.default=Cp,pp.registerLazyResult(Cp),up.registerLazyResult(Cp);let xp=Mh,kp=zc,Ep=rd,Op=np;const Ap=ad;let Rp=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i=kp;this.result=new Ap(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new xp(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Ep("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)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Op;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Pp=Rp;Rp.default=Rp;let Tp=Pp,_p=Ip,Mp=ed,Np=Ud,Lp=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" 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.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new _p(this,e,t):new Tp(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Dp=Lp;Lp.default=Lp,Np.registerProcessor(Lp),Mp.registerProcessor(Lp);let Fp=Xc,Up=ah,jp=Dh,Bp=Md,zp=Ch,Vp=Ud,Wp=qd;function qp(e,t){if(Array.isArray(e))return e.map((e=>qp(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:zp.prototype};r.map&&(r.map={...r.map,__proto__:Up.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>qp(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Vp(n);if("decl"===n.type)return new Fp(n);if("rule"===n.type)return new Wp(n);if("comment"===n.type)return new jp(n);if("atrule"===n.type)return new Bp(n);throw new Error("Unknown node type: "+e.type)}var Kp=qp;qp.default=qp;let Gp=Nc,Zp=Xc,Yp=Ip,Jp=Jh,$p=Dp,Hp=zc,Xp=Kp,Qp=ed,ef=id,tf=Dh,rf=Md,nf=ad,of=Ch,sf=np,af=Bd,lf=qd,uf=Ud,cf=Jc;function hf(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $p(e)}hf.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new $p).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return hf([i(r)]).process(e,t)},i},hf.stringify=Hp,hf.parse=sf,hf.fromJSON=Xp,hf.list=af,hf.comment=e=>new tf(e),hf.atRule=e=>new rf(e),hf.decl=e=>new Zp(e),hf.rule=e=>new lf(e),hf.root=e=>new uf(e),hf.document=e=>new Qp(e),hf.CssSyntaxError=Gp,hf.Declaration=Zp,hf.Container=Jp,hf.Processor=$p,hf.Document=Qp,hf.Comment=tf,hf.Warning=ef,hf.AtRule=rf,hf.Result=nf,hf.Input=of,hf.Rule=lf,hf.Root=uf,hf.Node=cf,Yp.registerPostcss(hf);var df=hf;hf.default=hf;const pf=xc(df);pf.stringify,pf.fromJSON,pf.plugin,pf.parse,pf.list,pf.document,pf.comment,pf.atRule,pf.rule,pf.decl,pf.root,pf.CssSyntaxError,pf.Declaration,pf.Container,pf.Processor,pf.Document,pf.Comment,pf.Warning,pf.AtRule,pf.Result,pf.Input,pf.Rule,pf.Root,pf.Node;var ff=Object.defineProperty,gf=(e,t,r)=>((e,t,r)=>t in e?ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function mf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function vf(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var yf={exports:{}},bf=String,wf=function(){return{isColorSupported:!1,reset:bf,bold:bf,dim:bf,italic:bf,underline:bf,inverse:bf,hidden:bf,strikethrough:bf,black:bf,red:bf,green:bf,yellow:bf,blue:bf,magenta:bf,cyan:bf,white:bf,gray:bf,bgBlack:bf,bgRed:bf,bgGreen:bf,bgYellow:bf,bgBlue:bf,bgMagenta:bf,bgCyan:bf,bgWhite:bf}};yf.exports=wf(),yf.exports.createColors=wf;var Sf=yf.exports;const Cf=vf(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let If=Sf,xf=Cf,kf=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=If.isColorSupported),xf&&e&&(t=xf(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=If.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Ef=kf;kf.default=kf;var Of={};Of.isClean=Symbol("isClean"),Of.my=Symbol("my");const Af={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Rf=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="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");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Af[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=Af[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(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)}};var Pf=Rf;Rf.default=Rf;let Tf=Pf;function _f(e,t){new Tf(t).stringify(e)}var Mf=_f;_f.default=_f;let{isClean:Nf,my:Lf}=Of,Df=Ef,Ff=Pf,Uf=Mf;function jf(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>jf(e,r))):("object"===o&&null!==i&&(i=jf(i)),r[n]=i)}return r}let Bf=class{constructor(e={}){this.raws={},this[Nf]=!1,this[Lf]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=jf(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new Df(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Nf]){this[Nf]=!1;let e=this;for(;e=e.parent;)e[Nf]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Ff).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Uf){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var zf=Bf;Bf.default=Bf;let Vf=zf,Wf=class extends Vf{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var qf=Wf;Wf.default=Wf;var Kf={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:Gf,SourceMapGenerator:Zf}=Cf,{existsSync:Yf,readFileSync:Jf}=Cf,{dirname:$f,join:Hf}=Cf;let Xf=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=$f(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Gf(this.text)),this.consumerCache}decodeInline(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;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=$f(e),Yf(e))return this.mapFile=e,Jf(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Gf)return Zf.fromSourceMap(t).toString();if(t instanceof Zf)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Hf($f(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Qf=Xf;Xf.default=Xf;let{SourceMapConsumer:eg,SourceMapGenerator:tg}=Cf,{fileURLToPath:rg,pathToFileURL:ng}=Cf,{isAbsolute:ig,resolve:og}=Cf,{nanoid:sg}=Kf,ag=Cf,lg=Ef,ug=Qf,cg=Symbol("fromOffsetCache"),hg=Boolean(eg&&tg),dg=Boolean(og&&ig),pg=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!dg||/^\w+:\/\//.test(t.from)||ig(t.from)?this.file=t.from:this.file=og(t.from)),dg&&hg){let e=new ug(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+sg(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new lg(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new lg(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(ng&&(i.input.url=ng(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[cg])r=this[cg];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[cg]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:og(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=ig(a.source)?ng(a.source):new URL(a.source,this.map.consumer().sourceRoot||ng(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!rg)throw new Error("file: protocol is not available in this PostCSS build");l.file=rg(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var fg=pg;pg.default=pg,ag&&ag.registerInput&&ag.registerInput(pg);let{SourceMapConsumer:gg,SourceMapGenerator:mg}=Cf,{dirname:vg,relative:yg,resolve:bg,sep:wg}=Cf,{pathToFileURL:Sg}=Cf,Cg=fg,Ig=Boolean(gg&&mg),xg=Boolean(vg&&bg&&yg&&wg);var kg=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;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";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||vg(e.file);!1===this.mapOpts.sourcesContent?(t=new gg(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),xg&&Ig&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=mg.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new mg({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>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new mg({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?vg(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=vg(bg(r,this.mapOpts.annotation)));let n=yg(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new Cg(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(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))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Sg){let t=Sg(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===wg&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Eg=zf,Og=class extends Eg{constructor(e){super(e),this.type="comment"}};var Ag=Og;Og.default=Og;let Rg,Pg,Tg,_g,{isClean:Mg,my:Ng}=Of,Lg=qf,Dg=Ag,Fg=zf;function Ug(e){return e.map((e=>(e.nodes&&(e.nodes=Ug(e.nodes)),delete e.source,e)))}function jg(e){if(e[Mg]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)jg(t)}let Bg=class e extends Fg{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Ug(Rg(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Lg(t)]}else if(t.selector)t=[new Pg(t)];else if(t.name)t=[new Tg(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Dg(t)]}return t.map((t=>(t[Ng]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Mg]&&jg(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Bg.registerParse=e=>{Rg=e},Bg.registerRule=e=>{Pg=e},Bg.registerAtRule=e=>{Tg=e},Bg.registerRoot=e=>{_g=e};var zg=Bg;Bg.default=Bg,Bg.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Tg.prototype):"rule"===e.type?Object.setPrototypeOf(e,Pg.prototype):"decl"===e.type?Object.setPrototypeOf(e,Lg.prototype):"comment"===e.type?Object.setPrototypeOf(e,Dg.prototype):"root"===e.type&&Object.setPrototypeOf(e,_g.prototype),e[Ng]=!0,e.nodes&&e.nodes.forEach((e=>{Bg.rebuild(e)}))};let Vg,Wg,qg=zg,Kg=class extends qg{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Vg(new Wg,this,e).stringify()}};Kg.registerLazyResult=e=>{Vg=e},Kg.registerProcessor=e=>{Wg=e};var Gg=Kg;Kg.default=Kg;let Zg={};var Yg=function(e){Zg[e]||(Zg[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Jg=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){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}};var $g=Jg;Jg.default=Jg;let Hg=$g,Xg=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Hg(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var Qg=Xg;Xg.default=Xg;const em="'".charCodeAt(0),tm='"'.charCodeAt(0),rm="\\".charCodeAt(0),nm="/".charCodeAt(0),im="\n".charCodeAt(0),om=" ".charCodeAt(0),sm="\f".charCodeAt(0),am="\t".charCodeAt(0),lm="\r".charCodeAt(0),um="[".charCodeAt(0),cm="]".charCodeAt(0),hm="(".charCodeAt(0),dm=")".charCodeAt(0),pm="{".charCodeAt(0),fm="}".charCodeAt(0),gm=";".charCodeAt(0),mm="*".charCodeAt(0),vm=":".charCodeAt(0),ym="@".charCodeAt(0),bm=/[\t\n\f\r "#'()/;[\\\]{}]/g,wm=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Sm=/.[\r\n"'(/\\]/,Cm=/[\da-f]/i;let Im=zg,xm=class extends Im{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var km=xm;xm.default=xm,Im.registerAtRule(xm);let Em,Om,Am=zg,Rm=class extends Am{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Em(new Om,this,e).stringify()}};Rm.registerLazyResult=e=>{Em=e},Rm.registerProcessor=e=>{Om=e};var Pm=Rm;Rm.default=Rm,Am.registerRoot(Rm);let Tm={comma:e=>Tm.split(e,[","],!0),space:e=>Tm.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var _m=Tm;Tm.default=Tm;let Mm=zg,Nm=_m,Lm=class extends Mm{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Nm.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Dm=Lm;Lm.default=Lm,Mm.registerRule(Lm);let Fm=qf,Um=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case im:case om:case am:case lm:case sm:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===om||r===im||r===am||r===lm||r===sm);h=["space",d.slice(g,n)],g=n-1;break;case um:case cm:case pm:case fm:case vm:case gm:case dm:{let e=String.fromCharCode(r);h=[e,e,g];break}case hm:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==em&&c!==tm&&c!==om&&c!==im&&c!==am&&c!==sm&&c!==lm){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===rm;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||Sm.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case em:case tm:i=r===em?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===rm;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case ym:bm.lastIndex=g+1,bm.test(d),n=0===bm.lastIndex?d.length-1:bm.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case rm:for(n=g,s=!0;d.charCodeAt(n+1)===rm;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==nm&&r!==om&&r!==im&&r!==am&&r!==lm&&r!==sm&&(n+=1,Cm.test(d.charAt(n)))){for(;Cm.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===om&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===nm&&d.charCodeAt(g+1)===mm?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(wm.lastIndex=g+1,wm.test(d),n=0===wm.lastIndex?d.length-1:wm.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},jm=Ag,Bm=km,zm=Pm,Vm=Dm;const Wm={empty:!0,space:!0};var qm=class{constructor(e){this.input=e,this.root=new zm,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,i=new Bm;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?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){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.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=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new jm;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Um(this.input)}decl(e,t){let r=new Fm;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Vm;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(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)}endFile(){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())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(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)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[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()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",Wm[a]||Wm[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new Vm;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let Km=zg,Gm=qm,Zm=fg;function Ym(e,t){let r=new Zm(e,t),n=new Gm(r);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}var Jm=Ym;Ym.default=Ym,Km.registerParse(Ym);let{isClean:$m,my:Hm}=Of,Xm=kg,Qm=Mf,ev=zg,tv=Gg,rv=Yg,nv=Qg,iv=Jm,ov=Pm;const sv={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},av={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},lv={Once:!0,postcssPlugin:!0,prepare:!0};function uv(e){return"object"==typeof e&&"function"==typeof e.then}function cv(e){let t=!1,r=sv[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function hv(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:cv(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function dv(e){return e[$m]=!1,e.nodes&&e.nodes.forEach((e=>dv(e))),e}let pv={},fv=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof nv)i=dv(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=iv;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[Hm]&&ev.rebuild(i)}else i=dv(r);this.result=new nv(t,i,n),this.helpers={...pv,postcss:pv,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!av[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!lv[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(uv(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[$m];){e[$m]=!0;let t=[hv(e)];for(;t.length>0;){let e=this.visitTick(t);if(uv(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return uv(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Qm;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Xm(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(uv(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[$m];)e[$m]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||rv("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)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(uv(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[$m])return n[$m]=!0,void e.push(hv(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[$m]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[$m]=!0;let t=cv(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[$m]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};fv.registerPostcss=e=>{pv=e};var gv=fv;fv.default=fv,ov.registerLazyResult(fv),tv.registerLazyResult(fv);let mv=kg,vv=Mf,yv=Yg,bv=Jm;const wv=Qg;let Sv=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i=vv;this.result=new wv(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new mv(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||yv("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)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=bv;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Cv=Sv;Sv.default=Sv;let Iv=Cv,xv=gv,kv=Gg,Ev=Pm,Ov=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" 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.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new xv(this,e,t):new Iv(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Av=Ov;Ov.default=Ov,Ev.registerProcessor(Ov),kv.registerProcessor(Ov);let Rv=qf,Pv=Qf,Tv=Ag,_v=km,Mv=fg,Nv=Pm,Lv=Dm;function Dv(e,t){if(Array.isArray(e))return e.map((e=>Dv(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Mv.prototype};r.map&&(r.map={...r.map,__proto__:Pv.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Dv(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Nv(n);if("decl"===n.type)return new Rv(n);if("rule"===n.type)return new Lv(n);if("comment"===n.type)return new Tv(n);if("atrule"===n.type)return new _v(n);throw new Error("Unknown node type: "+e.type)}var Fv=Dv;Dv.default=Dv;let Uv=Ef,jv=qf,Bv=gv,zv=zg,Vv=Av,Wv=Mf,qv=Fv,Kv=Gg,Gv=$g,Zv=Ag,Yv=km,Jv=Qg,$v=fg,Hv=Jm,Xv=_m,Qv=Dm,ey=Pm,ty=zf;function ry(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Vv(e)}ry.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new Vv).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return ry([i(r)]).process(e,t)},i},ry.stringify=Wv,ry.parse=Hv,ry.fromJSON=qv,ry.list=Xv,ry.comment=e=>new Zv(e),ry.atRule=e=>new Yv(e),ry.decl=e=>new jv(e),ry.rule=e=>new Qv(e),ry.root=e=>new ey(e),ry.document=e=>new Kv(e),ry.CssSyntaxError=Uv,ry.Declaration=jv,ry.Container=zv,ry.Processor=Vv,ry.Document=Kv,ry.Comment=Zv,ry.Warning=Gv,ry.AtRule=Yv,ry.Result=Jv,ry.Input=$v,ry.Rule=Qv,ry.Root=ey,ry.Node=ty,Bv.registerPostcss(ry);var ny=ry;ry.default=ry;const iy=mf(ny);iy.stringify,iy.fromJSON,iy.plugin,iy.parse,iy.list,iy.document,iy.comment,iy.atRule,iy.rule,iy.decl,iy.root,iy.CssSyntaxError,iy.Declaration,iy.Container,iy.Processor,iy.Document,iy.Comment,iy.Warning,iy.AtRule,iy.Result,iy.Input,iy.Rule,iy.Root,iy.Node;class oy{constructor(...e){gf(this,"parentElement",null),gf(this,"parentNode",null),gf(this,"ownerDocument"),gf(this,"firstChild",null),gf(this,"lastChild",null),gf(this,"previousSibling",null),gf(this,"nextSibling",null),gf(this,"ELEMENT_NODE",1),gf(this,"TEXT_NODE",3),gf(this,"nodeType"),gf(this,"nodeName"),gf(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof oy))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const sy={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ay={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ly={};function uy(e){if(ly[e])return ly[e];const t=globalThis[e],r=t.prototype,n=e in sy?sy[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in ay?ay[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return ly[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?ly[e]=o:r}catch{return r}}const cy={};function hy(e,t,r){var n;const i=`${e}.${String(r)}`;if(cy[i])return cy[i].call(t);const o=uy(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(cy[i]=s,s.call(t)):t[r]}const dy={};function py(e,t,r){const n=`${e}.${String(r)}`;if(dy[n])return dy[n].bind(t);const i=uy(e)[r];return"function"!=typeof i?t[r]:(dy[n]=i,i.bind(t))}const fy={childNodes:function(e){return hy("Node",e,"childNodes")},parentNode:function(e){return hy("Node",e,"parentNode")},parentElement:function(e){return hy("Node",e,"parentElement")},textContent:function(e){return hy("Node",e,"textContent")},contains:function(e,t){return py("Node",e,"contains")(t)},getRootNode:function(e){return py("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?hy("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?hy("Element",e,"shadowRoot"):null},querySelector:function(e,t){return hy("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return hy("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return uy("MutationObserver").constructor}};const gy="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.";let my={map:{},getId:()=>(console.error(gy),-1),getNode:()=>(console.error(gy),null),removeNodeFromMap(){console.error(gy)},has:()=>(console.error(gy),!1),reset(){console.error(gy)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(my=new Proxy(my,{get:(e,t,r)=>("map"===t&&console.error(gy),Reflect.get(e,t,r))}));let vy=Date.now;function yy(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:fy.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(vy=()=>(new Date).getTime());function by(e){var t;let r=null;return"getRootNode"in e&&(null==(t=fy.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&fy.host(fy.getRootNode(e))&&(r=fy.host(fy.getRootNode(e))),r}function wy(e){let t,r=e;for(;t=by(r);)r=t;return r}function Sy(e){const t=e.ownerDocument;if(!t)return!1;const r=wy(e);return fy.contains(t,r)}const Cy=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){cc(this,"id",1),cc(this,"styleIDMap",new WeakMap),cc(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return my},closestElementOfNode:yy,getBaseDimension:function e(t,r){var n,i;const o=null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=e(o,r),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){const n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){const t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:wy,getShadowHost:by,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=fy.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=fy.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof oy&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(fy.shadowRoot(e)))},hookSetter:function e(t,r,n,i,o=window){const s=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,r,s||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(fy.contains(t,e)||Sy(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&Sc.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Sc.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const i=fy.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||e(i,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const i=yy(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(Ic(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(let n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return vy},on:function(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}},polyfill:function(e=window){"NodeList"in e&&!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)},queueToResolveTrees:function(e){const t={},r=(e,r)=>{const n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(const i of e){const{nextId:e,parentId:o}=i;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,r(i,o.parent))}else{const e=n.indexOf(o);n.splice(e,0,r(i,null))}}else if(o in t){const e=t[o];e.children.push(r(i,e))}else n.push(r(i,null))}return n},shadowHostInDom:Sy,throttle:function(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();i||!1!==r.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)}),a))}},uniqueTextMutations:function(e){const t=new Set,r=[];for(let n=e.length;n--;){const i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"}));for(var Iy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xy="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ky=0;ky<64;ky++)xy[Iy.charCodeAt(ky)]=ky;var Ey,Oy,Ay;"undefined"!=typeof window&&window.Blob&&new Blob([(Ey="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(Ey),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Pu=e.contentWindow)?void 0:Pu.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new Cc,(Ay=Oy||(Oy={}))[Ay.NotStarted=0]="NotStarted",Ay[Ay.Running=1]="Running",Ay[Ay.Stopped=2]="Stopped";class Ry{constructor(e){lc(this,"fileName"),lc(this,"functionName"),lc(this,"lineNumber"),lc(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const Py=/(^|@)\S+:\d+/,Ty=/^\s*at .*(\S+:\d+|\(native\))/m,_y=/^(eval@)?(\[native code])?$/,My={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ty)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ty)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Ry({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(_y)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ry({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ry({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[];for(let e=2,i=r.length;e<i;e+=2){const i=t.exec(r[e]);i&&n.push(new Ry({fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[];for(let e=0,i=r.length;e<i;e+=2){const i=t.exec(r[e]);i&&n.push(new Ry({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Py)&&!e.match(/^Error created at/)}),this).map((function(e){const t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ry({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Ny(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(let e=0;e<n.children.length;e++){const t=n.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===r&&i.push(t)}i.length>1&&(r+=`:eq(${i.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function Ly(e){return"[object Object]"===Object.prototype.toString.call(e)}function Dy(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Ly(e[n])&&Dy(e[n],t-1))return!0;return!1}function Fy(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){const r=n.indexOf(this);~r?n.splice(r+1):n.push(this),~r?i.splice(r,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ly(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ly(e)&&Dy(e,r.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=`${t.slice(0,r.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const r in t){const n=t[r];Array.isArray(n)?e[r]=Ny(n.length?n[0]:null):e[r]=n}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}const Uy={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function jy(e,t,r){const n=r?Object.assign({},Uy,r):Uy,i=n.logger;if(!i)return()=>{};let o;o="string"==typeof i?t[i]:i;let s=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,i=t.error,o=My.parse(i).map((e=>e.toString())),s=[Fy(r,n.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",r),l.push((()=>{t.removeEventListener("error",r)}));const i=t=>{let r,i;t.reason instanceof Error?(r=t.reason,i=[Fy(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,i=[Fy("Uncaught (in promise)",n.stringifyOptions),Fy(t.reason,n.stringifyOptions)]);const o=My.parse(r).map((e=>e.toString()));e({level:"error",trace:o,payload:i})};t.addEventListener("unhandledrejection",i),l.push((()=>{t.removeEventListener("unhandledrejection",i)}))}for(const e of n.level)l.push(u(o,e));return()=>{l.forEach((e=>e()))};function u(t,r){return t[r]?Cy.patch(t,r,(t=>(...i)=>{if(t.apply(this,i),!("assert"===r&&i[0]||a)){a=!0;try{const t=My.parse(new Error).map((e=>e.toString())).splice(1),o=("assert"===r?i.slice(1):i).map((e=>Fy(e,n.stringifyOptions)));s++,s<n.lengthThreshold?e({level:r,trace:t,payload:o}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Fy("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...i)}finally{a=!1}}})):()=>{}}}const By="rrweb/console@1";var zy,Vy=Object.freeze({__proto__:null,PLUGIN_NAME:By,getRecordConsolePlugin:e=>({name:By,observer:jy,options:e})}),Wy=Object.defineProperty,qy=(e,t,r)=>((e,t,r)=>t in e?Wy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ky=Object.defineProperty,Gy=(e,t,r)=>((e,t,r)=>t in e?Ky(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Zy=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Zy||{});const Yy={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Jy={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},$y={};function Hy(e){if($y[e])return $y[e];const t=globalThis[e],r=t.prototype,n=e in Yy?Yy[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in Jy?Jy[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return $y[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?$y[e]=o:r}catch{return r}}const Xy={};function Qy(e,t,r){var n;const i=`${e}.${String(r)}`;if(Xy[i])return Xy[i].call(t);const o=Hy(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Xy[i]=s,s.call(t)):t[r]}const eb={};function tb(e,t,r){const n=`${e}.${String(r)}`;if(eb[n])return eb[n].bind(t);const i=Hy(e)[r];return"function"!=typeof i?t[r]:(eb[n]=i,i.bind(t))}const rb={childNodes:function(e){return Qy("Node",e,"childNodes")},parentNode:function(e){return Qy("Node",e,"parentNode")},parentElement:function(e){return Qy("Node",e,"parentElement")},textContent:function(e){return Qy("Node",e,"textContent")},contains:function(e,t){return tb("Node",e,"contains")(t)},getRootNode:function(e){return tb("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Qy("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Qy("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Qy("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Qy("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Hy("MutationObserver").constructor}};function nb(e){return e.nodeType===e.ELEMENT_NODE}function ib(e){const t=e&&"host"in e&&"mode"in e&&rb.host(e)||null;return Boolean(t&&"shadowRoot"in t&&rb.shadowRoot(t)===e)}function ob(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function sb(e){try{const r=e.rules||e.cssRules;if(!r)return null;let n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);const i=Array.from(r,(e=>ab(e,n))).join("");return(t=i).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function ab(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=sb(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(r){t=e.cssText}return e.styleSheet.href?yb(t,e.styleSheet.href):t}{let r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(r)),t?yb(r,t):r}}class lb{constructor(){Gy(this,"idNodeMap",new Map),Gy(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ub({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";const a=n&&cb(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function cb(e){return e.toLowerCase()}const hb="__rrweb_original__";function db(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?cb(t):null}function pb(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(e){return null}const n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==n?void 0:n[1])??null}const fb=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,gb=/^(?:[a-z+]+:)?\/\//i,mb=/^www\..*/i,vb=/^(data:)([^,]*),(.*)/i;function yb(e,t){return(e||"").replace(fb,((e,r,n,i,o,s)=>{const a=n||o||s,l=r||i||"";if(!a)return e;if(gb.test(a)||mb.test(a))return`url(${l}${a}${l})`;if(vb.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const u=t.split("/"),c=a.split("/");u.pop();for(const e of c)"."!==e&&(".."===e?u.pop():u.push(e));return`url(${l}${u.join("/")}${l})`}))}function bb(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function wb(e,t){return function(e,t,r=!1){const n=Array.from(t.childNodes),i=[];let o=0;if(n.length>1&&e&&"string"==typeof e){let t=bb(e,r);const s=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=bb(n[a].textContent,r),u=100;let c=3;for(;c<l.length&&(l[c].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,c),1));c++);for(;c<l.length;c++){let h=l.substring(0,c),d=t.split(h),p=-1;if(2===d.length)p=d[0].length;else if(d.length>2&&""===d[0]&&""!==n[a-1].textContent)p=t.indexOf(h,1);else if(1===d.length){if(h=h.substring(0,h.length-1),d=t.split(h),d.length<=1)return i.push(e),i;c=u+1}else c===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&c>u){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=bb(e).length;p=t.indexOf(h,r)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/s);for(;a>0&&a<e.length;){if(o+=1,o>50*n.length)return i.push(e),i;const l=bb(e.substring(0,a),r);if(l.length===p){i.push(e.substring(0,a)),e=e.substring(a),t=t.substring(p);break}l.length<p?a+=Math.max(1,Math.floor((p-l.length)/s)):a-=Math.max(1,Math.floor((l.length-p)*s))}break}}}}return i.push(e),i}(e,t).join("/* rr_split */")}const Sb="lightgrey";let Cb=1;const Ib=new RegExp("[^a-z0-9-_:]");function xb(){return Cb++}let kb,Eb;const Ob=/^[^ \t\n\r\u000c]+/,Ab=/^[, \t\n\r\u000c]+/;const Rb=new WeakMap;function Pb(e,t){return t&&""!==t.trim()?_b(e,t):t}function Tb(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function _b(e,t){let r=Rb.get(e);if(r||(r=e.createElement("a"),Rb.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Mb(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Pb(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function n(e){let n;const i=e.exec(t.substring(r));return i?(n=i[0],r+=n.length,n):""}const i=[];for(;n(Ab),!(r>=t.length);){let o=n(Ob);if(","===o.slice(-1))o=Pb(e,o.substring(0,o.length-1)),i.push(o);else{let n="";o=Pb(e,o);let s=!1;for(;;){const e=t.charAt(r);if(""===e){i.push((o+n).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){r+=1,i.push((o+n).trim());break}"("===e&&(s=!0)}n+=e,r+=1}}}return i.join(", ")}(e,n):"style"===r?yb(n,_b(e)):"object"===t&&"data"===r?Pb(e,n):n:Pb(e,n):n}function Nb(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Lb(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Lb(rb.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Lb(rb.parentNode(e),t,r)}function Db(e,t,r,n){let i;if(nb(e)){if(i=e,!rb.childNodes(i).length)return!1}else{if(null===rb.parentElement(e))return!1;i=rb.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Lb(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function Fb(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:g=!1,cssCaptured:m=!1,applyBackgroundColorToBlockedElements:v=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Zy.Document,childNodes:[],compatMode:e.compatMode}:{type:Zy.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Zy.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:o,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p,applyBackgroundColorToBlockedElements:f=!1}=t,g=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,i),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=cb(e.tagName);return Ib.test(t)?"div":t}(e);let v={};const y=e.attributes.length;for(let t=0;t<y;t++){const n=e.attributes[t];Nb(m,n.name,n.value)||(v[n.name]=Mb(r,m,cb(n.name),n.value))}if("link"===m&&o){const t=Array.from(r.styleSheets).find((t=>t.href===e.href));let n=null;t&&(n=sb(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===m&&e.sheet){let t=sb(e.sheet);t&&(e.childNodes.length>1&&(t=wb(t,e)),v._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&t?v.value=ub({element:e,type:db(e),tagName:m,value:t,maskInputOptions:s,maskInputFn:a}):r&&(v.checked=r)}"option"===m&&(e.selected&&!s.select?v.selected=!0:delete v.selected);"dialog"===m&&e.open&&(v.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&c)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const i=t.getImageData,o=hb in i?i[hb]:i;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(v.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(l.type,l.quality)&&(v.rr_dataURL=t)}if("img"===m&&u){kb||(kb=r.createElement("canvas"),Eb=kb.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",i=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{kb.width=t.naturalWidth,kb.height=t.naturalHeight,Eb.drawImage(t,0,0),v.rr_dataURL=kb.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(i?v.crossOrigin=i:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===m||"video"===m){const t=v;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}d||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop));if(g){const{width:t,height:r}=e.getBoundingClientRect();v={class:v.class,rr_width:`${t}px`,rr_height:`${r}px`,...f?{rr_background_color:Sb}:{}}}"iframe"!==m||h(v.src)||(e.contentDocument||(v.rr_src=v.src),delete v.src);let b;try{customElements.get(m)&&(b=!0)}catch(e){}return{type:Zy.Element,tagName:m,attributes:v,childNodes:[],isSVG:Tb(e)||void 0,needBlock:g,rootId:p,isCustom:b}}(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:g,rootId:y,applyBackgroundColorToBlockedElements:v});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:i,cssCaptured:o}=t,s=rb.parentNode(e),a=s&&s.tagName;let l="";const u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;c?l="SCRIPT_PLACEHOLDER":o||(l=rb.textContent(e),u&&l&&(l=yb(l,_b(t.doc))));!u&&!c&&l&&r&&(l=n?n(l,rb.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Zy.Text,textContent:l||"",rootId:i}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:y,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Zy.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Zy.Comment,textContent:rb.textContent(e)||"",rootId:y};default:return!1}}function Ub(e){return null==e?"":e.toLowerCase()}function jb(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:I=!1,cssCaptured:x=!1,applyBackgroundColorToBlockedElements:k=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:O=!0}=t;if(!E){E=Db(e,s,a,void 0===E)}const A=Fb(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:E,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:x,applyBackgroundColorToBlockedElements:k});if(!A)return console.warn(e,"not serialized"),null;let R;R=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===Zy.Comment)return!0;if(e.type===Zy.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===pb(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ub(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ub(e.attributes.name)||"icon"===Ub(e.attributes.rel)||"apple-touch-icon"===Ub(e.attributes.rel)||"shortcut icon"===Ub(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ub(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ub(e.attributes.property).match(/^(og|twitter|fb):/)||Ub(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ub(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ub(e.attributes.name)||"googlebot"===Ub(e.attributes.name)||"bingbot"===Ub(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ub(e.attributes.name)||"generator"===Ub(e.attributes.name)||"framework"===Ub(e.attributes.name)||"publisher"===Ub(e.attributes.name)||"progid"===Ub(e.attributes.name)||Ub(e.attributes.property).match(/^article:/)||Ub(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ub(e.attributes.name)||"yandex-verification"===Ub(e.attributes.name)||"csrf-token"===Ub(e.attributes.name)||"p:domain_verify"===Ub(e.attributes.name)||"verify-v1"===Ub(e.attributes.name)||"verification"===Ub(e.attributes.name)||"shopify-checkout-api-token"===Ub(e.attributes.name)))return!0}}return!1}(A,p)||!O&&A.type===Zy.Text&&!A.textContent.replace(/^\s+|\s+$/gm,"").length?-2:xb();const P=Object.assign(A,{id:R});if(n.add(e,P),-2===R)return null;v&&v(e);let T=!l;if(P.type===Zy.Element){T=T&&!P.needBlock,delete P.needBlock;const t=rb.shadowRoot(e);t&&ob(t)&&(P.isShadowHost=!0)}if((P.type===Zy.Document||P.type===Zy.Element)&&T){p.headWhitespace&&P.type===Zy.Element&&"head"===P.tagName&&(O=!1);const t={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:O,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1,applyBackgroundColorToBlockedElements:k};if(P.type===Zy.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else{P.type===Zy.Element&&void 0!==P.attributes._cssText&&"string"==typeof P.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(rb.childNodes(e))){const e=jb(r,t);e&&P.childNodes.push(e)}}let I=null;if(nb(e)&&(I=rb.shadowRoot(e)))for(const e of Array.from(rb.childNodes(I))){const r=jb(e,t);r&&(ob(I)&&(r.isShadow=!0),P.childNodes.push(r))}}const _=rb.parentNode(e);return _&&ib(_)&&ob(_)&&(P.isShadow=!0),P.type===Zy.Element&&"iframe"===P.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"!==i){const n=setTimeout((()=>{o||(t(),o=!0)}),r);return void e.addEventListener("load",(()=>{clearTimeout(n),o=!0,t()}))}const s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&y){const r=jb(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:O,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&y(e,r)}}),b),P.type===Zy.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===pb(P.attributes.href))&&function(e,t,r){let n,i=!1;try{n=e.sheet}catch(e){return}if(n)return;const o=setTimeout((()=>{i||(t(),i=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}(e,(()=>{if(w){const t=jb(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:O,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&w(e,t)}}),S),P}function Bb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zb(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var Vb={exports:{}},Wb=String,qb=function(){return{isColorSupported:!1,reset:Wb,bold:Wb,dim:Wb,italic:Wb,underline:Wb,inverse:Wb,hidden:Wb,strikethrough:Wb,black:Wb,red:Wb,green:Wb,yellow:Wb,blue:Wb,magenta:Wb,cyan:Wb,white:Wb,gray:Wb,bgBlack:Wb,bgRed:Wb,bgGreen:Wb,bgYellow:Wb,bgBlue:Wb,bgMagenta:Wb,bgCyan:Wb,bgWhite:Wb}};Vb.exports=qb(),Vb.exports.createColors=qb;var Kb=Vb.exports;const Gb=zb(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Zb=Kb,Yb=Gb,Jb=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Zb.isColorSupported),Yb&&e&&(t=Yb(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=Zb.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var $b=Jb;Jb.default=Jb;var Hb={};Hb.isClean=Symbol("isClean"),Hb.my=Symbol("my");const Xb={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Qb=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="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");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Xb[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=Xb[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(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)}};var ew=Qb;Qb.default=Qb;let tw=ew;function rw(e,t){new tw(t).stringify(e)}var nw=rw;rw.default=rw;let{isClean:iw,my:ow}=Hb,sw=$b,aw=ew,lw=nw;function uw(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>uw(e,r))):("object"===o&&null!==i&&(i=uw(i)),r[n]=i)}return r}let cw=class{constructor(e={}){this.raws={},this[iw]=!1,this[ow]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=uw(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new sw(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[iw]){this[iw]=!1;let e=this;for(;e=e.parent;)e[iw]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new aw).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=lw){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var hw=cw;cw.default=cw;let dw=hw,pw=class extends dw{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var fw=pw;pw.default=pw;var gw={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:mw,SourceMapGenerator:vw}=Gb,{existsSync:yw,readFileSync:bw}=Gb,{dirname:ww,join:Sw}=Gb;let Cw=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ww(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new mw(this.text)),this.consumerCache}decodeInline(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;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=ww(e),yw(e))return this.mapFile=e,bw(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof mw)return vw.fromSourceMap(t).toString();if(t instanceof vw)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Sw(ww(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Iw=Cw;Cw.default=Cw;let{SourceMapConsumer:xw,SourceMapGenerator:kw}=Gb,{fileURLToPath:Ew,pathToFileURL:Ow}=Gb,{isAbsolute:Aw,resolve:Rw}=Gb,{nanoid:Pw}=gw,Tw=Gb,_w=$b,Mw=Iw,Nw=Symbol("fromOffsetCache"),Lw=Boolean(xw&&kw),Dw=Boolean(Rw&&Aw),Fw=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Dw||/^\w+:\/\//.test(t.from)||Aw(t.from)?this.file=t.from:this.file=Rw(t.from)),Dw&&Lw){let e=new Mw(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Pw(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new _w(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new _w(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(Ow&&(i.input.url=Ow(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[Nw])r=this[Nw];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[Nw]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Rw(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=Aw(a.source)?Ow(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ow(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Ew)throw new Error("file: protocol is not available in this PostCSS build");l.file=Ew(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Uw=Fw;Fw.default=Fw,Tw&&Tw.registerInput&&Tw.registerInput(Fw);let{SourceMapConsumer:jw,SourceMapGenerator:Bw}=Gb,{dirname:zw,relative:Vw,resolve:Ww,sep:qw}=Gb,{pathToFileURL:Kw}=Gb,Gw=Uw,Zw=Boolean(jw&&Bw),Yw=Boolean(zw&&Ww&&Vw&&qw);var Jw=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;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";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||zw(e.file);!1===this.mapOpts.sourcesContent?(t=new jw(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Yw&&Zw&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Bw.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Bw({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>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Bw({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?zw(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=zw(Ww(r,this.mapOpts.annotation)));let n=Vw(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new Gw(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(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))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Kw){let t=Kw(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===qw&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let $w=hw,Hw=class extends $w{constructor(e){super(e),this.type="comment"}};var Xw=Hw;Hw.default=Hw;let Qw,eS,tS,rS,{isClean:nS,my:iS}=Hb,oS=fw,sS=Xw,aS=hw;function lS(e){return e.map((e=>(e.nodes&&(e.nodes=lS(e.nodes)),delete e.source,e)))}function uS(e){if(e[nS]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)uS(t)}let cS=class e extends aS{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=lS(Qw(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new oS(t)]}else if(t.selector)t=[new eS(t)];else if(t.name)t=[new tS(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new sS(t)]}return t.map((t=>(t[iS]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[nS]&&uS(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};cS.registerParse=e=>{Qw=e},cS.registerRule=e=>{eS=e},cS.registerAtRule=e=>{tS=e},cS.registerRoot=e=>{rS=e};var hS=cS;cS.default=cS,cS.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,tS.prototype):"rule"===e.type?Object.setPrototypeOf(e,eS.prototype):"decl"===e.type?Object.setPrototypeOf(e,oS.prototype):"comment"===e.type?Object.setPrototypeOf(e,sS.prototype):"root"===e.type&&Object.setPrototypeOf(e,rS.prototype),e[iS]=!0,e.nodes&&e.nodes.forEach((e=>{cS.rebuild(e)}))};let dS,pS,fS=hS,gS=class extends fS{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new dS(new pS,this,e).stringify()}};gS.registerLazyResult=e=>{dS=e},gS.registerProcessor=e=>{pS=e};var mS=gS;gS.default=gS;let vS={};var yS=function(e){vS[e]||(vS[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let bS=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){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}};var wS=bS;bS.default=bS;let SS=wS,CS=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new SS(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var IS=CS;CS.default=CS;const xS="'".charCodeAt(0),kS='"'.charCodeAt(0),ES="\\".charCodeAt(0),OS="/".charCodeAt(0),AS="\n".charCodeAt(0),RS=" ".charCodeAt(0),PS="\f".charCodeAt(0),TS="\t".charCodeAt(0),_S="\r".charCodeAt(0),MS="[".charCodeAt(0),NS="]".charCodeAt(0),LS="(".charCodeAt(0),DS=")".charCodeAt(0),FS="{".charCodeAt(0),US="}".charCodeAt(0),jS=";".charCodeAt(0),BS="*".charCodeAt(0),zS=":".charCodeAt(0),VS="@".charCodeAt(0),WS=/[\t\n\f\r "#'()/;[\\\]{}]/g,qS=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,KS=/.[\r\n"'(/\\]/,GS=/[\da-f]/i;let ZS=hS,YS=class extends ZS{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var JS=YS;YS.default=YS,ZS.registerAtRule(YS);let $S,HS,XS=hS,QS=class extends XS{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new $S(new HS,this,e).stringify()}};QS.registerLazyResult=e=>{$S=e},QS.registerProcessor=e=>{HS=e};var eC=QS;QS.default=QS,XS.registerRoot(QS);let tC={comma:e=>tC.split(e,[","],!0),space:e=>tC.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var rC=tC;tC.default=tC;let nC=hS,iC=rC,oC=class extends nC{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return iC.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var sC=oC;oC.default=oC,nC.registerRule(oC);let aC=fw,lC=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case AS:case RS:case TS:case _S:case PS:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===RS||r===AS||r===TS||r===_S||r===PS);h=["space",d.slice(g,n)],g=n-1;break;case MS:case NS:case FS:case US:case zS:case jS:case DS:{let e=String.fromCharCode(r);h=[e,e,g];break}case LS:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==xS&&c!==kS&&c!==RS&&c!==AS&&c!==TS&&c!==PS&&c!==_S){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===ES;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||KS.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case xS:case kS:i=r===xS?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===ES;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case VS:WS.lastIndex=g+1,WS.test(d),n=0===WS.lastIndex?d.length-1:WS.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case ES:for(n=g,s=!0;d.charCodeAt(n+1)===ES;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==OS&&r!==RS&&r!==AS&&r!==TS&&r!==_S&&r!==PS&&(n+=1,GS.test(d.charAt(n)))){for(;GS.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===RS&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===OS&&d.charCodeAt(g+1)===BS?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(qS.lastIndex=g+1,qS.test(d),n=0===qS.lastIndex?d.length-1:qS.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},uC=Xw,cC=JS,hC=eC,dC=sC;const pC={empty:!0,space:!0};var fC=class{constructor(e){this.input=e,this.root=new hC,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,i=new cC;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?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){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.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=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new uC;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=lC(this.input)}decl(e,t){let r=new aC;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new dC;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(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)}endFile(){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())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(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)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[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()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",pC[a]||pC[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new dC;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let gC=hS,mC=fC,vC=Uw;function yC(e,t){let r=new vC(e,t),n=new mC(r);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}var bC=yC;yC.default=yC,gC.registerParse(yC);let{isClean:wC,my:SC}=Hb,CC=Jw,IC=nw,xC=hS,kC=mS,EC=yS,OC=IS,AC=bC,RC=eC;const PC={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},TC={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},_C={Once:!0,postcssPlugin:!0,prepare:!0};function MC(e){return"object"==typeof e&&"function"==typeof e.then}function NC(e){let t=!1,r=PC[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function LC(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:NC(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function DC(e){return e[wC]=!1,e.nodes&&e.nodes.forEach((e=>DC(e))),e}let FC={},UC=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof OC)i=DC(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=AC;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[SC]&&xC.rebuild(i)}else i=DC(r);this.result=new OC(t,i,n),this.helpers={...FC,postcss:FC,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!TC[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!_C[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(MC(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[wC];){e[wC]=!0;let t=[LC(e)];for(;t.length>0;){let e=this.visitTick(t);if(MC(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return MC(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=IC;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new CC(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(MC(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[wC];)e[wC]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||EC("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)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(MC(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[wC])return n[wC]=!0,void e.push(LC(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[wC]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[wC]=!0;let t=NC(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[wC]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};UC.registerPostcss=e=>{FC=e};var jC=UC;UC.default=UC,RC.registerLazyResult(UC),kC.registerLazyResult(UC);let BC=Jw,zC=nw,VC=yS,WC=bC;const qC=IS;let KC=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i=zC;this.result=new qC(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new BC(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||VC("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)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=WC;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var GC=KC;KC.default=KC;let ZC=GC,YC=jC,JC=mS,$C=eC,HC=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" 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.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new YC(this,e,t):new ZC(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var XC=HC;HC.default=HC,$C.registerProcessor(HC),JC.registerProcessor(HC);let QC=fw,eI=Iw,tI=Xw,rI=JS,nI=Uw,iI=eC,oI=sC;function sI(e,t){if(Array.isArray(e))return e.map((e=>sI(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:nI.prototype};r.map&&(r.map={...r.map,__proto__:eI.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>sI(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new iI(n);if("decl"===n.type)return new QC(n);if("rule"===n.type)return new oI(n);if("comment"===n.type)return new tI(n);if("atrule"===n.type)return new rI(n);throw new Error("Unknown node type: "+e.type)}var aI=sI;sI.default=sI;let lI=$b,uI=fw,cI=jC,hI=hS,dI=XC,pI=nw,fI=aI,gI=mS,mI=wS,vI=Xw,yI=JS,bI=IS,wI=Uw,SI=bC,CI=rC,II=sC,xI=eC,kI=hw;function EI(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new dI(e)}EI.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new dI).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return EI([i(r)]).process(e,t)},i},EI.stringify=pI,EI.parse=SI,EI.fromJSON=fI,EI.list=CI,EI.comment=e=>new vI(e),EI.atRule=e=>new yI(e),EI.decl=e=>new uI(e),EI.rule=e=>new II(e),EI.root=e=>new xI(e),EI.document=e=>new gI(e),EI.CssSyntaxError=lI,EI.Declaration=uI,EI.Container=hI,EI.Processor=dI,EI.Document=gI,EI.Comment=vI,EI.Warning=mI,EI.AtRule=yI,EI.Result=bI,EI.Input=wI,EI.Rule=II,EI.Root=xI,EI.Node=kI,cI.registerPostcss(EI);var OI=EI;EI.default=EI;const AI=Bb(OI);AI.stringify,AI.fromJSON,AI.plugin,AI.parse,AI.list,AI.document,AI.comment,AI.atRule,AI.rule,AI.decl,AI.root,AI.CssSyntaxError,AI.Declaration,AI.Container,AI.Processor,AI.Document,AI.Comment,AI.Warning,AI.AtRule,AI.Result,AI.Input,AI.Rule,AI.Root,AI.Node;var RI=Object.defineProperty,PI=(e,t,r)=>((e,t,r)=>t in e?RI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function TI(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _I(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var MI={exports:{}},NI=String,LI=function(){return{isColorSupported:!1,reset:NI,bold:NI,dim:NI,italic:NI,underline:NI,inverse:NI,hidden:NI,strikethrough:NI,black:NI,red:NI,green:NI,yellow:NI,blue:NI,magenta:NI,cyan:NI,white:NI,gray:NI,bgBlack:NI,bgRed:NI,bgGreen:NI,bgYellow:NI,bgBlue:NI,bgMagenta:NI,bgCyan:NI,bgWhite:NI}};MI.exports=LI(),MI.exports.createColors=LI;var DI=MI.exports;const FI=_I(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let UI=DI,jI=FI,BI=class e extends Error{constructor(t,r,n,i,o,s){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=UI.isColorSupported),jI&&e&&(t=jI(t));let r,n,i=t.split(/\r?\n/),o=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length;if(e){let{bold:e,gray:t,red:i}=UI.createColors(!0);r=t=>e(i(t)),n=e=>t(e)}else r=n=e=>e;return i.slice(o,s).map(((e,t)=>{let i=o+1+t,s=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=n(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(s)+e+"\n "+t+r("^")}return" "+n(s)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var zI=BI;BI.default=BI;var VI={};VI.isClean=Symbol("isClean"),VI.my=Symbol("my");const WI={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let qI=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let i=(e.raws.between||"")+(t?";":"");this.builder(r+n+i,e)}}beforeAfter(e,t){let r;r="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");let n=e.parent,i=0;for(;n&&"root"!==n.type;)i+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let i=e.nodes[n],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return WI[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let i="raw"+((s=r)[0].toUpperCase()+s.slice(1));this[i]?n=this[i](o,e):o.walk((e=>{if(n=e.raws[t],void 0!==n)return!1}))}var s;return void 0===n&&(n=WI[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls((e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1})),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(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)}};var KI=qI;qI.default=qI;let GI=KI;function ZI(e,t){new GI(t).stringify(e)}var YI=ZI;ZI.default=ZI;let{isClean:JI,my:$I}=VI,HI=zI,XI=KI,QI=YI;function ex(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let i=e[n],o=typeof i;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map((e=>ex(e,r))):("object"===o&&null!==i&&(i=ex(i)),r[n]=i)}return r}let tx=class{constructor(e={}){this.raws={},this[JI]=!1,this[$I]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=ex(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new HI(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[JI]){this[JI]=!1;let e=this;for(;e=e.parent;)e[JI]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),i=n.indexOf(e.word);-1!==i&&(t=this.positionInside(i,n),r=this.positionInside(i+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new XI).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=i,t.set(n.input,i),i++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map((e=>e.toJSON()))),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=QI){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var rx=tx;tx.default=tx;let nx=rx,ix=class extends nx{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var ox=ix;ix.default=ix;var sx={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",i=r;for(;i--;)n+=e[Math.random()*e.length|0];return n}};let{SourceMapConsumer:ax,SourceMapGenerator:lx}=FI,{existsSync:ux,readFileSync:cx}=FI,{dirname:hx,join:dx}=FI;let px=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=hx(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ax(this.text)),this.consumerCache}decodeInline(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;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=hx(e),ux(e))return this.mapFile=e,cx(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof ax)return lx.fromSourceMap(t).toString();if(t instanceof lx)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=dx(hx(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var fx=px;px.default=px;let{SourceMapConsumer:gx,SourceMapGenerator:mx}=FI,{fileURLToPath:vx,pathToFileURL:yx}=FI,{isAbsolute:bx,resolve:wx}=FI,{nanoid:Sx}=sx,Cx=FI,Ix=zI,xx=fx,kx=Symbol("fromOffsetCache"),Ex=Boolean(gx&&mx),Ox=Boolean(wx&&bx),Ax=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Ox||/^\w+:\/\//.test(t.from)||bx(t.from)?this.file=t.from:this.file=wx(t.from)),Ox&&Ex){let e=new xx(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Sx(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let i,o,s;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,s=e.col}else o=n.line,s=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,s);return i=a?new Ix(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Ix(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:s,line:o},this.css,this.file,n.plugin),i.input={column:r,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(yx&&(i.input.url=yx(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[kx])r=this[kx];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,i=e.length;n<i;n++)r[n]=t,t+=e[n].length+1;this[kx]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,i=r.length-2;for(;n<i;)if(t=n+(i-n>>1),e<r[t])i=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:wx(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(i=s.originalPositionFor({column:n,line:r})),o=bx(a.source)?yx(a.source):new URL(a.source,this.map.consumer().sourceRoot||yx(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!vx)throw new Error("file: protocol is not available in this PostCSS build");l.file=vx(o)}let u=s.sourceContentFor(a.source);return u&&(l.source=u),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Rx=Ax;Ax.default=Ax,Cx&&Cx.registerInput&&Cx.registerInput(Ax);let{SourceMapConsumer:Px,SourceMapGenerator:Tx}=FI,{dirname:_x,relative:Mx,resolve:Nx,sep:Lx}=FI,{pathToFileURL:Dx}=FI,Fx=Rx,Ux=Boolean(Px&&Tx),jx=Boolean(_x&&Nx&&Mx&&Lx);var Bx=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;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";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||_x(e.file);!1===this.mapOpts.sourcesContent?(t=new Px(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),jx&&Ux&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Tx.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Tx({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>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Tx({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=s.match(/\n/g),e?(r+=e.length,t=s.lastIndexOf("\n"),n=s.length-t):n+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?_x(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=_x(Nx(r,this.mapOpts.annotation)));let n=Mx(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new Fx(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(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))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Dx){let t=Dx(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Lx&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let zx=rx,Vx=class extends zx{constructor(e){super(e),this.type="comment"}};var Wx=Vx;Vx.default=Vx;let qx,Kx,Gx,Zx,{isClean:Yx,my:Jx}=VI,$x=ox,Hx=Wx,Xx=rx;function Qx(e){return e.map((e=>(e.nodes&&(e.nodes=Qx(e.nodes)),delete e.source,e)))}function ek(e){if(e[Yx]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ek(t)}let tk=class e extends Xx{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map((e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e))):"every"===t||"some"===t?r=>e[t](((e,...t)=>r(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),i=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),i=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],i).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Qx(qx(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new $x(t)]}else if(t.selector)t=[new Kx(t)];else if(t.name)t=[new Gx(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Hx(t)]}return t.map((t=>(t[Jx]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Yx]&&ek(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls((n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)})):this.walk(((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("atrule"===e.type)return t(e,r)})))}walkComments(e){return this.walk(((t,r)=>{if("comment"===t.type)return e(t,r)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)})):this.walk(((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("decl"===e.type)return t(e,r)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)})):this.walk(((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)})):(t=e,this.walk(((e,r)=>{if("rule"===e.type)return t(e,r)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};tk.registerParse=e=>{qx=e},tk.registerRule=e=>{Kx=e},tk.registerAtRule=e=>{Gx=e},tk.registerRoot=e=>{Zx=e};var rk=tk;tk.default=tk,tk.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Gx.prototype):"rule"===e.type?Object.setPrototypeOf(e,Kx.prototype):"decl"===e.type?Object.setPrototypeOf(e,$x.prototype):"comment"===e.type?Object.setPrototypeOf(e,Hx.prototype):"root"===e.type&&Object.setPrototypeOf(e,Zx.prototype),e[Jx]=!0,e.nodes&&e.nodes.forEach((e=>{tk.rebuild(e)}))};let nk,ik,ok=rk,sk=class extends ok{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new nk(new ik,this,e).stringify()}};sk.registerLazyResult=e=>{nk=e},sk.registerProcessor=e=>{ik=e};var ak=sk;sk.default=sk;let lk={};var uk=function(e){lk[e]||(lk[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ck=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){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}};var hk=ck;ck.default=ck;let dk=hk,pk=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new dk(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var fk=pk;pk.default=pk;const gk="'".charCodeAt(0),mk='"'.charCodeAt(0),vk="\\".charCodeAt(0),yk="/".charCodeAt(0),bk="\n".charCodeAt(0),wk=" ".charCodeAt(0),Sk="\f".charCodeAt(0),Ck="\t".charCodeAt(0),Ik="\r".charCodeAt(0),xk="[".charCodeAt(0),kk="]".charCodeAt(0),Ek="(".charCodeAt(0),Ok=")".charCodeAt(0),Ak="{".charCodeAt(0),Rk="}".charCodeAt(0),Pk=";".charCodeAt(0),Tk="*".charCodeAt(0),_k=":".charCodeAt(0),Mk="@".charCodeAt(0),Nk=/[\t\n\f\r "#'()/;[\\\]{}]/g,Lk=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Dk=/.[\r\n"'(/\\]/,Fk=/[\da-f]/i;let Uk=rk,jk=class extends Uk{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Bk=jk;jk.default=jk,Uk.registerAtRule(jk);let zk,Vk,Wk=rk,qk=class extends Wk{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new zk(new Vk,this,e).stringify()}};qk.registerLazyResult=e=>{zk=e},qk.registerProcessor=e=>{Vk=e};var Kk=qk;qk.default=qk,Wk.registerRoot(qk);let Gk={comma:e=>Gk.split(e,[","],!0),space:e=>Gk.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],i="",o=!1,s=0,a=!1,l="",u=!1;for(let r of e)u?u=!1:"\\"===r?u=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?s+=1:")"===r?s>0&&(s-=1):0===s&&t.includes(r)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=r;return(r||""!==i)&&n.push(i.trim()),n}};var Zk=Gk;Gk.default=Gk;let Yk=rk,Jk=Zk,$k=class extends Yk{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Jk.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Hk=$k;$k.default=$k,Yk.registerRule($k);let Xk=ox,Qk=function(e,t={}){let r,n,i,o,s,a,l,u,c,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],v=[];function y(t){throw e.error("Unclosed "+t,g)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&g>=f},nextToken:function(e){if(v.length)return v.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case bk:case wk:case Ck:case Ik:case Sk:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===wk||r===bk||r===Ck||r===Ik||r===Sk);h=["space",d.slice(g,n)],g=n-1;break;case xk:case kk:case Ak:case Rk:case _k:case Pk:case Ok:{let e=String.fromCharCode(r);h=[e,e,g];break}case Ek:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==gk&&c!==mk&&c!==wk&&c!==bk&&c!==Ck&&c!==Sk&&c!==Ik){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}y("bracket")}for(l=n;d.charCodeAt(l-1)===vk;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),o=d.slice(g,n+1),-1===n||Dk.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case gk:case mk:i=r===gk?"'":'"',n=g;do{if(a=!1,n=d.indexOf(i,n+1),-1===n){if(p||t){n=g+1;break}y("string")}for(l=n;d.charCodeAt(l-1)===vk;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Mk:Nk.lastIndex=g+1,Nk.test(d),n=0===Nk.lastIndex?d.length-1:Nk.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case vk:for(n=g,s=!0;d.charCodeAt(n+1)===vk;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==yk&&r!==wk&&r!==bk&&r!==Ck&&r!==Ik&&r!==Sk&&(n+=1,Fk.test(d.charAt(n)))){for(;Fk.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===wk&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===yk&&d.charCodeAt(g+1)===Tk?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:y("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(Lk.lastIndex=g+1,Lk.test(d),n=0===Lk.lastIndex?d.length-1:Lk.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},eE=Wx,tE=Bk,rE=Kk,nE=Hk;const iE={empty:!0,space:!0};var oE=class{constructor(e){this.input=e,this.root=new rE,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,i=new tE;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,s=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?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){s=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.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=""),s&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let i=t-1;i>=0&&(r=e[i],"space"===r[0]||(n+=1,2!==n));i--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,i=0;for(let[o,s]of e.entries()){if(t=s,r=t[0],"("===r&&(i+=1),")"===r&&(i-=1),0===i&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new eE;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Qk(this.input)}decl(e,t){let r=new Xk;this.init(r,e[0][2]);let n,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,s=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),i="";for(let e=t;e>0;e--){let t=n[e][0];if(0===i.trim().indexOf("!")&&"space"!==t)break;i=n.pop()[1]+i}0===i.trim().indexOf("!")&&(r.important=!0,r.raws.important=i,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(r.raws.between+=s.map((e=>e[1])).join(""),s=[]),this.raw(r,"value",s.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new nE;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(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)}endFile(){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())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(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)}other(e){let t=!1,r=null,n=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)i||(i=l),o.push("("===r?")":"]");else if(s&&n&&"{"===r)i||(i=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,s);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&n){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[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()}precheckMissedSemicolon(){}raw(e,t,r,n){let i,o,s,a,l=r.length,u="",c=!0;for(let e=0;e<l;e+=1)i=r[e],o=i[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",s=r[e+1]?r[e+1][0]:"empty",iE[a]||iE[s]||","===u.slice(-1)?c=!1:u+=i[1]):u+=i[1]:c=!1;if(!c){let n=r.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new nE;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let sE=rk,aE=oE,lE=Rx;function uE(e,t){let r=new lE(e,t),n=new aE(r);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}var cE=uE;uE.default=uE,sE.registerParse(uE);let{isClean:hE,my:dE}=VI,pE=Bx,fE=YI,gE=rk,mE=ak,vE=uk,yE=fk,bE=cE,wE=Kk;const SE={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},CE={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},IE={Once:!0,postcssPlugin:!0,prepare:!0};function xE(e){return"object"==typeof e&&"function"==typeof e.then}function kE(e){let t=!1,r=SE[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function EE(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:kE(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function OE(e){return e[hE]=!1,e.nodes&&e.nodes.forEach((e=>OE(e))),e}let AE={},RE=class e{constructor(t,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof yE)i=OE(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=bE;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[dE]&&gE.rebuild(i)}else i=OE(r);this.result=new yE(t,i,n),this.helpers={...AE,postcss:AE,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,i=t.split("."),o=n.split(".");(i[0]!==o[0]||parseInt(i[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!CE[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!IE[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(xE(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[hE];){e[hE]=!0;let t=[EE(e)];for(;t.length>0;){let e=this.visitTick(t);if(xE(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return xE(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=fE;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new pE(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(xE(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[hE];)e[hE]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||vE("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)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(xE(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,i=t.iterator;for(;n=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!n[hE])return n[hE]=!0,void e.push(EE(n));t.iterator=0,delete r.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[hE]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[hE]=!0;let t=kE(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[hE]||this.walkSync(e)}));else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};RE.registerPostcss=e=>{AE=e};var PE=RE;RE.default=RE,wE.registerLazyResult(RE),mE.registerLazyResult(RE);let TE=Bx,_E=YI,ME=uk,NE=cE;const LE=fk;let DE=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i=_E;this.result=new LE(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new TE(i,n,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||ME("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)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=NE;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var FE=DE;DE.default=DE;let UE=FE,jE=PE,BE=ak,zE=Kk,VE=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" 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.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new jE(this,e,t):new UE(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var WE=VE;VE.default=VE,zE.registerProcessor(VE),BE.registerProcessor(VE);let qE=ox,KE=fx,GE=Wx,ZE=Bk,YE=Rx,JE=Kk,$E=Hk;function HE(e,t){if(Array.isArray(e))return e.map((e=>HE(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:YE.prototype};r.map&&(r.map={...r.map,__proto__:KE.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>HE(e,t)))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new JE(n);if("decl"===n.type)return new qE(n);if("rule"===n.type)return new $E(n);if("comment"===n.type)return new GE(n);if("atrule"===n.type)return new ZE(n);throw new Error("Unknown node type: "+e.type)}var XE=HE;HE.default=HE;let QE=zI,eO=ox,tO=PE,rO=rk,nO=WE,iO=YI,oO=XE,sO=ak,aO=hk,lO=Wx,uO=Bk,cO=fk,hO=Rx,dO=cE,pO=Zk,fO=Hk,gO=Kk,mO=rx;function vO(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new nO(e)}vO.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new nO).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return vO([i(r)]).process(e,t)},i},vO.stringify=iO,vO.parse=dO,vO.fromJSON=oO,vO.list=pO,vO.comment=e=>new lO(e),vO.atRule=e=>new uO(e),vO.decl=e=>new eO(e),vO.rule=e=>new fO(e),vO.root=e=>new gO(e),vO.document=e=>new sO(e),vO.CssSyntaxError=QE,vO.Declaration=eO,vO.Container=rO,vO.Processor=nO,vO.Document=sO,vO.Comment=lO,vO.Warning=aO,vO.AtRule=uO,vO.Result=cO,vO.Input=hO,vO.Rule=fO,vO.Root=gO,vO.Node=mO,tO.registerPostcss(vO);var yO=vO;vO.default=vO;const bO=TI(yO);bO.stringify,bO.fromJSON,bO.plugin,bO.parse,bO.list,bO.document,bO.comment,bO.atRule,bO.rule,bO.decl,bO.root,bO.CssSyntaxError,bO.Declaration,bO.Container,bO.Processor,bO.Document,bO.Comment,bO.Warning,bO.AtRule,bO.Result,bO.Input,bO.Rule,bO.Root,bO.Node;class wO{constructor(...e){PI(this,"parentElement",null),PI(this,"parentNode",null),PI(this,"ownerDocument"),PI(this,"firstChild",null),PI(this,"lastChild",null),PI(this,"previousSibling",null),PI(this,"nextSibling",null),PI(this,"ELEMENT_NODE",1),PI(this,"TEXT_NODE",3),PI(this,"nodeType"),PI(this,"nodeName"),PI(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof wO))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const SO={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},CO={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},IO={};function xO(e){if(IO[e])return IO[e];const t=globalThis[e],r=t.prototype,n=e in SO?SO[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in CO?CO[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s&&!globalThis.Zone)return IO[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const i=n.contentWindow;if(!i)return t.prototype;const o=i[e].prototype;return document.body.removeChild(n),o?IO[e]=o:r}catch{return r}}const kO={};function EO(e,t,r){var n;const i=`${e}.${String(r)}`;if(kO[i])return kO[i].call(t);const o=xO(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(kO[i]=s,s.call(t)):t[r]}const OO={};function AO(e,t,r){const n=`${e}.${String(r)}`;if(OO[n])return OO[n].bind(t);const i=xO(e)[r];return"function"!=typeof i?t[r]:(OO[n]=i,i.bind(t))}function RO(){return xO("MutationObserver").constructor}const PO={childNodes:function(e){return EO("Node",e,"childNodes")},parentNode:function(e){return EO("Node",e,"parentNode")},parentElement:function(e){return EO("Node",e,"parentElement")},textContent:function(e){return EO("Node",e,"textContent")},contains:function(e,t){return AO("Node",e,"contains")(t)},getRootNode:function(e){return AO("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?EO("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?EO("Element",e,"shadowRoot"):null},querySelector:function(e,t){return EO("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return EO("Element",e,"querySelectorAll")(t)},mutationObserver:RO};function TO(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const _O="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.";let MO={map:{},getId:()=>(console.error(_O),-1),getNode:()=>(console.error(_O),null),removeNodeFromMap(){console.error(_O)},has:()=>(console.error(_O),!1),reset(){console.error(_O)}};function NO(e,t,r={}){let n=null,i=0;return function(...o){const s=Date.now();i||!1!==r.leading||(i=s);const a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)}),a))}}function LO(e,t,r,n,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>LO(e,t,o||{},!0)}function DO(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(MO=new Proxy(MO,{get:(e,t,r)=>("map"===t&&console.error(_O),Reflect.get(e,t,r))}));let FO=Date.now;function UO(e){var t,r,n,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=PO.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=PO.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function jO(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function BO(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function zO(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:PO.parentElement(e)}function VO(e,t,r,n){if(!e)return!1;const i=zO(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(Lb(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function WO(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function qO(e,t){if(ib(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=PO.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||qO(n,t))}function KO(e){return Boolean(e.changedTouches)}function GO(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function ZO(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function YO(e){return!!e&&(e instanceof wO&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(PO.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(FO=()=>(new Date).getTime());class JO{constructor(){qy(this,"id",1),qy(this,"styleIDMap",new WeakMap),qy(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function $O(e){var t;let r=null;return"getRootNode"in e&&(null==(t=PO.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&PO.host(PO.getRootNode(e))&&(r=PO.host(PO.getRootNode(e))),r}function HO(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=$O(r);)r=t;return r}(e);return PO.contains(t,r)}function XO(e){const t=e.ownerDocument;return!!t&&(PO.contains(t,e)||HO(e))}var QO=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(QO||{}),eA=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(eA||{}),tA=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(tA||{}),rA=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(rA||{}),nA=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(nA||{}),iA=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(iA||{}),oA=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(oA||{});function sA(e){return"__ln"in e}class aA{constructor(){qy(this,"length",0),qy(this,"head",null),qy(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&sA(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&sA(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const 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--)}}const lA=(e,t)=>`${e}@${t}`;class uA{constructor(){qy(this,"frozen",!1),qy(this,"locked",!1),qy(this,"texts",[]),qy(this,"attributes",[]),qy(this,"attributeMap",new WeakMap),qy(this,"removes",[]),qy(this,"mapRemoves",[]),qy(this,"movedMap",{}),qy(this,"addedSet",new Set),qy(this,"movedSet",new Set),qy(this,"droppedSet",new Set),qy(this,"removesSubTreeCache",new Set),qy(this,"mutationCb"),qy(this,"blockClass"),qy(this,"blockSelector"),qy(this,"maskTextClass"),qy(this,"maskTextSelector"),qy(this,"inlineStylesheet"),qy(this,"maskInputOptions"),qy(this,"maskTextFn"),qy(this,"maskInputFn"),qy(this,"keepIframeSrcFn"),qy(this,"recordCanvas"),qy(this,"inlineImages"),qy(this,"slimDOMOptions"),qy(this,"dataURLOptions"),qy(this,"doc"),qy(this,"mirror"),qy(this,"iframeManager"),qy(this,"stylesheetManager"),qy(this,"shadowDomManager"),qy(this,"canvasManager"),qy(this,"processedNodeManager"),qy(this,"unattachedDoc"),qy(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),qy(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new aA,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},i=i=>{const o=PO.parentNode(i);if(!o||!XO(i))return;let s=!1;if(i.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(s=!0)}const a=ib(o)?this.mirror.getId($O(i)):this.mirror.getId(o),l=n(i);if(-1===a||-1===l)return r.addNode(i);const u=jb(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{GO(e,this.mirror)&&this.iframeManager.addIframe(e),ZO(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),YO(i)&&this.shadowDomManager.addShadowRoot(PO.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});u&&(e.push({parentId:a,nextId:l,node:u}),t.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)hA(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(PO.parentNode(e))||i(e);for(const e of this.addedSet)dA(this.droppedSet,e)||hA(this.removesSubTreeCache,e,this.mirror)?dA(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(PO.parentNode(o.value)),r=n(o.value);-1!==t&&-1!==r&&(e=o)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(PO.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=PO.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=PO.host(n);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}o=e.previous,r.removeNode(e.value),i(e.value)}const s={texts:this.texts.map((e=>{const t=e.node,r=PO.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(s))})),qy(this,"genTextAreaValueMutation",(e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const r=Array.from(PO.childNodes(e),(e=>PO.textContent(e)||"")).join("");t.attributes.value=ub({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:db(e),value:r,maskInputFn:this.maskInputFn})})),qy(this,"processMutation",(e=>{if(!WO(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=PO.textContent(e.target);VO(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Db(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,zO(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,n=e.target.getAttribute(r);if("value"===r){const e=db(t);n=ub({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(VO(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!Nb(t.tagName,r))if(i.attributes[r]=Mb(this.doc,cb(t.tagName),cb(r),n),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?n:[n,o]:i._unchangedStyles[e]=[n,o]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(VO(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const r=this.mirror.getId(t),n=ib(e.target)?this.mirror.getId(PO.host(e.target)):this.mirror.getId(e.target);VO(e.target,this.blockClass,this.blockSelector,!1)||WO(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(cA(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||qO(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[lA(r,n)]?cA(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!ib(e.target)||!ob(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),PO.childNodes(e).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),qy(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(WO(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[lA(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);VO(e,this.blockClass,this.blockSelector,!1)||(PO.childNodes(e).forEach((e=>this.genAdds(e))),YO(e)&&PO.childNodes(PO.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function cA(e,t){e.delete(t),PO.childNodes(t).forEach((t=>cA(e,t)))}function hA(e,t,r){return 0!==e.size&&function(e,t){const r=PO.parentNode(t);return!!r&&e.has(r)}(e,t)}function dA(e,t){return 0!==e.size&&pA(e,t)}function pA(e,t){const r=PO.parentNode(t);return!!r&&(!!e.has(r)||pA(e,r))}let fA;const gA=e=>{if(!fA)return e;return(...t)=>{try{return e(...t)}catch(e){if(fA&&!0===fA(e))return;throw e}}};function mA(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const vA=[];function yA(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function bA(e,t){const r=new uA;vA.push(r),r.init(e);const n=new(RO())(gA(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function wA({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(tA).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((o=>{let s=cb(o);const u=(t=>o=>{const s=yA(o);if(VO(s,n,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=rA.Mouse;break;case"touch":a=rA.Touch;break;case"pen":a=rA.Pen}a===rA.Touch?tA[t]===tA.MouseDown?u="TouchStart":tA[t]===tA.MouseUp&&(u="TouchEnd"):rA.Pen}else KO(o)&&(a=rA.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===rA.Touch||u.startsWith("Mouse")&&a===rA.Mouse)&&(a=null)):tA[t]===tA.Click&&(a=l,l=null);const c=KO(o)?o.changedTouches[0]:o;if(!c)return;const h=r.getId(s),{clientX:d,clientY:p}=c;gA(e)({type:tA[u],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(tA[o]){case tA.MouseDown:case tA.MouseUp:s=s.replace("mouse","pointer");break;case tA.TouchStart:case tA.TouchEnd:return}a.push(TO(s,u,t))})),gA((()=>{a.forEach((e=>e()))}))}function SA({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const s=gA(NO(gA((o=>{const s=yA(o);if(!s||VO(s,n,i,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=UO(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})})),o.scroll||100));return TO("scroll",s,t)}const CA=["INPUT","TEXTAREA","SELECT"],IA=new WeakMap;function xA(e){return function(e,t){if(AA("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||AA("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||AA("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||AA("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function kA(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function EA({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(PO.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(o=null==(i=r.ownerDocument)?void 0:i.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var r;const n=null==(r=l.set)?void 0:r.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return n}}),gA((()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function OA(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:d,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),c(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(n=bA(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const l=NO(gA((t=>{const r=Date.now()-s;e(a.map((e=>(e.timeOffset-=r,e))),t),a=[],s=null})),o),u=gA(NO(gA((e=>{const t=yA(e),{clientX:r,clientY:i}=KO(e)?e.changedTouches[0]:e;s||(s=FO()),a.push({x:r,y:i,id:n.getId(t),timeOffset:FO()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?eA.Drag:e instanceof MouseEvent?eA.MouseMove:eA.TouchMove)})),i,{trailing:!1})),c=[TO("mousemove",u,r),TO("touchmove",u,r),TO("drag",u,r)];return gA((()=>{c.forEach((e=>e()))}))}(e),o=wA(e),s=SA(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return TO("resize",gA(NO(gA((()=>{const t=jO(),i=BO();r===t&&n===i||(e({width:Number(i),height:Number(t)}),r=t,n=i)})),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(e){let r=yA(e);const u=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=PO.parentElement(r)),!r||!h||CA.indexOf(h)<0||VO(r,n,i,!0))return;if(r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,f=!1;const g=db(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=ub({element:r,maskInputOptions:a,tagName:h,type:g,value:p,maskInputFn:l})),d(r,c?{text:p,isChecked:f,userTriggered:u}:{text:p,isChecked:f});const m=r.name;"radio"===g&&m&&f&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==r){const t=e.value;d(e,c?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}}))}function d(t,n){const i=IA.get(t);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){IA.set(t,n);const i=r.getId(t);gA(e)({...n,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map((e=>TO(e,gA(h),t))),f=t.defaultView;if(!f)return()=>{p.forEach((e=>e()))};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...m.map((e=>LO(e[0],e[1],{set(){gA(h)({target:this,isTrusted:!1})}},!1,f)))),gA((()=>{p.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const s=gA((o=>NO(gA((i=>{const s=yA(i);if(!s||VO(s,t,r,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=s;e({type:o,id:n.getId(s),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})})),i.media||500))),a=[TO("play",s(iA.Play),o),TO("pause",s(iA.Pause),o),TO("seeked",s(iA.Seeked),o),TO("volumechange",s(iA.VolumeChange),o),TO("ratechange",s(iA.RateChange),o)];return gA((()=>{a.forEach((e=>e()))}))}(e);let c=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(c=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:gA(((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=kA(i,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),mA((()=>n.apply(i,o)))()}))}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const i=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};const o=n.CSSStyleSheet.prototype.deleteRule;let s,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:gA(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=kA(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),mA((()=>n.apply(i,o)))()}))}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:gA(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=kA(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:s}),n.apply(i,o)}))})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:gA(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=kA(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),n.apply(i,o)}))}));const l={};RA("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(RA("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),RA("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),RA("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const u={};return Object.entries(l).forEach((([n,i])=>{u[n]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(u[n].insertRule,{apply:gA(((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=kA(i.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...xA(i),a||0]}]}),n.apply(i,o)}))}),i.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:gA(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=kA(i.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...xA(i),s]}]}),n.apply(i,o)}))})})),gA((()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach((([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule}))}))}(e,{win:r}),h=EA(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:gA(((i,s,a)=>{var l;const[u,c,h]=a;if(r.has(u))return o.apply(s,[u,c,h]);const{id:d,styleId:p}=kA(null==(l=s.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:u,value:c,priority:h},index:xA(s.parentRule)}),i.apply(s,a)}))});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:gA(((i,o,a)=>{var l;const[u]=a;if(r.has(u))return s.apply(o,[u]);const{id:c,styleId:h}=kA(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||h&&-1!==h)&&e({id:c,styleId:h,remove:{property:u},index:xA(o.parentRule)}),i.apply(o,a)}))}),gA((()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s}))}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const n=new o(e,t,r);return i.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const s=DO(t.fonts,"add",(function(t){return function(r){return setTimeout(gA((()=>{const t=i.get(r);t&&(e(t),i.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{r.FontFace=o})),n.push(s),gA((()=>{n.forEach((e=>e()))}))}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e;let s=!0;const a=gA((()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:u,endOffset:c}=o;VO(s,n,i,!0)||VO(u,n,i,!0)||a.push({start:r.getId(s),startOffset:l,end:r.getId(u),endOffset:c})}o({ranges:a})}));return a(),TO("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?DO(r.customElements,"define",(function(e){return function(r,n,i){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,i])}})):()=>{}}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,r,t.options));return gA((()=>{vA.forEach((e=>e.reset())),null==n||n.disconnect(),i(),o(),s(),a(),l(),u(),c(),h(),d(),p(),f(),g(),m.forEach((e=>e()))}))}function AA(e){return void 0!==window[e]}function RA(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class PA{constructor(e){qy(this,"iframeIdToRemoteIdMap",new WeakMap),qy(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const i=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=n.get(t);return i||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class TA{constructor(e){qy(this,"iframes",new WeakMap),qy(this,"crossOriginIframeMap",new WeakMap),qy(this,"crossOriginIframeMirror",new PA(xb)),qy(this,"crossOriginIframeStyleMirror"),qy(this,"crossOriginIframeRootIdMap",new WeakMap),qy(this,"mirror"),qy(this,"mutationCb"),qy(this,"wrappedEmit"),qy(this,"loadListener"),qy(this,"stylesheetManager"),qy(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new PA(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case QO.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:QO.IncrementalSnapshot,data:{source:eA.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case QO.Meta:case QO.Load:case QO.DomContentLoaded:return!1;case QO.Plugin:return t;case QO.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case QO.IncrementalSnapshot:switch(t.data.source){case eA.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case eA.Drag:case eA.TouchMove:case eA.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case eA.ViewportResize:return!1;case eA.MediaInteraction:case eA.MouseInteraction:case eA.Scroll:case eA.CanvasMutation:case eA.Input:return this.replaceIds(t.data,e,["id"]),t;case eA.StyleSheetRule:case eA.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case eA.Font:return t;case eA.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case eA.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(const i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===oA.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class _A{constructor(e){qy(this,"shadowDoms",new WeakSet),qy(this,"mutationCb"),qy(this,"scrollCb"),qy(this,"bypassOptions"),qy(this,"mirror"),qy(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!ob(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=bA({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(SA({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(PO.host(e))),this.restoreHandlers.push(EA({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(DO(e.prototype,"attachShadow",(function(e){return function(n){const i=e.call(this,n),o=PO.shadowRoot(this);return o&&XO(this)&&r.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var MA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",NA="undefined"==typeof Uint8Array?[]:new Uint8Array(256),LA=0;LA<64;LA++)NA[MA.charCodeAt(LA)]=LA;const DA=new Map;const FA=(e,t,r)=>{if(!e||!BA(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=DA.get(e);return r||(r=new Map,DA.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i};function UA(e,t,r){if(e instanceof Array)return e.map((e=>UA(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=MA[r[t]>>2],i+=MA[(3&r[t])<<4|r[t+1]>>4],i+=MA[(15&r[t+1])<<2|r[t+2]>>6],i+=MA[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[UA(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[UA(e.data,t,r),e.width,e.height]}}if(BA(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:FA(e,t,r)}}return e}const jA=(e,t,r)=>e.map((e=>UA(e,t,r))),BA=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function zA(e,t,r,n){const i=[];try{const o=DO(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i,...o){if(!VO(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}}));i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function VA(e,t,r,n,i,o){const s=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=DO(e,l,(function(e){return function(...s){const a=e.apply(this,s);if(FA(a,o,this),"tagName"in this.canvas&&!VO(this.canvas,n,i,!0)){const e=jA(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}}));s.push(a)}catch{const n=LO(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(n)}return s}const WA="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",qA="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))(WA)],{type:"text/javascript;charset=utf-8"});function KA(e){let t;try{if(t=qA&&(window.URL||window.webkitURL).createObjectURL(qA),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+WA,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class GA{constructor(e){qy(this,"pendingCanvasMutations",new Map),qy(this,"rafStamps",{latestId:0,invokeId:null}),qy(this,"mirror"),qy(this,"mutationCb"),qy(this,"resetObservers"),qy(this,"frozen",!1),qy(this,"locked",!1),qy(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));const{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,n,i){const o=zA(t,r,n,!0),s=new Map,a=new KA;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:i,height:o}=e.data;this.mutationCb({id:t,type:nA["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let u,c=0;const h=e=>{c&&e-c<l||(c=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{VO(t,r,n,!0)||e.push(t)})),e})().forEach((async e=>{var t;const r=this.mirror.getId(e);if(s.get(r))return;if(0===e.width||0===e.height)return;if(s.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const n=await createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[n])}))),u=requestAnimationFrame(h)};u=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=zA(e,t,r,!1),i=function(e,t,r,n){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const o=DO(t.CanvasRenderingContext2D.prototype,s,(function(i){return function(...o){return VO(this.canvas,r,n,!0)||setTimeout((()=>{const r=jA(o,t,this);e(this.canvas,{type:nA["2D"],property:s,args:r})}),0),i.apply(this,o)}}));i.push(o)}catch{const r=LO(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:nA["2D"],property:s,args:[t],setter:!0})}});i.push(r)}return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){const i=[];return i.push(...VA(t.WebGLRenderingContext.prototype,nA.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...VA(t.WebGL2RenderingContext.prototype,nA.WebGL2,e,r,n,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map((e=>{const{type:t,...r}=e;return r})),{type:i}=r[0];this.mutationCb({id:t,type:i,commands:n}),this.pendingCanvasMutations.delete(e)}}class ZA{constructor(e){qy(this,"trackedLinkElements",new WeakSet),qy(this,"mutationCb"),qy(this,"adoptedStyleSheetCb"),qy(this,"styleMirror",new JO),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:ab(e,t.href),index:r})))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class YA{constructor(){qy(this,"nodeMap",new WeakMap),qy(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let JA,$A,HA,XA=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(zy=e.contentWindow)?void 0:zy.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const QA=new lb;function eR(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:g,hooks:m,packFn:v,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:k=!1,collectFonts:E=!1,inlineImages:O=!1,plugins:A,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:T,applyBackgroundColorToBlockedElements:_=!1}=e;fA=T;const M=!I||window.parent===window;let N=!1;if(!M)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(M&&!t)throw new Error("emit function is required");if(!M&&!N)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),QA.reset();const L=!0===h?{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!==d?d:{password:!0},D=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let F;!function(e=window){"NodeList"in e&&!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)}();let U=0;const j=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!N&&(e=v(e)),e};JA=(e,i)=>{var o;const s=e;if(s.timestamp=FO(),!(null==(o=vA[0])?void 0:o.isFrozen())||s.type===QO.FullSnapshot||s.type===QO.IncrementalSnapshot&&s.data.source===eA.Mutation||vA.forEach((e=>e.unfreeze())),M)null==t||t(j(s),i);else if(N){const e={type:"rrweb",event:j(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===QO.FullSnapshot)F=s,U=0;else if(s.type===QO.IncrementalSnapshot){if(s.data.source===eA.Mutation&&s.data.isAttachIframe)return;U++;const e=n&&U>=n,t=r&&s.timestamp-F.timestamp>r;(e||t)&&$A(!0)}};const B=e=>{JA({type:QO.IncrementalSnapshot,data:{source:eA.Mutation,...e}})},z=e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.Scroll,...e}}),V=e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.CanvasMutation,...e}}),W=new ZA({mutationCb:B,adoptedStyleSheetCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.AdoptedStyleSheet,...e}})}),q=new TA({mirror:QA,mutationCb:B,stylesheetManager:W,recordCrossOriginIframes:I,wrappedEmit:JA});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:QA,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});const K=new YA;HA=new GA({recordCanvas:C,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:QA,sampling:y.canvas,dataURLOptions:b});const G=new _A({mutationCb:B,scrollCb:z,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:L,dataURLOptions:b,maskTextFn:g,maskInputFn:f,recordCanvas:C,inlineImages:O,sampling:y,slimDOMOptions:D,iframeManager:q,stylesheetManager:W,canvasManager:HA,keepIframeSrcFn:R,processedNodeManager:K},mirror:QA});$A=(e=!1)=>{if(!S)return;JA({type:QO.Meta,data:{href:window.location.href,width:BO(),height:jO()}},e),W.reset(),G.init(),vA.forEach((e=>e.lock()));const t=function(e,t){const{mirror:r=new lb,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:d,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:S=()=>!1,applyBackgroundColorToBlockedElements:C=!1}=t||{};return jb(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{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===c?{password:!0}:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:S,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:C})}(document,{mirror:QA,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:L,maskTextFn:g,maskInputFn:f,slimDOM:D,dataURLOptions:b,recordCanvas:C,inlineImages:O,applyBackgroundColorToBlockedElements:_,onSerialize:e=>{GO(e,QA)&&q.addIframe(e),ZO(e,QA)&&W.trackLinkElement(e),YO(e)&&G.addShadowRoot(PO.shadowRoot(e),document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{W.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");JA({type:QO.FullSnapshot,data:{node:t,initialOffset:UO(window)}},e),vA.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,QA.getId(document))};try{const e=[],t=e=>{var t;return gA(OA)({mutationCb:B,mousemoveCb:(e,t)=>JA({type:QO.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.ViewportResize,...e}}),inputCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.Input,...e}}),mediaInteractionCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.MediaInteraction,...e}}),styleSheetRuleCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.StyleSheetRule,...e}}),styleDeclarationCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>JA({type:QO.IncrementalSnapshot,data:{source:eA.Font,...e}}),selectionCb:e=>{JA({type:QO.IncrementalSnapshot,data:{source:eA.Selection,...e}})},customElementCb:e=>{JA({type:QO.IncrementalSnapshot,data:{source:eA.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:L,inlineStylesheet:c,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:O,userTriggeredOnInput:k,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:D,dataURLOptions:b,mirror:QA,iframeManager:q,stylesheetManager:W,shadowDomManager:G,processedNodeManager:K,canvasManager:HA,ignoreCSSAttributes:P,plugins:(null==(t=null==A?void 0:A.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>JA({type:QO.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};q.addLoadListener((r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}}));const r=()=>{$A(),e.push(t(document)),XA=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(TO("DOMContentLoaded",(()=>{JA({type:QO.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&r()}))),e.push(TO("load",(()=>{JA({type:QO.Load,data:{}}),"load"===x&&r()}),window))),()=>{e.forEach((e=>e())),K.destroy(),XA=!1,fA=void 0}}catch(e){console.warn(e)}}var tR;eR.addCustomEvent=(e,t)=>{if(!XA)throw new Error("please add custom event after start recording");JA({type:QO.Custom,data:{tag:e,payload:t}})},eR.freezePage=()=>{vA.forEach((e=>e.freeze()))},eR.takeFullSnapshot=e=>{if(!XA)throw new Error("please take full snapshot after start recording");$A(e)},eR.mirror=QA,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(tR||(tR={}));var rR=Object.freeze({__proto__:null,record:eR}),nR=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e){this.eventCallback=e,this.observeFetch()},e.prototype.stop=function(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0},e.prototype.notifyEvent=function(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=E();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return a(e,void 0,void 0,(function(){var e,i,o,s,a,u,c;return l(this,(function(l){switch(l.label){case 0:e=Date.now(),i={timestamp:e,type:"fetch",method:(null==n?void 0:n.method)||"GET",url:t.toString(),requestHeaders:null==n?void 0:n.headers},l.label=1;case 1:return l.trys.push([1,3,,4]),[4,r(t,n)];case 2:return o=l.sent(),u=Date.now(),i.status=o.status,i.duration=u-e,s={},o.headers.forEach((function(e,t){s[t]=e})),i.responseHeaders=s,this.notifyEvent(i),[2,o];case 3:throw a=l.sent(),u=Date.now(),i.duration=u-e,c=a,i.error={name:c.name||"UnknownError",message:c.message||"An unknown error occurred"},this.notifyEvent(i),a;case 4:return[2]}}))}))},this.fetchObserver=function(){t.fetch=r})}},e}(),iR=Object.freeze({__proto__:null,NetworkObservers:nR});e.Types=Qi,e.add=Vu,e.createInstance=Fu,e.experiment=Bu,e.extendSession=Wu,e.flush=qu,e.getDeviceId=Ku,e.getSessionId=Gu,e.getUserId=Zu,e.groupIdentify=Yu,e.identify=Ju,e.initAll=ju,e.logEvent=$u,e.remove=Hu,e.reset=Xu,e.revenue=Qu,e.sessionReplay=zu,e.setDeviceId=ec,e.setGroup=tc,e.setOptOut=rc,e.setSessionId=nc,e.setTransport=ic,e.setUserId=oc,e.track=sc,Object.defineProperty(e,"__esModule",{value:!0})}));